Selaa lähdekoodia

feat: 优化团队选项加载逻辑,支持从任务列表获取工作中心ID

xieyong 4 päivää sitten
vanhempi
commit
2dc4e913ed
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      src/views/productionPlan/components/planDotLine.vue

+ 3 - 1
src/views/productionPlan/components/planDotLine.vue

@@ -586,7 +586,9 @@
       async loadTeamOptions() {
         try {
           const factoryId = this.$store.state.user.info.factoryId;
-          const workCenterIds = this.planRoutingPayload.detailList[0].workCenterIds.join(',');
+          const detailIds = this.planRoutingPayload?.detailList?.[0]?.workCenterIds?.join(',');
+          const taskIds = this.taskList[0]?.workCenterIds?.join(',');
+          const workCenterIds = detailIds || taskIds;
           const res = await teamPage({ pageNum: 1, size: -1, factoryId, workCenterIds });
           this.teamOptions = (res?.list || []).map(
             ({ id, name, leaderUserName, leaderUserId }) => ({