Przeglądaj źródła

fix: 修复产线列表在currentTeam为空时的错误

防止因currentTeam为null/undefined导致forEach调用报错
yusheng 4 dni temu
rodzic
commit
bb9def31e7

+ 11 - 10
src/views/rulesManagement/recordPlan/components/programRulesDialog.vue

@@ -1551,17 +1551,18 @@
           this.addForm.productLineId = '';
         }
         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) {
+          currentTeam.factoryWorkstationVOList.forEach((item) => {
+            if (
+              !this.productLineList.find((p) => p.id === item.productionLineId)
+            ) {
+              this.productLineList.push({
+                name: item.productionLineName,
+                id: item.productionLineId
+              });
+            }
+          });
           // 同步执行人
           this.addForm.executeUsers = [
             {