优化
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user