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