fix(pda): preserve authoritative overseas receiving reservation hints

This commit is contained in:
2026-09-09 12:25:13 +08:00
parent cb1dfc5a31
commit f6ee80d677
5 changed files with 71 additions and 11 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import { overseasDownload, overseasRequest, overseasUpload } from '@/api/overseas.js'
import { normalizeReceivingCandidate, normalizeReceivingSession, normalizeReceivingWarehouseProfile } from '@/api/receiving-adapter.js'
import { normalizeReceivingAssignment, normalizeReceivingInbound, normalizeReceivingCandidate, normalizeReceivingSession, normalizeReceivingWarehouseProfile } from '@/api/receiving-adapter.js'
const RECEIVING_BASE = '/pda/v1/last-leg/receiving-containers'
const current = (suffix = '') => `${RECEIVING_BASE}/current${suffix}`
@@ -20,8 +20,8 @@ export const uploadCurrentUnloadPhoto = (filePath) => overseasUpload(current('/u
export const downloadCurrentUnloadPhoto = (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 = (cartonMark) => overseasRequest('POST', current('/cartons/resolve'), { cartonMark })
export const resolveCurrentCarton = async (cartonMark) => normalizeReceivingInbound(await overseasRequest('POST', current('/cartons/resolve'), { cartonMark }))
export const resolveCurrentPallet = (palletCode, inboundCode) => overseasRequest('POST', current('/pallets/resolve'), { palletCode, inboundCode })
export const receiveCurrentBulk = (request) => overseasRequest('POST', current('/receipts/bulk'), request)
export const receiveCurrentCarton = (request) => overseasRequest('POST', current('/receipts/carton'), request)
export const receiveCurrentBulk = async (request) => normalizeReceivingAssignment(await overseasRequest('POST', current('/receipts/bulk'), request))
export const receiveCurrentCarton = async (request) => normalizeReceivingAssignment(await overseasRequest('POST', current('/receipts/carton'), request))
export const completeCurrentReceiving = async (request) => normalizeReceivingSession(await overseasRequest('POST', current('/complete'), request))
+13 -3
View File
@@ -38,15 +38,21 @@ export function assertReceivingWarehouse(value, profile, label = '当前柜') {
export function normalizeReceivingInbound(value = {}) {
return {
...value,
...normalizeReceivingAssignment(value),
plannedPalletCount: number(value.plannedPalletCount),
totalPackages: number(value.totalPackages),
receivedPackages: number(value.receivedPackages),
pendingPackages: number(value.pendingPackages),
pendingPackages: number(value.pendingPackages)
}
}
export function normalizeReceivingAssignment(value = {}) {
return {
...value,
assigned: value.assigned === true,
mergeAllowed: value.mergeAllowed === true,
urgent: value.urgent === true,
mergeHint: text(value.mergeHint)
mergeHint: value.mergeAllowed === true ? text(value.mergeHint) : ''
}
}
@@ -104,6 +110,10 @@ export function toReceivingError(error, fallback = '海外仓作业失败') {
const code = error?.code
const rawMessage = String(error?.message || '').trim()
const palletConflictMessages = {
'Reserved pallet binding is incomplete': '预留托盘资料不完整,请联系管理员检查入仓计划',
'Reserved pallet customer binding is invalid': '预留托盘与当前客户不匹配,请联系管理员检查入仓计划',
'Scanned pallet does not match the reserved inbound plan resource': '扫描托盘与入仓计划预留资源不一致,请扫描已预留的托盘',
'Pallet code matches multiple reserved resources in this inbound plan': '托盘码对应多个预留资源,请联系管理员检查入仓计划',
'Pallet is not idle': '该托盘已被占用,当前不可用于收货,请更换可用托盘',
'Pallet location was not found': '该托盘未关联有效库位,请联系管理员维护后重试',
'Pallet virtual location is not active': '该托盘所在虚拟库位不可用,请更换托盘或联系管理员',