From 76118a8d11186ec3e7367f6d83c3893da26ff1c8 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Fri, 20 Sep 2024 13:02:15 +0700 Subject: [PATCH] Refactoring code module 14_KPI --- .../components/1_Complaint/EditPage.vue | 2 +- .../components/1_Complaint/MainPage.vue | 6 +- .../2_InvestigateFacts/EditPage.vue | 2 +- .../components/2_InvestigateFacts/Form.vue | 10 +- .../14_KPI/components/Tab/01_Assessment.vue | 30 +- .../14_KPI/components/Tab/02_Evaluator.vue | 333 --------- .../components/Tab/03_CommanderAbove.vue | 3 - .../Tab/04_CommanderAboveOneStep.vue | 3 - .../14_KPI/components/Tab/04_Result.vue | 6 + src/modules/14_KPI/components/Tab/05_File.vue | 16 +- .../Tab/Dialog/01_FormIndicator.vue | 59 +- .../Tab/Dialog/03_FormIndicatorSpecial.vue | 6 +- .../Tab/Dialog/04_FormCompetency.vue | 57 +- .../Tab/Dialog/DialogCommentProblem.vue | 13 +- .../Tab/Dialog/DialogCommentProgress.vue | 680 +++++++++--------- .../Tab/Dialog/DialogCompetncyByRow.vue | 5 +- .../components/Tab/Dialog/DialogDevelop.vue | 186 ++--- .../components/Tab/Dialog/DialogEvalute.vue | 116 +-- .../Tab/Dialog/DialogGovernment.vue | 34 +- .../components/Tab/Dialog/DialogLevel.vue | 8 +- .../Tab/Dialog/DialogListCriteria.vue | 8 - .../components/Tab/Dialog/DialogStatus.vue | 79 -- .../components/Tab/Dialog/DialogViewInfo.vue | 4 +- .../Tab/DialogEvaluate/01_Indicator.vue | 29 +- .../Tab/DialogEvaluate/02_Competenct.vue | 39 +- .../03_DialogEvalutionDevelop.vue | 9 +- .../components/Tab/Topic/01_Indicator.vue | 283 +++----- .../components/Tab/Topic/02_Competency.vue | 154 +--- .../components/Tab/Topic/03_Develop.vue | 165 ++--- .../components/results/dialogIndividual.vue | 48 +- .../components/results/tableIndividual.vue | 30 +- .../components/results/tableResults.vue | 11 +- src/modules/14_KPI/interface/request/index.ts | 4 +- src/modules/14_KPI/interface/response/KPI.ts | 18 +- src/modules/14_KPI/router.ts | 13 - src/modules/14_KPI/store.ts | 31 +- src/modules/14_KPI/views/detail.vue | 2 +- 37 files changed, 827 insertions(+), 1675 deletions(-) delete mode 100644 src/modules/14_KPI/components/Tab/02_Evaluator.vue delete mode 100644 src/modules/14_KPI/components/Tab/03_CommanderAbove.vue delete mode 100644 src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue delete mode 100644 src/modules/14_KPI/components/Tab/Dialog/DialogStatus.vue diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index 4f67ceb6d..62ab55941 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -393,7 +393,7 @@ onMounted(() => { @return-person="sendPersonToNext" :rows="mainStore.rowsSend" :columns="columns" - :visibleColumns="visibleColumns" + :visible-columns="visibleColumns" /> diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue index 033e04e9f..ba40b5e61 100644 --- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue @@ -197,10 +197,10 @@ onMounted(async () => {
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue index 31ece10f8..5f5c2ac9b 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue @@ -425,7 +425,7 @@ onMounted(() => { title="ส่งไปสอบสวน" :rows="mainStore.rowsSend.filter((item: ArrayPersonAdd)=> item.isSend == 'NEW')" :columns="mainStore.columnsDirector" - :visibleColumns="mainStore.visibleColumnsDirector" + :visible-columns="mainStore.visibleColumnsDirector" @return-person="emitPerson" />
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index edba86a1f..7839eedd1 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -1744,14 +1744,14 @@ onMounted(async () => { { title="ส่งรายชื่อไปออกคำสั่งยุติเรื่อง" :rows="mainStore.rowsCheck" :columns="mainStore.columnsDirector" - :visibleColumns="mainStore.visibleColumnsDirector" + :visible-columns="mainStore.visibleColumnsDirector" @return-person="emitPerson" :checked-val="false" :fetch-data="fetchData" diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue index 49a15155d..6aaaad1db 100644 --- a/src/modules/14_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -3,21 +3,19 @@ import { ref, onMounted, computed, watch } from "vue"; import { useQuasar } from "quasar"; import { useRoute } from "vue-router"; -import DialogListCriteria from "@/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue"; - import config from "@/app.config"; import http from "@/plugins/http"; +import { useCounterMixin } from "@/stores/mixin"; +import { useKpiDataStore } from "@/modules/14_KPI/store"; +import type { ListCriteria } from "@/modules/14_KPI/interface/request/Index"; + +import DialogListCriteria from "@/modules/14_KPI/components/Tab/Dialog/DialogListCriteria.vue"; import Work from "@/modules/14_KPI/components/Tab/Topic/01_Indicator.vue"; import Competency from "@/modules/14_KPI/components/Tab/Topic/02_Competency.vue"; import Develop from "@/modules/14_KPI/components/Tab/Topic/03_Develop.vue"; -import { useCounterMixin } from "@/stores/mixin"; -import { useKpiDataStore } from "@/modules/14_KPI/store"; - -import type { ListCriteria } from "@/modules/14_KPI/interface/request/index"; const dataListCriteria = ref([]); - const modalCriteria = ref(false); const $q = useQuasar(); const route = useRoute(); @@ -33,7 +31,6 @@ const rows_03 = ref([]); const totalResults1 = ref(0); const totalResults2 = ref(0); const totalResults3 = ref(0); -// const resultWork = ref(0); const weightPlanned = ref(0); const weightRole = ref(0); @@ -42,6 +39,11 @@ const resultPlanned = ref(0); const resultRole = ref(0); const resultAssigned = ref(0); +const isShowScore = computed(() => { + return store.tabMain === "3"; +}); + +/** ดึงข้อมูล งานตามแผนปฏิบัติราชการประจำปี */ async function fetchListPlanned() { await http .get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`) @@ -78,6 +80,7 @@ async function fetchListPlanned() { }); } +/** ดึงข้อมูล งานตามหน้าที่ความรับผิดชอบหลัก */ async function fetchListRole() { await http .get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`) @@ -107,7 +110,7 @@ async function fetchListRole() { messageError($q, err); }); } - +/** ดึงข้อมูล งานอื่น ๆ ที่ได้รับมอบหมาย */ async function fetchAssigned() { await http .get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`) @@ -146,6 +149,7 @@ async function fetchAssigned() { }); } +/** ข้อมูล เกณฑ์การประเมินสมรรถนะ */ async function getCriteria() { await http .get(config.API.KpiEvaluationInfo + `/criteria`) @@ -158,10 +162,6 @@ async function getCriteria() { }); } -const isShowScore = computed(() => { - return store.tabMain === "3"; -}); - watch( [weightPlanned, weightRole, weightAssigned], ([newA, newB, newC], [prevA, prevB, prevC]) => { @@ -297,10 +297,6 @@ onMounted(async () => { dense bordered :rows="[ - // { - // name: 'รวมผลการประเมิน (ร้อยละ)', - // value: store.excusiveIndicator2PercentVal.toFixed(2), - // }, { name: 'ผลการประเมินมิติที่ 2 (คะแนน)', value: store.excusiveIndicator2ScoreVal.toFixed(2), diff --git a/src/modules/14_KPI/components/Tab/02_Evaluator.vue b/src/modules/14_KPI/components/Tab/02_Evaluator.vue deleted file mode 100644 index d9b9c3c45..000000000 --- a/src/modules/14_KPI/components/Tab/02_Evaluator.vue +++ /dev/null @@ -1,333 +0,0 @@ - - - - diff --git a/src/modules/14_KPI/components/Tab/03_CommanderAbove.vue b/src/modules/14_KPI/components/Tab/03_CommanderAbove.vue deleted file mode 100644 index d47994bbf..000000000 --- a/src/modules/14_KPI/components/Tab/03_CommanderAbove.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue b/src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue deleted file mode 100644 index 4d5bde7de..000000000 --- a/src/modules/14_KPI/components/Tab/04_CommanderAboveOneStep.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/modules/14_KPI/components/Tab/04_Result.vue b/src/modules/14_KPI/components/Tab/04_Result.vue index de5b6d351..3de13102d 100644 --- a/src/modules/14_KPI/components/Tab/04_Result.vue +++ b/src/modules/14_KPI/components/Tab/04_Result.vue @@ -44,6 +44,7 @@ const sumWeight = ref(0); const sumResult = ref(0); const result = ref(""); +/** บันทึกสรุปผล ผู้ประเมิน */ function onSubmit() { dialogConfirm($q, () => { showLoader(); @@ -67,6 +68,7 @@ function onSubmit() { }); } +/** บันทึกสรุปผล ผู้บังคับบัญชา */ function onSubmitCommander() { if (superiorCommentCheck.value == "") { dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น"); @@ -92,6 +94,7 @@ function onSubmitCommander() { } } +/** บันทึกสรุปผล ผู้บังคับบัญชาเหนือขึ้นไป */ function onSubmitCommanderHigh() { if (additionalSuperiorCheck.value == "") { dialogMessageNotify($q, "กรุณาเลือกความคิดเห็น"); @@ -117,11 +120,13 @@ function onSubmitCommanderHigh() { } } +/** เมื่อเห็นด้วย ล้างค่าความคิดเห็น */ function resetCommander() { superiorComment.value = ""; superiorCommentRef.value.resetValidation(); } +/** เมื่อเห็นด้วย ล้างค่าความคิดเห็น */ function resetCommanderHigh() { additionalSuperiorComment.value = ""; additionalSuperiorCommentRef.value.resetValidation(); @@ -158,6 +163,7 @@ function userOpen() { http.get(config.API.openPoint(id.value)).then(async () => {}); } +/** ดึงรายละเอียด ผลการประเมิน */ async function getData() { showLoader(); await http diff --git a/src/modules/14_KPI/components/Tab/05_File.vue b/src/modules/14_KPI/components/Tab/05_File.vue index d4c309b69..735deee2e 100644 --- a/src/modules/14_KPI/components/Tab/05_File.vue +++ b/src/modules/14_KPI/components/Tab/05_File.vue @@ -1,8 +1,9 @@