diff --git a/src/modules/09_leave/views/04_SpecialTimeMain.vue b/src/modules/09_leave/views/04_SpecialTimeMain.vue index fde61f269..8aaaee5a9 100644 --- a/src/modules/09_leave/views/04_SpecialTimeMain.vue +++ b/src/modules/09_leave/views/04_SpecialTimeMain.vue @@ -12,7 +12,6 @@ import { checkPermission } from "@/utils/permissions"; import type { DataDateMonthObject, DetailData, - Pagination, } from "@/modules/09_leave/interface/request/specialTime"; import DialogReason from "@/components/Dialogs/PopupReason.vue"; @@ -28,6 +27,7 @@ const { showLoader, success, date2Thai, + dialogConfirm, } = mixin; const emit = defineEmits(["update:change-page"]); const rows = ref([]); @@ -191,23 +191,25 @@ function closeDialog() { /** API reject */ async function clickSave(reason: string) { - showLoader(); - modalUnapprove.value = false; - const body = { - reason: reason, - }; - await http - .put(config.API.specialTimeReject(id.value), body) - .then(async () => { - await fetchData(); - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); + dialogConfirm($q, async () => { + showLoader(); + modalUnapprove.value = false; + const body = { + reason: reason, + }; + await http + .put(config.API.specialTimeReject(id.value), body) + .then(async () => { + await fetchData(); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }); } /** @@ -473,6 +475,7 @@ onMounted(async () => { " >อนุมัติ +