This commit is contained in:
2026-08-24 19:29:41 +08:00
parent 1b129c4cdb
commit bc986f1eef
10 changed files with 107 additions and 32 deletions
+5 -7
View File
@@ -1,4 +1,5 @@
import { reactive } from 'vue'
import { RECEIVING_PHOTO_ROLES } from '@/api/receiving-adapter.js'
export const receiving = reactive({
candidates: [], selected: null, current: null, photoSlots: [null, null, null],
@@ -33,13 +34,10 @@ export function setCurrentReceiving(value) {
if (!chosen || Number(chosen.pendingPackages || 0) <= 0) {
receiving.selectedInboundCode = (value?.inbounds || []).find((item) => Number(item.pendingPackages || 0) > 0)?.inboundCode || value?.inbounds?.[0]?.inboundCode || ''
}
if (value?.photos?.length) {
const roles = ['LICENSE_PLATE', 'CONTAINER_SEAL', 'DOOR_OPEN']
receiving.photoSlots = roles.map((role) => {
const photo = value.photos.find((item) => item.role === role)
return photo ? { ...photo, fileId: String(photo.fileId), role, uploaded: true } : null
})
}
receiving.photoSlots = RECEIVING_PHOTO_ROLES.map((role) => {
const photo = value?.photos?.find((item) => item.role === role)
return photo ? { ...photo, fileId: String(photo.fileId), role, uploaded: true } : null
})
}
export function resetReceivingDraft({ keepCurrent = false } = {}) {