From 36ac4e7807d583d69347309b3afbc50be777fec6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 19 Jun 2024 15:51:15 +0700 Subject: [PATCH] KPI => report --- src/modules/14_KPI/views/report.vue | 261 +++++++++++++++++++++------- 1 file changed, 195 insertions(+), 66 deletions(-) diff --git a/src/modules/14_KPI/views/report.vue b/src/modules/14_KPI/views/report.vue index 4cbb751f5..e438463dd 100644 --- a/src/modules/14_KPI/views/report.vue +++ b/src/modules/14_KPI/views/report.vue @@ -21,6 +21,48 @@ const organization = ref(""); const roundOp = ref([]); const organizationOpsMain = ref([]); const organizationOps = ref([]); +const typeReport = ref(""); +const listReportMain = ref([ + { + id: "1", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล", + }, + { + id: "2", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล", + }, + { + id: "3", + name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล", + }, + { + id: "4", + name: "แบบสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล (รายบุคคล)", + }, + { + id: "5", + name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๕ ปี", + }, + { + id: "6", + name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๓ ปี", + }, + { + id: "7", + name: "รายงานสรุปแผนพัฒนาการปฏิบัติราชการรายบุคคล", + }, + { + id: "8", + name: "รายงานแผนพัฒนาการปฏิบัติราชการรายบุคคล", + }, +]); +const listReport = ref([]); +const searchField = ref("fullName"); +const search = ref(""); +const typeFilter = ref([ + { id: "fullName", name: "ชื่อ-นามสกุล" }, + { id: "citizenId", name: "เลขประจำตัวประชาชน" }, +]); function fetchRoundOption() { http @@ -112,9 +154,9 @@ function fetchReport() { * function เรียกไฟล์ PDF * @param data ข้อมูลบัญชีวันลา */ -async function genPDf(data: any) { +function genPDf(data: any) { showLoader(); - await axios + axios .post(config.API.reportTemplate + `/docx`, data, { headers: { accept: "application/pdf", @@ -144,12 +186,26 @@ function changOption() { fetchReport(); } -function filterSelector(val: string, update: Function) { - update(() => { - organizationOps.value = organizationOpsMain.value.filter( - (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 - ); - }); +function filterSelector(val: string, update: Function, type: string) { + switch (type) { + case "typereport": + update(() => { + listReport.value = listReportMain.value.filter( + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 + ); + }); + break; + case "organization": + update(() => { + organizationOps.value = organizationOpsMain.value.filter( + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 + ); + }); + break; + + default: + break; + } } const splitterModel = ref(14); @@ -184,60 +240,11 @@ onMounted(() => {