รายการลาออก download file

This commit is contained in:
STW_TTTY\stwtt 2024-08-22 13:08:09 +07:00
parent c014962eed
commit 30871f95c8

View file

@ -24,6 +24,8 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
/** importComponents*/ /** importComponents*/
import CardProfile from "@/components/CardProfile.vue"; import CardProfile from "@/components/CardProfile.vue";
import genReport from "@/plugins/genreport";
const modalPersonal = ref<boolean>(false); const modalPersonal = ref<boolean>(false);
const personId = ref<string>(""); const personId = ref<string>("");
/** Use */ /** Use */
@ -398,18 +400,17 @@ const rowsFileDownload = ref<rowFile[]>([
const fileDownload = async (type: string, fileName: string) => { const fileDownload = async (type: string, fileName: string) => {
showLoader(); showLoader();
await http await http
.get(config.API.reportResignList(type, id.value), { .get(config.API.reportResignList(type, id.value))
responseType: "blob",
})
.then(async (res) => { .then(async (res) => {
downloadFile(res, `${fileName}.${type}`); const data = res.data.result;
await genReport(data, `${fileName}`, type);
hideLoader();
}) })
.catch(async (e) => { .catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text())); messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader(); hideLoader();
}); })
.finally(() => {});
}; };
// //