From 4b1e21898a6a424a5de7f1342f2754303b023f80 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 26 Apr 2024 12:10:34 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=94=E0=B8=B1=E0=B8=81=E0=B9=84=E0=B8=A1?= =?UTF-8?q?=E0=B9=88=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=AA=E0=B8=A3=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=20kpi=20=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD=E0=B8=81=E0=B8=A3=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=9B=E0=B8=B4=E0=B8=94?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B9=81=E0=B8=A5=E0=B9=89=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/08_KPI/views/main.vue | 42 ++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/modules/08_KPI/views/main.vue b/src/modules/08_KPI/views/main.vue index 0bfd07f..7618c4c 100644 --- a/src/modules/08_KPI/views/main.vue +++ b/src/modules/08_KPI/views/main.vue @@ -77,7 +77,7 @@ const roundDialgOp = ref([]); const modalDialog = ref(false); const yearDialog = ref(null); const formRound = reactive({ - kpiPeriodId: "", + kpiPeriodId: { id: "", name: "", isClosed: false }, profileId: "", prefix: "", firstName: "", @@ -90,6 +90,7 @@ const formQuery = reactive({ pageSize: 10, }); const totalList = ref(1); +const isRoundClose = ref(false); function fetchRoundOption(type: string) { const y = type === "main" ? year.value : yearDialog.value; @@ -108,6 +109,7 @@ function fetchRoundOption(type: string) { : e.durationKPI === "APR" ? "รอบเมษายน" : "", + isClosed: !e.isActive, })); if (type === "main") { roundMainOp.value = list; @@ -115,7 +117,7 @@ function fetchRoundOption(type: string) { fetchList(); } else { roundDialgOp.value = list; - formRound.kpiPeriodId = ""; + formRound.kpiPeriodId = { id: "", name: "", isClosed: false }; } }) .catch((err) => { @@ -162,7 +164,7 @@ function onClickAddList() { function onCloseDialog() { modalDialog.value = false; - formRound.kpiPeriodId = ""; + formRound.kpiPeriodId = { id: "", name: "", isClosed: false }; yearDialog.value = null; } @@ -170,7 +172,13 @@ function onSubmit() { dialogConfirm($q, () => { showLoader(); http - .post(config.API.kpiEvaluation, formRound) + .post(config.API.kpiEvaluation, { + kpiPeriodId: formRound.kpiPeriodId.id, + profileId: formRound.profileId, + prefix: formRound.prefix, + firstName: formRound.firstName, + lastName: formRound.lastName, + }) .then((res) => { console.log(res); const id = res.data.result; @@ -205,6 +213,10 @@ function getProfile() { }); } +function checkClosed() { + isRoundClose.value = formRound.kpiPeriodId.isClosed; +} + const pagination = ref({ sortBy: "desc", descending: false, @@ -399,7 +411,7 @@ onMounted(() => { - + @@ -448,6 +460,7 @@ onMounted(() => {
{ option-label="name" option-value="id" :options="roundDialgOp" - emit-value - map-options hide-bottom-space lazy-rules - :rules="[ - (val:string) => - !!val || `${'กรุณาเลือกรอบการประเมิน'}`, - ]" + :rules="[(val) => !!val.id || `${'กรุณาเลือกรอบการประเมิน'}`]" + @update:model-value="checkClosed" />
- + รอบการประเมินนี้ปิดแล้ว + + + + บันทึกข้อมูล