From 11ac18fadeb1a1104d3eb9dd6f2f85db7beeac82 Mon Sep 17 00:00:00 2001 From: xianyi Date: Mon, 22 Dec 2025 10:24:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=93=E6=A3=80=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=20=E8=80=97=E6=97=B6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97&=E6=B8=A0=E9=81=93=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/exam/ExamSection.tsx | 2 + src/data/mockData.ts | 219 ++-------------------------- src/pages/ExamPage.tsx | 27 +++- 3 files changed, 40 insertions(+), 208 deletions(-) diff --git a/src/components/exam/ExamSection.tsx b/src/components/exam/ExamSection.tsx index efc946e..71263d3 100644 --- a/src/components/exam/ExamSection.tsx +++ b/src/components/exam/ExamSection.tsx @@ -199,9 +199,11 @@ export const ExamSection = ({ >
{client.name} + {client.familyDoctorName && 家医:{client.familyDoctorName}} {client.level}
套餐:{client.packageName}
+
渠道:{client.channel ?? ''}
状态:{client.status} 已耗时:{client.elapsed} diff --git a/src/data/mockData.ts b/src/data/mockData.ts index fe80b3d..eebb706 100644 --- a/src/data/mockData.ts +++ b/src/data/mockData.ts @@ -10,226 +10,31 @@ export interface ExamClient { checkedItems: string[]; pendingItems: string[]; timeSlot: '上午' | '下午'; + channel: string; vipType: '高客' | '普客'; signStatus: '已登记' | '未登记'; customerType: '团客' | '散客'; guidePrinted?: boolean; addonCount?: number; + familyDoctorName?: string; [key: string]: unknown; } export type ExamModalTab = 'detail' | 'sign' | 'addon' | 'print' | 'delivery'; export type QuickActionType = 'none' | 'meal' | 'vip' | 'note'; -export const B1_ROWS: [string, string, number, number, number, number][] = [ - ['B超1', '张医生', 6, 2, 2, 15], - ['B超2', '李医生', 5, 2, 1, 14], - ['B超3', '王医生', 4, 2, 2, 16], - ['耳鼻喉', '王医生', 10, 3, 2, 10], - ['外科', '周医生', 8, 3, 2, 20], -]; - -export const B1_SUMMARY = { - totalClients: B1_ROWS.reduce((s, r) => s + r[2] + r[3] + r[4], 0), - waiting: B1_ROWS.reduce((s, r) => s + r[4], 0), - inExam: B1_ROWS.reduce((s, r) => s + r[3], 0), -}; - -export const NORTH3_ROWS: [string, number, number][] = [ - ['刘医生', 15, 9], - ['高医生', 12, 7], - ['马医生', 18, 10], -]; - -export const NORTH3_SUMMARY = { - totalDoctor: NORTH3_ROWS.length, - totalAssigned: NORTH3_ROWS.reduce((s, r) => s + r[1], 0), - consult: NORTH3_ROWS.reduce((s, r) => s + r[2], 0), -}; - -export const EXAM_CLIENTS: ExamClient[] = [ - { - id: 'A001', - name: '张伟', - gender: '男', - age: 35, - level: 'VIP', - packageName: '高端入职体检套餐', - status: '体检中', - elapsed: '00:45', - checkedItems: ['签到', '更衣', '预检', '抽血'], - pendingItems: ['家医面诊', 'B超'], - timeSlot: '上午', - vipType: '高客', - signStatus: '已登记', - customerType: '团客', - guidePrinted: true, - addonCount: 2, - addonOptions: [ - { - id: 'addon_001', - name: '胸部 CT', - paid: true, - tags: [{ title: '热门', type: 1 }, { title: '肺结节筛查', type: 2 }], - originalPrice: '400.00', - currentPrice: '320.00', - }, - { - id: 'addon_002', - name: '肿瘤标志物组合', - paid: true, - tags: [{ title: '医生推荐', type: 3 }], - originalPrice: '300.00', - currentPrice: '260.00', - }, - { - id: 'addon_003', - name: '颈动脉超声', - paid: false, - tags: [{ title: '脑卒中风险', type: 2 }], - originalPrice: '260.00', - currentPrice: '220.00', - }, - { - id: 'addon_004', - name: '幽门螺杆菌检测', - paid: false, - tags: [{ title: '胃病筛查', type: 2 }], - originalPrice: '180.00', - currentPrice: '150.00', - }, - { - id: 'addon_005', - name: '骨密度检查', - paid: false, - tags: [{ title: '骨质疏松', type: 2 }], - originalPrice: '260.00', - currentPrice: '210.00', - }, - { - id: 'addon_006', - name: '心脏彩超', - paid: false, - tags: [{ title: '心功能评估', type: 2 }], - originalPrice: '380.00', - currentPrice: '320.00', - }, - { - id: 'addon_007', - name: '甲状腺功能全套', - paid: false, - tags: [{ title: '内分泌', type: 2 }], - originalPrice: '260.00', - currentPrice: '230.00', - }, - { - id: 'addon_008', - name: '颅脑核磁共振', - paid: false, - tags: [{ title: '高价值项目', type: 1 }], - originalPrice: '1200.00', - currentPrice: '980.00', - }, - { - id: 'addon_009', - name: '眼底照相 + 眼压', - paid: false, - tags: [{ title: '糖尿病并发症', type: 2 }], - originalPrice: '220.00', - currentPrice: '180.00', - }, - { - id: 'addon_010', - name: '女性宫颈癌筛查 (TCT+HPV)', - paid: false, - tags: [{ title: '女性建议加选', type: 3 }], - originalPrice: '600.00', - currentPrice: '520.00', - }, - { - id: 'addon_011', - name: '男性前列腺专项', - paid: false, - tags: [{ title: '男性专项', type: 2 }], - originalPrice: '260.00', - currentPrice: '220.00', - }, - { - id: 'addon_012', - name: '脑血管 CT (CTA)', - paid: false, - tags: [{ title: '高风险人群', type: 1 }], - originalPrice: '1500.00', - currentPrice: '1200.00', - }, - { - id: 'addon_013', - name: '肝纤维化评估', - paid: false, - tags: [{ title: '肝病风险', type: 2 }], - originalPrice: '360.00', - currentPrice: '300.00', - }, - { - id: 'addon_014', - name: '全身动脉硬化筛查', - paid: false, - tags: [{ title: '血管评估', type: 2 }], - originalPrice: '480.00', - currentPrice: '420.00', - }, - { - id: 'addon_015', - name: '睡眠呼吸监测', - paid: false, - tags: [{ title: '打鼾/睡眠差', type: 2 }], - originalPrice: '520.00', - currentPrice: '460.00', - }, - ], - }, - { - id: 'A002', - name: '李静', - gender: '女', - age: 29, - level: '普通', - packageName: '基础体检套餐', - status: '已签到', - elapsed: '00:10', - checkedItems: ['签到'], - pendingItems: ['更衣', '预检', '抽血'], - timeSlot: '上午', - vipType: '普客', - signStatus: '已登记', - customerType: '散客', - guidePrinted: false, - addonCount: 0, - }, - { - id: 'A003', - name: '孙丽', - gender: '女', - age: 31, - level: 'VIP', - packageName: '健康管理套餐', - status: '用餐', - elapsed: '00:50', - checkedItems: ['签到', '更衣', '预检', '抽血', '家医面诊'], - pendingItems: ['B超'], - timeSlot: '下午', - vipType: '高客', - signStatus: '已登记', - customerType: '团客', - guidePrinted: true, - addonCount: 1, - }, -]; - - export const EXAM_TAGS = ['全部', '上午', '下午', '高客', '普客', '已登记', '未登记', '散客', '团客'] as const; -export const BOOKING_DOCTORS = [ +export interface BookingDoctor { + id: string; + name: string; + dept: string; + period: string; + total: number; + remain: number; +} + +export const BOOKING_DOCTORS: BookingDoctor[] = [ { id: 'zhang', name: '张主任', dept: '内科 · 主任医师', period: '上午', total: 20, remain: 8 }, { id: 'wang', name: '王教授', dept: '外科 · 主任医师', period: '下午', total: 16, remain: 10 }, ]; diff --git a/src/pages/ExamPage.tsx b/src/pages/ExamPage.tsx index 496210a..815fee3 100644 --- a/src/pages/ExamPage.tsx +++ b/src/pages/ExamPage.tsx @@ -110,6 +110,29 @@ export const ExamPage = () => { const customerType: ExamClient['customerType'] = item.customer_type === 1 ? '团客' : '散客'; const vipType: ExamClient['vipType'] = item.is_vip === 1 ? '高客' : '普客'; + let elapsed = '00:00'; + // 计算耗时:体检完成时间 - 体检时间 + if (item.physical_exam_time && item.physical_exam_complete_time) { + try { + const startTime = new Date(item.physical_exam_time).getTime(); + const completeTime = new Date(item.physical_exam_complete_time).getTime(); + + // 检查时间是否有效 + if (!isNaN(startTime) && !isNaN(completeTime) && completeTime >= startTime) { + const diffMs = completeTime - startTime; + const diffMinutes = Math.floor(diffMs / 1000 / 60); + const hours = Math.floor(diffMinutes / 60); + const minutes = diffMinutes % 60; + elapsed = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`; + } + } catch (err) { + console.error('计算体检耗时失败', err, { + physical_exam_time: item.physical_exam_time, + physical_exam_complete_time: item.physical_exam_complete_time, + }); + } + } + // 粗略判断上午/下午 const timeSlot: ExamClient['timeSlot'] = (item.physical_exam_time || '').includes('下午') ? '下午' : '上午'; @@ -122,13 +145,15 @@ export const ExamPage = () => { level: item.member_level || (item.is_vip === 1 ? 'VIP' : '普通'), packageName: item.package_name || '未提供套餐', status, - elapsed: '', + elapsed, checkedItems: [], pendingItems: [], timeSlot, + channel: item.channel || '', vipType, signStatus, customerType, + familyDoctorName: item.family_doctor_name || '', guidePrinted: item.is_print === 1, addonCount: item.add_item_count ?? 0, };