diff --git a/src/modules/14_KPI/views/report.vue b/src/modules/14_KPI/views/report.vue index 363c57f73..8afb39273 100644 --- a/src/modules/14_KPI/views/report.vue +++ b/src/modules/14_KPI/views/report.vue @@ -7,9 +7,13 @@ import http from "@/plugins/http"; import axios from "axios"; import genReport from "@/plugins/genreport"; +import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; +import type { QTableProps } from "quasar"; + import { useCounterMixin } from "@/stores/mixin"; -import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; +import DialogHeader from "@/components/DialogHeader.vue"; + const $q = useQuasar(); const { showLoader, hideLoader, messageError, date2Thai, dialogConfirm } = @@ -24,49 +28,43 @@ const organizationOps = ref([]); const typeReport = ref(""); const listReportMain = ref([ { - id: "1", + id: "KPI1", name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงจำนวนผู้มีผลการประเมินระดับต่างๆ ในแต่ละรอบการประเมินรายหน่วยงาน/ส่วนราชการ", }, { - id: "2", + id: "KPI2", name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงรายละเอียดผู้มีผลการประเมินระดับต่างๆ รายหน่วยงาน/ส่วนราชการ ", }, { - id: "3", + id: "KPI3", name: "รายงานสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล แสดงรายละเอียดผลการประเมินของผู้ใต้บังคับบัญชา", }, { - id: "4", + id: "KPI4", name: "แบบสรุปผลการประเมินผลการปฏิบัติราชการระดับบุคคล (รายบุคคล)", }, { - id: "5", + id: "KPI5", name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๕ ปี", }, { - id: "6", + id: "KPI6", name: "รายงานผลการประเมินผลการปฏิบัติราชการย้อนหลัง ๓ ปี", }, { - id: "7", + id: "KPI7", name: "รายงานสรุปแผนพัฒนาการปฏิบัติราชการรายบุคคล", }, { - id: "8", + id: "KPI8", name: "รายงานแผนพัฒนาการปฏิบัติราชการรายบุคคล", }, { - id: "9", + id: "KPI9", name: "จัดทำประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก", }, ]); const listReport = ref([]); -const searchField = ref("fullName"); -const search = ref(""); -const typeFilter = ref([ - { id: "fullName", name: "ชื่อ-นามสกุล" }, - { id: "citizenId", name: "เลขประจำตัวประชาชน" }, -]); function fetchRoundOption() { http @@ -134,24 +132,24 @@ function fetchListOrg(id: string) { } function fetchReport() { - if (round.value !== "" && organization.value !== "") { - showLoader(); - const body = { - periodId: round.value, - root: organization.value, - }; - http - .post(config.API.kpiReport(), body) - .then((res) => { - dataDownload.value = res.data.result; - page.value = 1; - genPDf(res.data.result); - }) - .catch((err) => { - messageError($q, err); - hideLoader(); - }); - } + showLoader(); + const body = { + type: typeReport.value, + periodId: round.value, + root: organization.value, + // persanalId: persanalId.value, + }; + http + .post(config.API.kpiReport(), body) + .then((res) => { + dataDownload.value = res.data.result; + page.value = 1; + genPDf(res.data.result); + }) + .catch((err) => { + messageError($q, err); + hideLoader(); + }); } /** @@ -186,8 +184,22 @@ function genPDf(data: any) { }); } -function changOption() { - fetchReport(); +function changOption(val: string) { + if ( + val === "KPI1" || + val === "KPI2" || + val === "KPI3" || + val === "KPI7" || + val === "KPI9" + ) { + persanalId.value = ""; + if (round.value !== "" && organization.value !== "") { + fetchReport(); + } + } else { + round.value = ""; + organization.value = ""; + } } function filterSelector(val: string, update: Function, type: string) { @@ -239,6 +251,93 @@ function backPage() { } } +/*******/ +const modal = ref(false); +const persanalId = ref(""); +const filter = ref(""); +const rowsPerson = ref([ + { + id: "1", + citizenId: "12345678910123", + name: "tset,", + posNo: "1", + position: "ตำแหน่งในสายงาน", + posType: "ตำแหน่งประเภท", + posLevel: "ระดับ", + }, +]); +const columns = ref([ + { + name: "citizenId", + align: "left", + label: "เลขประจำตัวประชาชน", + sortable: false, + field: "citizenId", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "name", + align: "left", + label: "ชื่อ-นามสกุล", + field: "name", + sortable: false, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: false, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "position", + align: "left", + label: "ตำแหน่งในสายงาน", + sortable: false, + field: "position", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posType", + align: "left", + label: "ตำแหน่งประเภท", + sortable: false, + field: "posType", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posLevel", + align: "left", + label: "ระดับ", + sortable: false, + field: "posLevel", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); + +function onClickModal() { + modal.value = !modal.value; + if ((modal.value = true)) { + fetchListPerson(); + } +} + +function fetchListPerson() {} + +function onSelectPerson(id: string) { + persanalId.value = id; + modal.value = false; + fetchReport(); +} + onMounted(() => { fetchRoundOption(); fetchActiveId(); @@ -252,7 +351,6 @@ onMounted(() => {
{ :options="listReport" label="รายงาน" use-input + @update:model-value="changOption" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn ,'typereport')" /> @@ -314,11 +413,11 @@ onMounted(() => {
{ emit-value map-options :disable="roundOp.length === 0" - @update:model-value="changOption" + @update:model-value="changOption(typeReport)" /> { :options="organizationOps" label="หน่วยงาน" use-input - @update:model-value="changOption" + @update:model-value="changOption(typeReport)" @filter="(inputValue: string, doneFn: Function) => filterSelector(inputValue, doneFn,'organization' )" />
-
- + + +
@@ -519,6 +621,73 @@ onMounted(() => { + + + + + + +
+ + + +
+
+ + + + + +
+
+
+