修复订单货柜预约与排车维护界面

This commit is contained in:
2026-10-21 23:20:10 +08:00
parent 93a31b3872
commit 2e26477db5
68 changed files with 602 additions and 239 deletions
@@ -19,7 +19,7 @@ import { overseasWarehousePermissions as permission } from '../permissions'
const can = vi.hoisted(() => vi.fn((_code: string) => true))
vi.mock('@/core/access/accessPreview', () => ({ useAccessPreviewStore: () => ({ can }) }))
vi.mock('vue-router', () => ({ useRoute: () => ({ params: { orderId: 'IP-1' }, query: { customerId: 'C-1' } }), useRouter: () => ({ push: vi.fn() }), onBeforeRouteLeave: vi.fn(), onBeforeRouteUpdate: vi.fn() }))
vi.mock('@/modules/appointment-calendar', () => ({ appointmentReturnTarget: () => null, AppointmentConfirmationCargo: { name: 'AppointmentConfirmationCargo', mounted() { this.$emit('ready', true) }, methods: { canLeave: async () => true }, template: '<div />' } }))
vi.mock('@/modules/appointment-calendar', () => ({ appointmentReturnTarget: () => null, AppointmentConfirmationCargo: { name: 'AppointmentConfirmationCargo', mounted(this: { $emit: (event: string, value: boolean) => void }) { this.$emit('ready', true) }, methods: { canLeave: async () => true }, template: '<div />' } }))
vi.mock('../components/SmartDispatchDialog.vue', () => ({ default: { name: 'SmartDispatchDialog', template: '<div />' } }))
vi.mock('../api/inboundOrders', () => ({ createFbaAppointment: vi.fn(), getFbaAppointment: vi.fn(), listInboundOrders: vi.fn(), updateFbaAppointment: vi.fn(), updateInboundPlan: vi.fn() }))
vi.mock('../api/inboundPlans', () => ({ getInboundPlan: vi.fn(), moveInboundPallet: vi.fn() }))
@@ -88,7 +88,8 @@ describe('inbound appointment native dialogs', () => {
vi.mocked(updateFbaAppointment).mockReturnValueOnce(new Promise((_, no) => { reject = no })).mockResolvedValueOnce({ ...appointment })
const { dialog } = await openEditAppointment()
const fields = dialog.getComponent(FbaAppointmentFields)
fields.props('model').appointmentRemark = '交接备注'; await flushPromises()
Object.assign(fields.props('model'), { appointmentRemark: '交接备注', confirmationNo: 'EXT-CONFIRMED', appointmentAt: '2026-10-25T09:30:00' })
fields.vm.$emit('confirmationReady', true); await flushPromises()
dialog.vm.$emit('confirm'); dialog.vm.$emit('confirm'); await flushPromises()
expect(updateFbaAppointment).toHaveBeenCalledTimes(1)
const original = vi.mocked(updateFbaAppointment).mock.calls[0]!