From ffbe3480a890dee09a1dfd7d311387ef68a00a92 Mon Sep 17 00:00:00 2001
From: ouyangxq <775153912@qq.com>
Date: Mon, 28 Sep 2026 17:01:36 +0100
Subject: [PATCH] fix(client): align customs completion notice and warehouse
labels
---
.../components/CustomsDocumentsDialog.vue | 3 ++-
.../views/FirstLegOrdersView.test.mjs | 4 +++-
.../views/businessIdentifiers.test.mjs | 19 ++++++++++++++++++-
.../views/ReturnOrdersView.test.mjs | 2 +-
.../views/WarehouseServiceView.vue | 2 +-
5 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/src/modules/first-leg/components/CustomsDocumentsDialog.vue b/src/modules/first-leg/components/CustomsDocumentsDialog.vue
index 606f4e7..996dd7f 100644
--- a/src/modules/first-leg/components/CustomsDocumentsDialog.vue
+++ b/src/modules/first-leg/components/CustomsDocumentsDialog.vue
@@ -303,7 +303,8 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
-
{{ detail.brokerSubmittedAt ? '已发送报关行执行' : '报关资料已锁定' }}{{ detail.brokerSubmittedAt ? '平台已将客户确认后的回执发送给报关行,等待真实报关完税文件。' : '报关开始后仅可查看和下载,不提供退回或解锁。' }}
+
报关已完成真实报关完税文件已齐全,可查看和下载资料、回执及完税文件。
+
{{ detail.brokerSubmittedAt ? '已发送报关行执行' : '报关资料已锁定' }}{{ detail.brokerSubmittedAt ? '平台已将客户确认后的回执发送给报关行,等待真实报关完税文件。' : '客户原始资料已冻结,仍可确认或打回待确认的报关行回执。' }}
diff --git a/src/modules/first-leg/views/FirstLegOrdersView.test.mjs b/src/modules/first-leg/views/FirstLegOrdersView.test.mjs
index 5c6964e..58c1845 100644
--- a/src/modules/first-leg/views/FirstLegOrdersView.test.mjs
+++ b/src/modules/first-leg/views/FirstLegOrdersView.test.mjs
@@ -705,7 +705,9 @@ test('supports the frozen customs document workflow and customer-safe downloads'
assert.match(customsApiSource, /MAX_CUSTOMS_FILE_SIZE = 50 \* 1024 \* 1024/)
assert.match(customsApiSource, /data: \{ inboundIds, expectedVersion: document\.source\.version \}/)
assert.match(customsApiSource, /requestId: error\.requestId/)
- assert.match(customsDialogSource, /报关开始后仅可查看和下载,不提供退回或解锁/)
+ assert.match(customsDialogSource, /客户原始资料已冻结,仍可确认或打回待确认的报关行回执/)
+ assert.match(customsDialogSource, /v-if="detail.status === 'COMPLETED'"[^>]*>报关已完成/)
+ assert.match(customsDialogSource, /真实报关完税文件已齐全/)
assert.match(customsDialogSource, /item\.finalDocument/)
assert.match(customsDialogSource, /资料版本历史/)
assert.match(customsDialogSource, /尚未上传退税报关资料/)
diff --git a/src/modules/first-leg/views/businessIdentifiers.test.mjs b/src/modules/first-leg/views/businessIdentifiers.test.mjs
index 2d174a2..6d3d691 100644
--- a/src/modules/first-leg/views/businessIdentifiers.test.mjs
+++ b/src/modules/first-leg/views/businessIdentifiers.test.mjs
@@ -1,6 +1,8 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
+import { runInNewContext } from 'node:vm'
+import ts from 'typescript'
const firstLeg = readFileSync(new URL('./FirstLegOrdersView.vue', import.meta.url), 'utf8')
const quickOrder = readFileSync(new URL('./QuickOrderView.vue', import.meta.url), 'utf8')
@@ -18,7 +20,22 @@ test('uses business identifiers and names without visible internal-ID fallbacks'
assert.doesNotMatch(quickOrder, />\{\{ result\.orderNo/)
assert.doesNotMatch(customs, /detail\.planNo \|\| detail\.loadingPlanId/)
assert.doesNotMatch(overseas, /overseasWarehouseName \|\| (?:item|candidate)\.overseasWarehouseId/)
- assert.doesNotMatch(overseas, /row\(\[[^\]]*(?:item\.overseasWarehouseId|item\.operatingWarehouseId)/)
+ // Warehouse IDs may be inputs to a resolver, but must never be raw cells.
+ assert.doesNotMatch(overseas, /row\(\[[^\]]*[,[]\s*item\.(?:overseasWarehouseId|operatingWarehouseId)\s*[,\]]/)
+})
+
+test('warehouse labels never fall back to unknown internal IDs', () => {
+ const source = overseas.slice(overseas.indexOf('function warehouseDisplay('), overseas.indexOf('function statusLabel('))
+ const javascript = ts.transpileModule(source, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText
+ const display = runInNewContext(`${javascript}; warehouseDisplay`, {
+ operationWarehouses: { value: [{ id: '1234567890123456789', warehouseCode: 'LAX', warehouseName: '洛杉矶仓' }] },
+ fbaWarehouses: { value: [] }, warehouseLabel: (warehouse) => warehouse.warehouseName,
+ })
+ assert.equal(display('1234567890123456789'), '洛杉矶仓')
+ assert.equal(display('LAX'), '洛杉矶仓')
+ assert.equal(display('9999999999999999999'), '—')
+ assert.equal(display('1234567890123456789,9999999999999999999'), '洛杉矶仓、—')
+ assert.equal(display(undefined), '—')
})
test('keeps internal IDs only as non-rendered routing, selection, and request values', () => {
diff --git a/src/modules/overseas-warehouse/views/ReturnOrdersView.test.mjs b/src/modules/overseas-warehouse/views/ReturnOrdersView.test.mjs
index 1415e8f..3576d6f 100644
--- a/src/modules/overseas-warehouse/views/ReturnOrdersView.test.mjs
+++ b/src/modules/overseas-warehouse/views/ReturnOrdersView.test.mjs
@@ -76,7 +76,7 @@ test('退货签收详情使用独立路由和紧凑连续页面', () => {
test('待审核退货可编辑,完成入库后从独立新增页发起贴标', () => {
assert.match(view, /row\.status === 'PENDING_REVIEW'.*key: 'edit'/)
- assert.match(view, /await updateReturnOrder\(editingReturnNo\.value, payload\)/)
+ assert.match(view, /await \(editingReturnNo\.value \? updateReturnOrder\(editingReturnNo\.value, payload\) : createReturnOrder\(payload\)\)/)
assert.match(view, /order\.status === 'COMPLETED' && order\.needRelabel === true/)
assert.match(view, /name: 'overseas-labeling-create'/)
assert.match(view, /query: \{ returnNo: order\.returnNo, warehouseId: String\(order\.overseasWarehouseId\) \}/)
diff --git a/src/modules/overseas-warehouse/views/WarehouseServiceView.vue b/src/modules/overseas-warehouse/views/WarehouseServiceView.vue
index 0b5225e..de8ff08 100644
--- a/src/modules/overseas-warehouse/views/WarehouseServiceView.vue
+++ b/src/modules/overseas-warehouse/views/WarehouseServiceView.vue
@@ -810,7 +810,7 @@ function warehouseDisplay(value?: string) {
if (!value) return '—'
return value.split(',').map((code) => {
const warehouse = [...operationWarehouses.value, ...fbaWarehouses.value].find((item) => String(item.id) === code || item.warehouseCode === code)
- return warehouse ? warehouseLabel(warehouse) : code
+ return warehouse ? warehouseLabel(warehouse) : '—'
}).join('、')
}
function statusLabel(value: string) {