diff --git a/src/api/index.ts b/src/api/index.ts index 1526e93..b5a49a6 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -37,6 +37,63 @@ export const getLeads = (status = 'pending') => export const getServiceCustomers = (params: Record = {}) => apiGet('/admin/service-customers', params) +export type CustomerTimelineItem = { + eventId: string + eventType: string + occurredAt?: string | null + title: string + description: string + source?: string + actorRole?: string | null + actorName?: string | null + appointment?: { + id: number + appointmentTime?: string | null + endTime?: string | null + petName?: string | null + petType?: string | null + serviceType?: string | null + durationMinutes?: number + currentStatus?: string | null + } + report?: { + id: number + appointmentId?: number | null + petName?: string | null + serviceType?: string | null + sendStatus?: 'unknown' | 'unsent' | 'sent' | null + sentAt?: string | null + sendChannel?: 'wechat' | 'qr' | 'other' | null + } + lead?: { + id: number + reportId?: number | null + petName?: string | null + serviceType?: string | null + remindDate?: string | null + remindStatus?: string | null + } +} + +export type CustomerTimelineResponse = { + customer: { + storeCustomerId: number + displayName?: string | null + phoneMasked?: string | null + originSource?: string | null + firstContactAt?: string | null + lastContactAt?: string | null + } + total: number + page: number + pageSize: number + hasMore: boolean + list: CustomerTimelineItem[] +} + +export const getServiceCustomerTimeline = (storeCustomerId: number, page = 1, pageSize = 20) => + apiGet('/admin/service-customers/timeline', { storeCustomerId, page, pageSize }) + export const getWorkbenchReportFunnel = (date?: string) => apiGet('/admin/workbench/report-funnel', date ? { date } : {}) diff --git a/src/views/CustomersView.vue b/src/views/CustomersView.vue index ba9dc79..355bd68 100644 --- a/src/views/CustomersView.vue +++ b/src/views/CustomersView.vue @@ -35,17 +35,23 @@ - + @@ -61,7 +119,13 @@