From 687d355246153ea44f2b6913785222e173088327 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Thu, 2 Jul 2026 10:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=BB=BA=E9=A2=84?= =?UTF-8?q?=E7=BA=A6=E5=90=8E=E8=A7=84=E5=88=92=E9=A1=B5=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JY-Salon-Front/src/views/AppointmentFormView.vue | 5 ++++- JY-Salon-Front/src/views/PlanningView.vue | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/JY-Salon-Front/src/views/AppointmentFormView.vue b/JY-Salon-Front/src/views/AppointmentFormView.vue index dbd99c1c..c9e8b4ab 100644 --- a/JY-Salon-Front/src/views/AppointmentFormView.vue +++ b/JY-Salon-Front/src/views/AppointmentFormView.vue @@ -705,7 +705,10 @@ const submit = async (): Promise => { const result = await managerPlanningApi.createAppointment(payload) removeDraftForm(session.userInfo) removeFormModalDraft(session.userInfo, APPOINTMENT_MODAL_STATE_DRAFT_NAME) - markPlanningRefresh() + markPlanningRefresh({ + date: result.date || form.appointmentDate, + artistId: String(result.artistId ?? form.artistId) + }) toast.success('预约已创建') await router.replace(`/appointments/${result.orderItemId}`) } finally { diff --git a/JY-Salon-Front/src/views/PlanningView.vue b/JY-Salon-Front/src/views/PlanningView.vue index a4bf9af6..301770bc 100644 --- a/JY-Salon-Front/src/views/PlanningView.vue +++ b/JY-Salon-Front/src/views/PlanningView.vue @@ -197,6 +197,7 @@ import { timeFromMinutes } from '@/utils/date' import { resolveAppointmentDate, resolveAppointmentStartMinute, resolveAppointmentTimeText, summaryMap } from '@/utils/planning' +import { consumePlanningRefresh } from '@/utils/storage' type ViewMode = 'day' | 'week' | 'month' type MonthDisplayMode = 'count' | 'blocks' | 'rows' @@ -438,6 +439,18 @@ const loadCalendar = async (): Promise => { } } +const loadInitialCalendar = async (): Promise => { + const refreshTarget = consumePlanningRefresh() + if (refreshTarget?.date) { + currentDateText.value = refreshTarget.date + viewMode.value = 'day' + } + if (refreshTarget?.artistId) { + selectedArtistId.value = refreshTarget.artistId + } + await loadCalendar() +} + const switchView = async (mode: ViewMode): Promise => { viewMode.value = mode await loadCalendar() @@ -484,7 +497,7 @@ const openAppointment = (id: IdType): void => { } onMounted(() => { - void loadCalendar() + void loadInitialCalendar() })