完善体检客户操作状态显示
This commit is contained in:
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import type { ExamClient, ExamModalTab } from '../../data/mockData';
|
import type { ExamClient, ExamModalTab } from '../../data/mockData';
|
||||||
import type { CustomerAppointmentInfo, CustomerExamAddItem, CustomerInfo, PhysicalExamProgressItem } from '../../api';
|
import type { CustomerAppointmentInfo, CustomerExamAddItem, CustomerInfo, PhysicalExamProgressItem } from '../../api';
|
||||||
import { getCustomerDetail, getPhysicalExamProgressDetail } from '../../api';
|
import { getCustomerDetail, getPhysicalExamProgressDetail } from '../../api';
|
||||||
|
import { isExamActionDone } from '../../utils/examActions';
|
||||||
import { ExamDetailPanel } from './ExamDetailPanel';
|
import { ExamDetailPanel } from './ExamDetailPanel';
|
||||||
import { ExamAddonPanel } from './ExamAddonPanel';
|
import { ExamAddonPanel } from './ExamAddonPanel';
|
||||||
import { ExamPrintPanel } from './ExamPrintPanel';
|
import { ExamPrintPanel } from './ExamPrintPanel';
|
||||||
@@ -25,9 +26,13 @@ export const ExamModal = ({ client, tab, onTabChange, onClose }: ExamModalProps)
|
|||||||
{ key: 'delivery', label: '报告寄送' },
|
{ key: 'delivery', label: '报告寄送' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const signDone = client.signStatus === '已登记' || client.checkedItems.includes('签到');
|
// 检查操作是否已完成(与 ExamSection 中的逻辑保持一致)
|
||||||
|
const idCardSignInDone = isExamActionDone(client.id, 'idCardSignIn');
|
||||||
|
const printSignDone = isExamActionDone(client.id, 'printSign');
|
||||||
|
|
||||||
|
const signDone = idCardSignInDone || client.signStatus === '已登记' || client.checkedItems.includes('签到');
|
||||||
const addonDone = (client.addonCount || 0) > 0;
|
const addonDone = (client.addonCount || 0) > 0;
|
||||||
const printDone = !!client.guidePrinted;
|
const printDone = printSignDone || !!client.guidePrinted;
|
||||||
const deliveryDone = !!client.deliveryDone;
|
const deliveryDone = !!client.deliveryDone;
|
||||||
|
|
||||||
const tabDone: Record<ExamModalTab, boolean> = {
|
const tabDone: Record<ExamModalTab, boolean> = {
|
||||||
@@ -129,12 +134,15 @@ export const ExamModal = ({ client, tab, onTabChange, onClose }: ExamModalProps)
|
|||||||
}`}
|
}`}
|
||||||
disabled={signBusy}
|
disabled={signBusy}
|
||||||
>
|
>
|
||||||
|
<span className='flex items-center gap-1'>
|
||||||
{t.label}
|
{t.label}
|
||||||
|
{isDone && <span>✅</span>}
|
||||||
{t.key === 'addon' && (client.addonCount || 0) > 0 && (
|
{t.key === 'addon' && (client.addonCount || 0) > 0 && (
|
||||||
<span className={`text-xs ${isActive ? 'text-blue-100' : 'text-gray-400'}`}>
|
<span className={`text-xs ${isActive ? 'text-blue-100' : 'text-gray-400'}`}>
|
||||||
({client.addonCount})
|
({client.addonCount})
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user