From 722794a27ee25fff2e2f655aa2f7af8b4ebd4323 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 16 Aug 2024 11:12:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=B1=E0=B8=95=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=81=E0=B8=B3=E0=B8=A5=E0=B8=B1=E0=B8=87=E0=B8=A5=E0=B8=B9?= =?UTF-8?q?=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=88=E0=B8=B3=20=E0=B8=AF=20=3D>=20fix=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogFormPosition.vue | 10 ++++-- .../components/DialogFormPosition.vue | 34 ++++++++++++------- .../components/DialogMovePos.vue | 6 ++-- .../components/DialogSelectPerson.vue | 10 +++--- .../components/TreeTable.vue | 18 ++++++---- 5 files changed, 49 insertions(+), 29 deletions(-) diff --git a/src/modules/02_organization/components/DialogFormPosition.vue b/src/modules/02_organization/components/DialogFormPosition.vue index f0197b7fe..b2c0c9e52 100644 --- a/src/modules/02_organization/components/DialogFormPosition.vue +++ b/src/modules/02_organization/components/DialogFormPosition.vue @@ -841,7 +841,10 @@ async function emitSearch(keyword: string, typeSelect: string) { icon="mdi-dots-horizontal-circle-outline" round > - + - + { - success($q, "ลบข้อมูลสำเร็จ"); - searchInput(); + .then(async () => { + await searchInput(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); @@ -629,11 +633,14 @@ watch( - + - + {{ diff --git a/src/modules/16_positionEmployee/components/DialogMovePos.vue b/src/modules/16_positionEmployee/components/DialogMovePos.vue index f66c63d11..12b58e8fd 100644 --- a/src/modules/16_positionEmployee/components/DialogMovePos.vue +++ b/src/modules/16_positionEmployee/components/DialogMovePos.vue @@ -123,10 +123,10 @@ function onClickMovePos() { showLoader(); await http .post(config.API.orgPosMoveEmp, body) - .then(() => { - props.fetchDataTree?.(store.activeId); + .then(async () => { + await props.fetchDataTree?.(store.activeId); + await success($q, "ย้ายตำแหน่งสำเร็จ"); modal.value = false; - success($q, "ย้ายตำแหน่งสำเร็จ"); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue index cf254922b..76e9525bd 100644 --- a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue +++ b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue @@ -4,7 +4,7 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; -/** +/** * importType */ import type { QTableProps } from "quasar"; @@ -279,10 +279,10 @@ function onSubmit() { showLoader(); http .post(config.API.orgProfileEmp, body) - .then(() => { - props.fetchDataTable?.(store.treeId, store.level, false); - props.getSummary(); - success($q, "บันทึกข้อมูลสำเร็จ"); + .then(async () => { + await props.fetchDataTable?.(store.treeId, store.level, false); + await props.getSummary(); + await success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/16_positionEmployee/components/TreeTable.vue b/src/modules/16_positionEmployee/components/TreeTable.vue index 403a6581d..0820911df 100644 --- a/src/modules/16_positionEmployee/components/TreeTable.vue +++ b/src/modules/16_positionEmployee/components/TreeTable.vue @@ -193,10 +193,14 @@ function onClickDelete(id: string) { showLoader(); await http .delete(config.API.orgPosMasterByIdEmp(id)) - .then(() => { + .then(async () => { + await props.fetchDataTable?.( + reqMaster.value.id, + reqMaster.value.type, + false + ); + await getSummary(); success($q, "ลบข้อมูลสำเร็จ"); - props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false); - getSummary(); }) .catch((err) => { messageError($q, err); @@ -262,14 +266,14 @@ function removePerson(id: string) { showLoader(); await http .post(config.API.orgDeleteProfileEmp(id)) - .then(() => { - success($q, "ลบข้อมูลสำเร็จ"); - props.fetchDataTable?.( + .then(async () => { + await props.fetchDataTable?.( reqMaster.value.id, reqMaster.value.type, false ); - getSummary(); + await getSummary(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err);