From f58c433fa4e74ac225eb5129a250a521d2ac48b0 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 9 Sep 2026 17:17:05 +0800 Subject: [PATCH] fix: complete container and overseas fee contracts --- .../pages/ContainersView.test.ts | 20 +++++++++++++++++++ .../pages/ContainersView.vue | 2 +- .../pages/LastMileOrderDetailView.vue | 4 ++-- .../pages/OutboundsView.test.ts | 6 +++--- .../pages/prototypeContract.test.ts | 5 ++++- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/modules/container-loading/pages/ContainersView.test.ts b/src/modules/container-loading/pages/ContainersView.test.ts index 380f18de..2982e732 100644 --- a/src/modules/container-loading/pages/ContainersView.test.ts +++ b/src/modules/container-loading/pages/ContainersView.test.ts @@ -699,6 +699,26 @@ describe('ContainersView', () => { wrapper.unmount() }) + it.each([undefined, null, '', '客户一'])('renders optional booking customer %s without leaking a missing value', async (customerName) => { + vi.mocked(listOceanBookingLinkCandidates).mockResolvedValueOnce({ records: [{ + oceanBookingId: '315', bookingNo: 'OB-OPTIONAL-CUSTOMER', requirementId: '45315', + containerType: '40HC', remainingQuantity: 1, customerName, warehouseName: '义乌仓', channelName: 'EXX海卡', + }], page: 1, size: 200, total: 1, pages: 1 } as never) + const router = createTestRouter() + await router.push('/'); await router.isReady() + const wrapper = mount(ContainersView, { attachTo: document.body, global: { plugins: [ElementPlus, router] } }) + await flushPromises() + await wrapper.find('button[aria-label="更多货柜操作"]').trigger('click') + await flushPromises() + Array.from(document.body.querySelectorAll('.el-dropdown-menu__item')) + .filter((item) => item.textContent?.includes('关联已放舱订舱')).at(-1)!.click() + await flushPromises() + const label = `OB-OPTIONAL-CUSTOMER · 40HC × 1 · ${customerName || '未关联客户'} · 义乌仓 · EXX海卡` + expect(document.body.textContent).toContain(label) + expect((wrapper.vm as unknown as { linkCandidates: Array<{ label: string }> }).linkCandidates[0]?.label).toBe(label) + wrapper.unmount() + }) + it('keeps a three-field match selectable when only capacity snapshots differ and blocks duplicate waves', async () => { let resolveCandidates!: (value: Awaited>) => void vi.mocked(listContainers).mockResolvedValue({ records: [{ diff --git a/src/modules/container-loading/pages/ContainersView.vue b/src/modules/container-loading/pages/ContainersView.vue index 14cf01a1..642b8a90 100644 --- a/src/modules/container-loading/pages/ContainersView.vue +++ b/src/modules/container-loading/pages/ContainersView.vue @@ -526,7 +526,7 @@ async function openLink(source: object) { oceanBookingId: candidate.oceanBookingId, requirementId: candidate.requirementId, disabled: false, - label: `${candidate.bookingNo} · ${candidate.containerType} × ${candidate.remainingQuantity} · ${candidate.customerName} · ${candidate.warehouseName} · ${candidate.channelName}`, + label: `${candidate.bookingNo} · ${candidate.containerType} × ${candidate.remainingQuantity} · ${candidate.customerName || '未关联客户'} · ${candidate.warehouseName} · ${candidate.channelName}`, })) } catch (error) { if (sequence === linkSequence) linkError.value = getApiErrorDetails(error, '已放舱订舱候选加载失败') diff --git a/src/modules/overseas-warehouse/pages/LastMileOrderDetailView.vue b/src/modules/overseas-warehouse/pages/LastMileOrderDetailView.vue index 1aa1314c..6886a3a6 100644 --- a/src/modules/overseas-warehouse/pages/LastMileOrderDetailView.vue +++ b/src/modules/overseas-warehouse/pages/LastMileOrderDetailView.vue @@ -183,13 +183,13 @@ onMounted(load)
- + - +
diff --git a/src/modules/overseas-warehouse/pages/OutboundsView.test.ts b/src/modules/overseas-warehouse/pages/OutboundsView.test.ts index 426df26b..d293f0f7 100644 --- a/src/modules/overseas-warehouse/pages/OutboundsView.test.ts +++ b/src/modules/overseas-warehouse/pages/OutboundsView.test.ts @@ -29,17 +29,17 @@ describe('OutboundsView permissions and navigation', () => { const wrapper = mount(OutboundsView, { global: { plugins: [ElementPlus] } }) await flushPromises() expect(wrapper.text()).toContain('详情') - expect(wrapper.text()).not.toContain('一件代发出库') + expect(wrapper.text()).not.toContain('新建出库单') expect(wrapper.text()).not.toContain('取消') expect(OutboundsView.__file).toContain('OutboundsView.vue') wrapper.unmount() }) - it('shows one-click creation and cancellation only with their exact permissions', async () => { + it('shows outbound creation and cancellation only with their exact permissions', async () => { canPermission.mockImplementation((code: string) => ['platform:overseas-warehouse:outbound:create', 'platform:overseas-warehouse:outbound:cancel'].includes(code)) const wrapper = mount(OutboundsView, { global: { plugins: [ElementPlus] } }) await flushPromises() - expect(wrapper.text()).toContain('一件代发出库') + expect(wrapper.text()).toContain('新建出库单') expect(wrapper.text()).toContain('取消') wrapper.unmount() }) diff --git a/src/modules/overseas-warehouse/pages/prototypeContract.test.ts b/src/modules/overseas-warehouse/pages/prototypeContract.test.ts index 918fac90..d3b1a48e 100644 --- a/src/modules/overseas-warehouse/pages/prototypeContract.test.ts +++ b/src/modules/overseas-warehouse/pages/prototypeContract.test.ts @@ -84,9 +84,12 @@ describe('overseas warehouse first-batch prototype contract', () => { const value = source(fileName) expect(value).toContain(' {