From aa63c96cbad096d00d79f6a39787ebfa694ea7ed Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 13 May 2024 14:38:55 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4=E0=B8=99=E0=B8=9C=E0=B8=A5?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9B=E0=B8=8F=E0=B8=B4=E0=B8=9A?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=A3=E0=B8=B0=E0=B8=94=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=9A=E0=B8=B8=E0=B8=84=E0=B8=84=E0=B8=A5=20=3D>=20=20?= =?UTF-8?q?=E0=B8=9C=E0=B8=B9=E0=B8=81=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../08_KPI/components/Evaluator/01_TabAll.vue | 19 +++- .../components/Evaluator/02_TabOther.vue | 107 ++++++++++++++++-- src/modules/08_KPI/interface/index/Main.ts | 14 ++- src/modules/08_KPI/interface/request/index.ts | 8 ++ .../08_KPI/interface/response/index.ts | 31 ++++- src/modules/08_KPI/store.ts | 6 +- src/modules/08_KPI/views/mainEvaluator.vue | 91 +++++++++------ 7 files changed, 219 insertions(+), 57 deletions(-) diff --git a/src/modules/08_KPI/components/Evaluator/01_TabAll.vue b/src/modules/08_KPI/components/Evaluator/01_TabAll.vue index 52995a3..3a4b976 100644 --- a/src/modules/08_KPI/components/Evaluator/01_TabAll.vue +++ b/src/modules/08_KPI/components/Evaluator/01_TabAll.vue @@ -3,13 +3,20 @@ import { ref } from "vue"; import { useRouter } from "vue-router"; import type { QTableProps } from "quasar"; +import type { ResEvaluatorAssessor } from "@/modules/08_KPI/interface/response/index"; +import type { FormQuery } from "@/modules/08_KPI/interface/request/index"; + const router = useRouter(); -const visibleColumns = defineModel("visibleColumns", {}); -const columns = defineModel("columns", {}); -const rows = defineModel("rows", {}); -const formQuery = defineModel("formQuery", {}); -const total = defineModel("total", {}); -const maxPage = defineModel("maxPage", {}); +const visibleColumns = defineModel("visibleColumns", { + required: true, +}); +const columns = defineModel("columns", { + required: true, +}); +const rows = defineModel("rows", { required: true }); +const formQuery = defineModel("formQuery", { required: true }); +const total = defineModel("total", { required: true }); +const maxPage = defineModel("maxPage", { required: true }); const props = defineProps({ updatePagination: { type: Function }, diff --git a/src/modules/08_KPI/components/Evaluator/02_TabOther.vue b/src/modules/08_KPI/components/Evaluator/02_TabOther.vue index 927140e..5e0e98c 100644 --- a/src/modules/08_KPI/components/Evaluator/02_TabOther.vue +++ b/src/modules/08_KPI/components/Evaluator/02_TabOther.vue @@ -1,23 +1,45 @@ diff --git a/src/modules/08_KPI/interface/index/Main.ts b/src/modules/08_KPI/interface/index/Main.ts index 80143f3..a1fe878 100644 --- a/src/modules/08_KPI/interface/index/Main.ts +++ b/src/modules/08_KPI/interface/index/Main.ts @@ -1,8 +1,12 @@ interface DataOptions { - id:string - name:string + id: string; + name: string; +} +interface Pagination { + descending: boolean; + page: number; + rowsPerPage: number; + sortBy: string; } -export type { - DataOptions -} \ No newline at end of file +export type { DataOptions, Pagination }; diff --git a/src/modules/08_KPI/interface/request/index.ts b/src/modules/08_KPI/interface/request/index.ts index c8eb73b..5d00e30 100644 --- a/src/modules/08_KPI/interface/request/index.ts +++ b/src/modules/08_KPI/interface/request/index.ts @@ -53,6 +53,13 @@ interface FormComment { reason: string; } +interface FormQuery { + page: number; + pageSize: number; + round: string; + keyword: string; +} + export type { FormProfile, FormDataAssigned, @@ -60,4 +67,5 @@ export type { ListCriteria, ListCapacity, FormComment, + FormQuery, }; diff --git a/src/modules/08_KPI/interface/response/index.ts b/src/modules/08_KPI/interface/response/index.ts index a217a31..c93bb00 100644 --- a/src/modules/08_KPI/interface/response/index.ts +++ b/src/modules/08_KPI/interface/response/index.ts @@ -12,4 +12,33 @@ interface ResEvaluator { type: string; } -export type { ResEvaluator }; +interface ResRound { + createdAt: string; + createdFullName: string; + createdUserId: string; + durationKPI: string; + endDate: string; + id: string; + isActive: boolean; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + startDate: string; + year: number; +} +interface ResEvaluatorAssessor { + commanderHighId: string | null; + commanderId: string | null; + createdAt: string; + evaluationResults: string; + evaluationStatus: string; + evaluatorId: string; + firstname: string; + id: string; + kpiPeriodId: string; + lastname: string; + prefix: string; + profileId: string; +} + +export type { ResEvaluator, ResRound, ResEvaluatorAssessor }; diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index 55d3a72..824ac16 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -1,16 +1,19 @@ import { defineStore } from "pinia"; import { ref, reactive } from "vue"; import type { DataOptions } from "./interface/index/Main"; +import type { FormQuery } from "@/modules/08_KPI/interface/request/index"; export const useKpiDataStore = defineStore("KPIDate", () => { const tabMainevaluator = ref("1"); const yearRound = ref(new Date().getFullYear()); - const formQuery = reactive({ + const formQuery = reactive({ page: 1, pageSize: 10, round: "", keyword: "", }); + const selected = ref([]); + const tabMain = ref("1"); const dataProfile = ref({ profileId: null, @@ -339,5 +342,6 @@ export const useKpiDataStore = defineStore("KPIDate", () => { tabMainevaluator, formQuery, yearRound, + selected, }; }); diff --git a/src/modules/08_KPI/views/mainEvaluator.vue b/src/modules/08_KPI/views/mainEvaluator.vue index b788435..2b0c680 100644 --- a/src/modules/08_KPI/views/mainEvaluator.vue +++ b/src/modules/08_KPI/views/mainEvaluator.vue @@ -5,8 +5,15 @@ import { useQuasar } from "quasar"; import config from "@/app.config"; import http from "@/plugins/http"; -import type { DataOptions } from "@/modules/08_KPI/interface/index/Main"; import type { QTableProps } from "quasar"; +import type { + DataOptions, + Pagination, +} from "@/modules/08_KPI/interface/index/Main"; +import type { + ResRound, + ResEvaluatorAssessor, +} from "@/modules/08_KPI/interface/response/index"; import TabAll from "@/modules/08_KPI/components/Evaluator/01_TabAll.vue"; import TabOther from "@/modules/08_KPI/components/Evaluator/02_TabOther.vue"; @@ -19,9 +26,7 @@ const router = useRouter(); const store = useKpiDataStore(); const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin(); -const dataListMain = ref(); - -const year = ref(new Date().getFullYear()); +const dataListMain = ref([]); const roundOp = ref([]); @@ -93,7 +98,7 @@ function fetchRoundOption(type: boolean = false) { ) .then((res) => { const data = res.data.result.data; - const list = data.map((e: any) => ({ + const list = data.map((e: ResRound) => ({ id: e.id, name: e.durationKPI === "OCT" @@ -118,36 +123,21 @@ function fetchRoundOption(type: boolean = false) { function fetchList() { showLoader(); - const formTab1 = { + const body = { page: store.formQuery.page, pageSize: store.formQuery.pageSize, kpiPeriodId: store.formQuery.round, keyword: store.formQuery.keyword, + status: + store.tabMainevaluator === "2" + ? "NEW" + : store.tabMainevaluator === "4" + ? "APPROVE" + : store.tabMainevaluator === "5" + ? "EVALUATING" + : undefined, + reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined, }; - const formTab2 = { - page: store.formQuery.page, - pageSize: store.formQuery.pageSize, - kpiPeriodId: store.formQuery.round, - keyword: store.formQuery.keyword, - status: "NEW_EVALUATOR", - }; - - const formTab3 = { - page: store.formQuery.page, - pageSize: store.formQuery.pageSize, - kpiPeriodId: store.formQuery.round, - keyword: store.formQuery.keyword, - reqedit: "EVALUATOR", - }; - - const body = - store.tabMainevaluator === "1" - ? formTab1 - : store.tabMainevaluator === "2" - ? formTab2 - : store.tabMainevaluator === "3" - ? formTab3 - : ""; http .post(config.API.kpiEvaluation + `/admin`, body) @@ -174,7 +164,7 @@ function changRound() { * function updatePagination * @param newPagination ข้อมูล Pagination ใหม่ */ -function updatePagination(newPagination: any) { +function updatePagination(newPagination: Pagination) { store.formQuery.page = 1; store.formQuery.pageSize = newPagination.rowsPerPage; } @@ -189,6 +179,7 @@ watch( function onChangTab() { store.formQuery.page = 1; fetchList(); + store.selected = []; } onMounted(async () => { @@ -316,7 +307,7 @@ onMounted(async () => { { label="รออนุมัติแก้ไขข้อตกลง" @click="onChangTab" /> + + @@ -366,6 +367,32 @@ onMounted(async () => { :fetchList="fetchList" /> + + + + + + + + From 7cb3382fe5b487d54391e8a85c394411280b9a24 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Mon, 13 May 2024 14:49:08 +0700 Subject: [PATCH 2/2] updated kpi store --- src/modules/08_KPI/store.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index 55d3a72..8ec9aa5 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -229,6 +229,8 @@ export const useKpiDataStore = defineStore("KPIDate", () => { defaultCompetencyGroupLevel.value = 1; break; default: + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 1; break; } } @@ -273,10 +275,8 @@ export const useKpiDataStore = defineStore("KPIDate", () => { // SUMMARY GENERAL CASE const indicatorPercent = ref(100); // รวมผลการประเมิน (ร้อยละ) const indicatorPercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) ที่ได้จริง - const indicatorScore = ref(80); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน) - const indicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้ + const indicatorScore = ref(70); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน ( คะแนนเต็ม indicatorScore คะแนน) const competencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) - const competencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน const devScore = ref(10); // ผลการประเมินการพัฒนาตนเอง (devScore คะแนน) const devScoreVal = ref(0); // ผลการประเมินการพัฒนาตนเองที่ได้กี่คะแนน const competencyDevScore = ref(30); // สรุปผลการประเมินพฤติกรรมการปฏิบัติราชการ (สมรรถนะ+การพัฒนาตนเอง) (คะแนนเต็ม competencyDevScore คะแนน) @@ -291,9 +291,10 @@ export const useKpiDataStore = defineStore("KPIDate", () => { const excusiveIndicator2PercentVal = ref(0); // รวมผลการประเมิน (ร้อยละ) มิติที่ 2 ที่ได้จริง const excusiveIndicator2ScoreVal = ref(0); // คะแนนมิติที่ 2 ที่ได้จริง const excusiveIndicatorScore = ref(80); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน (มิติที่ 1 + มิติที่ 2) ( คะแนนเต็ม excusiveIndicatorScore คะแนน) - const excusiveIndicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงาน (มิติที่ 1 + มิติที่ 2) คะแนนที่ได้จริง const excusiveCompetencyScore = ref(20); // ผลการประเมินสมรรถนะ (competencyScore คะแนน) - const excusiveCompetencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน + + const indicatorScoreVal = ref(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้ + const competencyScoreVal = ref(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน return { tabMain, @@ -324,7 +325,6 @@ export const useKpiDataStore = defineStore("KPIDate", () => { competencyDevScore, competencyDevScoreVal, excusiveCompetencyScore, - excusiveCompetencyScoreVal, excusiveIndicatorPercent, excusiveIndicator1PercentVal, excusiveIndicator1Weight, @@ -333,7 +333,6 @@ export const useKpiDataStore = defineStore("KPIDate", () => { excusiveIndicator2PercentVal, excusiveIndicator2ScoreVal, excusiveIndicatorScore, - excusiveIndicatorScoreVal, //รายการการประเมินผลการปฏิบัติราชการระดับบุคคล tabMainevaluator,