From 7538d2136450ac90e79c8e941c2be5ff7b0fe192 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 26 Jun 2024 17:07:01 +0700 Subject: [PATCH] updated kpi --- src/api/KPI/api.kpis.ts | 11 ++- .../Tab/Dialog/DialogCommentProgress.vue | 7 +- src/modules/08_KPI/views/form.vue | 81 +++++++++++++++---- 3 files changed, 72 insertions(+), 27 deletions(-) diff --git a/src/api/KPI/api.kpis.ts b/src/api/KPI/api.kpis.ts index e85f31b..1238304 100644 --- a/src/api/KPI/api.kpis.ts +++ b/src/api/KPI/api.kpis.ts @@ -15,11 +15,10 @@ const KpiUser = `${env.API_URI}/kpi/user`; const kpiAchievement = `${env.API_URI}/kpi/user/achievement`; const kpiReason = `${env.API_URI}/kpi/reason`; - // const placementKeycloak = `${env.API_URI}/placement/officer/keycloak`; const placementKeycloak = `${env.API_URI}/placement/officer/profileId`; // const orgPosition = `${env.API_URI}/org/profile/keycloak/position `; -const orgPosition = `${env.API_URI}/org/profile/profileid/position`; +const orgPosition = `${env.API_URI}/org/profile/profileid/position`; export default { kpiPeriod, kpiEvaluation, @@ -48,9 +47,13 @@ export default { /**ประเมิน*/ kpiAchievementDevelop: `${kpiAchievement}/development`, - kpiCommentP:(typP:string,type:string,role:string,id:string)=>`${kpiReason}/${typP}/${type}/${role}/${id}`, + kpiCommentP: (typP: string, type: string, role: string, id: string) => + `${kpiReason}/${typP}/${type}/${role}/${id}`, placementKeycloak, orgPosition, - sendToCommander:`${KpiUser}/evaluation/admin/change-status` + sendToCommander: `${KpiUser}/evaluation/admin/change-status`, + sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`, + updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`, + openPoint: (id: string) => `${kpiEvaluation}/open/${id}`, }; diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue index 45d2cf5..8019b3d 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/DialogCommentProgress.vue @@ -105,12 +105,7 @@ function onSubmitAdd() { showLoader(); http .put( - config.API.kpiCommentP( - "progress", - type.value, - store.rolePerson.toLocaleLowerCase(), - idList.value - ), + config.API.kpiCommentP("progress", type.value, "user", idList.value), { reason: formDataAdd.reason, topic: formDataAdd.topic, diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index da9fb9f..8365170 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -23,10 +23,10 @@ const route = useRoute(); const id = ref(route.params.id as string); const isReadonly = (route.name === "KPIEditEvaluator" ? true : false); -const plannedPoint = ref(""); -const rolePoint = ref(""); -const specialPoint = ref(""); -const capacityPoint = ref(""); +// const plannedPoint = ref(""); +// const rolePoint = ref(""); +// const specialPoint = ref(""); +// const capacityPoint = ref(""); const store = useKpiDataStore(); const $q = useQuasar(); @@ -71,11 +71,11 @@ async function fetchEvaluation() { fetchProfile(data.profileId); - plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; - rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; - specialPoint.value = data.specialPoint == null ? "" : data.specialPoint; - capacityPoint.value = - data.capacityPoint == null ? "" : data.capacityPoint; + // plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; + // rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; + // specialPoint.value = data.specialPoint == null ? "" : data.specialPoint; + // capacityPoint.value = + // data.capacityPoint == null ? "" : data.capacityPoint; }) .catch((e) => { messageError($q, e); @@ -317,12 +317,12 @@ function openStatus() { modalStatus.value = true; } -function sendToCommander() { +function sendToEvauator() { dialogConfirm($q, () => { showLoader(); http .post(config.API.sendToCommander, { - status: "EVALUATING", + evaluationStatus: "EVALUATING", id: [store.dataEvaluation.id], }) .then(async (res) => { @@ -338,6 +338,26 @@ function sendToCommander() { }); } +function goToSummary() { + dialogConfirm($q, () => { + showLoader(); + http + .post(config.API.sendToSummary(store.dataEvaluation.id), { + status: "SUMMARY", + }) + .then(async (res) => { + await getAll(); + store.tabMain = "4"; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }); +} + onMounted(async () => { showLoader(); await getAll(); @@ -412,9 +432,11 @@ onMounted(async () => {
{ color="grey-2" text-color="blue-6" size="md" - @click="sendToCommander" + @click="sendToEvauator" > ทำการประเมิน @@ -499,6 +523,28 @@ onMounted(async () => { ขอแก้ไขข้อตกลง + + สรุปผลการประเมิน + + { คะแนนประเมิน {{ - store.dataEvaluation.posExecutiveName == null + store.dataEvaluation.posTypeName != "อำนวยการ" && + store.dataEvaluation.posTypeName != "บริหาร" ? ( store.indicatorScoreVal + store.competencyScoreVal +