Selaa lähdekoodia

fix(productionPlan): 修复工厂排产甘特图匹配逻辑并完善派工面板

- 修正工厂排产模式下甘特图选中行匹配只收集计划ID和编号
- 任务配置面板新增已派单/未派单数量显示
- 表格新增标准工时输入列
yusheng 4 viikkoa sitten
vanhempi
commit
6ed0002ad8

+ 51 - 41
src/views/productionPlan/components/newFactoryProductionScheduling.vue

@@ -603,7 +603,6 @@
       },
       hasOrderSchedulingGanttSelection() {
         return (
-          this.isOrderScheduling &&
           Array.isArray(this.selection) &&
           this.selection.length > 0
         );
@@ -690,46 +689,57 @@
       collectSelectedOrderSchedulingGanttMatchGroups(rows = []) {
         const groups = this.createOrderSchedulingGanttMatchGroups();
         (Array.isArray(rows) ? rows : []).forEach((row) => {
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderIds',
-            row?.workOrderId || row?.id
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderIds',
-            row?.apsWorkOrderId
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderIds',
-            row?.sourceWorkOrderId || row?.orderId
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderCodes',
-            row?.productionOrderNumber || row?.code
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderCodes',
-            row?.apsWorkOrderCode || row?.workOrderCode
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'orderCodes',
-            row?.productionOrderCode || row?.orderCode
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'planIds',
-            row?.productionPlanId || row?.planId
-          );
-          this.addOrderSchedulingGanttMatchValue(
-            groups,
-            'planCodes',
-            row?.productionPlanCode || row?.planCode
-          );
+          if (this.isOrderScheduling) {
+            // 班组排程:行是工单数据,同时收集工单键与关联计划键
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderIds',
+              row?.workOrderId || row?.id
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderIds',
+              row?.apsWorkOrderId
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderIds',
+              row?.sourceWorkOrderId || row?.orderId
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderCodes',
+              row?.productionOrderNumber || row?.code
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderCodes',
+              row?.apsWorkOrderCode || row?.workOrderCode
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'orderCodes',
+              row?.productionOrderCode || row?.orderCode
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'planIds',
+              row?.productionPlanId || row?.planId
+            );
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'planCodes',
+              row?.productionPlanCode || row?.planCode
+            );
+          } else {
+            // 工厂排产:行是生产计划数据,id 即计划主键、code 即计划编号
+            this.addOrderSchedulingGanttMatchValue(groups, 'planIds', row?.id);
+            this.addOrderSchedulingGanttMatchValue(
+              groups,
+              'planCodes',
+              row?.code
+            );
+          }
         });
         return groups;
       },

+ 29 - 0
src/views/productionPlan/components/newFactoryProductionScheduling/TaskConfigPanel.vue

@@ -13,6 +13,19 @@
             <el-radio :label="0">批量报工</el-radio>
           </el-radio-group>
           <div class="dispatch-plan-info">
+            <span class="dispatch-plan-item">
+              <span class="dispatch-plan-label">已派单数量:</span>
+              <span class="dispatch-plan-value">
+                {{ quantityLimit || 0 }}{{ currentPlan.unit }}
+              </span>
+            </span>
+            <span class="dispatch-plan-item">
+              <span class="dispatch-plan-label">未派单数量:</span>
+              <span class="dispatch-plan-value">
+                {{ currentPlan.productNum - quantityLimit || 0
+                }}{{ currentPlan.unit }}
+              </span>
+            </span>
             <span class="dispatch-plan-item">
               <span class="dispatch-plan-label">计划数量:</span>
               <span class="dispatch-plan-value">
@@ -614,6 +627,17 @@
               />
             </template>
           </el-table-column>
+          <el-table-column label="标准工时" min-width="120" align="center">
+            <template slot-scope="{ row }">
+              <el-input
+                v-model="row.standardWorkingHours"
+                placeholder="请输入标准工时"
+                :disabled="readonlyMode"
+                class="config-table-control"
+              ></el-input>
+            </template>
+          </el-table-column>
+
           <el-table-column label="执行开始时间" min-width="164" align="center">
             <template slot-scope="{ row }">
               <el-date-picker
@@ -1067,6 +1091,11 @@
       },
       normalTableMaxHeight() {
         return this.fillTableHeight ? undefined : this.tableMaxHeight;
+      },
+      quantityLimit() {
+        return this.pagedDispatchObjectRows?.reduce((total, row) => {
+          return total + this.parseDispatchQuantity(row.quantity);
+        }, 0);
       }
     },
     watch: {