Преглед изворни кода

优化班组选择逻辑,修复产品线列表重复问题

yusheng пре 4 месеци
родитељ
комит
9be92a6f76

+ 13 - 8
src/views/recordComponents/programRulesDialog.vue

@@ -78,6 +78,7 @@
               size="small"
               @change="typeChange"
               style="width: 100%"
+              :disabled="addForm.autoOrder == 1 && type === 'dispatch'"
             >
               <el-option :value="1" label="班组"></el-option>
               <el-option :value="0" label="个人"></el-option>
@@ -1292,9 +1293,11 @@
         row.tools = [];
       },
       deleteRow(time, row) {
-        const index = this.addForm.findIndex((item) => item.id === row.id);
+        const index = this.addForm.detailList.findIndex(
+          (item) => item.id === row.id
+        );
         if (index !== -1) {
-          this.addForm.splice(index, 1);
+          this.addForm.detailList.splice(index, 1);
         }
       },
       // 负责人变更 同步执行人列表
@@ -1330,15 +1333,17 @@
           this.addForm.productLineName = '';
           this.addForm.productLineId = '';
         }
-
-        this.productLineList = currentTeam.factoryWorkstationVOList.map(
-          (item) => {
-            return {
+        this.productLineList = [];
+        currentTeam.factoryWorkstationVOList.forEach((item) => {
+          if (
+            !this.productLineList.find((p) => p.id === item.productionLineId)
+          ) {
+            this.productLineList.push({
               name: item.productionLineName,
               id: item.productionLineId
-            };
+            });
           }
-        );
+        });
 
         // if (currentTeam) {
         //   // 同步执行人

+ 17 - 9
src/views/recordComponents/workOrderReport.vue

@@ -293,7 +293,10 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import parentList from '@/components/contact/parentList.vue';
-  import { producetaskrulerecordSaveOrUpdateAndSubmit,getById } from '@/api/recordRules/index.js';
+  import {
+    producetaskrulerecordSaveOrUpdateAndSubmit,
+    getById
+  } from '@/api/recordRules/index.js';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { getUserPage } from '@/api/system/organization';
   import { getteampage, getTeam } from '@/api/main/index.js';
@@ -645,14 +648,19 @@
             );
             console.log(this.allTeamList[index], 'dsadas');
             this.teamUserList = this.allTeamList[index].userVOList;
-
-            this.productLineList = this.allTeamList[
-              index
-            ].factoryWorkstationVOList.map((item) => {
-              return {
-                name: item.productionLineName,
-                id: item.productionLineId
-              };
+            this.productLineList = [];
+
+            this.allTeamList[index].factoryWorkstationVOList.forEach((item) => {
+              if (
+                !this.productLineList.find(
+                  (p) => p.id === item.productionLineId
+                )
+              ) {
+                this.productLineList.push({
+                  name: item.productionLineName,
+                  id: item.productionLineId
+                });
+              }
             });
 
             console.log('this.teamUserList', this.teamUserList);