From 422aea7677145bc4f61f10436353d9e62d80fff5 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期三, 25 三月 2026 16:59:35 +0800
Subject: [PATCH] 过程检验列表加上不良数量、合格数量字段。过程检验编辑页面也加上不良数量、合格数量字段,不良数量输入框手填,合格数量,数量输入框置灰,根据根据不良数量+合格数量=数量这一逻辑计算。若不填默认不良数量为0。数量是订单本次生产数量-报废数量
---
src/views/qualityManagement/processInspection/components/formDia.vue | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/views/qualityManagement/processInspection/components/formDia.vue b/src/views/qualityManagement/processInspection/components/formDia.vue
index 5626d35..850e8b3 100644
--- a/src/views/qualityManagement/processInspection/components/formDia.vue
+++ b/src/views/qualityManagement/processInspection/components/formDia.vue
@@ -262,9 +262,27 @@
// 鐩戝惉涓嶈壇鏁伴噺鍙樺寲锛岃嚜鍔ㄦ洿鏂版暟閲�
// 褰� 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;
+ }
+
+ console.log(totalQty);
+ // 璁$畻鍚堟牸鏁伴噺
+ form.value.qualifiedQuantity = Number((totalQty - defectiveQty).toFixed(2));
+});
+
// 鎵撳紑寮规
const openDialog = async (type, row) => {
operationType.value = type;
--
Gitblit v1.9.3