fix(doctorstation): 修复诊断和手术模块的数据类型及权限过滤问题

- 修复诊断模块中medTypeCode字段使用数字类型字典值而非字符串
- 在报损管理中添加权限过滤后的数据回退机制,当权限过滤无数据时获取全部数据
- 为报损管理新增getPharmacyListAll和getDispensaryListAll接口函数
- 在手术申请模块中添加患者选中校验,防止未选择患者时的操作异常
- 修复手术模块的编辑、查看、删除操作缺少患者校验的问题
This commit is contained in:
2026-03-04 13:16:37 +08:00
parent e722841e60
commit 30ca81090a
4 changed files with 71 additions and 10 deletions

View File

@@ -507,7 +507,7 @@ function handleAddDiagnosis() {
showPopover: false,
name: undefined,
verificationStatusEnum: 4,
medTypeCode: '初诊诊断',
medTypeCode: 11, // Bug #151 修复:使用数字类型的字典值
diagSrtNo: maxSortNo + 1,
iptDiseTypeCode: 2,
diagnosisDesc: '',
@@ -718,7 +718,7 @@ form.value.diagnosisList.push({
ybNo: data.ybNo,
name: data.name,
verificationStatusEnum: 4,
medTypeCode: '初诊诊断',
medTypeCode: 11, // Bug #151 修复:使用数字类型的字典值,而非字符串'初诊诊断'
diagSrtNo: maxSortNo + 1,
definitionId: data.definitionId,
classification: '西医', // 默认为西医

View File

@@ -744,6 +744,11 @@ function handleAdd() {
// 编辑
function handleEdit(row) {
// Bug #152 修复:添加患者选中校验
if (!props.patientInfo?.encounterId) {
proxy.$modal.msgWarning('请先选择患者')
return
}
if (row.statusEnum !== 0) {
proxy.$modal.msgWarning('当前状态不允许编辑手术,仅新开状态可编辑')
return
@@ -795,6 +800,11 @@ getSurgeryDetail(row.id).then(res => {
// 查看
function handleView(row) {
// Bug #152 修复:添加患者选中校验
if (!props.patientInfo?.encounterId) {
proxy.$modal.msgWarning('请先选择患者')
return
}
viewOpen.value = true
getSurgeryDetail(row.id).then(res => {
if (res.code === 200) {
@@ -819,6 +829,11 @@ function handleView(row) {
// 删除/取消
function handleDelete(row) {
// Bug #152 修复:添加患者选中校验
if (!props.patientInfo?.encounterId) {
proxy.$modal.msgWarning('请先选择患者')
return
}
if (row.statusEnum === 0) {
// 新开状态 - 直接删除
proxy.$modal.confirm('是否确认删除手术"' + row.surgeryName + '"?').then(() => {

View File

@@ -88,8 +88,16 @@ export function getCount(queryParams) {
})
}
// 获取药房列表
// 获取药房列表(带权限过滤)
export function getPharmacyList() {
return request({
url: '/app-common/inventory-pharmacy-list',
method: 'get',
})
}
// 获取药房列表(无权限过滤,作为回退)
export function getPharmacyListAll() {
return request({
url: '/app-common/pharmacy-list',
method: 'get',
@@ -104,8 +112,16 @@ export function getPharmacyCabinetList() {
}
// 获取药库列表
// 获取药库列表(带权限过滤)
export function getDispensaryList() {
return request({
url: '/app-common/inventory-cabinet-list',
method: 'get',
})
}
// 获取药库列表(无权限过滤,作为回退)
export function getDispensaryListAll() {
return request({
url: '/app-common/cabinet-list',
method: 'get',

View File

@@ -532,10 +532,12 @@ import {
getBusNoInit,
getCount,
getDispensaryList,
getDispensaryListAll,
getInit,
getMedicineList,
getPharmacyCabinetList,
getPharmacyList,
getPharmacyListAll,
getWarehouseList,
getTransferProductDetail,
lossReportApproved,
@@ -1243,14 +1245,28 @@ function handleLocationClick(id, itemId, index) {
function handleChangePurposeTypeEnum(value) {
if (value == 16) {
getPharmacyList().then((res) => {
if (res.data && res.data.length > 0) {
purposeTypeListOptions.value = res.data;
} else {
// 权限过滤后无数据,尝试获取所有药房
getPharmacyListAll().then((resAll) => {
purposeTypeListOptions.value = resAll.data || [];
});
}
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
});
} else if (value == 11) {
getDispensaryList().then((res) => {
if (res.data && res.data.length > 0) {
purposeTypeListOptions.value = res.data;
} else {
// 权限过滤后无数据,尝试获取所有药库
getDispensaryListAll().then((resAll) => {
purposeTypeListOptions.value = resAll.data || [];
});
}
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
@@ -1264,7 +1280,14 @@ function handleChangelossTypeEnum(value) {
if (value == 16) {
// 药房
getPharmacyList().then((res) => {
if (res.data && res.data.length > 0) {
sourceTypeListOptions.value = res.data;
} else {
// 权限过滤后无数据,尝试获取所有药房
getPharmacyListAll().then((resAll) => {
sourceTypeListOptions.value = resAll.data || [];
});
}
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}
@@ -1272,7 +1295,14 @@ function handleChangelossTypeEnum(value) {
} else if (value == 11) {
// 药库
getDispensaryList().then((res) => {
if (res.data && res.data.length > 0) {
sourceTypeListOptions.value = res.data;
} else {
// 权限过滤后无数据,尝试获取所有药库
getDispensaryListAll().then((resAll) => {
sourceTypeListOptions.value = resAll.data || [];
});
}
if (!route.query.supplyBusNo) {
receiptHeaderForm.lossLocationId = '';
}