yusheng пре 1 година
родитељ
комит
7d8eca02e2

+ 179 - 53
src/views/bpm/taskAssignRule/taskAssignRuleDialog.vue

@@ -56,7 +56,7 @@
           v-if="modelId"
           label="操作"
           align="center"
-          width="80"
+          width="250"
           fixed="right"
         >
           <template v-slot="scope">
@@ -65,19 +65,21 @@
               type="text"
               icon="el-icon-edit"
               @click="handleUpdateTaskAssignRule(scope.row)"
-              >修改</el-button
+              >修改任务规则</el-button
+            >
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit"
+              @click="ccHandleUpdateTaskAssignRule(scope.row)"
+              >修改抄送规则</el-button
             >
           </template>
         </el-table-column>
       </el-table>
     </el-dialog>
     <!-- 添加/修改弹窗 -->
-    <el-dialog
-      title="修改任务规则"
-      :visible.sync="open"
-      width="500px"
-      append-to-body
-    >
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form
         ref="taskAssignRuleForm"
         :model="form"
@@ -92,7 +94,7 @@
         </el-form-item>
         <el-form-item label="规则类型" prop="type">
           <el-select
-            v-model="form.type"
+            v-model="form.typeS"
             clearable
             style="width: 100%"
             @change="emptyingRules"
@@ -107,7 +109,7 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item v-if="form.type === 10" label="指定角色" prop="roleIds">
+        <el-form-item v-if="form.typeS === 10" label="指定角色" prop="roleIds">
           <el-select
             v-model="form.roleIds"
             multiple
@@ -123,7 +125,7 @@
           </el-select>
         </el-form-item>
         <el-form-item
-          v-if="form.type === 20 || form.type === 21"
+          v-if="form.typeS === 20 || form.typeS === 21"
           label="指定部门"
           prop="deptIds"
         >
@@ -138,7 +140,7 @@
           />
         </el-form-item>
         <el-form-item
-          v-if="form.type === 22"
+          v-if="form.typeS === 22"
           label="指定工种"
           prop="workTypeIds"
         >
@@ -157,7 +159,7 @@
           </el-select>
         </el-form-item>
         <el-form-item
-          v-if="form.type === 30 || form.type === 31 || form.type === 32"
+          v-if="form.typeS === 30 || form.typeS === 31 || form.typeS === 32"
           label="指定用户"
           prop="userIds"
         >
@@ -195,7 +197,7 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item v-if="form.type === 50" label="指定脚本" prop="scripts">
+        <el-form-item v-if="form.typeS === 50" label="指定脚本" prop="scripts">
           <el-select
             v-model="form.scripts"
             multiple
@@ -212,33 +214,41 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item v-if="form.type === 70" label="审核方向" prop="direction">
+        <el-form-item
+          v-if="form.typeS === 70 && title != '修改抄送规则'"
+          label="审核方向"
+          prop="direction"
+        >
           <el-select
             v-model="form.direction"
             clearable
             style="width: 100%"
             @change="handleChangeDirection"
           >
-            <el-option key="0" label="从下到上" value="0"/>
-            <el-option key="1" label="从上到下" value="1"/>
+            <el-option key="0" label="从下到上" value="0" />
+            <el-option key="1" label="从上到下" value="1" />
           </el-select>
         </el-form-item>
-        <el-form-item v-if="form.type === 70" label="指定部门负责人" prop="topLevel">
+        <el-form-item
+          v-if="form.typeS === 70 && title != '修改抄送规则'"
+          label="指定部门负责人"
+          prop="topLevel"
+        >
           <el-select
-            v-if="form.direction==0"
+            v-if="form.direction == 0"
             v-model="form.topLevel"
             clearable
             style="width: 100%"
           >
-            <el-option key="1" label="直接部门负责人" value="1"/>
-            <el-option key="2" label="上二级部门负责人" value="2"/>
-            <el-option key="3" label="上三级部门负责人" value="3"/>
-            <el-option key="4" label="上四级部门负责人" value="4"/>
-            <el-option key="5" label="上五级部门负责人" value="5"/>
-            <el-option key="6" label="上六级部门负责人" value="6"/>
-            <el-option key="7" label="上七级部门负责人" value="7"/>
-            <el-option key="8" label="上八级部门负责人" value="8"/>
-            <el-option key="9" label="上九级部门负责人" value="9"/>
+            <el-option key="1" label="直接部门负责人" value="1" />
+            <el-option key="2" label="上二级部门负责人" value="2" />
+            <el-option key="3" label="上三级部门负责人" value="3" />
+            <el-option key="4" label="上四级部门负责人" value="4" />
+            <el-option key="5" label="上五级部门负责人" value="5" />
+            <el-option key="6" label="上六级部门负责人" value="6" />
+            <el-option key="7" label="上七级部门负责人" value="7" />
+            <el-option key="8" label="上八级部门负责人" value="8" />
+            <el-option key="9" label="上九级部门负责人" value="9" />
           </el-select>
           <el-select
             v-else
@@ -246,19 +256,19 @@
             clearable
             style="width: 100%"
           >
-            <el-option key="99" label="最高级部门负责人" value="99"/>
-            <el-option key="2" label="第二层部门负责人" value="2"/>
-            <el-option key="3" label="第三层部门负责人" value="3"/>
-            <el-option key="4" label="第四层部门负责人" value="4"/>
-            <el-option key="5" label="第五层部门负责人" value="5"/>
-            <el-option key="6" label="第六层部门负责人" value="6"/>
-            <el-option key="7" label="第七层部门负责人" value="7"/>
-            <el-option key="8" label="第八层部门负责人" value="8"/>
-            <el-option key="9" label="第九层部门负责人" value="9"/>
+            <el-option key="99" label="最高级部门负责人" value="99" />
+            <el-option key="2" label="第二层部门负责人" value="2" />
+            <el-option key="3" label="第三层部门负责人" value="3" />
+            <el-option key="4" label="第四层部门负责人" value="4" />
+            <el-option key="5" label="第五层部门负责人" value="5" />
+            <el-option key="6" label="第六层部门负责人" value="6" />
+            <el-option key="7" label="第七层部门负责人" value="7" />
+            <el-option key="8" label="第八层部门负责人" value="8" />
+            <el-option key="9" label="第九层部门负责人" value="9" />
           </el-select>
         </el-form-item>
         <el-form-item
-          v-if="form.type === 60"
+          v-if="form.typeS === 60"
           label="自定义变量"
           prop="variableName"
         >
@@ -271,9 +281,19 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitAssignRuleForm"
+        <el-button
+          type="primary"
+          @click="submitAssignRuleForm"
+          v-if="title == '修改任务规则'"
           >确 定</el-button
         >
+        <el-button
+          type="primary"
+          @click="ccSubmitAssignRuleForm"
+          v-if="title == '修改抄送规则'"
+          >确 定</el-button
+        >
+
         <el-button @click="cancelAssignRuleForm">取 消</el-button>
       </div>
     </el-dialog>
@@ -318,7 +338,7 @@
         modelId: undefined, // 流程模型的编号。如果 modelId 非空,则用于流程模型的查看与配置
         processDefinitionId: undefined, // 流程定义的编号。如果 processDefinitionId 非空,则用于流程定义的查看,不支持配置
         visible: false,
-
+        title: '',
         // 任务分配规则表单
         row: undefined, // 选中的流程模型
         list: [], // 选中流程模型的任务分配规则们
@@ -410,8 +430,8 @@
         // 获得岗位列表 暂无岗位概念
         this.postOptions = [];
         /*listSimplePosts().then(response => {
-        this.postOptions.push(...response.data);
-      });*/
+          this.postOptions.push(...response.data);
+        });*/
         // 获得用户列表
         this.userOptions = [];
         listAllUserBind().then((data) => {
@@ -474,23 +494,66 @@
 
       // 选择规则清空上一次选择内容
       emptyingRules(val) {
-        this.form.options = [];
+        if (this.title == '修改任务规则') {
+          this.form.options = [];
+          this.form.variableName = '';
+          this.$set(this.form, 'direction', val == '70' ? '0' : '');
+          this.$set(this.form, 'topLevel', val == '70' ? '1' : '');
+        } else {
+          this.form.ccOptions = [];
+          this.form.ccVariableName = '';
+        }
         this.form.roleIds = [];
         this.form.deptIds = [];
         this.form.workTypeIds = [];
         this.form.userIds = [];
         this.form.userGroupIds = [];
         this.form.scripts = [];
-        this.form.variableName = '';
-        this.$set(this.form,'direction',val=='70'?'0':'')
-        this.$set(this.form,'topLevel',val=='70'?'1':'')
       },
       // 选择规则清空上一次选择内容
       handleChangeDirection(val) {
-        this.$set(this.form,'topLevel',val=='0'?'1':'99')
+        this.$set(this.form, 'topLevel', val == '0' ? '1' : '99');
+      },
+      /** 处理修改抄送 分配规则的按钮操作 */
+      ccHandleUpdateTaskAssignRule(row) {
+        this.title = '修改抄送规则';
+        // 先重置标识
+        this.resetAssignRuleForm();
+        // 设置表单
+        this.form = {
+          ...row,
+          ccOptions: [],
+          roleIds: [],
+          deptIds: [],
+          workTypeIds: [],
+          userIds: [],
+          userGroupIds: [],
+          scripts: []
+        };
+        this.$set(this.form, 'typeS', row.ccType);
+        // 将 options 赋值到对应的 roleIds 等选项
+        if (row.ccType === 10) {
+          this.form.roleIds.push(...row.ccOptions);
+        } else if (row.ccType === 20 || row.ccType === 21) {
+          this.form.deptIds.push(...row.ccOptions);
+        } else if (row.ccType === 22) {
+          this.form.workTypeIds.push(...row.ccOptions);
+        } else if (
+          row.ccType === 30 ||
+          row.ccType === 31 ||
+          row.ccType === 32
+        ) {
+          this.form.userIds.push(...row.ccOptions);
+        } else if (row.ccType === 40) {
+          this.form.userGroupIds.push(...row.ccOptions);
+        } else if (row.ccType === 50) {
+          this.form.scripts.push(...row.ccOptions);
+        }
+        this.open = true;
       },
       /** 处理修改任务分配规则的按钮操作 */
       handleUpdateTaskAssignRule(row) {
+        this.title = '修改任务规则';
         // 先重置标识
         this.resetAssignRuleForm();
         // 设置表单
@@ -504,6 +567,7 @@
           userGroupIds: [],
           scripts: []
         };
+        this.$set(this.form, 'typeS', row.type);
         // 将 options 赋值到对应的 roleIds 等选项
         if (row.type === 10) {
           this.form.roleIds.push(...row.options);
@@ -517,10 +581,10 @@
           this.form.userGroupIds.push(...row.options);
         } else if (row.type === 50) {
           this.form.scripts.push(...row.options);
-        }else if (row.type === 70) {
+        } else if (row.type === 70) {
           let res = JSON.parse(row.variableName);
-          this.$set(this.form,'direction',res.direction)
-          this.$set(this.form,'topLevel',res.topLevel)
+          this.$set(this.form, 'direction', res.direction);
+          this.$set(this.form, 'topLevel', res.topLevel);
         }
         this.open = true;
       },
@@ -529,6 +593,7 @@
         this.$refs['taskAssignRuleForm'].validate((valid) => {
           if (valid) {
             // 构建表单
+            this.form.type = this.form.typeS;
             let form = {
               ...this.form,
               taskDefinitionName: undefined
@@ -552,9 +617,69 @@
               form.options = form.scripts;
             } else if (form.type === 70) {
               form.variableName = JSON.stringify({
-                direction:form.direction,
-                topLevel:form.topLevel
-              })
+                direction: form.direction,
+                topLevel: form.topLevel
+              });
+            }
+            form.roleIds = undefined;
+            form.deptIds = undefined;
+            form.workTypeIds = undefined;
+            form.userIds = undefined;
+            form.userGroupIds = undefined;
+            form.scripts = undefined;
+            form.direction = undefined;
+            form.topLevel = undefined;
+            // 新增
+            if (!form.id) {
+              form.modelId = this.modelId; // 模型编号
+              createTaskAssignRule(form).then((response) => {
+                this.$message.success('修改成功');
+                this.open = false;
+                this.getList();
+              });
+              // 修改
+            } else {
+              form.taskDefinitionKey = undefined; // 无法修改
+              updateTaskAssignRule(form).then((response) => {
+                this.$message.success('修改成功');
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      /** 提交任务分配规则的表单 */
+      ccSubmitAssignRuleForm() {
+        this.$refs['taskAssignRuleForm'].validate((valid) => {
+          if (valid) {
+            // 构建表单
+            this.form.ccType = this.form.typeS;
+
+            let form = {
+              ...this.form,
+              taskDefinitionName: undefined
+            };
+        
+            // 将 roleIds 等选项赋值到 options 中
+            if (form.ccType === 10) {
+              form.ccOptions = form.roleIds;
+              console.log( form.ccOptions)
+           
+            } else if (form.ccType === 20 || form.ccType === 21) {
+              form.ccOptions = form.deptIds;
+            } else if (form.ccType === 22) {
+              form.ccOptions = form.workTypeIds;
+            } else if (
+              form.ccType === 30 ||
+              form.ccType === 31 ||
+              form.ccType === 32
+            ) {
+              form.ccOptions = form.userIds;
+            } else if (form.ccType === 40) {
+              form.ccOptions = form.userGroupIds;
+            } else if (form.ccType === 50) {
+              form.ccOptions = form.scripts;
             }
             form.roleIds = undefined;
             form.deptIds = undefined;
@@ -564,6 +689,7 @@
             form.scripts = undefined;
             form.direction = undefined;
             form.topLevel = undefined;
+            console.log( form)
             // 新增
             if (!form.id) {
               form.modelId = this.modelId; // 模型编号

+ 2 - 1
src/views/rulesManagement/components/detail.vue

@@ -21,7 +21,8 @@
             <span>{{ detailsForm.code }}</span>
           </el-col>
           <el-col :span="6">
-            <span>{{ title }}名称:</span>
+            <!-- <span>{{ title }}名称:</span> -->
+            <span>名称:</span>
             <span>{{ detailsForm.name }}</span>
           </el-col>
           <el-col :span="6">

+ 13 - 5
src/views/rulesManagement/components/programRulesDialog.vue

@@ -372,10 +372,10 @@ export default {
           { required: true, message: '请选择设备类别', trigger: 'change' }
         ],
         groupId: [
-          { required: true, message: '请选择巡点检部门', trigger: 'change' }
+          { required: true, message: '请选择部门', trigger: 'change' }
         ],
         executeIdList: [
-          { required: true, message: '请选择巡点检人员', trigger: 'change' }
+          { required: true, message: '请选择人员', trigger: 'change' }
         ],
         urgent: [
           { required: true, message: '请选择紧急程度', trigger: 'change' }
@@ -488,7 +488,8 @@ export default {
             ? '运行记录'
             : this.dialogTitle.includes('保养')
               ? '保养'
-              : '盘点';
+              :  this.dialogTitle.includes('检修')
+              ? '检修':'盘点';
         // 获取审核人列表数据
         this.getUserList();
         // 获取规则名称
@@ -558,7 +559,8 @@ export default {
                 ? 2
                 : this.dialogTitle.includes('运行记录')
                   ? 5
-                  : 4;
+                  :this.dialogTitle.includes('检修')
+                  ?7:4;
             console.log(this.ruleIdList);
             this.addForm.isBindPlan = this.isBindPlan;
             let planConfigAddOrUpdatePOList = this.ruleIdList.map((item) => {
@@ -758,6 +760,10 @@ export default {
         const code = await getCode('runRecord_code');
         this.$set(this.addForm, 'code', code);
       }
+      if (tips.includes('检修')) {
+        const code = await getCode('service_code');
+        this.$set(this.addForm, 'code', code);
+      }
     },
     //选择部门(搜索)
     async searchDeptNodeClick(info, data) {
@@ -810,7 +816,9 @@ export default {
         '新增量具送检计划配置': 5,
         '编辑量具送检计划配置': 5,
         '新增运行记录配置': 6,
-        '编辑运行记录配置': 6
+        '编辑运行记录配置': 6,
+        '新增检修配置': 7,
+        '编辑检修配置': 7
       };
 
       const ruleType = typeMap[this.dialogTitle];

+ 4 - 1
src/views/rulesManagement/inspectionPoint/components/patrol-search.vue

@@ -25,7 +25,7 @@
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="巡点检部门:">
+        <el-form-item :label="ruleType==1?'巡点检部门':'部门'">
           <deptSelect v-model.trim="where.groupId" />
         </el-form-item>
         <el-form-item label="创建时间:">
@@ -110,6 +110,9 @@
         return this.$store.state.theme.styleResponsive;
       }
     },
+    props:{
+      ruleType:''
+    },
     created() {
       // this.getDeptList()
     },

+ 229 - 213
src/views/rulesManagement/inspectionPoint/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <patrol-search @search="reload"> </patrol-search>
+      <patrol-search @search="reload" :ruleType="ruleType"> </patrol-search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -79,232 +79,248 @@
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-// import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
-import ProgramRulesDialog from '../components/programRulesDialog';
-import PatrolSearch from './components/patrol-search.vue';
-import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  props: {
-    ruleType: {
-      type: String,
-      default: ''
-    }
-  },
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
+  import ProgramRulesDialog from '../components/programRulesDialog';
+  import PatrolSearch from './components/patrol-search.vue';
+  import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    props: {
+      ruleType: {
+        type: String,
+        default: ''
+      }
+    },
 
-  mixins: [dictMixins, tabMixins],
-  components: {
-    PatrolSearch,
-    // AddPatrolConfigDialog,
-    ProgramRulesDialog
-  },
-  computed: {
-    columns() {
-      const version = this.columnsVersion;
-      return [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '计划配置单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          slot: 'code'
-        },
-        {
-          prop: 'name',
-          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: '设备分类',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'autoOrder',
-          label: '自动派单',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            let autoOrder =
-              _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
-            return autoOrder;
-          }
-        },
-        {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.getDictValue('规则状态', _row.status);
+    mixins: [dictMixins, tabMixins],
+    components: {
+      PatrolSearch,
+      // AddPatrolConfigDialog,
+      ProgramRulesDialog
+    },
+    computed: {
+      columns() {
+        const version = this.columnsVersion;
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '计划配置单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code'
+          },
+          {
+            prop: 'name',
+            label: '计划配置名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
           },
-          filters: [
-            { value: 1, text: '生效'},
-            { value: 0, text: '失效'}
+          ...[
+            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'
+                }
           ],
-          filterMultiple: false,
-          columnKey: 'status'
-        },
-        {
-          prop: 'createUserName',
-          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);
+          {
+            prop: 'categoryName',
+            label: '设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'autoOrder',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              let autoOrder =
+                _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
+              return autoOrder;
+            }
+          },
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.getDictValue('规则状态', _row.status);
+            },
+            filters: [
+              { value: 1, text: '生效' },
+              { value: 0, text: '失效' }
+            ],
+            filterMultiple: false,
+            columnKey: 'status'
+          },
+          {
+            prop: 'createUserName',
+            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: 150,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ];
-    }
-  },
-  data() {
-    return {
-      addProgramRulesDialog: false,
-      // 表格列配置
-
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: `ae1c4c09-rulesManagement-planRules-point${this.ruleType}`,
-      columnsVersion: 1
-    };
-  },
-
-  created() {
-    this.requestDict('规则状态');
-  },
-  methods: {
-    selectType(value) {
-      let where = {}
-      if (value.status.length > 0) {
-        where['status'] = value.status[0]
+        ];
       }
-      this.reload(where)
-    },
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return planConfigPage({
-        pageNum: page,
-        size: limit,
-        ...where,
-        groupId: where.groupId == null ? '' : where.groupId,
-        categoryLevelId:
-          where.categoryLevelId == null ? '' : where.categoryLevelId,
-        ruleType: parseInt(this.ruleType)
-      });
     },
+    data() {
+      return {
+        addProgramRulesDialog: false,
+        // 表格列配置
 
-    /* 刷新表格 */
-    reload(where) {
-      console.log('刷新表格');
-      this.addProgramRulesDialog = false;
-      this.$refs.table.reload({
-        page: 1,
-        where,
-        ruleType: parseInt(this.ruleType)
-      });
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: `ae1c4c09-rulesManagement-planRules-point${this.ruleType}`,
+        columnsVersion: 1
+      };
     },
 
-    openEdit(row) {
-      this.isBindPlan = false;
-      this.addProgramRulesDialog = true;
-      if (row) {
-        this.dialogTitle =
-          this.ruleType == 1 ? '编辑巡点检计划配置' : '编辑运行记录配置';
-      } else {
-        this.dialogTitle =
-          this.ruleType == 1 ? '新增巡点检计划配置' : '新增运行记录配置';
-      }
-      this.$nextTick(() => {
-        this.$refs.programRulesDialog.init(
-          row,
-          this.ruleType == 1 ? '巡点检' : '运行记录'
-        );
-      });
+    created() {
+      this.requestDict('规则状态');
     },
+    methods: {
+      selectType(value) {
+        let where = {};
+        if (value.status.length > 0) {
+          where['status'] = value.status[0];
+        }
+        this.reload(where);
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return planConfigPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          groupId: where.groupId == null ? '' : where.groupId,
+          categoryLevelId:
+            where.categoryLevelId == null ? '' : where.categoryLevelId,
+          ruleType: parseInt(this.ruleType)
+        });
+      },
 
-    remove(row) {
-      removeRule([row.id]).then((res) => {
-        this.$message.success('删除成功!');
-        this.reload();
-      });
-    },
+      /* 刷新表格 */
+      reload(where) {
+        console.log('刷新表格');
+        this.addProgramRulesDialog = false;
+        this.$refs.table.reload({
+          page: 1,
+          where,
+          ruleType: parseInt(this.ruleType)
+        });
+      },
 
-    goDetail({ id }) {
-      this.$router.push({
-        path:
-          '/rulesManagement/inspectionPoint/detail?date=' +
-          new Date().valueOf(),
-        query: {
-          id
+      openEdit(row) {
+        this.isBindPlan = false;
+        this.addProgramRulesDialog = true;
+        if (row) {
+          this.dialogTitle =
+            this.ruleType == 1
+              ? '编辑巡点检计划配置'
+              : this.ruleType == 5
+              ? '编辑运行记录配置'
+              : '编辑检修配置';
+        } else {
+          this.dialogTitle =
+            this.ruleType == 1
+              ? '新增巡点检计划配置'
+              : this.ruleType == 5
+              ? '新增运行记录配置'
+              : '新增检修配置';
         }
-      });
+        this.$nextTick(() => {
+          this.$refs.programRulesDialog.init(
+            row,
+            this.ruleType == 1
+              ? '巡点检'
+              : this.ruleType == 5
+              ? '运行记录'
+              : '检修'
+          );
+        });
+      },
+
+      remove(row) {
+        removeRule([row.id]).then((res) => {
+          this.$message.success('删除成功!');
+          this.reload();
+        });
+      },
+
+      goDetail({ id }) {
+        console.log(this.ruleType,'this.ruleType')
+        let url =
+          this.ruleType == 7
+            ? '/rulesManagement/serviceList/detail?date='
+            : ' /rulesManagement/inspectionPoint/detail?date=';
+        this.$router.push({
+          path: url + new Date().valueOf(),
+          query: {
+            id
+          }
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 11 - 1
src/views/rulesManagement/planRules/index.vue

@@ -35,6 +35,10 @@
           <!-- 共用巡点检页面 -->
           <InspectionPoint2 ref="InspectionPoint2" :ruleType="String(5)"
         /></div>
+        <div v-if="activeComp == 'serviceList'">
+          <!-- 共用巡点检页面 -->
+          <InspectionPoint3 ref="InspectionPoint3" :ruleType="String(7)"
+        /></div>
       </div>
     </el-card>
   </div>
@@ -43,6 +47,7 @@
 <script>
   import InspectionPoint from '../inspectionPoint';
   import InspectionPoint2 from '../inspectionPoint';
+  import InspectionPoint3 from '../inspectionPoint';
   import MeasuringSubmit from '../measuringSubmit';
   import Maintenance from '../maintenance';
   import WarehouseInventory from '../warehouseInventory';
@@ -50,6 +55,7 @@
     components: {
       InspectionPoint,
       InspectionPoint2,
+      InspectionPoint3,
       MeasuringSubmit,
       Maintenance,
       WarehouseInventory
@@ -62,7 +68,8 @@
           { key: 'anmac', name: '保养配置' },
           { key: 'warehouseInventory', name: '仓库盘点配置' },
           { key: 'measuringSubmit', name: '量具送检配置' },
-          { key: 'runtimeConfiguration', name: '运行记录配置' }
+          { key: 'runtimeConfiguration', name: '运行记录配置' },
+          { key: 'serviceList', name: '检修配置' }
         ],
         // 加载状态
         loading: false
@@ -86,6 +93,9 @@
         case '运行记录配置':
           this.activeComp = 'runtimeConfiguration';
           break;
+        case '检修配置':
+          this.activeComp = 'serviceList';
+          break;
         default:
           break;
       }