diff --git a/src/modules/appointment-calendar/AppointmentCargoPanel.vue b/src/modules/appointment-calendar/AppointmentCargoPanel.vue index 19848d92..8286eb82 100644 --- a/src/modules/appointment-calendar/AppointmentCargoPanel.vue +++ b/src/modules/appointment-calendar/AppointmentCargoPanel.vue @@ -12,6 +12,7 @@ import RowActions from '@/shared/components/RowActions.vue' import { getApiErrorDetails, type ApiErrorDetails } from '@/shared/api/http' import { listPlanningCargo, resolvePlanningSource, previewPlanningBatch, createSourceAppointment, type SourceAppointmentPayload, type PlanningBatchPreview, type ResolvedPlanningSource, type PlanningCargo, type PlanningSource } from './planningApi' import AppointmentFollowupDialog from './AppointmentFollowupDialog.vue' +import AppointmentExternalCandidates from './AppointmentExternalCandidates.vue' import { useAccessPreviewStore } from '@/core/access/accessPreview' const router = useRouter() @@ -22,6 +23,8 @@ const arrangement = reactive(createAppointmentForm()) const creating = ref(false), createError = ref(null) const pendingCreate = ref(null) const following = ref(null) +const candidateMode = ref<'firstleg' | 'external'>('firstleg') +const externalRevision = ref(0) const followupError = ref(null) type Selection = Pick & { bookingNo?: string | null } const selected = ref>({}) @@ -76,7 +79,7 @@ async function saveArrangement() { try { const result = await createSourceAppointment(pendingCreate.value) pendingCreate.value = null; batchPreview.value = null; selected.value = {} - ElMessage.success(`预约安排 ${result.appointmentNo} 已保存`); emit('created'); await load() + ElMessage.success(`预约安排 ${result.appointmentNo} 已保存`); ++externalRevision.value; emit('created'); await load() } catch (cause) { createError.value = getApiErrorDetails(cause, '保存结果待核实,请重试原请求') if (['400','403','404','409','A0400','A0403','A0404','A0409'].includes(createError.value.code || '')) pendingCreate.value = null @@ -122,7 +125,7 @@ async function load(reset = false) { function source(row: PlanningCargo) { return router.push({ name: 'overseas-last-mile-order-detail', params: { orderId: row.orderId }, query: { customerId: row.customerId } }) } -async function openFollowup(row: PlanningCargo) { +async function openFollowup(row: Pick) { const request = ++followupRequest followupError.value = null try { @@ -135,7 +138,24 @@ onBeforeUnmount(() => { ++request; ++followupRequest; ++batchRequest; controller