Fix Bug #441: 门诊手术安排:手术室护士角色进入页面提示"无权限"且"获取卫生机构列表失败"

策略B(优雅降级):将 loadDeptList、loadDoctorList、loadNurseList、loadOperatingRoomList 四个初始化接口中的 proxy.$modal.msgError 改为 console.warn 静默降级,避免权限不足时弹窗阻断页面。配合已有的 loadOrgList 修复,确保手术室护士等角色进入页面时不会因个别字典接口权限拒绝而弹窗报错。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-12 10:04:59 +08:00
committed by 华佗
parent a81e7ec980
commit 374658923d

View File

@@ -1136,12 +1136,14 @@ function loadDeptList() {
const tree = res.data?.records || res.data || [] const tree = res.data?.records || res.data || []
deptList.value = flattenOrgTree(tree) deptList.value = flattenOrgTree(tree)
} else { } else {
proxy.$modal.msgError('获取科室列表失败') // 权限不足时静默降级不弹窗阻断Bug #441
console.warn('科室列表加载失败(可能无权限):', res.message || res.code)
deptList.value = [] deptList.value = []
} }
}) })
.catch(error => { .catch(error => {
proxy.$modal.msgError('获取科室列表失败') // 网络错误或权限拒绝:静默降级
console.warn('科室列表加载失败:', error?.message || error)
deptList.value = [] deptList.value = []
}) })
} }
@@ -1154,12 +1156,14 @@ function loadDoctorList() {
const records = res.data?.records || [] const records = res.data?.records || []
doctorList.value = records.map(mapPractitionerToOption).filter(it => it.code && it.name) doctorList.value = records.map(mapPractitionerToOption).filter(it => it.code && it.name)
} else { } else {
proxy.$modal.msgError('获取医生列表失败') // 权限不足时静默降级不弹窗阻断Bug #441
console.warn('医生列表加载失败(可能无权限):', res.message || res.code)
doctorList.value = [] doctorList.value = []
} }
}) })
.catch(error => { .catch(error => {
proxy.$modal.msgError('获取医生列表失败') // 网络错误或权限拒绝:静默降级
console.warn('医生列表加载失败:', error?.message || error)
doctorList.value = [] doctorList.value = []
}) })
} }
@@ -1172,12 +1176,14 @@ function loadNurseList() {
const records = res.data?.records || [] const records = res.data?.records || []
nurseList.value = records.map(mapPractitionerToOption).filter(it => it.code && it.name) nurseList.value = records.map(mapPractitionerToOption).filter(it => it.code && it.name)
} else { } else {
proxy.$modal.msgError('获取护士列表失败') // 权限不足时静默降级不弹窗阻断Bug #441
console.warn('护士列表加载失败(可能无权限):', res.message || res.code)
nurseList.value = [] nurseList.value = []
} }
}) })
.catch(error => { .catch(error => {
proxy.$modal.msgError('获取护士列表失败') // 网络错误或权限拒绝:静默降级
console.warn('护士列表加载失败:', error?.message || error)
nurseList.value = [] nurseList.value = []
}) })
} }
@@ -1190,12 +1196,14 @@ function loadOperatingRoomList() {
const records = res.data?.records || [] const records = res.data?.records || []
operatingRoomList.value = records.map(mapOperatingRoomToOption).filter(it => it.roomCode) operatingRoomList.value = records.map(mapOperatingRoomToOption).filter(it => it.roomCode)
} else { } else {
proxy.$modal.msgError('获取手术室列表失败') // 权限不足时静默降级不弹窗阻断Bug #441
console.warn('手术室列表加载失败(可能无权限):', res.message || res.code)
operatingRoomList.value = [] operatingRoomList.value = []
} }
}) })
.catch(error => { .catch(error => {
proxy.$modal.msgError('获取手术室列表失败') // 网络错误或权限拒绝:静默降级
console.warn('手术室列表加载失败:', error?.message || error)
operatingRoomList.value = [] operatingRoomList.value = []
}) })
} }
@@ -1910,6 +1918,7 @@ function resetForm() {
allergyRemark: undefined, allergyRemark: undefined,
surgeryNature: undefined, surgeryNature: undefined,
surgerySite: undefined, surgerySite: undefined,
incisionType: undefined,
admissionTime: undefined, admissionTime: undefined,
entryTime: undefined, entryTime: undefined,
roomCode: undefined, roomCode: undefined,