From 30871f95c8c152f0c095760f80fd50ad5a475d0a Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Thu, 22 Aug 2024 13:08:09 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81=20downlo?= =?UTF-8?q?ad=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/resign/ResignByid.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index 4a6e2c3ef..5d9ac5070 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -24,6 +24,8 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; /** importComponents*/ import CardProfile from "@/components/CardProfile.vue"; +import genReport from "@/plugins/genreport"; + const modalPersonal = ref(false); const personId = ref(""); /** Use */ @@ -398,18 +400,17 @@ const rowsFileDownload = ref([ const fileDownload = async (type: string, fileName: string) => { showLoader(); await http - .get(config.API.reportResignList(type, id.value), { - responseType: "blob", - }) + .get(config.API.reportResignList(type, id.value)) .then(async (res) => { - downloadFile(res, `${fileName}.${type}`); + const data = res.data.result; + await genReport(data, `${fileName}`, type); + hideLoader(); }) .catch(async (e) => { messageError($q, JSON.parse(await e.response.data.text())); - }) - .finally(() => { hideLoader(); - }); + }) + .finally(() => {}); }; // ดาว์นโหลดไฟล์