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 || '保存失败,请重试'); }); }