fill report 10 evaluate

This commit is contained in:
Kittapath 2023-12-23 19:51:59 +07:00
parent 14ccbcfe62
commit dd5614a0c0
2 changed files with 58 additions and 5 deletions

View file

@ -36,6 +36,7 @@ const fileEvaluation83 = ref<any>();
const fileEvaluation84 = ref<any>();
const fileEvaluation85 = ref<any>();
const fileEvaluation86 = ref<any>();
const profile = ref<any>();
async function onClickDowloadFile(
tp: string,
@ -43,11 +44,21 @@ async function onClickDowloadFile(
fileName: string
) {
showLoader();
const data = Object.assign(
{ fullName: profile.value == null ? "" : profile.value.fullName },
{ position: profile.value == null ? "" : profile.value.position },
{ positionLevel: profile.value == null ? "" : profile.value.positionLevel },
{ posNo: profile.value == null ? "" : profile.value.posNo },
{ oc: profile.value == null ? "" : profile.value.oc },
{ birthDate: profile.value == null ? "" : date2Thai(profile.value.birthDate) },
{ govAge: profile.value == null ? "" : profile.value.govAge },
{ positionLevelNew: profile.value == null ? "" : (profile.value.type == "EXPERT"? "ชำนาญการ":"ชำนาญการพิเศษ")}
);
const body = {
template: tp,
reportName: templateName,
data:{}
data: data,
};
await genReport(body, fileName);
}
@ -185,8 +196,24 @@ function nextStep(){
});
}
async function fetchProfile() {
showLoader();
await http
.get(config.API.evaluateGetDetail(id.value))
.then((res) => {
const data = res.data.result;
profile.value =data
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(()=>{
fetchProfile()
})
</script>