add report form kpi
This commit is contained in:
parent
20eaec4c5e
commit
cad424140e
3 changed files with 40 additions and 2 deletions
|
|
@ -45,7 +45,8 @@ export default {
|
|||
kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`,
|
||||
kpiSendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
|
||||
kpiSendToGet: (id: string) => `${kpiEvaluation}/reason/${id}`,
|
||||
kpiSendToReason: (id: string,type:string) => `${kpiEvaluation}/reason/${type}/${id}`,
|
||||
kpiSendToReason: (id: string, type: string) =>
|
||||
`${kpiEvaluation}/reason/${type}/${id}`,
|
||||
kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`,
|
||||
/**ประเมิน*/
|
||||
kpiAchievementDevelop: `${kpiAchievement}/development`,
|
||||
|
|
@ -59,4 +60,5 @@ export default {
|
|||
sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
|
||||
updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`,
|
||||
openPoint: (id: string) => `${kpiEvaluation}/open/${id}`,
|
||||
kpiReport: (id: string) => `${kpiEvaluation}/report/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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[]>([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue