diff --git a/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.test.ts b/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.test.ts index b61c4399..86693fd9 100644 --- a/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.test.ts +++ b/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.test.ts @@ -17,7 +17,7 @@ function mount(mode: 'incoming' | 'receipt' | 'bind' | 'view') { const field = { props: ['modelValue'], emits: ['update:modelValue'], template: '' } const wrapper = shallowMount(TripBookingFulfillmentDialog, { props: { modelValue: true, trip, booking, mode, arrivalAt: '2026-10-03T08:00:00Z' }, global: { plugins: [createPinia()], directives: { loading: () => undefined }, stubs: { AppDialog: { name: 'AppDialog', props: ['modelValue', 'confirmDisabled'], emits: ['confirm'], template: '
' }, - DataTable: { name: 'DataTable', props: ['data'], template: '
' }, + DataTable: { name: 'DataTable', props: ['data', 'columns'], template: '
' }, ElForm: { template: '
' }, ElFormItem: { template: '
' }, ElInputNumber: { ...field, name: 'ElInputNumber' }, ElDatePicker: field, ElInput: field, ElButton: { template: '' }, LoadErrorState: true, ApiErrorMeta: true, } } }); wrappers.push(wrapper); return wrapper @@ -27,9 +27,10 @@ afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount())) it('uses server actual pallets and preview versions while requiring explicit price confirmation', async () => { vi.mocked(api.acceptTripIncoming).mockResolvedValue({ tripRecordVersion: 6, booking: { ...booking, status: 'RECEIVED' }, replayed: false }) const wrapper = mount('receipt'); await flushPromises() - const inputs = wrapper.findAllComponents({ name: 'ElInputNumber' }); inputs[1]!.vm.$emit('update:modelValue', 55); await flushPromises() + expect(wrapper.findComponent({ name: 'DataTable' }).props('columns')).toContainEqual(expect.objectContaining({ key: 'spaces', singleLine: false })) + const inputs = wrapper.findAllComponents({ name: 'ElInputNumber' }); inputs[0]!.vm.$emit('update:modelValue', 2); inputs[1]!.vm.$emit('update:modelValue', 55); await flushPromises() wrapper.findComponent({ name: 'AppDialog' }).vm.$emit('confirm'); await flushPromises() - expect(api.acceptTripIncoming).toHaveBeenCalledWith('TR-1', 'FB-1', expect.objectContaining({ tripRecordVersion: 5, recordVersion: 2, receiptHash: 'receipt-hash', unitPrice: 55, pallets: [{ warehousePalletId: '902', palletSpaces: 1 }] })) + expect(api.acceptTripIncoming).toHaveBeenCalledWith('TR-1', 'FB-1', expect.objectContaining({ tripRecordVersion: 5, recordVersion: 2, receiptHash: 'receipt-hash', unitPrice: 55, pallets: [{ warehousePalletId: '902', palletSpaces: 2 }] })) expect(api.startTripIncoming).not.toHaveBeenCalled(); expect(api.bindTripBookingDispatch).not.toHaveBeenCalled() }) it('does not accept a receipt while the warehouse is still waiting for actual goods', async () => { diff --git a/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.vue b/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.vue index e02faafd..036e9220 100644 --- a/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.vue +++ b/src/modules/overseas-master-data/components/TripBookingFulfillmentDialog.vue @@ -34,7 +34,7 @@ const incomingStatusLabel = computed(() => { }) const columns = computed(() => [{ key: 'palletNo', prop: 'palletNo', label: '实收托盘', minWidth: 180 }, { key: 'packages', prop: 'packages', label: '箱数', width: 95 }, { key: 'weightKg', prop: 'weightKg', label: '实测重量(kg)', minWidth: 150 }, { key: 'volumeCbm', prop: 'volumeCbm', label: '实测体积(m³)', minWidth: 150 }, - ...(props.mode === 'receipt' ? [{ key: 'spaces', label: '占用标准托位', slotName: 'spaces', width: 170 }] : [])]) + ...(props.mode === 'receipt' ? [{ key: 'spaces', label: '占用标准托位', slotName: 'spaces', width: 170, singleLine: false }] : [])]) async function load() { if (!props.booking) return const current = generation; loading.value = true; error.value = null @@ -100,7 +100,7 @@ onBeforeUnmount(() => { generation++ }) @@ -108,4 +108,4 @@ onBeforeUnmount(() => { generation++ }) - +