From fc940d1939db4b832f2fad50aeea1cdeb4a638f3 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 26 三月 2026 12:00:25 +0800
Subject: [PATCH] 报工页面改为两列

---
 src/views/qualityManagement/processInspection/components/formDia.vue |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 5626d35..58cca54 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -262,9 +262,26 @@
 // 鐩戝惉涓嶈壇鏁伴噺鍙樺寲锛岃嚜鍔ㄦ洿鏂版暟閲�
 // 褰� defectiveQuantity 澧炲姞鏃讹紝quantity 鍑忓皯锛涘綋 defectiveQuantity 鍑忓皯鏃讹紝quantity 澧炲姞
 watch(() => form.value.defectiveQuantity, (newVal, oldVal) => {
+  if (newVal > form.value.quantity) {
+    form.value.defectiveQuantity = form.value.quantity;
+  }
   form.value.qualifiedQuantity = Number((form.value.quantity - newVal).toFixed(2));
 });
 
+// 鐩戝惉鎬绘暟閲忓彉鍖栵紝鑷姩鏇存柊鍚堟牸鏁伴噺
+watch(() => form.value.quantity, (newVal, oldVal) => {
+  const totalQty = Number(newVal) || 0;
+  const defectiveQty = Number(form.value.defectiveQuantity) || 0;
+
+  // 纭繚涓嶈壇鏁伴噺涓嶈秴杩囨�绘暟閲�
+  if (defectiveQty > totalQty) {
+    form.value.defectiveQuantity = totalQty;
+  }
+
+  // 璁$畻鍚堟牸鏁伴噺
+  form.value.qualifiedQuantity = Number((totalQty - defectiveQty).toFixed(2));
+});
+
 // 鎵撳紑寮规
 const openDialog = async (type, row) => {
 	operationType.value = type;

--
Gitblit v1.9.3