门诊挂号查询优化
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
width="210"
|
||||
fixed="right"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
@@ -464,23 +464,42 @@ const findNodeByCode = (data, code) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
/** 查询菜单列表 */
|
||||
/** 查询患者列表 */
|
||||
function getList() {
|
||||
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) => {
|
||||
console.log(response);
|
||||
occupationtypeList.value = response.data.occupationType;
|
||||
administrativegenderList.value = response.data.sex;
|
||||
bloodtypeaboList.value = response.data.bloodTypeABO;
|
||||
bloodtypearhList.value = response.data.bloodTypeRH;
|
||||
familyrelationshiptypeList.value = response.data.familyRelationshipType;
|
||||
maritalstatusList.value = response.data.maritalStatus;
|
||||
tempFlagList.value = response.data.whetherStatus;
|
||||
idTypeList.value = response.data.identityDocumentType;
|
||||
console.log(idTypeList.value, 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
|
||||
// 确保即使响应格式变化也能正常工作
|
||||
if (response.data) {
|
||||
occupationtypeList.value = response.data.occupationType || [];
|
||||
administrativegenderList.value = response.data.sex || [];
|
||||
bloodtypeaboList.value = response.data.bloodTypeABO || [];
|
||||
bloodtypearhList.value = response.data.bloodTypeRH || [];
|
||||
familyrelationshiptypeList.value = response.data.familyRelationshipType || [];
|
||||
maritalstatusList.value = response.data.maritalStatus || [];
|
||||
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] : '';
|
||||
queryParams.value.createTimeETime =
|
||||
dateRange.value && dateRange.value.length == 2 ? dateRange.value[1] : '';
|
||||
// 执行查询
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
|
||||
Reference in New Issue
Block a user