From a531f0131e24808e4403e82f4e5ce24b4155e434 Mon Sep 17 00:00:00 2001 From: xianyi Date: Wed, 24 Dec 2025 14:07:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types.ts | 3 +++ src/components/exam/ExamDetailPanel.tsx | 4 +++- src/pages/ExamPage.tsx | 24 ++---------------------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/api/types.ts b/src/api/types.ts index edeb89a..4cf3c8d 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -162,6 +162,7 @@ export interface OutputPhysicalExamCustomerListItem { is_sign_in?: number | null; is_print?: number | null; appointment_remarks?: string | null; + time_spent?: string | null; } /** @@ -205,6 +206,8 @@ export interface CustomerInfo { patient_marital_status_name?: string | null; family_doctor_name?: string | null; customer_type?: number | null; + age?: string | null; + card_number?: string | null; } /** diff --git a/src/components/exam/ExamDetailPanel.tsx b/src/components/exam/ExamDetailPanel.tsx index edb0de4..a01d499 100644 --- a/src/components/exam/ExamDetailPanel.tsx +++ b/src/components/exam/ExamDetailPanel.tsx @@ -202,6 +202,8 @@ export const ExamDetailPanel = ({
证件号:{loading ? '' : (customerInfo?.id_no || '—')} +
+ 卡号:{loading ? '' : (customerInfo?.card_number || '—')}
手机号: @@ -244,7 +246,7 @@ export const ExamDetailPanel = ({
性别/年龄: - {customerInfo?.gender_name || client.gender} / {client.age} + {customerInfo?.gender_name || client.gender} / {customerInfo?.age || client.age}
diff --git a/src/pages/ExamPage.tsx b/src/pages/ExamPage.tsx index 2c08940..bcd299f 100644 --- a/src/pages/ExamPage.tsx +++ b/src/pages/ExamPage.tsx @@ -64,28 +64,8 @@ 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 elapsed = item.time_spent || '00:00'; return { id: String(item.physical_exam_id ?? ''),