From c3d87eaafeac865f1518b30fd3dddb73860bc082 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 26 Aug 2024 11:21:01 +0700 Subject: [PATCH] =?UTF-8?q?KPI=20=3D>=20=20=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=9C=E0=B8=A5=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=9B=E0=B8=8F=E0=B8=B4=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3=20?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/14_KPI/views/round.vue | 49 +++++++++--------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/src/modules/14_KPI/views/round.vue b/src/modules/14_KPI/views/round.vue index ca597053d..d2ea33607 100644 --- a/src/modules/14_KPI/views/round.vue +++ b/src/modules/14_KPI/views/round.vue @@ -126,27 +126,8 @@ const formData = reactive({ year: null, startDate: null, endDate: null, -}); // form เพิ่มรอบการประเมินผลการปฏิบัติหน้าที่ราชการ -const itemMenu = ref([ - // { - // label: "เปิดรอบ", - // value: "open", - // icon: "mdi-check", - // color: "primary", - // }, - { - label: "ปิดรอบ", - value: "close", - icon: "mdi-close", - color: "orange", - }, - { - label: "ลบรอบ", - value: "delete", - icon: "delete", - color: "red", - }, -]); // itemMenu +}); + const roundOp = ref([ { id: "APR", name: "รอบที่ 1 เมษายน" }, { @@ -224,19 +205,20 @@ function clearFormData() { */ function onSubmit() { dialogConfirm($q, async () => { + showLoader(); try { const url = isStatusEdit.value ? config.API.kpiPeriodById("12") : config.API.kpiPeriod; const method = isStatusEdit.value ? "put" : "post"; await http[method](url, formData); - fetchList(); - success($q, "บันทึกข้อมูลสำเร็จ"); + await fetchList(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + closeDialog(); } catch (e) { messageError($q, e); } finally { hideLoader(); - closeDialog(); } }); } @@ -272,9 +254,9 @@ function onOpenRounde(id: string) { () => { http .get(config.API.kpiPeriod + `/open/${id}`) - .then(() => { - fetchList(); - success($q, "เปิดรอบสำเร็จ"); + .then(async () => { + await fetchList(); + await success($q, "เปิดรอบสำเร็จ"); }) .catch((err) => { messageError($q, err); @@ -299,9 +281,9 @@ function onCloseRounde(id: string) { showLoader(); http .get(config.API.kpiPeriod + `/close/${id}`) - .then(() => { - success($q, "ปิดรอบสำเร็จ"); - fetchList(); + .then(async () => { + await fetchList(); + await success($q, "ปิดรอบสำเร็จ"); }) .catch((err) => { messageError($q, err); @@ -324,9 +306,9 @@ function onDeleteRound(id: string) { showLoader(); http .delete(config.API.kpiPeriodById(id)) - .then(() => { - success($q, "ลบข้อมูลสำเร็จ"); - fetchList(); + .then(async () => { + await fetchList(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); @@ -532,7 +514,6 @@ onMounted(() => { > ลบรอบ -