diff --git a/src/pages/ExamPage.tsx b/src/pages/ExamPage.tsx index b1f96bb..648c94a 100644 --- a/src/pages/ExamPage.tsx +++ b/src/pages/ExamPage.tsx @@ -52,11 +52,22 @@ export const ExamPage = () => { .then((res) => { const list = res.Data || []; const mapped: ExamClient[] = list.map((item) => { - // 简单映射为现有 UI 使用的字段 - const statusName = item.physical_exam_status_name || ''; - const signStatus = item.is_register === 1 ? '已登记' : '未登记'; - const customerType = item.customer_type === 1 ? '团客' : '散客'; - const vipType = item.is_vip === 1 ? '高客' : '普客'; + // 状态映射到联合类型 + const status: ExamClient['status'] = + item.is_sign_in === 1 + ? '已签到' + : (item.physical_exam_status_name ?? '').includes('餐') + ? '用餐' + : '体检中'; + + const signStatus: ExamClient['signStatus'] = item.is_register === 1 ? '已登记' : '未登记'; + const customerType: ExamClient['customerType'] = item.customer_type === 1 ? '团客' : '散客'; + const vipType: ExamClient['vipType'] = item.is_vip === 1 ? '高客' : '普客'; + + // 粗略判断上午/下午 + const timeSlot: ExamClient['timeSlot'] = + (item.physical_exam_time || '').includes('下午') ? '下午' : '上午'; + return { id: String(item.physical_exam_id ?? ''), name: item.customer_name || '未知客户', @@ -64,11 +75,11 @@ export const ExamPage = () => { age: 0, level: item.member_level || (item.is_vip === 1 ? 'VIP' : '普通'), packageName: item.package_name || '未提供套餐', - status: statusName || '未开始', + status, elapsed: '', checkedItems: [], pendingItems: [], - timeSlot: '上午', + timeSlot, vipType, signStatus, customerType,