diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java index d36440d28..11174386c 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationDiagnosisAppServiceImpl.java @@ -261,8 +261,10 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn // 设置创建时间,避免数据库约束错误 encounterDiagnosis.setCreateTime(new Date()); iEncounterDiagnosisService.saveOrUpdate(encounterDiagnosis); + // 回写就诊诊断ID,供前端后续更新使用 + saveDiagnosisChildParam.setEncounterDiagnosisId(encounterDiagnosis.getId()); } - return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"})); + return R.ok(saveDiagnosisParam, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊断"})); } diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue index ed8637cf3..e50513b32 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue @@ -568,6 +568,11 @@ function handleMaindise(value, index) { * 保存诊断 */ function handleSaveDiagnosis() { + // 防止重复点击保存 + if (isSaving.value) { + return; + } + for (let index = 0; index < (form.value.diagnosisList || []).length; index++) { const item = form.value.diagnosisList[index]; if (!item.diagSrtNo) { @@ -600,7 +605,7 @@ function handleSaveDiagnosis() { // 步骤2:重新分配连续的序号(从1开始) sortedList.forEach((item, index) => { - item.diagSrtNo = index + 1; // 这里是关键!把“诊断排序”改成新顺序 + item.diagSrtNo = index + 1; // 这里是关键!把”诊断排序”改成新顺序 }); // 步骤3:提交排序后的数据 @@ -610,12 +615,12 @@ function handleSaveDiagnosis() { diagnosisChildList: sortedList, }).then((res) => { if (res.code === 200) { - // 步骤4:更新本地数据,使用全新对象防止响应式问题 - form.value.diagnosisList = sortedList.map(item => ({ ...item })); - emits('diagnosisSave', false); proxy.$modal.msgSuccess('诊断已保存'); + // 保存成功后从服务器重新加载数据,确保前后端数据一致 + getList(); + // 食源性疾病逻辑 isFoodDiseasesNew({ encounterId: props.patientInfo.encounterId }).then((res2) => { if (res2.code === 20 && res2.data) {