ผูก API ประเมินในส่วนของเอกสารต้นแบบใน step 2 (ADMIN)

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-14 16:27:19 +07:00
parent 11a95acabd
commit 082d53ee3b

View file

@ -1,5 +1,21 @@
<script setup lang="ts">
import { ref } from "vue";
import keycloak from "@/plugins/keycloak";
import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const fullName = ref<string>(
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
);
const fileEvaluation1 = ref<any>();
const fileEvaluation2 = ref<any>();
@ -31,6 +47,28 @@ function backPage() {
page.value--;
}
}
async function onClickDowloadFile(
tp: string,
templateName: string,
fileName: string
) {
showLoader();
const data = Object.assign(
{ fullName: fullName.value },
tp === "EV1_005" || tp === "EV1_007"
? { organizationName: "หน่วยงาน" }
: null,
tp === "EV1_007" ? { positionName: "ตำแหน่ง" } : null,
tp === "EV1_007" ? { positionLeaveName: "ระดับ" } : null
);
const body = {
template: tp,
reportName: templateName,
data: data,
};
await genReport(body, fileName);
}
</script>
<template>
@ -52,6 +90,13 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_005',
'template-1',
'แบบพิจารณาคุณสมบัติบุคคล'
)
"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
@ -112,6 +157,13 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_006',
'template-2',
'แบบแสดงรายละเอียดการเสนอผลงาน'
)
"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
@ -171,6 +223,13 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_007',
'template-3',
'แบบตรวจสอบความถูกต้องครบถ้วนของข้อมูลเพื่อประกอบการคัดเลือกบุคคล'
)
"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
@ -230,6 +289,13 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_008',
'template-4',
'แบบประเมินคุณลักษณะบุคคล'
)
"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
@ -289,7 +355,15 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_009',
'template-5',
'แบบสรุปข้อมูลของผู้ขอรับการคัดเลือก'
)
"
>
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>
</div>
@ -348,6 +422,13 @@ function backPage() {
icon="download"
label="ดาวน์โหลดต้นแบบ"
color="primary"
@click="
onClickDowloadFile(
'EV1_010',
'template-6',
'ผลงานที่จะส่งประเมิน'
)
"
>
<q-tooltip> ดาวนโหลดตนแบบ </q-tooltip></q-btn
>