เพิ่มเส้น report /แก้เปลี่ยนรูป

This commit is contained in:
STW_TTTY\stwtt 2024-09-11 11:41:50 +07:00
parent 895843d60d
commit 5c14d6f631
6 changed files with 42 additions and 61 deletions

View file

@ -80,37 +80,22 @@ 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"
? "ชำนาญการ"
: "ชำนาญการพิเศษ",
},
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);
await http
.get(config.API.evaluateGetReport(id.value))
.then(async (res) => {
const data = res.data.result;
const body = {
template: tp,
reportName: templateName,
data: data,
};
await genReport(body, fileName);
hideLoader();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
}
/** function เปิด popup ติดต่อผู้ขอประเมิน */

View file

@ -64,33 +64,22 @@ 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,
};
await genReport(body, fileName);
await http
.get(config.API.evaluateGetReport(id.value))
.then(async (res) => {
const data = res.data.result;
const body = {
template: tp,
reportName: templateName,
data: data,
};
await genReport(body, fileName);
hideLoader();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
}
/**