Fix Bug #478: 【住院医生工作站-检验申请】点击"详情"查看检验单时,"发往科室"字段回显异常(显示为"-")

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-11 00:09:06 +08:00
parent 14ecf0ffce
commit f250399383

View File

@@ -173,7 +173,7 @@ import {computed, getCurrentInstance, ref, watch} from 'vue';
import {Refresh, Search} from '@element-plus/icons-vue'; import {Refresh, Search} from '@element-plus/icons-vue';
import {patientInfo} from '../../store/patient.js'; import {patientInfo} from '../../store/patient.js';
import {getInspection} from './api'; import {getInspection} from './api';
import {getOrgList} from '@/views/doctorstation/components/api.js'; import {getDepartmentList} from '@/api/public.js';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@@ -332,8 +332,8 @@ const hasMatchedFields = computed(() => {
/** 查询科室 */ /** 查询科室 */
const getLocationInfo = () => { const getLocationInfo = () => {
getOrgList().then((res) => { getDepartmentList().then((res) => {
orgOptions.value = res.data.records; orgOptions.value = res.data || [];
}); });
}; };
@@ -345,10 +345,12 @@ const recursionFun = (targetDepartment) => {
name = obj.name; name = obj.name;
} }
const subObjArray = obj['children']; const subObjArray = obj['children'];
for (let index = 0; index < subObjArray.length; index++) { if (subObjArray && subObjArray.length > 0) {
const item = subObjArray[index]; for (let i = 0; i < subObjArray.length; i++) {
if (item.id == targetDepartment) { const item = subObjArray[i];
name = item.name; if (item.id == targetDepartment) {
name = item.name;
}
} }
} }
} }