|
|
@@ -1,4 +1,4 @@
|
|
|
-import { message } from 'antd';
|
|
|
+import { message, Modal } from 'antd';
|
|
|
import dayjs from 'dayjs';
|
|
|
import utc from 'dayjs/plugin/utc';
|
|
|
import {
|
|
|
@@ -12,6 +12,7 @@ import { omitAnimalSchemaMap } from '@/domain/animalSpecificInfo';
|
|
|
import { omitHumanSchemaMap } from '@/domain/humanSpecificInfo';
|
|
|
import { RootState } from '@/states/store';
|
|
|
import { View } from '@/API/patient/viewActions';
|
|
|
+import { checkPatientDuplicate } from './duplicateCheck';
|
|
|
|
|
|
dayjs.extend(utc);
|
|
|
|
|
|
@@ -61,6 +62,28 @@ export async function executeRegisterLogic(store: {
|
|
|
return { success: false, views: [] };
|
|
|
}
|
|
|
|
|
|
+ // 检查患者是否有重复检查
|
|
|
+ const hasDuplicate = await checkPatientDuplicate(values.patient_id);
|
|
|
+ if (hasDuplicate) {
|
|
|
+ // 弹出确认对话框
|
|
|
+ const confirmed = await new Promise<boolean>((resolve) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认继续注册',
|
|
|
+ content: '患者已被登记,确认要继续登记吗?',
|
|
|
+ okText: '确定',
|
|
|
+ cancelText: '取消',
|
|
|
+ centered: true,
|
|
|
+ onOk: () => resolve(true),
|
|
|
+ onCancel: () => resolve(false),
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!confirmed) {
|
|
|
+ // 用户选择取消,不继续注册
|
|
|
+ return { success: false, views: [] };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 构建注册信息 - 与原代码相同的逻辑
|
|
|
const registerInfo: RegisterInfo = {
|
|
|
...values,
|