From d010529aafd2012568db0950de81333f559afa6d Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 28 Feb 2025 10:05:39 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=20=3D=3D>=20=E0=B8=82=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB?= =?UTF-8?q?=E0=B8=99=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GovernmentInformation/07_Position.vue | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue index eab68205e..f250c2cbb 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/07_Position.vue @@ -307,7 +307,6 @@ const cardData = ref([ /** function fetch รายการ ตำแหน่งเงินเดือน*/ async function fetchListSalary() { - showLoader(); await http .get( config.API.profileListSalaryPositionNew(profileId.value, empType.value) @@ -318,9 +317,6 @@ async function fetchListSalary() { }) .catch((err) => { messageError($q, err); - }) - .finally(() => { - hideLoader(); }); } @@ -553,13 +549,13 @@ function onSubmit() { : config.API.profileSalaryPositionNew(empType.value); const method = isStatusEdit.value ? "patch" : "post"; await http[method](url, formData); - await onClickCloseDialog(); await fetchListSalary(); + await onClickCloseDialog(); success($q, "บันทึกข้อมูลสำเร็จ"); } catch (e) { messageError($q, e); - hideLoader(); } finally { + hideLoader(); } }); } @@ -753,9 +749,16 @@ async function fetchDataTenure() { } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ -onMounted(() => { - fetchListSalary(); - empType.value === "" && fetchDataTenure(); +onMounted(async () => { + try { + showLoader(); + await Promise.all([ + fetchListSalary(), + empType.value === "" ? fetchDataTenure() : Promise.resolve(), + ]); + } finally { + hideLoader(); + } });