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(); })