添加接口
This commit is contained in:
@@ -74,6 +74,8 @@ import type {
|
|||||||
OptionalItemInfoListResponse,
|
OptionalItemInfoListResponse,
|
||||||
InputOptionalPackageRemove,
|
InputOptionalPackageRemove,
|
||||||
OptionalPackageRemoveResponse,
|
OptionalPackageRemoveResponse,
|
||||||
|
InputTijianOptionItemRecordList,
|
||||||
|
TijianOptionItemRecordListResponse,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -577,3 +579,15 @@ export const removeOptionalPackage = (
|
|||||||
data
|
data
|
||||||
).then(res => res.data);
|
).then(res => res.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取体检客户可选项操作记录信息
|
||||||
|
*/
|
||||||
|
export const getExamOptionRecordList = (
|
||||||
|
data: InputTijianOptionItemRecordList
|
||||||
|
): Promise<TijianOptionItemRecordListResponse> => {
|
||||||
|
return request.post<TijianOptionItemRecordListResponse>(
|
||||||
|
`${MEDICAL_EXAM_BASE_PATH}/optional-record-list`,
|
||||||
|
data
|
||||||
|
).then(res => res.data);
|
||||||
|
};
|
||||||
|
|||||||
@@ -1329,3 +1329,34 @@ export interface OutputOptionalPackageRemove {
|
|||||||
* 移除弃选体检套餐选项响应
|
* 移除弃选体检套餐选项响应
|
||||||
*/
|
*/
|
||||||
export type OptionalPackageRemoveResponse = CommonActionResult<OutputOptionalPackageRemove>;
|
export type OptionalPackageRemoveResponse = CommonActionResult<OutputOptionalPackageRemove>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取体检客户可选项操作记录信息入参
|
||||||
|
*/
|
||||||
|
export interface InputTijianOptionItemRecordList {
|
||||||
|
/** 体检ID */
|
||||||
|
exam_id?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 体检可选项记录列表出参
|
||||||
|
*/
|
||||||
|
export interface OutputTijianOptionItemRecordList {
|
||||||
|
/** 体检ID */
|
||||||
|
exam_id?: number;
|
||||||
|
/** 组合代码 */
|
||||||
|
combination_code?: string | null;
|
||||||
|
/** 组合名称 */
|
||||||
|
combination_name?: string | null;
|
||||||
|
/** 套餐代码 */
|
||||||
|
package_code?: string | null;
|
||||||
|
/** 是否弃选 默认0(1-弃选 0-选中) */
|
||||||
|
is_abandon?: number;
|
||||||
|
/** 是否弃选名称 */
|
||||||
|
is_abandon_name?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取体检客户可选项操作记录信息响应
|
||||||
|
*/
|
||||||
|
export type TijianOptionItemRecordListResponse = CommonActionResult<OutputTijianOptionItemRecordList[]>;
|
||||||
|
|||||||
@@ -3,7 +3,19 @@ import * as pdfjsLib from 'pdfjs-dist';
|
|||||||
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs?url';
|
||||||
|
|
||||||
import type { OutputTongyishuFileInfo, OutputTijianPdfFileInfo, OutputPhysicalExamItemInfo } from '../../api';
|
import type { OutputTongyishuFileInfo, OutputTijianPdfFileInfo, OutputPhysicalExamItemInfo } from '../../api';
|
||||||
import { signInMedicalExamCenter, submitTongyishuSign, submitDaojiandanSign, editDaojiandanPrintStatus, submitAddItemBillSign, getTijianPdfFile, getTongyishuPdf, getDaojiandanPdf, getExamOptionalItemList, removeOptionalPackage } from '../../api';
|
import {
|
||||||
|
signInMedicalExamCenter,
|
||||||
|
submitTongyishuSign,
|
||||||
|
submitDaojiandanSign,
|
||||||
|
editDaojiandanPrintStatus,
|
||||||
|
submitAddItemBillSign,
|
||||||
|
getTijianPdfFile,
|
||||||
|
getTongyishuPdf,
|
||||||
|
getDaojiandanPdf,
|
||||||
|
getExamOptionalItemList,
|
||||||
|
removeOptionalPackage,
|
||||||
|
getExamOptionRecordList,
|
||||||
|
} from '../../api';
|
||||||
import type { SignaturePadHandle } from '../ui';
|
import type { SignaturePadHandle } from '../ui';
|
||||||
import { Button, SignaturePad } from '../ui';
|
import { Button, SignaturePad } from '../ui';
|
||||||
|
|
||||||
@@ -85,9 +97,20 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
const [optionalItemList, setOptionalItemList] = useState<OutputPhysicalExamItemInfo[]>([]);
|
const [optionalItemList, setOptionalItemList] = useState<OutputPhysicalExamItemInfo[]>([]);
|
||||||
const [optionalItemLoading, setOptionalItemLoading] = useState(false);
|
const [optionalItemLoading, setOptionalItemLoading] = useState(false);
|
||||||
const [selectedOptionalItem, setSelectedOptionalItem] = useState<number | null>(null);
|
const [selectedOptionalItem, setSelectedOptionalItem] = useState<number | null>(null);
|
||||||
|
// 是否已经确认过可选项目(如果后端已有记录,视为已确认)
|
||||||
|
const [optionalConfirmed, setOptionalConfirmed] = useState(false);
|
||||||
|
// 是否显示“请先确认体检项目,确认后不可修改”的提示
|
||||||
|
const [showOptionalConfirmTip, setShowOptionalConfirmTip] = useState(false);
|
||||||
|
|
||||||
const busy =
|
const busy =
|
||||||
signLoading || submitLoading || consentLoading || pdfLoading || daojiandanSubmitLoading || addItemBillSubmitLoading || batchPrintLoading || optionalItemLoading;
|
signLoading ||
|
||||||
|
submitLoading ||
|
||||||
|
consentLoading ||
|
||||||
|
pdfLoading ||
|
||||||
|
daojiandanSubmitLoading ||
|
||||||
|
addItemBillSubmitLoading ||
|
||||||
|
batchPrintLoading ||
|
||||||
|
optionalItemLoading;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onBusyChange?.(busy);
|
onBusyChange?.(busy);
|
||||||
@@ -199,17 +222,67 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载可选项目列表
|
// 加载可选项目列表 & 操作记录(用于判断是否已选择)
|
||||||
const loadOptionalItems = async () => {
|
const loadOptionalItems = async () => {
|
||||||
if (!examId) return;
|
if (!examId) return;
|
||||||
setOptionalItemLoading(true);
|
setOptionalItemLoading(true);
|
||||||
try {
|
try {
|
||||||
const res = await getExamOptionalItemList({ physical_exam_id: examId });
|
const [listRes, recordRes] = await Promise.all([
|
||||||
if (res.Status === 200 && res.Data?.listOptionalItem) {
|
getExamOptionalItemList({ physical_exam_id: examId }),
|
||||||
setOptionalItemList(res.Data.listOptionalItem);
|
getExamOptionRecordList({ exam_id: examId }),
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (listRes.Status === 200 && listRes.Data?.listOptionalItem) {
|
||||||
|
const items = listRes.Data.listOptionalItem;
|
||||||
|
setOptionalItemList(items);
|
||||||
|
|
||||||
|
// 根据操作记录判断是否已经选择过(is_abandon = 0)
|
||||||
|
let selectedFromRecord: number | null = null;
|
||||||
|
if (recordRes.Status === 200 && recordRes.Data) {
|
||||||
|
const selectedRecord = recordRes.Data.find(
|
||||||
|
(r) => r.is_abandon === 0 && r.combination_code
|
||||||
|
);
|
||||||
|
if (selectedRecord?.combination_code) {
|
||||||
|
const codeNum = Number(selectedRecord.combination_code);
|
||||||
|
if (Number.isFinite(codeNum)) {
|
||||||
|
selectedFromRecord = codeNum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length > 0) {
|
||||||
|
if (
|
||||||
|
selectedFromRecord != null &&
|
||||||
|
items.some((i) => i.combination_code === selectedFromRecord)
|
||||||
|
) {
|
||||||
|
// 后端已有已选记录
|
||||||
|
setSelectedOptionalItem(selectedFromRecord);
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
} else {
|
||||||
|
// 尚未选择,需要前端引导用户选择并确认
|
||||||
|
setSelectedOptionalItem(null);
|
||||||
|
setOptionalConfirmed(false);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 没有可选项目,则视为无需确认
|
||||||
|
setSelectedOptionalItem(null);
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setOptionalItemList([]);
|
||||||
|
setSelectedOptionalItem(null);
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取可选项目列表失败', err);
|
console.error('获取可选项目/记录失败', err);
|
||||||
|
setOptionalItemList([]);
|
||||||
|
setSelectedOptionalItem(null);
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
} finally {
|
} finally {
|
||||||
setOptionalItemLoading(false);
|
setOptionalItemLoading(false);
|
||||||
}
|
}
|
||||||
@@ -222,6 +295,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
}, [examId]);
|
}, [examId]);
|
||||||
|
|
||||||
const handlePickFile = () => {
|
const handlePickFile = () => {
|
||||||
|
// 有可选项目但尚未确认时,禁止拍照并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
fileInputRef.current?.click();
|
fileInputRef.current?.click();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -294,29 +373,11 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有可选项目,先移除未选中的项目
|
// 如果存在可选项目但尚未确认,则不允许直接签到
|
||||||
if (optionalItemList.length > 0 && selectedOptionalItem != null) {
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
const unselectedCodes = optionalItemList
|
setMessage('请先确认体检项目');
|
||||||
.map((item) => item.combination_code)
|
setShowOptionalConfirmTip(true);
|
||||||
.filter((code): code is number => code != null && code !== selectedOptionalItem);
|
return;
|
||||||
|
|
||||||
if (unselectedCodes.length > 0) {
|
|
||||||
try {
|
|
||||||
const combinationCodeIds = unselectedCodes.join(',');
|
|
||||||
const removeRes = await removeOptionalPackage({
|
|
||||||
physical_exam_id: examId,
|
|
||||||
combination_code_ids: combinationCodeIds,
|
|
||||||
});
|
|
||||||
if (removeRes.Status !== 200 || removeRes.Data?.is_success !== 1) {
|
|
||||||
setMessage('移除未选项目失败:' + (removeRes.Message || '未知错误'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('移除未选项目失败', err);
|
|
||||||
setMessage('移除未选项目失败,请稍后重试');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setSignLoading(true);
|
setSignLoading(true);
|
||||||
@@ -337,7 +398,74 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 确认当前选择的可选项目:移除未选择的项目
|
||||||
|
const handleConfirmOptionalSelection = async () => {
|
||||||
|
if (!examId) {
|
||||||
|
setMessage('缺少体检ID');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (optionalItemList.length === 0) {
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (selectedOptionalItem == null) {
|
||||||
|
setMessage('请选择一个可选项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const unselectedCodes = optionalItemList
|
||||||
|
.map((item) => item.combination_code)
|
||||||
|
.filter((code): code is number => code != null && code !== selectedOptionalItem);
|
||||||
|
|
||||||
|
// 没有未选项目需要移除,直接标记为已确认
|
||||||
|
if (unselectedCodes.length === 0) {
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
setMessage('可选项目已确定');
|
||||||
|
setTimeout(() => setMessage(null), 3000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setOptionalItemLoading(true);
|
||||||
|
try {
|
||||||
|
const combinationCodeIds = unselectedCodes.join(',');
|
||||||
|
const res = await removeOptionalPackage({
|
||||||
|
physical_exam_id: examId,
|
||||||
|
combination_code_ids: combinationCodeIds,
|
||||||
|
});
|
||||||
|
if (res.Status === 200 && res.Data?.is_success === 1) {
|
||||||
|
setOptionalConfirmed(true);
|
||||||
|
setShowOptionalConfirmTip(false);
|
||||||
|
// 刷新剩余可选项目列表(理论上只剩一个)
|
||||||
|
const refreshRes = await getExamOptionalItemList({ physical_exam_id: examId });
|
||||||
|
if (refreshRes.Status === 200 && refreshRes.Data?.listOptionalItem) {
|
||||||
|
setOptionalItemList(refreshRes.Data.listOptionalItem);
|
||||||
|
}
|
||||||
|
setMessage('可选项目已确定');
|
||||||
|
setTimeout(() => setMessage(null), 3000);
|
||||||
|
} else {
|
||||||
|
setMessage('可选项目确定失败:' + (res.Message || '未知错误'));
|
||||||
|
setTimeout(() => setMessage(null), 3000);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('可选项目确定失败', err);
|
||||||
|
setMessage('可选项目确定失败,请稍后重试');
|
||||||
|
setTimeout(() => setMessage(null), 3000);
|
||||||
|
} finally {
|
||||||
|
setOptionalItemLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleSubmitSign = async () => {
|
const handleSubmitSign = async () => {
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setSubmitMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!examId || !previewPdf?.combination_code) {
|
if (!examId || !previewPdf?.combination_code) {
|
||||||
setSubmitMessage('缺少必要信息,无法提交签名');
|
setSubmitMessage('缺少必要信息,无法提交签名');
|
||||||
return;
|
return;
|
||||||
@@ -1006,6 +1134,13 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
|
|
||||||
// 导检单签名提交
|
// 导检单签名提交
|
||||||
const handleSubmitDaojiandanSign = async () => {
|
const handleSubmitDaojiandanSign = async () => {
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setDaojiandanSubmitMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!examId) {
|
if (!examId) {
|
||||||
setDaojiandanSubmitMessage('缺少必要信息,无法提交签名');
|
setDaojiandanSubmitMessage('缺少必要信息,无法提交签名');
|
||||||
return;
|
return;
|
||||||
@@ -1697,7 +1832,11 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
<img src={previewImage} alt='身份证预览' className='w-full h-full object-cover' />
|
<img src={previewImage} alt='身份证预览' className='w-full h-full object-cover' />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Button className='py-1.5 px-4 flex-1' onClick={handleSign} disabled={busy || !idCardFile}>
|
<Button
|
||||||
|
className='py-1.5 px-4 flex-1'
|
||||||
|
onClick={handleSign}
|
||||||
|
disabled={busy || !idCardFile || (optionalItemList.length > 0 && !optionalConfirmed)}
|
||||||
|
>
|
||||||
{signLoading ? '签到中...' : '签到'}
|
{signLoading ? '签到中...' : '签到'}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1709,11 +1848,14 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
<div className='text-xs text-gray-500'>加载可选项目...</div>
|
<div className='text-xs text-gray-500'>加载可选项目...</div>
|
||||||
) : optionalItemList.length > 0 ? (
|
) : optionalItemList.length > 0 ? (
|
||||||
<div className='mt-2 space-y-2'>
|
<div className='mt-2 space-y-2'>
|
||||||
<div className='text-xs font-medium text-gray-700'>可选项目(必选其一):</div>
|
<div className='text-xs font-medium text-gray-700'>
|
||||||
|
可选项目(必选其一){optionalConfirmed ? '(已确定)' : ''}
|
||||||
|
</div>
|
||||||
<div className='max-h-32 overflow-y-auto custom-scroll space-y-1'>
|
<div className='max-h-32 overflow-y-auto custom-scroll space-y-1'>
|
||||||
{optionalItemList.map((item) => {
|
{optionalItemList.map((item) => {
|
||||||
const combinationCode = item.combination_code;
|
const combinationCode = item.combination_code;
|
||||||
const isSelected = combinationCode != null && combinationCode === selectedOptionalItem;
|
const isSelected =
|
||||||
|
combinationCode != null && combinationCode === selectedOptionalItem;
|
||||||
return (
|
return (
|
||||||
<label
|
<label
|
||||||
key={combinationCode ?? `item-${item.package_code}`}
|
key={combinationCode ?? `item-${item.package_code}`}
|
||||||
@@ -1724,11 +1866,11 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
name='optional-item'
|
name='optional-item'
|
||||||
checked={isSelected}
|
checked={isSelected}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
if (combinationCode != null) {
|
if (combinationCode != null && !optionalConfirmed) {
|
||||||
setSelectedOptionalItem(combinationCode);
|
setSelectedOptionalItem(combinationCode);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy || optionalConfirmed}
|
||||||
className='w-3 h-3'
|
className='w-3 h-3'
|
||||||
/>
|
/>
|
||||||
<span className={isSelected ? 'text-blue-600 font-medium' : 'text-gray-700'}>
|
<span className={isSelected ? 'text-blue-600 font-medium' : 'text-gray-700'}>
|
||||||
@@ -1738,6 +1880,22 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
{!optionalConfirmed && (
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<Button
|
||||||
|
className='py-1 px-3 text-xs bg-blue-600 hover:bg-blue-700 text-white'
|
||||||
|
onClick={handleConfirmOptionalSelection}
|
||||||
|
disabled={busy || selectedOptionalItem == null}
|
||||||
|
>
|
||||||
|
确定选择
|
||||||
|
</Button>
|
||||||
|
{showOptionalConfirmTip && (
|
||||||
|
<span className='text-[11px] text-gray-500'>
|
||||||
|
请先确认体检项目,确认后不可修改
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@@ -1757,7 +1915,15 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
{checkAllSigned() && (
|
{checkAllSigned() && (
|
||||||
<Button
|
<Button
|
||||||
className='py-1 px-3 bg-green-600 hover:bg-green-700 text-white text-xs'
|
className='py-1 px-3 bg-green-600 hover:bg-green-700 text-white text-xs'
|
||||||
onClick={handleBatchPrint}
|
onClick={() => {
|
||||||
|
// 有可选项目但尚未确认时,禁止打印并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handleBatchPrint();
|
||||||
|
}}
|
||||||
disabled={busy || batchPrintLoading}
|
disabled={busy || batchPrintLoading}
|
||||||
>
|
>
|
||||||
{batchPrintLoading ? '加载中...' : '一键打印'}
|
{batchPrintLoading ? '加载中...' : '一键打印'}
|
||||||
@@ -1792,6 +1958,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3 bg-blue-600 hover:bg-blue-700 text-white'
|
className='py-1.5 px-3 bg-blue-600 hover:bg-blue-700 text-white'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止打印并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleDirectPrint(item);
|
handleDirectPrint(item);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1803,7 +1975,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3'
|
className='py-1.5 px-3'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止查看并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setPreviewPdf(item);
|
setPreviewPdf(item);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1833,6 +2010,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3 bg-blue-600 hover:bg-blue-700 text-white'
|
className='py-1.5 px-3 bg-blue-600 hover:bg-blue-700 text-white'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止打印并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleDaojiandanDirectPrint();
|
handleDaojiandanDirectPrint();
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1843,6 +2026,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3'
|
className='py-1.5 px-3'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止查看并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setShowDaojiandanPreview(true);
|
setShowDaojiandanPreview(true);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1857,6 +2046,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3'
|
className='py-1.5 px-3'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止查看并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setShowDaojiandanPreview(true);
|
setShowDaojiandanPreview(true);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1867,6 +2062,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3'
|
className='py-1.5 px-3'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setShowDaojiandanSignature(true);
|
setShowDaojiandanSignature(true);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1880,6 +2081,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1.5 px-3'
|
className='py-1.5 px-3'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setShowDaojiandanSignature(true);
|
setShowDaojiandanSignature(true);
|
||||||
}}
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
@@ -1972,12 +2179,33 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<Button
|
<Button
|
||||||
className='py-1 px-3 bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed'
|
className='py-1 px-3 bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed'
|
||||||
onClick={handlePrint}
|
onClick={() => {
|
||||||
|
// 有可选项目但尚未确认时,禁止打印并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handlePrint();
|
||||||
|
}}
|
||||||
disabled={pdfLoading || !pdfReady || !pdfBlobUrl}
|
disabled={pdfLoading || !pdfReady || !pdfBlobUrl}
|
||||||
>
|
>
|
||||||
打印
|
打印
|
||||||
</Button>
|
</Button>
|
||||||
<Button className='py-1 px-3' onClick={() => !busy && setShowSignature(true)} disabled={busy}>
|
<Button
|
||||||
|
className='py-1 px-3'
|
||||||
|
onClick={() => {
|
||||||
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setShowSignature(true);
|
||||||
|
}}
|
||||||
|
disabled={busy}
|
||||||
|
>
|
||||||
签名
|
签名
|
||||||
</Button>
|
</Button>
|
||||||
<Button className='py-1 px-3' onClick={() => !busy && setPreviewPdf(null)} disabled={busy}>
|
<Button className='py-1 px-3' onClick={() => !busy && setPreviewPdf(null)} disabled={busy}>
|
||||||
@@ -2113,7 +2341,15 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<Button
|
<Button
|
||||||
className='py-1 px-3 bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed'
|
className='py-1 px-3 bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed'
|
||||||
onClick={handleDaojiandanDirectPrint}
|
onClick={() => {
|
||||||
|
// 有可选项目但尚未确认时,禁止打印并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handleDaojiandanDirectPrint();
|
||||||
|
}}
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
>
|
>
|
||||||
打印
|
打印
|
||||||
@@ -2122,6 +2358,12 @@ export const ExamSignPanel = ({ examId, onBusyChange }: ExamSignPanelProps) => {
|
|||||||
className='py-1 px-3 hover:bg-blue-700 text-white'
|
className='py-1 px-3 hover:bg-blue-700 text-white'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (busy) return;
|
if (busy) return;
|
||||||
|
// 有可选项目但尚未确认时,禁止签名并提示先确认项目
|
||||||
|
if (optionalItemList.length > 0 && !optionalConfirmed) {
|
||||||
|
setMessage('请先确认体检项目');
|
||||||
|
setShowOptionalConfirmTip(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setShowDaojiandanPreview(false);
|
setShowDaojiandanPreview(false);
|
||||||
setShowDaojiandanSignature(true);
|
setShowDaojiandanSignature(true);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user