diff --git a/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue b/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue index c80f81b0d..2f773e5e1 100644 --- a/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue +++ b/src/modules/06_retirement/components/01_retirement/RetirementDetail.vue @@ -172,7 +172,6 @@ async function fetchlistprofile(id: string) { isSignDate.value = data.signDate ? true : false; // รายชื่อผู้เกษียณอายุราชการ - const listData = data.profile && data.profile.map((e: any) => ({ @@ -212,10 +211,11 @@ async function fetchlistprofile(id: string) { rows.value = listData; rowsData.value = listData; - hideLoader(); }) .catch((e) => { messageError($q, e); + }) + .finally(() => { hideLoader(); }); } @@ -229,8 +229,7 @@ async function fecthCheck(id: string) { }) .catch((e) => { messageError($q, e); - }) - .finally(() => {}); + }); } // DelProfile @@ -253,7 +252,7 @@ function clickDelete() { .catch((e) => { messageError($q, e); }) - .finally(async () => { + .finally(() => { hideLoader(); }); }, @@ -333,10 +332,15 @@ async function uploadFile(event: any, date: any) { config.API.fileRetirement(retireld.value.toString()), formdata ) - .then(async (res) => { + .then(async () => { await fetchlistprofile(retireld.value); + success( + $q, + isUploadFile.value + ? "เพิ่มไฟล์สำเร็จ" + : "แก้ไขวันที่ประกาศสำเร็จ" + ); modalUpload.value = false; - success($q, "เพิ่มไฟล์สำเร็จ"); fileUpload.value = null; signDate.value = null; }) @@ -347,8 +351,12 @@ async function uploadFile(event: any, date: any) { hideLoader(); }); }, - "ยืนยันการอัปโหลดเอกสาร", - "ต้องการยืนยันการอัปโหลดเอกสารนี้หรือไม่ ?" + isUploadFile.value + ? "ยืนยันการอัปโหลดเอกสาร" + : "ยืนยันการแก้ไขวันที่ประกาศ", + isUploadFile.value + ? "ต้องการยืนยันการอัปโหลดเอกสารนี้หรือไม่ ?" + : "ต้องการยืนยันการแก้ไขวันที่ประกาศนี้หรือไม่ ?" ); } });