diff --git a/src/modules/18_command/components/Main/TableMain.vue b/src/modules/18_command/components/Main/TableMain.vue index 3c74b9f78..9667a7a63 100644 --- a/src/modules/18_command/components/Main/TableMain.vue +++ b/src/modules/18_command/components/Main/TableMain.vue @@ -6,6 +6,7 @@ import { useRouter } from "vue-router"; import { checkPermission } from "@/utils/permissions"; import { useCounterMixin } from "@/stores/mixin"; import { useCommandListStore } from "@/modules/18_command/store/ListStore"; +import { updateCurrentPage } from "@/utils/function"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -83,6 +84,11 @@ function onReCommand(id: string) { await http .put(config.API.commandAction(id, "resume")) .then(async () => { + page.value = await updateCurrentPage( + page.value, + store.maxPage, + store.rows.length + ); await fetchListCommand(); success($q, "ดึงไปทำคำสั่งใหม่สำเร็จ"); }) @@ -105,6 +111,11 @@ function onDeleteCommand(id: string) { await http .delete(config.API.command + `/${id}`) .then(async () => { + page.value = await updateCurrentPage( + page.value, + store.maxPage, + store.rows.length + ); await fetchListCommand(); success($q, "ลบรายการสำเร็จ"); })