From 82e0ac0fcd21d44440aac536139b8bec185eb5ab Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 13 Jan 2025 18:08:51 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B9=82?= =?UTF-8?q?=E0=B8=AB=E0=B8=A5=E0=B8=94=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../03_recruiting/views/01_compete/Period.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/03_recruiting/views/01_compete/Period.vue b/src/modules/03_recruiting/views/01_compete/Period.vue index b53465a23..c031056e8 100644 --- a/src/modules/03_recruiting/views/01_compete/Period.vue +++ b/src/modules/03_recruiting/views/01_compete/Period.vue @@ -4,6 +4,7 @@ import type { QTableProps } from "quasar"; import { onMounted, ref } from "vue"; import { useRouter } from "vue-router"; import { useQuasar } from "quasar"; +import genReport from "@/plugins/genreport"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -203,7 +204,19 @@ function clickPassExam(id: string) { * @param id รอบสอบเเข่งขัน */ function clickCandidateList(id: string) { - window.open(config.API.exportCandidateList(id)); + http + .get(config.API.exportCandidateList(id)) + .then((res) => { + const data = res.data.result; + data.reportName = `CandidateList` + genReport(data, data.reportName,'pdf'); + }) + .catch(async (e) => { + messageError($q, JSON.parse(await e.response.data.text())); + }) + .finally(() => { + hideLoader(); + }); } /** @@ -329,7 +342,7 @@ async function clickClose() { /** ปิด dialog คะเเนน */ async function clickCloseScore() { modalScore.value = false; - files_score.value = null + files_score.value = null; await fetchData(); } @@ -370,7 +383,7 @@ async function checkSaveScore() { .then((res) => { success($q, "นำเข้าข้อมูลผลคะแนนสอบสำเร็จ"); modalScore.value = false; - files_score.value = null + files_score.value = null; selected_row_id.value = ""; fetchData(); })