fixing report insignia
This commit is contained in:
parent
832db7c582
commit
a87e0bd015
1 changed files with 29 additions and 5 deletions
|
|
@ -290,12 +290,14 @@ function backPage() {
|
|||
}
|
||||
}
|
||||
|
||||
function downloadReport(type: string) {
|
||||
function downloadReport(type: string, download: "docx" | "" | "xlsx" = "") {
|
||||
const fileName =
|
||||
optionReport.value.find((e) => e.id === typeReport.value.id)?.name || "";
|
||||
|
||||
if (type === "xlsx") {
|
||||
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);
|
||||
}
|
||||
|
|
@ -335,20 +337,42 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
:loading="isLoadPDF"
|
||||
:disable="!nodeId || !employeeClass || !roundId"
|
||||
:disable="!nodeId || !employeeClass || (!roundId && !roundId2)"
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="downloadReport('pdf')">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
downloadReport(
|
||||
'pdf',
|
||||
typeReport.val != 'report1' ||
|
||||
typeReport.val != 'report2' ||
|
||||
typeReport.val != 'report3'
|
||||
? 'xlsx'
|
||||
: 'docx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadReport('docx')">
|
||||
<q-item
|
||||
v-if="
|
||||
typeReport.val == 'report1' ||
|
||||
typeReport.val == 'report2' ||
|
||||
typeReport.val == 'report3'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport('docx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue