diff --git a/src/modules/inbounds/components/InboundTaskList.test.ts b/src/modules/inbounds/components/InboundTaskList.test.ts index 8ebeb2d2..0b76d9c8 100644 --- a/src/modules/inbounds/components/InboundTaskList.test.ts +++ b/src/modules/inbounds/components/InboundTaskList.test.ts @@ -37,7 +37,7 @@ describe('InboundTaskList measurement scope', () => { expect(source).toContain(':tenant-id="selectedInbound.tenantId"') expect(source).toContain(':customer-id="selectedInbound.tenantId"') - expect(source).toContain(':customer-name="selectedInbound.customerName || selectedInbound.companyName"') + expect(source).toContain(':customer-name="customerDisplayName(selectedInbound)"') expect(source).toContain(':channel-name="selectedInbound.channelName"') expect(source).not.toContain('selectedInbound.customerId || selectedInbound.tenantId') }) diff --git a/src/modules/inbounds/components/InboundTaskList.vue b/src/modules/inbounds/components/InboundTaskList.vue index b2bfce49..5fed05bd 100644 --- a/src/modules/inbounds/components/InboundTaskList.vue +++ b/src/modules/inbounds/components/InboundTaskList.vue @@ -65,6 +65,9 @@ const actionPermission = computed(() => isReview.value const taskLabel = computed(() => isReview.value ? '审核' : '测量') const emptyText = computed(() => isReview.value ? '暂无待审核的测量数据' : '暂无当前可测量的订单') const preferenceKey = computed(() => isReview.value ? 'inbound-measurement-reviews' : 'inbound-measurements') +const customerNameById = computed(() => new Map(customers.value.map((customer) => [ + String(customer.id), customer.legalName?.trim() || customer.tenantName, +]))) const queryFields = computed(() => [ { @@ -111,6 +114,11 @@ function text(value: unknown) { return value === null || value === undefined || value === '' ? '—' : String(value) } +function customerDisplayName(inbound: InboundOrderSummary) { + const snapshot = inbound.customerName?.trim() || inbound.companyName?.trim() + return snapshot || customerNameById.value.get(String(inbound.customerId || inbound.tenantId)) || '' +} + function formatNumber(value: number | null | undefined) { return value === null || value === undefined ? '—' : value.toLocaleString('zh-CN', { maximumFractionDigits: 3 }) } @@ -440,6 +448,7 @@ onBeforeUnmount(() => { disposed = true; requestSerial += 1; optionsRequestSeria v-if="!isReview && selectedInbound" v-model="measurementDialogOpen" :customer-id="selectedInbound.tenantId" + :customer-name="customerDisplayName(selectedInbound)" :inbound-id="selectedInbound.id" :inbound-code="selectedInbound.inboundCode" @updated="handleMeasurementUpdated" diff --git a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts index 9b5f1dc9..fe382b05 100644 --- a/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts +++ b/src/modules/inbounds/components/InboundWorkflowWorkspace.test.ts @@ -40,6 +40,7 @@ describe('InboundWorkflowWorkspace', () => { expect(source).toContain('@click="reviewDialogOpen = true"') expect(source).toContain(':key="`review-dialog-${revision}`"') expect(source).toContain(':customer-name="detail?.summary.customerName || detail?.summary.companyName"') + expect(source).toContain(':customer-name="detail?.summary.customerName || detail?.summary.companyName"') expect(source).toContain(':channel-name="detail?.summary.channelName"') expect(source).toContain('@changed="handleReviewChanged"') expect(source).not.toContain('