add report form kpi

This commit is contained in:
Warunee Tamkoo 2024-06-27 17:30:50 +07:00
parent 20eaec4c5e
commit cad424140e
3 changed files with 40 additions and 2 deletions

View file

@ -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();

View file

@ -58,7 +58,9 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
const dataEvaluation = ref<any>({
evaluationReqEdit: null,
evaluationResults: null,
evaluationStatus: null,
isOpen: null,
profileId: null,
evaluatorId: null,
commanderId: null,
@ -66,6 +68,17 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
plannedPoint: 0,
rolePoint: 0,
specialPoint: 0,
prefix: "",
firstName: "",
lastName: "",
posExecutiveName: "",
posLevelName: "",
posTypeName: "",
position: "",
summaryPoint: 0,
totalPoint1: 0,
totalPoint2_1: 0,
totalPoint2_2: 0,
});
const competencyType = ref<DataOptions[]>([