From 07cb81804529846ef715fcf1642323d4d3b86796 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 16 Jul 2024 14:45:51 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=A1=E0=B8=B4=E0=B8=99=E0=B8=9C=E0=B8=A5?= =?UTF-8?q?=20=3D>=20fix=20bug=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../14_KPI/components/Tab/01_Assessment.vue | 2 +- .../14_KPI/components/Tab/04_Result.vue | 8 +- src/modules/14_KPI/views/detailView.vue | 91 +++---------------- 3 files changed, 21 insertions(+), 80 deletions(-) diff --git a/src/modules/14_KPI/components/Tab/01_Assessment.vue b/src/modules/14_KPI/components/Tab/01_Assessment.vue index 5dadefdf7..61e26f8b3 100644 --- a/src/modules/14_KPI/components/Tab/01_Assessment.vue +++ b/src/modules/14_KPI/components/Tab/01_Assessment.vue @@ -216,7 +216,7 @@ onMounted(() => { ]).finally(() => { setTimeout(() => { hideLoader(); - }, 2000); + }, 2500); }); }); diff --git a/src/modules/14_KPI/components/Tab/04_Result.vue b/src/modules/14_KPI/components/Tab/04_Result.vue index 54893b488..a2f529859 100644 --- a/src/modules/14_KPI/components/Tab/04_Result.vue +++ b/src/modules/14_KPI/components/Tab/04_Result.vue @@ -198,8 +198,12 @@ function getData() { } onMounted(() => { - getData(); - fetchEvaluation(); + showLoader(); + Promise.all([fetchEvaluation(), getData()]).finally(() => { + setTimeout(() => { + hideLoader(); + }, 3000); + }); }); diff --git a/src/modules/14_KPI/views/detailView.vue b/src/modules/14_KPI/views/detailView.vue index a397da424..f499aa22d 100644 --- a/src/modules/14_KPI/views/detailView.vue +++ b/src/modules/14_KPI/views/detailView.vue @@ -62,7 +62,14 @@ const isReadonly = (route.name === "KPIEditEvaluator" ? true : false); const store = useKpiDataStore(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, dialogConfirm, success ,findOrgName} = mixin; +const { + showLoader, + hideLoader, + messageError, + dialogConfirm, + success, + findOrgName, +} = mixin; const evaluatorIdOp = ref([]); const commanderIdOp = ref([]); @@ -95,25 +102,15 @@ async function fetchEvaluation() { .then(async (res) => { const data = res.data.result; store.dataEvaluation = await data; - // store.dataProfile = await data; formProfile.status = store.convertStatus(data.evaluationStatus); formProfile.result = store.convertResults(data.evaluationResults); store.checkCompetency(); store.checkCompetencyDefaultCompetencyLevel(); fetchProfile(data.profileId); - - // plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; - // rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; - // specialPoint.value = data.specialPoint == null ? "" : data.specialPoint; - // capacityPoint.value = - // data.capacityPoint == null ? "" : data.capacityPoint; }) .catch((e) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); }); } @@ -173,7 +170,7 @@ function onSubmit() { } async function getOrgOp() { http - .get(config.API.Kpiorg+`/${store.dataProfile.profileId}`) + .get(config.API.Kpiorg + `/${store.dataProfile.profileId}`) .then((res) => { const data = res.data.result; evaluatorIdMainOp.value = data.caregiver.map((i: any) => ({ @@ -242,50 +239,19 @@ function filterOption(val: any, update: Function, refData: string) { } } -// function onSubmitScore() { -// showLoader(); -// http -// .put(config.API.kpiScoreTotal() + `/${id.value}`, { -// plannedPoint: plannedPoint.value, -// rolePoint: rolePoint.value, -// specialPoint: specialPoint.value, -// capacityPoint: capacityPoint.value, -// }) -// .then(async (res) => { -// await fetchEvaluation(); -// success($q, "บันทึกสำเร็จ"); -// modalScore.value = false; -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// } - -// async function clearScore() { -// modalScore.value = false; -// plannedPoint.value = ""; -// rolePoint.value = ""; -// specialPoint.value = ""; -// capacityPoint.value = ""; -// getAll(); -// } async function getProfile() { await http .get(config.API.profilePosition + `/${store.dataEvaluation.profileId}`) .then(async (res) => { const data = await res.data.result; store.dataProfile = await data; - await store.checkStep(); + await setTimeout(() => { + store.checkStep(); + }, 800); }) .catch((e) => { messageError($q, e); }); - // .finally(() => { - // hideLoader(); - // }); } async function getAll() { await fetchEvaluation(); @@ -345,31 +311,7 @@ function sendToEvaluateEvaluatore() { "ต้องการยืนยันส่งให้ผู้ประเมินรายงานผลสำเร็จของงานใช่หรือไม่?" ); } -// function sendToSummary(status: string) { -// dialogConfirm( -// $q, -// () => { -// if (id.value) { -// showLoader(); -// http -// .get(config.API.kpiSendToSummary(id.value)) -// .then((res) => { -// success($q, "ส่งไปสรุปผลการประเมินสำเร็จ"); -// getAll(); -// store.tabMain = "4"; -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(() => { -// hideLoader(); -// }); -// } -// }, -// "ยืนยันการส่งไปสรุปผลการประเมิน", -// "ต้องการยืนยันส่งไปสรุปผลการประเมินใช่หรือไม่?" -// ); -// } + function requireEdit() { dialogConfirm( $q, @@ -494,7 +436,6 @@ async function fetchProfileEvaluator(id: string) { } onMounted(async () => { - store.isUpdate = await false; await getAll(); }); @@ -526,9 +467,6 @@ onMounted(async () => { -
{ color="grey-2" text-color="edit" size="md" - @click="modalEdit = true,getOrgOp()" + @click="(modalEdit = true), getOrgOp()" > {{ store.dataEvaluation.evaluationStatus === "NEW" && @@ -1232,7 +1170,6 @@ onMounted(async () => { --> -