fix(client): align customs completion notice and warehouse labels

This commit is contained in:
2026-09-28 17:01:36 +01:00
parent 32c5241a01
commit ffbe3480a8
5 changed files with 25 additions and 5 deletions
@@ -303,7 +303,8 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
<div v-if="locked" class="customs-locked" role="status">
<LockKeyhole :size="18" />
<div><strong>{{ detail.brokerSubmittedAt ? '已发送报关行执行' : '报关资料已锁定' }}</strong><span>{{ detail.brokerSubmittedAt ? '平台已将客户确认后的回执发送给报关行,等待真实报关完税文件。' : '报关开始后仅可查看和下载,不提供退回或解锁。' }}</span></div>
<div v-if="detail.status === 'COMPLETED'"><strong>报关已完成</strong><span>真实报关完税文件已齐全,可查看和下载资料、回执及完税文件。</span></div>
<div v-else><strong>{{ detail.brokerSubmittedAt ? '已发送报关行执行' : '报关资料已锁定' }}</strong><span>{{ detail.brokerSubmittedAt ? '平台已将客户确认后的回执发送给报关行,等待真实报关完税文件。' : '客户原始资料已冻结,仍可确认或打回待确认的报关行回执。' }}</span></div>
</div>
<section class="customs-section">
@@ -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'"[^>]*><strong>报关已完成/)
assert.match(customsDialogSource, /真实报关完税文件已齐全/)
assert.match(customsDialogSource, /item\.finalDocument/)
assert.match(customsDialogSource, /资料版本历史/)
assert.match(customsDialogSource, /尚未上传退税报关资料/)
@@ -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', () => {
@@ -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\) \}/)
@@ -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) {