แก้ report

This commit is contained in:
STW_TTTY\stwtt 2024-09-11 12:00:14 +07:00
parent 54cfdd2f9b
commit bdd59fbd0b
2 changed files with 4 additions and 74 deletions

View file

@ -123,82 +123,11 @@ async function onClickDowloadFile(
fileName: string
) {
showLoader();
let educations: any = [];
if (profile.value != null) {
profile.value.educations.map((e: any) => {
educations.push({
educationLevel: e.educationLevel ?? "",
finishYear:
e.finishDate == null
? ""
: new Date(e.finishDate).getFullYear() + 543,
institute: e.institute ?? "",
});
});
}
let certificates: any = [];
if (profile.value != null) {
profile.value.certificates.map((e: any) => {
certificates.push({
certificateNo: e.certificateNo ?? "",
certificateType: e.certificateType ?? "",
issuer: e.issuer ?? "",
});
});
}
let salaries: any = [];
if (profile.value != null) {
profile.value.salaries.map((e: any) => {
salaries.push({
date: e.date == null ? "" : date2Thai(new Date(e.date)),
position: e.position ?? "",
amount: e.amount ?? "",
});
});
}
let trainings: any = [];
if (profile.value != null) {
profile.value.trainings.map((e: any) => {
trainings.push({
yearly: e.yearly ?? "",
startDate: e.startDate == null ? "" : date2Thai(new Date(e.startDate)),
endDate: e.endDate == null ? "" : date2Thai(new Date(e.endDate)),
name: e.name ?? "",
topic: e.topic ?? "",
});
});
}
const data = Object.assign(
{ educations: educations },
{ certificates: certificates },
{ salaries: salaries },
{ trainings: trainings },
{ 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,
tp === "EV1_007" ? { positionName: "-" } : null,
tp === "EV1_007" ? { positionLeaveName: "-" } : null
);
const body = {
template: tp,
reportName: templateName,
data: data,
data: profile.value,
};
await genReport(body, fileName); //
}
@ -308,7 +237,7 @@ function fetcheSigner(id: string) {
async function fetchCheckSpec(id: string) {
showLoader();
await http
.get(config.API.evaluationCheckspecByid(id))
.get(config.API.evaluationReportCheckspecByid(id))
.then((res) => {
const data = res.data.result;
profile.value = data;