Commit 30f5cafe by Nattana Chaiyamat

ประเมิน competency

parent e9df7494
...@@ -369,7 +369,7 @@ ...@@ -369,7 +369,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu1Modal.search" placeholder="Search" [(ngModel)]="bu1Modal.search"
(ngModelChange)="onBu1ModalSearchChange()"> (ngModelChange)="onBu1ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu2Modal.search" placeholder="Search" [(ngModel)]="bu2Modal.search"
(ngModelChange)="onBu2ModalSearchChange()"> (ngModelChange)="onBu2ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="search" (ngModelChange)="searchChange()"> [(ngModel)]="search" (ngModelChange)="searchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="bu3Table.search" (ngModelChange)="onBu3TableSearchChange()"> [(ngModel)]="bu3Table.search" (ngModelChange)="onBu3TableSearchChange()">
<div <div
...@@ -493,7 +493,7 @@ ...@@ -493,7 +493,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu3Modal.search" placeholder="Search" [(ngModel)]="bu3Modal.search"
(ngModelChange)="onBu3ModalSearchChange()"> (ngModelChange)="onBu3ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="bu7Table.search" (ngModelChange)="onBu7TableSearchChange()"> [(ngModel)]="bu7Table.search" (ngModelChange)="onBu7TableSearchChange()">
<div <div
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu6Modal.search" placeholder="Search" [(ngModel)]="bu6Modal.search"
(ngModelChange)="onBu6ModalSearchChange()"> (ngModelChange)="onBu6ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
...@@ -493,7 +493,7 @@ ...@@ -493,7 +493,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu7Modal.search" placeholder="Search" [(ngModel)]="bu7Modal.search"
(ngModelChange)="onBu7ModalSearchChange()"> (ngModelChange)="onBu7ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="bu4Table.search" (ngModelChange)="onBu4TableSearchChange()"> [(ngModel)]="bu4Table.search" (ngModelChange)="onBu4TableSearchChange()">
<div <div
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu3Modal.search" placeholder="Search" [(ngModel)]="bu3Modal.search"
(ngModelChange)="onBu3ModalSearchChange()"> (ngModelChange)="onBu3ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu4Modal.search" placeholder="Search" [(ngModel)]="bu4Modal.search"
(ngModelChange)="onBu4ModalSearchChange()"> (ngModelChange)="onBu4ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="bu6Table.search" (ngModelChange)="onBu6TableSearchChange()"> [(ngModel)]="bu6Table.search" (ngModelChange)="onBu6TableSearchChange()">
<div <div
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu5Modal.search" placeholder="Search" [(ngModel)]="bu5Modal.search"
(ngModelChange)="onBu5ModalSearchChange()"> (ngModelChange)="onBu5ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu6Modal.search" placeholder="Search" [(ngModel)]="bu6Modal.search"
(ngModelChange)="onBu6ModalSearchChange()"> (ngModelChange)="onBu6ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search"
[(ngModel)]="bu5Table.search" (ngModelChange)="onBu5TableSearchChange()"> [(ngModel)]="bu5Table.search" (ngModelChange)="onBu5TableSearchChange()">
<div <div
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu4Modal.search" placeholder="Search" [(ngModel)]="bu4Modal.search"
(ngModelChange)="onBu4ModalSearchChange()"> (ngModelChange)="onBu4ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
...@@ -495,7 +495,7 @@ ...@@ -495,7 +495,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="bu5Modal.search" placeholder="Search" [(ngModel)]="bu5Modal.search"
(ngModelChange)="onBu5ModalSearchChange()"> (ngModelChange)="onBu5ModalSearchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " <input type="text" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name" [(ngModel)]="search" (ngModelChange)="searchChange()"> placeholder="Search" [(ngModel)]="search" (ngModelChange)="searchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i> <i class="ri-search-line text-gray"></i>
......
<div class="bg-card-white">
</div>
<ng-container *ngIf="appraisalCompentency.data"> <ng-container *ngIf="appraisalCompentency.data">
<div class="pb-2rem px-2rem pt-1.5rem w-full min-height-50px justify-between items-center"> <div class="pb-2rem px-2rem pt-1.5rem w-full min-height-50px justify-between items-center">
<div class="flex"> <div class="flex">
......
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { AppraisalCompentencyModel2 } from 'src/app/shared/model/appraisal-competency.model'; import { AppraisalCompentencyModel2 } from 'src/app/shared/model/appraisal-competency.model';
import { SettingAssessmentModel, MySettingAssessmentModel } from 'src/app/shared/model/setting-assessment.model'; import { SettingAssessmentModel, MySettingAssessmentModel } from 'src/app/shared/model/setting-assessment.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service'; import { AppraisalService } from 'src/app/shared/services/appraisal.service';
...@@ -15,6 +15,7 @@ export class EvaluationComponent implements OnInit { ...@@ -15,6 +15,7 @@ export class EvaluationComponent implements OnInit {
@Input() evaluateeId = "" @Input() evaluateeId = ""
@Input() evaluaterId = "" @Input() evaluaterId = ""
@Input() competencyTypeId = "" @Input() competencyTypeId = ""
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
canEdit = false canEdit = false
hoveredCode: string | null = null; hoveredCode: string | null = null;
currentDate = new Date() currentDate = new Date()
...@@ -211,12 +212,7 @@ export class EvaluationComponent implements OnInit { ...@@ -211,12 +212,7 @@ export class EvaluationComponent implements OnInit {
return isNaN(num) ? 0 : +num.toFixed(2); return isNaN(num) ? 0 : +num.toFixed(2);
} }
returnPath() { returnPath() {
// if (this.byBoss) { this.sendReturnPath.emit()
// this.returnPageEvalution()
// } else {
// this.currentTemplate = this.selfEvaluation;
// this.pathTitle = ['การประเมินผล', 'ประเมินตนเอง']
// }
} }
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<nav class=" flex space-x-2 rtl:space-x-reverse"> <nav class=" flex space-x-2 rtl:space-x-reverse">
<a *ngFor="let item of appraisalCompentency.dataList; let i=index ; let f= first" <a *ngFor="let item of appraisalCompentency.dataList; let i=index ; let f= first"
class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900" class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900"
[class.active]="f" href="javascript:void(0);" id="card-type-item-1" [class.active]="f" href="javascript:void(0);" [id]="'card-type-item-'+(i+1)"
[attr.data-hs-tab]="'#underline-'+(i+1)" aria-controls="underline-1" [attr.data-hs-tab]="'#underline-'+(i+1)" [attr.aria-controls]="'underline-'+(i+1)"
(click)="selectAppraisalCompentency(item)"> (click)="selectAppraisalCompentency(item)">
รอบการประเมินที่ {{i+1}}/{{appraisalCompentency.dataList.length}} รอบการประเมินที่ {{i+1}}/{{appraisalCompentency.dataList.length}}
</a> </a>
...@@ -201,7 +201,8 @@ ...@@ -201,7 +201,8 @@
<ng-template #selfEvaluationEdit> <ng-template #selfEvaluationEdit>
<app-evaluation [evaluationRoundId]="appraisalCompentency.select?.masfromEvaluationRound?.evaluationRoundId || ''" <app-evaluation (sendReturnPath)="currentTemplate = this.selfEvaluation"
[evaluationRoundId]="appraisalCompentency.select?.masfromEvaluationRound?.evaluationRoundId || ''"
[evaluaterId]="evaluatee.data.employeeId" [evaluateeId]="evaluatee.data.employeeId" [evaluaterId]="evaluatee.data.employeeId" [evaluateeId]="evaluatee.data.employeeId"
[competencyTypeId]="competencyTypeId"></app-evaluation> [competencyTypeId]="competencyTypeId"></app-evaluation>
</ng-template> </ng-template>
\ No newline at end of file
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
ประเมินผลประจำปี {{currentDate.getFullYear()}} ประเมินผลประจำปี {{currentDate.getFullYear()}}
</div> </div>
<div class="pt-0.75rem"> <div class="pt-0.75rem">
<div class=" px-2rem" [ngClass]="{'border-gray-200 border-b': subordinate.dataListRound.length}"> <div class=" px-2rem" [ngClass]="{'border-gray-200 border-b': subordinate.dataList.length}">
<nav class=" flex space-x-2 rtl:space-x-reverse"> <nav class=" flex space-x-2 rtl:space-x-reverse">
<a *ngFor="let item of subordinate.dataListRound; let i=index ; let f= first" <a *ngFor="let item of subordinate.dataList; let i=index ; let f= first"
class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900" class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900"
[class.active]="f" href="javascript:void(0);" id="card-type-item-1" [class.active]="f" href="javascript:void(0);" [id]="'card-type-item-'+(i+1)"
[attr.data-hs-tab]="'#underline-'+(i+1)" aria-controls="underline-1" [attr.data-hs-tab]="'#underline-'+(i+1)" [attr.aria-controls]="'underline-'+(i+1)"
(click)="selectDataListRound(item)"> (click)="selectDataList(item)">
รอบการประเมินที่ {{i+1}}/{{subordinate.dataListRound.length}} รอบการประเมินที่ {{i+1}}/{{subordinate.dataList.length}}
</a> </a>
</nav> </nav>
</div> </div>
</div> </div>
<div class="pt-50px pb-2rem" *ngIf="subordinate.dataListRound.length"> <div class="pt-50px pb-2rem" *ngIf="subordinate.dataList.length">
<div class="header-title-type p-0 px-2rem"> <div class="header-title-type p-0 px-2rem">
<div class="flex justify-end"> <div class="flex justify-end">
<div class="px-1"> <div class="px-1">
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<button type="button" class="ti-btn rounded-sm ti-btn-soft-success" <button type="button" class="ti-btn rounded-sm ti-btn-soft-success"
*ngFor="let type of item.typeList" *ngFor="let type of item.typeList"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;" style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item,type.shortName,type.shortName);pageEvalution='evaluation'"> (click)="selectSubordinate(item,type.competencyTypeId,subordinate.select?.evaluationRoundId);pageEvalution='evaluation'">
{{type.shortName}} {{type.shortName}}
</button> </button>
</div> </div>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<td class="text-center" style="font-size: 12px;">{{item.sumScore}}</td> <td class="text-center" style="font-size: 12px;">{{item.sumScore}}</td>
<td class="text-center" style="font-size: 12px;">{{item.gread}}</td> <td class="text-center" style="font-size: 12px;">{{item.gread}}</td>
<td class="text-center" style="font-size: 12px;"> <td class="text-center" style="font-size: 12px;">
{{item.masfromStatusType.tdesc}} <!-- {{item.masfromStatusType.tdesc}} -->
</td> </td>
<td class="text-center" style="font-size: 12px;">{{item.apsapproveType.tdesc}} <td class="text-center" style="font-size: 12px;">{{item.apsapproveType.tdesc}}
</td> </td>
...@@ -187,6 +187,7 @@ ...@@ -187,6 +187,7 @@
<app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution> <app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution>
</ng-container> </ng-container>
<ng-container *ngIf="pageEvalution=='evaluation'"> <ng-container *ngIf="pageEvalution=='evaluation'">
<app-evaluation [evaluationRoundId]="evaluationRoundId" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId" <app-evaluation (sendReturnPath)="pageEvalution=''" [evaluationRoundId]="formEvaluation.evaluationRoundId"
[competencyTypeId]="competencyTypeId"></app-evaluation> [evaluaterId]="formEvaluation.evaluaterId" [evaluateeId]="formEvaluation.evaluateeId"
[competencyTypeId]="formEvaluation.competencyTypeId"></app-evaluation>
</ng-container> </ng-container>
\ No newline at end of file
import { ChangeDetectorRef, Component } from '@angular/core'; import { ChangeDetectorRef, Component } from '@angular/core';
import { AppraisalSubordinateModel, MyAppraisalSubordinateModel } from 'src/app/shared/model/appraisal-subordinate.model'; import { AppraisalSubordinateModel, Masfromevaluationassessment } from 'src/app/shared/model/appraisal-subordinate.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service'; import { AppraisalService } from 'src/app/shared/services/appraisal.service';
@Component({ @Component({
...@@ -11,27 +11,32 @@ export class SupervisorEvaluationComponent { ...@@ -11,27 +11,32 @@ export class SupervisorEvaluationComponent {
pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า'] pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']
pageEvalution = '' pageEvalution = ''
currentDate = new Date() currentDate = new Date()
subordinate: { loading: false, select: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[], dataListRound: AppraisalSubordinateModel[][] } = { loading: false, select: new MyAppraisalSubordinateModel(), dataListRound: [], dataList: [] } subordinate: { loading: false, select?: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[] } = { loading: false, select: undefined, dataList: [] }
search = "" search = ""
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1) page = Array.from({ length: 1 }, (_, i) => i + 1)
formEvaluation = {
evaluateeId = "" evaluateeId: "",
evaluaterId = "" evaluaterId: "",
competencyTypeId = "" competencyTypeId: "",
evaluationRoundId = "" evaluationRoundId: ""
}
constructor(private appraisalService: AppraisalService, constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) { private cdr: ChangeDetectorRef) {
} }
ngOnInit(): void { ngOnInit(): void {
this.evaluaterId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').employeeid this.formEvaluation.evaluaterId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').employeeid
this.getBossList() this.getBossList()
} }
getBossList() { getBossList() {
this.appraisalService.getBossList().subscribe({ this.appraisalService.getBossList().subscribe({
next: response => { next: response => {
this.subordinate.dataListRound = [response.map(x => new MyAppraisalSubordinateModel(x))] this.subordinate.dataList = JSON.parse(JSON.stringify(response))
this.subordinate.dataList = this.subordinate.dataListRound.map(x => x.map(y => new MyAppraisalSubordinateModel(y)))?.[0] || [] this.cdr.detectChanges()
if (this.subordinate.dataList.length) {
this.subordinate.select = JSON.parse(JSON.stringify(this.subordinate.dataList[0]))
}
console.log(" 🐒 subordinate.dataList.length:", this.subordinate.dataList.length)
this.searchChange() this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
}, error: error => { }, error: error => {
...@@ -39,27 +44,34 @@ export class SupervisorEvaluationComponent { ...@@ -39,27 +44,34 @@ export class SupervisorEvaluationComponent {
} }
}) })
} }
selectDataList(data: AppraisalSubordinateModel) {
this.subordinate.select = JSON.parse(JSON.stringify(data))
this.searchChange()
this.cdr.detectChanges()
}
subordinateFilter() { subordinateFilter() {
return this.subordinate.dataList.filter(x => { if (this.subordinate.select) {
return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase()) return this.subordinate.select.masfromevaluationassessment.filter(x => {
}) return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase())
})
}
return []
} }
searchChange() { searchChange() {
this.currentPage = 1 this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.subordinateFilter().length / 10) }, (_, i) => i + 1); this.page = Array.from({ length: Math.ceil(this.subordinateFilter().length / 10) }, (_, i) => i + 1);
} }
selectSubordinate(data: AppraisalSubordinateModel, competencyTypeId: string, evaluationRoundId: string) { selectSubordinate(data: Masfromevaluationassessment, competencyTypeId: string, evaluationRoundId?: string) {
this.subordinate.select = new MyAppraisalSubordinateModel(data) if (data && competencyTypeId && evaluationRoundId) {
this.formEvaluation.evaluateeId = data.apsassessy.employeeId
this.evaluateeId = this.subordinate.select.apsassessy.employeeId this.formEvaluation.competencyTypeId = competencyTypeId
this.competencyTypeId = competencyTypeId this.formEvaluation.evaluationRoundId = evaluationRoundId
this.evaluationRoundId = evaluationRoundId this.cdr.detectChanges()
this.cdr.detectChanges() }
}
selectDataListRound(data: AppraisalSubordinateModel[]) {
this.subordinate.dataList = data.map(x => new MyAppraisalSubordinateModel(x))
this.searchChange()
this.cdr.detectChanges()
} }
decodeJWT(token: string) { decodeJWT(token: string) {
......
import { EmployeeModel, MyEmployeeModel } from "./employee.model"
import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model"
export interface AppraisalSubordinateModel { export interface AppraisalSubordinateModel {
evaluationRoundId: string
companyId: string companyId: string
active: boolean tdesc: string
masfromStatusType: StatusCodeModel edesc: string
apsapproveType: StatusCodeModel masfromevaluationassessment: Masfromevaluationassessment[]
apsassessy: EmployeeModel
gread: string
sumScore: number
typeList: {
competencyTypeId: string,
shortName: string
}[]
} }
export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
export interface Masfromevaluationassessment {
companyId: string companyId: string
active: boolean active: boolean
masfromStatusType: StatusCodeModel masfromStatusType: MasfromStatusType
apsapproveType: StatusCodeModel apsapproveType: ApsapproveType
apsassessy: EmployeeModel apsassessy: Apsassessy
gread: string gread: string
sumScore: number sumScore: number
typeList: { typeList: TypeList[]
competencyTypeId: string, }
shortName: string
}[] export interface MasfromStatusType {
constructor(data?: Partial<AppraisalSubordinateModel>) { code: string
this.companyId = data?.companyId || "" tdesc: string
this.active = data?.active ?? false edesc: string
this.masfromStatusType = new MyStatusCodeModel(data?.masfromStatusType) }
this.apsapproveType = new MyStatusCodeModel(data?.apsapproveType)
this.apsassessy = new MyEmployeeModel(data?.apsassessy) export interface ApsapproveType {
this.gread = data?.gread || "" code: string
this.sumScore = data?.sumScore ?? 0 tdesc: string
this.typeList = data?.typeList?.map(x => ({ edesc: string
competencyTypeId: x.competencyTypeId || "", }
shortName: x.shortName || ""
})) || [] export interface Apsassessy {
} employeeId: string
bossId: string
prefix: Prefix
fname: string
lname: string
efname: string
elname: string
bu1: Bu1
bu2: Bu2
bu3: Bu3
bu4: Bu4
bu5: Bu5
position: Position
job: Job
pl: Pl
status: Status
time0: Time0
resignDate: string
endWorkDate: string
thFullName: string
engFullName: string
} }
export interface Prefix {
prefixId: string
tdesc: string
edesc: string
}
export interface Bu1 {
bu1id: string
tdesc: string
edesc: string
companyId: string
}
export interface Bu2 {
bu2id: string
tdesc: string
edesc: string
parent: string
companyId: string
}
export interface Bu3 {
bu3id: string
tdesc: string
edesc: string
parent: string
companyId: string
}
export interface Bu4 {
bu4id: string
tdesc: string
edesc: string
parent: string
companyId: string
}
export interface Bu5 {
bu5id: string
tdesc: string
edesc: string
parent: string
companyId: string
}
export interface Position {
positionId: string
tdesc: string
edesc: string
consolidate: string
shortName: string
companyId: string
}
export interface Job {
jobCodeId: string
tdesc: string
edesc: string
}
export interface Pl {
plId: string
tdesc: string
edesc: string
companyId: string
}
export interface Status {
statusCode: string
statusType: string
tdesc: string
edesc: string
}
export interface Time0 {
time0id: string
tdesc: string
edesc: string
stickTm: string
hourD: number
}
export interface TypeList {
statusType: string
competencyTypeId: string
shortName: string
}
\ No newline at end of file
...@@ -63,7 +63,7 @@ export class AuthService { ...@@ -63,7 +63,7 @@ export class AuthService {
logout(){ logout(){
sessionStorage.clear() sessionStorage.clear()
localStorage.clear() localStorage.clear()
this.router.navigate(['/login']); this.router.navigate(['/auth/login']);
} }
} }
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