From 4f973738a397cee95d3d5343793c75d881fa9cd0 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Fri, 28 Jun 2024 11:28:40 +0700 Subject: [PATCH] KPI --- src/api/14_KPI/api.KPI.ts | 8 +- .../14_KPI/components/Tab/01_Assessment.vue | 90 +- .../Tab/Dialog/01_FormIndicator.vue | 55 +- .../Tab/Dialog/DialogCommentProgress.vue | 526 +++++--- .../Tab/Dialog/DialogCompetncyByRow.vue | 195 +++ .../Tab/Dialog/DialogGovernment.vue | 43 +- .../components/Tab/Dialog/DialogLevel.vue | 178 +++ .../components/Tab/Dialog/DialogStatus.vue | 27 +- .../Tab/DialogEvaluate/01_Indicator.vue | 7 +- .../Tab/DialogEvaluate/02_Competenct.vue | 1 + .../components/Tab/Topic/01_Indicator.vue | 126 +- .../components/Tab/Topic/02_Competency.vue | 228 +++- src/modules/14_KPI/interface/request/index.ts | 3 +- src/modules/14_KPI/store.ts | 42 +- src/modules/14_KPI/views/detailView.vue | 1100 +++++++++++------ 15 files changed, 1896 insertions(+), 733 deletions(-) create mode 100644 src/modules/14_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue create mode 100644 src/modules/14_KPI/components/Tab/Dialog/DialogLevel.vue diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index 990f035a2..b8fd56c69 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -21,6 +21,7 @@ const urlFile = `${env.API_URI}/salary`; const kpiGroup = `${env.API_URI}/kpi/group`; const kpiLink = `${env.API_URI}/kpi/link`; const placementKeycloak = `${env.API_URI}/placement/officer/profileId`; +const orgPosition = `${env.API_URI}/org/profile/profileid/position`; export default { KPI, @@ -69,9 +70,12 @@ export default { kpiLink, - profilePosition: () => `${env.API_URI}/org/profile/profileid/position`, + profilePosition:`${env.API_URI}/org/profile/profileid/position`, placementKeycloak, - + profilePositionKey: () => `${env.API_URI}/org/profile/keycloak/position`, /** Report*/ kpiReport: () => `${KPI}/report/announcement`, + sendToCommander: `${KpiUser}/evaluation/admin/change-status`, + sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`, + updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`, }; diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue index 460465566..68292deb4 100644 --- a/src/modules/14_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -21,14 +21,8 @@ const dataListCriteria = ref([]); const modalCriteria = ref(false); const $q = useQuasar(); const route = useRoute(); -const { - hideLoader, - messageError, - date2Thai, - success, - showLoader, - dialogRemove, -} = useCounterMixin(); +const { hideLoader, messageError, success, showLoader, dialogRemove } = + useCounterMixin(); const store = useKpiDataStore(); const evaluationId = ref(route.params.id.toString()); @@ -152,10 +146,6 @@ function fetchAssigned() { }); } -function onInfo() { - modalCriteria.value = true; -} - function getCriteria() { http .get(config.API.KpiEvaluationInfo) @@ -169,7 +159,7 @@ function getCriteria() { } const isShowScore = computed(() => { - return store.tabOpen === 3 && store.tabMain === "3"; + return store.tabMain === "3"; }); watch( @@ -195,32 +185,40 @@ watch( store.indicatorScoreVal = store.indicatorPercentVal * (store.indicatorScore / 100); + + if (store.isUpdate && store.tabMain === "3") { + http + .put(config.API.updatePoint(evaluationId.value), { + totalPoint1: ( + store.indicatorPercentVal * + (store.indicatorScore / 100) + ).toFixed(2), + summaryPoint: ( + store.indicatorScoreVal + + store.competencyScoreVal + + store.devScoreVal + ).toFixed(2), + }) + .then((res) => {}); + } } } ); -onMounted(async () => { - showLoader(); - try { - await Promise.all([ - getCriteria(), - fetchListPlanned(), - fetchListRole(), - fetchAssigned(), - ]); - } catch (err) { - messageError($q, err); - } finally { - setTimeout(() => { - hideLoader(); - }, 4000); - } +onMounted(() => { + getCriteria(); + fetchListPlanned(); + fetchListRole(); + fetchAssigned(); + setTimeout(() => { + hideLoader(); + }, 1000); }); @@ -469,7 +551,14 @@ watch( - + @@ -479,23 +568,70 @@ watch( v-model="formDataAdd.topic" outlined class="inputgreen" - label="หัวข้อความก้าวหน้า" + :label=" + type == 'capacity' || type == 'development' + ? 'เหตุการณ์/พฤติกรรม' + : 'หัวข้อความก้าวหน้า' + " dense lazy-rules hide-bottom-space - :rules="[(val:string) => !!val || `${'กรุณากรอกหัวข้อความก้าวหน้า'}`,]" + :rules="[(val:string) => !!val || `${type == 'capacity'||type == 'development' ? 'กรุณากรอกเหตุการณ์/พฤติกรรม':'กรุณากรอกหัวข้อความก้าวหน้า' }`,]" /> + +
+
+ คะแนนความก้าวหน้า +
+ + + + +
+ {{ i }} +
+
+
+
+
@@ -520,4 +656,20 @@ watch( background: #ebf9f7 !important; color: #1bb19ab8 !important; } + +.q-btn-group--outline > .q-btn-item:not(:last-child):before { + border-right: 1px solid #c4c4c4; +} +.q-btn-group--outline > .q-btn-item.active { + color: #2196f3 !important; + background-color: #cde6fb !important; +} +.q-btn-group--outline > .q-btn-item + .q-btn-item.active:before { + border-left: 1px solid #2196f3 !important; + background-color: #cde6fb; +} +.q-btn-group--outline > .q-btn-item.active:not(:last-child):before { + border: 1px solid #2196f3; + background-color: #cde6fb; +} diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue new file mode 100644 index 000000000..edcf0752a --- /dev/null +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue b/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue index de09cb3bf..032e5c1e7 100644 --- a/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue +++ b/src/modules/14_KPI/components/Tab/Dialog/DialogGovernment.vue @@ -1,13 +1,15 @@