From 1cbaecce8ecdc5e5654f20952ce2b394ca299b1c Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 1 May 2024 13:05:54 +0700 Subject: [PATCH 1/5] =?UTF-8?q?change=20style=20=E0=B8=84=E0=B8=B0?= =?UTF-8?q?=E0=B9=81=E0=B8=99=E0=B8=99=E0=B9=80=E0=B8=95=E0=B9=87=E0=B8=A1?= =?UTF-8?q?=E0=B8=A3=E0=B8=A7=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/08_KPI/views/form.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index d5ecd5b..939f0c5 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -603,7 +603,7 @@ onMounted(() => { -
+
คะแนนเต็มรวมกันต้องเท่ากับ 100 คะแนน From 1ae9e85af9ef4ecf02c1e808148fa412bfb7fe0c Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 2 May 2024 14:44:22 +0700 Subject: [PATCH 2/5] =?UTF-8?q?updated=20=E0=B8=84=E0=B8=B0=E0=B9=81?= =?UTF-8?q?=E0=B8=99=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=20kpi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../08_KPI/components/Tab/01_Assessment.vue | 23 +++++++++++++++++-- .../components/Tab/Topic/02_Competency.vue | 5 ++++ src/modules/08_KPI/views/form.vue | 5 ++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/01_Assessment.vue b/src/modules/08_KPI/components/Tab/01_Assessment.vue index 4fe3aed..680a5d6 100644 --- a/src/modules/08_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/08_KPI/components/Tab/01_Assessment.vue @@ -142,8 +142,11 @@ function fetchAssigned() { function onInfo() { modalCriteria.value = true; } + +const totalCompetency = ref(0); const resultWork = computed(() => { const total = totalResults1.value + totalResults2.value + totalResults3.value; + score.value = total; return total.toFixed(2); }); @@ -162,6 +165,19 @@ function getCriteria() { }); } +watch( + () => totalCompetency.value, + (newValue, oldValue) => { + if (newValue !== oldValue) { + score.value = + totalResults1.value + + totalResults2.value + + totalResults3.value + + newValue; + } + } +); + watch( () => store.dataEvaluation.plannedPoint, (newValue, oldValue) => { @@ -203,7 +219,7 @@ onMounted(() => { class="bg-white row col-12 text-dark q-pa-md" >
- องค์ประกอบที่ 1 + องค์ประกอบที่ 1 ผลสัมฤทธิ์ของงาน
@@ -268,7 +284,10 @@ onMounted(() => {
- +
diff --git a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue index e841800..7ee27a2 100644 --- a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue +++ b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue @@ -18,6 +18,10 @@ import type { const dataListCriteria = defineModel("dataListCriteria", { required: true, }); +const totalCompetency = defineModel("totalCompetency", { + type: Number, + default: 0, +}); const sortedDataListCriteria = computed(() => { return dataListCriteria.value.sort((a, b) => a.level - b.level); @@ -159,6 +163,7 @@ function getData(type: string) { ? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint : 0; resultEvaluation.value = sum.toFixed(2); + totalCompetency.value = sum; } // end cal summary diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 939f0c5..e685def 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -49,6 +49,7 @@ const commanderHighMainOp = ref([]); const evaluatorId = ref(null); const commanderId = ref(null); const commanderHighId = ref(null); +const score = ref(0); const formProfile = reactive({ fullName: "", @@ -440,7 +441,7 @@ onMounted(() => {
คะแนนประเมิน {{ - formProfile.score + score.toFixed(2) }}
@@ -451,7 +452,7 @@ onMounted(() => { - + From d642f663f304a626cbafffdceeac163565cc8961 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 2 May 2024 16:13:34 +0700 Subject: [PATCH 3/5] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20load=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=20kpi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../08_KPI/components/Tab/01_Assessment.vue | 47 ++++++------------- src/modules/08_KPI/components/Tab/TabMain.vue | 16 +++++-- .../components/Tab/Topic/02_Competency.vue | 8 +--- src/modules/08_KPI/views/form.vue | 38 +++++++-------- 4 files changed, 48 insertions(+), 61 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/01_Assessment.vue b/src/modules/08_KPI/components/Tab/01_Assessment.vue index 680a5d6..97d2620 100644 --- a/src/modules/08_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/08_KPI/components/Tab/01_Assessment.vue @@ -16,13 +16,20 @@ import { useKpiDataStore } from "@/modules/08_KPI/store"; import type { ListCriteria } from "@/modules/08_KPI/interface/request/index"; -const score = defineModel("score", { type: Number, default: 0 }); +const indicatorScore = defineModel("indicatorScore", { + type: Number, + default: 0, +}); +const competencyScore = defineModel("competencyScore", { + type: Number, + default: 0, +}); const dataListCriteria = ref([]); const modalCriteria = ref(false); const $q = useQuasar(); const route = useRoute(); -const { showLoader, hideLoader, messageError } = useCounterMixin(); +const { hideLoader, messageError } = useCounterMixin(); const store = useKpiDataStore(); const evaluationId = ref(route.params.id.toString()); @@ -37,7 +44,6 @@ const totalResults3 = ref(0); // const resultWork = ref(0); function fetchListPlanned() { - showLoader(); http .get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`) .then((res) => { @@ -64,14 +70,10 @@ function fetchListPlanned() { }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - hideLoader(); }); } function fetchListRole() { - showLoader(); http .get(config.API.kpiAchievement("role") + `?id=${evaluationId.value}`) .then((res) => { @@ -98,14 +100,10 @@ function fetchListRole() { }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - hideLoader(); }); } function fetchAssigned() { - showLoader(); http .get(config.API.kpiAchievement("special") + `?id=${evaluationId.value}`) .then((res) => { @@ -133,9 +131,6 @@ function fetchAssigned() { }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - hideLoader(); }); } @@ -143,10 +138,9 @@ function onInfo() { modalCriteria.value = true; } -const totalCompetency = ref(0); const resultWork = computed(() => { const total = totalResults1.value + totalResults2.value + totalResults3.value; - score.value = total; + indicatorScore.value = total; return total.toFixed(2); }); @@ -159,25 +153,9 @@ function getCriteria() { }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); } -watch( - () => totalCompetency.value, - (newValue, oldValue) => { - if (newValue !== oldValue) { - score.value = - totalResults1.value + - totalResults2.value + - totalResults3.value + - newValue; - } - } -); - watch( () => store.dataEvaluation.plannedPoint, (newValue, oldValue) => { @@ -210,6 +188,9 @@ onMounted(() => { fetchListPlanned(); fetchListRole(); fetchAssigned(); + setTimeout(() => { + hideLoader(); + }, 1000); }); @@ -286,7 +267,7 @@ onMounted(() => { diff --git a/src/modules/08_KPI/components/Tab/TabMain.vue b/src/modules/08_KPI/components/Tab/TabMain.vue index 9e701c3..431b664 100644 --- a/src/modules/08_KPI/components/Tab/TabMain.vue +++ b/src/modules/08_KPI/components/Tab/TabMain.vue @@ -12,8 +12,14 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue"; const store = useKpiDataStore(); const route = useRoute(); const isReadonly = (route.name === "KPIEditEvaluator" ? true : false); -const score = defineModel("score", { type: Number, default: 0 }); - +const indicatorScore = defineModel("indicatorScore", { + type: Number, + default: 0, +}); +const competencyScore = defineModel("competencyScore", { + type: Number, + default: 0, +}); const itemsTab = ref([ { name: "1", @@ -84,7 +90,11 @@ const splitterModel = ref(12); :name="tab.name" class="q-pa-none" > - + diff --git a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue index 7ee27a2..ec1f213 100644 --- a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue +++ b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue @@ -18,7 +18,7 @@ import type { const dataListCriteria = defineModel("dataListCriteria", { required: true, }); -const totalCompetency = defineModel("totalCompetency", { +const competencyScore = defineModel("competencyScore", { type: Number, default: 0, }); @@ -118,7 +118,6 @@ const lists = ref([]); const resultEvaluation = ref(0); function getData(type: string) { - showLoader(); http .get(config.API.kpiUserCapacity + `?id=${id.value}&type=${type}`) .then(async (res) => { @@ -163,11 +162,8 @@ function getData(type: string) { ? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint : 0; resultEvaluation.value = sum.toFixed(2); - totalCompetency.value = sum; + competencyScore.value = sum; } - // end cal summary - - hideLoader(); }); } diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index e685def..4b1340c 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -49,7 +49,8 @@ const commanderHighMainOp = ref([]); const evaluatorId = ref(null); const commanderId = ref(null); const commanderHighId = ref(null); -const score = ref(0); +const indicatorScore = ref(0); +const competencyScore = ref(0); const formProfile = reactive({ fullName: "", @@ -65,7 +66,6 @@ const formProfile = reactive({ const router = useRouter(); function fetchEvaluation() { - showLoader(); http .get(config.API.kpiEvaluation + `/${id.value}`) .then((res) => { @@ -83,14 +83,13 @@ function fetchEvaluation() { }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); + // .finally(() => { + // hideLoader(); + // }); } function getProfile() { - showLoader(); http .get(config.API.profilePosition()) .then((res) => { @@ -106,14 +105,13 @@ function getProfile() { }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); + // .finally(() => { + // hideLoader(); + // }); } async function fetchProfile(id: string) { - showLoader(); await http .get( config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`) @@ -123,9 +121,6 @@ async function fetchProfile(id: string) { }) .catch(() => { // profilePicture.value = avatar; - }) - .finally(() => { - hideLoader(); }); } @@ -251,9 +246,10 @@ watch( } else { scoreTotal.value = true; } - } else { - console.log(2); } + // else { + // console.log(2); + // } } ); @@ -296,8 +292,9 @@ async function getAll() { await getOrgOp(); } -onMounted(() => { - getAll(); +onMounted(async () => { + showLoader(); + await getAll(); }); @@ -441,7 +438,7 @@ onMounted(() => {
คะแนนประเมิน {{ - score.toFixed(2) + (indicatorScore + competencyScore).toFixed(2) }}
@@ -452,7 +449,10 @@ onMounted(() => { - + From 6c10587139e1fd133311e04ce94b1a48369b71b9 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 8 May 2024 08:06:53 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=9F=E0=B8=AD=E0=B8=A3=E0=B9=8C=E0=B8=A1=20kpi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../08_KPI/components/Tab/01_Assessment.vue | 8 +++++ .../Tab/Dialog/04_FormCompetency.vue | 19 ++++++------ src/modules/08_KPI/components/Tab/TabMain.vue | 30 +++++++++++-------- .../components/Tab/Topic/01_Indicator.vue | 4 +-- .../components/Tab/Topic/02_Competency.vue | 16 +++------- src/modules/08_KPI/views/form.vue | 4 +-- 6 files changed, 43 insertions(+), 38 deletions(-) diff --git a/src/modules/08_KPI/components/Tab/01_Assessment.vue b/src/modules/08_KPI/components/Tab/01_Assessment.vue index 97d2620..4dd7451 100644 --- a/src/modules/08_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/08_KPI/components/Tab/01_Assessment.vue @@ -269,6 +269,14 @@ onMounted(() => { v-model:dataListCriteria="dataListCriteria" v-model:competencyScore="competencyScore" /> + +
+ สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม + {{ store.dataEvaluation.capacityPoint }} คะแนน) +
{{ competencyScore }}
+
diff --git a/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue b/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue index 8fcd607..b06391e 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/04_FormCompetency.vue @@ -24,7 +24,7 @@ const $q = useQuasar(); const store = useKpiDataStore(); const expectedLevel = ref(); -const weight = ref(null); +const weight = ref(100); const mixin = useCounterMixin(); const { showLoader, @@ -123,7 +123,7 @@ function closeDialog() { formDetail.definition = ""; formDetail.criteria = ""; idProps.value = null; - weight.value = null; + // weight.value = null; expectedLevel.value = null; dataListCapacityDetails.value = []; @@ -375,6 +375,7 @@ watch(
น้ำหนัก (ร้อยละ)
ระดับที่คาดหวัง
-
+
-
+
@@ -428,8 +427,8 @@ watch(
ไม่พบข้อมูลสมรรถนะ
diff --git a/src/modules/08_KPI/components/Tab/TabMain.vue b/src/modules/08_KPI/components/Tab/TabMain.vue index 431b664..d559d84 100644 --- a/src/modules/08_KPI/components/Tab/TabMain.vue +++ b/src/modules/08_KPI/components/Tab/TabMain.vue @@ -11,7 +11,8 @@ import File from "@/modules/08_KPI/components/Tab/05_File.vue"; const store = useKpiDataStore(); const route = useRoute(); -const isReadonly = (route.name === "KPIEditEvaluator" ? true : false); +const isReadonly = ref(route.name === "KPIEditEvaluator" ? true : false); +const step = ref(1); // 1 = จัดทำข้อตกลง, 2 = รายงานความก้าวหน้า, 3 = รายงานผลสำเร็จของงาน const indicatorScore = defineModel("indicatorScore", { type: Number, default: 0, @@ -23,20 +24,24 @@ const competencyScore = defineModel("competencyScore", { const itemsTab = ref([ { name: "1", - label: "ผู้ขอรับการประเมิน", + label: "จัดทำแบบฟอร์มการประเมิน", }, { name: "2", - label: "ผู้ประเมิน", + label: "รายงานความก้าวหน้า", }, { name: "3", - label: "ผู้บังคับบัญชาเหนือขึ้นไป", - }, - { - name: "4", - label: "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + label: "รายงานผลสำเร็จของงาน", }, + // { + // name: "3", + // label: "ผู้บังคับบัญชาเหนือขึ้นไป", + // }, + // { + // name: "4", + // label: "ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง", + // }, { name: "5", label: "ไฟล์เอกสาร", @@ -63,14 +68,15 @@ const splitterModel = ref(12); :icon="tab.icon" :label="tab.label" /> --> - - - + + + + diff --git a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue index 8969aeb..1407b71 100644 --- a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue +++ b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue @@ -204,7 +204,7 @@ watch( เพิ่มข้อมูล -
+
diff --git a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue index ec1f213..65f4374 100644 --- a/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue +++ b/src/modules/08_KPI/components/Tab/Topic/02_Competency.vue @@ -115,7 +115,7 @@ function onAdd(type: string) { const rows = ref([]); const lists = ref([]); -const resultEvaluation = ref(0); +// const resultEvaluation = ref(0); function getData(type: string) { http @@ -161,7 +161,7 @@ function getData(type: string) { weightAvg != 0 ? (resultAvg / weightAvg) * store.dataEvaluation.capacityPoint : 0; - resultEvaluation.value = sum.toFixed(2); + // resultEvaluation.value = sum.toFixed(2); competencyScore.value = sum; } }); @@ -239,7 +239,7 @@ onMounted(() => { - { @click="onEvaluate(item.id)" > ประเมิน - + --> @@ -359,14 +359,6 @@ onMounted(() => { v-model:dataListCriteria="dataListCriteria" :get-data="getData" /> - -
- สรุปผลการประเมินสมรรถนะ (คะแนนเต็ม - {{ store.dataEvaluation.capacityPoint }} คะแนน) -
{{ resultEvaluation }}
-