|
|
@@ -26,6 +26,12 @@
|
|
|
{{ row.code }}
|
|
|
</el-link>
|
|
|
</template>
|
|
|
+
|
|
|
+ <!-- <template v-slot:groupName="{ row }">
|
|
|
+ <el-table-column prop="zip" label="部门">
|
|
|
+ {{ row.groupName }}
|
|
|
+ </el-table-column>
|
|
|
+ </template> -->
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link
|
|
|
@@ -76,17 +82,22 @@
|
|
|
import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
export default {
|
|
|
+ props: {
|
|
|
+ ruleType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
|
PatrolSearch,
|
|
|
// AddPatrolConfigDialog,
|
|
|
ProgramRulesDialog
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- addProgramRulesDialog: false,
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
+ computed: {
|
|
|
+ columns() {
|
|
|
+ return [
|
|
|
{
|
|
|
columnKey: 'index',
|
|
|
label: '序号',
|
|
|
@@ -111,13 +122,25 @@
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'groupName',
|
|
|
- label: '巡点检部门',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
+ ...[
|
|
|
+ this.ruleType == 1
|
|
|
+ ? {
|
|
|
+ prop: 'groupName',
|
|
|
+ label: '巡点检部门',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'groupName'
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ prop: 'groupName',
|
|
|
+ label: '部门',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'groupName'
|
|
|
+ }
|
|
|
+ ],
|
|
|
{
|
|
|
prop: 'categoryName',
|
|
|
label: '设备分类',
|
|
|
@@ -180,7 +203,14 @@
|
|
|
slot: 'action',
|
|
|
showOverflowTooltip: true
|
|
|
}
|
|
|
- ],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ addProgramRulesDialog: false,
|
|
|
+ // 表格列配置
|
|
|
+
|
|
|
// 加载状态
|
|
|
loading: false,
|
|
|
pageType: 'add',
|
|
|
@@ -188,7 +218,7 @@
|
|
|
isBindPlan: false
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+
|
|
|
created() {
|
|
|
this.requestDict('规则状态');
|
|
|
},
|
|
|
@@ -202,7 +232,7 @@
|
|
|
groupId: where.groupId == null ? '' : where.groupId,
|
|
|
categoryLevelId:
|
|
|
where.categoryLevelId == null ? '' : where.categoryLevelId,
|
|
|
- ruleType: 1
|
|
|
+ ruleType: parseInt(this.ruleType)
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -210,19 +240,28 @@
|
|
|
reload(where) {
|
|
|
console.log('刷新表格');
|
|
|
this.addProgramRulesDialog = false;
|
|
|
- this.$refs.table.reload({ page: 1, where, ruleType: 1 });
|
|
|
+ this.$refs.table.reload({
|
|
|
+ page: 1,
|
|
|
+ where,
|
|
|
+ ruleType: parseInt(this.ruleType)
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
openEdit(row) {
|
|
|
this.isBindPlan = false;
|
|
|
this.addProgramRulesDialog = true;
|
|
|
if (row) {
|
|
|
- this.dialogTitle = '编辑巡点检计划配置';
|
|
|
+ this.dialogTitle =
|
|
|
+ this.ruleType == 1 ? '编辑巡点检计划配置' : '编辑运行记录配置';
|
|
|
} else {
|
|
|
- this.dialogTitle = '新增巡点检计划配置';
|
|
|
+ this.dialogTitle =
|
|
|
+ this.ruleType == 1 ? '新增巡点检计划配置' : '新增运行记录配置';
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.programRulesDialog.init(row, '巡点检');
|
|
|
+ this.$refs.programRulesDialog.init(
|
|
|
+ row,
|
|
|
+ this.ruleType == 1 ? '巡点检' : '运行记录'
|
|
|
+ );
|
|
|
});
|
|
|
},
|
|
|
|