diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java index 9bb6802a..95d0d774 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -250,7 +250,8 @@ public class AdviceSaveDto { */ public AdviceSaveDto() { this.chineseHerbsDoseQuantity = new BigDecimal("1"); - this.therapyEnum = TherapyTimeType.TEMPORARY.getValue(); + // 默认设置为长期医嘱,但前端应该明确传递正确的值 + this.therapyEnum = TherapyTimeType.LONG_TERM.getValue(); this.practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); this.founderOrgId = SecurityUtils.getLoginUser().getOrgId(); // 开方人科室 } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java index b34da1b3..c87deb98 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java @@ -167,6 +167,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { Long organizationId = regAdviceSaveParam.getOrganizationId(); // 医嘱分类信息 List regAdviceSaveList = regAdviceSaveParam.getRegAdviceSaveList(); + // 药品 List medicineList = regAdviceSaveList.stream() .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue index fd4dd612..e02135e2 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -541,11 +541,14 @@ function getListInfo(addNewRow) { loadingInstance.close(); prescriptionList.value = res.data .map((item) => { + const parsedContent = JSON.parse(item.contentJson); return { - ...JSON.parse(item.contentJson), + ...parsedContent, ...item, - doseQuantity: JSON.parse(item.contentJson)?.doseQuantity, - doseUnitCode_dictText: JSON.parse(item.contentJson)?.doseUnitCode_dictText, + doseQuantity: parsedContent?.doseQuantity, + doseUnitCode_dictText: parsedContent?.doseUnitCode_dictText, + // 确保 therapyEnum 被正确设置,优先使用 contentJson 中的值 + therapyEnum: String(parsedContent?.therapyEnum ?? item.therapyEnum ?? '1'), }; }) .sort((a, b) => { @@ -604,7 +607,7 @@ function handleAddPrescription() { showPopover: false, isEdit: true, statusEnum: 1, - therapyEnum: '1', + therapyEnum: '1', // 默认为长期医嘱 }); getGroupMarkers(); nextTick(() => { @@ -641,8 +644,8 @@ function clickRowDb(row, column, event) { } row.showPopover = false; if (row.statusEnum == 1) { - // 确保治疗类型为字符串,方便与单选框 label 对齐 - row.therapyEnum = String(row.therapyEnum ?? ''); + // 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1') + row.therapyEnum = String(row.therapyEnum ?? '1'); row.isEdit = true; const index = prescriptionList.value.findIndex((item) => item.uniqueKey === row.uniqueKey); prescriptionList.value[index] = row; @@ -879,13 +882,16 @@ function handleSave() { // 此处签发处方和单行保存处方传参相同,后台已经将传参存为JSON字符串,此处直接转换为JSON即可 loading.value = true; let list = saveList.map((item) => { + const parsedContent = JSON.parse(item.contentJson); return { - ...JSON.parse(item.contentJson), + ...parsedContent, adviceType: item.adviceType, requestId: item.requestId, dbOpType: '1', groupId: item.groupId, uniqueKey: undefined, + // 确保 therapyEnum 被正确传递 + therapyEnum: parsedContent.therapyEnum || item.therapyEnum || '1', }; }); // 保存签发按钮 @@ -1059,6 +1065,8 @@ function handleSaveSign(row, index) { row.conditionDefinitionId = conditionDefinitionId.value; row.encounterDiagnosisId = encounterDiagnosisId.value; row.diagnosisName = diagnosisName.value; + // 确保 therapyEnum 被正确设置,默认为长期医嘱('1') + row.therapyEnum = row.therapyEnum || '1'; if (row.injectFlag == 1) { row.sortNumber = row.sortNumber ? row.sortNumber : prescriptionList.value.length; } @@ -1098,8 +1106,11 @@ function handleSaveBatch() { return item.statusEnum == 1 && !item.requestId; }) .map((item) => { + // 确保 therapyEnum 被正确传递,默认为长期医嘱('1') + const therapyEnum = item.therapyEnum || '1'; return { ...item, + therapyEnum: therapyEnum, dbOpType: item.requestId ? '2' : '1', }; }); @@ -1246,6 +1257,8 @@ function handleSaveGroup(orderGroupList) { conditionId: conditionId.value, // 诊断id conditionDefinitionId: conditionDefinitionId.value, // 诊断定义id encounterDiagnosisId: encounterDiagnosisId.value, // 就诊诊断id + // 确保 therapyEnum 被正确设置,默认为长期医嘱('1') + therapyEnum: prescriptionList.value[rowIndex.value]?.therapyEnum || '1', }; // 计算价格和总量 @@ -1278,7 +1291,12 @@ function handleSaveHistory(value) { conditionId: conditionId.value, conditionDefinitionId: conditionDefinitionId.value, encounterDiagnosisId: encounterDiagnosisId.value, - contentJson: JSON.stringify(value), + // 确保 therapyEnum 被正确传递,默认为长期医嘱('1') + therapyEnum: value.therapyEnum || '1', + contentJson: JSON.stringify({ + ...value, + therapyEnum: value.therapyEnum || '1', + }), }; savePrescription({ adviceSaveList: [saveRow], regAdviceSaveList: [saveRow] }).then((res) => { if (res.code === 200) {