From 963839d98b0d1cb84c906d7975ff8365a3038d1c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 11 Jul 2025 17:22:24 +0700 Subject: [PATCH] =?UTF-8?q?fix=20CurrentPage=20=3D=3D=3D>=20=20=E0=B8=AD?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=A3=E0=B8=B2=E0=B8=81=E0=B8=B3=E0=B8=A5?= =?UTF-8?q?=E0=B8=B1=E0=B8=87=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=88=E0=B8=B3?= =?UTF-8?q?=20=E0=B8=AF,=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=8A=E0=B8=B1?= =?UTF-8?q?=E0=B9=88=E0=B8=A7=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/TableMain.vue | 19 ++++++++++++++----- .../20_positionTemp/components/TableMain.vue | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/modules/16_positionEmployee/components/TableMain.vue b/src/modules/16_positionEmployee/components/TableMain.vue index c8298c04a..e01f1cdcd 100644 --- a/src/modules/16_positionEmployee/components/TableMain.vue +++ b/src/modules/16_positionEmployee/components/TableMain.vue @@ -5,6 +5,7 @@ import { useQuasar } from "quasar"; import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational"; import { useCounterMixin } from "@/stores/mixin"; import { checkPermission } from "@/utils/permissions"; +import { updateCurrentPage } from "@/utils/function"; import genreport from "@/plugins/genreportxlsx"; import config from "@/app.config"; import http from "@/plugins/http"; @@ -203,12 +204,20 @@ function onClickDelete(id: string) { await http .delete(config.API.orgPosMasterByIdEmp(id)) .then(async () => { - await props.fetchDataTable?.( - reqMaster.value.id, - reqMaster.value.type, - false + reqMaster.value.page = await updateCurrentPage( + reqMaster.value.page, + totalPage.value, + posMaster.value.length ); - await getSummary(); + + await Promise.all([ + props.fetchDataTable?.( + reqMaster.value.id, + reqMaster.value.type, + false + ), + getSummary(), + ]); success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { diff --git a/src/modules/20_positionTemp/components/TableMain.vue b/src/modules/20_positionTemp/components/TableMain.vue index a58b969fe..c2b47f56e 100644 --- a/src/modules/20_positionTemp/components/TableMain.vue +++ b/src/modules/20_positionTemp/components/TableMain.vue @@ -5,6 +5,7 @@ import { useQuasar } from "quasar"; import { usePositionEmp } from "@/modules/20_positionTemp/store/organizational"; import { useCounterMixin } from "@/stores/mixin"; import { checkPermission } from "@/utils/permissions"; +import { updateCurrentPage } from "@/utils/function"; import genreport from "@/plugins/genreportxlsx"; import config from "@/app.config"; import http from "@/plugins/http"; @@ -204,12 +205,20 @@ function onClickDelete(id: string) { await http .delete(config.API.orgPosMasterByIdEmpTemp(id)) .then(async () => { - await props.fetchDataTable?.( - reqMaster.value.id, - reqMaster.value.type, - false + reqMaster.value.page = await updateCurrentPage( + reqMaster.value.page, + totalPage.value, + posMaster.value.length ); - await getSummary(); + await Promise.all([ + props.fetchDataTable?.( + reqMaster.value.id, + reqMaster.value.type, + false + ), + getSummary(), + ]); + success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => {