feat(dispatch): show original and remaining handover quantities
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user