Merge branch 'develop' into dev
* develop: fig: export report recruit fix: display posMasterNo fix: label yearly updated path api report exam & recruit by api
This commit is contained in:
commit
a298a1fe8c
6 changed files with 157 additions and 50 deletions
|
|
@ -33,11 +33,13 @@ export default {
|
||||||
exportDisablePassResultExam: (id: string) =>
|
exportDisablePassResultExam: (id: string) =>
|
||||||
`${disableExam}export/pass/${id}`,
|
`${disableExam}export/pass/${id}`,
|
||||||
|
|
||||||
exportDisableCandidateList: (id: string) => `${diable_report}candidate/${id}`,
|
exportDisableCandidateList: (id: string) =>
|
||||||
exportDisablePassExamList: (id: string) => `${diable_report}pass/${id}`,
|
`${diable_report}candidate-new/${id}`,
|
||||||
|
exportDisablePassExamList: (id: string) => `${diable_report}pass-new/${id}`,
|
||||||
periodDisableToPlacement: (examId: string) =>
|
periodDisableToPlacement: (examId: string) =>
|
||||||
`${disableExam}placement/${examId}`,
|
`${disableExam}placement/${examId}`,
|
||||||
|
|
||||||
repoetUploadDisableExam: (id: string) => `${disableExam}result/${id}`,
|
repoetUploadDisableExam: (id: string) => `${disableExam}result/${id}`,
|
||||||
repoetDownloadDisableExam:(id:string,examId:string)=>`${disableExam}report/exam/${id}/${examId}`
|
repoetDownloadDisableExam: (id: string, examId: string) =>
|
||||||
|
`${disableExam}report/exam/${id}/${examId}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,14 @@ export default {
|
||||||
exportPassResultExam: (id: string) => `${recruit}export/pass/${id}`,
|
exportPassResultExam: (id: string) => `${recruit}export/pass/${id}`,
|
||||||
|
|
||||||
exportCandidateList: (id: string) => `${recruit_report}candidate/${id}`,
|
exportCandidateList: (id: string) => `${recruit_report}candidate/${id}`,
|
||||||
exportPassExamList: (id: string) => `${recruit_report}pass/${id}`,
|
exportPassExamList: (id: string) => `${recruit_report}pass-new/${id}`,
|
||||||
periodRecruitToPlacement: (examId: string) => `${recruit}placement/${examId}`,
|
periodRecruitToPlacement: (examId: string) => `${recruit}placement/${examId}`,
|
||||||
|
|
||||||
reportRecruit: (type: string) => `${recruit}${type}`,
|
reportRecruit: (type: string) => `${recruit}${type}`,
|
||||||
|
|
||||||
|
exportCandidateListNew: (id: string) =>
|
||||||
exportCandidateListNew: (id: string) => `${recruit_report}candidate-new/${id}`,
|
`${recruit_report}candidate-new/${id}`,
|
||||||
reportCandidateListNew: (id: string) => `${recruit}report/candidate-new/${id}`,
|
// reportCandidateListNew: (id: string) =>
|
||||||
|
// `${recruit}report/candidate-new/${id}`, ปรับไปใช้ api ด้านบนแทน
|
||||||
examReport: (id: string, no: string) => `${recruit}report/exam/${id}/${no}`,
|
examReport: (id: string, no: string) => `${recruit}report/exam/${id}/${no}`,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -229,31 +229,9 @@ async function fetchData(actionType?: string) {
|
||||||
async function clickPassExam(id: string) {
|
async function clickPassExam(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.exportPassExamList(id))
|
.get(config.API.exportPassExamList(id), {
|
||||||
.then(async (res) => {
|
|
||||||
const data = res.data.result;
|
|
||||||
data.reportName = `CandidateList`;
|
|
||||||
await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
|
|
||||||
})
|
|
||||||
.catch(async (e) => {
|
|
||||||
messageError($q, JSON.parse(await e.response.data.text()));
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ
|
|
||||||
* @param id รอบสอบเเข่งขัน
|
|
||||||
*/
|
|
||||||
async function clickCandidateList(id: string) {
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.get(config.API.reportCandidateListNew(id), {
|
|
||||||
headers: {
|
headers: {
|
||||||
accept:
|
accept: "application/pdf",
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
||||||
"content-Type": "application/json",
|
"content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -271,7 +249,64 @@ async function clickCandidateList(id: string) {
|
||||||
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.download = `CandidateList.xlsx`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
link.download = `รายชื่อผู้สอบแข่งขันได้.pdf`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// ลบ URL ที่สร้างขึ้นหลังจากใช้งาน
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(async (e) => {
|
||||||
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
|
||||||
|
// await http
|
||||||
|
// .get(config.API.exportPassExamList(id))
|
||||||
|
// .then(async (res) => {
|
||||||
|
// const data = res.data.result;
|
||||||
|
// data.reportName = `CandidateList`;
|
||||||
|
// await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
|
||||||
|
// })
|
||||||
|
// .catch(async (e) => {
|
||||||
|
// messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ
|
||||||
|
* @param id รอบสอบเเข่งขัน
|
||||||
|
*/
|
||||||
|
async function clickCandidateList(id: string) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.exportCandidateListNew(id), {
|
||||||
|
headers: {
|
||||||
|
accept: "application/pdf",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
|
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = res.data;
|
||||||
|
if (data) {
|
||||||
|
// สร้าง Blob จาก array buffer
|
||||||
|
const blob = new Blob([data]);
|
||||||
|
|
||||||
|
// สร้าง URL สำหรับไฟล์ Blob
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = `รายชื่อผู้มีสิทธิ์สอบแข่งขัน.pdf`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -187,15 +187,50 @@ const visibleColumnsHistory = ref<String[]>([
|
||||||
/** ดาวน์โหลดรายชื่อผู้สอบคัดเลือกคนพิการได้ */
|
/** ดาวน์โหลดรายชื่อผู้สอบคัดเลือกคนพิการได้ */
|
||||||
async function clickPassExam(id: string) {
|
async function clickPassExam(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
// await http
|
||||||
|
// .get(config.API.exportDisablePassExamList(id))
|
||||||
|
// .then(async (res) => {
|
||||||
|
// const data = res.data.result;
|
||||||
|
// data.reportName = `CandidateList`;
|
||||||
|
// await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
|
||||||
|
// })
|
||||||
|
// .catch(async (e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
await http
|
await http
|
||||||
.get(config.API.exportDisablePassExamList(id))
|
.get(config.API.exportDisablePassExamList(id), {
|
||||||
|
headers: {
|
||||||
|
accept: "application/pdf",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
|
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data;
|
||||||
data.reportName = `CandidateList`;
|
if (data) {
|
||||||
await genReport(data, "รายชื่อผู้สอบแข่งขันได้", "pdf");
|
// สร้าง Blob จาก array buffer
|
||||||
|
const blob = new Blob([data]);
|
||||||
|
|
||||||
|
// สร้าง URL สำหรับไฟล์ Blob
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = `รายชื่อผู้สอบคัดเลือกคนพิการได้.pdf`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// ลบ URL ที่สร้างขึ้นหลังจากใช้งาน
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(async (e) => {
|
.catch(async (e) => {
|
||||||
messageError($q, e);
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -205,15 +240,50 @@ async function clickPassExam(id: string) {
|
||||||
/** ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ */
|
/** ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ */
|
||||||
async function clickCandidateList(id: string) {
|
async function clickCandidateList(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
// await http
|
||||||
|
// .get(config.API.exportDisableCandidateList(id))
|
||||||
|
// .then(async (res) => {
|
||||||
|
// const data = res.data.result;
|
||||||
|
// data.reportName = `CandidateList`;
|
||||||
|
// await genReport(data, "รายชื่อผู้มีสิทธิ์สอบ", "pdf");
|
||||||
|
// })
|
||||||
|
// .catch(async (e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
await http
|
await http
|
||||||
.get(config.API.exportDisableCandidateList(id))
|
.get(config.API.exportDisablePassExamList(id), {
|
||||||
|
headers: {
|
||||||
|
accept: "application/pdf",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
|
|
||||||
|
responseType: "blob",
|
||||||
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data;
|
||||||
data.reportName = `CandidateList`;
|
if (data) {
|
||||||
await genReport(data, "รายชื่อผู้มีสิทธิ์สอบ", "pdf");
|
// สร้าง Blob จาก array buffer
|
||||||
|
const blob = new Blob([data]);
|
||||||
|
|
||||||
|
// สร้าง URL สำหรับไฟล์ Blob
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = url;
|
||||||
|
link.download = `รายชื่อผู้มีสิทธิ์สอบคัดเลือกคนพิการ.pdf`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// ลบ URL ที่สร้างขึ้นหลังจากใช้งาน
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(async (e) => {
|
.catch(async (e) => {
|
||||||
messageError($q, e);
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
|
||||||
|
|
@ -1001,8 +1001,8 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
:readonly="checkRoutePermisson"
|
:readonly="checkRoutePermisson"
|
||||||
:model-value="yearly + 543"
|
:model-value="yearly + 543"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกปี พ.ศ.'}`]"
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
:label="`${'ปี พ.ศ.'}`"
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue