fix
This commit is contained in:
parent
4120aee9f2
commit
5ad5857df4
2 changed files with 44 additions and 11 deletions
|
|
@ -255,7 +255,12 @@ onMounted(async () => {
|
||||||
/></q-item-section>
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-close-popup @click="downloadReport('xlsx')">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="downloadReport('xlsx')"
|
||||||
|
v-if="typeReport !== 'report1'"
|
||||||
|
>
|
||||||
<q-item-section avatar
|
<q-item-section avatar
|
||||||
><q-icon color="green" name="mdi-file-excel"
|
><q-icon color="green" name="mdi-file-excel"
|
||||||
/></q-item-section>
|
/></q-item-section>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import { checkPermission } from "@/utils/permissions";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
import genReportDocx from "@/plugins/genreport";
|
||||||
|
|
||||||
import type { DataStructureTree } from "@/interface/main";
|
import type { DataStructureTree } from "@/interface/main";
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -260,6 +261,16 @@ function getCurrentWeek() {
|
||||||
return [firstDayOfWeek, lastDayOfWeek];
|
return [firstDayOfWeek, lastDayOfWeek];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function downloadReport(type: string) {
|
||||||
|
const fileName =
|
||||||
|
typeReport.value === "1" ? "รายงานการเข้างาน" : "รายงานการเข้างานสาย";
|
||||||
|
// if (type === "pdf") {
|
||||||
|
// genReportDocx(detailReport.value, fileName, type);
|
||||||
|
// } else {
|
||||||
|
genReportXLSX(detailReport.value, fileName, type);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchDataTree();
|
fetchDataTree();
|
||||||
});
|
});
|
||||||
|
|
@ -291,6 +302,16 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
|
<!-- @click.stop.pervent="
|
||||||
|
genReportXLSX(
|
||||||
|
detailReport,
|
||||||
|
`${
|
||||||
|
typeReport === '1'
|
||||||
|
? 'รายงานการเข้างาน'
|
||||||
|
: 'รายงานการเข้างานสาย'
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
" -->
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsGet"
|
v-if="checkPermission($route)?.attrIsGet"
|
||||||
|
|
@ -300,17 +321,24 @@ onMounted(() => {
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="download"
|
icon="download"
|
||||||
@click.stop.pervent="
|
|
||||||
genReportXLSX(
|
|
||||||
detailReport,
|
|
||||||
`${
|
|
||||||
typeReport === '1'
|
|
||||||
? 'รายงานการเข้างาน'
|
|
||||||
: 'รายงานการเข้างานสาย'
|
|
||||||
}`
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
|
<q-menu>
|
||||||
|
<q-list style="min-width: 150px">
|
||||||
|
<q-item clickable v-close-popup @click="downloadReport('pdf')">
|
||||||
|
<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('xlsx')">
|
||||||
|
<q-item-section avatar
|
||||||
|
><q-icon color="green" name="mdi-file-excel"
|
||||||
|
/></q-item-section>
|
||||||
|
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue