fix ไม่แสดงรอบ/ตารางไม่แสดงแถวแรก
This commit is contained in:
parent
b6fd61aad5
commit
fb41b66bf9
1 changed files with 66 additions and 66 deletions
|
|
@ -72,7 +72,7 @@ export class ReportController extends Controller {
|
|||
})
|
||||
dataKpiUserEvaluations = await this.kpiUserEvaluationRepository.find({
|
||||
where: {
|
||||
kpiPeriodId: String(requestBody.periodId),
|
||||
kpiPeriodId: requestBody.periodId,
|
||||
orgId: requestBody.root
|
||||
}
|
||||
})
|
||||
|
|
@ -89,11 +89,10 @@ export class ReportController extends Controller {
|
|||
period1 = `${Extension.ToThaiFullDate2(data.startDate)} ถึง ${Extension.ToThaiFullDate2(data.endDate)}`
|
||||
let _period2 = await this.kpiPeriodRepository.findOne({
|
||||
where: {
|
||||
year: data.year, durationKPI: "OCR", isActive: true
|
||||
year: data.year, durationKPI: "OCT", isActive: true
|
||||
}
|
||||
});
|
||||
period2 = _period2 ? `${Extension.ToThaiFullDate2(_period2?.startDate)} ถึง ${Extension.ToThaiFullDate2(_period2?.endDate)}` : ""
|
||||
|
||||
}
|
||||
else if(data.durationKPI == "OCT"){
|
||||
period2 = `${Extension.ToThaiFullDate2(data.startDate)} ถึง ${Extension.ToThaiFullDate2(data.endDate)}`
|
||||
|
|
@ -142,26 +141,26 @@ export class ReportController extends Controller {
|
|||
: "๐"
|
||||
/*END ROOT*/
|
||||
formattedData = {
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "",
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "-",
|
||||
period1: Extension.ToThaiNumber(period1),
|
||||
period2: Extension.ToThaiNumber(period2),
|
||||
durationKPI: data?.durationKPI,
|
||||
root: data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
? data?.kpiUserEvaluations[0].orgEvaluator
|
||||
: "",
|
||||
: "-",
|
||||
userEvaluations: [
|
||||
{
|
||||
no: "๑",
|
||||
no: userEvaluationOrg.length > 0 ? "๑" : "",
|
||||
root: userEvaluationOrg.length > 0
|
||||
? userEvaluationOrg[0].orgEvaluator ?? ""
|
||||
: "",
|
||||
resultAll: resultAll,
|
||||
result: result,
|
||||
excellent: excellent,
|
||||
verygood: verygood,
|
||||
good: good,
|
||||
fair: fair,
|
||||
improvment: improvment,
|
||||
: "-",
|
||||
resultAll: userEvaluationOrg.length > 0 ? resultAll : "",
|
||||
result: userEvaluationOrg.length > 0 ? result : "",
|
||||
excellent: userEvaluationOrg.length > 0 ? excellent : "",
|
||||
verygood: userEvaluationOrg.length > 0 ? verygood : "",
|
||||
good: userEvaluationOrg.length > 0 ? good : "",
|
||||
fair: userEvaluationOrg.length > 0 ? fair : "",
|
||||
improvment: userEvaluationOrg.length > 0 ? improvment : "",
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -169,77 +168,77 @@ export class ReportController extends Controller {
|
|||
if (requestBody.type == "KPI2") {
|
||||
templateName = "KPI2";
|
||||
reportName = "KPI2";
|
||||
const excellent = data.length > 0
|
||||
? data.fla((x:any, idx:number) => ({
|
||||
const excellent = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x:any, idx:number) => ({
|
||||
no: Extension.ToThaiNumber((idx+1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
org: x.org ? x.org : "",
|
||||
})).filter((x:any) => x.evaluationResults == "EXCELLENT")
|
||||
: []
|
||||
const verygood = data.length > 0
|
||||
? data.map((x:any, idx:number) => ({
|
||||
: [{}]
|
||||
const verygood = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x:any, idx:number) => ({
|
||||
no: Extension.ToThaiNumber((idx+1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
org: x.org ? x.org : "",
|
||||
})).filter((x:any) => x.evaluationResults == "VERY_GOOD")
|
||||
: []
|
||||
const good = data.length > 0
|
||||
? data.map((x:any, idx:number) => ({
|
||||
: [{}]
|
||||
const good = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x:any, idx:number) => ({
|
||||
no: Extension.ToThaiNumber((idx+1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
org: x.org ? x.org : "",
|
||||
})).filter((x:any) => x.evaluationResults == "GOOD")
|
||||
: []
|
||||
const fair = data.length > 0
|
||||
? data.map((x:any, idx:number) => ({
|
||||
: [{}]
|
||||
const fair = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x:any, idx:number) => ({
|
||||
no: Extension.ToThaiNumber((idx+1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
org: x.org ? x.org : "",
|
||||
})).filter((x:any) => x.evaluationResults == "FAIR")
|
||||
: []
|
||||
const improvment = data.length > 0
|
||||
? data.map((x:any, idx:number) => ({
|
||||
: [{}]
|
||||
const improvment = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x:any, idx:number) => ({
|
||||
no: Extension.ToThaiNumber((idx+1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
org: x.org ? x.org : "",
|
||||
})).filter((x:any) => x.evaluationResults == "IMPROVEMENT")
|
||||
: []
|
||||
: [{}]
|
||||
formattedData = {
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "",
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "-",
|
||||
period1: Extension.ToThaiNumber(period1),
|
||||
period2: Extension.ToThaiNumber(period2),
|
||||
durationKPI: data?.durationKPI,
|
||||
root: data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
? data?.kpiUserEvaluations[0].orgEvaluator
|
||||
: "",
|
||||
: "-",
|
||||
excellents: {
|
||||
count: Extension.ToThaiNumber(excellent.length.toString()),
|
||||
count: data.kpiUserEvaluations.length > 0 ? Extension.ToThaiNumber(excellent.length.toString()) : "",
|
||||
data: excellent
|
||||
},
|
||||
verygoods: {
|
||||
count: Extension.ToThaiNumber(verygood.length.toString()),
|
||||
count: data.kpiUserEvaluations.length > 0 ? Extension.ToThaiNumber(verygood.length.toString()) : "",
|
||||
data: verygood
|
||||
},
|
||||
goods: {
|
||||
count: Extension.ToThaiNumber(good.length.toString()),
|
||||
count: data.kpiUserEvaluations.length > 0 ? Extension.ToThaiNumber(good.length.toString()) : "",
|
||||
data: good
|
||||
},
|
||||
fairs: {
|
||||
count: Extension.ToThaiNumber(fair.length.toString()),
|
||||
count: data.kpiUserEvaluations.length > 0 ? Extension.ToThaiNumber(fair.length.toString()) : "",
|
||||
data: fair
|
||||
},
|
||||
improvments: {
|
||||
count: Extension.ToThaiNumber(improvment.length.toString()),
|
||||
count: data.kpiUserEvaluations.length > 0 ? Extension.ToThaiNumber(improvment.length.toString()) : "",
|
||||
data: improvment
|
||||
},
|
||||
}
|
||||
|
|
@ -259,18 +258,18 @@ export class ReportController extends Controller {
|
|||
point5: x.summaryPoint < 60.00 ? Extension.ToThaiNumber(x.summaryPoint.toString()) : "",
|
||||
remark: ""
|
||||
}))
|
||||
: []
|
||||
: [{}]
|
||||
// const prefixEvaluator_ = data.kpiUserEvaluations.find((x:any) => x.prefixEvaluator);
|
||||
// const firstNameEvaluator_ = data.kpiUserEvaluations.firstNameEvaluator ? data.kpiUserEvaluations.firstNameEvaluator : "";
|
||||
// const lastNameEvaluator_ = data.kpiUserEvaluations.lastNameEvaluator ? data.kpiUserEvaluations.lastNameEvaluator : "";
|
||||
formattedData = {
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "",
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "-",
|
||||
period1: Extension.ToThaiNumber(period1),
|
||||
period2: Extension.ToThaiNumber(period2),
|
||||
durationKPI: data?.durationKPI,
|
||||
root: data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
? data?.kpiUserEvaluations[0].orgEvaluator
|
||||
: "",
|
||||
: "-",
|
||||
fullNameEvaluator: "-",
|
||||
positionEvaluator: "-",
|
||||
posTypeNameEvaluator: "-",
|
||||
|
|
@ -310,27 +309,27 @@ export class ReportController extends Controller {
|
|||
templateName = "KPI7";
|
||||
reportName = "KPI7";
|
||||
formattedData = {
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "",
|
||||
year: data?.year ? Extension.ToThaiNumber((data.year+543).toString()) : "-",
|
||||
period1: Extension.ToThaiNumber(period1),
|
||||
period2: Extension.ToThaiNumber(period2),
|
||||
durationKPI: data?.durationKPI,
|
||||
root: data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
? data?.kpiUserEvaluations[0].orgEvaluator
|
||||
: "",
|
||||
userEvaluations: data.kpiUserEvaluations.map((x: any, idx: number) => ({
|
||||
no: Extension.ToThaiNumber((idx + 1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
developName: x.topicEvaluator ? x.topicEvaluator : "",
|
||||
developEvaluator: x.developEvaluator ? x.developEvaluator : "",
|
||||
target: "", //เป้าหมาย
|
||||
timeEvaluator: x.timeEvaluator ? x.timeEvaluator : "",
|
||||
developResults: "", //วิธีการวัดผลการพัฒนา
|
||||
evaluationResults: x.evaluationResults
|
||||
? Extension.EvaluationResult(x.evaluationResults)
|
||||
: "",
|
||||
})),
|
||||
: "-",
|
||||
userEvaluations: data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x: any, idx: number) => ({
|
||||
no: Extension.ToThaiNumber((idx + 1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
developName: x.topicEvaluator ? x.topicEvaluator : "",
|
||||
developEvaluator: x.developEvaluator ? x.developEvaluator : "",
|
||||
target: "", //เป้าหมาย
|
||||
timeEvaluator: x.timeEvaluator ? x.timeEvaluator : "",
|
||||
developResults: "", //วิธีการวัดผลการพัฒนา
|
||||
evaluationResults: x.evaluationResults ? Extension.EvaluationResult(x.evaluationResults) : "",
|
||||
}))
|
||||
: [{}],
|
||||
}
|
||||
}
|
||||
if (requestBody.type == "KPI8") {
|
||||
|
|
@ -344,18 +343,19 @@ export class ReportController extends Controller {
|
|||
formattedData = {
|
||||
root: data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
? data?.kpiUserEvaluations[0].orgEvaluator
|
||||
: "",
|
||||
: "-",
|
||||
period: data?.durationKPI == "APR" ? "๑": data?.durationKPI == "OCT" ? "๒" : "-",
|
||||
year: Extension.ToThaiNumber((data.year+543).toString()),
|
||||
userEvaluations: data.kpiUserEvaluations.map((x: any, idx: number) => ({
|
||||
no: Extension.ToThaiNumber((idx + 1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
evaluationResults: x.evaluationResults
|
||||
? Extension.EvaluationResult(x.evaluationResults)
|
||||
: "",
|
||||
})),
|
||||
year: data.year ? Extension.ToThaiNumber((data.year+543).toString()) : "-",
|
||||
userEvaluations: data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations.map((x: any, idx: number) => ({
|
||||
no: Extension.ToThaiNumber((idx + 1).toString()),
|
||||
fullName: `${x.prefix}${x.firstName} ${x.lastName}`,
|
||||
position: x.position ? x.position : "",
|
||||
posLevelName: x.posLevelName ? x.posLevelName : "",
|
||||
evaluationResults: x.evaluationResults ? Extension.EvaluationResult(x.evaluationResults) : "",
|
||||
}))
|
||||
: [{}]
|
||||
,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue