From 724848feb6328f4c6cd54bf5300e61ca9d014536 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 14 Aug 2026 13:03:11 +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 --- .../container-loading/pages/ContainersView.test.ts | 8 ++++++++ .../pages/GlobalSmartLoadingView.test.ts | 8 ++++++++ .../loading-lists/components/LoadingListsView.test.ts | 6 ++++++ .../ocean-bookings/pages/OceanBookingDetailView.test.ts | 3 +++ .../pages/OutboundDispatchesView.test.ts | 8 ++++++++ .../port-schedules/pages/PortSchedulesView.test.ts | 3 +++ .../trucking/components/TruckAppointmentForm.test.ts | 3 +++ 7 files changed, 39 insertions(+) diff --git a/src/modules/container-loading/pages/ContainersView.test.ts b/src/modules/container-loading/pages/ContainersView.test.ts index 7e8d5f8b..e5af92c8 100644 --- a/src/modules/container-loading/pages/ContainersView.test.ts +++ b/src/modules/container-loading/pages/ContainersView.test.ts @@ -129,6 +129,14 @@ describe('ContainersView', () => { expect(push).toHaveBeenNthCalledWith(3, { name: 'loading-lists', query: { planId: '9103', warehouseId: '8' } }) }) + it('uses active customer names and sends the stable customerId filter', () => { + const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/ContainersView.vue'), 'utf8') + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain("customer.legalName?.trim() || customer.tenantName") + expect(source).toContain('customerId: applied.value.customerId || undefined') + expect(source).not.toContain('customer.tenantCode') + }) + it('uses the list permission for detail while keeping edit independent', async () => { accessCan.mockImplementation((permission: string) => permission === 'platform:firstleg:container:list') const router = createTestRouter() diff --git a/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts b/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts index 58a02296..dfb5a373 100644 --- a/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts +++ b/src/modules/container-loading/pages/GlobalSmartLoadingView.test.ts @@ -76,6 +76,14 @@ describe('GlobalSmartLoadingView', () => { expect(wrapper.text()).toContain('ORD-1') }) + it('filters candidates by an active name-only customer selector and accountId', () => { + const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/GlobalSmartLoadingView.vue'), 'utf8') + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain("customer.legalName?.trim() || customer.tenantName") + expect(source).toContain('item.accountId !== customerId') + expect(source).not.toContain('customer.tenantCode') + }) + it('rounds capacity percentages and hides column settings in embedded tables', async () => { vi.mocked(listContainers).mockResolvedValue({ records: [{ ...container, capacityCbm: 100, maxWeightKg: 100000 }], page: 1, size: 100, total: 1, pages: 1 }) vi.mocked(getSmartLoadingPlanByBooking).mockResolvedValue({ diff --git a/src/modules/loading-lists/components/LoadingListsView.test.ts b/src/modules/loading-lists/components/LoadingListsView.test.ts index 2e8748f6..6ab89a4a 100644 --- a/src/modules/loading-lists/components/LoadingListsView.test.ts +++ b/src/modules/loading-lists/components/LoadingListsView.test.ts @@ -7,6 +7,12 @@ const detailSource = readFileSync(resolve(process.cwd(), 'src/modules/loading-li const preloadDetailSource = readFileSync(resolve(process.cwd(), 'src/modules/loading-lists/pages/PreloadPlanDetailView.vue'), 'utf8') describe('LoadingListsView', () => { + it('filters both list modes by an active name-only customer selector', () => { + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain("customer.legalName?.trim() || customer.tenantName") + expect(source).toContain("customerId: String(query.customerId || '').trim() || undefined") + expect(source).not.toContain('customer.tenantCode') + }) it('keeps the operation column first and fixed left in both lists', () => { const actionColumns = [...source.matchAll(/key: 'actions', label: '操作', fixed: 'left'/g)] expect(actionColumns).toHaveLength(2) diff --git a/src/modules/ocean-bookings/pages/OceanBookingDetailView.test.ts b/src/modules/ocean-bookings/pages/OceanBookingDetailView.test.ts index a633338b..0a5148fd 100644 --- a/src/modules/ocean-bookings/pages/OceanBookingDetailView.test.ts +++ b/src/modules/ocean-bookings/pages/OceanBookingDetailView.test.ts @@ -17,6 +17,9 @@ describe('OceanBookingDetailView interaction contract', () => { }) it('hides unavailable customers instead of filling the selector with disabled options', () => { + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain('customer.legalName?.trim() || customer.tenantName') + expect(source).not.toContain('customer.tenantCode') expect(source).toContain("customer.status === 'ACTIVE' || String(customer.id) === String(form.data.customerId)") expect(source).toContain('v-for="customer in selectableCustomers"') expect(source).not.toContain(':disabled="customer.status !== \'ACTIVE\'"') diff --git a/src/modules/outbound-dispatch/pages/OutboundDispatchesView.test.ts b/src/modules/outbound-dispatch/pages/OutboundDispatchesView.test.ts index 9dd634f1..d27861ca 100644 --- a/src/modules/outbound-dispatch/pages/OutboundDispatchesView.test.ts +++ b/src/modules/outbound-dispatch/pages/OutboundDispatchesView.test.ts @@ -72,6 +72,14 @@ describe('OutboundDispatchesView', () => { expect(wrapper.text()).not.toContain('READY_FOR_DISPATCH') }) + it('loads only active customer names for the filter', () => { + const source = readFileSync(resolve(process.cwd(), 'src/modules/outbound-dispatch/pages/OutboundDispatchesView.vue'), 'utf8') + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain("records.filter((customer) => customer.status === 'ACTIVE')") + expect(source).toContain("item.legalName?.trim() || item.tenantName") + expect(source).not.toContain('item.tenantCode') + }) + it('does not issue a search when reset returns to the initial state', async () => { const wrapper = mountPage() await flushPromises() diff --git a/src/modules/port-schedules/pages/PortSchedulesView.test.ts b/src/modules/port-schedules/pages/PortSchedulesView.test.ts index 032d9c8d..39ec5e99 100644 --- a/src/modules/port-schedules/pages/PortSchedulesView.test.ts +++ b/src/modules/port-schedules/pages/PortSchedulesView.test.ts @@ -28,6 +28,9 @@ describe('PortSchedulesView', () => { expect(source).toContain("from '@/modules/ocean-bookings'") expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") expect(source).toContain('listOceanBookings({ page: 1, size: 200, customerId })') + expect(source).toContain("customerId: String(query.customerId || '') || undefined") + expect(source).toContain('customer.legalName?.trim() || customer.tenantName') + expect(source).not.toContain('customer.tenantCode') expect(source).toContain("form.oceanBookingId = ''") expect(source).not.toContain('label="客户 ID"') expect(source).not.toContain('label="订舱 ID"') diff --git a/src/modules/trucking/components/TruckAppointmentForm.test.ts b/src/modules/trucking/components/TruckAppointmentForm.test.ts index bb9a4e5d..18332926 100644 --- a/src/modules/trucking/components/TruckAppointmentForm.test.ts +++ b/src/modules/trucking/components/TruckAppointmentForm.test.ts @@ -13,6 +13,9 @@ describe('TruckAppointmentForm interaction contract', () => { expect(source).toContain('listAllPlatformWarehouses') expect(source).not.toContain('label="承运商 ID"') expect(source).not.toContain('label="客户关联 ID"') + expect(source).toContain("listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })") + expect(source).toContain('customer.legalName?.trim() || customer.tenantName') + expect(source).not.toContain('customer.tenantCode') }) it('synchronizes ids and names and recovers failed option loading', () => {