From f9744bf5de57fe644104c81cb5946eefe5915b93 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Tue, 20 Oct 2026 22:06:35 +0800 Subject: [PATCH] fix(appointments): use Element date and time pickers --- .../AppointmentBatchForm.test.ts | 4 ++- .../AppointmentBatchForm.vue | 4 +-- .../AppointmentCalendarDialogs.native.test.ts | 20 +++++++++-- .../AppointmentCalendarView.test.ts | 4 ++- .../AppointmentCalendarView.vue | 4 +-- .../appointment-calendar/PROTOTYPE_MATRIX.md | 15 ++++++++ .../WorkCommandForm.test.ts | 8 +++-- .../appointment-calendar/WorkCommandForm.vue | 4 +-- .../WorkReceivingPanel.test.ts | 2 ++ .../WorkReceivingPanel.vue | 10 +++--- .../temporal-picker.test-support.ts | 8 +++++ .../temporalControls.test.ts | 36 +++++++++++++++++++ src/styles/adminDensity.test.ts | 3 +- 13 files changed, 102 insertions(+), 20 deletions(-) create mode 100644 src/modules/appointment-calendar/temporal-picker.test-support.ts create mode 100644 src/modules/appointment-calendar/temporalControls.test.ts diff --git a/src/modules/appointment-calendar/AppointmentBatchForm.test.ts b/src/modules/appointment-calendar/AppointmentBatchForm.test.ts index eb2aea64..9a3800c3 100644 --- a/src/modules/appointment-calendar/AppointmentBatchForm.test.ts +++ b/src/modules/appointment-calendar/AppointmentBatchForm.test.ts @@ -1,3 +1,4 @@ +import { DatePickerStub, TimePickerStub } from './temporal-picker.test-support' import { flushPromises, mount } from '@vue/test-utils' import { beforeEach, expect, it, vi } from 'vitest' import AppointmentBatchForm from './AppointmentBatchForm.vue' @@ -13,6 +14,7 @@ vi.mock('./batchApi', async original => ({ ...await original ({ ...await original(), getWorkItems: vi.fn() })) let guard: LeaveGuard function render() { return mount(AppointmentBatchForm, { props: { batchKey: 'FBA_APPOINTMENT:1' }, global: { provide: { 'appointment-work-leave-guard': (value: LeaveGuard) => { guard = value; return () => undefined } }, stubs: { + ElDatePicker: DatePickerStub, ElTimePicker: TimePickerStub, ElButton: { props: ['nativeType', 'disabled'], template: '' }, LoadErrorState: { props: ['message'], template: '
{{ message }}
' }, ApiErrorMeta: true, CargoVerificationForm: true, } } }) } @@ -176,7 +178,7 @@ it('retries a new destination without exposing the prior batch or retaining its expect(wrapper.text()).not.toContain('AP-001'); expect(wrapper.find('form').exists()).toBe(false) await wrapper.get('[role="alert"] button').trigger('click'); await flushPromises() expect(wrapper.text()).toContain('AP-CURRENT') - expect((wrapper.findAll('input[type="date"]')[0]!.element as HTMLInputElement).value).toBe('2026-10-22') + expect((wrapper.findAll('input[data-picker-kind="date"]')[0]!.element as HTMLInputElement).value).toBe('2026-10-22') expect((wrapper.get('[aria-label="来源1分出箱数"]').element as HTMLInputElement).value).toBe('0') expect(getAppointmentBatch).toHaveBeenLastCalledWith('FBA_APPOINTMENT:2') expect(repartitionAppointments).not.toHaveBeenCalled(); wrapper.unmount() diff --git a/src/modules/appointment-calendar/AppointmentBatchForm.vue b/src/modules/appointment-calendar/AppointmentBatchForm.vue index a404117b..d6701b5a 100644 --- a/src/modules/appointment-calendar/AppointmentBatchForm.vue +++ b/src/modules/appointment-calendar/AppointmentBatchForm.vue @@ -121,10 +121,10 @@ onMounted(() => load())

{{ reason }}

当前批次无分批资格,以下为原预约保留的货物资料。

来源 {{ index + 1 }} · {{ item.inboundCode || '原票业务号未提供' }}

{{ item.fbaWarehouseCode }} · {{ item.packageCount ?? '箱数待核实' }} 箱

货件:{{ item.shipmentReferences?.join('、') || '待核实' }}

分成两次送仓同仓合并安排
-
+
来源 {{ index + 1 }} · {{ sourceLabel(source) }}

本批 {{ source.packageCount ?? '待核实' }} 箱 · 原箱数 {{ source.originalPackages ?? '未知' }}

货件:{{ source.shipmentReferences.join('、') || '待核实' }}

核实本票资料
-