Commit bb71bec4 by Nattana Chaiyamat

ประเมินตนเอง

parent d497e4ed
...@@ -209,7 +209,8 @@ ...@@ -209,7 +209,8 @@
<div class="col-span-8">คะแนนรวมหลังถ่วงน้ำ</div> <div class="col-span-8">คะแนนรวมหลังถ่วงน้ำ</div>
<div class="col-span-3 grid grid-cols-5"> <div class="col-span-3 grid grid-cols-5">
<div class="col-span-5 text-center"> <div class="col-span-5 text-center">
{{appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal}}</div> {{showNumber(appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal)}}
</div>
</div> </div>
</div> </div>
<div class="py-2 grid grid-cols-11"> <div class="py-2 grid grid-cols-11">
......
...@@ -44,6 +44,7 @@ export class EvaluationComponent implements OnInit { ...@@ -44,6 +44,7 @@ export class EvaluationComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.getAppraisalCompentencyForm() this.getAppraisalCompentencyForm()
this.getSettingList() this.getSettingList()
this.getEvaluatee()
} }
getEvaluatee() { getEvaluatee() {
...@@ -156,19 +157,19 @@ export class EvaluationComponent implements OnInit { ...@@ -156,19 +157,19 @@ export class EvaluationComponent implements OnInit {
if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) {
switch (numberCheck) { switch (numberCheck) {
case (1): { case (1): {
return +((+(this.setting.data.settingScore1) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck1).toFixed(2)) return this.showNumber((this.setting.data.settingScore1) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck1)
} }
case (2): { case (2): {
return +((+(this.setting.data.settingScore2) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck2).toFixed(2)) return this.showNumber((this.setting.data.settingScore2) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck2)
} }
case (3): { case (3): {
return +((+(this.setting.data.settingScore3) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck3).toFixed(2)) return this.showNumber((this.setting.data.settingScore3) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck3)
} }
case (4): { case (4): {
return +((+(this.setting.data.settingScore4) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck4).toFixed(2)) return this.showNumber((this.setting.data.settingScore4) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck4)
} }
case (5): { case (5): {
return +((+(this.setting.data.settingScore5) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck5).toFixed(2)) return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].numberCheck5)
} }
default: { return } default: { return }
} }
...@@ -178,7 +179,7 @@ export class EvaluationComponent implements OnInit { ...@@ -178,7 +179,7 @@ export class EvaluationComponent implements OnInit {
calWeightTotal() { calWeightTotal() {
if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal = 0 this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal = 0
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal = (this.calWeightScore(1) ?? 0) + (this.calWeightScore(2) ?? 0) + (this.calWeightScore(3) ?? 0) + (this.calWeightScore(4) ?? 0) + (this.calWeightScore(5) ?? 0) this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal = +(((this.calWeightScore(1) ?? 0) + (this.calWeightScore(2) ?? 0) + (this.calWeightScore(3) ?? 0) + (this.calWeightScore(4) ?? 0) + (this.calWeightScore(5) ?? 0)).toFixed(2))
this.cdr.detectChanges() this.cdr.detectChanges()
this.calAverageScore() this.calAverageScore()
} }
...@@ -192,10 +193,9 @@ export class EvaluationComponent implements OnInit { ...@@ -192,10 +193,9 @@ export class EvaluationComponent implements OnInit {
+(this.setting.data.settingScore2), +(this.setting.data.settingScore2),
+(this.setting.data.settingScore1)]) +(this.setting.data.settingScore1)])
const total = length * max const total = length * max
console.log(length)
if (total) { if (total) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore = 0 this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore = 0
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore = (this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal * 100) / total this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore = this.showNumber((this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal * 100) / total)
this.cdr.detectChanges() this.cdr.detectChanges()
} }
} }
...@@ -253,7 +253,7 @@ export class EvaluationComponent implements OnInit { ...@@ -253,7 +253,7 @@ export class EvaluationComponent implements OnInit {
} }
showNumber(text: number | string) { showNumber(text: number | string) {
const num = Number(text); const num = Number(text);
return isNaN(num) ? 0 : +num.toFixed(2); return isNaN(num) ? 0 : +(+num.toFixed(2));
} }
returnPath() { returnPath() {
this.sendReturnPath.emit() this.sendReturnPath.emit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment