From f9ff9086d5199e46d904bf8245e43092ce05985e Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 12 Aug 2026 10:59:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customs/pages/CustomsCasesView.test.ts | 7 ++ .../customs/pages/CustomsCasesView.vue | 3 +- .../pages/DownloadCenterView.test.ts | 15 +++-- .../downloads/pages/DownloadCenterView.vue | 2 - .../pages/CarrierRatesView.test.ts | 1 + .../carrier-rates/pages/CarrierRatesView.vue | 2 +- .../pages/FinanceFormalSettlementPage.vue | 2 +- .../finance/pages/FinanceG3G4Views.test.ts | 6 +- .../inbounds/pages/InboundOrdersView.test.ts | 14 +++- .../inbounds/pages/InboundOrdersView.vue | 12 ++-- .../components/LoadingListDetailDrawer.vue | 4 +- .../components/LoadingListsView.test.ts | 6 ++ .../pages/ExpressCompaniesView.test.ts | 4 ++ .../pages/ExpressCompaniesView.vue | 4 -- .../pages/PortSchedulesView.test.ts | 4 ++ .../pages/PortSchedulesView.vue | 2 +- .../pages/TruckAppointmentsView.test.ts | 3 +- .../trucking/pages/TruckAppointmentsView.vue | 2 +- .../pages/UnifiedOrdersView.test.ts | 24 +++++-- .../pages/UnifiedOrdersView.vue | 67 +++++-------------- 20 files changed, 103 insertions(+), 81 deletions(-) diff --git a/src/modules/customs/pages/CustomsCasesView.test.ts b/src/modules/customs/pages/CustomsCasesView.test.ts index ea240095..d9cf1524 100644 --- a/src/modules/customs/pages/CustomsCasesView.test.ts +++ b/src/modules/customs/pages/CustomsCasesView.test.ts @@ -21,4 +21,11 @@ describe('CustomsCasesView', () => { expect(source).not.toContain("key: 'orderId', type: 'input'") expect(source).not.toContain("key: 'inboundId', type: 'input'") }) + it('does not render technical order or inbound ids in the list', () => { + expect(source).toContain("label: '订单关联'") + expect(source).toContain("label: '入库单关联'") + expect(source).toContain("return value ? '已关联' : '未关联'") + expect(source).not.toContain("label: '订单标识'") + expect(source).not.toContain("label: '入库单标识'") + }) }) diff --git a/src/modules/customs/pages/CustomsCasesView.vue b/src/modules/customs/pages/CustomsCasesView.vue index d4c003ee..0874a13c 100644 --- a/src/modules/customs/pages/CustomsCasesView.vue +++ b/src/modules/customs/pages/CustomsCasesView.vue @@ -18,7 +18,8 @@ import type { CustomsCaseDetail, CustomsCaseResource } from '../types' const access = useAccessPreviewStore(); const rows = ref([]); const loading = ref(false); const error = ref(null); const page = ref(1); const pageSize = ref(20); const total = ref(0) const filters = ref({ status: '' }); const fields: QueryField[] = [{ key: 'status', type: 'select', label: '状态', options: customsCaseStatusOptions.map((option) => ({ ...option })) }] -const columns = [{ key: 'actions', label: '操作', fixed: 'left', width: 175, slotName: 'actions', hideable: false, movable: false }, { prop: 'customsNo', label: '报关编号', minWidth: 145 }, { prop: 'orderId', label: '订单标识', minWidth: 155 }, { prop: 'inboundId', label: '入库单标识', minWidth: 155 }, { prop: 'checklistCode', label: '资料清单', minWidth: 125 }, { prop: 'checklistVersionNo', label: '版本', width: 90 }, { prop: 'status', label: '状态', width: 110, slotName: 'status' }, { prop: 'updatedAt', label: '更新时间', minWidth: 160 }] +const columns = [{ key: 'actions', label: '操作', fixed: 'left', width: 175, slotName: 'actions', hideable: false, movable: false }, { prop: 'customsNo', label: '报关编号', minWidth: 145 }, { key: 'orderLink', label: '订单关联', minWidth: 120, formatter: (row: CustomsCaseResource) => associationLabel(row.orderId) }, { key: 'inboundLink', label: '入库单关联', minWidth: 120, formatter: (row: CustomsCaseResource) => associationLabel(row.inboundId) }, { prop: 'checklistCode', label: '资料清单', minWidth: 125 }, { prop: 'checklistVersionNo', label: '版本', width: 90 }, { prop: 'status', label: '状态', width: 110, slotName: 'status' }, { prop: 'updatedAt', label: '更新时间', minWidth: 160 }] +function associationLabel(value: string | null | undefined) { return value ? '已关联' : '未关联' } async function load() { loading.value = true; error.value = null; try { const result = await listCustomsCases({ page: page.value, size: pageSize.value, status: String(filters.value.status || '') || undefined }); rows.value = result.records; total.value = result.total } catch (cause) { error.value = getApiErrorDetails(cause) } finally { loading.value = false } } function search() { if (page.value === 1) void load(); else page.value = 1 } const detailOpen = ref(false); const detail = ref(null); const detailLoading = ref(false); const actionError = ref(null); const submitForm = reactive({ customsAgentName: '', externalReference: '', note: '' }); const canSubmit = computed(() => detail.value?.customsCase.status === 'READY_TO_SUBMIT' && access.can('platform:firstleg:customs:submit')) diff --git a/src/modules/downloads/pages/DownloadCenterView.test.ts b/src/modules/downloads/pages/DownloadCenterView.test.ts index a2709323..8c17db50 100644 --- a/src/modules/downloads/pages/DownloadCenterView.test.ts +++ b/src/modules/downloads/pages/DownloadCenterView.test.ts @@ -67,7 +67,8 @@ describe('DownloadCenterView', () => { await flushPromises() expect(document.body.textContent).toContain('客户列表') - expect(document.querySelector('.failure-cell')?.classList.contains('failure-message')).toBe(false) + expect(document.querySelector('.data-table')?.textContent).not.toContain('失败原因') + expect(document.querySelector('.failure-cell')).toBeNull() const button = [...document.querySelectorAll('button')].find((item) => item.textContent?.trim() === '下载') button?.click() await flushPromises() @@ -91,7 +92,7 @@ describe('DownloadCenterView', () => { mount(DownloadCenterView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } }) await flushPromises() - expect(document.querySelector('.failure-cell')?.classList.contains('failure-message')).toBe(true) + expect(document.querySelector('.failure-cell')).toBeNull() const button = [...document.querySelectorAll('button')].find((item) => item.textContent?.trim() === '重试') button?.click() await flushPromises() @@ -145,7 +146,7 @@ describe('DownloadCenterView', () => { .some((item) => item.textContent?.trim() === '重试')).toBe(false) }) - it('does not expose customer retry without the customer export permission', async () => { + it('keeps failure details out of the list and does not expose retry without the source export permission', async () => { vi.mocked(listPlatformExportTasks).mockResolvedValue({ records: [{ ...task, status: 'FAILED', failureMessage: 'IAM timeout' }], page: 1, size: 20, total: 1, pages: 1, @@ -155,12 +156,18 @@ describe('DownloadCenterView', () => { auth.token = 'token' auth.permissions = ['platform:download:list'] useAccessPreviewStore().initializeAfterLogin() + vi.mocked(getPlatformExportTask).mockResolvedValue({ ...task, status: 'FAILED', failureMessage: 'IAM timeout' }) mount(DownloadCenterView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } }) await flushPromises() - expect(document.body.textContent).toContain('IAM timeout') + expect(document.body.textContent).not.toContain('IAM timeout') expect([...document.querySelectorAll('button')] .some((item) => item.textContent?.trim() === '重试')).toBe(false) + + ;[...document.querySelectorAll('button')] + .find((item) => item.textContent?.trim() === '详情')?.click() + await flushPromises() + expect(document.body.textContent).toContain('IAM timeout') }) it('announces the initial loading state while the task request is pending', async () => { diff --git a/src/modules/downloads/pages/DownloadCenterView.vue b/src/modules/downloads/pages/DownloadCenterView.vue index 4750aee7..dcaaf70b 100644 --- a/src/modules/downloads/pages/DownloadCenterView.vue +++ b/src/modules/downloads/pages/DownloadCenterView.vue @@ -67,7 +67,6 @@ const columns: DataTableColumn[] = [ { key: 'requestedAt', label: '申请时间', width: 170, slotName: 'requestedAt' }, { key: 'completedAt', label: '完成时间', width: 170, slotName: 'completedAt' }, { key: 'expiresAt', label: '过期时间', width: 170, slotName: 'expiresAt' }, - { key: 'failure', label: '失败原因', minWidth: 240, slotName: 'failure' }, ] const hasActiveTasks = computed(() => result.value.records.some((task) => ['PENDING', 'RUNNING'].includes(task.status))) @@ -267,7 +266,6 @@ onBeforeUnmount(() => { - diff --git a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.test.ts b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.test.ts index 0e997d2e..6e710308 100644 --- a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.test.ts +++ b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.test.ts @@ -14,6 +14,7 @@ describe('CarrierRatesView price-book source contract', () => { expect(source).toContain('formatEffectivePeriod') expect(source).toContain('PENDING_CONFIRMATION') expect(source).toContain('SUPERSEDED') + expect(source).not.toContain('ID {{ (row as PlatformPriceBookVersion).id }}') }) it('uses only the parsed price-book workflow instead of legacy carrier-rate editing', () => { diff --git a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue index 483caad9..e6d0a6b1 100644 --- a/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue +++ b/src/modules/fba-pricing/carrier-rates/pages/CarrierRatesView.vue @@ -646,7 +646,7 @@ onMounted(() => { >原文件 - + diff --git a/src/modules/finance/pages/FinanceFormalSettlementPage.vue b/src/modules/finance/pages/FinanceFormalSettlementPage.vue index a7014e91..d14f3c94 100644 --- a/src/modules/finance/pages/FinanceFormalSettlementPage.vue +++ b/src/modules/finance/pages/FinanceFormalSettlementPage.vue @@ -122,7 +122,7 @@ async function openCreate() { } else { const [fees, suppliers] = await Promise.all([ listFinanceFeePool(customerId, 'PAYABLE'), - listPlatformPartners({ page: 1, size: 200, type: 'SUPPLIER', status: 'ACTIVE' }), + listPlatformPartners({ page: 1, size: 200, status: 'ACTIVE' }), ]) feeOptions.value = fees.filter((item) => item.feeSourceId && item.status === 'AVAILABLE') supplierOptions.value = suppliers.records diff --git a/src/modules/finance/pages/FinanceG3G4Views.test.ts b/src/modules/finance/pages/FinanceG3G4Views.test.ts index 1053f491..46e26c4f 100644 --- a/src/modules/finance/pages/FinanceG3G4Views.test.ts +++ b/src/modules/finance/pages/FinanceG3G4Views.test.ts @@ -70,7 +70,7 @@ describe('Finance G3/G4 views', () => { document.body.innerHTML = '' const customer = { id: '10001', tenantName: '客户A', status: 'ACTIVE' } as PlatformTenantResource vi.mocked(listPlatformTenants).mockReset().mockResolvedValue({ records: [customer], page: 1, size: 200, total: 1, pages: 1 }) - vi.mocked(listPlatformPartners).mockReset().mockResolvedValue({ records: [{ id: '301', tenantId: '0', dataScopeId: '0', partnerCode: 'SUP-301', partnerName: '供应商A', partnerType: 'SUPPLIER', types: ['SUPPLIER'], contactName: '', contactPhone: '', contactEmail: null, countryCode: 'CN', province: null, city: '', district: null, addressLine: '', postalCode: null, status: 'ACTIVE', remark: null } as PlatformPartnerResource], page: 1, size: 200, total: 1, pages: 1 }) + vi.mocked(listPlatformPartners).mockReset().mockResolvedValue({ records: [{ id: '301', tenantId: '0', dataScopeId: '0', partnerCode: 'PARTNER-301', partnerName: '往来单位A', partnerType: 'CUSTOMER', types: ['CUSTOMER'], contactName: '', contactPhone: '', contactEmail: null, countryCode: 'CN', province: null, city: '', district: null, addressLine: '', postalCode: null, status: 'ACTIVE', remark: null } as PlatformPartnerResource], page: 1, size: 200, total: 1, pages: 1 }) vi.mocked(listFinanceStatements).mockReset().mockResolvedValue([statement]) vi.mocked(getReconciliationStatement).mockReset().mockResolvedValue(statementDetail) vi.mocked(actionReconciliationStatement).mockReset().mockResolvedValue(statementDetail) @@ -106,8 +106,8 @@ describe('Finance G3/G4 views', () => { const wrapper = await mountWithAccess(FinanceFormalSettlementPage, ['platform:finance:settlement-ap:view', 'platform:finance:settlement-ap:create', 'platform:finance:payment:create'], { kind: 'payable' }) const vm = wrapper.vm as unknown as { load(model: Record): Promise; openCreate(): Promise; submitCreate(): Promise; openPayment(row: FinancePayableSettlement): void; submitPayment(): Promise; createForm: { supplierId: string; dueDate: string; feeSourceIds: string[] }; paymentFile: File | null; paymentForm: { amount: number; transactionDate: string; method: 'BANK_TRANSFER'; referenceNo: string; remark: string } } await vm.load({ customerId: '10001' }); await vm.openCreate() - expect(listPlatformPartners).toHaveBeenCalledWith({ page: 1, size: 200, type: 'SUPPLIER', status: 'ACTIVE' }) - expect(document.body.textContent).toContain('供应商A · SUP-301') + expect(listPlatformPartners).toHaveBeenCalledWith({ page: 1, size: 200, status: 'ACTIVE' }) + expect(document.body.textContent).toContain('往来单位A · PARTNER-301') Object.assign(vm.createForm, { supplierId: '301', dueDate: '2026-09-30', feeSourceIds: ['81'] }) await vm.submitCreate() expect(createPayableSettlement).toHaveBeenCalledWith({ customerId: '10001', supplierId: '301', feeSourceIds: ['81'], dueDate: '2026-09-30', currency: 'CNY' }) diff --git a/src/modules/inbounds/pages/InboundOrdersView.test.ts b/src/modules/inbounds/pages/InboundOrdersView.test.ts index c75b601c..032ac439 100644 --- a/src/modules/inbounds/pages/InboundOrdersView.test.ts +++ b/src/modules/inbounds/pages/InboundOrdersView.test.ts @@ -294,19 +294,29 @@ describe('InboundOrdersView', () => { const columnSource = source.slice(source.indexOf('const columns:')) const operation = columnSource.indexOf("key: 'actions'") const inboundCode = columnSource.indexOf("key: 'inboundCode'") + const processStatus = columnSource.indexOf("key: 'processStatus'") const orderStatus = columnSource.indexOf("key: 'orderStatus'") const measureReview = columnSource.indexOf("key: 'measureReviewStatus'") const feeStatus = columnSource.indexOf("key: 'feeStatus'") + const feeReviewStatus = columnSource.indexOf("key: 'feeReviewStatus'") const customer = columnSource.indexOf("key: 'customerName'") const warehouse = columnSource.indexOf("key: 'warehouseName'") expect(operation).toBeGreaterThan(-1) expect(operation).toBeLessThan(inboundCode) - expect(inboundCode).toBeLessThan(orderStatus) + expect(inboundCode).toBeLessThan(processStatus) + expect(processStatus).toBeLessThan(orderStatus) expect(orderStatus).toBeLessThan(measureReview) expect(measureReview).toBeLessThan(feeStatus) - expect(feeStatus).toBeLessThan(customer) + expect(feeStatus).toBeLessThan(feeReviewStatus) + expect(feeReviewStatus).toBeLessThan(customer) expect(customer).toBeLessThan(warehouse) expect(columnSource).toContain("fixed: 'left'") + expect(columnSource).toContain("{ key: 'processStatus', label: '入库流程状态'") + expect(columnSource).toContain("{ key: 'orderStatus', label: '订单状态'") + expect(columnSource).toContain("{ key: 'feeStatus', label: '费用状态'") + expect(columnSource).toContain("{ key: 'feeReviewStatus', label: '费用审核状态'") + expect(source).toContain('