diff --git a/src/modules/04_registryNew/views/detailView.vue b/src/modules/04_registryNew/views/detailView.vue index 05b45bc7b..f3373b405 100644 --- a/src/modules/04_registryNew/views/detailView.vue +++ b/src/modules/04_registryNew/views/detailView.vue @@ -11,7 +11,7 @@ import type { DataPerson } from "@/modules/04_registryNew/interface/response/Mai import avatar from "@/assets/avatar_user.jpg"; import TabMain from "@/modules/04_registryNew/components/detail/TabMain.vue"; import UploadFile from "@/modules/11_discipline/components/UploadFile.vue"; -import { ResponseObject } from "../interface/response/Profile"; +import type { ResponseObject } from "@/modules/04_registryNew/interface/response/Profile"; import DialogHeader from "@/components/DialogHeader.vue"; /** ถึงเเก่กรรม */ const dialogPassaway = ref(false); @@ -33,7 +33,7 @@ const { messageError, success, date2Thai, - dateToISO + dateToISO, } = mixin; const profileId = ref(route.params.id.toString()); @@ -181,7 +181,7 @@ async function helpPost() { router.push("/help-government"); }); }); -}; +} /** ส่งตัวกลับ */ async function repatriationPost() { @@ -202,7 +202,7 @@ async function repatriationPost() { router.push("/repatriate"); }); }); -}; +} /** แต่งตังเลื่อน */ async function appointPost() { @@ -223,12 +223,12 @@ async function appointPost() { router.push("/appoint-promote"); }); }); -}; +} /** ถึงเเก่กรรม */ async function clickPassaway() { dialogPassaway.value = true; -}; +} /** ให้ออกจากราชการ */ async function outPost() { @@ -249,10 +249,10 @@ async function outPost() { router.push("/dismiss-order"); }); }); -}; +} /** อื่นๆ */ -async function otherPost(){ +async function otherPost() { const formData = new FormData(); formData.append("id", profileId.value); dialogConfirm($q, async () => { @@ -270,11 +270,11 @@ async function otherPost(){ router.push("/other"); }); }); -}; +} function closePassaway() { dialogPassaway.value = false; -}; +} async function clickSaveDeceased() { const formData = new FormData(); @@ -285,18 +285,9 @@ async function clickSaveDeceased() { formData.append("Reason", reasonDeath.value); formData.append("ProfileId", profileId.value); - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - showLoader(); - await http + dialogConfirm($q,()=>{ + showLoader(); + http .post(config.API.listDeceased(), formData) .then(() => { success($q, "บันทึกข้อมูลสำเร็จ"); @@ -308,10 +299,8 @@ async function clickSaveDeceased() { .finally(() => { hideLoader(); }); - }) - .onCancel(() => { }) - .onDismiss(() => { }); -}; + }) +} onMounted(async () => { fileName.value = `profile-${profileId.value}`; @@ -323,25 +312,61 @@ onMounted(async () => { + \ No newline at end of file