From e58c87fc724f5cbc64fa4d9bfbc9939e82286aee Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 29 Aug 2023 15:22:27 +0700 Subject: [PATCH] no message --- .../components/resign/ResignByid.vue | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index 6589aa4cc..462b46e2e 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -126,7 +126,6 @@ onMounted(async () => { } else { roleUser.value = "admin"; } - console.log(roleUser.value); } }); @@ -181,6 +180,37 @@ const fetchData = async (id: string) => { hideLoader(); }); }; +const rowsFileDownload = ref([ + { fileName: "หนังสือลาออกจากราขการ", pathName: "" }, +]); +const downloadAttachment = async (type: string, id: string) => { + showLoader(); + await http + .get(config.API.reportResignList(type, id), { + responseType: "blob", + }) + .then(async (res) => { + const data = res.data.result; + console.log(data); + let list: TypeFile[] = []; + downloadFile(res, `หนังสือลาออกจากราขการ.${type}`); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; +const downloadFile = (response: any, filename: string) => { + const link = document.createElement("a"); + var fileName = filename; + link.href = window.URL.createObjectURL(new Blob([response.data])); + link.setAttribute("download", fileName); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); +}; const popUp = (action: "pass" | "passNot") => { reasonReign.value = ""; @@ -522,7 +552,9 @@ const statusOrder = (val: boolean) => {
-
แบบฟอร์มหนังสือขอลาออกจากราชการ
+
+ แบบฟอร์มหนังสือขอลาออกจากราชการ +
@@ -542,10 +574,24 @@ const statusOrder = (val: boolean) => { {{ props.row.fileName }} - + ดาวน์โหลด - + ไฟล์ WORD @@ -1069,7 +1115,7 @@ const statusOrder = (val: boolean) => { -import CurrencyInput from "@/components/CurruncyInput.vue"; +