From 49844130b6bc9f3dbaf85b96ed2b33777e4de76a Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Tue, 18 Mar 2025 17:03:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB=E4=BF=9D=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Medical-examination-vehicle.vue | 31 +++++++++---------- src/views/Department-entry/summary.vue | 31 ++++++++++--------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/views/Department-entry/Medical-examination-vehicle.vue b/src/views/Department-entry/Medical-examination-vehicle.vue index a5538c0..b10f7d1 100644 --- a/src/views/Department-entry/Medical-examination-vehicle.vue +++ b/src/views/Department-entry/Medical-examination-vehicle.vue @@ -1691,32 +1691,31 @@ const handleSaveAllResults = async () => { } } + // 最后执行汇总保存 + const result = await handleSummarySave() + if (!result) return + ElMessage.success('所有检查结果保存成功') // 重新加载数据以更新界面 await refreshExamData() - - // 如果汇总组件存在,调用其保存方法 - if (summaryRef.value) { - await summaryRef.value.saveSummary() - } - + } catch (error) { ElMessage.error(`保存失败: ${error.message || '请检查数据是否完整'}`) } - // 汇总标签页特殊处理 - const result = await handleSummarySave() - if (!result) return } -// 添加汇总保存方法 +// 修改汇总保存方法 const handleSummarySave = async () => { - // 直接调用汇总组件的保存方法 - if (summaryRef.value) { - await summaryRef.value.saveSummary() - ElMessage.success('汇总数据保存成功') - } else { - throw new Error('未找到汇总组件') + try { + if (summaryRef.value) { + await summaryRef.value.saveSummary() + return true + } + return false + } catch (error) { + ElMessage.error('汇总保存失败: ' + error.message) + return false } } diff --git a/src/views/Department-entry/summary.vue b/src/views/Department-entry/summary.vue index 43637b2..d06fb2d 100644 --- a/src/views/Department-entry/summary.vue +++ b/src/views/Department-entry/summary.vue @@ -3,7 +3,7 @@