From a87e0bd01563063c6282e5ce2d131571c53bbbb1 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 13 Feb 2025 22:48:05 +0700 Subject: [PATCH] fixing report insignia --- .../07_insignia/views/06_ReportMain.vue | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 5e4857469..5f090531a 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -290,12 +290,14 @@ function backPage() { } } -function downloadReport(type: string) { +function downloadReport(type: string, download: "docx" | "" | "xlsx" = "") { const fileName = optionReport.value.find((e) => e.id === typeReport.value.id)?.name || ""; - if (type === "xlsx") { + if (type === "xlsx" && download === "") { genReportXLSX(detailReport.value, fileName, type); + } else if (type === "pdf" && download === "xlsx") { + genReportXLSX(detailReport.value, fileName, "pdf"); } else { genReport(detailReport.value, fileName, type); } @@ -335,20 +337,42 @@ onMounted(async () => { flat round :loading="isLoadPDF" - :disable="!nodeId || !employeeClass || !roundId" + :disable="!nodeId || !employeeClass || (!roundId && !roundId2)" color="primary" icon="download" v-if="checkPermission($route)?.attrIsGet" > - + ไฟล์ .pdf - +