From deb145e84f7ddc7032fa4f78bda469cd034cf5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E7=BE=BD?= <关羽@gentronhealth.com> Date: Wed, 13 May 2026 13:35:30 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#405:=20=E4=BD=8F=E9=99=A2=E5=8C=BB?= =?UTF-8?q?=E7=94=9F=E5=B7=A5=E4=BD=9C=E7=AB=99=EF=BC=9A=E4=B8=B4=E5=BA=8A?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=8C=BB=E5=98=B1=E6=9D=A1=E7=9B=AE=E4=BB=8D=E5=A4=84?= =?UTF-8?q?=E4=BA=8E=E5=8F=AF=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=EF=BC=88?= =?UTF-8?q?=E6=9C=AA=E9=94=81=E5=AE=9A=E5=B1=95=E7=A4=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handleSaveSign: 新增行点击确定后调用savePrescription持久化到后端,而非仅设置isEdit=false后调用handleAddPrescription - handleSaveBatch: 修复nextId.value == 1 为赋值操作(=) - handleSaveBatch: catch块增加错误提示,保存失败时用户可感知 Co-Authored-By: Claude Opus 4.7 --- .../home/components/order/index.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 0f1592c3e..27491ed6c 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue @@ -1210,7 +1210,7 @@ function handleSave() { isSaving.value = false; getListInfo(false); bindMethod.value = {}; - nextId.value == 1; + nextId.value = 1; } else { proxy.$modal.msgError(res.message); isSaving.value = false; @@ -1376,13 +1376,21 @@ function handleSaveSign(row, index) { savePrescription({ regAdviceSaveList: [row] }).then((res) => { if (res.code === 200) { proxy.$modal.msgSuccess('保存成功'); - nextId.value == 1; + nextId.value = 1; } }); } else { - if (prescriptionList.value[0].adviceName) { - handleAddPrescription(); - } + // 新增行:调用保存接口将数据持久化到后端 + row.dbOpType = '1'; + savePrescription({ regAdviceSaveList: [row] }).then((res) => { + if (res.code === 200) { + proxy.$modal.msgSuccess('保存成功'); + nextId.value = 1; + // 保存成功后刷新列表,确保后端返回的数据带 requestId + getListInfo(false); + } + }); + // 不需要再添加空行,保存成功后由 getListInfo 处理 } adviceQueryParams.value.adviceType = undefined; } @@ -1429,12 +1437,13 @@ function handleSaveBatch() { if (row) row.isEdit = false; }); getListInfo(false); - nextId.value == 1; + nextId.value = 1; isSaving.value = false; } }) .catch((error) => { isSaving.value = false; + proxy.$modal.msgError(error?.msg || '保存失败,请重试'); }); }