From 574a9267bf04b3eee39f04548fd5e976682d4dfa Mon Sep 17 00:00:00 2001 From: qk123 <18211963828@163.com> Date: Wed, 17 Dec 2025 09:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99->?= =?UTF-8?q?=E6=82=A3=E8=80=85=E4=BF=A1=E6=81=AF=E4=B8=AD=E5=8C=BB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SchedulePoolAppServiceImpl.java | 5 +- .../components/tcm/tcmAdvice.vue | 64 ++++++++++--------- openhis-ui-vue3/src/views/index.vue | 7 +- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/SchedulePoolAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/SchedulePoolAppServiceImpl.java index 8dda55da..93714363 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/SchedulePoolAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/appservice/impl/SchedulePoolAppServiceImpl.java @@ -18,11 +18,11 @@ public class SchedulePoolAppServiceImpl implements ISchedulePoolAppService { @Override public R addSchedulePool(SchedulePoolDto schedulePoolDto) { - //12/15 实体封装过程数据关系复杂 尚未完全理清 下次继续改 + //1.数据检验 if(ObjectUtil.isNull(schedulePoolDto)){ return R.fail("号源不能为空"); } - + //2.封装实体 SchedulePool schedulePool = new SchedulePool(); schedulePool.setHospitalId(schedulePoolDto.getHospitalId()); schedulePool.setDeptId(schedulePoolDto.getDeptId()); @@ -35,6 +35,7 @@ public class SchedulePoolAppServiceImpl implements ISchedulePoolAppService { schedulePool.setRegType(schedulePoolDto.getRegType()); schedulePool.setFee(schedulePoolDto.getFee()); + //3.保存 boolean save = schedulePoolService.save(schedulePool); return R.ok(save); } diff --git a/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue b/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue index 035fd7be..48065339 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue @@ -583,36 +583,38 @@ function getListInfo(addNewRow) { getTcmAdviceList({ encounterId: props.patientInfo.encounterId }).then((res) => { if (res && res.data && Array.isArray(res.data)) { - // 清空当前处方列表 - tcmPrescriptionList.value = []; - // 处理返回的数据 - res.data.forEach((item) => { - try { - // 解析contentJson获取完整的医嘱数据 - const contentData = item.contentJson ? JSON.parse(item.contentJson) : {}; - - // 创建一个新的处方对象 - const newPrescription = { - ...item, - ...contentData, - // 确保关键显示字段存在 - adviceName: contentData.adviceName || item.adviceName || '', - quantity: contentData.quantity || item.quantity || '', - totalPrice: contentData.totalPrice || item.totalPrice || '', - diagnosisName: contentData.diagnosisName || item.diagnosisName || '', - positionName: contentData.positionName || item.positionName || '', - doseUnitCode_dictText: contentData.doseUnitCode_dictText || item.doseUnitCode_dictText || '', - chineseHerbsDoseQuantity: contentData.chineseHerbsDoseQuantity || item.chineseHerbsDoseQuantity || '', - prescriptionList: [contentData] - }; - - // 添加到处方列表 - tcmPrescriptionList.value.push(newPrescription); - } catch (error) { - console.error('解析医嘱数据失败:', error, '数据项:', item); - } - }); + if (res.data.length > 0) { + // 如果有数据,清空当前列表并重新添加 + tcmPrescriptionList.value = []; + + res.data.forEach((item) => { + try { + // 解析contentJson获取完整的医嘱数据 + const contentData = item.contentJson ? JSON.parse(item.contentJson) : {}; + + // 创建一个新的处方对象 + const newPrescription = { + ...item, + ...contentData, + // 确保关键显示字段存在 + adviceName: contentData.adviceName || item.adviceName || '', + quantity: contentData.quantity || item.quantity || '', + totalPrice: contentData.totalPrice || item.totalPrice || '', + diagnosisName: contentData.diagnosisName || item.diagnosisName || '', + positionName: contentData.positionName || item.positionName || '', + doseUnitCode_dictText: contentData.doseUnitCode_dictText || item.doseUnitCode_dictText || '', + chineseHerbsDoseQuantity: contentData.chineseHerbsDoseQuantity || item.chineseHerbsDoseQuantity || '', + prescriptionList: [contentData] + }; + + // 添加到处方列表 + tcmPrescriptionList.value.push(newPrescription); + } catch (error) { + console.error('解析医嘱数据失败:', error, '数据项:', item); + } + }); + } // 重新计算总金额 handleTotalAmount(); @@ -622,11 +624,11 @@ function getListInfo(addNewRow) { } } else { console.error('获取医嘱列表失败或数据格式错误:', res); - tcmPrescriptionList.value = []; + // 保持当前列表不变,不要清空 } }).catch(error => { console.error('获取医嘱列表异常:', error); - tcmPrescriptionList.value = []; + // 保持当前列表不变,不要清空 }); tcmDiagnosisList.value = getFromDiagnosis(props.patientInfo.encounterId); diff --git a/openhis-ui-vue3/src/views/index.vue b/openhis-ui-vue3/src/views/index.vue index 3037455a..4526e35e 100644 --- a/openhis-ui-vue3/src/views/index.vue +++ b/openhis-ui-vue3/src/views/index.vue @@ -30,7 +30,7 @@ 👥 患者管理 -