This commit is contained in:
2026-09-15 13:37:44 +08:00
parent 6f07d17c1d
commit 053f5201d0
6 changed files with 62 additions and 5 deletions
+1
View File
@@ -18,6 +18,7 @@ export const getReceivingContainer = async (containerNo) => normalizeReceivingSe
export const prepareReceivingContainer = async (containerNo, request) => normalizeReceivingSession(await overseasRequest('POST', `${RECEIVING_BASE}/${encodeURIComponent(containerNo)}/prepare`, request))
export const uploadCurrentUnloadPhoto = (filePath) => overseasUpload(current('/unload-photos/files'), filePath)
export const downloadCurrentUnloadPhoto = (downloadPath) => overseasDownload(downloadPath)
export const downloadCurrentDomesticLoadingPhoto = (downloadPath) => overseasDownload(downloadPath)
export const signCurrentReceiving = async (request) => normalizeReceivingSession(await overseasRequest('POST', current('/sign'), request))
export const getCurrentReceiving = async () => normalizeReceivingSession(await overseasRequest('GET', current()))
export const resolveCurrentCarton = async (cartonMark) => normalizeReceivingInbound(await overseasRequest('POST', current('/cartons/resolve'), { cartonMark }))
+5
View File
@@ -87,11 +87,16 @@ export function normalizeReceivingSession(value) {
const photos = Array.isArray(value.photos)
? value.photos.map((photo) => ({ ...photo, fileId: String(photo.fileId) }))
: []
const domesticLoadingPhotos = Array.isArray(value.domesticLoadingPhotos)
? value.domesticLoadingPhotos.filter((photo) => photo?.evidenceType && photo?.downloadPath)
.map((photo) => ({ ...photo, status: 'idle', localPath: '' }))
: []
return {
...value,
overseasWarehouseCode: text(value.overseasWarehouseCode),
overseasWarehouseName: text(value.overseasWarehouseName),
photos: RECEIVING_PHOTO_ROLES.map((role) => photos.find((photo) => photo?.role === role && photo?.fileId)).filter(Boolean),
domesticLoadingPhotos,
totalPackages: number(value.totalPackages),
receivedPackages: number(value.receivedPackages),
pendingPackages: number(value.pendingPackages),