Compare commits
2 Commits
d28ac34ae0
...
251cf263ff
| Author | SHA1 | Date | |
|---|---|---|---|
| 251cf263ff | |||
| f1a4fc87c8 |
@@ -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());// 请求状态
|
||||
|
||||
@@ -573,7 +573,11 @@ function selectAdviceBase(key, row) {
|
||||
}
|
||||
} else {
|
||||
// 诊疗:设置执行科室和价格
|
||||
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId;
|
||||
// 🔧 Bug Fix #238: 如果positionId为空,使用orgId作为默认值
|
||||
const rowData = JSON.parse(JSON.stringify(row));
|
||||
const selectedPositionId = rowData.positionId;
|
||||
const selectedOrgId = rowData.orgId;
|
||||
prescriptionList.value[rowIndex.value].orgId = selectedPositionId || selectedOrgId;
|
||||
if (row.priceList && row.priceList.length > 0) {
|
||||
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
|
||||
} else {
|
||||
@@ -751,6 +755,11 @@ function handleSave() {
|
||||
|
||||
// 单行处方保存
|
||||
function handleSaveSign(row, index) {
|
||||
// 🔧 Bug Fix #238: 诊疗项目必须选择执行科室
|
||||
if (row.adviceType === 3 && !row.orgId) {
|
||||
proxy.$modal.msgWarning('诊疗项目必须选择执行科室');
|
||||
return;
|
||||
}
|
||||
proxy.$refs['formRef' + index].validate((valid) => {
|
||||
if (valid) {
|
||||
row.isEdit = false;
|
||||
@@ -774,6 +783,11 @@ function handleSaveSign(row, index) {
|
||||
proxy.$modal.msgSuccess('保存成功');
|
||||
getListInfo(false);
|
||||
nextId.value == 1;
|
||||
// 🔧 Bug Fix #238: 如果诊疗项目缺少执行科室,标记为需要修复的脏数据
|
||||
if (row.adviceType === 3 && !row.orgId) {
|
||||
console.warn('Bug #238: 检测到诊疗项目保存时缺少执行科室,请手动编辑修正:', row);
|
||||
proxy.$modal.msgWarning('诊疗项目执行科室信息不完整,请编辑后重新保存');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 为空时出错
|
||||
|
||||
Reference in New Issue
Block a user