diff --git a/src/modules/09_leave/components/3_Report/DetailReport.vue b/src/modules/09_leave/components/3_Report/DetailReport.vue index 0ebda31dd..f1b04a802 100644 --- a/src/modules/09_leave/components/3_Report/DetailReport.vue +++ b/src/modules/09_leave/components/3_Report/DetailReport.vue @@ -218,13 +218,18 @@ async function genReport(data: any) { }, responseType: "blob", }) - .then((res) => { + .then(async (res) => { const blob = new Blob([res.data]); const objectUrl = URL.createObjectURL(blob); console.log(blob); - pdfSrc.value = objectUrl; - console.log(pdfSrc.value); + const pdfData = await usePDF(`${objectUrl}`); + showLoader(); + setTimeout(() => { + pdfSrc.value = pdfData.pdf.value; + numOfPages.value = pdfData.pages.value; + hideLoader(); + }, 1500); }) .catch((err) => { messageError($q, err);