From 6d68d618b7de7fb8d2c751578c44f672eb67fd29 Mon Sep 17 00:00:00 2001 From: xianyi Date: Wed, 10 Dec 2025 17:30:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=93=E6=A3=80=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ExamPage.tsx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) 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,