From 5ad5857df45d1633dc3f222496d5f4af867cdc3e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 6 Feb 2025 15:25:36 +0700 Subject: [PATCH] fix --- .../07_insignia/views/06_ReportMain.vue | 7 ++- .../09_leave/views/07_ReportCheckin.vue | 48 +++++++++++++++---- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/modules/07_insignia/views/06_ReportMain.vue b/src/modules/07_insignia/views/06_ReportMain.vue index 6c3e45de6..640edcf54 100644 --- a/src/modules/07_insignia/views/06_ReportMain.vue +++ b/src/modules/07_insignia/views/06_ReportMain.vue @@ -255,7 +255,12 @@ onMounted(async () => { /> ไฟล์ .docx - + diff --git a/src/modules/09_leave/views/07_ReportCheckin.vue b/src/modules/09_leave/views/07_ReportCheckin.vue index 12b9a17ba..793c14c91 100644 --- a/src/modules/09_leave/views/07_ReportCheckin.vue +++ b/src/modules/09_leave/views/07_ReportCheckin.vue @@ -11,6 +11,7 @@ import { checkPermission } from "@/utils/permissions"; import http from "@/plugins/http"; import config from "@/app.config"; import genReportXLSX from "@/plugins/genreportxlsx"; +import genReportDocx from "@/plugins/genreport"; import type { DataStructureTree } from "@/interface/main"; import type { @@ -260,6 +261,16 @@ function getCurrentWeek() { return [firstDayOfWeek, lastDayOfWeek]; } +function downloadReport(type: string) { + const fileName = + typeReport.value === "1" ? "รายงานการเข้างาน" : "รายงานการเข้างานสาย"; + // if (type === "pdf") { + // genReportDocx(detailReport.value, fileName, type); + // } else { + genReportXLSX(detailReport.value, fileName, type); + // } +} + onMounted(() => { fetchDataTree(); }); @@ -291,6 +302,16 @@ onMounted(() => { + { round color="primary" icon="download" - @click.stop.pervent=" - genReportXLSX( - detailReport, - `${ - typeReport === '1' - ? 'รายงานการเข้างาน' - : 'รายงานการเข้างานสาย' - }` - ) - " > + + + + + ไฟล์ .pdf + + + + + ไฟล์ .xlsx + + +