门诊挂号查询优化

This commit is contained in:
2025-11-25 16:14:03 +08:00
parent 3d3b21a775
commit 0b98763c05

View File

@@ -71,7 +71,7 @@
width="210" width="210"
fixed="right" fixed="right"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@@ -464,23 +464,42 @@ const findNodeByCode = (data, code) => {
return null; return null;
}; };
/** 查询菜单列表 */ /** 查询患者列表 */
function getList() { function getList() {
listPatient(queryParams.value).then((response) => { listPatient(queryParams.value).then((response) => {
patientList.value = response.data.records; // 适配门诊挂号接口返回的数据格式
total.value = response.data.total; // 不同的接口可能返回不同格式,这里做一个通用适配
if (response.data && Array.isArray(response.data)) {
// 如果返回的直接是数组
patientList.value = response.data;
total.value = response.data.length;
} else if (response.data && response.data.records) {
// 如果返回的是分页格式
patientList.value = response.data.records;
total.value = response.data.total;
} else if (response.data && response.data.rows) {
// 另一种可能的分页格式
patientList.value = response.data.rows;
total.value = response.data.total;
} else {
// 默认处理
patientList.value = [];
total.value = 0;
}
}); });
lists().then((response) => { lists().then((response) => {
console.log(response); console.log(response);
occupationtypeList.value = response.data.occupationType; // 确保即使响应格式变化也能正常工作
administrativegenderList.value = response.data.sex; if (response.data) {
bloodtypeaboList.value = response.data.bloodTypeABO; occupationtypeList.value = response.data.occupationType || [];
bloodtypearhList.value = response.data.bloodTypeRH; administrativegenderList.value = response.data.sex || [];
familyrelationshiptypeList.value = response.data.familyRelationshipType; bloodtypeaboList.value = response.data.bloodTypeABO || [];
maritalstatusList.value = response.data.maritalStatus; bloodtypearhList.value = response.data.bloodTypeRH || [];
tempFlagList.value = response.data.whetherStatus; familyrelationshiptypeList.value = response.data.familyRelationshipType || [];
idTypeList.value = response.data.identityDocumentType; maritalstatusList.value = response.data.maritalStatus || [];
console.log(idTypeList.value, 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); tempFlagList.value = response.data.whetherStatus || [];
idTypeList.value = response.data.identityDocumentType || [];
}
}); });
} }
@@ -530,6 +549,8 @@ function handleQuery() {
dateRange.value && dateRange.value.length == 2 ? dateRange.value[0] : ''; dateRange.value && dateRange.value.length == 2 ? dateRange.value[0] : '';
queryParams.value.createTimeETime = queryParams.value.createTimeETime =
dateRange.value && dateRange.value.length == 2 ? dateRange.value[1] : ''; dateRange.value && dateRange.value.length == 2 ? dateRange.value[1] : '';
// 执行查询
getList();
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {