Просмотр исходного кода

计划规则新增’运行记录配置‘

yijing 1 год назад
Родитель
Сommit
8c07657937

+ 28 - 6
src/views/rulesManagement/components/programRulesDialog.vue

@@ -624,6 +624,8 @@
         if (val) {
           this.formLabel = this.dialogTitle.includes('巡点检')
             ? '巡点检'
+            : this.dialogTitle.includes('运行记录')
+            ? '运行记录'
             : this.dialogTitle.includes('保养')
             ? '保养'
             : '盘点';
@@ -694,6 +696,8 @@
                 ? 1
                 : this.dialogTitle.includes('保养')
                 ? 2
+                : this.dialogTitle.includes('运行记录')
+                ? 5
                 : 4;
               console.log(this.ruleIdList);
               this.addForm.isBindPlan = this.isBindPlan;
@@ -887,6 +891,10 @@
           const code = await getCode('quantity_code');
           this.$set(this.addForm, 'code', code);
         }
+        if (tips.includes('运行记录')) {
+          const code = await getCode('runRecord_code');
+          this.$set(this.addForm, 'code', code);
+        }
       },
       //选择部门(搜索)
       async searchDeptNodeClick(info, data) {
@@ -932,12 +940,12 @@
       // 获取规则名列表
       async _getRuleNameList() {
         if (
-          this.dialogTitle === '新增保养计划配置' ||
-          this.dialogTitle === '编辑保养计划配置'
+          this.dialogTitle === '新增巡点检计划配置' ||
+          this.dialogTitle === '编辑巡点检计划配置'
         ) {
           const res = await getRule({
             status: 1,
-            type: 2,
+            type: 1,
             pageNum: 1,
             size: -1
           });
@@ -946,12 +954,12 @@
           }
         }
         if (
-          this.dialogTitle === '新增巡点检计划配置' ||
-          this.dialogTitle === '编辑巡点检计划配置'
+          this.dialogTitle === '新增保养计划配置' ||
+          this.dialogTitle === '编辑保养计划配置'
         ) {
           const res = await getRule({
             status: 1,
-            type: 1,
+            type: 2,
             pageNum: 1,
             size: -1
           });
@@ -973,6 +981,20 @@
             this.ruleNameList = res.list || [];
           }
         }
+        if (
+          this.dialogTitle === '新增运行记录配置' ||
+          this.dialogTitle === '编辑运行记录配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 6,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
+        }
       },
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);

+ 58 - 19
src/views/rulesManagement/inspectionPoint/index.vue

@@ -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 ? '巡点检' : '运行记录'
+          );
         });
       },
 

+ 0 - 1
src/views/rulesManagement/maintenance/index.vue

@@ -213,7 +213,6 @@
 
       openEdit(row) {
         this.isBindPlan = false;
-        // this.$refs.addPatrolConfigDialogRef.$refs.addFormRef && this.$refs.addPatrolConfigDialogRef.$refs.addFormRef.clearValidate()
         this.addProgramRulesDialog = true;
         if (row) {
           this.dialogTitle = '编辑保养计划配置';

+ 4 - 4
src/views/rulesManagement/matterRules/components/matter-add.vue

@@ -76,7 +76,6 @@
           v-if="formData.ruleType !== 4"
           :data="formData.ruleItems"
           tooltip-effect="dark"
-          style="width: 95%; margin: auto"
           border
           :header-cell-style="{ background: '#F0F3F3' }"
         >
@@ -111,7 +110,7 @@
               ></el-input>
             </template>
           </el-table-column>
-          <el-table-column prop="matterType" label="流程类型" width="160">
+          <el-table-column prop="matterType" label="执行状态" width="160">
             <template slot-scope="scope">
               <el-select
                 v-model="scope.row.matterType"
@@ -164,7 +163,7 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column prop="operationGuide" label="操作指导">
+          <el-table-column prop="operationGuide" label="操作指导" width="400">
             <template slot-scope="scope">
               <div
                 class="operationGuide_box"
@@ -593,7 +592,8 @@
     overflow: hidden;
     cursor: pointer;
     .left_content {
-      flex: 0 0 200px;
+      // flex: 0 0 200px;
+      width: 50%;
       padding: 10px;
       box-sizing: border-box;
       border: 1px solid #c0c4cc;

+ 19 - 3
src/views/rulesManagement/planRules/index.vue

@@ -8,7 +8,7 @@
               v-for="item in tabOptions"
               :key="item.key"
               :class="{ active: activeComp == item.key }"
-              @click="activeComp = item.key"
+              @click="handleClick(item)"
             >
               {{ item.name }}
             </li>
@@ -20,7 +20,7 @@
       </div>
       <div class="main">
         <div v-if="activeComp == 'point'">
-          <InspectionPoint />
+          <InspectionPoint ref="InspectionPoint" :ruleType="String(1)" />
         </div>
         <div v-if="activeComp == 'anmac'">
           <Maintenance />
@@ -31,6 +31,10 @@
         <div v-if="activeComp == 'measuringSubmit'">
           <MeasuringSubmit />
         </div>
+        <div v-if="activeComp == 'runtimeConfiguration'">
+          <!-- 共用巡点检页面 -->
+          <InspectionPoint2 ref="InspectionPoint2" :ruleType="String(5)"
+        /></div>
       </div>
     </el-card>
   </div>
@@ -38,12 +42,14 @@
 
 <script>
   import InspectionPoint from '../inspectionPoint';
+  import InspectionPoint2 from '../inspectionPoint';
   import MeasuringSubmit from '../measuringSubmit';
   import Maintenance from '../maintenance';
   import WarehouseInventory from '../warehouseInventory';
   export default {
     components: {
       InspectionPoint,
+      InspectionPoint2,
       MeasuringSubmit,
       Maintenance,
       WarehouseInventory
@@ -55,7 +61,8 @@
           { key: 'point', name: '巡点检配置' },
           { key: 'anmac', name: '保养配置' },
           { key: 'warehouseInventory', name: '仓库盘点配置' },
-          { key: 'measuringSubmit', name: '量具送检配置' }
+          { key: 'measuringSubmit', name: '量具送检配置' },
+          { key: 'runtimeConfiguration', name: '运行记录配置' }
         ],
         // 加载状态
         loading: false
@@ -76,9 +83,18 @@
         case '仓库盘点配置':
           this.activeComp = 'warehouseInventory';
           break;
+        case '运行记录配置':
+          this.activeComp = 'runtimeConfiguration';
+          break;
         default:
           break;
       }
+    },
+    methods: {
+      handleClick(val) {
+        this.activeComp = val.key;
+        this.$forceUpdate();
+      }
     }
   };
 </script>