添加体检客户列表 耗时计算&渠道显示

This commit is contained in:
xianyi
2025-12-22 10:24:17 +08:00
parent 4bfb09b7d9
commit 11ac18fade
3 changed files with 40 additions and 208 deletions

View File

@@ -199,9 +199,11 @@ export const ExamSection = ({
> >
<div className='flex items-center justify-between mb-1'> <div className='flex items-center justify-between mb-1'>
<span className='font-medium'>{client.name}</span> <span className='font-medium'>{client.name}</span>
{client.familyDoctorName && <span className='text-xs text-gray-500'>{client.familyDoctorName}</span>}
<Badge>{client.level}</Badge> <Badge>{client.level}</Badge>
</div> </div>
<div className='text-xs text-gray-500 truncate'>{client.packageName}</div> <div className='text-xs text-gray-500 truncate'>{client.packageName}</div>
<div className='text-xs text-gray-500 truncate'>{client.channel ?? ''}</div>
<div className='flex items-center justify-between text-xs text-gray-500 mt-1'> <div className='flex items-center justify-between text-xs text-gray-500 mt-1'>
<span>{client.status}</span> <span>{client.status}</span>
<span>{client.elapsed}</span> <span>{client.elapsed}</span>

View File

@@ -10,226 +10,31 @@ export interface ExamClient {
checkedItems: string[]; checkedItems: string[];
pendingItems: string[]; pendingItems: string[];
timeSlot: '上午' | '下午'; timeSlot: '上午' | '下午';
channel: string;
vipType: '高客' | '普客'; vipType: '高客' | '普客';
signStatus: '已登记' | '未登记'; signStatus: '已登记' | '未登记';
customerType: '团客' | '散客'; customerType: '团客' | '散客';
guidePrinted?: boolean; guidePrinted?: boolean;
addonCount?: number; addonCount?: number;
familyDoctorName?: string;
[key: string]: unknown; [key: string]: unknown;
} }
export type ExamModalTab = 'detail' | 'sign' | 'addon' | 'print' | 'delivery'; export type ExamModalTab = 'detail' | 'sign' | 'addon' | 'print' | 'delivery';
export type QuickActionType = 'none' | 'meal' | 'vip' | 'note'; 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 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: 'zhang', name: '张主任', dept: '内科 · 主任医师', period: '上午', total: 20, remain: 8 },
{ id: 'wang', name: '王教授', dept: '外科 · 主任医师', period: '下午', total: 16, remain: 10 }, { id: 'wang', name: '王教授', dept: '外科 · 主任医师', period: '下午', total: 16, remain: 10 },
]; ];

View File

@@ -110,6 +110,29 @@ export const ExamPage = () => {
const customerType: ExamClient['customerType'] = item.customer_type === 1 ? '团客' : '散客'; const customerType: ExamClient['customerType'] = item.customer_type === 1 ? '团客' : '散客';
const vipType: ExamClient['vipType'] = item.is_vip === 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'] = const timeSlot: ExamClient['timeSlot'] =
(item.physical_exam_time || '').includes('下午') ? '下午' : '上午'; (item.physical_exam_time || '').includes('下午') ? '下午' : '上午';
@@ -122,13 +145,15 @@ export const ExamPage = () => {
level: item.member_level || (item.is_vip === 1 ? 'VIP' : '普通'), level: item.member_level || (item.is_vip === 1 ? 'VIP' : '普通'),
packageName: item.package_name || '未提供套餐', packageName: item.package_name || '未提供套餐',
status, status,
elapsed: '', elapsed,
checkedItems: [], checkedItems: [],
pendingItems: [], pendingItems: [],
timeSlot, timeSlot,
channel: item.channel || '',
vipType, vipType,
signStatus, signStatus,
customerType, customerType,
familyDoctorName: item.family_doctor_name || '',
guidePrinted: item.is_print === 1, guidePrinted: item.is_print === 1,
addonCount: item.add_item_count ?? 0, addonCount: item.add_item_count ?? 0,
}; };