Commit 0520217b by Nattana Chaiyamat

เพิ่ม view แสดงคะแนนประเมินของลูกน้องกับหัวหน้า

parent 0dadc073
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
</a> </a>
</div> </div>
</th> </th>
<th scope="col" style="width: 500px;">ระดับความสามารถ <th scope="col"
[ngStyle]="{'width': (evaluaterId!=evaluateeId||currentStep != '0') ?'325px' :'500px;'}">
ระดับความสามารถ
<div class="hs-tooltip ti-main-tooltip [--trigger:hover]"> <div class="hs-tooltip ti-main-tooltip [--trigger:hover]">
<a class="hs-tooltip-toggle ti-main-tooltip-toggle" href="javascript:;"> <a class="hs-tooltip-toggle ti-main-tooltip-toggle" href="javascript:;">
<i class="ti ti-help-circle"></i> <i class="ti ti-help-circle"></i>
...@@ -97,13 +99,13 @@ ...@@ -97,13 +99,13 @@
</a> </a>
</div> </div>
</th> </th>
<th scope="col" *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">คะแนนลูกน้อง</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<ng-container <ng-container
*ngFor="let bi of item2.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList;let i2 = index;let f = first"> *ngFor="let bi of item2.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList;let i2 = index;let f = first">
<tr class="border-b border-gray-200" <tr class="border-b border-gray-200" (mouseenter)="tableHover.set(bi.behavioralIndicators,true)"
(mouseenter)="tableHover.set(bi.behavioralIndicators,true)"
(mouseleave)="tableHover.clear()" (mouseleave)="tableHover.clear()"
[ngStyle]="{'background':tableHover.get(bi.behavioralIndicators)?'#f1f5f9':'#ffffff'}"> [ngStyle]="{'background':tableHover.get(bi.behavioralIndicators)?'#f1f5f9':'#ffffff'}">
<td class="py-2" style="vertical-align: top">{{bi.behavioralIndicators}}</td> <td class="py-2" style="vertical-align: top">{{bi.behavioralIndicators}}</td>
...@@ -112,17 +114,35 @@ ...@@ -112,17 +114,35 @@
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
<div class="flex flex-row justify-center gap-2 mb-2"> <div class="flex flex-row justify-center gap-2 mb-2">
<ng-container *ngFor="let item of [5,4,3,2,1];let f = first"> <ng-container *ngFor="let item of [5,4,3,2,1];let f = first">
<button type="button" class="h-12 w-12 p-0 shadow border text-soft-secondary-no-hover bg-white" <ng-container *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">
style="border-radius:10px" <button type="button"
(mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)" class="h-12 w-12 p-0 shadow border text-soft-secondary-no-hover bg-white"
(mouseleave)="biScore.clear()" style="border-radius:10px"
(click)="bi.competencyBehavioral.scoreTopicExpectation=item;calnumberCheck()" [ngClass]="{ (mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)"
'!border-secondary': bi.competencyBehavioral.scoreTopicExpectation>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item , (mouseleave)="biScore.clear()"
'!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectation>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item, (click)="bi.competencyBehavioral.scoreTopicExpectation=item;calnumberCheck()" [ngClass]="{
'!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectation==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item , '!border-secondary': bi.competencyBehavioral.scoreTopicExpectation>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item ,
'pointer-events-none':!canEdit}"> '!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectation>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item,
{{item}} '!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectation==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item ,
</button> 'pointer-events-none':!canEdit}">
{{item}}
</button>
</ng-container>
<ng-container *ngIf="!(evaluaterId!=evaluateeId||currentStep != '0')">
<button type="button"
class="h-12 w-12 p-0 shadow border text-soft-secondary-no-hover bg-white"
style="border-radius:10px"
(mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)"
(mouseleave)="biScore.clear()"
(click)="bi.competencyBehavioral.scoreTopicExpectationEmp=item;bi.competencyBehavioral.scoreTopicExpectation=item;calnumberCheck()"
[ngClass]="{
'!border-secondary': bi.competencyBehavioral.scoreTopicExpectation>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item ,
'!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectation>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item,
'!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectation==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item ,
'pointer-events-none':!canEdit}">
{{item}}
</button>
</ng-container>
</ng-container> </ng-container>
</div> </div>
<div class="flex justify-center" style="height: 20px;white-space: nowrap; overflow: visible"> <div class="flex justify-center" style="height: 20px;white-space: nowrap; overflow: visible">
...@@ -134,6 +154,10 @@ ...@@ -134,6 +154,10 @@
</span> </span>
</div> </div>
</td> </td>
<td class="py-2 text-center text-indigo-600 font-semibold" style="vertical-align: top"
*ngIf="evaluaterId!=evaluateeId||currentStep != '0'">
{{bi.competencyBehavioral.scoreTopicExpectationEmp}}
</td>
</tr> </tr>
</ng-container> </ng-container>
</tbody> </tbody>
......
...@@ -55,11 +55,17 @@ export class PmsFormEmployeeComponent { ...@@ -55,11 +55,17 @@ export class PmsFormEmployeeComponent {
compentencyScore: String[] = [] compentencyScore: String[] = []
compentencyWeightScore = "" compentencyWeightScore = ""
compentencyGap = "" compentencyGap = ""
compentencyScoreEmp: String[] = []
compentencyWeightScoreEmp = ""
compentencyGapEmp = ""
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>()
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>()
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
<th scope="col">แบบการประเมิน</th> <th scope="col">แบบการประเมิน</th>
<th scope="col text-center">วันที่เริ่มต้น</th> <th scope="col text-center">วันที่เริ่มต้น</th>
<th scope="col text-center">วันที่สิ้นสุด</th> <th scope="col text-center">วันที่สิ้นสุด</th>
<th scope="col text-center" *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">คะแนนเฉลี่ยลูกน้อง
</th>
<th scope="col text-center">คะแนนเฉลี่ย</th> <th scope="col text-center">คะแนนเฉลี่ย</th>
<th scope="col text-center" *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">ผล GAP ลูกน้อง</th>
<th scope="col text-center">ผล GAP</th> <th scope="col text-center">ผล GAP</th>
<th scope="col text-center">การจัดการ</th> <th scope="col text-center">การจัดการ</th>
</tr> </tr>
...@@ -33,9 +36,18 @@ ...@@ -33,9 +36,18 @@
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{formatThaiDate(item.masfromEvaluationRound.apsPeriodEnd)}} {{formatThaiDate(item.masfromEvaluationRound.apsPeriodEnd)}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"
*ngIf="evaluaterId!=evaluateeId||currentStep != '0'">
{{inforWeightEmp.get(item.comType)!=='undefined' && inforWeightEmp.get(item.comType)
!=='null'?inforWeightEmp.get(item.comType): '0'}}
</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'}} {{inforWeight.get(item.comType) !=='null'?inforWeight.get(item.comType): '0'}}
</td> </td>
<td class="py-2 text-center" style="vertical-align: top"
*ngIf="evaluaterId!=evaluateeId||currentStep != '0'">
{{inforGapEmp.get(item.comType)!=='null'?inforGapEmp.get(item.comType): ''}}
</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): ''}} {{inforGap.get(item.comType)!=='null'?inforGap.get(item.comType): ''}}
</td> </td>
...@@ -67,6 +79,7 @@ ...@@ -67,6 +79,7 @@
<th scope="col">แบบการประเมิน</th> <th scope="col">แบบการประเมิน</th>
<th scope="col text-center">วันที่เริ่มต้น</th> <th scope="col text-center">วันที่เริ่มต้น</th>
<th scope="col text-center">วันที่สิ้นสุด</th> <th scope="col text-center">วันที่สิ้นสุด</th>
<th scope="col text-center">ผลการประเมินลูกน้อง</th>
<th scope="col text-center">ผลการประเมิน</th> <th scope="col text-center">ผลการประเมิน</th>
<th scope="col text-center">เกรด</th> <th scope="col text-center">เกรด</th>
<th scope="col text-center">การจัดการ</th> <th scope="col text-center">การจัดการ</th>
...@@ -85,6 +98,10 @@ ...@@ -85,6 +98,10 @@
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{formatThaiDate(appraisalPms.pmsMasfromEvaluationRoundModel.apsPeriodEnd)}} {{formatThaiDate(appraisalPms.pmsMasfromEvaluationRoundModel.apsPeriodEnd)}}
</td> </td>
<td *ngIf="evaluaterId!=evaluateeId||currentStep != '0'" class="py-2 text-center"
style="vertical-align: top">
{{kpiScoreEmp}}
</td>
<td class="py-2 text-center" style="vertical-align: top"> <td class="py-2 text-center" style="vertical-align: top">
{{kpiScore}} {{kpiScore}}
</td> </td>
......
...@@ -11,11 +11,17 @@ export class PmsInformationComponent { ...@@ -11,11 +11,17 @@ export class PmsInformationComponent {
@Input() statusType = '' @Input() statusType = ''
@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() kpiScore: string = "" @Input() kpiScore: string = ""
@Input() kpiScoreEmp: string = ""
@Input() kpiGrade: string = "" @Input() kpiGrade: string = ""
@Input() kpiName: string = "" @Input() kpiName: string = ""
@Input() evaluateeId = ""
@Input() evaluaterId = ""
@Input() currentStep = ""
@Output() sendCurrentTap: EventEmitter<any> = new EventEmitter<any>(); @Output() sendCurrentTap: EventEmitter<any> = new EventEmitter<any>();
@Output() sendCurrentPart: EventEmitter<any> = new EventEmitter<any>(); @Output() sendCurrentPart: EventEmitter<any> = new EventEmitter<any>();
tableHover: Map<string, boolean> = new Map<string, boolean>() tableHover: Map<string, boolean> = new Map<string, boolean>()
......
...@@ -110,6 +110,7 @@ export class PmsKpiComponent { ...@@ -110,6 +110,7 @@ export class PmsKpiComponent {
@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() 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>();
...@@ -354,13 +355,7 @@ export class PmsKpiComponent { ...@@ -354,13 +355,7 @@ export class PmsKpiComponent {
calScoreObtainedEmp() { calScoreObtainedEmp() {
return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtainedEmp, 0).toFixed(2); return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtainedEmp, 0).toFixed(2);
} }
calNetScoreEmp() {
if (this.appraisalPms) {
this.appraisalPms.netScoreEmp = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScoreEmp, 0).toFixed(2));
return this.appraisalPms.netScoreEmp
}
return "0.00"
}
calScoreObtained() { calScoreObtained() {
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);
} }
...@@ -371,7 +366,13 @@ export class PmsKpiComponent { ...@@ -371,7 +366,13 @@ export class PmsKpiComponent {
} }
return "0.00" return "0.00"
} }
calNetScoreEmp() {
if (this.appraisalPms) {
this.appraisalPms.netScoreEmp = +(this.data8List.reduce((sum: number, item: any) => sum + item.netScoreEmp, 0).toFixed(2));
return this.appraisalPms.netScoreEmp
}
return "0.00"
}
calAverage(score: number) { calAverage(score: number) {
const roundedScore = score % 1 <= 0.5 ? Math.floor(score) : Math.round(score); const roundedScore = score % 1 <= 0.5 ? Math.floor(score) : Math.round(score);
...@@ -599,7 +600,9 @@ export class PmsKpiComponent { ...@@ -599,7 +600,9 @@ export class PmsKpiComponent {
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.calNetScore()) >= item.gradeMinScore && Math.ceil(+this.calNetScore()) <= 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 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 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 || '' }])
this.scorePart.emit(score) this.scorePart.emit(score)
this.scorePartEmp.emit(scoreEmp)
} }
} }
......
...@@ -715,6 +715,7 @@ export interface MasfromEvaluationAssessment1lList { ...@@ -715,6 +715,7 @@ export interface MasfromEvaluationAssessment1lList {
apsassessyDate: string apsassessyDate: string
apsassessyStatus: string apsassessyStatus: string
averageScore: number averageScore: number
averageScoreEmp: number
companyId: string companyId: string
competencyType: CompetencyType competencyType: CompetencyType
evaluationResults: string evaluationResults: string
...@@ -724,9 +725,15 @@ export interface MasfromEvaluationAssessment1lList { ...@@ -724,9 +725,15 @@ export interface MasfromEvaluationAssessment1lList {
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
weightedTotal: number weightedTotal: number
weightedTotalEmp: number
masfromEvaluationAssessment2List: MasfromEvaluationAssessment2List[] masfromEvaluationAssessment2List: MasfromEvaluationAssessment2List[]
} }
...@@ -869,6 +876,7 @@ export interface BehavioralIndicatorsList { ...@@ -869,6 +876,7 @@ export interface BehavioralIndicatorsList {
export interface CompetencyBehavioral { export interface CompetencyBehavioral {
scoreTopicExpectation: number scoreTopicExpectation: number
scoreTopicExpectationEmp: number
companyId: string companyId: 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