diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue index cc4aec901..5dadefdf7 100644 --- a/src/modules/14_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -42,6 +42,7 @@ const weightAssigned = ref(0); const resultPlanned = ref(0); const resultRole = ref(0); const resultAssigned = ref(0); + function fetchListPlanned() { http .get(config.API.kpiAchievement("planned") + `?id=${evaluationId.value}`) @@ -206,13 +207,17 @@ watch( ); onMounted(() => { - getCriteria(); - fetchListPlanned(); - fetchListRole(); - fetchAssigned(); - setTimeout(() => { - hideLoader(); - }, 1000); + showLoader(), + Promise.all([ + getCriteria(), + fetchListPlanned(), + fetchListRole(), + fetchAssigned(), + ]).finally(() => { + setTimeout(() => { + hideLoader(); + }, 2000); + }); }); diff --git a/src/modules/14_KPI/components/results/dialogIndividual.vue b/src/modules/14_KPI/components/results/dialogIndividual.vue index e525a9190..bd74d80b6 100644 --- a/src/modules/14_KPI/components/results/dialogIndividual.vue +++ b/src/modules/14_KPI/components/results/dialogIndividual.vue @@ -9,7 +9,7 @@ import config from "@/app.config"; */ import type { OptionCheckbox, - DataCapacity, + DataAchievement, } from "@/modules/14_KPI/interface/index/Main"; /** @@ -39,24 +39,24 @@ const devId = defineModel("devId", { /** * Table */ -const rows = ref([]); -const visibleColumns = ref(["capacityPoint", "capacityName"]); +const rows = ref([]); +const visibleColumns = ref(["achievement", "detail"]); const columns = ref([ { - name: "capacityPoint", + name: "achievement", align: "center", label: "ระดับคะแนน", sortable: true, - field: "capacityPoint", + field: "achievement", headerStyle: "font-size: 14px", style: "font-size: 14px; width:20%;", }, { - name: "capacityName", + name: "detail", align: "left", label: "เกณฑ์การประเมิน", sortable: true, - field: "capacityName", + field: "detail", headerStyle: "font-size: 14px", style: "font-size: 14px; width:80%;", }, @@ -97,7 +97,11 @@ function fetchDetailIndividual() { ]; target.value = data.target; - rows.value = data.capacity; + const achievements = ["10", "5", "0"]; + rows.value = achievements.map((i) => ({ + achievement: i, + detail: data[`achievement${i}`], + })); }) .catch((err) => { messageError($q, err); @@ -200,13 +204,13 @@ watch( :key="col.name" :props="props" > -
+
diff --git a/src/modules/14_KPI/components/results/tableIndividual.vue b/src/modules/14_KPI/components/results/tableIndividual.vue index 451e06070..e045d6e3a 100644 --- a/src/modules/14_KPI/components/results/tableIndividual.vue +++ b/src/modules/14_KPI/components/results/tableIndividual.vue @@ -348,7 +348,6 @@ onMounted(() => { :columns="columns" :rows="rows" row-key="id" - :selection="tab === 'COMPLETE' ? 'multiple' : null" :rows-per-page-options="[10, 25, 50, 100]" v-model:pagination="pagination" :paging="true" diff --git a/src/modules/14_KPI/interface/index/Main.ts b/src/modules/14_KPI/interface/index/Main.ts index d321c73b4..aeb361cff 100644 --- a/src/modules/14_KPI/interface/index/Main.ts +++ b/src/modules/14_KPI/interface/index/Main.ts @@ -68,7 +68,10 @@ interface FormData { email: string; qualification: string; } -interface DataCapacity {} +interface DataAchievement { + achievement: string; + detail: string; +} export type { DataOption, @@ -80,5 +83,5 @@ export type { FormData, ItemsTab, OptionCheckbox, - DataCapacity, + DataAchievement, }; diff --git a/src/modules/14_KPI/views/resultsMain.vue b/src/modules/14_KPI/views/resultsMain.vue index 97b30a3e5..84fef59b4 100644 --- a/src/modules/14_KPI/views/resultsMain.vue +++ b/src/modules/14_KPI/views/resultsMain.vue @@ -58,9 +58,9 @@ function fetcDataList() { kpiPeriodId: store.formQuery.round ? store.formQuery.round : "", }) .then((res) => { - const data = res.data.result.data; + const data = res.data.result; - dataList.value = data; + dataList.value = data.data; total.value = data.total; maxPage.value = Math.ceil(total.value / pageSize.value);