fix query kpi9
This commit is contained in:
parent
50776ec3e6
commit
16c3504f74
1 changed files with 14 additions and 12 deletions
|
|
@ -1173,6 +1173,19 @@ export class ReportController extends Controller {
|
|||
if (requestBody.type == "KPI9") {
|
||||
templateName = "KPI9";
|
||||
reportName = "KPI9";
|
||||
const userEvaluations_ = data.kpiUserEvaluations.length > 0
|
||||
? data.kpiUserEvaluations
|
||||
.filter((x: any) => x.evaluationResults == "EXCELLENT" || x.evaluationResults == "VERY_GOOD")
|
||||
.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)
|
||||
: "",
|
||||
}))
|
||||
: [{}]
|
||||
formattedData = {
|
||||
root:
|
||||
data?.kpiUserEvaluations != null && data?.kpiUserEvaluations.length > 0
|
||||
|
|
@ -1180,18 +1193,7 @@ export class ReportController extends Controller {
|
|||
: "-",
|
||||
period: data?.durationKPI == "APR" ? "๑" : data?.durationKPI == "OCT" ? "๒" : "-",
|
||||
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)
|
||||
: "",
|
||||
}))
|
||||
: [{}],
|
||||
userEvaluations: userEvaluations_.length > 0 ? userEvaluations_ : [{}],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue