优化
This commit is contained in:
@@ -17,8 +17,8 @@ export interface InboundPlanSummary {
|
||||
planNo: string
|
||||
inboundCode: string
|
||||
orderType: string | null
|
||||
warehouseCode: string | null
|
||||
warehouseName: string | null
|
||||
overseasWarehouseCode: string | null
|
||||
overseasWarehouseName: string | null
|
||||
fbaWarehouseCode: string | null
|
||||
packageCount: number
|
||||
pickedPackageCount: number
|
||||
@@ -52,6 +52,8 @@ export interface InboundPlanPallet {
|
||||
export interface InboundPlanDetail {
|
||||
planNo: string
|
||||
containerNo: string | null
|
||||
overseasWarehouseCode: string | null
|
||||
overseasWarehouseName: string | null
|
||||
status: string
|
||||
lineCount: number
|
||||
palletCount: number
|
||||
|
||||
@@ -5,6 +5,7 @@ import test from 'node:test'
|
||||
const api = readFileSync(new URL('./api/inboundPlans.ts', import.meta.url), 'utf8')
|
||||
const routes = readFileSync(new URL('./routes.ts', import.meta.url), 'utf8')
|
||||
const view = readFileSync(new URL('./views/InboundOrdersView.vue', import.meta.url), 'utf8')
|
||||
const overseasHttp = readFileSync(new URL('../../api/overseasHttp.ts', import.meta.url), 'utf8')
|
||||
|
||||
test('activates the customer-scoped overseas inbound list and detail', () => {
|
||||
assert.match(routes, /path: 'orders\/inbound'[\s\S]*?release: 'active'[\s\S]*?permission: 'merchant:warehouse:inbound:list'/)
|
||||
@@ -23,3 +24,21 @@ test('keeps actions first and exposes filters loading errors empty state paginat
|
||||
assert.match(view, /detail\.planNo/)
|
||||
assert.doesNotMatch(view, /planId|orderId|warehouseId|customerId/)
|
||||
})
|
||||
|
||||
test('shows only the server-provided overseas receiving warehouse code and name', () => {
|
||||
assert.match(api, /overseasWarehouseCode: string \| null/)
|
||||
assert.match(api, /overseasWarehouseName: string \| null/)
|
||||
assert.doesNotMatch(api, /overseasWarehouseId/)
|
||||
assert.match(view, /label="海外接柜仓"/)
|
||||
assert.match(view, /overseasWarehouseLabel\(scope\.row\.overseasWarehouseCode, scope\.row\.overseasWarehouseName\)/)
|
||||
assert.match(view, /overseasWarehouseLabel\(detail\.overseasWarehouseCode, detail\.overseasWarehouseName\)/)
|
||||
assert.match(view, /if \(typeof code !== 'string' \|\| !code\.trim\(\) \|\| typeof name !== 'string' \|\| !name\.trim\(\)\) return '—'/)
|
||||
assert.doesNotMatch(view, /warehouseName \|\| warehouseCode|destinationWarehouse(?:Id|Code|Name).*overseasWarehouse/i)
|
||||
})
|
||||
|
||||
test('preserves overseas API diagnostic metadata without rendering it as a business identifier', () => {
|
||||
assert.match(overseasHttp, /response\.data\.traceId/)
|
||||
assert.match(overseasHttp, /response\.data\.requestId/)
|
||||
assert.match(overseasHttp, /body\.traceId, body\.requestId/)
|
||||
assert.doesNotMatch(view, /requestId|traceId/)
|
||||
})
|
||||
|
||||
@@ -14,6 +14,10 @@ const query = reactive({
|
||||
})
|
||||
|
||||
function text(value: unknown) { return value === null || value === undefined || value === '' ? '—' : String(value) }
|
||||
function overseasWarehouseLabel(code: unknown, name: unknown) {
|
||||
if (typeof code !== 'string' || !code.trim() || typeof name !== 'string' || !name.trim()) return '—'
|
||||
return `${code.trim()} · ${name.trim()}`
|
||||
}
|
||||
function dateTime(value: unknown) { return value ? new Date(String(value)).toLocaleString('zh-CN', { hour12: false }) : '—' }
|
||||
function statusLabel(value: unknown) {
|
||||
return ({ PENDING: '待处理', PROCESSING: '处理中', COMPLETED: '已完成', CANCELLED: '已取消', UNAPPOINTED: '未预约', SUCCESS: '预约成功', FAILED: '预约失败', SCHEDULED: '已排车', UNSCHEDULED: '未排车' } as Record<string, string>)[String(value)] || text(value)
|
||||
@@ -82,7 +86,7 @@ onMounted(() => void load())
|
||||
<el-table-column label="操作" width="90" fixed="left"><template #default="scope"><el-button link type="primary" @click="openDetail(scope.row)">查看</el-button></template></el-table-column>
|
||||
<el-table-column prop="planNo" label="计划号" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="inboundCode" label="入仓码" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column label="海外仓" min-width="160" show-overflow-tooltip><template #default="scope">{{ text(scope.row.warehouseName || scope.row.warehouseCode) }}</template></el-table-column>
|
||||
<el-table-column label="海外接柜仓" min-width="220" show-overflow-tooltip><template #default="scope">{{ overseasWarehouseLabel(scope.row.overseasWarehouseCode, scope.row.overseasWarehouseName) }}</template></el-table-column>
|
||||
<el-table-column label="目的仓" min-width="150" show-overflow-tooltip><template #default="scope">{{ text(scope.row.fbaWarehouseCode) }}</template></el-table-column>
|
||||
<el-table-column prop="packageCount" label="计划箱数" width="100" />
|
||||
<el-table-column prop="pickedPackageCount" label="已拣箱数" width="100" />
|
||||
@@ -100,6 +104,7 @@ onMounted(() => void load())
|
||||
<el-card shadow="never">
|
||||
<dl class="detail-grid">
|
||||
<div><dt>计划号</dt><dd>{{ detail.planNo }}</dd></div><div><dt>集装箱号</dt><dd>{{ text(detail.containerNo) }}</dd></div>
|
||||
<div><dt>海外接柜仓</dt><dd>{{ overseasWarehouseLabel(detail.overseasWarehouseCode, detail.overseasWarehouseName) }}</dd></div>
|
||||
<div><dt>状态</dt><dd>{{ statusLabel(detail.status) }}</dd></div><div><dt>入仓码数</dt><dd>{{ detail.lineCount }}</dd></div>
|
||||
<div><dt>托盘数</dt><dd>{{ detail.palletCount }}</dd></div><div><dt>总体积(m³)</dt><dd>{{ detail.totalVolumeCbm }}</dd></div>
|
||||
<div><dt>计划箱数</dt><dd>{{ detail.expectedPackageCount }}</dd></div><div><dt>已拣箱数</dt><dd>{{ detail.pickedPackageCount }}</dd></div>
|
||||
|
||||
Reference in New Issue
Block a user