download รายงานพ้นจากราชการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-09 17:55:17 +07:00
parent 7e93f611c5
commit 4c8c2280ff

View file

@ -9,6 +9,7 @@ import { useStructureTree } from "@/stores/structureTree";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import genReportXLSX from "@/plugins/genreportxlsx";
import type { DataStructureTree } from "@/interface/main";
import type {
@ -60,6 +61,8 @@ const dateEnd = ref<Date>(
new Date(dateMonth.value.year, dateMonth.value.month + 1, 0)
);
const detailReport = ref<any>();
/** View*/
const isLoadPDF = ref<boolean>(false);
const numOfPages = ref<number>(0);
@ -123,6 +126,7 @@ function fetchDataReport() {
})
.then(async (res) => {
const data = await res.data.result;
detailReport.value = data;
await fetchDocumentTemplate(data);
})
.catch((err) => {
@ -210,6 +214,7 @@ onMounted(() => {
</q-select>
<q-space />
<q-btn
:loading="isLoadPDF"
flat
@ -217,6 +222,12 @@ onMounted(() => {
color="primary"
icon="download"
:disable="!reportType || !nodeId"
@click.stop.pervent="
genReportXLSX(
detailReport,
`${optionReport.find((e) => e.id === reportType)?.name}`
)
"
>
</q-btn>
</div>