add report form kpi
This commit is contained in:
parent
20eaec4c5e
commit
cad424140e
3 changed files with 40 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const store = useKpiDataStore();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -194,7 +195,29 @@ function getData() {
|
|||
/**
|
||||
* ฟังก์ชันดาวน์โหลดรายงาน
|
||||
*/
|
||||
function downloadReport() {}
|
||||
async function downloadReport() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.kpiReport(id.value))
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result.data);
|
||||
const data = res.data.result;
|
||||
await genReport(
|
||||
data,
|
||||
"แบบรายงานผลการปฏิบัติราชการ " +
|
||||
store.dataEvaluation.prefix +
|
||||
store.dataEvaluation.fileName +
|
||||
" " +
|
||||
store.dataEvaluation.lastName
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue