fix API ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ === > จัดการรอบสอบแข่งขัน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-05-29 16:01:45 +07:00
parent e22a720975
commit f5b677e26c
7 changed files with 45 additions and 37 deletions

View file

@ -206,40 +206,42 @@ async function fetchData() {
* ดาวนโหลดรายชอผสอบแขงขนได
* @param id รอบสอบเเขงข
*/
function clickPassExam(id: string) {
async function clickPassExam(id: string) {
showLoader();
http
await http
.get(config.API.exportPassExamList(id))
.then((res) => {
.then(async (res) => {
const data = res.data.result;
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
await genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/**
* ดาวนโหลดรายชอผทธสอบ
* @param id รอบสอบเเขงข
*/
function clickCandidateList(id: string) {
async function clickCandidateList(id: string) {
showLoader();
http
.get(config.API.exportCandidateList(id))
.then((res) => {
await http
.get(config.API.exportCandidateListNew(id))
.then(async (res) => {
const data = res.data.result;
data.reportName = `CandidateList`;
genReport(data, data.reportName, "pdf");
await genReport(data, data.reportName, "pdf");
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/**

View file

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