fix(doctorstation): 解决诊疗项目执行科室缺失问题

- 在批量签发前验证诊疗项目的执行科室是否已设置
- 对于未选择执行科室的诊疗项目显示警告信息并阻止签发
- 当诊疗项目没有设置执行科室时默认使用患者的就诊科室
- 在后端服务中增加对诊疗项目执行科室的非空校验
- 确保诊疗项目签发流程中执行科室信息完整有效
This commit is contained in:
2026-03-23 17:18:12 +08:00
parent f1a4fc87c8
commit 251cf263ff
2 changed files with 17 additions and 1 deletions

View File

@@ -1075,6 +1075,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
}
for (AdviceSaveDto adviceSaveDto : insertOrUpdateList) {
// 🔧 Bug Fix #238: 诊疗项目执行科室非空校验
if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == 3) {
if (adviceSaveDto.getPositionId() == null) {
throw new ServiceException("诊疗项目必须选择执行科室");
}
}
serviceRequest = new ServiceRequest();
serviceRequest.setId(adviceSaveDto.getRequestId()); // 主键id
serviceRequest.setStatusEnum(is_save ? RequestStatus.DRAFT.getValue() : RequestStatus.ACTIVE.getValue());// 请求状态

View File

@@ -2100,6 +2100,13 @@ function handleSave(prescriptionId) {
// 过滤出真正可以签发的列表 (已保存的)
saveList = saveList.filter((item) => item.isSaved || item.requestId);
// 🔧 Bug Fix #238: 批量签发前校验诊疗项目执行科室
const invalidItems = saveList.filter(item => item.adviceType === 3 && !item.orgId);
if (invalidItems.length > 0) {
proxy.$modal.msgWarning(`有 ${invalidItems.length} 个诊疗项目未选择执行科室,请先编辑完善`);
return;
}
if (saveList.length == 0) {
if (selectedRows.length > 0) {
proxy.$modal.msgWarning('选中的医嘱不可签发(可能未保存或已签发)');
@@ -3067,7 +3074,10 @@ function setValue(row) {
prescriptionList.value[rowIndex.value].categoryEnum = 31; // 会诊的category_enum设置为31
} else {
// 诊疗类型adviceType == 3
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
// 🔧 Bug Fix #238: 诊疗项目默认使用患者就诊科室
if (!prescriptionList.value[rowIndex.value].orgId) {
prescriptionList.value[rowIndex.value].orgId = props.patientInfo.orgId;
}
// 🔧 Bug #218 修复使用组套中维护的quantity如果没有则默认1
prescriptionList.value[rowIndex.value].quantity = row.quantity || 1;
// 🔧 Bug #144 修复:安全访问 priceList防止 orderDetailInfos 为空时出错