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

@ -29,6 +29,7 @@ const id = ref<string>(route.params.id as string);
const fullName = ref<string>(
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
);
const profile = ref<any>();
const messenger = ref<string>("");
const title = ref<string>("");
const modalEvaluation = ref<boolean>(false);
@ -76,7 +77,14 @@ async function onClickDowloadFile(
) {
showLoader();
const data = Object.assign(
{ fullName: fullName.value },
{ 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"? "ชำนาญการ":"ชำนาญการพิเศษ")},
tp === "EV1_005" || tp === "EV1_007"
? { organizationName: "หน่วยงาน" }
: null,
@ -278,6 +286,23 @@ function checkDoc10() {
.finally(() => {
hideLoader();
});
fetchProfile()
}
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(() => {
@ -342,7 +367,7 @@ onMounted(() => {
color="primary"
@click="
onClickDowloadFile(
'EV1_008',
'เอกสารหมายเลข 10',
'template-4',
'แบบประเมินคุณลักษณะบุคคล'
)
@ -396,7 +421,8 @@ onMounted(() => {
</div>
</q-card>
</div>
<div v-if="store.currentStep == 4" class="col-12">
<!-- v-if="store.currentStep == 4" -->
<div class="col-12">
<div class="q-mt-xs q-gutter-md" align="right">
<q-btn label="ติดต่อผู้ขอประเมิน" color="info" @click="openPopUp" />
<q-btn

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>