From 278cfc7b1d36ce98ad62749ec816d60aa09173ea Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期三, 29 四月 2026 09:27:15 +0800
Subject: [PATCH] fix(workOrder): 修复生产数量验证和表单初始化问题

---
 src/views/productionManagement/workOrder/index.vue |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index edae03e..6a9eed8 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -1184,6 +1184,12 @@
   if (isNaN(num)) {
     return;
   }
+  // 濡傛灉瓒呰繃寰呯敓浜ф暟閲�
+  if (num > reportForm.planQuantity) {
+    proxy.$modal.msgWarning("鏈鐢熶骇鏁伴噺涓嶈兘澶т簬寰呯敓浜ф暟閲�");
+    reportForm.quantity = reportForm.planQuantity;
+    return;
+  }
   // 濡傛灉灏忎簬1锛屾竻闄�
   if (num < 1) {
     reportForm.quantity = null;
@@ -1378,13 +1384,15 @@
 };
 
 const showReportDialog = row => {
+
   currentReportRowData.value = row;
   reportForm.planQuantity = row.planQuantity - row.completeQuantity;
-  reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
+  reportForm.quantity = row.planQuantity !== undefined && row.planQuantity !== null ? row.planQuantity : null;
   reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
   reportForm.workOrderId = row.id;
   reportForm.reportWork = row.reportWork;
   reportForm.productMainId = row.productMainId;
+  reportForm.planQuantity = row.planQuantity;
   reportForm.startTime = "";
   reportForm.endTime = "";
   reportForm.replenishQty = 0;

--
Gitblit v1.9.3