diff --git a/src/modules/14_KPI/components/results/tableResults.vue b/src/modules/14_KPI/components/results/tableResults.vue index a1f2cf34d..26856dc89 100644 --- a/src/modules/14_KPI/components/results/tableResults.vue +++ b/src/modules/14_KPI/components/results/tableResults.vue @@ -1,12 +1,271 @@ - {{ tab }} + + + + + + + + + + + + + + + + + + + + + + + + {{ (page - 1) * pageSize + props.rowIndex + 1 }} + + + {{ col.value ?? "-" }} + + + + + + ทั้งหมด {{ total }} รายการ + + + + + + + + + diff --git a/src/modules/14_KPI/interface/response/Main.ts b/src/modules/14_KPI/interface/response/Main.ts index 2d8cea4d2..cc702b947 100644 --- a/src/modules/14_KPI/interface/response/Main.ts +++ b/src/modules/14_KPI/interface/response/Main.ts @@ -39,5 +39,19 @@ interface ResEvaluator { topic: string; type: string; } +interface ResResults { + commanderHighId: string | null; + commanderId: string | null; + createdAt: string; + evaluationResults: string; + evaluationStatus: string; + evaluatorId: string; + firstname: string; + id: string; + kpiPeriodId: string; + lastname: string; + prefix: string; + profileId: string; +} -export type { ResRound, ResDataCapacity, ResEvaluator }; +export type { ResRound, ResDataCapacity, ResEvaluator, ResResults }; diff --git a/src/modules/14_KPI/views/resultsMain.vue b/src/modules/14_KPI/views/resultsMain.vue index e10b62667..c6be1b040 100644 --- a/src/modules/14_KPI/views/resultsMain.vue +++ b/src/modules/14_KPI/views/resultsMain.vue @@ -8,6 +8,7 @@ import config from "@/app.config"; * import type */ import type { ItemsTab } from "@/modules/14_KPI/interface/index/Main"; +import type { ResResults } from "@/modules/14_KPI/interface/response/Main"; /** * import components @@ -23,8 +24,7 @@ import { useCounterMixin } from "@/stores/mixin"; * use */ const $q = useQuasar(); -const { dialogRemove, messageError, showLoader, hideLoader, success } = - useCounterMixin(); +const { messageError, showLoader, hideLoader } = useCounterMixin(); /** * ตัวแปร @@ -34,19 +34,31 @@ const tabItems = ref([ { name: "COMPLETE", label: " รอประกาศผล" }, { name: "KP7", label: "ประกาศผลแล้ว" }, ]); - +const dataList = ref([]); // ข่อมูลรายการ const page = ref(1); const pageSize = ref(10); +const maxPage = ref(1); +const total = ref(1); +const keyword = ref(""); -function fetcDatahList() { +/** + * function fetch รายการประกาศผล + */ +function fetcDataList() { showLoader(); http .post(config.API.evaluationUser, { status: tab.value, page: page.value, pageSize: pageSize.value, + keyword: keyword.value, + }) + .then((res) => { + const data = res.data.result; + dataList.value = data.data; + total.value = data.total; + maxPage.value = Math.ceil(total.value / pageSize.value); }) - .then((res) => {}) .catch((err) => { messageError($q, err); }) @@ -55,14 +67,27 @@ function fetcDatahList() { }); } +/** + * ทำงานเมื่อมีการเปลี่ยน Tab + */ watch(tab, () => { page.value = 1; - pageSize.value = 10; - fetcDatahList(); + keyword.value = ""; + fetcDataList(); }); +/** + * ทำงานเมื่อมีการเปลี่ยนแถวต่อหน้า + */ +watch(pageSize, () => { + fetcDataList(); +}); + +/** + * HooK + */ onMounted(() => { - fetcDatahList(); + fetcDataList(); }); @@ -85,12 +110,30 @@ onMounted(() => { - - + + - - + +