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

@ -42,5 +42,9 @@ export default {
exportPassExamList: (id: string) => `${recruit_report}pass/${id}`,
periodRecruitToPlacement: (examId: string) => `${recruit}placement/${examId}`,
reportRecruit:(type:string)=>`${recruit}${type}`
reportRecruit:(type:string)=>`${recruit}${type}`,
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
};

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

View file

@ -875,13 +875,13 @@ async function clickdownloadFile(type: string) {
`แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ-${fullname.value}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/** เช็ค จำนวนเดือน เเละ วันที่เริ่ม ไม่เท่ากับ undefined*/

View file

@ -6,7 +6,7 @@ import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
import genReport from "@/plugins/genreport";
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
import DialogSelectAuthority from "@/modules/05_placement/components/probation/FormEvaluation/DialogSelectAuthority.vue";

View file

@ -97,13 +97,13 @@ async function FileDownload(type: string) {
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
} else {
//
showLoader();
@ -116,13 +116,13 @@ async function FileDownload(type: string) {
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
}

View file

@ -5,7 +5,7 @@ import { useRoute } from "vue-router";
import { VuePDF, usePDF } from "@tato30/vue-pdf";
import axios from "axios";
import genReportXLSX from "@/plugins/genreportxlsx";
import genReport from "@/plugins/genreport";
import http from "@/plugins/http";
import config from "@/app.config";