fix(storegoods): 扫码详情展示细码数量并去掉本行匹数

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 14:06:20 +08:00
co-authored by Cursor
parent 863f0fe850
commit ab9d199fe3
2 changed files with 13 additions and 7 deletions
+11 -1
View File
@@ -213,6 +213,16 @@ export function getEmptyScanDetail() {
};
}
/** 刚扫细码的数量(公斤存储值):优先细码 weight */
function pickScannedFineWeight(res) {
if (!res) return 0;
if (res.weight != null && res.weight !== '') return res.weight;
if (res.base_unit_weight != null && res.base_unit_weight !== '') return res.base_unit_weight;
if (res.settle_weight != null && res.settle_weight !== '') return res.settle_weight;
if (res.actually_weight != null && res.actually_weight !== '') return res.actually_weight;
return res.item_weight;
}
/** 从扫码接口返回构建详情区(匹数÷100,数量÷10000) */
export function buildScanDetailFromScanResponse(res) {
if (!res) return getEmptyScanDetail();
@@ -225,7 +235,7 @@ export function buildScanDetailFromScanResponse(res) {
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
item_weight: formatWeightKg(res.item_weight != null ? res.item_weight : res.weight),
item_weight: formatWeightKg(pickScannedFineWeight(res)),
};
}