diff --git a/src/api/index.ts b/src/api/index.ts index a722781..4d04bc9 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -36,6 +36,9 @@ export const getServiceCustomers = (params: Record = {}) => export const getWorkbenchReportFunnel = (date?: string) => apiGet('/admin/workbench/report-funnel', date ? { date } : {}) +export const getWorkbenchActions = () => + apiGet('/admin/workbench/actions') + export const getAdminStore = () => apiGet>('/admin/store') export const updateStore = (data: Record) => apiPut('/store/update', data) diff --git a/src/views/AppointmentsView.vue b/src/views/AppointmentsView.vue index 7af3f1d..6e69770 100644 --- a/src/views/AppointmentsView.vue +++ b/src/views/AppointmentsView.vue @@ -20,6 +20,8 @@ 待出报告 + 已过预约时间 + 今日完成 查询 重置 @@ -132,6 +134,8 @@ const dateFilter = ref((route.query.date as string) || '') const dateRange = ref<[string, string] | ''>('') const staffId = ref() const missingReport = ref(route.query.missingReport === '1') +const overdueOnly = ref(route.query.overdue === '1') +const completedTodayOnly = ref(route.query.completedToday === '1') function appointmentRange(row: Appt): string { const start = String(row.appointmentTime || '').replace('T', ' ').slice(0, 16) @@ -195,6 +199,17 @@ async function load() { if (missingReport.value) { list = list.filter((a) => a.status === 'doing' && !a.hasReport) } + if (overdueOnly.value) { + const now = Date.now() + list = list.filter((a) => { + const appointmentAt = Date.parse(String(a.appointmentTime || '')) + return a.status === 'new' && !Number.isNaN(appointmentAt) && appointmentAt < now + }) + } + if (completedTodayOnly.value) { + const today = todayPrefix() + list = list.filter((a) => a.status === 'done' && String(a.updateTime || '').startsWith(today)) + } if (keyword.value.trim()) { const q = keyword.value.trim() list = list.filter((a) => @@ -216,6 +231,8 @@ function reset() { dateRange.value = '' staffId.value = undefined missingReport.value = false + overdueOnly.value = false + completedTodayOnly.value = false load() } @@ -265,6 +282,10 @@ onMounted(async () => { } await loadStaff() await load() + const focusId = Number(route.query.id) + if (Number.isFinite(focusId) && focusId > 0) { + await openDetail({ id: focusId }) + } }) diff --git a/src/views/WorkbenchView.vue b/src/views/WorkbenchView.vue index 64af32d..10c8b1c 100644 --- a/src/views/WorkbenchView.vue +++ b/src/views/WorkbenchView.vue @@ -1,197 +1,631 @@