Fix Bug #441: 门诊手术安排:手术室护士角色进入页面提示"无权限"且"获取卫生机构列表失败"
根因:loadDeptList/loadDoctorList/loadNurseList/loadOperatingRoomList 调用的API 没有设置 skipErrorMsg: true,当手术室护士等角色无权限时,axios响应拦截器会 弹出错误提示。只有 getTenantPageSilent 设置了 skipErrorMsg,其他均未设置。 修复:为所有字典加载API创建静默包装函数(deptTreeSelectSilent/listUserSilent/ listOperatingRoomSilent),统一使用 skipErrorMsg: true 跳过拦截器错误弹窗, 在 catch 块中静默降级为空数组。
This commit is contained in:
@@ -881,16 +881,13 @@ import {
|
||||
deleteSurgerySchedule,
|
||||
getSurgeryScheduleDetail
|
||||
} from '@/api/surgicalschedule'
|
||||
import { listUser } from '@/api/system/user'
|
||||
import { deptTreeSelect } from '@/api/system/user'
|
||||
import { listOperatingRoom } from '@/api/operatingroom'
|
||||
import { getSurgeryPage} from '@/views/inpatientDoctor/home/components/applicationShow/api.js'
|
||||
import { getContract } from '@/views/inpatientDoctor/home/components/api.js'
|
||||
import request from '@/utils/request'
|
||||
import SurgeryCharge from '../charge/surgerycharge/index.vue'
|
||||
import TemporaryMedical from './temporaryMedical.vue'
|
||||
|
||||
// 静默获取卫生机构列表(跳过拦截器错误提示,手术室护士等角色可能无此权限)
|
||||
// 静默获取字典列表(跳过拦截器错误提示,手术室护士等角色可能无此权限)
|
||||
function getTenantPageSilent(query) {
|
||||
return request({
|
||||
url: '/system/tenant/page',
|
||||
@@ -900,6 +897,36 @@ function getTenantPageSilent(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 静默获取科室树(跳过拦截器错误提示)
|
||||
function deptTreeSelectSilent(params = {}) {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
params: { typeEnum: 2, ...params },
|
||||
skipErrorMsg: true
|
||||
})
|
||||
}
|
||||
|
||||
// 静默获取用户列表(跳过拦截器错误提示)
|
||||
function listUserSilent(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/practitioner/user-practitioner-page',
|
||||
method: 'get',
|
||||
params: query,
|
||||
skipErrorMsg: true
|
||||
})
|
||||
}
|
||||
|
||||
// 静默获取手术室列表(跳过拦截器错误提示)
|
||||
function listOperatingRoomSilent(query) {
|
||||
return request({
|
||||
url: '/base-data-manage/operating-room/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
skipErrorMsg: true
|
||||
})
|
||||
}
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
const loading = ref(true)
|
||||
@@ -1148,7 +1175,7 @@ function loadOrgList() {
|
||||
|
||||
// 加载科室列表
|
||||
function loadDeptList() {
|
||||
deptTreeSelect()
|
||||
deptTreeSelectSilent()
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
const tree = res.data?.records || res.data || []
|
||||
@@ -1168,7 +1195,7 @@ function loadDeptList() {
|
||||
|
||||
// 加载医生列表
|
||||
function loadDoctorList() {
|
||||
listUser({ pageNo: 1, pageSize: 1000 })
|
||||
listUserSilent({ pageNo: 1, pageSize: 1000 })
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
const records = res.data?.records || []
|
||||
@@ -1188,7 +1215,7 @@ function loadDoctorList() {
|
||||
|
||||
// 加载护士列表
|
||||
function loadNurseList() {
|
||||
listUser({ pageNo: 1, pageSize: 1000 })
|
||||
listUserSilent({ pageNo: 1, pageSize: 1000 })
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
const records = res.data?.records || []
|
||||
@@ -1208,7 +1235,7 @@ function loadNurseList() {
|
||||
|
||||
// 加载手术室列表
|
||||
function loadOperatingRoomList() {
|
||||
listOperatingRoom({ pageNo: 1, pageSize: 1000, statusEnum: 1 })
|
||||
listOperatingRoomSilent({ pageNo: 1, pageSize: 1000, statusEnum: 1 })
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
const records = res.data?.records || []
|
||||
|
||||
Reference in New Issue
Block a user