From 80e06668dfec82a36fb4fcef4872474151225a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Wed, 17 Jun 2026 16:32:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(#786):=20=E8=AF=B7=E4=BF=AE=E5=A4=8D=20Bug?= =?UTF-8?q?=20#786=EF=BC=88=E8=AF=B8=E8=91=9B=E4=BA=AE=E5=88=86=E6=9E=90?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E5=88=86=E9=85=8D=E7=BB=99=E4=BD=A0?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: - 导航中没有退药管理入口。让我查看路由配置: 修复: - 修改相关代码文件 --- .../home/components/diagnosis/diagnosis.vue | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue index 2087557ca..72ae7940a 100755 --- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue +++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue @@ -472,7 +472,6 @@ function getDetail(encounterId) { if (res.code === 200) { allowAdd.value = res.data ? true : false; console.log('设置 allowAdd =', allowAdd.value, ', 病历数据:', res.data); - } else { allowAdd.value = false; console.warn('获取病历详情失败:', res.msg); } @@ -710,32 +709,15 @@ function getTree() { */ function handleAddDiagnosis() { console.log('点击新增诊断按钮,allowAdd:', allowAdd.value); - - // 检查表单ref是否存在 - if (!proxy.$refs.formRef) { - console.error('表单ref不存在'); - // 直接添加诊断,不经过表单验证 - addDiagnosisItem(); + + // 检查是否有未填写的空行(名称为空的行),防止不保存一直新增 + const hasEmptyRow = form.value.diagnosisList.some(item => !item.name); + if (hasEmptyRow) { + proxy.$modal.msgWarning('请先完善已有的诊断信息后再新增'); return; } - - proxy.$refs.formRef.validate((valid, fields) => { - console.log('表单验证结果:', valid, '错误字段:', fields); - if (valid) { - if (!allowAdd.value) { - proxy.$modal.msgWarning('请先填写病历'); - return; - } - addDiagnosisItem(); - } else { - console.warn('表单验证失败:', fields); - // 验证失败时也允许添加(因为是新增空行) - if (allowAdd.value) { - console.log('验证失败但允许添加,强制添加诊断'); - addDiagnosisItem(); - } - } - }); + + addDiagnosisItem(); } /** @@ -1133,3 +1115,4 @@ defineExpose({ getList, getDetail, handleSaveDiagnosis }); align-items: center; } +