From e6dd962dc2d6ffbac416290f9bcad80232d13d7e Mon Sep 17 00:00:00 2001 From: Certificate System Date: Fri, 14 Aug 2026 12:58:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=81=E4=B9=A6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=90=8EPDF=E7=8A=B6=E6=80=81=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/AdminCertificates.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/views/AdminCertificates.vue b/frontend/src/views/AdminCertificates.vue index 839702b..fb42fb4 100644 --- a/frontend/src/views/AdminCertificates.vue +++ b/frontend/src/views/AdminCertificates.vue @@ -376,6 +376,7 @@ async function previewCertificate(row: AdminCertificate) { async function downloadCertificate(row: AdminCertificate) { downloadingCertificateId.value = row.id; + let downloaded = false; const loading = ElLoading.service({ lock: true, text: "当前查询人数较多,请稍后。。。", @@ -383,12 +384,21 @@ async function downloadCertificate(row: AdminCertificate) { }); try { await downloadFile(`/admin/certificates/${row.id}/download`, `${row.certificate_no}.pdf`); + row.pdf_status = "generated"; + downloaded = true; } catch (error: any) { ElMessage.error(await apiErrorMessage(error, "PDF生成失败,请稍后再试")); } finally { loading.close(); downloadingCertificateId.value = null; } + if (downloaded) { + try { + await loadCertificates(); + } catch { + ElMessage.warning("PDF已生成并下载,但列表状态同步失败,请稍后重试"); + } + } } async function voidCertificate(row: AdminCertificate) {