From 4e687db2a039313b69cd1369afcae9233a13ca41 Mon Sep 17 00:00:00 2001
From: zhang_nuo <zhang_12370@163.com>
Date: 星期五, 11 九月 2026 19:53:45 +0800
Subject: [PATCH] feat(productionManagement): 增加每小时平均产量列与工单报工数量优化

---
 src/views/productionManagement/productionCosting/index.vue   |   23 ++++++++++++++++++++++-
 src/views/productionManagement/workOrderManagement/index.vue |    4 ++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index 3e79b93..2ee7583 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -65,7 +65,11 @@
                       :page="page1"
                       :tableLoading="tableLoading1"
                       style="margin-right: 20px;"
-                      @pagination="pagination1"></PIMTable>
+                      @pagination="pagination1">
+              <template #avgPerHour="{ row }">
+                {{ formatAvgPerHour(row) }}
+              </template>
+            </PIMTable>
           </div>
         </el-col>
       </el-row>
@@ -122,6 +126,13 @@
     {
       label: "宸ュ簭",
       prop: "process",
+      minWidth: 100,
+    },
+    {
+      label: "骞冲潎(灏忔椂)",
+      prop: "avgPerHour",
+      dataType: "slot",
+      slot: "avgPerHour",
       minWidth: 100,
     },
     {
@@ -311,6 +322,16 @@
   };
 
   // 鐐瑰嚮宸︿晶琛岋紝鍒峰彸渚ф槑缁嗭紙鎸夌敓浜т汉杩囨护锛�
+  // 璁$畻姣忓皬鏃跺钩鍧囩敓浜т欢鏁� = 鐢熶骇鏁伴噺 / 宸ユ椂
+  const formatAvgPerHour = row => {
+    const quantity = Number(row?.quantity) || 0;
+    const workHour = Number(row?.workHour) || 0;
+    if (workHour <= 0) return "-";
+    // 鍗曚綅
+    console.log(row)
+    return (quantity / workHour).toFixed(2)+" "+row.unit;
+  };
+
   const handleLeftRowClick = row => {
     searchForm.value.schedulingUserName = row.schedulingUserName || "";
     handleQuery();
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index b2ac432..f64b1d2 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -134,6 +134,7 @@
                     type="number"
                     min="0"
                     step="0.0001"
+                    disabled
                     style="width: 300px"
                     placeholder="璇疯緭鍏ョ敓浜у悎鏍兼暟閲�"
                     @input="handleQuantityInput" />
@@ -663,8 +664,7 @@
       row.planQuantity,
       row.completeQuantity
     );
-    reportForm.quantity =
-      row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
+    reportForm.quantity = reportForm.planQuantity;
     reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
     reportForm.workOrderId = row.id;
     reportForm.reportWork = row.reportWork;

--
Gitblit v1.9.3