ปรับโหลด

This commit is contained in:
setthawutttty 2025-01-14 09:33:58 +07:00
parent 86c6cc5236
commit 9d72c1b5dc
2 changed files with 45 additions and 8 deletions

View file

@ -196,7 +196,19 @@ async function fetchData() {
* @param id รอบสอบเเขงข
*/
function clickPassExam(id: string) {
window.open(config.API.exportPassExamList(id));
showLoader();
http
.get(config.API.exportPassExamList(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()));
hideLoader();
})
.finally(() => {});
}
/**
@ -204,19 +216,19 @@ function clickPassExam(id: string) {
* @param id รอบสอบเเขงข
*/
function clickCandidateList(id: string) {
showLoader();
http
.get(config.API.exportCandidateList(id))
.then((res) => {
const data = res.data.result;
data.reportName = `CandidateList`
genReport(data, data.reportName,'pdf');
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
})
.finally(() => {});
}
/**

View file

@ -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";
@ -150,12 +151,36 @@ const visibleColumnsHistory = ref<String[]>([
/** ดาวน์โหลดรายชื่อผู้สอบคัดเลือกคนพิการได้ */
function clickPassExam(id: string) {
window.open(config.API.exportDisablePassExamList(id));
showLoader();
http
.get(config.API.exportDisablePassExamList(id))
.then((res) => {
const data = res.data.result;
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
hideLoader();
messageError($q, e);
})
.finally(() => {});
}
/** ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ */
function clickCandidateList(id: string) {
window.open(config.API.exportDisableCandidateList(id));
showLoader();
http
.get(config.API.exportDisableCandidateList(id))
.then((res) => {
const data = res.data.result;
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
hideLoader();
messageError($q, e);
})
.finally(() => {});
}
/**