From 1b060856c168e48178cfc516fadfeb54d247dd35 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 17 Jun 2024 16:01:54 +0700 Subject: [PATCH] =?UTF-8?q?KPI=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/14_KPI/api.KPI.ts | 2 +- .../14_KPI/components/Tab/01_Assessment.vue | 24 +- src/modules/14_KPI/components/Tab/TabMain.vue | 15 +- src/modules/14_KPI/interface/index/Main.ts | 15 +- src/modules/14_KPI/interface/response/KPI.ts | 27 + src/modules/14_KPI/router.ts | 104 +-- src/modules/14_KPI/views/detail.vue | 3 +- src/modules/14_KPI/views/detailView.vue | 700 ++++++++++++++++++ 8 files changed, 773 insertions(+), 117 deletions(-) create mode 100644 src/modules/14_KPI/interface/response/KPI.ts create mode 100644 src/modules/14_KPI/views/detailView.vue diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index 902d5b476..57a521266 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -68,7 +68,7 @@ export default { kpiLink, - profilePosition: () => `${env.API_URI}/org/profile/keycloak/position`, + profilePosition: () => `${env.API_URI}/org/profile/profileid/position`, /** Report*/ kpiReport: () => `${KPI}/report/announcement`, diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue index f4a73105b..460465566 100644 --- a/src/modules/14_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -199,14 +199,22 @@ watch( } ); -onMounted(() => { - getCriteria(); - fetchListPlanned(); - fetchListRole(); - fetchAssigned(); - setTimeout(() => { - hideLoader(); - }, 1000); +onMounted(async () => { + showLoader(); + try { + await Promise.all([ + getCriteria(), + fetchListPlanned(), + fetchListRole(), + fetchAssigned(), + ]); + } catch (err) { + messageError($q, err); + } finally { + setTimeout(() => { + hideLoader(); + }, 4000); + } }); diff --git a/src/modules/14_KPI/components/Tab/TabMain.vue b/src/modules/14_KPI/components/Tab/TabMain.vue index 645a44c3f..78e97ad3b 100644 --- a/src/modules/14_KPI/components/Tab/TabMain.vue +++ b/src/modules/14_KPI/components/Tab/TabMain.vue @@ -43,14 +43,6 @@ const splitterModel = ref(12); class="text-grey-7 text-weight-light" active-class="bg-blue-1 text-blue-8 text-weight-bold" > - (12); label="รายงานผลสำเร็จของงาน" :disable="store.tabOpen < 3" /> - + diff --git a/src/modules/14_KPI/interface/index/Main.ts b/src/modules/14_KPI/interface/index/Main.ts index e0114d8f9..6ed8b34ab 100644 --- a/src/modules/14_KPI/interface/index/Main.ts +++ b/src/modules/14_KPI/interface/index/Main.ts @@ -2,6 +2,10 @@ interface DataOption { id: string; name: string; } +interface ItemsTab { + label: string; + name: string; +} interface ItemsMenu { label: string; @@ -61,4 +65,13 @@ interface FormData { qualification: string; } -export type { DataOption, ItemsMenu,NewPagination,typeOp,ResponsePreson,tableType,FormData }; +export type { + DataOption, + ItemsMenu, + NewPagination, + typeOp, + ResponsePreson, + tableType, + FormData, + ItemsTab, +}; diff --git a/src/modules/14_KPI/interface/response/KPI.ts b/src/modules/14_KPI/interface/response/KPI.ts new file mode 100644 index 000000000..952de3b9f --- /dev/null +++ b/src/modules/14_KPI/interface/response/KPI.ts @@ -0,0 +1,27 @@ +interface ResUserEvaluation { + capacityPoint: null; + commanderHighId: null | string; + commanderId: null | string; + createdAt: string; + durationKPI: string; + evaluationReqEdit: null | string; + evaluationResults: string; + evaluationStatus: string; + evaluatorId: string; + firstName: string; + id: string; + kpiPeriodId: string; + lastName: string; + plannedPoint: null | string; + posExecutiveName: null | string; + posLevelName: string; + posTypeName: string; + position: string; + prefix: string; + profileId: string; + rolePoint: null | string; + specialPoint: null | string; + year: number; +} + +export type { ResUserEvaluation }; diff --git a/src/modules/14_KPI/router.ts b/src/modules/14_KPI/router.ts index 2b8312b23..79c2d697e 100644 --- a/src/modules/14_KPI/router.ts +++ b/src/modules/14_KPI/router.ts @@ -13,6 +13,7 @@ const roundPage = () => import("@/modules/14_KPI/views/round.vue"); const listPage = () => import("@/modules/14_KPI/views/list.vue"); const detailPage = () => import("@/modules/14_KPI/views/detail.vue"); const reportPage = () => import("@/modules/14_KPI/views/report.vue"); +const detailView = () => import("@/modules/14_KPI/views/detailView.vue"); export default [ { @@ -25,97 +26,7 @@ export default [ Role: "evaluateKPI", }, }, - // { - // path: "/KPI-indicator-plan", - // name: "KPIIndicatorByPlan", - // component: IndicatorByPlan, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-indicator-plan/add", - // name: "KPIIndicatorByPlan/Add", - // component: IndicatorByPlanDetail, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-indicator-plan/:id", - // name: "KPIIndicatorByPlanByid", - // component: IndicatorByPlanDetail, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-indicator-role", - // name: "KPIIndicatorByRole", - // component: IndicatorByRole, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-indicator-role/add", - // name: "KPIIndicatorByRoleAdd", - // component: IndicatorByRoleDetail, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-indicator-role/:id", - // name: "KPIIndicatorByRoleByid", - // component: IndicatorByRoleDetail, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-competency", - // name: "KPICompetency", - // component: competencyPage, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-competency/add", - // name: "KPICompetencyAdd", - // component: competencyAddPage, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, - // { - // path: "/KPI-competency/:id", - // name: "KPICompetencyByid", - // component: competencyAddPage, - // meta: { - // Auth: true, - // Key: [1.1], - // Role: "evaluateKPI", - // }, - // }, { path: "/KPI-list", name: "KPI​List", @@ -129,7 +40,7 @@ export default [ { path: "/KPI-list/:id", name: "KPIDetail", - component: detailPage, + component: detailView, meta: { Auth: true, Key: [1.1], @@ -146,4 +57,15 @@ export default [ Role: "evaluateKPI", }, }, + + { + path: "/KPI-list/new/:id", + name: "KPIDetailnew", + component: detailView, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, ]; diff --git a/src/modules/14_KPI/views/detail.vue b/src/modules/14_KPI/views/detail.vue index e9cc7831d..324e79c47 100644 --- a/src/modules/14_KPI/views/detail.vue +++ b/src/modules/14_KPI/views/detail.vue @@ -59,14 +59,13 @@ async function fetchEvaluation() { .get(config.API.kpiUserEvaluation + `/${id.value}`) .then(async (res) => { const data = await res.data.result; - store.dataEvaluation = await data; formProfile.status = store.convertStatus(data.evaluationStatus); formProfile.result = store.convertResults(data.evaluationResults); await store.checkCompetency(); await store.checkCompetencyDefaultCompetencyLevel(); - fetchProfile(data.profileId); + await fetchProfile(data.profileId); plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; diff --git a/src/modules/14_KPI/views/detailView.vue b/src/modules/14_KPI/views/detailView.vue new file mode 100644 index 000000000..fc7e36080 --- /dev/null +++ b/src/modules/14_KPI/views/detailView.vue @@ -0,0 +1,700 @@ + + + + +