ต่อ API ดาวน์โหลดรายงาน
This commit is contained in:
parent
2948ebdc2f
commit
1bdd71d9f2
5 changed files with 124 additions and 9 deletions
|
|
@ -2,6 +2,7 @@ import env from "../index";
|
||||||
const development = `${env.API_URI}/development`;
|
const development = `${env.API_URI}/development`;
|
||||||
const developmentOrg = `${env.API_URI}/org`;
|
const developmentOrg = `${env.API_URI}/org`;
|
||||||
const devScholarship = `${env.API_URI}/development/scholarship`;
|
const devScholarship = `${env.API_URI}/development/scholarship`;
|
||||||
|
const developmentReport = `${env.API_URI}/development/report`;
|
||||||
export default {
|
export default {
|
||||||
development,
|
development,
|
||||||
/** history */
|
/** history */
|
||||||
|
|
@ -20,4 +21,9 @@ export default {
|
||||||
devScholarship,
|
devScholarship,
|
||||||
devScholarshipByid: (id: string) => `${devScholarship}/${id}`,
|
devScholarshipByid: (id: string) => `${devScholarship}/${id}`,
|
||||||
|
|
||||||
|
/** download File */
|
||||||
|
developmentReportMain:() =>`${developmentReport}/main`,
|
||||||
|
developmentReportHistory:() =>`${developmentReport}/history-officer`,
|
||||||
|
developmentReportHistoryOfficer:() =>`${developmentReport}/history-employee`,
|
||||||
|
developmentReportScholarship:() =>`${developmentReport}/scholarship`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -129,7 +131,25 @@ function onAdd() {
|
||||||
store.statusEdit = false;
|
store.statusEdit = false;
|
||||||
router.push(`/development/employee-history/add`);
|
router.push(`/development/employee-history/add`);
|
||||||
}
|
}
|
||||||
function onDownload() {}
|
function onDownload() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.developmentReportHistoryOfficer())
|
||||||
|
.then((res) => {
|
||||||
|
const dataList = res.data.result;
|
||||||
|
genReportXLSX(
|
||||||
|
dataList,
|
||||||
|
"รายการประวัติฝึกอบรม/ดูงานลูกจ้าง"
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function onEdit(id: string) {
|
function onEdit(id: string) {
|
||||||
store.statusEdit = true;
|
store.statusEdit = true;
|
||||||
|
|
@ -255,6 +275,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
color="blue"
|
color="blue"
|
||||||
|
@click="onDownload"
|
||||||
>
|
>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -138,7 +140,24 @@ function onAdd() {
|
||||||
store.statusEdit = false;
|
store.statusEdit = false;
|
||||||
router.push(`/development/history/add`);
|
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) {
|
function onEdit(id: string) {
|
||||||
store.statusEdit = true;
|
store.statusEdit = true;
|
||||||
|
|
@ -261,6 +280,7 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
color="blue"
|
color="blue"
|
||||||
|
@click="onDownload"
|
||||||
>
|
>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { useRouter } from "vue-router";
|
||||||
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";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
|
|
@ -60,20 +62,20 @@ const visibleColumns = ref<string[]>(["year", "projectName", "org"]);
|
||||||
/** เมนูดาวน์โหลด*/
|
/** เมนูดาวน์โหลด*/
|
||||||
const itemDownload = ref<ItemsMenu[]>([
|
const itemDownload = ref<ItemsMenu[]>([
|
||||||
{
|
{
|
||||||
label: "ดาวน์โหลด 1",
|
label: "Excel",
|
||||||
value: "",
|
value: "EXCEL",
|
||||||
icon: "mdi-file-pdf-box",
|
icon: "mdi-file-pdf-box",
|
||||||
color: "green",
|
color: "green",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "ดาวน์โหลด 2",
|
label: "ดาวน์โหลด 2",
|
||||||
value: "",
|
value: "PDF",
|
||||||
icon: "mdi-file-table",
|
icon: "mdi-file-table",
|
||||||
color: "red",
|
color: "red",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "ดาวน์โหลด 3",
|
label: "ดาวน์โหลด 3",
|
||||||
value: "",
|
value: "WORD",
|
||||||
icon: "mdi-file-word",
|
icon: "mdi-file-word",
|
||||||
color: "blue",
|
color: "blue",
|
||||||
},
|
},
|
||||||
|
|
@ -143,6 +145,25 @@ function fetchListProjectNew() {
|
||||||
fetchListProject();
|
fetchListProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onDownload() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.developmentReportMain())
|
||||||
|
.then((res) => {
|
||||||
|
const dataList = res.data.result;
|
||||||
|
genReportXLSX(
|
||||||
|
dataList,
|
||||||
|
"รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด"
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListProject();
|
fetchListProject();
|
||||||
});
|
});
|
||||||
|
|
@ -217,6 +238,16 @@ onMounted(() => {
|
||||||
<div class="row q-gutter-sm">
|
<div class="row q-gutter-sm">
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
|
color="blue"
|
||||||
|
@click="onDownload"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<!-- <q-btn
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="blue"
|
color="blue"
|
||||||
|
|
@ -224,7 +255,13 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 100px" dense>
|
<q-list style="min-width: 100px" dense>
|
||||||
<q-item clickable v-close-popup v-for="items in itemDownload">
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
v-for="items in itemDownload"
|
||||||
|
:key="items.value"
|
||||||
|
@click="onDownload(items.value)"
|
||||||
|
>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-icon :color="items.color" :name="items.icon" />
|
<q-icon :color="items.color" :name="items.icon" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
@ -235,7 +272,7 @@ onMounted(() => {
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { useRouter } from "vue-router";
|
||||||
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 type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
ItemsDownload,
|
ItemsDownload,
|
||||||
|
|
@ -182,6 +184,25 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function onDownload() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.developmentReportScholarship())
|
||||||
|
.then((res) => {
|
||||||
|
const dataList = res.data.result;
|
||||||
|
genReportXLSX(
|
||||||
|
dataList,
|
||||||
|
"รายการข้าราชการฯที่ได้รับทุนการศึกษา/ฝึกอบรม"
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchList();
|
fetchList();
|
||||||
});
|
});
|
||||||
|
|
@ -260,6 +281,16 @@ onMounted(() => {
|
||||||
<div class="row q-gutter-sm">
|
<div class="row q-gutter-sm">
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
|
color="blue"
|
||||||
|
@click="onDownload"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<!-- <q-btn
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="blue"
|
color="blue"
|
||||||
|
|
@ -278,7 +309,7 @@ onMounted(() => {
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue