From ebff6f816771005639facdfacb5a182f4a471af7 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Sat, 10 Oct 2026 18:38:08 +0800 Subject: [PATCH] fix(appointments): show authoritative timezone and business source --- .../appointment-calendar/AppointmentCargoPanel.vue | 5 +++-- .../AppointmentImpactDialog.test.ts | 13 +++++++++++++ .../AppointmentImpactDialog.vue | 5 +++-- .../AppointmentTableRendering.test.ts | 12 ++++++++---- src/modules/appointment-calendar/planningApi.ts | 1 + 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/modules/appointment-calendar/AppointmentCargoPanel.vue b/src/modules/appointment-calendar/AppointmentCargoPanel.vue index 8286eb82..e3f38e1d 100644 --- a/src/modules/appointment-calendar/AppointmentCargoPanel.vue +++ b/src/modules/appointment-calendar/AppointmentCargoPanel.vue @@ -105,7 +105,7 @@ const columns: DataTableColumn[] = [ { prop: 'packages', label: '预报箱数', width: 100 }, { prop: 'receivedPackages', label: '实收箱数', width: 100 }, { prop: 'estimatedArrivalAt', label: '来源预计到港', minWidth: 170 }, - { prop: 'estimatedWarehouseAt', label: '已保存预计到仓', minWidth: 170 }, + { prop: 'estimatedWarehouseAt', label: '已保存预计到仓', minWidth: 180, slotName: 'warehouseEta', singleLine: false }, { key: 'progress', label: '当前事项', slotName: 'progress', minWidth: 170 }, ] @@ -179,6 +179,7 @@ onBeforeUnmount(() => { ++request; ++followupRequest; ++batchRequest; controller + diff --git a/src/modules/appointment-calendar/AppointmentImpactDialog.test.ts b/src/modules/appointment-calendar/AppointmentImpactDialog.test.ts index 9ddc3d72..b6bfef33 100644 --- a/src/modules/appointment-calendar/AppointmentImpactDialog.test.ts +++ b/src/modules/appointment-calendar/AppointmentImpactDialog.test.ts @@ -15,9 +15,22 @@ describe('appointment impact handling', () => { expect(wrapper.text()).toContain('2026-10-17T09:00:00') expect(wrapper.text()).toContain('2026-10-16T09:00:00') expect(wrapper.text()).toContain('无车次查看权限') + expect(wrapper.text()).toContain('来源:carrier') + expect(wrapper.text()).toContain('核对原因:到港预测变化') expect(wrapper.text()).not.toContain('认领跟进') expect(handleImpact).not.toHaveBeenCalled(); wrapper.unmount() }) + it('labels manual observations without exposing internal operator references and explains missing forecasts', async () => { + vi.mocked(getImpact).mockResolvedValueOnce({ ...detail, impact: { ...detail.impact, reason: 'FORECAST_MISSING', latest: { ...detail.impact.latest!, providerCode: 'MANUAL', sourceReference: 'MANUAL:1000001', estimatedAt: null } } }) + const wrapper = render(); await flushPromises() + expect(wrapper.text()).toContain('来源:人工维护') + expect(wrapper.text()).toContain('来源预计到港缺失,待核实') + expect(wrapper.text()).not.toContain('1000001') + expect(wrapper.text()).not.toContain('MANUAL:') + expect(wrapper.text()).not.toContain('已延误') + expect(wrapper.text()).toContain('认领跟进') + expect(handleImpact).not.toHaveBeenCalled(); wrapper.unmount() + }) it('freezes an uncertain command and retries exactly once with original version and key', async () => { vi.mocked(handleImpact).mockRejectedValueOnce(new Error('connection lost')).mockResolvedValueOnce({ ...detail.impact, version: 2 }) const wrapper = render(); await flushPromises() diff --git a/src/modules/appointment-calendar/AppointmentImpactDialog.vue b/src/modules/appointment-calendar/AppointmentImpactDialog.vue index 8bf0cdc7..b5c3cc1a 100644 --- a/src/modules/appointment-calendar/AppointmentImpactDialog.vue +++ b/src/modules/appointment-calendar/AppointmentImpactDialog.vue @@ -5,7 +5,7 @@ import { ElMessage } from 'element-plus' import AppDialog from '@/shared/components/AppDialog.vue' import LoadErrorState from '@/shared/components/LoadErrorState.vue' import { getApiErrorDetails, type ApiErrorDetails } from '@/shared/api/http' -import { getImpact, handleImpact, impactStatus, type ImpactDetail, type ImpactCommand } from './impactApi' +import { getImpact, handleImpact, impactStatus, impactReason, type ImpactDetail, type ImpactCommand } from './impactApi' const props = defineProps<{ containerId: string; canWrite: boolean }>() const emit = defineEmits<{ close: []; saved: [] }>() const router = useRouter(), detail = ref(null), loading = ref(false), saving = ref(false), historyPage = ref(1) @@ -35,8 +35,9 @@ onMounted(load)