From c7ec71595209c0a7c7ad5d518ac30c74b3ae36f3 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Sun, 14 Jul 2024 23:04:43 +0700 Subject: [PATCH] updated KPI --- .../Tab/Dialog/DialogGovernment.vue | 13 +- src/modules/08_KPI/views/form.vue | 346 +++++++++++++----- 2 files changed, 266 insertions(+), 93 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue index d9e31ca..f3519c9 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue @@ -153,6 +153,16 @@ const columns = ref([ style: "font-size: 14px", format: (val) => statusText(val), }, + { + name: "commandNo", + align: "left", + label: "เลขที่คำสั่ง", + sortable: true, + field: "commandNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (val) => statusText(val), + }, ]); const visibleColumns = ref([ "no", @@ -166,6 +176,7 @@ const visibleColumns = ref([ "dateEnd", "createdAt", "status", + "commandNo", ]); const statusText = (val: string) => { @@ -195,7 +206,7 @@ function close() { function getData() { showLoader(); http - .get(config.API.placementKeycloak + `/${store.dataProfile.profileId}`) + .get(config.API.placementKeycloak + `/${store.dataEvaluation.profileId}`) .then((res) => { const data = res.data.result; rows.value = data; diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 02eafe2..76bf07e 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -13,10 +13,10 @@ import DialogHeader from "@/components/DialogHeader.vue"; import type { FormProfile } from "@/modules/08_KPI/interface/request/index"; import type { DataOptions } from "@/modules/08_KPI/interface/index/Main"; import DialogGovernment from "@/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue"; -import DialogStatus from "@/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue"; +// import DialogStatus from "@/modules/08_KPI/components/Tab/Dialog/DialogStatus.vue"; const modalGovernment = ref(false); -const modalStatus = ref(false); +// const modalStatus = ref(false); // const modalScore = ref(false); const modalEdit = ref(false); const route = useRoute(); @@ -132,6 +132,11 @@ async function fetchProfile(id: string) { }); } +function openEvaluator() { + modalEdit.value = true; + getOrgOp(); +} + function close() { modalEdit.value = false; evaluatorId.value = null; @@ -384,7 +389,9 @@ function openGovernment() { modalGovernment.value = true; } function openStatus() { - modalStatus.value = true; + // router.push(`/probation/${store.dataEvaluation.profileId}`); + router.push(`/probation`); + // modalStatus.value = true; } function sendToEvauator() { @@ -462,6 +469,49 @@ async function goToSummary() { ); } +const modalEvaluatorDetail = ref(false); +const topic = ref(""); +function viewEvaluatorDetail(profileId: string, type: string) { + modalEvaluatorDetail.value = true; + topic.value = + type == "evaluator" + ? "ข้อมูลของผู้ประเมิน" + : type == "commander" + ? "ข้อมูลของผู้บังคับบัญชาเหนือขึ้นไป" + : "ข้อมูลของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง"; + fetchProfileEvaluator(profileId); +} + +const evaluator = ref({ + fullName: "", + position: "", + avartar: "", + posTypeName: "", + posLevelName: "", + org: "", +}); +async function fetchProfileEvaluator(id: string) { + showLoader(); + http + .get(config.API.orgPosition + `/${id}`) + .then((res) => { + console.log(res.data.result); + const data = res.data.result; + evaluator.value.fullName = + data.prefix + data.firstName + " " + data.lastName; + evaluator.value.position = data.position; + evaluator.value.posTypeName = data.posTypeName; + evaluator.value.posLevelName = data.posLevelName; + evaluator.value.org = findOrgName(data); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(async () => { showLoader(); store.isUpdate = await false; @@ -685,7 +735,7 @@ onMounted(async () => { color="grey-2" text-color="edit" size="md" - @click="modalEdit = true" + @click="openEvaluator()" > {{ store.dataEvaluation.evaluationStatus === "NEW" && @@ -820,103 +870,155 @@ onMounted(async () => {
- +
+ filterOption(inputValue, doneFn,'evaluatorIdOp' ) " - /> - + + ดูข้อมูลผู้ประเมิน + +
+
+
+
+ - - - + ดูข้อมูลผู้บังคับบัญชาเหนือขึ้นไป + +
+
+
+
+ - - + @click=" + viewEvaluatorDetail(commanderHighId.id, 'commanderHigh') + " + > + ดูข้อมูลผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง + +
+
@@ -936,6 +1038,66 @@ onMounted(async () => { + + + + + + +
+ {{ + evaluator.fullName + }} +
+ + +
+
+
+
ตำแหน่งในสายงาน
+
ตำแหน่งประเภท
+
ตำแหน่งทางการบริหาร
+
สังกัด
+
+
+
+ {{ evaluator.position ? evaluator.position : "-" }} +
+
+ {{ evaluator.posTypeName ? evaluator.posTypeName : "-" }} + {{ + evaluator.posLevelName + ? ` (${evaluator.posLevelName})` + : "-" + }} +
+
+ {{ + evaluator.posExecutiveName + ? evaluator.posExecutiveName + : "-" + }} +
+
+ {{ evaluator.org ? evaluator.org : "-" }} +
+
+ +
+
รักษาการในตำแหน่ง/การรักษาราชการแทน
+
+
+
-
+
+
+
+
+
+
+
- + /> -->