门诊医生排班->科室名称管理页面科室下拉选项数据来源更改
This commit is contained in:
@@ -9,16 +9,12 @@
|
||||
<div class="query-condition">
|
||||
<el-select v-model="queryParams.orgName" placeholder="全部机构" class="query-select">
|
||||
<el-option label="全部机构" value=""></el-option>
|
||||
<el-option label="示例医院" value="示例医院"></el-option>
|
||||
<el-option label="中联医院" value="中联医院"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="queryParams.deptName" placeholder="全部科室" class="query-select">
|
||||
<el-option label="全部科室" value=""></el-option>
|
||||
<el-option label="口腔科" value="口腔科"></el-option>
|
||||
<el-option label="妇产科" value="妇产科"></el-option>
|
||||
<el-option label="测试内科" value="测试内科"></el-option>
|
||||
<el-option label="高值耗材房" value="高值耗材房"></el-option>
|
||||
<el-option label="其他内科" value="其他内科"></el-option>
|
||||
<el-option v-for="dept in departmentOptions" :key="dept.id || dept.code" :label="dept.name || dept.deptName" :value="dept.name || dept.deptName"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-button type="primary" @click="handleQuery" class="query-button">查询</el-button>
|
||||
@@ -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()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user