Commit 0520217b by Nattana Chaiyamat

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

parent 0dadc073
......@@ -71,7 +71,9 @@
</a>
</div>
</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]">
<a class="hs-tooltip-toggle ti-main-tooltip-toggle" href="javascript:;">
<i class="ti ti-help-circle"></i>
......@@ -97,13 +99,13 @@
</a>
</div>
</th>
<th scope="col" *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">คะแนนลูกน้อง</th>
</tr>
</thead>
<tbody>
<ng-container
*ngFor="let bi of item2.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList;let i2 = index;let f = first">
<tr class="border-b border-gray-200"
(mouseenter)="tableHover.set(bi.behavioralIndicators,true)"
<tr class="border-b border-gray-200" (mouseenter)="tableHover.set(bi.behavioralIndicators,true)"
(mouseleave)="tableHover.clear()"
[ngStyle]="{'background':tableHover.get(bi.behavioralIndicators)?'#f1f5f9':'#ffffff'}">
<td class="py-2" style="vertical-align: top">{{bi.behavioralIndicators}}</td>
......@@ -112,17 +114,35 @@
<td class="py-2 text-center" style="vertical-align: top">
<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">
<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.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 *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.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 *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>
</div>
<div class="flex justify-center" style="height: 20px;white-space: nowrap; overflow: visible">
......@@ -134,6 +154,10 @@
</span>
</div>
</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>
</ng-container>
</tbody>
......
......@@ -55,11 +55,17 @@ export class PmsFormEmployeeComponent {
compentencyScore: String[] = []
compentencyWeightScore = ""
compentencyGap = ""
compentencyScoreEmp: String[] = []
compentencyWeightScoreEmp = ""
compentencyGapEmp = ""
inforWeight: 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 }[] = []
kpiScorePartEmp: { text: string, score: string }[] = []
menuClose: Map<string, boolean> = new Map<string, boolean>()
......
......@@ -13,7 +13,10 @@
<th scope="col">แบบการประเมิน</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" *ngIf="evaluaterId!=evaluateeId||currentStep != '0'">ผล GAP ลูกน้อง</th>
<th scope="col text-center">ผล GAP</th>
<th scope="col text-center">การจัดการ</th>
</tr>
......@@ -33,9 +36,18 @@
<td class="py-2 text-center" style="vertical-align: top">
{{formatThaiDate(item.masfromEvaluationRound.apsPeriodEnd)}}
</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">
{{inforWeight.get(item.comType) !=='null'?inforWeight.get(item.comType): '0'}}
</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">
{{inforGap.get(item.comType)!=='null'?inforGap.get(item.comType): ''}}
</td>
......@@ -67,6 +79,7 @@
<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>
......@@ -85,6 +98,10 @@
<td class="py-2 text-center" style="vertical-align: top">
{{formatThaiDate(appraisalPms.pmsMasfromEvaluationRoundModel.apsPeriodEnd)}}
</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">
{{kpiScore}}
</td>
......
......@@ -11,11 +11,17 @@ export class PmsInformationComponent {
@Input() statusType = ''
@Input() inforWeight: 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() appraisalPms?: Pms
@Input() kpiScore: string = ""
@Input() kpiScoreEmp: string = ""
@Input() kpiGrade: string = ""
@Input() kpiName: string = ""
@Input() evaluateeId = ""
@Input() evaluaterId = ""
@Input() currentStep = ""
@Output() sendCurrentTap: EventEmitter<any> = new EventEmitter<any>();
@Output() sendCurrentPart: EventEmitter<any> = new EventEmitter<any>();
tableHover: Map<string, boolean> = new Map<string, boolean>()
......
......@@ -110,6 +110,7 @@ export class PmsKpiComponent {
@Output() kpiFormRemain: EventEmitter<any> = new EventEmitter<any>();
@Output() kpiForm: 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: [] }
@ViewChild('scrollContainer') scrollContainer!: ElementRef;
@Output() scrollToMenuId: EventEmitter<any> = new EventEmitter<any>();
......@@ -354,13 +355,7 @@ export class PmsKpiComponent {
calScoreObtainedEmp() {
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() {
return this.data8List.reduce((sum: number, item: any) => sum + item.scoreObtained, 0).toFixed(2);
}
......@@ -371,7 +366,13 @@ export class PmsKpiComponent {
}
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) {
const roundedScore = score % 1 <= 0.5 ? Math.floor(score) : Math.round(score);
......@@ -599,7 +600,9 @@ export class PmsKpiComponent {
if (this.appraisalPms) {
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 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.scorePartEmp.emit(scoreEmp)
}
}
......
......@@ -715,6 +715,7 @@ export interface MasfromEvaluationAssessment1lList {
apsassessyDate: string
apsassessyStatus: string
averageScore: number
averageScoreEmp: number
companyId: string
competencyType: CompetencyType
evaluationResults: string
......@@ -724,9 +725,15 @@ export interface MasfromEvaluationAssessment1lList {
numberCheck3: number
numberCheck4: number
numberCheck5: number
numberCheck1Emp: number
numberCheck2Emp: number
numberCheck3Emp: number
numberCheck4Emp: number
numberCheck5Emp: number
plId: string
sumEvaluationResults: string
weightedTotal: number
weightedTotalEmp: number
masfromEvaluationAssessment2List: MasfromEvaluationAssessment2List[]
}
......@@ -869,6 +876,7 @@ export interface BehavioralIndicatorsList {
export interface CompetencyBehavioral {
scoreTopicExpectation: number
scoreTopicExpectationEmp: number
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