Sfoglia il codice sorgente

feat(TaskConfigPanel): 增加班组长显示逻辑,优化班组信息展示

xieyong 1 mese fa
parent
commit
9842217675

+ 9 - 2
src/views/productionPlan/components/newFactoryProductionScheduling.vue

@@ -1214,8 +1214,15 @@
           rawExecutionTeamId: '',
           executionObjectType: '',
           executionObjectName: '',
-          executionTeamLeader: '',
-          executionTeamLeaderId: '',
+          executionTeamLeader:
+            item.executionTeamLeader ||
+            item.dispatchTeamLeader ||
+            item.teamLeaderUserName ||
+            item.leaderUserName ||
+            item.firstTaskTeamLeader ||
+            item.executionLeaderName ||
+            '',
+          executionTeamLeaderId: item.executionTeamLeaderId || '',
           executionTeamName: '',
           executionStartTime,
           executionEndTime,

+ 28 - 9
src/views/productionPlan/components/newFactoryProductionScheduling/TaskConfigPanel.vue

@@ -50,7 +50,7 @@
         <div class="dispatch-process-meta">
           工序编码:{{ taskCodeDisplay(activeTask) }},所属班组:{{
             dispatchTeamDisplay(activeTask)
-          }}
+          }},班组长:{{ dispatchTeamLeaderDisplay(activeTask) }}
         </div>
 
         <div class="dispatch-toolbar">
@@ -697,6 +697,14 @@
     'teamNames',
     'executionTeamName'
   ];
+  const DISPATCH_TEAM_LEADER_NAME_KEYS = [
+    'dispatchTeamLeader',
+    'executionTeamLeader',
+    'teamLeaderUserName',
+    'leaderUserName',
+    'firstTaskTeamLeader',
+    'executionLeaderName'
+  ];
 
   export default {
     name: 'TaskConfigPanel',
@@ -1915,8 +1923,8 @@
           this.$set(task, 'executionObjectType', '');
           this.$set(task, 'executionObjectName', '');
           this.$set(task, 'executionTeamName', '');
-          this.$set(task, 'executionTeamLeader', '');
-          this.$set(task, 'executionTeamLeaderId', '');
+          // this.$set(task, 'executionTeamLeader', '');
+          // this.$set(task, 'executionTeamLeaderId', '');
         });
       },
       createDispatchTaskRow(row) {
@@ -1960,8 +1968,8 @@
         this.$set(task, 'executionObjectType', '');
         this.$set(task, 'executionObjectName', '');
         this.$set(task, 'executionTeamName', '');
-        this.$set(task, 'executionTeamLeader', '');
-        this.$set(task, 'executionTeamLeaderId', '');
+        // this.$set(task, 'executionTeamLeader', '');
+        // this.$set(task, 'executionTeamLeaderId', '');
       },
       clearDispatchTaskBinding(row, task = this.getDispatchRowTask(row)) {
         if (!task) {
@@ -1977,8 +1985,8 @@
         this.$set(task, 'executionObjectType', '');
         this.$set(task, 'executionObjectName', '');
         this.$set(task, 'executionTeamName', '');
-        this.$set(task, 'executionTeamLeader', '');
-        this.$set(task, 'executionTeamLeaderId', '');
+        // this.$set(task, 'executionTeamLeader', '');
+        // this.$set(task, 'executionTeamLeaderId', '');
       },
       clearDispatchQuantityInput(row) {
         this.clearDispatchObject(row);
@@ -2072,8 +2080,8 @@
         this.$set(task, 'executionObjectType', '');
         this.$set(task, 'executionObjectName', '');
         this.$set(task, 'executionTeamName', '');
-        this.$set(task, 'executionTeamLeader', '');
-        this.$set(task, 'executionTeamLeaderId', '');
+        // this.$set(task, 'executionTeamLeader', '');
+        // this.$set(task, 'executionTeamLeaderId', '');
       },
       clearDispatchStartTime(row) {
         if (row) {
@@ -2690,6 +2698,17 @@
           ]) || '所有班组'
         );
       },
+
+      dispatchTeamLeaderDisplay(row = this.activeTask) {
+        const plan = this.currentPlan || {};
+        return (
+          this.pickDispatchSingleValue([
+            { source: row || {}, keys: DISPATCH_TEAM_LEADER_NAME_KEYS },
+            { source: plan, keys: DISPATCH_TEAM_LEADER_NAME_KEYS }
+          ]) || '-'
+        );
+      },
+
       handleDispatchPageSizeChange(size) {
         this.dispatchPageSize = size;
         this.dispatchPage = 1;