From d5048a33e4760d414115a5e25645d30b41d24198 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 29 八月 2026 18:06:07 +0800
Subject: [PATCH] fix(wls): 修复多个组件中的类型安全和数据验证问题
---
src/views/wls/productreceipt/modules/line-list.vue | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/views/wls/productreceipt/modules/line-list.vue b/src/views/wls/productreceipt/modules/line-list.vue
index e28cdac..a68891c 100644
--- a/src/views/wls/productreceipt/modules/line-list.vue
+++ b/src/views/wls/productreceipt/modules/line-list.vue
@@ -153,6 +153,22 @@
details = await getProductReceiptDetailListByLineId(line.id!);
detailMap[line.id!] = details;
}
+ // 鍕鹃�夊叆搴撶殑琛屽繀椤诲凡鏈変笂鏋舵槑缁嗭紝涓旀槑缁嗘暟閲忎箣鍜岀瓑浜庤鏀惰揣鏁伴噺
+ if (!details.length) {
+ message.error(`鐗╂枡銆�${line.itemName}銆嶅凡鍕鹃�夊叆搴擄紝璇峰厛娣诲姞涓婃灦鏄庣粏`);
+ return;
+ }
+ const lineQty = Number(line.quantity ?? 0);
+ const sumQty = details.reduce(
+ (acc, detail) => acc + Number(detail.quantity ?? 0),
+ 0,
+ );
+ if (lineQty !== sumQty) {
+ message.error(
+ `鐗╂枡銆�${line.itemName}銆嶄笂鏋舵槑缁嗘暟閲忎箣鍜岋紙${sumQty}锛変笌鏀惰揣鏁伴噺锛�${lineQty}锛変笉涓�鑷碻,
+ );
+ return;
+ }
row.details = details.map((detail) => ({
warehouseId: detail.warehouseId!,
locationId: detail.locationId!,
--
Gitblit v1.9.3