From c8ca56c3f5efe5ed7a31515cc3ec4014e1cfec69 Mon Sep 17 00:00:00 2001 From: qk123 <18211963828@163.com> Date: Tue, 9 Dec 2025 16:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F=E6=8E=92?= =?UTF-8?q?=E7=8F=AD->=E7=A7=91=E5=AE=A4=E5=90=8D=E7=A7=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E7=A7=91=E5=AE=A4=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/appoinmentmanage/index.vue | 47 ++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/openhis-ui-vue3/src/views/appoinmentmanage/index.vue b/openhis-ui-vue3/src/views/appoinmentmanage/index.vue index 4c899ffd..84acf0c7 100644 --- a/openhis-ui-vue3/src/views/appoinmentmanage/index.vue +++ b/openhis-ui-vue3/src/views/appoinmentmanage/index.vue @@ -9,16 +9,12 @@
- + - - - - - + 查询 @@ -131,6 +127,7 @@ import { ref, onMounted } from 'vue' import { ElMessage, ElDialog, ElSelect, ElOption, ElInput, ElForm, ElFormItem } from 'element-plus' import { EditPen, View, DocumentRemove } from '@element-plus/icons-vue' import { listDept, searchDept } from '@/api/appoinmentmanage/dept' +import { getLocationTree } from '@/views/charge/outpatientregistration/components/outpatientregistration' // 查询参数 const queryParams = ref({ @@ -138,6 +135,9 @@ const queryParams = ref({ deptName: '' }) +// 科室选项列表 +const departmentOptions = ref([]) + // 科室列表 const deptList = ref([]) @@ -276,9 +276,44 @@ const handleCurrentChange = (current) => { getDeptList() } +// 获取门诊挂号的就诊科室数据 +const getDepartmentOptions = async () => { + try { + const response = await getLocationTree() + if (response.code === 200) { + // 适配不同的后端数据结构 + let actualData = response.data + // 处理嵌套data结构 + if (actualData && actualData.code === 200 && actualData.msg) { + actualData = actualData.data + } + + // 确保数据是数组格式 + if (Array.isArray(actualData)) { + departmentOptions.value = actualData + } else if (actualData && actualData.records) { + departmentOptions.value = actualData.records + } else if (actualData && actualData.content) { + departmentOptions.value = actualData.content + } else if (actualData && actualData.list) { + departmentOptions.value = actualData.list + } else { + departmentOptions.value = [] + } + } else { + console.error('获取科室列表失败:', response.msg) + departmentOptions.value = [] + } + } catch (error) { + console.error('获取科室列表失败:', error) + departmentOptions.value = [] + } +} + // 页面加载时获取科室列表 onMounted(() => { getDeptList() + getDepartmentOptions() })