|
|
@@ -1,36 +1,35 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
- <el-card shadow="never" v-loading="loading">
|
|
|
- <plan-search @search="reload">
|
|
|
- </plan-search>
|
|
|
- <!-- 数据表格 -->
|
|
|
- <ele-pro-table
|
|
|
- ref="table"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- cache-key="systemRoleTable"
|
|
|
- >
|
|
|
- <!-- 表头工具栏 -->
|
|
|
- <template v-slot:toolbar>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="openEdit()"
|
|
|
- >
|
|
|
- 新建临时计划
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="goDetail()"
|
|
|
- >
|
|
|
- 详情
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
-<!-- <template v-slot:enable="{ row }">
|
|
|
+ <el-card shadow="never" v-loading="loading">
|
|
|
+ <plan-search @search="reload"> </plan-search>
|
|
|
+ <!-- 数据表格 -->
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ cache-key="systemRoleTable"
|
|
|
+ >
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="openEdit()"
|
|
|
+ >
|
|
|
+ 新建临时计划
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="goDetail()"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <!-- <template v-slot:enable="{ row }">
|
|
|
<el-switch
|
|
|
v-model="row.enable"
|
|
|
active-color="#13ce66"
|
|
|
@@ -41,21 +40,21 @@
|
|
|
>
|
|
|
</el-switch>
|
|
|
</template> -->
|
|
|
- <!-- 操作列 -->
|
|
|
- <template v-slot:action="{ row }">
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="openEdit(row)"
|
|
|
- >
|
|
|
- 撤回
|
|
|
- </el-link>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- </el-card>
|
|
|
-
|
|
|
- <!-- 新建或编辑弹窗 -->
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="openEdit(row)"
|
|
|
+ >
|
|
|
+ 撤回
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- 新建或编辑弹窗 -->
|
|
|
<AddPatrolPlanDialog
|
|
|
ref="addPatrolPlanDialogRef"
|
|
|
:dialogTitle="dialogTitle"
|
|
|
@@ -65,120 +64,118 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import AddPatrolPlanDialog from '@/components/addPatrolPlanDialog'
|
|
|
+ import AddPatrolPlanDialog from '@/components/addPatrolPlanDialog';
|
|
|
import PlanSearch from './components/plan-search.vue';
|
|
|
- import { pageRoles } from '@/api/system/role';
|
|
|
+ import { getPage } from '@/api/maintenance/patrol_maintenance';
|
|
|
export default {
|
|
|
components: {
|
|
|
PlanSearch,
|
|
|
- AddPatrolPlanDialog
|
|
|
+ AddPatrolPlanDialog
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '计划单号',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'groupId',
|
|
|
- label: '计划名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'enable',
|
|
|
- label: '计划规则',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- slot: 'enable',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '设备分类',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'cycle',
|
|
|
- label: '设备性质',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'auto',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '审批人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'creater',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '生成时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 230,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ],
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '计划单号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'groupId',
|
|
|
+ label: '计划名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'enable',
|
|
|
+ label: '计划规则',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ slot: 'enable',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '设备分类',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'cycle',
|
|
|
+ label: '设备性质',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'auto',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '审批人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'creater',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '生成时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 230,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
// 加载状态
|
|
|
loading: false,
|
|
|
pageType: 'add',
|
|
|
dialogTitle: '',
|
|
|
- isBindPlan:false,
|
|
|
+ isBindPlan: false
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
-
|
|
|
- },
|
|
|
+ computed: {},
|
|
|
methods: {
|
|
|
/* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return pageRoles({ pageNum: page, size: limit, ...where });
|
|
|
+ datasource ({ page, limit, where, order }) {
|
|
|
+ return getPage({ pageNum: page, size: limit, ...where });
|
|
|
},
|
|
|
- async changeEnable(row) {
|
|
|
+ async changeEnable (row) {
|
|
|
const res = await putRoles(row);
|
|
|
if (res.code == 0) {
|
|
|
this.$message({
|
|
|
@@ -190,28 +187,25 @@
|
|
|
}
|
|
|
},
|
|
|
/* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
+ reload (where) {
|
|
|
this.$refs.table.reload({ page: 1, where });
|
|
|
},
|
|
|
-
|
|
|
- openEdit(row){
|
|
|
- this.$refs.addPatrolPlanDialogRef.addPatrolPlanDialog = true
|
|
|
- this.dialogTitle = '新增巡点检计划'
|
|
|
- },
|
|
|
-
|
|
|
- goDetail(){
|
|
|
- this.$router.push({
|
|
|
- path: '/maintenance/patrol/plan/details',
|
|
|
- // query: {
|
|
|
- // id
|
|
|
- // }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ openEdit (row) {
|
|
|
+ this.$refs.addPatrolPlanDialogRef.addPatrolPlanDialog = true;
|
|
|
+ this.dialogTitle = '新增巡点检计划';
|
|
|
+ },
|
|
|
+
|
|
|
+ goDetail () {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/maintenance/patrol/plan/details'
|
|
|
+ // query: {
|
|
|
+ // id
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style lang="scss" scoped></style>
|