增加监护人信息限制,在门诊挂号页面增加档案按钮完成患者档案管理的跳转

This commit is contained in:
2025-11-05 11:38:47 +08:00
parent b7412648b4
commit 7ac26cf781
3 changed files with 70 additions and 12 deletions

View File

@@ -372,6 +372,23 @@ const validateIdCard = (rule, value, callback) => {
callback(); // 校验通过 callback(); // 校验通过
} }
// 监护人信息条件验证函数
const validateGuardianInfo = (rule, value, callback) => {
// 只有当年龄小于18岁时才验证监护人信息
if (form.value.age) {
// 提取年龄数字部分
const ageMatch = form.value.age.toString().match(/\d+/);
if (ageMatch) {
const age = parseInt(ageMatch[0]);
// 如果年龄小于18岁监护人信息必须填写
if (age < 18 && !value) {
return callback(new Error('年龄小于18岁的患者必须填写监护人信息'));
}
}
}
// 18岁及以上患者或年龄未填写时跳过验证
callback();
}
const data = reactive({ const data = reactive({
isViewMode: false, isViewMode: false,
@@ -394,6 +411,11 @@ const data = reactive({
{ validator: validateUniquePatient, trigger: 'blur' } { validator: validateUniquePatient, trigger: 'blur' }
], ],
birthDate: [{ required: false, message: '请选择出生日期', trigger: 'change' }], birthDate: [{ required: false, message: '请选择出生日期', trigger: 'change' }],
// 监护人信息条件验证规则
guardianName: [{ validator: validateGuardianInfo, trigger: 'blur' }],
guardianRelation: [{ validator: validateGuardianInfo, trigger: 'blur' }],
guardianPhone: [{ validator: validateGuardianInfo, trigger: 'blur' }],
guardianIdNo: [{ validator: validateGuardianInfo, trigger: 'blur' }],
}, },
}); });
@@ -583,13 +605,16 @@ function submitForm() {
form.value.idCard.toString().substring(12, 14); form.value.idCard.toString().substring(12, 14);
console.log(form.value.birthDate, 123); console.log(form.value.birthDate, 123);
} }
// 进行表单验证
proxy.$refs['patientRef'].validate((valid) => { proxy.$refs['patientRef'].validate((valid) => {
if (valid) { if (valid) {
// 使用 // 提交表单前的处理
if (!form.value.identifierNo) { if (!form.value.identifierNo) {
form.value.typeCode = undefined; form.value.typeCode = undefined;
} }
form.value.address = getAddress(form); form.value.address = getAddress(form);
// 提交新增患者请求
addPatient(form.value).then((response) => { addPatient(form.value).then((response) => {
proxy.$modal.msgSuccess('新增成功'); proxy.$modal.msgSuccess('新增成功');
getPatientInfo(response.data.idCard); getPatientInfo(response.data.idCard);

View File

@@ -3,7 +3,14 @@
<el-row> <el-row>
<el-col :span="24" class="card-box"> <el-col :span="24" class="card-box">
<el-card> <el-card>
<template #header> <span style="vertical-align: middle">门诊挂号</span></template> <template #header>
<div style="display: flex; width: 100%; justify-content: center; position: relative;">
<span style="position: absolute; left: 0; vertical-align: middle;">门诊挂号</span>
<el-button type="primary" plain @click="handleArchive" style="width: 100px; height: 36px; font-size: 14px;">
档案
</el-button>
</div>
</template>
<el-form :model="form" :rules="rules" ref="outpatientRegistrationRef" label-width="110px"> <el-form :model="form" :rules="rules" ref="outpatientRegistrationRef" label-width="110px">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="5"> <el-col :span="5">
@@ -56,6 +63,7 @@
<el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px"> <el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px">
医保卡 医保卡
</el-button> </el-button>
<!-- <el-button <!-- <el-button
type="primary" type="primary"
plain plain
@@ -1188,9 +1196,16 @@ function handleAdd() {
}); });
} }
/** /** 档案按钮点击事件 - 跳转到患者档案管理界面 */
* 姓名表单获取焦点打开列表 function handleArchive() {
*/ // 使用路由跳转到患者档案管理界面,并携带门诊号作为搜索参数
router.push({
path: '/system/basicmanage/patientmanagement',
query: { searchKey: form.value.busNo }
});
}
/** 姓名表单获取焦点打开列表 */
function handleFocus() { function handleFocus() {
showPopover.value = true; showPopover.value = true;
} }

View File

@@ -179,11 +179,19 @@
label='门诊号' label='门诊号'
align="center" align="center"
key="busNo" key="busNo"
prop="busNo" min-width="150px"
width="110px"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
resizable resizable
/> >
<template #default="scope">
<el-button
type="text"
@click="handleArchive(scope.row)"
>
{{ scope.row.busNo }}
</el-button>
</template>
</el-table-column>
<el-table-column <el-table-column
label="科室" label="科室"
align="center" align="center"
@@ -207,7 +215,7 @@
align="center" align="center"
key="ybCode" key="ybCode"
prop="ybCode" prop="ybCode"
width="190px" min-width="200px"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
resizable resizable
/> />
@@ -217,7 +225,7 @@
align="center" align="center"
key="clinicalName" key="clinicalName"
prop="clinicalName" prop="clinicalName"
min-width="150px" min-width="180px"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
resizable resizable
/> />
@@ -226,7 +234,7 @@
align="center" align="center"
key="ybNo" key="ybNo"
prop="ybNo" prop="ybNo"
width="220px" min-width="250px"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
resizable resizable
/> />
@@ -734,6 +742,16 @@ function autoFitColumnWidth(property) {
} }
} }
/** 跳转到患者档案管理页面 */
function handleArchive(row) {
// 跳转到患者档案管理页面并传递busNo参数
proxy.$router.push({
path: '/system/basicmanage/patientmanagement',
query: { searchKey: row.busNo }
});
}
getList(); getList();
getPharmacyCabinetLists() getPharmacyCabinetLists()