ต่อ API ดาวน์โหลดรายงาน
This commit is contained in:
parent
2948ebdc2f
commit
1bdd71d9f2
5 changed files with 124 additions and 9 deletions
|
|
@ -14,6 +14,8 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
|
||||
const maxPage = ref<number>(1);
|
||||
const pagination = ref({
|
||||
page: 1,
|
||||
|
|
@ -138,7 +140,24 @@ function onAdd() {
|
|||
store.statusEdit = false;
|
||||
router.push(`/development/history/add`);
|
||||
}
|
||||
function onDownload() {}
|
||||
function onDownload() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.developmentReportHistory())
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
genReportXLSX(
|
||||
dataList,
|
||||
"รายการประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onEdit(id: string) {
|
||||
store.statusEdit = true;
|
||||
|
|
@ -261,6 +280,7 @@ onMounted(() => {
|
|||
dense
|
||||
icon="mdi-arrow-down-bold-circle-outline"
|
||||
color="blue"
|
||||
@click="onDownload"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue