Commit 75f423e8 by Nattana Chaiyamat

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

parent 302f8fe6
...@@ -173,7 +173,6 @@ import { PmsInformationComponent } from '../performance-evaluation/pms-form-empl ...@@ -173,7 +173,6 @@ import { PmsInformationComponent } from '../performance-evaluation/pms-form-empl
import { PmsCompetencyComponent } from '../performance-evaluation/pms-form-employee/pms-competency/pms-competency.component'; import { PmsCompetencyComponent } from '../performance-evaluation/pms-form-employee/pms-competency/pms-competency.component';
import { PmsKpiComponent } from '../performance-evaluation/pms-form-employee/pms-kpi/pms-kpi.component'; import { PmsKpiComponent } from '../performance-evaluation/pms-form-employee/pms-kpi/pms-kpi.component';
import { PmsIdpComponent } from '../performance-evaluation/pms-form-employee/pms-idp/pms-idp.component'; import { PmsIdpComponent } from '../performance-evaluation/pms-form-employee/pms-idp/pms-idp.component';
import { PmsSummaryComponent } from '../performance-evaluation/pms-form-employee/pms-summary/pms-summary.component';
import { BarRatingModule } from 'ngx-bar-rating'; import { BarRatingModule } from 'ngx-bar-rating';
import { EmployeeSelfServiceComponent } from '../employee-self-service/employee-self-service.component'; import { EmployeeSelfServiceComponent } from '../employee-self-service/employee-self-service.component';
import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component'; import { MySkillXModuleComponent } from '../my-skill-x-module/my-skill-x-module.component';
...@@ -337,7 +336,6 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -337,7 +336,6 @@ export class CustomDateAdapter extends NativeDateAdapter {
PmsCompetencyComponent, PmsCompetencyComponent,
PmsKpiComponent, PmsKpiComponent,
PmsIdpComponent, PmsIdpComponent,
PmsSummaryComponent,
EmployeeSelfServiceComponent, EmployeeSelfServiceComponent,
MySkillXModuleComponent, MySkillXModuleComponent,
DashboardEvaluationComponent, DashboardEvaluationComponent,
......
...@@ -220,19 +220,19 @@ ...@@ -220,19 +220,19 @@
<div class="col-span-8">รวมจำนวนเครื่องหมายแต่ละช่อง (1)</div> <div class="col-span-8">รวมจำนวนเครื่องหมายแต่ละช่อง (1)</div>
<div class="col-span-3 grid grid-cols-5"> <div class="col-span-3 grid grid-cols-5">
<div class="col-span-1 text-center"> <div class="col-span-1 text-center">
{{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5}} {{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5Boss}}
</div> </div>
<div class="col-span-1 text-center"> <div class="col-span-1 text-center">
{{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4}} {{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4Boss}}
</div> </div>
<div class="col-span-1 text-center"> <div class="col-span-1 text-center">
{{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3}} {{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3Boss}}
</div> </div>
<div class="col-span-1 text-center"> <div class="col-span-1 text-center">
{{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2}} {{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2Boss}}
</div> </div>
<div class="col-span-1 text-center"> <div class="col-span-1 text-center">
{{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1}} {{appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1Boss}}
</div> </div>
</div> </div>
</div> </div>
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<div class="py-2 grid grid-cols-11"> <div class="py-2 grid grid-cols-11">
<div class="col-span-8">ถ่วงน้ำหนักผลรวม 1X2</div> <div class="col-span-8">ถ่วงน้ำหนักผลรวม 1X2</div>
<div class="col-span-3 grid grid-cols-5"> <div class="col-span-3 grid grid-cols-5">
<div class="col-span-1 text-center" *ngFor="let item of [5,4,3,2,1]">{{calWeightScore(item)}}</div> <div class="col-span-1 text-center" *ngFor="let item of [5,4,3,2,1]">{{calWeightScoreBoss(item)}}</div>
</div> </div>
</div> </div>
<div class="py-2 grid grid-cols-11"> <div class="py-2 grid grid-cols-11">
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</div> </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 text-indigo-600 font-semibold"> <div class="col-span-5 text-center text-indigo-600 font-semibold">
{{showNumber(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotal)}} {{showNumber(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalBoss)}}
</div> </div>
</div> </div>
</div> </div>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</div> </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 text-indigo-600 font-semibold"> <div class="col-span-5 text-center text-indigo-600 font-semibold">
{{showNumber(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore)}} {{showNumber(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss)}}
</div> </div>
</div> </div>
</div> </div>
...@@ -306,10 +306,10 @@ ...@@ -306,10 +306,10 @@
</div> </div>
</td> </td>
<td class="align-start text-center text-indigo-600 font-semibold"> <td class="align-start text-center text-indigo-600 font-semibold">
{{calAverage(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore)}} {{calAverage(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss)}}
</td> </td>
<td class="align-start text-center text-indigo-600 font-semibold"> <td class="align-start text-center text-indigo-600 font-semibold">
{{calGap(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore)}} {{calGap(appraisalCompentencyList[appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss)}}
</td> </td>
</tr> </tr>
<tr (mouseenter)="hoveredCode2 = 'true'" (mouseleave)="hoveredCode2 = null" <tr (mouseenter)="hoveredCode2 = 'true'" (mouseleave)="hoveredCode2 = null"
......
...@@ -24,16 +24,16 @@ export class PmsCompetencyComponent { ...@@ -24,16 +24,16 @@ export class PmsCompetencyComponent {
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>(); @Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyFormRemain: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyFormRemain: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyForm: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyForm: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyScoreBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyScore: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyScore: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyScoreEmp: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyWeightScoreBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyWeightScore: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyWeightScore: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyWeightScoreEmp: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyGapBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyGap: EventEmitter<any> = new EventEmitter<any>(); @Output() compentencyGap: EventEmitter<any> = new EventEmitter<any>();
@Output() compentencyGapEmp: EventEmitter<any> = new EventEmitter<any>(); @Output() sendInforWeightBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() sendInforWeight: EventEmitter<any> = new EventEmitter<any>(); @Output() sendInforWeight: EventEmitter<any> = new EventEmitter<any>();
@Output() sendInforWeightEmp: EventEmitter<any> = new EventEmitter<any>(); @Output() sendInforGapBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() sendInforGap: EventEmitter<any> = new EventEmitter<any>(); @Output() sendInforGap: EventEmitter<any> = new EventEmitter<any>();
@Output() sendInforGapEmp: EventEmitter<any> = new EventEmitter<any>();
@Input() canEdit = false @Input() canEdit = false
@Input() currentStep = "" @Input() currentStep = ""
@Input() dateIso = "" @Input() dateIso = ""
...@@ -65,10 +65,10 @@ export class PmsCompetencyComponent { ...@@ -65,10 +65,10 @@ export class PmsCompetencyComponent {
biScore: Map<string, number> = new Map<string, number>() biScore: Map<string, number> = new Map<string, number>()
@ViewChild('scrollContainer') scrollContainer!: ElementRef; @ViewChild('scrollContainer') scrollContainer!: ElementRef;
inforWeightBoss: Map<string, string> = new Map<string, string>()
inforGapBoss: Map<string, string> = new Map<string, string>()
inforWeight: Map<string, string> = new Map<string, string>() inforWeight: Map<string, string> = new Map<string, string>()
inforGap: Map<string, string> = new Map<string, string>() inforGap: Map<string, string> = new Map<string, string>()
inforWeightEmp: Map<string, string> = new Map<string, string>()
inforGapEmp: Map<string, string> = new Map<string, string>()
@Output() scrollToMenuId: EventEmitter<any> = new EventEmitter<any>(); @Output() scrollToMenuId: EventEmitter<any> = new EventEmitter<any>();
...@@ -179,63 +179,63 @@ export class PmsCompetencyComponent { ...@@ -179,63 +179,63 @@ export class PmsCompetencyComponent {
calnumberCheck() { calnumberCheck() {
if (this.evaluaterId != this.evaluateeId || this.currentStep != '0') { if (this.evaluaterId != this.evaluateeId || this.currentStep != '0') {
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1Emp = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 1).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 1).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2Emp = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 2).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 2).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3Emp = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 3).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 3).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4Emp = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 4).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 4).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5Emp = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 5).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectation == 5).length).reduce((acc: any, num: any) => acc + num, 0)
} }
} }
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 1).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1Boss = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 1).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 2).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2Boss = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 2).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 3).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3Boss = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 3).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 4).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4Boss = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 4).length).reduce((acc: any, num: any) => acc + num, 0)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5 = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 5).length).reduce((acc: any, num: any) => acc + num, 0) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5Boss = this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].masfromEvaluationAssessment2List.map((x: any) => x.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList.filter((y: any) => y.competencyBehavioral.scoreTopicExpectationBoss == 5).length).reduce((acc: any, num: any) => acc + num, 0)
this.calWeightTotal() this.calWeightTotal()
} }
this.cdr.detectChanges() this.cdr.detectChanges()
} }
calWeightScore(numberCheck: number) { calWeightScoreBoss(numberCheck: number) {
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
switch (numberCheck) { switch (numberCheck) {
case (1): { case (1): {
return this.showNumber((this.setting.data.settingScore1) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1) return this.showNumber((this.setting.data.settingScore1) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1Boss)
} }
case (2): { case (2): {
return this.showNumber((this.setting.data.settingScore2) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2) return this.showNumber((this.setting.data.settingScore2) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2Boss)
} }
case (3): { case (3): {
return this.showNumber((this.setting.data.settingScore3) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3) return this.showNumber((this.setting.data.settingScore3) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3Boss)
} }
case (4): { case (4): {
return this.showNumber((this.setting.data.settingScore4) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4) return this.showNumber((this.setting.data.settingScore4) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4Boss)
} }
case (5): { case (5): {
return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5) return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5Boss)
} }
default: { return } default: { return }
} }
} }
return return
} }
calWeightScoreEmp(numberCheck: number) { calWeightScore(numberCheck: number) {
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
switch (numberCheck) { switch (numberCheck) {
case (1): { case (1): {
return this.showNumber((this.setting.data.settingScore1) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1Emp) return this.showNumber((this.setting.data.settingScore1) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck1)
} }
case (2): { case (2): {
return this.showNumber((this.setting.data.settingScore2) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2Emp) return this.showNumber((this.setting.data.settingScore2) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck2)
} }
case (3): { case (3): {
return this.showNumber((this.setting.data.settingScore3) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3Emp) return this.showNumber((this.setting.data.settingScore3) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck3)
} }
case (4): { case (4): {
return this.showNumber((this.setting.data.settingScore4) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4Emp) return this.showNumber((this.setting.data.settingScore4) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck4)
} }
case (5): { case (5): {
return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5Emp) return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].numberCheck5)
} }
default: { return } default: { return }
} }
...@@ -244,10 +244,10 @@ export class PmsCompetencyComponent { ...@@ -244,10 +244,10 @@ export class PmsCompetencyComponent {
} }
calWeightTotal() { calWeightTotal() {
if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalBoss = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalBoss = +(((this.calWeightScoreBoss(1) ?? 0) + (this.calWeightScoreBoss(2) ?? 0) + (this.calWeightScoreBoss(3) ?? 0) + (this.calWeightScoreBoss(4) ?? 0) + (this.calWeightScoreBoss(5) ?? 0)).toFixed(2))
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotal = 0 this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotal = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].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.appraisalCompentencyList[this.appraisalCompentencyIndex].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.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalEmp = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalEmp = +(((this.calWeightScoreEmp(1) ?? 0) + (this.calWeightScoreEmp(2) ?? 0) + (this.calWeightScoreEmp(3) ?? 0) + (this.calWeightScoreEmp(4) ?? 0) + (this.calWeightScoreEmp(5) ?? 0)).toFixed(2))
this.cdr.detectChanges() this.cdr.detectChanges()
this.calAverageScore() this.calAverageScore()
} }
...@@ -262,10 +262,10 @@ export class PmsCompetencyComponent { ...@@ -262,10 +262,10 @@ export class PmsCompetencyComponent {
+(this.setting.data.settingScore1)]) +(this.setting.data.settingScore1)])
const total = length * max const total = length * max
if (total) { if (total) {
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss = this.showNumber((this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalBoss * 100) / total)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore = 0 this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore = this.showNumber((this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotal * 100) / total) this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore = this.showNumber((this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotal * 100) / total)
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreEmp = 0
this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreEmp = this.showNumber((this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].weightedTotalEmp * 100) / total)
this.cdr.detectChanges() this.cdr.detectChanges()
} }
} }
...@@ -288,12 +288,12 @@ export class PmsCompetencyComponent { ...@@ -288,12 +288,12 @@ export class PmsCompetencyComponent {
if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0]) {
const roundedScore = this.showNumber(score) % 1 <= 0.5 ? Math.floor(this.showNumber(score)) : Math.round(this.showNumber(score)); const roundedScore = this.showNumber(score) % 1 <= 0.5 ? Math.floor(this.showNumber(score)) : Math.round(this.showNumber(score));
if (roundedScore >= 90 && roundedScore <= 100) { if (roundedScore >= 90 && roundedScore <= 100) {
if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck1 || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck2 || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck3) { if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck1Boss || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck2Boss || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck3Boss) {
return "-1"; return "-1";
} }
return "+1"; return "+1";
} else if (roundedScore >= 80 && roundedScore <= 89) { } else if (roundedScore >= 80 && roundedScore <= 89) {
if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck1 || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck2 || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck3) { if (this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck1Boss || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck2Boss || this.appraisalCompentencyList[index ? +(index) : this.appraisalCompentencyIndex]?.masfromEvaluationAssessment1lList[0].numberCheck3Boss) {
return "-1"; return "-1";
} }
return "0"; return "0";
...@@ -348,27 +348,27 @@ export class PmsCompetencyComponent { ...@@ -348,27 +348,27 @@ export class PmsCompetencyComponent {
).filter(data => data != 0).length ).filter(data => data != 0).length
).filter(data => data != 0).length ).filter(data => data != 0).length
const score = [1, 2, 3, 4, 5] const score = [1, 2, 3, 4, 5]
this.compentencyScore.emit(score.map(x => this.calWeightScore(x))) this.compentencyScoreBoss.emit(score.map(x => this.calWeightScoreBoss(x)))
this.compentencyWeightScore.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore)) this.compentencyWeightScoreBoss.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss))
this.compentencyGap.emit(this.calGap(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore)) this.compentencyGapBoss.emit(this.calGap(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreBoss))
this.compentencyForm.emit(this.appraisalCompentencyList) this.compentencyForm.emit(this.appraisalCompentencyList)
this.compentencyFormRemain.emit(remain) this.compentencyFormRemain.emit(remain)
this.compentencyScoreEmp.emit(score.map(x => this.calWeightScoreEmp(x))) this.compentencyScore.emit(score.map(x => this.calWeightScore(x)))
this.compentencyWeightScoreEmp.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreEmp)) this.compentencyWeightScore.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore))
this.compentencyGapEmp.emit(this.calGap(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScoreEmp)) this.compentencyGap.emit(this.calGap(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1lList[0].averageScore))
} }
allWeightGap() { allWeightGap() {
this.appraisalCompentencyList.forEach((x, i) => { this.appraisalCompentencyList.forEach((x, i) => {
this.inforWeightBoss.set(x.comType, x.masfromEvaluationAssessment1lList[0].averageScoreBoss + '')
this.inforGapBoss.set(x.comType, this.calGap(x.masfromEvaluationAssessment1lList[0].averageScoreBoss, (i + '')) ?? '')
this.inforWeight.set(x.comType, x.masfromEvaluationAssessment1lList[0].averageScore + '') this.inforWeight.set(x.comType, x.masfromEvaluationAssessment1lList[0].averageScore + '')
this.inforGap.set(x.comType, this.calGap(x.masfromEvaluationAssessment1lList[0].averageScore, (i + '')) ?? '') this.inforGap.set(x.comType, this.calGap(x.masfromEvaluationAssessment1lList[0].averageScore, (i + '')) ?? '')
this.inforWeightEmp.set(x.comType, x.masfromEvaluationAssessment1lList[0].averageScoreEmp + '')
this.inforGapEmp.set(x.comType, this.calGap(x.masfromEvaluationAssessment1lList[0].averageScoreEmp, (i + '')) ?? '')
}) })
this.sendInforWeightBoss.emit(this.inforWeightBoss)
this.sendInforGapBoss.emit(this.inforGapBoss)
this.sendInforWeight.emit(this.inforWeight) this.sendInforWeight.emit(this.inforWeight)
this.sendInforGap.emit(this.inforGap) this.sendInforGap.emit(this.inforGap)
this.sendInforWeightEmp.emit(this.inforWeightEmp)
this.sendInforGapEmp.emit(this.inforGapEmp)
} }
allBiOpen(status: boolean, part?: string) { allBiOpen(status: boolean, part?: string) {
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<div class="flex flex-row gap-2"> <div class="flex flex-row gap-2">
<div class="flex flex-col gap-2 w-1/4" [class.hidden]="menuClose.get('ข้อมูลรายละเอียด')"> <div class="flex flex-col gap-2 w-1/4" [class.hidden]="menuClose.get('ข้อมูลรายละเอียด')">
<div class="flex flex-col gap-2" style="height:calc(100vh - 177px);overflow-y: auto;"> <div class="flex flex-col gap-2" style="height:calc(100vh - 177px);overflow-y: auto;">
<div class="w-full" *ngIf="kpiScorePart.length > 0"> <div class="w-full" *ngIf="kpiScorePartBoss.length > 0">
<div class="box shadow-md hover:shadow-xl transition m-0" style="border-radius:20px"> <div class="box shadow-md hover:shadow-xl transition m-0" style="border-radius:20px">
<div class="box-body py-2"> <div class="box-body py-2">
<div class="flex flex-col items-center gap-3"> <div class="flex flex-col items-center gap-3">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
[src]="evaluatee.data.picture?getImg(evaluatee.data.picture):'./assets/img/users/defaultperson.jpg'" [src]="evaluatee.data.picture?getImg(evaluatee.data.picture):'./assets/img/users/defaultperson.jpg'"
(error)="onImageError($event)" class="h-24 w-24 rounded-full ring-4 ring-primary object-cover" (error)="onImageError($event)" class="h-24 w-24 rounded-full ring-4 ring-primary object-cover"
alt="profile-img" /> alt="profile-img" />
<ng-container *ngIf="kpiScorePart[kpiScorePart.length-1].score as grade"> <ng-container *ngIf="kpiScorePartBoss[kpiScorePartBoss.length-1].score as grade">
<div class="flex gap-1"> <div class="flex gap-1">
<ng-container *ngFor="let s of [1,2,3,4,5]"> <ng-container *ngFor="let s of [1,2,3,4,5]">
<i class="ti text-xl" <i class="ti text-xl"
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<div *ngFor="let item of [5,4,3,2,1]" <div *ngFor="let item of [5,4,3,2,1]"
class="flex-1 border border-secondary text-center align-center" class="flex-1 border border-secondary text-center align-center"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyScore[item-1]}} {{compentencyScoreBoss[item-1]}}
</div> </div>
</div> </div>
</div> </div>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<div <div
class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold" class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyWeightScore}} {{compentencyWeightScoreBoss}}
</div> </div>
</div> </div>
<div class="flex-1 font-size-18px font-weight-700 text-right align-center"> <div class="flex-1 font-size-18px font-weight-700 text-right align-center">
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
<div <div
class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold" class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyGap}} {{compentencyGapBoss}}
</div> </div>
</div> </div>
</div> </div>
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
<div *ngFor="let item of [5,4,3,2,1]" <div *ngFor="let item of [5,4,3,2,1]"
class="flex-1 border border-secondary text-center align-center" class="flex-1 border border-secondary text-center align-center"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyScoreEmp[item-1]}} {{compentencyScore[item-1]}}
</div> </div>
</div> </div>
</div> </div>
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
<div <div
class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold" class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyWeightScoreEmp}} {{compentencyWeightScore}}
</div> </div>
</div> </div>
<div class="flex-1 font-size-18px font-weight-700 text-right align-center"> <div class="flex-1 font-size-18px font-weight-700 text-right align-center">
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
<div <div
class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold" class="w-full border border-secondary text-center align-center text-indigo-600 font-semibold"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;"> style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
{{compentencyGapEmp}} {{compentencyGap}}
</div> </div>
</div> </div>
</div> </div>
...@@ -282,8 +282,8 @@ ...@@ -282,8 +282,8 @@
<div class="box-body py-2 flex flex-col gap-6 " [class.hidden]="menuClose.get('สรุปผลประเมิน')"> <div class="box-body py-2 flex flex-col gap-6 " [class.hidden]="menuClose.get('สรุปผลประเมิน')">
<div class='flex-1 flex flex-row gap-2'> <div class='flex-1 flex flex-row gap-2'>
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<ng-container *ngFor="let item of kpiScorePart; let i=index"> <ng-container *ngFor="let item of kpiScorePartBoss; let i=index">
<ng-container *ngIf="i<4 && i< kpiScorePart.length-2"> <ng-container *ngIf="i<4 && i< kpiScorePartBoss.length-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1" style="align-content:center"> <div class="flex-1" style="align-content:center">
{{item.text}} {{item.text}}
...@@ -297,8 +297,8 @@ ...@@ -297,8 +297,8 @@
</ng-container> </ng-container>
</div> </div>
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<ng-container *ngFor="let item of kpiScorePart; let i=index"> <ng-container *ngFor="let item of kpiScorePartBoss; let i=index">
<ng-container *ngIf="i>=4 && i< kpiScorePart.length-2"> <ng-container *ngIf="i>=4 && i< kpiScorePartBoss.length-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1" style="align-content:center"> <div class="flex-1" style="align-content:center">
{{item.text}} {{item.text}}
...@@ -313,8 +313,8 @@ ...@@ -313,8 +313,8 @@
</div> </div>
</div> </div>
<div class='flex-1 flex flex-row gap-2'> <div class='flex-1 flex flex-row gap-2'>
<ng-container *ngFor="let item of kpiScorePart; let i=index"> <ng-container *ngFor="let item of kpiScorePartBoss; let i=index">
<ng-container *ngIf="i >= kpiScorePart.length-2"> <ng-container *ngIf="i >= kpiScorePartBoss.length-2">
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1 font-size-18px font-weight-700" style="align-content:center"> <div class="flex-1 font-size-18px font-weight-700" style="align-content:center">
...@@ -356,8 +356,8 @@ ...@@ -356,8 +356,8 @@
<div class="box-body py-2 flex flex-col gap-6 " [class.hidden]="menuClose.get('สรุปผลประเมินตนเอง')"> <div class="box-body py-2 flex flex-col gap-6 " [class.hidden]="menuClose.get('สรุปผลประเมินตนเอง')">
<div class='flex-1 flex flex-row gap-2'> <div class='flex-1 flex flex-row gap-2'>
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<ng-container *ngFor="let item of kpiScorePartEmp; let i=index"> <ng-container *ngFor="let item of kpiScorePart; let i=index">
<ng-container *ngIf="i<4 && i< kpiScorePartEmp.length-2"> <ng-container *ngIf="i<4 && i< kpiScorePart.length-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1" style="align-content:center"> <div class="flex-1" style="align-content:center">
{{item.text}} {{item.text}}
...@@ -371,8 +371,8 @@ ...@@ -371,8 +371,8 @@
</ng-container> </ng-container>
</div> </div>
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<ng-container *ngFor="let item of kpiScorePartEmp; let i=index"> <ng-container *ngFor="let item of kpiScorePart; let i=index">
<ng-container *ngIf="i>=4 && i< kpiScorePartEmp.length-2"> <ng-container *ngIf="i>=4 && i< kpiScorePart.length-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1" style="align-content:center"> <div class="flex-1" style="align-content:center">
{{item.text}} {{item.text}}
...@@ -387,8 +387,8 @@ ...@@ -387,8 +387,8 @@
</div> </div>
</div> </div>
<div class='flex-1 flex flex-row gap-2'> <div class='flex-1 flex flex-row gap-2'>
<ng-container *ngFor="let item of kpiScorePartEmp; let i=index; let l=last"> <ng-container *ngFor="let item of kpiScorePart; let i=index; let l=last">
<ng-container *ngIf="i >= kpiScorePartEmp.length-2 && !l"> <ng-container *ngIf="i >= kpiScorePart.length-2 && !l">
<div class="flex-1 flex flex-col gap-2"> <div class="flex-1 flex flex-col gap-2">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="flex-1 font-size-18px font-weight-700" style="align-content:center"> <div class="flex-1 font-size-18px font-weight-700" style="align-content:center">
...@@ -579,11 +579,11 @@ ...@@ -579,11 +579,11 @@
<div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='ข้อมูลการประเมิน'"> <div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='ข้อมูลการประเมิน'">
<app-pms-information [statusType]="compentency.data.statusType" [canSave]="canSave" <app-pms-information [statusType]="compentency.data.statusType" [canSave]="canSave"
[appraisalPms]="compentency.data.pms" [appraisalCompentencyList]="compentency.data.competency" [appraisalPms]="compentency.data.pms" [appraisalCompentencyList]="compentency.data.competency"
[inforGap]="inforGap" [inforWeight]="inforWeight" [inforGapEmp]="inforGapEmp" [inforGapBoss]="inforGapBoss" [inforWeightBoss]="inforWeightBoss" [inforGap]="inforGap"
[inforWeightEmp]="inforWeightEmp" [inforWeight]="inforWeight"
[kpiScoreBoss]="kpiScorePartBoss.length > 1 ?kpiScorePartBoss[kpiScorePartBoss.length-2].score : ''"
[kpiScore]="kpiScorePart.length > 1 ?kpiScorePart[kpiScorePart.length-2].score : ''" [kpiScore]="kpiScorePart.length > 1 ?kpiScorePart[kpiScorePart.length-2].score : ''"
[kpiScoreEmp]="kpiScorePartEmp.length > 1 ?kpiScorePartEmp[kpiScorePartEmp.length-2].score : ''" [kpiGrade]="kpiScorePartBoss.length > 0 ?kpiScorePartBoss[kpiScorePartBoss.length-1].score : ''"
[kpiGrade]="kpiScorePart.length > 0 ?kpiScorePart[kpiScorePart.length-1].score : ''"
[kpiName]="compentency.data.tdesc" (sendCurrentTap)="currentTap=$event" [kpiName]="compentency.data.tdesc" (sendCurrentTap)="currentTap=$event"
(sendCurrentPart)="currentPart=$event" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId" (sendCurrentPart)="currentPart=$event" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId"
[currentStep]="compentency.data.currentStep" [complete]="complete"></app-pms-information> [currentStep]="compentency.data.currentStep" [complete]="complete"></app-pms-information>
...@@ -592,15 +592,15 @@ ...@@ -592,15 +592,15 @@
<app-pms-competency [currentTap]="currentTap" [canSave]="canSave" [fCurrentPart]="currentPart" <app-pms-competency [currentTap]="currentTap" [canSave]="canSave" [fCurrentPart]="currentPart"
[appraisalCompentencyList]="compentency.data.competency" [evaluaterId]="evaluaterId" [appraisalCompentencyList]="compentency.data.competency" [evaluaterId]="evaluaterId"
[evaluateeId]="evaluateeId" [canEdit]="canEdit" [currentStep]="compentency.data.currentStep" [evaluateeId]="evaluateeId" [canEdit]="canEdit" [currentStep]="compentency.data.currentStep"
[dateIso]="dateIso" (compentencyScore)="compentencyScore=$event" [dateIso]="dateIso" (compentencyScoreBoss)="compentencyScoreBoss=$event"
(compentencyScoreEmp)="compentencyScoreEmp=$event" (compentencyScore)="compentencyScore=$event"
(compentencyWeightScoreBoss)="compentencyWeightScoreBoss=$event"
(compentencyGapBoss)="compentencyGapBoss=$event"
(compentencyWeightScore)="compentencyWeightScore=$event" (compentencyGap)="compentencyGap=$event" (compentencyWeightScore)="compentencyWeightScore=$event" (compentencyGap)="compentencyGap=$event"
(compentencyWeightScoreEmp)="compentencyWeightScoreEmp=$event"
(compentencyGapEmp)="compentencyGapEmp=$event"
(compentencyFormRemain)="compentencyFormRemain=$event" (compentencyFormRemain)="compentencyFormRemain=$event"
(compentencyForm)="compentency.data.competency=$event" (sendInforGap)="inforGap=$event" (compentencyForm)="compentency.data.competency=$event" (sendInforGapBoss)="inforGapBoss=$event"
(sendInforWeight)="inforWeight=$event" (sendInforGapEmp)="inforGapEmp=$event" (sendInforWeightBoss)="inforWeightBoss=$event" (sendInforGap)="inforGap=$event"
(sendInforWeightEmp)="inforWeightEmp=$event" (scrollToMenuId)="scrollToMenu($event)" (sendInforWeight)="inforWeight=$event" (scrollToMenuId)="scrollToMenu($event)"
[complete]="complete"></app-pms-competency> [complete]="complete"></app-pms-competency>
</div> </div>
<div class="min-height: calc(100vh - 406px);" <div class="min-height: calc(100vh - 406px);"
...@@ -608,9 +608,9 @@ ...@@ -608,9 +608,9 @@
<app-pms-kpi [canSave]="canSave" [appraisalPms]="compentency.data.pms" [currentTap]="currentTap" <app-pms-kpi [canSave]="canSave" [appraisalPms]="compentency.data.pms" [currentTap]="currentTap"
[currentPart]="currentTap" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId" [currentPart]="currentTap" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId"
[canEdit]="canEdit" [currentStep]="compentency.data.currentStep" [dateIso]="dateIso" [canEdit]="canEdit" [currentStep]="compentency.data.currentStep" [dateIso]="dateIso"
(kpiFormRemain)="kpiFormRemain=$event" (scorePart)="kpiScorePart=$event" (kpiFormRemain)="kpiFormRemain=$event" (scorePartBoss)="kpiScorePartBoss=$event"
(scorePartEmp)="kpiScorePartEmp=$event" (kpiForm)="compentency.data.pms=$event" (scorePart)="kpiScorePart=$event" (kpiForm)="compentency.data.pms=$event"
(scrollToMenuId)="scrollToMenu($event)" [inforWeight]="inforWeight" (scrollToMenuId)="scrollToMenu($event)" [inforWeight]="inforWeightBoss"
[compentencyFormRemain]="compentencyFormRemain" [complete]="complete"></app-pms-kpi> [compentencyFormRemain]="compentencyFormRemain" [complete]="complete"></app-pms-kpi>
</div> </div>
<div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='แผนพัฒนาบุคลากร'"> <div class="min-height: calc(100vh - 406px);" [class.hidden]="currentTap!='แผนพัฒนาบุคลากร'">
......
...@@ -52,20 +52,20 @@ export class PmsFormEmployeeComponent { ...@@ -52,20 +52,20 @@ export class PmsFormEmployeeComponent {
currentDate = new Date() currentDate = new Date()
comment = "" comment = ""
compentencyScoreBoss: String[] = []
compentencyWeightScoreBoss = ""
compentencyGapBoss = ""
compentencyScore: String[] = [] compentencyScore: String[] = []
compentencyWeightScore = "" compentencyWeightScore = ""
compentencyGap = "" compentencyGap = ""
compentencyScoreEmp: String[] = []
compentencyWeightScoreEmp = ""
compentencyGapEmp = ""
inforWeightBoss: Map<string, string> = new Map<string, string>()
inforGapBoss: Map<string, string> = new Map<string, string>()
inforWeight: Map<string, string> = new Map<string, string>() inforWeight: Map<string, string> = new Map<string, string>()
inforGap: Map<string, string> = new Map<string, string>() inforGap: Map<string, string> = new Map<string, string>()
inforWeightEmp: Map<string, string> = new Map<string, string>()
inforGapEmp: Map<string, string> = new Map<string, string>()
kpiScorePartBoss: { text: string, score: string }[] = []
kpiScorePart: { text: string, score: string }[] = [] kpiScorePart: { text: string, score: string }[] = []
kpiScorePartEmp: { text: string, score: string }[] = []
menuClose: Map<string, boolean> = new Map<string, boolean>() menuClose: Map<string, boolean> = new Map<string, boolean>()
......
...@@ -44,26 +44,26 @@ ...@@ -44,26 +44,26 @@
</td> </td>
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforWeightEmp.get(item.comType)!=='undefined' && inforWeightEmp.get(item.comType) {{inforWeight.get(item.comType)!=='undefined' && inforWeight.get(item.comType)
!=='null'?inforWeightEmp.get(item.comType): '0'}} !=='null'?inforWeight.get(item.comType): '0'}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforGapEmp.get(item.comType)!=='null'?inforGapEmp.get(item.comType): ''}} {{inforGap.get(item.comType)!=='null'?inforGap.get(item.comType): ''}}
</td> </td>
</ng-container> </ng-container>
<ng-container *ngIf="evaluaterId!=evaluateeId||complete"> <ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforWeightEmp.get(item.comType)!=='undefined' && inforWeightEmp.get(item.comType) {{inforWeight.get(item.comType)!=='undefined' && inforWeight.get(item.comType)
!=='null'?inforWeightEmp.get(item.comType): '0'}} !=='null'?inforWeight.get(item.comType): '0'}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforWeight.get(item.comType) !=='null'?inforWeight.get(item.comType): '0'}} {{inforWeightBoss.get(item.comType) !=='null'?inforWeightBoss.get(item.comType): '0'}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforGapEmp.get(item.comType)!=='null'?inforGapEmp.get(item.comType): ''}} {{inforGap.get(item.comType)!=='null'?inforGap.get(item.comType): ''}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{inforGap.get(item.comType)!=='null'?inforGap.get(item.comType): ''}} {{inforGapBoss.get(item.comType)!=='null'?inforGapBoss.get(item.comType): ''}}
</td> </td>
</ng-container> </ng-container>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
...@@ -120,15 +120,15 @@ ...@@ -120,15 +120,15 @@
</td> </td>
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{kpiScoreEmp}} {{kpiScore}}
</td> </td>
</ng-container> </ng-container>
<ng-container *ngIf="evaluaterId!=evaluateeId||complete"> <ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{kpiScoreEmp}} {{kpiScore}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{kpiScore}} {{kpiScoreBoss}}
</td> </td>
</ng-container> </ng-container>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
......
...@@ -10,14 +10,14 @@ export class PmsInformationComponent { ...@@ -10,14 +10,14 @@ export class PmsInformationComponent {
@Input() canSave = false @Input() canSave = false
@Input() complete = false @Input() complete = false
@Input() statusType = '' @Input() statusType = ''
@Input() inforWeightBoss: Map<string, string> = new Map<string, string>()
@Input() inforGapBoss: Map<string, string> = new Map<string, string>()
@Input() inforWeight: Map<string, string> = new Map<string, string>() @Input() inforWeight: Map<string, string> = new Map<string, string>()
@Input() inforGap: Map<string, string> = new Map<string, string>() @Input() inforGap: Map<string, string> = new Map<string, string>()
@Input() inforWeightEmp: Map<string, string> = new Map<string, string>()
@Input() inforGapEmp: Map<string, string> = new Map<string, string>()
@Input() appraisalCompentencyList: Competency[] = [] @Input() appraisalCompentencyList: Competency[] = []
@Input() appraisalPms?: Pms @Input() appraisalPms?: Pms
@Input() kpiScoreBoss: string = ""
@Input() kpiScore: string = "" @Input() kpiScore: string = ""
@Input() kpiScoreEmp: string = ""
@Input() kpiGrade: string = "" @Input() kpiGrade: string = ""
@Input() kpiName: string = "" @Input() kpiName: string = ""
@Input() evaluateeId = "" @Input() evaluateeId = ""
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<ng-container *ngIf="appraisalPms"> <ng-container *ngIf="appraisalPms">
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex py-2 flex-row gap-2 sticky" style="top:0;z-index:2;background: white;"> <div class="flex py-2 flex-row gap-2 sticky" style="top:0;z-index:2;background: white;">
<ng-container *ngIf="currentTap == 'ประเมินผลการปฏิบัติงาน'">
<ng-container *ngFor="let item of partShow;let i=index"> <ng-container *ngFor="let item of partShow;let i=index">
<button type="button" <button type="button"
class="flex justify-center !items-center border bg-white p-1 text-center font-semibold" class="flex justify-center !items-center border bg-white p-1 text-center font-semibold"
(click)="scrollToMenu(currentTap == 'ประเมินผลการปฏิบัติงาน'?('menu-part-'+(i+1)):('menu-part-'+(i+8)));currentPart=item;toggleAllParts(true,item)" (click)="scrollToMenu('menu-part-'+(i+1));currentPart=item;toggleAllParts(true,item)"
style="border-radius:20px;width: 100px" style="border-radius:20px;width: 100px"
[ngClass]="{'!bg-primary text-white':currentPart==item}"> [ngClass]="{'!bg-primary text-white':currentPart==item}">
<span class="leading-none">{{ item }}</span> <span class="leading-none">{{ item }}</span>
<ng-container *ngIf="currentTap == 'ประเมินผลการปฏิบัติงาน'">
<ng-container *ngIf="remainList()[i]>=0"> <ng-container *ngIf="remainList()[i]>=0">
&nbsp; &nbsp;
<span class="flex align-center justify-center rounded-circle text-white" <span class="flex align-center justify-center rounded-circle text-white"
...@@ -22,9 +22,20 @@ ...@@ -22,9 +22,20 @@
<i *ngIf="!remainList()[i]" class="ti ti-check"></i> <i *ngIf="!remainList()[i]" class="ti ti-check"></i>
</span> </span>
</ng-container> </ng-container>
</button>
</ng-container>
</ng-container> </ng-container>
<ng-container *ngIf="currentTap != 'ประเมินผลการปฏิบัติงาน'">
<ng-container *ngFor="let item of partShow;let i=index">
<button type="button"
class="flex justify-center !items-center border bg-white p-1 text-center font-semibold"
(click)="scrollToMenu('menu-part-'+(i+8));currentPart=item;toggleAllParts(true,item)"
style="border-radius:20px;width: 100px"
[ngClass]="{'!bg-primary text-white':currentPart==item}">
<span class="leading-none">{{ item }}</span>
</button> </button>
</ng-container> </ng-container>
</ng-container>
<div class="flex justify-around !items-center border bg-white p-2 text-right" <div class="flex justify-around !items-center border bg-white p-2 text-right"
style="border-radius:20px;width: 100px;margin-left: auto;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));"> style="border-radius:20px;width: 100px;margin-left: auto;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));">
<i title="แสดงทั้งหมด" class="bg-white cursor-pointer border ti ti-chevron-down" <i title="แสดงทั้งหมด" class="bg-white cursor-pointer border ti ti-chevron-down"
...@@ -897,9 +908,9 @@ ...@@ -897,9 +908,9 @@
style="border-radius:5px" (mouseenter)="partScore.set(item.tdesc,item2)" style="border-radius:5px" (mouseenter)="partScore.set(item.tdesc,item2)"
(mouseleave)="partScore.clear()" (mouseleave)="partScore.clear()"
(click)="setScorePart5(item,item2);allFormRemain()" [ngClass]="{ (click)="setScorePart5(item,item2);allFormRemain()" [ngClass]="{
'!border-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimScore>=item2:item.pmsWorkingTimScoreBoss>=item2)||(partScore.get(item.tdesc) ?? 0)>=item2 , '!border-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimeScore>=item2:item.pmsWorkingTimeScoreBoss>=item2)||(partScore.get(item.tdesc) ?? 0)>=item2 ,
'!text-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimScore>item2:item.pmsWorkingTimScoreBoss>item2)||(partScore.get(item.tdesc) ?? 0)>item2, '!text-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimeScore>item2:item.pmsWorkingTimeScoreBoss>item2)||(partScore.get(item.tdesc) ?? 0)>item2,
'!text-white !bg-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimScore==item2:item.pmsWorkingTimScoreBoss==item2)||(partScore.get(item.tdesc) ?? 0)==item2, '!text-white !bg-secondary': (evaluaterId==evaluateeId?item.pmsWorkingTimeScore==item2:item.pmsWorkingTimeScoreBoss==item2)||(partScore.get(item.tdesc) ?? 0)==item2,
'pointer-events-none':!canEdit}"> 'pointer-events-none':!canEdit}">
{{item2}} {{item2}}
</button> </button>
...@@ -914,16 +925,16 @@ ...@@ -914,16 +925,16 @@
</td> </td>
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.weight * item.pmsWorkingTimScore)}} {{numberFixed2(item.weight * item.pmsWorkingTimeScore)}}
</td> </td>
</ng-container> </ng-container>
<ng-container *ngIf="evaluaterId!=evaluateeId||complete"> <ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{item.pmsWorkingTimScore}} {{item.pmsWorkingTimeScore}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.weight * {{numberFixed2(item.weight *
(evaluaterId==evaluateeId?item.pmsWorkingTimScore:item.pmsWorkingTimScoreBoss))}} (evaluaterId==evaluateeId?item.pmsWorkingTimeScore:item.pmsWorkingTimeScoreBoss))}}
</td> </td>
</ng-container> </ng-container>
</tr> </tr>
...@@ -1451,25 +1462,25 @@ ...@@ -1451,25 +1462,25 @@
</td> </td>
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.scoreObtainedEmp)}} {{numberFixed2(item.scoreObtained)}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.netScoreEmp)}} {{numberFixed2(item.netScore)}}
</td> </td>
</ng-container> </ng-container>
<ng-container *ngIf="evaluaterId!=evaluateeId||complete"> <ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.scoreObtainedEmp)}}
</td>
<td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.scoreObtained)}} {{numberFixed2(item.scoreObtained)}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.netScoreEmp)}} {{numberFixed2(item.scoreObtainedBoss)}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.netScore)}} {{numberFixed2(item.netScore)}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top">
{{numberFixed2(item.netScoreBoss)}}
</td>
</ng-container> </ng-container>
</tr> </tr>
</ng-container> </ng-container>
...@@ -1484,25 +1495,25 @@ ...@@ -1484,25 +1495,25 @@
</td> </td>
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<td class="py-2 align-start text-center font-semibold text-indigo-600"> <td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calScoreObtainedEmp()}} {{calScoreObtained()}}
</td> </td>
<td class="py-2 align-start text-center font-semibold text-indigo-600"> <td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calNetScoreEmp()}} {{calNetScore()}}
</td> </td>
</ng-container> </ng-container>
<ng-container *ngIf="evaluaterId!=evaluateeId||complete"> <ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<td class="py-2 align-start text-center font-semibold text-indigo-600"> <td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calScoreObtainedEmp()}}
</td>
<td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calScoreObtained()}} {{calScoreObtained()}}
</td> </td>
<td class="py-2 align-start text-center font-semibold text-indigo-600"> <td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calNetScoreEmp()}} {{calScoreObtainedBoss()}}
</td> </td>
<td class="py-2 align-start text-center font-semibold text-indigo-600"> <td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calNetScore()}} {{calNetScore()}}
</td> </td>
<td class="py-2 align-start text-center font-semibold text-indigo-600">
{{calNetScoreBoss()}}
</td>
</ng-container> </ng-container>
</tr> </tr>
</tbody> </tbody>
......
...@@ -11,17 +11,17 @@ export interface Part8Model { ...@@ -11,17 +11,17 @@ export interface Part8Model {
evaluationFactor: string, evaluationFactor: string,
rawScore: number, rawScore: number,
factors: number factors: number
scoreObtainedBoss: number
scoreObtained: number scoreObtained: number
scoreObtainedEmp: number netScoreBoss: number
netScore: number netScore: number
netScoreEmp: number
} }
export interface LevelStarModel { export interface LevelStarModel {
evaluationFactor: string, evaluationFactor: string,
rawScore: number, rawScore: number,
factors: number factors: number
scoreObtained: number scoreObtainedBoss: number
netScore: number netScoreBoss: number
} }
@Component({ @Component({
selector: 'app-pms-kpi', selector: 'app-pms-kpi',
...@@ -37,64 +37,64 @@ export class PmsKpiComponent { ...@@ -37,64 +37,64 @@ export class PmsKpiComponent {
evaluationFactor: "Part 1 : ประเมินผลการปฏิบัติงานตามนโยบายบริษัท (Corporate KPI)", evaluationFactor: "Part 1 : ประเมินผลการปฏิบัติงานตามนโยบายบริษัท (Corporate KPI)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 2, id: 2,
evaluationFactor: "Part 2 : ประเมินผลการปฏิบัติงานประจำ (Department KPI)", evaluationFactor: "Part 2 : ประเมินผลการปฏิบัติงานประจำ (Department KPI)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 3, id: 3,
evaluationFactor: "Part 3 : ประเมินผลการปฏิบัติงานประจำ (Individual KPI)", evaluationFactor: "Part 3 : ประเมินผลการปฏิบัติงานประจำ (Individual KPI)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 4, id: 4,
evaluationFactor: "Part 4 : ประเมินผลสมรรถนะที่สนับสนุนการปฏิบัติงาน (Competency)", evaluationFactor: "Part 4 : ประเมินผลสมรรถนะที่สนับสนุนการปฏิบัติงาน (Competency)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 5, id: 5,
evaluationFactor: "Part 5 : อัตราการเข้างาน (Time Attendance)", evaluationFactor: "Part 5 : อัตราการเข้างาน (Time Attendance)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 6, id: 6,
evaluationFactor: "Part 6 : งานที่ได้รับมอบหมายเพิ่มเติม (Cross Functional Project Assignment)", evaluationFactor: "Part 6 : งานที่ได้รับมอบหมายเพิ่มเติม (Cross Functional Project Assignment)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, { }, {
id: 7, id: 7,
evaluationFactor: "Part 7 : กิจกรรมพิเศษ (Special Activities)", evaluationFactor: "Part 7 : กิจกรรมพิเศษ (Special Activities)",
rawScore: 100, rawScore: 100,
factors: 0, factors: 0,
scoreObtainedBoss: 0,
netScoreBoss: 0,
scoreObtained: 0, scoreObtained: 0,
netScore: 0, netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}] }]
partShow: string[] = [] partShow: string[] = []
partOpen: Map<string, boolean> = new Map<string, boolean>() partOpen: Map<string, boolean> = new Map<string, boolean>()
...@@ -110,8 +110,8 @@ export class PmsKpiComponent { ...@@ -110,8 +110,8 @@ export class PmsKpiComponent {
@Input() dateIso = "" @Input() dateIso = ""
@Output() kpiFormRemain: EventEmitter<any> = new EventEmitter<any>(); @Output() kpiFormRemain: EventEmitter<any> = new EventEmitter<any>();
@Output() kpiForm: EventEmitter<any> = new EventEmitter<any>(); @Output() kpiForm: EventEmitter<any> = new EventEmitter<any>();
@Output() scorePartBoss: EventEmitter<any> = new EventEmitter<any>();
@Output() scorePart: EventEmitter<any> = new EventEmitter<any>(); @Output() scorePart: EventEmitter<any> = new EventEmitter<any>();
@Output() scorePartEmp: EventEmitter<any> = new EventEmitter<any>();
groupGrade: { loading: boolean, dataList: CompetencyGradeModel[] } = { loading: false, dataList: [] } groupGrade: { loading: boolean, dataList: CompetencyGradeModel[] } = { loading: false, dataList: [] }
@ViewChild('scrollContainer') scrollContainer!: ElementRef; @ViewChild('scrollContainer') scrollContainer!: ElementRef;
@Output() scrollToMenuId: EventEmitter<any> = new EventEmitter<any>(); @Output() scrollToMenuId: EventEmitter<any> = new EventEmitter<any>();
...@@ -132,13 +132,38 @@ export class PmsKpiComponent { ...@@ -132,13 +132,38 @@ export class PmsKpiComponent {
} }
getTargetDetailValuePart5(item: any): string { getTargetDetailValuePart5(item: any): string {
const targetDetail = ['', 'targetEDetail', 'targetDDetail', 'targetCDetail', 'targetBDetail', 'targetADetail'] const targetDetail = ['', 'targetEDetail', 'targetDDetail', 'targetCDetail', 'targetBDetail', 'targetADetail']
const index = this.partScore.get(item.tdesc) ?? item.pmsWorkingTimScore; const index = this.partScore.get(item.tdesc) ?? item.pmsWorkingTimeScore;
const key = targetDetail[index ?? 0] as keyof Part5Detail; const key = targetDetail[index ?? 0] as keyof Part5Detail;
return item[key]; return item[key];
} }
ngOnInit(): void { ngOnInit(): void {
this.partOpen.clear() this.partOpen.clear()
this.partShow = this.currentTap == 'ประเมินผลการปฏิบัติงาน' ? ['PART 1', 'PART 2', 'PART 3', 'PART 4', 'PART 5', 'PART 6', 'PART 7'] : ['PART 8', 'PART 9', 'PART 10'] if (this.currentTap == 'ประเมินผลการปฏิบัติงาน') {
this.partShow = []
if (this.appraisalPms?.part1Detail?.length) {
this.partShow.push('PART 1')
}
if (this.appraisalPms?.part2Detail?.length) {
this.partShow.push('PART 2')
}
if (this.appraisalPms?.part3Detail?.length) {
this.partShow.push('PART 3')
}
if (this.appraisalPms?.part4Detail?.length) {
this.partShow.push('PART 4')
}
if (this.appraisalPms?.part5Detail?.length) {
this.partShow.push('PART 5')
}
if (this.appraisalPms?.part6Detail?.length) {
this.partShow.push('PART 6')
}
if (this.appraisalPms?.part7Detail?.length) {
this.partShow.push('PART 7')
}
} else {
this.partShow = ['PART 8', 'PART 9', 'PART 10']
}
this.partShow.forEach(x => { this.partShow.forEach(x => {
this.partOpen.set(x, false) this.partOpen.set(x, false)
}) })
...@@ -150,7 +175,32 @@ export class PmsKpiComponent { ...@@ -150,7 +175,32 @@ export class PmsKpiComponent {
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes['currentTap']?.currentValue || changes['appraisalPms']?.currentValue) { if (changes['currentTap']?.currentValue || changes['appraisalPms']?.currentValue) {
this.partOpen.clear() this.partOpen.clear()
this.partShow = this.currentTap == 'ประเมินผลการปฏิบัติงาน' ? ['PART 1', 'PART 2', 'PART 3', 'PART 4', 'PART 5', 'PART 6', 'PART 7'] : ['PART 8', 'PART 9', 'PART 10'] if (this.currentTap == 'ประเมินผลการปฏิบัติงาน') {
this.partShow = []
if (this.appraisalPms?.part1Detail?.length) {
this.partShow.push('PART 1')
}
if (this.appraisalPms?.part2Detail?.length) {
this.partShow.push('PART 2')
}
if (this.appraisalPms?.part3Detail?.length) {
this.partShow.push('PART 3')
}
if (this.appraisalPms?.part4Detail?.length) {
this.partShow.push('PART 4')
}
if (this.appraisalPms?.part5Detail?.length) {
this.partShow.push('PART 5')
}
if (this.appraisalPms?.part6Detail?.length) {
this.partShow.push('PART 6')
}
if (this.appraisalPms?.part7Detail?.length) {
this.partShow.push('PART 7')
}
} else {
this.partShow = ['PART 8', 'PART 9', 'PART 10']
}
this.partShow.forEach(x => { this.partShow.forEach(x => {
this.partOpen.set(x, false) this.partOpen.set(x, false)
}) })
...@@ -289,62 +339,62 @@ export class PmsKpiComponent { ...@@ -289,62 +339,62 @@ export class PmsKpiComponent {
changePercentage() { changePercentage() {
this.data8List.forEach(x => { this.data8List.forEach(x => {
if (x.id == 1 && this.appraisalPms?.part1Detail) { if (x.id == 1 && this.appraisalPms?.part1Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part1SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part1SumScore = x.scoreObtained this.appraisalPms.part1SumScore = x.scoreObtained
this.appraisalPms.part1SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 2 && this.appraisalPms?.part2Detail) { } else if (x.id == 2 && this.appraisalPms?.part2Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part2SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part2SumScore = x.scoreObtained this.appraisalPms.part2SumScore = x.scoreObtained
this.appraisalPms.part2SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 3 && this.appraisalPms?.part3Detail) { } else if (x.id == 3 && this.appraisalPms?.part3Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part3SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part3SumScore = x.scoreObtained this.appraisalPms.part3SumScore = x.scoreObtained
this.appraisalPms.part3SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 4 && this.appraisalPms?.part4Detail) { } else if (x.id == 4 && this.appraisalPms?.part4Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScoreBossPart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBossPart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBossPart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail))
x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBossPart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part4SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part4SumScore = x.scoreObtained this.appraisalPms.part4SumScore = x.scoreObtained
this.appraisalPms.part4SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 5 && this.appraisalPms?.part5Detail) { } else if (x.id == 5 && this.appraisalPms?.part5Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScorePart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScorePart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBossPart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBossPart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part5SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part5SumScore = x.scoreObtained this.appraisalPms.part5SumScore = x.scoreObtained
this.appraisalPms.part5SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 6 && this.appraisalPms?.part6Detail) { } else if (x.id == 6 && this.appraisalPms?.part6Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part6SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part6SumScore = x.scoreObtained this.appraisalPms.part6SumScore = x.scoreObtained
this.appraisalPms.part6SumScoreBoss = x.scoreObtainedBoss
} }
} else if (x.id == 7 && this.appraisalPms?.part7Detail) { } else if (x.id == 7 && this.appraisalPms?.part7Detail) {
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail)) x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail)) x.scoreObtainedBoss = +this.calPercentage(this.calExpectationTotalScoreBoss(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail))
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.part7SumScoreEmp = x.scoreObtainedEmp
this.appraisalPms.part7SumScore = x.scoreObtained this.appraisalPms.part7SumScore = x.scoreObtained
this.appraisalPms.part7SumScoreBoss = x.scoreObtainedBoss
} }
} }
x.netScoreEmp = x.factors / 100 * x.scoreObtainedEmp
x.netScore = x.factors / 100 * x.scoreObtained x.netScore = x.factors / 100 * x.scoreObtained
x.netScoreBoss = x.factors / 100 * x.scoreObtainedBoss
}) })
this.setGradeScore() this.setGradeScore()
} }
setGradeScore() { setGradeScore() {
const gradeScore = this.groupGrade.dataList.find(item => Math.ceil(+this.calNetScore()) >= item.gradeMinScore && Math.ceil(+this.calNetScore()) <= item.gradeMaxScore); const gradeScore = this.groupGrade.dataList.find(item => Math.ceil(+this.calNetScoreBoss()) >= item.gradeMinScore && Math.ceil(+this.calNetScoreBoss()) <= item.gradeMaxScore);
if (this.appraisalPms && gradeScore) { if (this.appraisalPms && gradeScore) {
this.appraisalPms.gradeScore = gradeScore.gradeDetail this.appraisalPms.gradeScore = gradeScore.gradeDetail
} }
...@@ -353,24 +403,24 @@ export class PmsKpiComponent { ...@@ -353,24 +403,24 @@ export class PmsKpiComponent {
calFactors() { calFactors() {
return this.data8List.reduce((sum: number, item: any) => sum + item.factors, 0).toFixed(2); return this.data8List.reduce((sum: number, item: any) => sum + item.factors, 0).toFixed(2);
} }
calScoreObtainedEmp() { calScoreObtained() {
return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtainedEmp, 0).toFixed(2); return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtained, 0).toFixed(2);
} }
calScoreObtained() { calScoreObtainedBoss() {
return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtained, 0).toFixed(2); return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtained, 0).toFixed(2);
} }
calNetScore() { calNetScoreBoss() {
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.netScore = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScore, 0).toFixed(2)); this.appraisalPms.netScoreBoss = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScore, 0).toFixed(2));
return this.appraisalPms.netScore return this.appraisalPms.netScoreBoss
} }
return "0.00" return "0.00"
} }
calNetScoreEmp() { calNetScore() {
if (this.appraisalPms) { if (this.appraisalPms) {
this.appraisalPms.netScoreEmp = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScoreEmp, 0).toFixed(2)); this.appraisalPms.netScore = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScore, 0).toFixed(2));
return this.appraisalPms.netScoreEmp return this.appraisalPms.netScore
} }
return "0.00" return "0.00"
} }
...@@ -435,29 +485,29 @@ export class PmsKpiComponent { ...@@ -435,29 +485,29 @@ export class PmsKpiComponent {
} }
calExpectationScorePart5(data?: any) { calExpectationScorePart5(data?: any) {
if (data) { if (data) {
return data.reduce((sum: number, item: any) => sum + item.pmsWorkingTimScoreBoss, 0).toFixed(2); return data.reduce((sum: number, item: any) => sum + item.pmsWorkingTimeScoreBoss, 0).toFixed(2);
} }
return "0.00" return "0.00"
} }
calExpectationTotalScorePart5(data?: any) { calExpectationTotalScorePart5(data?: any) {
if (data) { if (data) {
return data.reduce((sum: number, item: any) => sum + (item.pmsWorkingTimScore * item.weight), 0).toFixed(2); return data.reduce((sum: number, item: any) => sum + (item.pmsWorkingTimeScore * item.weight), 0).toFixed(2);
} }
return "0.00" return "0.00"
} }
calExpectationTotalScoreBossPart5(data?: any) { calExpectationTotalScoreBossPart5(data?: any) {
if (data) { if (data) {
return data.reduce((sum: number, item: any) => sum + (item.pmsWorkingTimScoreBoss * item.weight), 0).toFixed(2); return data.reduce((sum: number, item: any) => sum + (item.pmsWorkingTimeScoreBoss * item.weight), 0).toFixed(2);
} }
return "0.00" return "0.00"
} }
setScorePart5(item: any, score: number) { setScorePart5(item: any, score: number) {
if (this.canEdit) { if (this.canEdit) {
if (this.evaluaterId == this.evaluateeId) { if (this.evaluaterId == this.evaluateeId) {
item.pmsWorkingTimScore = score item.pmsWorkingTimeScore = score
item.pmsWorkingTimScoreBoss = score item.pmsWorkingTimeScoreBoss = score
} else { } else {
item.pmsWorkingTimScoreBoss = score item.pmsWorkingTimeScoreBoss = score
} }
this.changePercentage() this.changePercentage()
} }
...@@ -553,7 +603,7 @@ export class PmsKpiComponent { ...@@ -553,7 +603,7 @@ export class PmsKpiComponent {
part5Remain() { part5Remain() {
if (this.appraisalPms?.part5Detail.length) { if (this.appraisalPms?.part5Detail.length) {
const remain = this.appraisalPms.part5Detail.filter(x => const remain = this.appraisalPms.part5Detail.filter(x =>
x.pmsWorkingTimScore == 0 && x.pmsWorkingTimScoreBoss == 0 x.pmsWorkingTimeScore == 0 && x.pmsWorkingTimeScoreBoss == 0
).length ).length
return remain return remain
} }
...@@ -599,11 +649,11 @@ export class PmsKpiComponent { ...@@ -599,11 +649,11 @@ export class PmsKpiComponent {
sendScorePart() { sendScorePart() {
if (this.appraisalPms) { if (this.appraisalPms) {
const gradeScore = this.groupGrade.dataList.find(item => Math.ceil(+this.calNetScore()) >= item.gradeMinScore && Math.ceil(+this.calNetScore()) <= item.gradeMaxScore); const gradeScore = this.groupGrade.dataList.find(item => Math.ceil(+this.calNetScoreBoss()) >= item.gradeMinScore && Math.ceil(+this.calNetScoreBoss()) <= item.gradeMaxScore);
const score = this.data8List.map((x, i) => ({ text: "PART " + (i + 1), score: this.numberFixed2(x.netScore) })).concat([{ text: "สุทธิ", score: this.calNetScore() + '' }, { text: "Grade", score: gradeScore?.gradeDetail || '' }]) const scoreBoss = this.data8List.map((x, i) => ({ text: this.partShow[i], score: this.numberFixed2(x.netScoreBoss) })).concat([{ text: "สุทธิ", score: this.calNetScoreBoss() + '' }, { text: "Grade", score: gradeScore?.gradeDetail || '' }])
const scoreEmp = this.data8List.map((x, i) => ({ text: "PART " + (i + 1), score: this.numberFixed2(x.netScoreEmp) })).concat([{ text: "สุทธิ", score: this.calNetScoreEmp() + '' }, { text: "Grade", score: gradeScore?.gradeDetail || '' }]) const score = this.data8List.map((x, i) => ({ text: this.partShow[i], score: this.numberFixed2(x.netScore) })).concat([{ text: "สุทธิ", score: this.calNetScore() + '' }, { text: "Grade", score: gradeScore?.gradeDetail || '' }])
this.scorePartBoss.emit(scoreBoss)
this.scorePart.emit(score) this.scorePart.emit(score)
this.scorePartEmp.emit(scoreEmp)
} }
} }
......
<ng-container *ngTemplateOutlet="pmsEvaluation"></ng-container>
<ng-template #pmsEvaluation>
<ng-container *ngIf="appraisalPms">
<div class="pb-2rem px-2rem">
<div id="hs-tab-js-vertical-1" role="tabpanel" aria-labelledby="hs-tab-js-vertical-item-1">
<div class="hs-accordion-group w-full" data-hs-accordion-always-open>
<ng-container *ngTemplateOutlet="part8"></ng-container>
<ng-container *ngTemplateOutlet="part9"></ng-container>
<ng-container *ngTemplateOutlet="part10"></ng-container>
</div>
</div>
</div>
</ng-container>
</ng-template>
<ng-template #noData>
</ng-template>
<ng-template #part8>
<div class="hs-accordion overflow-hidden bg-white border -mt-px first:rounded-t-sm last:rounded-b-sm dark:bg-bgdark dark:border-white/10"
id="hs-primary-heading-1">
<button (click)="scrollToTable($event)"
class="hs-accordion-toggle hs-accordion-active:text-white hs-accordion-active:bg-secondary group py-4 px-5 inline-flex items-center justify-between gap-x-3 w-full font-semibold text-start text-gray-800 transition hover:text-gray-500 dark:hs-accordion-active:text-white dark:text-gray-200 dark:hover:text-white/80"
aria-controls="hs-primary-collapse-1" type="button">
<div></div>
<span>
Part 8 : สรุปผลการปฏิบัติงาน (Summary)
</span>
<svg class="hs-accordion-active:hidden hs-accordion-active:text-white hs-accordion-active:group-hover:text-white block w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 5L8.16086 10.6869C8.35239 10.8637 8.64761 10.8637 8.83914 10.6869L15 5"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
<svg class="hs-accordion-active:block hs-accordion-active:text-white hs-accordion-active:group-hover:text-white hidden w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 11L8.16086 5.31305C8.35239 5.13625 8.64761 5.13625 8.83914 5.31305L15 11"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
<div id="hs-primary-collapse-1"
class="hs-accordion-content hidden !w-full overflow-hidden transition-[height] duration-300"
aria-labelledby="hs-primary-heading-1">
<div class="box-body p-0">
<div class="space-y-4">
<div class="overflow-auto rounded-top-0.65rem">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead class="height-50px">
<tr class="font-size-12px">
<ng-container
*ngFor="let item of ['การประเมินผล (Evaluation Factor)','คะแนนดิบคิดเป็นร้อยละ','ร้อยละของปัจจัย','คะแนนที่ได้คิดเป็นร้อยละ','คะแนนสุทธิ\n(Net Score)','ระดับผลการปฏิบัติงาน'];let i = index;let l = last">
<th scope="col"
class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700 ">{{ item }}</span>
<div *ngIf="!l" class="absolute top-1/2 transform -translate-y-1/2 right-0">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="data8List.length">
<ng-container *ngIf="part8show">
<tr *ngFor="let item of data8List;let i = index">
<td class="align-start !white-space-normal">
{{item.evaluationFactor}}
</td>
<td class="align-start !white-space-normal text-center">
{{item.rawScore}}
</td>
<td class="align-start !white-space-normal text-center">
{{item.factors}}
</td>
<td class="align-start !white-space-normal text-center">
{{numberFixed2(item.scoreObtained)}}
</td>
<td class="align-start !white-space-normal text-center">
{{numberFixed2(item.netScore)}}
</td>
<td></td>
</tr>
</ng-container>
<tr class="bg-table-soft-gray">
<td class="align-start text-center">
รวม
</td>
<td class="align-start text-center">
</td>
<td class="align-start text-center">
{{calFactors()}}
</td>
<td class="align-start text-center">
{{calScoreObtained()}}
</td>
<td class="align-start text-center">
{{calNetScore()}}
</td>
<td class="align-start !white-space-normal" *ngIf="appraisalPms">
<ng-container
*ngFor="let item of groupGrade.dataList; let i=index;let f= first">
<span style="display:flex;align-items:center" [class.mt-2]="!f">
<i *ngIf="appraisalPms.gradeScore==item.gradeDetail"
class="ri ri-star-fill pr-10px"></i>
<i *ngIf="appraisalPms.gradeScore!=item.gradeDetail"
class="ti ti-star pr-10px"></i>
{{item.gradeDetail}} = {{item.tdesc}}<br>
</span>
</ng-container>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</ng-template>
<ng-template #part9>
<div class="hs-accordion overflow-hidden bg-white border -mt-px first:rounded-t-sm last:rounded-b-sm dark:bg-bgdark dark:border-white/10"
id="hs-primary-heading-1">
<button (click)="scrollToTable($event)"
class="hs-accordion-toggle hs-accordion-active:text-white hs-accordion-active:bg-secondary group py-4 px-5 inline-flex items-center justify-between gap-x-3 w-full font-semibold text-start text-gray-800 transition hover:text-gray-500 dark:hs-accordion-active:text-white dark:text-gray-200 dark:hover:text-white/80"
aria-controls="hs-primary-collapse-1" type="button">
<div></div>
<span>
Part 9 : พฤติกรรมบุคคลที่เป็นจุดแข็ง จุดอ่อน และการพัฒนา
(EMPLOYEE STRENGTHS , WEAKNESSES AND PLAN TO IMPROVED)
</span>
<svg class="hs-accordion-active:hidden hs-accordion-active:text-white hs-accordion-active:group-hover:text-white block w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 5L8.16086 10.6869C8.35239 10.8637 8.64761 10.8637 8.83914 10.6869L15 5"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
<svg class="hs-accordion-active:block hs-accordion-active:text-white hs-accordion-active:group-hover:text-white hidden w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 11L8.16086 5.31305C8.35239 5.13625 8.64761 5.13625 8.83914 5.31305L15 11"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
<div id="hs-primary-collapse-1"
class="hs-accordion-content hidden !w-full overflow-hidden transition-[height] duration-300"
aria-labelledby="hs-primary-heading-1">
<div class="box-body p-0">
<div class="space-y-4">
<div class="pb-1rem" *ngIf="appraisalPms">
<div class="pb-2 grid grid-cols-2">
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
พฤติกรรมที่เป็นจุดแข็ง (EMPLOYEE STRENGTHS AND ACCOMPLISHMENTS)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.employeeStrengths"></textarea>
</div>
</div>
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
หัวข้อที่ต้องเรียนรู้เพิ่มเติม (สำหรับจุดแข็ง)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.learningTopicsForStrengths"></textarea>
</div>
</div>
</div>
<div class="pb-2 grid grid-cols-2">
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
พฤติกรรมที่เป็นจุดอ่อน (PERFORMANCE AREAS WHICH NEED IMPROVEMENT)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.performanceWeaknesses"></textarea>
</div>
</div>
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
หัวข้อที่ต้องเรียนรู้เพิ่มเติม (สำหรับจุดอ่อน)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.learningTopicsForWeaknesses"></textarea>
</div>
</div>
</div>
<div class="pb-2 grid grid-cols-2">
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
พฤติกรรมที่ควรได้รับการพัฒนา (PLAN OF ACTION TOWARD IMPROVED PERFORMANCE)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.improvementPlan"></textarea>
</div>
</div>
<div class="col-span-1 grid-cols-1 text-gray-400">
<div class="col-span-1 bg-soft-secondary p-2" style="min-height: 55px;">
หัวข้อที่ต้องเรียนรู้เพิ่มเติม (สำหรับพฤติกรรมที่ควรได้รับการพัฒนา)
</div>
<div class="col-span-1 p-2">
<textarea type="text" rows="2" class="ti-form-input"
[class.!bg-input-readonly]="!canEdit" [readonly]="!canEdit"
[(ngModel)]="appraisalPms.learningTopicsForImprovement"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
<ng-template #part10>
<div class="hs-accordion overflow-hidden bg-white border -mt-px first:rounded-t-sm last:rounded-b-sm dark:bg-bgdark dark:border-white/10"
id="hs-primary-heading-1">
<button (click)="scrollToTable($event)"
class="hs-accordion-toggle hs-accordion-active:text-white hs-accordion-active:bg-secondary group py-4 px-5 inline-flex items-center justify-between gap-x-3 w-full font-semibold text-start text-gray-800 transition hover:text-gray-500 dark:hs-accordion-active:text-white dark:text-gray-200 dark:hover:text-white/80"
aria-controls="hs-primary-collapse-1" type="button">
<div></div>
<span>
Part 10: คำชมหรือรางวัลที่ได้รับ (Conversation, Feedback, Recognise : CFR)
</span>
<svg class="hs-accordion-active:hidden hs-accordion-active:text-white hs-accordion-active:group-hover:text-white block w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 5L8.16086 10.6869C8.35239 10.8637 8.64761 10.8637 8.83914 10.6869L15 5"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
<svg class="hs-accordion-active:block hs-accordion-active:text-white hs-accordion-active:group-hover:text-white hidden w-3 h-3 text-gray-600 group-hover:text-gray-500 dark:text-white/70"
width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 11L8.16086 5.31305C8.35239 5.13625 8.64761 5.13625 8.83914 5.31305L15 11"
stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
<div id="hs-primary-collapse-1"
class="hs-accordion-content hidden !w-full overflow-hidden transition-[height] duration-300"
aria-labelledby="hs-primary-heading-1">
<div class="box-body p-0">
<div class="space-y-4">
<div class="pb-1rem p-2" *ngIf="appraisalPms">
<textarea type="text" rows="2" class="ti-form-input" [class.!bg-input-readonly]="!canEdit"
[readonly]="!canEdit" [(ngModel)]="appraisalPms.cfrDetail"></textarea>
</div>
</div>
</div>
</div>
</div>
</ng-template>
\ No newline at end of file
import { ChangeDetectorRef, Component, EventEmitter, Input, Output, SimpleChanges } from '@angular/core';
import { CompetencyGradeModel, MyCompetencyGradeModel } from 'src/app/shared/model/competency-grades.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service';
import { EmployeeService } from 'src/app/shared/services/employee.service';
import { PmsGroupGradeService } from 'src/app/shared/services/pms-group-grade.service';
import { SettingAssessmentService } from 'src/app/shared/services/setting-assessment.service';
import { Pms } from 'src/app/shared/model/competency.model';
export interface Part8Model {
id: number
evaluationFactor: string,
rawScore: number,
factors: number
scoreObtained: number
scoreObtainedEmp: number
netScore: number
netScoreEmp: number
}
export interface LevelStarModel {
evaluationFactor: string,
rawScore: number,
factors: number
scoreObtained: number
netScore: number
}
@Component({
selector: 'app-pms-summary',
templateUrl: './pms-summary.component.html',
styleUrls: ['./pms-summary.component.scss']
})
export class PmsSummaryComponent {
part1show = true
part2show = true
part3show = true
part4show = true
part5show = true
part6show = true
part7show = true
part8show = true
data8List: Part8Model[] = [{
id: 1,
evaluationFactor: "Part 1 : ประเมินผลการปฏิบัติงานตามนโยบายบริษัท (Corporate KPI)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
scoreObtainedEmp: 0,
netScore: 0,
netScoreEmp: 0,
}, {
id: 2,
evaluationFactor: "Part 2 : ประเมินผลการปฏิบัติงานประจำ (Department KPI)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, {
id: 3,
evaluationFactor: "Part 3 : ประเมินผลการปฏิบัติงานประจำ (Individual KPI)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, {
id: 4,
evaluationFactor: "Part 4 : ประเมินผลสมรรถนะที่สนับสนุนการปฏิบัติงาน (Competency)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, {
id: 5,
evaluationFactor: "Part 5 : อัตราการเข้างาน (Time Attendance)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, {
id: 6,
evaluationFactor: "Part 6 : งานที่ได้รับมอบหมายเพิ่มเติม (Cross Functional Project Assignment)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}, {
id: 7,
evaluationFactor: "Part 7 : กิจกรรมพิเศษ (Special Activities)",
rawScore: 100,
factors: 0,
scoreObtained: 0,
netScore: 0,
scoreObtainedEmp: 0,
netScoreEmp: 0,
}]
part9show = true
part10show = true
@Input() evaluateeId = ""
@Input() evaluaterId = ""
@Input() appraisalPms?: Pms
@Input() canEdit = false
@Input() currentStep = ""
@Input() dateIso = ""
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
@Output() kpiFormRemain: EventEmitter<any> = new EventEmitter<any>();
@Output() kpiForm: EventEmitter<any> = new EventEmitter<any>();
groupGrade: { loading: boolean, dataList: CompetencyGradeModel[] } = { loading: false, dataList: [] }
constructor(private appraisalService: AppraisalService,
private pmsGroupGradeService: PmsGroupGradeService,
private employeeService: EmployeeService,
private cdr: ChangeDetectorRef,
private settingAssessmentService: SettingAssessmentService
) {
}
// ngOnChanges(changes: SimpleChanges): void {
// if (changes['evaluateeId']?.currentValue || changes['evaluaterId']?.currentValue) {
// this.toggleAllParts(this.evaluateeId == this.evaluaterId)
// }
// }
ngOnInit(): void {
this.getPmsGroupGradeList()
this.getAppraisalPmsForm()
this.allFormRemain()
}
getAppraisalPmsForm() {
this.data8List.forEach((x, i) => {
if (x.id == 1 && this.appraisalPms?.part1Percentage) {
x.factors = this.appraisalPms.part1Percentage
} else if (x.id == 2 && this.appraisalPms?.part2Percentage) {
x.factors = this.appraisalPms.part2Percentage
} else if (x.id == 3 && this.appraisalPms?.part3Percentage) {
x.factors = this.appraisalPms.part3Percentage
} else if (x.id == 4 && this.appraisalPms?.part4Percentage) {
x.factors = this.appraisalPms.part4Percentage
} else if (x.id == 5 && this.appraisalPms?.part5Percentage) {
x.factors = this.appraisalPms.part5Percentage
} else if (x.id == 6 && this.appraisalPms?.part6Percentage) {
x.factors = this.appraisalPms.part6Percentage
} else if (x.id == 7 && this.appraisalPms?.part7Percentage) {
x.factors = this.appraisalPms.part7Percentage
}
})
if (!this.appraisalPms?.part1Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 1)
}
if (!this.appraisalPms?.part2Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 2)
}
if (!this.appraisalPms?.part3Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 3)
}
if (!this.appraisalPms?.part4Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 4)
}
if (!this.appraisalPms?.part5Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 5)
}
if (!this.appraisalPms?.part6Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 6)
}
if (!this.appraisalPms?.part7Detail.length) {
this.data8List = this.data8List.filter(item => item.id !== 7)
}
this.changePercentage()
if (this.appraisalPms) {
switch (this.currentStep) {
case ("0"): {
this.appraisalPms.apsassessyDate = this.dateIso
break
}
case ("1"): {
this.appraisalPms.apsapprove1Date = this.dateIso
break
}
case ("2"): {
this.appraisalPms.apsapprove2Date = this.dateIso
break
}
case ("3"): {
this.appraisalPms.apsapprove3Date = this.dateIso
break
}
case ("4"): {
this.appraisalPms.apsapprove4Date = this.dateIso
break
}
case ("5"): {
this.appraisalPms.apsapprove5Date = this.dateIso
break
}
default: { return }
}
}
this.cdr.detectChanges()
}
getPmsGroupGradeList() {
this.groupGrade.loading = true
this.pmsGroupGradeService.getGradeList().subscribe({
next: response => {
this.groupGrade.dataList = response.map(x => new MyCompetencyGradeModel(x))
this.groupGrade.loading = false
this.cdr.detectChanges()
}, error: error => {
this.groupGrade.loading = false
this.cdr.detectChanges()
}
})
}
returnPath() {
this.sendReturnPath.emit()
}
calRawScore(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.weight * 5, 0).toFixed(2);
}
return "0.00"
}
calWeigth(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.weight, 0).toFixed(2);
}
return "0.00"
}
calExpectationScore(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.scoreTopicExpectationBoss, 0).toFixed(2);
}
return "0.00"
}
calExpectationTotalScore(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + (item.scoreTopicExpectationBoss * item.weight), 0).toFixed(2);
}
return "0.00"
}
calExpectationTotalScoreEmp(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + (item.scoreTopicExpectation * item.weight), 0).toFixed(2);
}
return "0.00"
}
calPercentage(A: number, B: number) {
if (B > 0) {
return ((A / B) * 100).toFixed(2);
}
return "0.00"
}
changePercentage() {
this.data8List.forEach(x => {
if (x.id == 1 && this.appraisalPms?.part1Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail))
x.scoreObtainedEmp = +this.calPercentage(this.calExpectationTotalScoreEmp(this.appraisalPms?.part1Detail), this.calRawScore(this.appraisalPms?.part1Detail))
if (this.appraisalPms) {
this.appraisalPms.part1SumScore = x.scoreObtained
this.appraisalPms.part1SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 2 && this.appraisalPms?.part2Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part2Detail), this.calRawScore(this.appraisalPms?.part2Detail))
if (this.appraisalPms) {
this.appraisalPms.part2SumScore = x.scoreObtained
this.appraisalPms.part2SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 3 && this.appraisalPms?.part3Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part3Detail), this.calRawScore(this.appraisalPms?.part3Detail))
if (this.appraisalPms) {
this.appraisalPms.part3SumScore = x.scoreObtained
this.appraisalPms.part3SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 4 && this.appraisalPms?.part4Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScorePart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScorePart4(this.appraisalPms?.part4Detail), this.calRawScorePart4(this.appraisalPms?.part4Detail))
if (this.appraisalPms) {
this.appraisalPms.part4SumScore = x.scoreObtained
this.appraisalPms.part4SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 5 && this.appraisalPms?.part5Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScorePart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScorePart5(this.appraisalPms?.part5Detail), this.calRawScorePart5(this.appraisalPms?.part5Detail))
if (this.appraisalPms) {
this.appraisalPms.part5SumScore = x.scoreObtained
this.appraisalPms.part5SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 6 && this.appraisalPms?.part6Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part6Detail), this.calRawScore(this.appraisalPms?.part6Detail))
if (this.appraisalPms) {
this.appraisalPms.part6SumScore = x.scoreObtained
this.appraisalPms.part6SumScoreEmp = x.scoreObtainedEmp
}
} else if (x.id == 7 && this.appraisalPms?.part7Detail) {
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail))
x.scoreObtained = +this.calPercentage(this.calExpectationTotalScore(this.appraisalPms?.part7Detail), this.calRawScore(this.appraisalPms?.part7Detail))
if (this.appraisalPms) {
this.appraisalPms.part7SumScore = x.scoreObtained
this.appraisalPms.part7SumScoreEmp = x.scoreObtainedEmp
}
}
x.netScore = x.factors / 100 * x.scoreObtained
x.netScoreEmp = x.factors / 100 * x.scoreObtainedEmp
})
this.setGradeScore()
}
setGradeScore() {
const gradeScore = this.groupGrade.dataList.find(item => Math.ceil(+this.calNetScore()) >= item.gradeMinScore && Math.ceil(+this.calNetScore()) <= item.gradeMaxScore);
if (this.appraisalPms && gradeScore) {
this.appraisalPms.gradeScore = gradeScore.gradeDetail
}
}
calFactors() {
return this.data8List.reduce((sum: number, item: any) => sum + item.factors, 0).toFixed(2);
}
calScoreObtained() {
return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtained, 0).toFixed(2);
}
calNetScore() {
if (this.appraisalPms) {
this.appraisalPms.netScore = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScore, 0).toFixed(2));
return this.appraisalPms.netScore
}
return "0.00"
}
calAverage(score: number) {
const roundedScore = score % 1 <= 0.5 ? Math.floor(score) : Math.round(score);
if (roundedScore >= 90 && roundedScore <= 100) {
return 5;
} else if (roundedScore >= 80 && roundedScore <= 89) {
return 4;
} else if (roundedScore >= 60 && roundedScore <= 79) {
return 3;
} else if (roundedScore >= 40 && roundedScore <= 59) {
return 2;
} else {
return 1;
}
}
calRawScorePart4(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.competencyType.weight * 5, 0).toFixed(2);
}
return "0.00"
}
calWeigthPart4(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.competencyType.weight, 0).toFixed(2);
}
return "0.00"
}
calExpectationScorePart4(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + this.calAverage(item.averageScore), 0).toFixed(2);
}
return "0.00"
}
calExpectationTotalScorePart4(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + (item.competencyType.weight * this.calAverage(item.averageScore)), 0).toFixed(2);
}
return "0.00"
}
calRawScorePart5(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.weight * 5, 0).toFixed(2);
}
return "0.00"
}
calWeigthPart5(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.weight, 0).toFixed(2);
}
return "0.00"
}
calExpectationScorePart5(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + item.pmsWorkingTimScoreBoss, 0).toFixed(2);
}
return "0.00"
}
calExpectationTotalScorePart5(data?: any) {
if (data) {
return data.reduce((sum: number, item: any) => sum + (item.pmsWorkingTimScoreBoss * item.weight), 0).toFixed(2);
}
return "0.00"
}
setScorePart5(item: any, score: number) {
if (this.canEdit) {
if (this.evaluaterId == this.evaluateeId) {
item.pmsWorkingTimScore = score
item.pmsWorkingTimScoreBoss = score
} else {
item.pmsWorkingTimScoreBoss = score
}
this.changePercentage()
}
}
numberFixed2(data?: number) {
if (data) {
return data.toFixed(2)
}
return "0.00"
}
setScore(item: any, score: number) {
if (this.canEdit) {
if (this.evaluaterId == this.evaluateeId) {
item.scoreTopicExpectation = score
item.scoreTopicExpectationBoss = score
} else {
item.scoreTopicExpectationBoss = score
}
this.changePercentage()
}
}
convertDate(dateInput?: string | Date): string {
let date = new Date()
if (dateInput) {
if (typeof dateInput === 'string') {
const [year, month, day] = dateInput.split('-').map(Number);
date = new Date(year, month - 1, day);
} else {
date = dateInput
}
} else {
return ''
}
return date?.toLocaleDateString('th-TH', { day: 'numeric', month: 'long', year: 'numeric' }) || ''
}
toggleAllParts(check: boolean) {
this.part1show = check
this.part2show = check
this.part3show = check
this.part4show = check
this.part5show = check
this.part6show = check
this.part7show = check
this.part8show = check
this.part9show = check
this.part10show = check
}
scrollToTable(event: MouseEvent) {
const target = event.target as HTMLElement;
const position = target.getBoundingClientRect();
window.scrollTo({
top: position.top + window.scrollY - 100,
behavior: 'smooth'
});
}
part1Remain() {
if (this.appraisalPms?.part1Detail.length) {
const remain = this.appraisalPms.part1Detail.filter(x =>
x.scoreTopicExpectation == null && x.scoreTopicExpectationBoss == null
).length
return remain
}
return 2
}
part2Remain() {
if (this.appraisalPms?.part2Detail.length) {
const remain = this.appraisalPms.part2Detail.filter(x =>
x.scoreTopicExpectation == null && x.scoreTopicExpectationBoss == null
).length
return remain
}
return 0
}
part3Remain() {
if (this.appraisalPms?.part3Detail.length) {
const remain = this.appraisalPms.part3Detail.filter(x =>
x.scoreTopicExpectation == null && x.scoreTopicExpectationBoss == null
).length
return remain
}
return 0
}
part5Remain() {
if (this.appraisalPms?.part5Detail.length) {
const remain = this.appraisalPms.part5Detail.filter(x =>
x.pmsWorkingTimScore == null && x.pmsWorkingTimScoreBoss == null
).length
return remain
}
return 0
}
part6Remain() {
if (this.appraisalPms?.part6Detail.length) {
const remain = this.appraisalPms.part6Detail.filter(x =>
x.scoreTopicExpectation == null && x.scoreTopicExpectationBoss == null
).length
return remain
}
return 0
}
part7Remain() {
if (this.appraisalPms?.part7Detail.length) {
const remain = this.appraisalPms.part7Detail.filter(x =>
x.scoreTopicExpectation == null && x.scoreTopicExpectationBoss == null
).length
return remain
}
return 0
}
allFormRemain() {
const remain = [this.part1Remain(), this.part2Remain(), this.part3Remain(), this.part5Remain(), this.part6Remain(), this.part7Remain()].filter(data => data != 0).length
this.kpiForm.emit(this.appraisalPms)
this.kpiFormRemain.emit(remain)
}
}
...@@ -1097,8 +1097,8 @@ export interface Part5Detail { ...@@ -1097,8 +1097,8 @@ export interface Part5Detail {
targetCDetail: string targetCDetail: string
targetDDetail: string targetDDetail: string
targetEDetail: string targetEDetail: string
pmsWorkingTimScore: number pmsWorkingTimeScore: number
pmsWorkingTimScoreBoss: number pmsWorkingTimeScoreBoss: number
} }
export interface Part6Detail { export interface Part6Detail {
......
...@@ -713,26 +713,26 @@ export interface MasfromEvaluationAssessment1lList { ...@@ -713,26 +713,26 @@ export interface MasfromEvaluationAssessment1lList {
apsassessyComment: string apsassessyComment: string
apsassessyDate: string apsassessyDate: string
apsassessyStatus: string apsassessyStatus: string
averageScoreBoss: number
averageScore: number averageScore: number
averageScoreEmp: number
companyId: string companyId: string
competencyType: CompetencyType competencyType: CompetencyType
evaluationResults: string evaluationResults: string
lineNo: number lineNo: number
numberCheck1Boss: number
numberCheck2Boss: number
numberCheck3Boss: number
numberCheck4Boss: number
numberCheck5Boss: number
numberCheck1: number numberCheck1: number
numberCheck2: number numberCheck2: number
numberCheck3: number numberCheck3: number
numberCheck4: number numberCheck4: number
numberCheck5: number numberCheck5: number
numberCheck1Emp: number
numberCheck2Emp: number
numberCheck3Emp: number
numberCheck4Emp: number
numberCheck5Emp: number
plId: string plId: string
sumEvaluationResults: string sumEvaluationResults: string
weightedTotalBoss: number
weightedTotal: number weightedTotal: number
weightedTotalEmp: number
masfromEvaluationAssessment2List: MasfromEvaluationAssessment2List[] masfromEvaluationAssessment2List: MasfromEvaluationAssessment2List[]
} }
...@@ -2776,36 +2776,36 @@ export interface Pms { ...@@ -2776,36 +2776,36 @@ export interface Pms {
learningTopicsForStrengths: string learningTopicsForStrengths: string
learningTopicsForWeaknesses: string learningTopicsForWeaknesses: string
masfromStatusType: MasfromStatusType4 masfromStatusType: MasfromStatusType4
netScoreBoss: number
netScore: number netScore: number
netScoreEmp: number
part1Detail: Part1Detail[] part1Detail: Part1Detail[]
part1Percentage: number part1Percentage: number
part1SumScoreBoss: number
part1SumScore: number part1SumScore: number
part1SumScoreEmp: number
part2Detail: Part2Detail[] part2Detail: Part2Detail[]
part2Percentage: number part2Percentage: number
part2SumScoreBoss: number
part2SumScore: number part2SumScore: number
part2SumScoreEmp: number
part3Detail: Part3Detail[] part3Detail: Part3Detail[]
part3Percentage: number part3Percentage: number
part3SumScoreBoss: number
part3SumScore: number part3SumScore: number
part3SumScoreEmp: number
part4Detail: Part4Detail[] part4Detail: Part4Detail[]
part4Percentage: number part4Percentage: number
part4SumScoreBoss: number
part4SumScore: number part4SumScore: number
part4SumScoreEmp: number
part5Detail: Part5Detail[] part5Detail: Part5Detail[]
part5Percentage: number part5Percentage: number
part5SumScoreBoss: number
part5SumScore: number part5SumScore: number
part5SumScoreEmp: number
part6Detail: Part6Detail[] part6Detail: Part6Detail[]
part6Percentage: number part6Percentage: number
part6SumScoreBoss: number
part6SumScore: number part6SumScore: number
part6SumScoreEmp: number
part7Detail: Part7Detail[] part7Detail: Part7Detail[]
part7Percentage: number part7Percentage: number
part7SumScoreBoss: number
part7SumScore: number part7SumScore: number
part7SumScoreEmp: number
performanceWeaknesses: string performanceWeaknesses: string
personalLevel: PersonalLevel11 personalLevel: PersonalLevel11
pmsMasfromEvaluationRoundModel: PmsMasfromEvaluationRoundModel pmsMasfromEvaluationRoundModel: PmsMasfromEvaluationRoundModel
...@@ -3706,8 +3706,8 @@ export interface Part5Detail { ...@@ -3706,8 +3706,8 @@ export interface Part5Detail {
edesc: string edesc: string
performanceTargets: string performanceTargets: string
pmsWorkingTimeId: string pmsWorkingTimeId: string
pmsWorkingTimScore: number pmsWorkingTimeScore: number
pmsWorkingTimScoreBoss: number pmsWorkingTimeScoreBoss: number
targetADetail: string targetADetail: string
targetBDetail: string targetBDetail: string
targetCDetail: string targetCDetail: string
......
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