From 4a37317debb864364c6817b5b45033f13aa2ffae Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 19 Nov 2024 11:05:29 +0700 Subject: [PATCH] =?UTF-8?q?fixbug=20=3D=3D>=20=E0=B9=80=E0=B8=9E=E0=B8=B4?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=E0=B9=80=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=A3=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B9=80=E0=B8=A3?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Complaint/Form.vue | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 7cbfd831f..aeda613a6 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -220,9 +220,10 @@ async function getActive() { }) .catch((err) => { messageError($q, err); - hideLoader(); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } else { await getOc(formData.activeId); } @@ -230,6 +231,7 @@ async function getActive() { /** ดึงข้อมูลหน่วยงานจาก api */ async function getOc(activeId: string) { + showLoader(); await http .get(config.API.orgByIdSystem(activeId, route.meta.Key as string)) .then(async (res) => { @@ -242,7 +244,9 @@ async function getOc(activeId: string) { .catch((err) => { messageError($q, err); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } /** @@ -257,9 +261,8 @@ function deletePerson(id: string) { } /** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/ - -async function getListChannel() { - await http +function getListChannel() { + http .get( config.API.complaintListOp( mainStore.pathComplaintsChannal(route.name as string) @@ -267,6 +270,9 @@ async function getListChannel() { ) .then((res) => { channelOptions.value = res.data.result.data; + }) + .catch((err) => { + messageError($q, err); }); } @@ -377,8 +383,7 @@ watch(props.data, async () => { /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ onMounted(async () => { mainStore.rowsAdd = []; - await getActive(); - await getListChannel(); + await Promise.all([getActive(), getListChannel()]); });