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 |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 6fdccc0..6a9eed8 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -1022,7 +1022,7 @@
           }
           openScheduleDialog(row);
         },
-        disabled: row => !row.canSchedule
+        disabled: row => !row.canSchedule || row.completeQuantity >= row.planQuantity
       }
       // {
       //   name:"瀹℃牳",
@@ -1182,6 +1182,12 @@
   }
   const num = Number(value);
   if (isNaN(num)) {
+    return;
+  }
+  // 濡傛灉瓒呰繃寰呯敓浜ф暟閲�
+  if (num > reportForm.planQuantity) {
+    proxy.$modal.msgWarning("鏈鐢熶骇鏁伴噺涓嶈兘澶т簬寰呯敓浜ф暟閲�");
+    reportForm.quantity = reportForm.planQuantity;
     return;
   }
   // 濡傛灉灏忎簬1锛屾竻闄�
@@ -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