فهرست منبع

产前产后过程监测记录规则添加逻辑修改

lucw 7 ماه پیش
والد
کامیت
361a972e74

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

@@ -7,6 +7,7 @@
         :columns="columns"
         :datasource="datasource"
         :cache-key="cacheKeyUrl"
+        row-key="id"
       >
         <template v-slot:toolbar>
           <el-button

+ 3 - 1
src/views/technology/production/components/user-setting-matter-add.vue

@@ -198,7 +198,8 @@
         taskId: null,
         itemTaskName: '',
         // 是否执行中
-        isUsing: 0
+        isUsing: 0,
+        recordRulesClassify: '' // 记录规则分类
       };
 
       return {
@@ -356,6 +357,7 @@
         this.ruleInfo = rules;
         this.formData.rulesId = rules.id || null;
         this.formData.rulesName = rules.name || '';
+        this.formData.recordRulesClassify = rules.classify;
       }
     }
   };

+ 9 - 3
src/views/technology/production/components/user-setting-matter-process.vue

@@ -317,12 +317,18 @@
         console.log('matter', matter, rules);
 
         if (matter.itemType == '2') {
-          // 判断是否存在
+          // 判断是否存在同一分类
           const exists = this.matterList.some(
-            (item) => item.rulesId === matter.rulesId
+            (item) => item.recordRulesClassify === matter.recordRulesClassify
           );
           if (exists) {
-            return this.$message.warning('规则已存在,请勿重复添加');
+            const className = this.getDictValue(
+              '记录规则类型',
+              matter.recordRulesClassify
+            );
+            return this.$message.warning(
+              `“${className}”分类规则已存在,请勿重复添加`
+            );
           }
         }
 

+ 39 - 14
src/views/technology/production/components/user-setting-matter.vue

@@ -239,24 +239,49 @@
       addMatter(matter) {
         console.log('matter', matter);
         const id = 'tem' + new Date().getTime();
+
+        const msgList = [];
+        const className = this.getDictValue(
+          '记录规则类型',
+          matter.recordRulesClassify
+        );
+
         // 添加事项
         this.currentRows.forEach((task) => {
-          this.matterList.push({
-            ...matter,
-            id: id + task.id,
-            produceTaskId: task.id,
-            produceTaskName: task.name,
-            reportWorkType: this.reportWorkType
-          });
-          this.addPOs.push({
-            ...matter,
-            id: id + task.id,
-            produceTaskId: task.id,
-            produceTaskName: task.name,
-            reportWorkType: this.reportWorkType
-          });
+          // 判断是否存在同一分类
+          const exists = this.matterList
+            .filter((item) => item.reportWorkType == this.reportWorkType)
+            .some(
+              (item) =>
+                item.recordRulesClassify == matter.recordRulesClassify &&
+                task.id == item.produceTaskId
+            );
+
+          if (!exists) {
+            this.matterList.push({
+              ...matter,
+              id: id + task.id,
+              produceTaskId: task.id,
+              produceTaskName: task.name,
+              reportWorkType: this.reportWorkType
+            });
+            this.addPOs.push({
+              ...matter,
+              id: id + task.id,
+              produceTaskId: task.id,
+              produceTaskName: task.name,
+              reportWorkType: this.reportWorkType
+            });
+          } else {
+            // 记录重复信息
+            msgList.push({ taskName: task.name });
+          }
         });
 
+        if (msgList.length > 0) {
+          this.$message.warning(`部分工序已存在该分类规则:${className}`);
+        }
+
         this.handleSort();
       },
       editMatter(matter) {