From 4d29976a8cfa1d0e4f7df0752b0c3d0c3d8dfe94 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 29 Jan 2025 14:48:48 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20kpi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/08_KPI/views/form.vue | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 2c09199..2caa87f 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -220,7 +220,7 @@ function filterOption(val: string, update: Function, refData: string) { /** ดึงข้อมูลทั้งหมดในหน้า */ async function getAll() { - await Promise.all([fetchEvaluation(), getOrgOp()]); + await Promise.all([fetchEvaluation(), getOrgOp(), getProfile()]); await store.checkStep(); } @@ -459,6 +459,19 @@ async function fetchProfileEvaluator(id: string) { }); } +/** ดึงข้อมูลโปรไฟล์ */ +async function getProfile() { + await http + .get(config.API.profilePosition()) + .then(async (res) => { + const data = await res.data.result; + store.dataProfile = await data; + }) + .catch((e) => { + messageError($q, e); + }); +} + onMounted(async () => { showLoader(); store.isUpdate = false; @@ -545,8 +558,7 @@ onMounted(async () => { store.indicatorWeightTotal != 100) || ((store.dataEvaluation.posTypeName == 'อำนวยการ' || store.dataEvaluation.posTypeName == 'บริหาร') && - (store.indicatorWeight1Total != 100 || - store.indicatorWeight2Total != 20))) + store.indicatorWeightTotal != 100)) " class="text-red" >*น้ำหนัก(ร้อยละ) ผลสัมฤทธิ์ของงานไม่ถูกต้อง { store.dataEvaluation.evaluationStatus == 'NEW' " :disabled=" - (store.dataEvaluation.posTypeName != 'อำนวยการ' && - store.dataEvaluation.posTypeName != 'บริหาร' && + ((store.dataEvaluation.posTypeName != 'อำนวยการ' || + store.dataEvaluation.posTypeName != 'บริหาร') && store.indicatorWeightTotal != 100) || ((store.dataEvaluation.posTypeName == 'อำนวยการ' || store.dataEvaluation.posTypeName == 'บริหาร') && - (store.indicatorWeight1Total != 100 || - store.indicatorWeight2Total != 20)) + store.indicatorWeightTotal != 100) " unelevated round