From ee174f8265d2c2586d6769c135125ecec36a5f66 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Sun, 11 Oct 2026 14:14:49 +0800 Subject: [PATCH] fix: close appointment cancellation bypass and clarify verified cargo --- .../AppointmentCalendarView.test.ts | 12 ++++++ .../AppointmentCalendarView.vue | 6 +++ .../AppointmentImpactDialog.test.ts | 17 +++++++-- .../AppointmentImpactDialog.vue | 18 ++++++--- .../capacityOfferTypes.ts | 1 + .../components/CapacityInquiryDialog.vue | 13 ++++--- .../components/CapacityInquiryTable.vue | 6 +-- .../pages/CapacityOffersBehavior.test.ts | 21 +++++++++++ .../overseas-warehouse/appointmentForm.ts | 3 +- .../components/FbaAppointmentFields.vue | 4 +- .../InboundOrdersView.appointment.test.ts | 37 +++++++++++++++++++ .../pages/InboundOrdersView.vue | 15 +++++++- .../pages/realApiMount.test.ts | 2 +- 13 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 src/modules/overseas-warehouse/pages/InboundOrdersView.appointment.test.ts diff --git a/src/modules/appointment-calendar/AppointmentCalendarView.test.ts b/src/modules/appointment-calendar/AppointmentCalendarView.test.ts index 5740c46c..365c3e15 100644 --- a/src/modules/appointment-calendar/AppointmentCalendarView.test.ts +++ b/src/modules/appointment-calendar/AppointmentCalendarView.test.ts @@ -70,6 +70,18 @@ describe('appointment calendar data integration', () => { vi.mocked(createFbaAppointment).mockResolvedValue({ version: 0, id: '1', appointmentNo: 'APT-AB', plannedDate: '2026-10-09', appointmentAt: null, originWarehouseId: '100', appointmentStatus: 'PENDING', selectedCount: 2, fbaWarehouseCode: 'ONT8', items: [] }) }) + it('uses the dedicated cancellation dialog for an undated appointment instead of editing its status', async () => { + const record = { version: 3, id: '1', appointmentNo: 'AP-UNDATED', originWarehouseId: '100', appointmentStatus: 'PENDING', selectedCount: 1, fbaWarehouseCode: 'ABE3', items: [] } + vi.mocked(listUnscheduledAppointments).mockResolvedValue({records: [record], total: 1}) + vi.mocked(getFbaAppointment).mockResolvedValue(record) + const wrapper=render(); await flushPromises() + await wrapper.findAll('button').find(button=>button.text()==='查看 / 继续')!.trigger('click'); await flushPromises() + expect(wrapper.find('option[value="CANCELLED"]').exists()).toBe(false) + await wrapper.get('[data-cancel-editing]').trigger('click'); await flushPromises() + expect(wrapper.findComponent({name:'AppointmentCancellationDialog'}).attributes('appointment-no')).toBe('AP-UNDATED') + expect(wrapper.find('[data-save]').exists()).toBe(false) + expect(updateFbaAppointment).not.toHaveBeenCalled(); wrapper.unmount() + }) it('loads cancellation records only after expansion and opens cancelled appointments read-only', async () => { const record = { version: 1, id: '1', appointmentNo: 'AP-CANCEL', originWarehouseId: '100', appointmentStatus: 'CANCELLED', selectedCount: 1, fbaWarehouseCode: 'ABE3', items: [] } vi.mocked(getFbaAppointment).mockResolvedValue(record) diff --git a/src/modules/appointment-calendar/AppointmentCalendarView.vue b/src/modules/appointment-calendar/AppointmentCalendarView.vue index b1015197..8dffe02a 100644 --- a/src/modules/appointment-calendar/AppointmentCalendarView.vue +++ b/src/modules/appointment-calendar/AppointmentCalendarView.vue @@ -354,6 +354,11 @@ function remove(event: CalendarEvent) { if (!access.can('platform:appointment:delete') || loading.value || !canLeave()) return cancellationTarget.value = appointments.value.find(item => item.appointmentNo === event.key) || null } +function cancelEditing() { + if (!editing.value || editing.value.appointmentStatus === 'CANCELLED' || !access.can('platform:appointment:delete') || !canLeave()) return + cancellationTarget.value = editing.value + dialogOpen.value = false +} async function cancelled() { cancellationTarget.value = null; ++cancellationsRevision.value ElMessage.success('预约已取消,可在取消记录中查看原因与原记录') @@ -439,6 +444,7 @@ onBeforeUnmount(() => { ++unscheduledRequest; ++calendarRequest; ++candidateRequ

输入更完整的仓库编码或名称,缩小搜索范围。

+ 取消预约