diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index f5530839..aa2e422c 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -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());// 请求状态 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 60d2b97a..8b973667 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -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 为空时出错