提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -0,0 +1,232 @@
<template>
<el-row :gutter="20" style="margin-bottom: 10px; display: flex; justify-content: flex-end">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" size="small" @click="enhancedHandleAddDiagnosis">
新增诊断
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
size="small"
@click="enhancedHandleDeleteDiagnosis"
:disabled="multiple"
>
删除诊断
</el-button>
</el-col>
</el-row>
<el-row :gutter="10">
<el-table
style="width: 100%; overflow-x: auto"
:data="tableData"
height="45vh"
border
ref="diagnosisTableRef"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="诊断名称" align="center" prop="diagName" width="180">
<template #default="scope">
<div style="margin-top: -5px; margin-bottom: -5px">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
trigger="manual"
:width="800"
>
<diagnosislist
:diagnosisSearchkey="diagnosisSearchkey"
@selectDiagnosis="enhancedHandleSelsectDiagnosis"
/>
<template #reference>
<el-input
v-model="scope.row.diagName"
placeholder="请选择诊断"
@input="handleChange"
@focus="handleFocus(scope.row, scope.$index)"
@blur="handleBlur(scope.row)"
:validate-event="false"
/>
</template>
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column label="诊断编码" prop="diagCode" align="center" width="130">
<template #default="scope">
<el-input v-model="scope.row.diagCode" disabled />
</template>
</el-table-column>
<el-table-column label="诊断类型" prop="diagType" align="center" width="100">
<template #default="scope">
<el-input v-model="scope.row.diagType" disabled />
</template>
</el-table-column>
<el-table-column label="是否主诊断" align="center" prop="maindiagFlag" width="100">
<template #default="scope">
<el-checkbox
label="主诊断"
:trueLabel="1"
:falseLabel="0"
v-model="scope.row.maindiagFlag"
border
size="small"
@change="(value) => handleMaindise(value, scope.$index)"
/>
</template>
</el-table-column>
<el-table-column label="确诊时间" prop="diagTime" align="center" width="130">
<template #default="scope">
<el-date-picker v-model="scope.row.diagTime" type="date" placeholder="选择日期" />
</template>
</el-table-column>
<el-table-column label="说明" prop="diagDesc" align="center" width="130">
<template #default="scope">
<el-input v-model="scope.row.diagDesc" />
</template>
</el-table-column>
</el-table>
</el-row>
</template>
<script setup>
import { ref, watch } from 'vue';
import diagnosislist from '../../../../doctorstation/components/diagnosis/diagnosislist.vue';
const props = defineProps({
tableData: {
type: Array,
default: () => [],
},
tableType: {
type: String,
default: '',
},
multiple: {
type: Boolean,
default: true,
},
});
watch(
() => props.tableData,
(newValue) => {
if (newValue.length > 0) {
setTableData(newValue);
} else {
setTableData([]);
}
}
);
const tableData = ref([]);
const diagnosisTableRef = ref(null);
const selectedRows = ref([]);
const submitTableData = tableData;
const setTableData = (data) => {
tableData.value = data;
};
const handleAddDiagnosis = () => {
tableData.value.push({
diagName: '',
diagCode: '',
diagType: '',
maindiagFlag: '',
diagTime: '',
diagDesc: '',
showPopover: false,
diseinfo: null,
});
};
const handleDeleteDiagnosis = () => {
if (selectedRows.value.length === 0) {
return;
}
// 将选中的行从表格数据中移除
tableData.value = tableData.value.filter((item) => !selectedRows.value.includes(item));
// 清空选中状态
selectedRows.value = [];
if (diagnosisTableRef.value) {
diagnosisTableRef.value.clearSelection();
}
};
const multiple = ref(true);
const diagnosisSearchkey = ref('');
const currentRow = ref(null);
const currentIndex = ref(-1);
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
multiple.value = selection.length === 0;
emit('selection-change', selection);
};
const handleChange = (value) => {
diagnosisSearchkey.value = value;
};
const handleFocus = (row, index) => {
currentRow.value = row;
currentIndex.value = index;
row.showPopover = true;
};
const handleBlur = (row) => {
setTimeout(() => {
row.showPopover = false;
}, 200);
};
const handleSelsectDiagnosis = (row) => {
// 入院诊断使用diseinfo数据源
currentRow.value.diagName = row.diseinfo?.name || row.name;
currentRow.value.diagCode = row.diseinfo?.ybNo || row.ybNo;
currentRow.value.diagType = row.diseinfo?.typeName || row.typeName || '';
currentRow.value.showPopover = false;
};
function handleMaindise(value, index) {
if (value == 1) {
// 先将其他所有记录的主诊断标志设为0确保只有一个主诊断
tableData.value.forEach((item, i) => {
if (i !== index) {
item.maindiagFlag = 0;
}
});
}
// 触发数据更新事件,将当前表格数据传递给父组件
emit('data-change', tableData.value);
}
// 修改原始函数以触发数据更新事件
const originalHandleAddDiagnosis = handleAddDiagnosis;
const enhancedHandleAddDiagnosis = () => {
originalHandleAddDiagnosis();
emit('data-change', tableData.value);
};
const originalHandleDeleteDiagnosis = handleDeleteDiagnosis;
const enhancedHandleDeleteDiagnosis = () => {
originalHandleDeleteDiagnosis();
emit('data-change', tableData.value);
};
const originalHandleSelsectDiagnosis = handleSelsectDiagnosis;
const enhancedHandleSelsectDiagnosis = (row) => {
originalHandleSelsectDiagnosis(row);
emit('data-change', tableData.value);
};
const emit = defineEmits(['selection-change', 'data-change']);
defineExpose({
submitTableData,
});
</script>
<style>
.el-table .cell {
padding: 0 8px !important;
}
</style>

View File

@@ -0,0 +1,232 @@
<template>
<el-row :gutter="20" style="margin-bottom: 10px; display: flex; justify-content: flex-end">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" size="small" @click="enhancedHandleAddDiagnosis">
新增诊断
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
size="small"
@click="enhancedHandleDeleteDiagnosis"
:disabled="multiple"
>
删除诊断
</el-button>
</el-col>
</el-row>
<el-row :gutter="10">
<el-table
style="width: 100%; overflow-x: auto"
:data="tableData"
height="45vh"
border
ref="diagnosisTableRef"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="诊断名称" align="center" prop="diagName" width="180">
<template #default="scope">
<div style="margin-top: -5px; margin-bottom: -5px">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
trigger="manual"
:width="800"
>
<diagnosislist
:diagnosisSearchkey="diagnosisSearchkey"
@selectDiagnosis="enhancedHandleSelsectDiagnosis"
/>
<template #reference>
<el-input
v-model="scope.row.diagName"
placeholder="请选择诊断"
@input="handleChange"
@focus="handleFocus(scope.row, scope.$index)"
@blur="handleBlur(scope.row)"
:validate-event="false"
/>
</template>
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column label="诊断编码" prop="diagCode" align="center" width="130">
<template #default="scope">
<el-input v-model="scope.row.diagCode" disabled />
</template>
</el-table-column>
<el-table-column label="诊断类型" prop="diagType" align="center" width="100">
<template #default="scope">
<el-input v-model="scope.row.diagType" disabled />
</template>
</el-table-column>
<el-table-column label="是否主诊断" align="center" prop="maindiagFlag" width="100">
<template #default="scope">
<el-checkbox
label="主诊断"
:trueLabel="1"
:falseLabel="0"
v-model="scope.row.maindiagFlag"
border
size="small"
@change="(value) => handleMaindise(value, scope.$index)"
/>
</template>
</el-table-column>
<el-table-column label="确诊时间" prop="diagTime" align="center" width="130">
<template #default="scope">
<el-date-picker v-model="scope.row.diagTime" type="date" placeholder="选择日期" />
</template>
</el-table-column>
<el-table-column label="说明" prop="diagDesc" align="center" width="130">
<template #default="scope">
<el-input v-model="scope.row.diagDesc" />
</template>
</el-table-column>
</el-table>
</el-row>
</template>
<script setup>
import { ref, watch } from 'vue';
import diagnosislist from '../../../../doctorstation/components/diagnosis/diagnosislist.vue';
const props = defineProps({
tableData: {
type: Array,
default: () => [],
},
tableType: {
type: String,
default: '',
},
multiple: {
type: Boolean,
default: true,
},
});
watch(
() => props.tableData,
(newValue) => {
if (newValue.length > 0) {
setTableData(newValue);
} else {
setTableData([]);
}
}
);
const tableData = ref([]);
const diagnosisTableRef = ref(null);
const selectedRows = ref([]);
const submitTableData = tableData;
const setTableData = (data) => {
tableData.value = data;
};
const handleAddDiagnosis = () => {
tableData.value.push({
diagName: '',
diagCode: '',
diagType: '',
maindiagFlag: '',
diagTime: '',
diagDesc: '',
showPopover: false,
outDiseinfo: null,
});
};
const handleDeleteDiagnosis = () => {
if (selectedRows.value.length === 0) {
return;
}
// 将选中的行从表格数据中移除
tableData.value = tableData.value.filter((item) => !selectedRows.value.includes(item));
// 清空选中状态
selectedRows.value = [];
if (diagnosisTableRef.value) {
diagnosisTableRef.value.clearSelection();
}
};
const multiple = ref(true);
const diagnosisSearchkey = ref('');
const currentRow = ref(null);
const currentIndex = ref(-1);
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
multiple.value = selection.length === 0;
emit('selection-change', selection);
};
const handleChange = (value) => {
diagnosisSearchkey.value = value;
};
const handleFocus = (row, index) => {
currentRow.value = row;
currentIndex.value = index;
row.showPopover = true;
};
const handleBlur = (row) => {
setTimeout(() => {
row.showPopover = false;
}, 200);
};
const handleSelsectDiagnosis = (row) => {
// 出院诊断使用outDiseinfo数据源
currentRow.value.diagName = row.outDiseinfo?.name || row.name;
currentRow.value.diagCode = row.outDiseinfo?.ybNo || row.ybNo;
currentRow.value.diagType = row.outDiseinfo?.typeName || row.typeName || '';
currentRow.value.showPopover = false;
};
function handleMaindise(value, index) {
if (value == 1) {
// 先将其他所有记录的主诊断标志设为0确保只有一个主诊断
tableData.value.forEach((item, i) => {
if (i !== index) {
item.maindiagFlag = 0;
}
});
}
// 触发数据更新事件,将当前表格数据传递给父组件
emit('data-change', tableData.value);
}
// 修改原始函数以触发数据更新事件
const originalHandleAddDiagnosis = handleAddDiagnosis;
const enhancedHandleAddDiagnosis = () => {
originalHandleAddDiagnosis();
emit('data-change', tableData.value);
};
const originalHandleDeleteDiagnosis = handleDeleteDiagnosis;
const enhancedHandleDeleteDiagnosis = () => {
originalHandleDeleteDiagnosis();
emit('data-change', tableData.value);
};
const originalHandleSelsectDiagnosis = handleSelsectDiagnosis;
const enhancedHandleSelsectDiagnosis = (row) => {
originalHandleSelsectDiagnosis(row);
emit('data-change', tableData.value);
};
const emit = defineEmits(['selection-change', 'data-change']);
defineExpose({
submitTableData,
});
</script>
<style>
.el-table .cell {
padding: 0 8px !important;
}
</style>

View File

@@ -1,10 +1,15 @@
<<<<<<< HEAD
import request from '@/utils/request'
=======
import request from '@/utils/request';
>>>>>>> v1.3
// 获取住院信息初期数据列表
export function getInit(query) {
return request({
url: '/inpatient-manage/init',
method: 'get',
<<<<<<< HEAD
params: query
})
}
@@ -24,6 +29,10 @@ export function getAdmissionPage(query) {
method: 'get',
params: query
})
=======
params: query,
});
>>>>>>> v1.3
}
// 住院无档登记
@@ -31,8 +40,13 @@ export function addAdmissionInfo(data) {
return request({
url: '/inpatient-manage/admission-information',
method: 'post',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
// 住院登记
@@ -40,8 +54,13 @@ export function admissionInfo(data) {
return request({
url: '/inpatient-manage/admission-information',
method: 'put',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
/**
@@ -51,7 +70,11 @@ export function getOrgList() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
<<<<<<< HEAD
})
=======
});
>>>>>>> v1.3
}
/**
@@ -60,8 +83,13 @@ export function getOrgList() {
export function wardList() {
return request({
url: '/app-common/ward-list',
<<<<<<< HEAD
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
/**
@@ -71,29 +99,44 @@ export function diagnosisInit() {
return request({
url: '/doctor-station/diagnosis/init',
method: 'get',
<<<<<<< HEAD
})
=======
});
>>>>>>> v1.3
}
// 查询患者相关
export function patientlLists() {
return request({
url: '/patient-manage/information/init',
<<<<<<< HEAD
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
// 查询患者相关
export function doctorList(id) {
return request({
url: '/inpatient-manage/doctor-list?orgId=' + id,
<<<<<<< HEAD
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
// 查询患者相关
export function getPatientInfo(id, statusEnum) {
return request({
url: `/inpatient-manage/admission-one?id=${id}&statusEnum=${statusEnum}`,
<<<<<<< HEAD
method: 'get'
})
}
@@ -113,14 +156,23 @@ export function getInHospitalInfo(encounterId) {
url: `/inhospital-charge/register/in-hospital-info?encounterId=${encounterId}`,
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
// 获取病区床位信息
export function getBedInfo(wardBusNo) {
return request({
url: `/inhospital-charge/register/beds-num?wardBusNo=${wardBusNo}`,
<<<<<<< HEAD
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
// 住院登记
@@ -128,8 +180,13 @@ export function registerInHospital(data) {
return request({
url: '/inhospital-charge/register/by-cashier',
method: 'post',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
// 无档登记
@@ -137,16 +194,26 @@ export function noFilesRegister(data) {
return request({
url: '/inhospital-charge/register/no-files',
method: 'post',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
// 表单初始化
export function patientFormInit() {
return request({
url: '/patient-manage/information/init',
<<<<<<< HEAD
method: 'get'
})
=======
method: 'get',
});
>>>>>>> v1.3
}
// 合同
@@ -154,7 +221,11 @@ export function getContractList() {
return request({
url: '/app-common/contract-list',
method: 'get',
<<<<<<< HEAD
})
=======
});
>>>>>>> v1.3
}
/**
@@ -164,6 +235,114 @@ export function getDiagnosisDefinitionList(queryParams) {
return request({
url: '/doctor-station/diagnosis/condition-definition-metadata',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
}
}
=======
params: queryParams,
});
}
// 获取患者基础信息
export function getPatientBasicInfo(patientId) {
return request({
url: `/inhospital-charge/register/patient-info?patientId=${patientId}`,
method: 'get',
});
}
// -------------------------------------------------------------------------
// 查询住院登记信息
export function getRegisteInfoPage(query) {
return request({
url: '/yb-inpatient-request/register-info',
method: 'get',
params: query,
});
}
// 医保登记按钮 获取信息
export function getInHospitalInfo(encounterId) {
return request({
url: `/yb-inpatient-request/in-hospital-info?encounterId=${encounterId}`,
method: 'get',
});
}
//医保登记按钮 保存
export function saveEmr(data) {
return request({
url: '/yb-inpatient-request/inpatient-reg',
method: 'post',
data: data,
});
}
//医保出院按钮 信息获取
export function getInpatientCheckInfo(data) {
return request({
url: '/yb-inpatient-request/inpatient-check-info',
method: 'post',
data: data,
});
}
//医保出院按钮 保存
export function checkOutInpatient(data) {
return request({
url: '/yb-inpatient-request/inpatient-check-out',
method: 'post',
data: data,
});
}
//信息变更按钮 获取信息
export function getInpatientRegInfo(data) {
return request({
url: '/yb-inpatient-request/inpatient-reg-info',
method: 'get',
data: data,
});
}
//信息变更按钮 保存
export function updateInpatientRegInfo(data) {
return request({
url: '/yb-inpatient-request/update-inpatient-reg',
method: 'post',
data: data,
});
}
// 入院撤销
export function cancelInpatientRegister(data) {
return request({
url: '/yb-inpatient-request/cancel-inpatient-reg',
method: 'get',
data: data,
});
}
//出院撤销
export function cancelDischargeRegister(data) {
return request({
url: '/yb-inpatient-request/cancel-inpatient-check-out',
method: 'get',
data: data,
});
}
//病案上传
export function uploadEmr(data) {
return request({
url: '/yb-inpatient-request/emr-up',
method: 'post',
data: data,
});
}
// 获取患者医保信息
export function gerPreInfo(data) {
return request({
url: '/yb-inpatient-request/inpatient-per-info',
method: 'post',
data: data,
});
}
>>>>>>> v1.3

View File

@@ -0,0 +1,537 @@
<template>
<div class="app-container" v-loading="loading" loading-text="保存中。。。">
<!-- 操作框 -->
<el-row justify="end" :gutter="20">
<el-col :span="1.5">
<el-button type="primary" @click="handleSave">保存</el-button>
<el-button @click="handleCancel">取消</el-button>
</el-col>
</el-row>
<!-- 读卡功能区域 -->
<div class="read-card-section">
<el-radio-group v-model="typeCode">
<el-button type="primary" plain @click="handleReadCard('01')" style="width: 65px">
电子凭证
</el-button>
<el-button type="primary" plain @click="handleReadCard('02')" style="width: 65px">
身份证
</el-button>
<el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px">
医保卡
</el-button>
</el-radio-group>
<el-button type="primary" @click="handleReadCard(typeCode)" :loading="readCardLoading">
{{ loadingText }}
</el-button>
</div>
<el-divider></el-divider>
<RegisterForm ref="registerFormRef" :registerForm="registerForm" />
<el-divider></el-divider>
<el-row :gutter="80">
<el-col :span="12">
<h3 style="margin-bottom: 0px">入院诊断</h3>
<AdmissionDiagnosis :tableData="inHospitalDiagnosisTableData" @data-change="handleInHospitalDiagnosisChange" />
</el-col>
<el-col :span="12">
<h3 style="margin-bottom: 0px">出院诊断</h3>
<DischargeDiagnosis :tableData="historyDiagnosisTableData" ref="historyDiagnosisTableDataRef"
@data-change="handleHistoryDiagnosisChange" />
</el-col>
</el-row>
</div>
</template>
<script setup>
import { computed, onMounted, reactive, ref, getCurrentInstance } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { ElMessage } from 'element-plus';
import AdmissionDiagnosis from './AdmissionDiagnosis.vue';
import DischargeDiagnosis from './DischargeDiagnosis.vue';
import RegisterForm from './registerForm.vue';
import {
getInHospitalInfo,
getInpatientCheckInfo,
getInpatientRegInfo,
saveEmr,
checkOutInpatient,
updateInpatientRegInfo,
gerPreInfo,
} from './api';
import { invokeYbPlugin5001 } from '@/api/public';
import useTagsViewStore from '@/store/modules/tagsView';
import useUserStore from '@/store/modules/user';
const { proxy } = getCurrentInstance();
const route = useRoute();
const router = useRouter();
const tagsViewStore = useTagsViewStore();
const encounterId = ref('')
// const certType = computed(() => route.query.certType);
const operationType = computed(() => route.query.operationType || 'register'); // 默认是医保登记
const mdtrtId = computed(() => route.query.mdtrtId);
const queryRef = ref(null);
const registerFormRef = ref(null);
const inHospitalDiagnosisTableData = ref([]);
const inHospitalDiagnosisTableDataRef = ref(null);
const historyDiagnosisTableData = ref([]);
const historyDiagnosisTableRef = ref(null);
const loading = ref(false);
const registerForm = ref({});
const userStore = useUserStore();
const typeCode = ref('01');
const readCardLoading = ref(false);
const loadingText = ref('读卡');
let userCardInfo = ref({});
const BusiCardInfo = ref('');
const form = reactive({});
// 处理入院诊断数据变更
const handleInHospitalDiagnosisChange = (data) => {
inHospitalDiagnosisTableData.value = data;
console.log('入院诊断数据已更新:', data);
};
// 处理出院诊断数据变更
const handleHistoryDiagnosisChange = (data) => {
historyDiagnosisTableData.value = data;
console.log('出院诊断数据已更新:', data);
};
const loadRegisterInfo = async () => {
loading.value = true;
try {
let res;
// 根据操作类型调用不同的接口
switch (operationType.value) {
case 'register':
// 医保登记 - 使用 getInHospitalInfo 接口
if (!encounterId.value) {
proxy.$message.error('缺少就诊标识');
return;
}
res = await getInHospitalInfo(encounterId.value);
break;
case 'discharge':
// 医保出院 - 使用 getInpatientCheckInfo 接口
if (!mdtrtId.value) {
proxy.$message.error('缺少医保就诊ID');
return;
}
res = await getInpatientCheckInfo({ mdtrtId: mdtrtId.value });
break;
case 'change':
// 信息变更 - 使用 getInpatientRegInfo 接口
if (!mdtrtId.value) {
proxy.$message.error('缺少医保就诊ID');
return;
}
res = await getInpatientRegInfo({ mdtrtId: mdtrtId.value });
break;
default:
ElMessage.error('无效的操作类型');
return;
}
console.log(`获取${operationType.value}信息`, res);
if (res.code !== 200) {
ElMessage.error(res.message || `获取${operationType.value}信息失败`);
return;
}
const data = res.data || {};
registerForm.value = data.mdtrtinfo || {};
// 入院诊断从diseinfo获取
inHospitalDiagnosisTableData.value = (data.diseinfo || []).map((item) => ({
id: item.id,
diagName: item.diagName || item.name || '',
diagCode: item.diagCode,
diagType: item.diagType,
maindiagFlag: item.maindiagFlag,
diagTime: item.diagTime,
diagDesc: item.diagDesc,
showPopover: false, // 添加弹出框控制标志
}));
// 出院诊断从outDiseinfo获取
historyDiagnosisTableData.value = (data.outDiseinfo || []).map((item) => ({
id: item.id,
diagName: item.diagName || item.name || '',
diagCode: item.diagCode,
diagType: item.diagType,
maindiagFlag: item.maindiagFlag,
diagTime: item.diagTime,
diagDesc: item.diagDesc,
showPopover: false, // 添加弹出框控制标志
}));
} catch (error) {
console.error('加载登记信息失败:', error);
setTimeout(() => {
handleCancel();
}, 2000);
return;
} finally {
loading.value = false;
}
};
const handleSave = async () => {
console.log('registerFormRef.value', registerFormRef.value);
if (!registerFormRef.value) {
return;
}
// 使用async/await获取表单验证结果
const valid = await registerFormRef.value.validateData();
console.log('valid', valid);
if (valid) {
loading.value = true;
try {
// 构建请求参数,按照要求的格式组织数据
const payload = {
// 基本信息存到 mdtrtinfo
mdtrtinfo: {
...registerFormRef.value.submitForm,
encounterId: encounterId.value,
mdtrtId: mdtrtId.value,
// certType:certType.value,
},
// 入院诊断信息存到 diseinfo
diseinfo: (inHospitalDiagnosisTableDataRef.value?.submitTableData || []).map(
(item, index) => ({
// 转换诊断数据格式以匹配后端要求
diagName: item.diagName || item.name,
diagCode: item.diagCode,
diagType: item.diagType,
maindiagFlag: item.maindiagFlag || '0',
diagTime: item.diagTime,
diagSrtNo: index + 1,
diagDesc: item.diagDesc,
})
),
// 出院诊断信息存到 outDiseinfo
outDiseinfo: (historyDiagnosisTableRef.value?.submitTableData || []).map((item, index) => ({
// 转换诊断数据格式以匹配后端要求
diagName: item.diagName || item.name,
diagCode: item.diagCode,
diagType: item.diagType,
maindiagFlag: item.maindiagFlag || '0',
diagTime: item.diagTime,
diagSrtNo: index + 1,
diagDesc: item.diagDesc,
})),
};
let res;
// 根据操作类型调用不同的保存接口
switch (operationType.value) {
case ('register', 'HospitalizationRegistration'):
// 医保登记 - 使用 saveEmr 接口
console.log('保存医保登记数据:', payload);
res = await saveEmr(payload);
break;
case 'discharge':
// 医保出院 - 使用 checkOutInpatient 接口
console.log('保存医保出院数据:', payload);
res = await checkOutInpatient(payload);
break;
case 'change':
// 信息变更 - 使用 updateInpatientRegInfo 接口
console.log('保存信息变更数据:', payload);
res = await updateInpatientRegInfo(payload);
break;
}
if (res.code === 200) {
const operationNames = {
register: '医保登记',
discharge: '医保出院',
change: '信息变更',
};
ElMessage.success(`${operationNames[operationType.value]}保存成功`);
handleCancel();
} else {
ElMessage.error(res.message || '保存失败');
}
} catch (error) {
console.error('保存失败:', error);
ElMessage.error('保存失败,请重试');
} finally {
loading.value = false;
}
} else {
ElMessage.warning('表单验证失败,请检查填写内容');
}
};
const handleCancel = () => {
const currentView = { ...router.currentRoute.value };
router
.push({
path: '/ybmanagement/ybInhospital/ybInhospitalRegister',
})
.then(() => {
tagsViewStore.delView(currentView);
});
};
// 医保信息变更
const doYbChange = (row) => {
// 跳转到编辑页面并传递operationType参数标识这是信息变更操作
router.push({
name: 'YbregisterEdit',
query: {
encounterId: row.encounterId,
operationType: 'change', // 添加操作类型参数,标识是信息变更
mdtrtId: row.mdtrtId,
},
});
};
// 处理接收到的卡片数据
const processCardData = (cardData) => {
if (!cardData) return;
try {
console.log('开始处理卡片数据:', cardData);
// 处理患者基本信息
if (cardData.patientInfo) {
console.log('患者基本信息:', cardData.patientInfo);
// 将患者信息映射到医保登记表单
registerForm.value = {
...registerForm.value,
// 患者基本信息
patientName: cardData.patientInfo.patientName || cardData.patientInfo.name || '',
idCard: cardData.patientInfo.idCard || '',
gender: cardData.patientInfo.gender || '',
birthDate: cardData.patientInfo.birthDate || '',
phone: cardData.patientInfo.phone || '',
// 其他患者相关字段
patientId: cardData.patientInfo.patientId || '',
patCode: cardData.patientInfo.code || '',
};
}
// 处理住院信息
if (cardData.inHospitalInfo) {
console.log('住院信息:', cardData.inHospitalInfo);
registerForm.value = {
...registerForm.value,
// 住院相关信息
admissionDate:
cardData.inHospitalInfo.startTime || cardData.inHospitalInfo.admissionDate || '',
deptName: cardData.inHospitalInfo.departmentName || cardData.inHospitalInfo.deptName || '',
wardName: cardData.inHospitalInfo.wardLocationId || cardData.inHospitalInfo.wardName || '',
diagnosisName:
cardData.inHospitalInfo.ambDiagnosisName || cardData.inHospitalInfo.diagnosisName || '',
// 其他住院相关字段
encounterId: cardData.inHospitalInfo.encounterId || '',
visitNo: cardData.inHospitalInfo.visitNo || '',
bedNo: cardData.inHospitalInfo.bedNo || '',
admissionDeptName: cardData.inHospitalInfo.admissionDeptName || '',
};
}
console.log('处理后的表单数据:', registerForm.value);
} catch (e) {
console.error('处理卡片数据时出错:', e);
}
};
// 处理读卡功能
async function handleReadCard(value) {
try {
let jsonResult;
let cardInfo;
let userMessage = undefined;
// let certType;
console.log('encounterId:', registerForm.value.encounterId);
// console.log('certType:',certType.value);
// encounterId.value = registerForm.value.encounterId;
switch (value) {
case '01': // 电子凭证
await invokeYbPlugin5001({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
businessType: '01101',
operatorId: userStore.id.toString(),
operatorName: userStore.name,
officeId: 'D83',
officeName: '财务科',
// certType: certType.value,
encounterId: registerForm.value.encounterId,
})
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
console.log(res);
jsonResult = res.data;
})
.catch(() => {
readCardLoading.value = false;
});
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
const encounterIdValue = registerForm.value.encounterId;
console.log('准备使用的encounterId:', registerForm.value.encounterId);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterIdValue,
};
userCardInfo = {
certType: '01', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '01', // 居民身份证
busiCardInfo: message.data.ecToken, // 令牌
encounterId: encounterIdValue,
};
BusiCardInfo.value = message.data.ecToken;
console.log(BusiCardInfo.value);
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = JSON.stringify(res.data);
})
.finally(() => {
readCardLoading.value = false;
});
let message1 = JSON.parse(jsonResult);
const encounterIdValue2 = registerForm.value.encounterId;
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterIdValue2,
};
userCardInfo = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
busiCardInfo: message1.BusiCardInfo, //卡号
encounterId: encounterIdValue2,
};
BusiCardInfo.value = message1.BusiCardInfo;
console.log(message1.BusiCardInfo);
break;
case '99':
break;
}
readCardLoading.value = true;
console.log('发送给gerPreInfo的参数:', userMessage);
if (userMessage && userMessage.certNo) {
// 这里可以根据需要调用获取患者信息的接口
// 并将获取到的信息填充到registerForm中
// 由于registerEdit.vue没有直接引入gerPreInfo这里注释掉
console.log('开始调用gerPreInfo...');
gerPreInfo(userMessage)
.then((res) => {
console.log('gerPreInfo返回结果:', res);
if (res && res.code == 200 && res.data) {
// 将获取到的患者信息填充到registerForm
processCardData({
patientInfo: {
patientName: res.data.name,
idCard: res.data.idCard,
patientId: res.data.id,
code: res.data.id,
gender: res.data.genderEnum,
// 其他需要的字段
encounterId:registerForm.value.encounterId,
certType:userMessage.certType,
}
});
} else {
ElMessage.error('未获取到有效的患者信息');
}
})
.catch((error) => {
console.error('gerPreInfo调用失败:', error);
})
.finally(() => {
readCardLoading.value = false;
});
ElMessage.success('读卡成功');
readCardLoading.value = false;
}
} catch (error) {
console.error('调用失败:', error);
ElMessage.error('读卡失败');
readCardLoading.value = false;
}
}
onMounted(() => {
console.log('路由参数:', route.query);
console.log('操作类型:', operationType.value);
// 优先检查是否有卡片数据传递过来
const cardDataParam = route.query.cardData || route.params.cardData;
const cardType = route.query.cardType || route.params.cardType;
if (cardDataParam) {
try {
console.log('卡片数据参数存在:', cardDataParam);
const cardData = JSON.parse(decodeURIComponent(cardDataParam));
console.log('接收到的卡片数据:', cardData);
console.log('卡片类型:', cardType);
// 处理接收到的数据
processCardData(cardData);
} catch (e) {
console.error('解析卡片数据失败:', e);
console.error('原始卡片数据:', cardDataParam);
}
} else {
console.log('没有接收到卡片数据');
}
// 对于HospitalizationRegistration操作类型不调用loadRegisterInfo因为数据已通过卡片传递
if (operationType.value !== 'HospitalizationRegistration' && encounterId.value) {
console.log('调用loadRegisterInfo加载信息');
loadRegisterInfo();
}
});
</script>
<style lang="scss" scoped>
.read-card-section {
margin-bottom: 20px;
padding: 15px;
background: #f5f7fa;
border-radius: 4px;
display: flex;
align-items: center;
gap: 20px;
}
</style>

View File

@@ -1,4 +1,5 @@
<template>
<<<<<<< HEAD
<div class="registerForm-container">
<div class="operate">
<div>住院信息</div>
@@ -186,10 +187,311 @@
</el-form-item>
</el-col>
</el-row>
=======
<div>
<el-form ref="patientRef" :model="form" :rules="rules" label-width="140px" :inline="true">
<el-form-item label="联系人姓名" prop="conerName">
<el-input
v-model="form.conerName"
clearable
placeholder="请输入联系人姓名"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="联系电话" prop="tel">
<el-input v-model="form.tel" clearable placeholder="请输入联系电话" style="width: 200px" />
</el-form-item>
<el-form-item label="入院时间" prop="begntime">
<el-date-picker
v-model="form.begntime"
type="datetime"
placeholder="请选择时间"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="就诊凭证类型" prop="mdtrtCertType">
<el-input
v-model="form.mdtrtCertType"
clearable
placeholder="请输入就诊凭证类型"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="就诊凭证编号" prop="mdtrtCertNo">
<el-input
v-model="form.mdtrtCertNo"
clearable
placeholder="请输入就诊凭证编号"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="医疗类别" prop="medType">
<el-select v-model="form.medType" placeholder="请选择医疗类别" style="width: 200px">
<el-option
v-for="item in med_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="住院号" prop="iptNo">
<el-input v-model="form.iptNo" clearable placeholder="请输入住院号" style="width: 200px" />
</el-form-item>
<el-form-item label="病历号" prop="medrcdno">
<el-input
v-model="form.medrcdno"
clearable
placeholder="请输入病历号"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="主治医生编码" prop="atddrNo">
<el-input
v-model="form.atddrNo"
clearable
placeholder="请输入主治医生编码"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="主诊医师姓名" prop="chfpdrName">
<el-input
v-model="form.chfpdrName"
clearable
placeholder="请输入主诊医师姓名"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="入院诊断描述" prop="admDiagDscr">
<el-input
v-model="form.admDiagDscr"
type="textarea"
:rows="1"
placeholder="请输入入院诊断描述"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="入院科室编码" prop="admDeptCodg">
<el-input
v-model="form.admDeptCodg"
clearable
placeholder="请输入入院科室编码"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="入院科室名称" prop="admDeptName">
<el-input
v-model="form.admDeptName"
clearable
placeholder="请输入入院科室名称"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="入院床位" prop="admBed">
<el-input
v-model="form.admBed"
clearable
placeholder="请输入入院床位"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="住院主诊断代码" prop="dscgMaindiagCode">
<el-input
v-model="form.dscgMaindiagCode"
clearable
placeholder="请输入住院主诊断代码"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="住院主诊断名称" prop="dscgMaindiagName">
<el-input
v-model="form.dscgMaindiagName"
clearable
placeholder="请输入住院主诊断名称"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="主要病情描述" prop="mainCondDscr">
<el-input
v-model="form.mainCondDscr"
type="textarea"
:rows="1"
placeholder="请输入主要病情描述"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="病种编码" prop="diseCodg">
<el-input
v-model="form.diseCodg"
clearable
placeholder="请输入病种编码"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="病种名称" prop="diseName">
<el-input
v-model="form.diseName"
clearable
placeholder="请输入病种名称"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="手术操作代码" prop="oprnOprtCode">
<el-input
v-model="form.oprnOprtCode"
clearable
placeholder="请输入手术操作代码"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="手术操作名称" prop="oprnOprtName">
<el-input
v-model="form.oprnOprtName"
clearable
placeholder="请输入手术操作名称"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="病种类型" prop="diseTypeCode">
<el-input
v-model="form.diseTypeCode"
clearable
placeholder="请输入病种类型"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="计划生育服务证号" prop="fpscNo">
<el-input
v-model="form.fpscNo"
clearable
placeholder="请输入计划生育服务证号"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="生育类别" prop="matnType">
<el-input
v-model="form.matnType"
clearable
placeholder="请输入生育类别"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="计划生育手术类别" prop="birctrlType">
<el-input
v-model="form.birctrlType"
clearable
placeholder="请输入计划生育手术类别"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="晚育标志" prop="latechbFlag">
<el-input
v-model="form.latechbFlag"
clearable
placeholder="请输入晚育标志"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="孕周数" prop="gesoVal">
<el-input
v-model="form.gesoVal"
clearable
placeholder="请输入孕周数"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="胎次" prop="fetts">
<el-input v-model="form.fetts" clearable placeholder="请输入胎次" style="width: 200px" />
</el-form-item>
<el-form-item label="胎儿数" prop="fetusCnt">
<el-input
v-model="form.fetusCnt"
clearable
placeholder="请输入胎儿数"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="早产标志" prop="pretFlag">
<el-input
v-model="form.pretFlag"
clearable
placeholder="请输入早产标志"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="手术或生育日期" prop="birctrlMatnDate">
<el-date-picker
v-model="form.birctrlMatnDate"
type="date"
placeholder="请选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="参保地医保区划" prop="insuplcAdmdvs">
<el-input
v-model="form.insuplcAdmdvs"
clearable
placeholder="请输入参保地医保区划"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="就医地医保区划" prop="mdtrtareaAdmvs">
<el-input
v-model="form.mdtrtareaAdmvs"
clearable
placeholder="请输入就医地医保区划"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="扩展内容" prop="expContent">
<el-input
v-model="form.expContent"
type="textarea"
:rows="1"
placeholder="请输入扩展内容"
style="width: 200px"
/>
</el-form-item>
>>>>>>> v1.3
</el-form>
</div>
</template>
<script setup>
<<<<<<< HEAD
import {
getInit,
getOrgList,
@@ -438,3 +740,152 @@ defineExpose({ validateData, submitForm, init });
}
}
</style>
=======
import { reactive, ref, watch } from 'vue';
const props = defineProps({
registerForm: {
type: Object,
default: () => ({}),
},
});
const { proxy } = getCurrentInstance();
const { med_type } = proxy.useDict('med_type');
const patientRef = ref(null);
const form = reactive({
conerName: props.registerForm.coner_name,
tel: props.registerForm.tel,
begntime: props.registerForm.begntime,
mdtrtCertType: props.registerForm.mdtrt_cert_type,
mdtrtCertNo: props.registerForm.mdtrt_cert_no,
medType: props.registerForm.med_type,
iptNo: props.registerForm.ipt_no,
medrcdno: props.registerForm.medrcdno,
atddrNo: props.registerForm.atddr_no,
chfpdrName: props.registerForm.chfpdr_name,
admDiagDscr: props.registerForm.adm_diag_dscr,
admDeptCodg: props.registerForm.adm_dept_codg,
admDeptName: props.registerForm.adm_dept_name,
admBed: props.registerForm.adm_bed,
dscgMaindiagCode: props.registerForm.dscg_maindiag_code,
dscgMaindiagName: props.registerForm.dscg_maindiag_name,
mainCondDscr: props.registerForm.main_cond_dscr,
diseCodg: props.registerForm.dise_codg,
diseName: props.registerForm.dise_name,
oprnOprtCode: props.registerForm.oprn_oprt_code,
oprnOprtName: props.registerForm.oprn_oprt_name,
diseTypeCode: props.registerForm.dise_type_code,
fpscNo: props.registerForm.fpsc_no,
matnType: props.registerForm.matn_type,
birctrlType: props.registerForm.birctrl_type,
latechbFlag: props.registerForm.latechb_flag,
gesoVal: props.registerForm.geso_val,
fetts: props.registerForm.fetts,
fetusCnt: props.registerForm.fetus_cnt,
pretFlag: props.registerForm.pret_flag,
birctrlMatnDate: props.registerForm.birctrl_matn_date,
insuplcAdmdvs: props.registerForm.insuplc_admdvs,
mdtrtareaAdmvs: props.registerForm.mdtrtarea_admvs,
expContent: props.registerForm.exp_content,
});
// 诊断相关的响应式数据
const diagnosisSearchkey = ref('');
const rowIndex = ref();
const diagnosisOptions = ref([]);
const rules = {
conerName: [{ required: true, message: '请输入联系人姓名', trigger: 'blur' }],
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
diagSrtNo: [{ required: true, message: '请输入诊断序号', trigger: 'change' }],
// tel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
// begntime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
// mdtrtCertType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
// mdtrtCertNo: [{ required: true, message: '请输入证件号码', trigger: 'blur' }],
// medType: [{ required: true, message: '请选择就诊类型', trigger: 'change' }],
// iptNo: [{ required: true, message: '请输入住院号', trigger: 'blur' }],
// medrcdno: [{ required: true, message: '请输入就诊人编号', trigger: 'blur' }],
// atddrNo: [{ required: true, message: '请输入住院地址编号', trigger: 'blur' }],
// chfpdrName: [{ required: true, message: '请输入处方人姓名', trigger: 'blur' }],
// admDiagDscr: [{ required: true, message: '请输入主诊断描述', trigger: 'blur' }],
// admDeptCodg: [{ required: true, message: '请输入科室编码', trigger: 'blur' }],
// admDeptName: [{ required: true, message: '请输入科室名称', trigger: 'blur' }],
// admBed: [{ required: true, message: '请输入病床号', trigger: 'blur' }],
// dscgNo: [{ required: true, message: '请输入出院编号', trigger: 'blur' }],
// dscgDate: [{ required: true, message: '请选择出院时间', trigger: 'change' }],
// dscgType: [{ required: true, message: '请选择出院类型', trigger: 'change' }],
// dscgReason: [{ required: true, message: '请输入出院原因', trigger: 'blur' }],
// dscgMaindiagCode: [{ required: true, message: '请输入出院主要诊断编码', trigger: 'blur' }],
// dscgMaindiagName: [{ required: true, message: '请输入出院主要诊断名称', trigger: 'blur' }],
// mainCondDscr: [{ required: true, message: '请输入主要诊断描述', trigger: 'blur' }],
// diseCodg: [{ required: true, message: '请输入诊断编码', trigger: 'blur' }],
// diseName: [{ required: true, message: '请输入诊断名称', trigger: 'blur' }],
// oprnOprtCode: [{ required: true, message: '请输入手术操作人编码', trigger: 'blur' }],
// oprnOprtName: [{ required: true, message: '请输入手术操作人姓名', trigger: 'blur' }],
// diseTypeCode: [{ required: true, message: '请选择诊断类型编码', trigger: 'change' }],
// fpscNo: [{ required: true, message: '请输入发票编号', trigger: 'blur' }],
// matnType: [{ required: true, message: '请选择Material类型', trigger: 'change' }],
// birctrlType: [{ required: true, message: '请选择病案类型', trigger: 'change' }],
// latechbFlag: [{ required: true, message: '请选择是否Latechb', trigger: 'change' }],
// gesoVal: [{ required: true, message: '请输入Geso值', trigger: 'blur' }],
// fetts: [{ required: true, message: '请输入Fetts', trigger: 'blur' }],
// fts: [{ required: true, message: '请输入Fts', trigger: 'blur' }],
// ftsd: [{ required: true, message: '请输入Ftsd', trigger: 'blur' }],
// fetusCnt: [{ required: true, message: '请输入FetusCnt', trigger: 'blur' }],
// fetalHb: [{ required: true, message: '请输入FetalHb', trigger: 'blur' }],
// fetalHbD: [{ required: true, message: '请输入FetalHbD', trigger: 'blur' }],
// fetalHbDd: [{ required: true, message: '请输入FetalHbDd', trigger: 'blur' }],
// pretFlag: [{ required: true, message: '请输入FetalHbDdd', trigger: 'blur' }],
// birctrlMatnDate: [{ required: true, message: '请输入FetalHbDddd', trigger: 'blur' }],
// insuplcAdmdvs: [{ required: true, message: '请输入FetalHbDdddd', trigger: 'blur' }],
// mdtrtareaAdmvs: [{ required: true, message: '请输入FetalHbDddddd', trigger: 'blur' }],
// expContent: [{ required: true, message: '请输入FetalHbDdddddd', trigger: 'blur' }],
};
// 重置表单
function resetForm() {
for (const key in form) {
form[key] = '';
}
}
function setFormValue(data = {}) {
Object.keys(form).forEach((key) => {
form[key] = data?.[key] ?? '';
});
Object.keys(data || {}).forEach((key) => {
if (!(key in form)) {
form[key] = data[key];
}
});
}
watch(
() => props.registerForm,
(newVal) => {
if (newVal && Object.keys(newVal).length) {
setFormValue(newVal);
} else {
resetForm();
}
},
{ immediate: true, deep: true }
);
const submitForm = form;
const validateData = async (callback) => {
if (!patientRef.value) {
if (typeof callback === 'function') {
callback();
}
return true;
}
try {
await patientRef.value.validate();
if (typeof callback === 'function') {
callback();
}
return true;
} catch (error) {
return false;
}
};
defineExpose({ validateData, submitForm, resetForm });
</script>
>>>>>>> v1.3