fix(admin): clarify unassigned overseas warehouse
This commit is contained in:
@@ -113,6 +113,31 @@ describe('InboundCodeRelationshipDrawer contract', () => {
|
||||
expect(wrapper.text()).toContain('LP-260830-0016')
|
||||
})
|
||||
|
||||
it('distinguishes an unassigned overseas warehouse from a missing warehouse name', async () => {
|
||||
vi.mocked(getOverseasInboundCodeRelationship).mockResolvedValueOnce({
|
||||
inboundCode: 'NYEXX2608300027', found: true,
|
||||
customer: { customerId: '90071992547409932', customerName: '纽约客户' }, overseasWarehouse: null,
|
||||
overseasReceivingStatus: 'PENDING_ASSIGNMENT', taillegOrders: [], inboundPlans: [], palletCodes: [], inventory: [],
|
||||
})
|
||||
const unassigned = mountDrawer()
|
||||
await flushPromises()
|
||||
expect(unassigned.text()).toContain('尚未分配海外仓')
|
||||
expect(unassigned.text()).not.toContain('仓库名称待补充')
|
||||
unassigned.unmount()
|
||||
|
||||
vi.mocked(getOverseasInboundCodeRelationship).mockResolvedValueOnce({
|
||||
inboundCode: 'NYEXX2608300027', found: true,
|
||||
customer: { customerId: '90071992547409932', customerName: '纽约客户' },
|
||||
overseasWarehouse: { warehouseId: '90071992547409939', warehouseCode: 'LAX', warehouseName: '' },
|
||||
overseasReceivingStatus: 'PENDING_ASSIGNMENT', taillegOrders: [], inboundPlans: [], palletCodes: [], inventory: [],
|
||||
})
|
||||
const missingName = mountDrawer()
|
||||
await flushPromises()
|
||||
expect(missingName.text()).toContain('仓库名称待补充')
|
||||
expect(missingName.text()).not.toContain('尚未分配海外仓')
|
||||
missingName.unmount()
|
||||
})
|
||||
|
||||
it('loads only permission-authorized server read models and keeps failures isolated', () => {
|
||||
expect(source).toContain('props.canReadBase')
|
||||
expect(source).toContain('props.canReadLoading')
|
||||
|
||||
@@ -24,6 +24,9 @@ const canReadOverseas = computed(() => props.canReadOverseas)
|
||||
const normalizedCode = computed(() => props.inboundCode.trim())
|
||||
|
||||
function display(value: unknown, fallback = '—') { return String(value ?? '').trim() || fallback }
|
||||
function overseasWarehouseName(value: OverseasInboundCodeRelationship['overseasWarehouse']) {
|
||||
return value ? display(value.warehouseName, '仓库名称待补充') : '尚未分配海外仓'
|
||||
}
|
||||
function close(value: boolean) { emit('update:modelValue', value) }
|
||||
|
||||
async function load() {
|
||||
@@ -77,7 +80,7 @@ watch(() => [props.modelValue, props.inboundCode, props.canReadBase, props.canRe
|
||||
<LoadErrorState v-if="overseasError" title="海外关联加载失败" :message="overseasError.message" @retry="load"><template #details><ApiErrorMeta :details="overseasError" /></template></LoadErrorState>
|
||||
<el-empty v-else-if="overseas && !overseas.found" description="服务端未找到该入仓码的海外关联数据" :image-size="56" />
|
||||
<template v-else-if="overseas">
|
||||
<dl class="compact-facts"><div><dt>客户</dt><dd>{{ display(overseas.customer?.customerName, '客户名称待补充') }}</dd></div><div><dt>海外仓</dt><dd>{{ display(overseas.overseasWarehouse?.warehouseName, '仓库名称待补充') }}<small v-if="overseas.overseasWarehouse?.warehouseCode">{{ overseas.overseasWarehouse.warehouseCode }}</small></dd></div></dl>
|
||||
<dl class="compact-facts"><div><dt>客户</dt><dd>{{ display(overseas.customer?.customerName, '客户名称待补充') }}</dd></div><div><dt>海外仓</dt><dd>{{ overseasWarehouseName(overseas.overseasWarehouse) }}<small v-if="overseas.overseasWarehouse?.warehouseCode">{{ overseas.overseasWarehouse.warehouseCode }}</small></dd></div></dl>
|
||||
<div class="compact-list"><strong>尾程订单</strong><span :title="overseas.taillegOrders.map((item) => item.orderNo).join('、')">{{ overseas.taillegOrders.map((item) => `${item.orderNo}${item.orderStatus ? `(${item.orderStatus})` : ''}`).filter(Boolean).join('、') || '—' }}</span></div>
|
||||
<div class="compact-list"><strong>入库计划</strong><span :title="overseas.inboundPlans.map((item) => item.planNo).join('、')">{{ overseas.inboundPlans.map((item) => `${item.planNo}${item.planStatus ? `(${item.planStatus})` : ''}${item.receivingStatus ? ` · ${item.receivingStatus}` : ''}`).join('、') || '—' }}</span></div>
|
||||
<div class="compact-list"><strong>托盘号</strong><span :title="overseas.palletCodes.join('、')">{{ overseas.palletCodes.join('、') || '—' }}</span></div>
|
||||
|
||||
Reference in New Issue
Block a user