feat(dispatch): show original and remaining handover quantities

This commit is contained in:
2026-10-03 13:28:23 +08:00
parent a1a8bb4b8b
commit 12de982dac
3 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ export function normalizeHandoverStatus(value) {
deliveries: value.deliveries.map(row => {
const packages = Number(row.packages)
if (!row.deliveryNo || row.packages == null || String(row.packages).trim() === '' || !Number.isSafeInteger(packages) || packages <= 0) throw new Error('交接状态中的派送箱数无效')
return { deliveryNo: text(row.deliveryNo), status: text(row.status), packages, terminalAt: text(row.terminalAt), transport: transport(row.transport) }
const remainingPackages = Number(row.remainingPackages)
if (row.remainingPackages == null || String(row.remainingPackages).trim() === '' || !Number.isSafeInteger(remainingPackages) || remainingPackages < 0 || remainingPackages > packages) throw new Error('交接状态中的剩余箱数无效')
return { deliveryNo: text(row.deliveryNo), status: text(row.status), packages, remainingPackages, terminalAt: text(row.terminalAt), transport: transport(row.transport) }
}),
latestHandover: value.latestHandover ? { handoverNo: text(value.latestHandover.handoverNo), handedOverAt: text(value.latestHandover.handedOverAt),
location: text(value.latestHandover.location), previous: transport(value.latestHandover.previous), replacement: transport(value.latestHandover.replacement) } : null