filter ทะเบียนประวัติ
This commit is contained in:
parent
bd64e91628
commit
8db24538e0
4 changed files with 25 additions and 24 deletions
|
|
@ -196,6 +196,8 @@ async function onUpdateFilter() {
|
|||
) {
|
||||
isLoadPDF.value = true;
|
||||
pdfSrc.value = undefined;
|
||||
numOfPages.value = 1;
|
||||
detailReport.value = null;
|
||||
|
||||
await http
|
||||
.post(
|
||||
|
|
@ -222,6 +224,8 @@ async function onUpdateFilter() {
|
|||
} else if (roundId2.value && nodeId.value) {
|
||||
isLoadPDF.value = true;
|
||||
pdfSrc.value = undefined;
|
||||
numOfPages.value = 1;
|
||||
detailReport.value = null;
|
||||
|
||||
await http
|
||||
.post(
|
||||
|
|
@ -236,7 +240,6 @@ async function onUpdateFilter() {
|
|||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
detailReport.value = data;
|
||||
|
||||
await fetchDocumentTemplate(data, "xlsx");
|
||||
})
|
||||
.catch(async (e) => {
|
||||
|
|
@ -294,12 +297,14 @@ function downloadReport(type: string, download: "docx" | "" | "xlsx" = "") {
|
|||
const fileName =
|
||||
optionReport.value.find((e) => e.id === typeReport.value.id)?.name || "";
|
||||
|
||||
if (type === "xlsx" && download === "") {
|
||||
genReportXLSX(detailReport.value, fileName, type);
|
||||
} else if (type === "pdf" && download === "xlsx") {
|
||||
genReportXLSX(detailReport.value, fileName, "pdf");
|
||||
} else {
|
||||
genReport(detailReport.value, fileName, type);
|
||||
if (detailReport.value) {
|
||||
if (type === "xlsx" && download === "") {
|
||||
genReportXLSX(detailReport.value, fileName, type);
|
||||
} else if (type === "pdf" && download === "xlsx") {
|
||||
genReportXLSX(detailReport.value, fileName, "pdf");
|
||||
} else {
|
||||
genReport(detailReport.value, fileName, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -333,6 +338,7 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
|
|
@ -350,9 +356,9 @@ onMounted(async () => {
|
|||
@click="
|
||||
downloadReport(
|
||||
'pdf',
|
||||
typeReport.val != 'report1' ||
|
||||
typeReport.val != 'report2' ||
|
||||
typeReport.val != 'report3'
|
||||
!['report1', 'report2', 'report3'].includes(
|
||||
typeReport.val
|
||||
)
|
||||
? 'xlsx'
|
||||
: 'docx'
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue