From 859630fbbede12f6491a84f898abaf8fad9598cb Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 28 Oct 2026 17:17:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/receiving-adapter.js | 10 ++-- src/components/ReceivingSessionSummary.vue | 2 + src/pages/operation/operation.vue | 26 ++++++++-- tests/receiving-adapter.test.mjs | 15 ++++++ tests/receiving-lifecycle.test.mjs | 56 +++++++++++++++++++++- 5 files changed, 99 insertions(+), 10 deletions(-) diff --git a/src/api/receiving-adapter.js b/src/api/receiving-adapter.js index 629e429..95ca579 100644 --- a/src/api/receiving-adapter.js +++ b/src/api/receiving-adapter.js @@ -115,7 +115,9 @@ export function isReceivingConflict(error) { export function toReceivingError(error, fallback = '海外仓作业失败') { const code = error?.code const rawMessage = String(error?.message || '').trim() - const palletConflictMessages = { + const receivingMessages = { + 'Carton mark must contain a non-empty inbound code prefix': '请扫描箱码或国内DP码', + 'Pallet code is not part of the current FBA destination group': '托盘不属于当前目的仓,请重扫', 'Reserved pallet binding is incomplete': '预留托盘资料不完整,请联系管理员检查入仓计划', 'Reserved pallet customer binding is invalid': '预留托盘与当前客户不匹配,请联系管理员检查入仓计划', 'Scanned pallet does not match the reserved inbound plan resource': '扫描托盘与入仓计划预留资源不一致,请扫描已预留的托盘', @@ -131,13 +133,13 @@ export function toReceivingError(error, fallback = '海外仓作业失败') { 'Pallet FBA destination does not match the inbound code': '该托盘的FBA目的仓与当前入仓码不一致,请更换托盘', 'FBA-designated pallet cannot receive an OVERSEAS destination carton': 'FBA专用托盘不能接收海外仓目的箱,请更换托盘' } - const conflictMessage = ['409', 'A0409', 'B0409'].includes(String(code || '')) - ? palletConflictMessages[rawMessage] + const businessMessage = ['404', 'A0404', 'B0404', '409', 'A0409', 'B0409'].includes(String(code || '')) + ? receivingMessages[rawMessage] : '' const palletUnavailable = String(code || '') === 'S0503' && rawMessage === 'Warehouse pallet service returned no usable response' const mapped = Object.assign(new Error( - conflictMessage || (palletUnavailable + businessMessage || (palletUnavailable ? '该托盘当前不可用于收货,请更换可用托盘或联系管理员检查托盘状态' : rawMessage || fallback) ), { diff --git a/src/components/ReceivingSessionSummary.vue b/src/components/ReceivingSessionSummary.vue index 242d696..8fb4e80 100644 --- a/src/components/ReceivingSessionSummary.vue +++ b/src/components/ReceivingSessionSummary.vue @@ -47,6 +47,8 @@