更新客户接口字段显示
This commit is contained in:
@@ -162,6 +162,7 @@ export interface OutputPhysicalExamCustomerListItem {
|
|||||||
is_sign_in?: number | null;
|
is_sign_in?: number | null;
|
||||||
is_print?: number | null;
|
is_print?: number | null;
|
||||||
appointment_remarks?: string | null;
|
appointment_remarks?: string | null;
|
||||||
|
time_spent?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -205,6 +206,8 @@ export interface CustomerInfo {
|
|||||||
patient_marital_status_name?: string | null;
|
patient_marital_status_name?: string | null;
|
||||||
family_doctor_name?: string | null;
|
family_doctor_name?: string | null;
|
||||||
customer_type?: number | null;
|
customer_type?: number | null;
|
||||||
|
age?: string | null;
|
||||||
|
card_number?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ export const ExamDetailPanel = ({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
证件号:<span className='text-gray-900'>{loading ? '' : (customerInfo?.id_no || '—')}</span>
|
证件号:<span className='text-gray-900'>{loading ? '' : (customerInfo?.id_no || '—')}</span>
|
||||||
|
<br />
|
||||||
|
卡号:<span className='text-gray-900'>{loading ? '' : (customerInfo?.card_number || '—')}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<span>手机号:</span>
|
<span>手机号:</span>
|
||||||
@@ -244,7 +246,7 @@ export const ExamDetailPanel = ({
|
|||||||
<div>
|
<div>
|
||||||
性别/年龄:
|
性别/年龄:
|
||||||
<span className='text-gray-900'>
|
<span className='text-gray-900'>
|
||||||
{customerInfo?.gender_name || client.gender} / {client.age}
|
{customerInfo?.gender_name || client.gender} / {customerInfo?.age || client.age}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -64,28 +64,8 @@ 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';
|
// 直接使用接口返回的耗时
|
||||||
// 计算耗时:体检完成时间 - 体检时间
|
const elapsed = item.time_spent || '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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: String(item.physical_exam_id ?? ''),
|
id: String(item.physical_exam_id ?? ''),
|
||||||
|
|||||||
Reference in New Issue
Block a user