From 823fe93528300f2c491d600c54a6e3797569330e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 15 Jul 2024 17:05:33 +0700 Subject: [PATCH 1/2] =?UTF-8?q?KPI=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A8=E0=B8=9C=E0=B8=A5,=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/14_KPI/api.KPI.ts | 3 + .../components/results/dialogIndividual.vue | 232 ++++++++++++++++++ .../components/results/tableIndividual.vue | 170 ++++++------- .../components/results/tableResults.vue | 41 ++-- src/modules/14_KPI/interface/index/Main.ts | 7 + .../14_KPI/interface/response/index.ts | 17 +- src/modules/14_KPI/views/report.vue | 13 +- src/modules/14_KPI/views/resultsMain.vue | 36 +-- 8 files changed, 372 insertions(+), 147 deletions(-) create mode 100644 src/modules/14_KPI/components/results/dialogIndividual.vue diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index 11d64c69a..c3bab1be3 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -89,4 +89,7 @@ export default { */ evaluationUser: `${KpiUser}/evaluation/list`, evaluationUserDone: `${KpiUser}/evaluation/done/kp7`, + achievementDev: `${KpiUser}/achievement/development/admin`, + achievementDevByid: (id: string) => + `${KpiUser}/achievement/development/admin/detail/${id}`, }; diff --git a/src/modules/14_KPI/components/results/dialogIndividual.vue b/src/modules/14_KPI/components/results/dialogIndividual.vue new file mode 100644 index 000000000..e525a9190 --- /dev/null +++ b/src/modules/14_KPI/components/results/dialogIndividual.vue @@ -0,0 +1,232 @@ + + + + + diff --git a/src/modules/14_KPI/components/results/tableIndividual.vue b/src/modules/14_KPI/components/results/tableIndividual.vue index 77b574e12..451e06070 100644 --- a/src/modules/14_KPI/components/results/tableIndividual.vue +++ b/src/modules/14_KPI/components/results/tableIndividual.vue @@ -8,8 +8,16 @@ import config from "@/app.config"; * importType */ import type { QTableProps } from "quasar"; -import type { ResResults } from "@/modules/14_KPI/interface/response/Main"; import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; +import type { + ResRound, + ResDevelopment, +} from "@/modules/14_KPI/interface/response/index"; + +/** + * importComponents + */ +import DialogIndividual from "@/modules/14_KPI/components/results/dialogIndividual.vue"; /** * importStore @@ -21,26 +29,25 @@ import { useKpiDataStore } from "@/modules/14_KPI/store"; * use */ const $q = useQuasar(); -const { - showLoader, - success, - messageError, - dialogConfirm, - hideLoader, - date2Thai, -} = useCounterMixin(); +const { showLoader, messageError, hideLoader } = useCounterMixin(); const store = useKpiDataStore(); /** * props */ const tab = defineModel("tab", { required: true }); -const rows = ref<[]>([]); // ข่อมูลรายการ + +/** + * ตัวแปร + */ +const rows = ref([]); // ข่อมูลรายการ const page = ref(1); const pageSize = ref(10); const maxPage = ref(1); const total = ref(1); const keyword = ref(""); +const modalDetail = ref(false); +const devId = ref(""); /** * Table @@ -62,17 +69,17 @@ const columns = ref([ sortable: true, field: "fullName", format: (val, row) => { - return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`; + return `${row.prefix ?? ""}${row.firstname ?? ""} ${row.lastname ?? ""}`; }, headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "name", + name: "developmentName", align: "left", label: "ความรู้/ทักษะ/สมรรถนะ ที่ต้องได้รับการพัฒนา", sortable: true, - field: "name", + field: "developmentName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -99,7 +106,7 @@ const columns = ref([ align: "left", label: "ตำแหน่งประเภท", sortable: true, - field: "position", + field: "posTypeName", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -132,7 +139,6 @@ const visibleColumns = ref([ "posLevelName", "root", ]); - const pagination = ref({ page: page.value, rowsPerPage: pageSize.value, @@ -142,53 +148,35 @@ const pagination = ref({ * function fetch รายการแผนพัฒนาการปฏิบัติราชการรายบุคคลย้อนหลัง */ function fetcDataList() { - rows.value = [ - { - id: "08dca241-ddfa-4678-89f4-62ad60c41aa8", - prefix: "นาย", - firstName: "ชัยชนะ", - lastName: "เรืองโรจน์", - root: "สำนักงานเขตพระนคร", - rootId: "e8493cd1-d371-402e-add6-566e68d5d1b3", - rootShortName: "ขพน.", - position: "นักวิเคราะห์นโยบายและแผน", - posTypeId: "1526d9d3-d8b1-43ab-81b5-a84dfbe08071", - posTypeName: "วิชาการ", - posLevelId: "1526d9d3-d8b1-43ab-81b5-a84dfbe08562", - posLevelName: "ปฏิบัติการ", - createdAt: "2024-07-12T14:11:35.885071", - name: "พัฒนาการสื่อสาร", - organization: "ฝ่ายทะเบียน สำนักงานเขตพระนคร", - }, - ]; - total.value = 1; - maxPage.value = Math.ceil(total.value / pageSize.value); + showLoader(); + http + .post(config.API.achievementDev, { + page: page.value, + pageSize: pageSize.value, + keyword: keyword.value, + kpiPeriodId: store.formQuery.round ? store.formQuery.round : "", + }) + .then((res) => { + const data = res.data.result; + console.log(data); - // showLoader(); - // http - // .post(config.API.evaluationUser, { - // status: tab.value, - // page: page.value, - // pageSize: pageSize.value, - // keyword: keyword.value, - // kpiPeriodId: store.formQuery.round ? store.formQuery.round : "", - // }) - // .then((res) => { - // const data = res.data.result; - // rows.value = data.data; - // total.value = data.total; - // maxPage.value = Math.ceil(total.value / pageSize.value); - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(() => { - // hideLoader(); - // }); + rows.value = data.data; + total.value = data.total; + maxPage.value = Math.ceil(total.value / pageSize.value); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } const year = ref(new Date().getFullYear()); const roundOp = ref([]); +/** + * function fetch รอบการประเมิน + */ function fetchRoundOption() { showLoader(); http @@ -198,8 +186,10 @@ function fetchRoundOption() { ) .then(async (res) => { const data = await res.data.result.data; + console.log(res.data.result.data); + if (res.data.result.data.length > 0) { - const list = await data.map((e: any) => ({ + const list = await data.map((e: ResRound) => ({ id: e.id, name: e.durationKPI === "OCT" @@ -252,7 +242,17 @@ watch(pagination, () => { pageSize.value = pagination.value.rowsPerPage; }); +/** + * function รายละเอียดแผนพัฒนาการปฏิบัติราชการรายบุคคล + * @param id แผนพัฒนาการปฏิบัติราชการรายบุคคล + */ +function onClickView(id: string) { + modalDetail.value = true; + devId.value = id; +} + onMounted(() => { + store.formQuery.round = ""; fetchRoundOption(); }); @@ -282,8 +282,6 @@ onMounted(() => { hide-bottom-space :model-value="!!year ? year + 543 : null" :label="`${'ปีงบประมาณ'}`" - clearable - @clear="clearYear" >