download xlsx
This commit is contained in:
parent
c06306a171
commit
998e654eb4
2 changed files with 18 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import genReportXLSX from '@/plugins/genreportxlsx'
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
|
|
@ -178,6 +178,20 @@ function onClickDelete(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function clickDownload(){
|
||||
showLoader()
|
||||
http
|
||||
.get(config.API.salaryReportByid(salaryId.value))
|
||||
.then((res)=>{
|
||||
const dataList = res.data.result
|
||||
genReportXLSX(dataList,'อัตราเงินเดือน')
|
||||
})
|
||||
.catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
onMounted(async () => {
|
||||
await fetchListSalalyRate();
|
||||
});
|
||||
|
|
@ -218,8 +232,8 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
|||
<q-tooltip>เพิ่มอัตราเงินเดือน </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-btn outline label="พิมพ์เอกสาร" icon="print" color="green" />
|
||||
<q-btn outline label="ดาว์นโหลด" icon="download" color="blue" />
|
||||
<!-- <q-btn outline label="พิมพ์เอกสาร" icon="print" color="green" /> -->
|
||||
<q-btn outline label="ดาวน์โหลด" icon="download" color="blue" @click="clickDownload()"/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue