fix CurrentPage ===> รายการคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-15 13:59:18 +07:00
parent 28c3c2273f
commit 07338cdb63

View file

@ -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, "ลบรายการสำเร็จ");
})