fix(分拣): 保留历史斤行无重量回退,仅单位不一致时强制重量
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

This commit is contained in:
Ubuntu
2026-11-04 13:13:10 +08:00
parent 44e2041282
commit e7b48ab77a
@@ -353,7 +353,8 @@ export function resolvePickingSettlementQty(
): number {
const { picked_qty, picked_weight } = normalizePickingSavedMeasures(pickedQty, pickedWeight, unit);
if (isPickingWeightUnit(unit)) {
if (isPickingWeightUnit(orderUnit) === false && picked_weight <= 0) return 0;
const hasOrderUnit = Boolean(String(orderUnit || '').trim());
if (hasOrderUnit && !isPickingWeightUnit(orderUnit) && picked_weight <= 0) return 0;
return picked_weight > 0 ? picked_weight : picked_qty;
}
return picked_qty > 0 ? picked_qty : 0;