Commit 5beee0d8 by Nattana Chaiyamat

idp pms

parent 5800b432
...@@ -320,8 +320,8 @@ ...@@ -320,8 +320,8 @@
</div> </div>
<div class="col-span-2"> <div class="col-span-2">
<textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่" <textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่"
[class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='1'||!canEdit" [class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='1'||!canSave"
[readonly]="!formIdp.data||formIdp.data.currentStep!='1'||!canEdit" [readonly]="!formIdp.data||formIdp.data.currentStep!='1'||!canSave"
[(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove1Comment"></textarea> [(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove1Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -343,8 +343,8 @@ ...@@ -343,8 +343,8 @@
</div> </div>
<div class="col-span-2"> <div class="col-span-2">
<textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่" <textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่"
[class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='2'||!canEdit" [class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='2'||!canSave"
[readonly]="!formIdp.data||formIdp.data.currentStep!='2'||!canEdit" [readonly]="!formIdp.data||formIdp.data.currentStep!='2'||!canSave"
[(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove2Comment"></textarea> [(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove2Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -366,8 +366,8 @@ ...@@ -366,8 +366,8 @@
</div> </div>
<div class="col-span-2"> <div class="col-span-2">
<textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่" <textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่"
[class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='3'||!canEdit" [class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='3'||!canSave"
[readonly]="!formIdp.data||formIdp.data.currentStep!='3'||!canEdit" [readonly]="!formIdp.data||formIdp.data.currentStep!='3'||!canSave"
[(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove3Comment"></textarea> [(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove3Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -389,8 +389,8 @@ ...@@ -389,8 +389,8 @@
</div> </div>
<div class="col-span-2"> <div class="col-span-2">
<textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่" <textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่"
[class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='4'||!canEdit" [class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='4'||!canSave"
[readonly]="!formIdp.data||formIdp.data.currentStep!='4'||!canEdit" [readonly]="!formIdp.data||formIdp.data.currentStep!='4'||!canSave"
[(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove4Comment"></textarea> [(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove4Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -412,8 +412,8 @@ ...@@ -412,8 +412,8 @@
</div> </div>
<div class="col-span-2"> <div class="col-span-2">
<textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่" <textarea type="text" rows="2" class="ti-form-input mb-2" placeholder="ใส่ Comment ที่นี่"
[class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='5'||!canEdit" [class.!bg-input-readonly]="!formIdp.data||formIdp.data.currentStep!='5'||!canSave"
[readonly]="!formIdp.data||formIdp.data.currentStep!='5'||!canEdit" [readonly]="!formIdp.data||formIdp.data.currentStep!='5'||!canSave"
[(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove5Comment"></textarea> [(ngModel)]="formIdp.data.masfromEvaluationIdp.apsapprove5Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
</div> </div>
</div> </div>
<div class="flex justify-center mb-1rem pb-2rem" *ngIf="canEdit"> <div class="flex justify-center mb-1rem pb-2rem" *ngIf="canSave">
<button type="submit" class="ti-btn ti-btn-success mx-2rem" (click)="save('draft')"> <button type="submit" class="ti-btn ti-btn-success mx-2rem" (click)="save('draft')">
บันทึกร่าง บันทึกร่าง
</button> </button>
......
...@@ -13,11 +13,13 @@ export class IdpEvalutionComponent { ...@@ -13,11 +13,13 @@ export class IdpEvalutionComponent {
@Input() evaluationRoundId = "" @Input() evaluationRoundId = ""
@Input() evaluateeId = "" @Input() evaluateeId = ""
@Input() evaluaterId = "" @Input() evaluaterId = ""
@Input() masfromStatusType = ""
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>(); @Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
currentDate = new Date() currentDate = new Date()
hoveredCode: string | null = null; hoveredCode: string | null = null;
formIdp: { loading: boolean, data?: IdpFormModel } = { loading: false, data: undefined } formIdp: { loading: boolean, data?: IdpFormModel } = { loading: false, data: undefined }
canEdit = false canEdit = false
canSave = false
constructor(private evaluationIdpService: EvaluationIdpService, constructor(private evaluationIdpService: EvaluationIdpService,
private employeeService: EmployeeService, private employeeService: EmployeeService,
private cdr: ChangeDetectorRef private cdr: ChangeDetectorRef
...@@ -32,7 +34,8 @@ export class IdpEvalutionComponent { ...@@ -32,7 +34,8 @@ export class IdpEvalutionComponent {
next: response => { next: response => {
this.formIdp.data = JSON.parse(JSON.stringify(response)) this.formIdp.data = JSON.parse(JSON.stringify(response))
if (this.formIdp.data) { if (this.formIdp.data) {
this.canEdit = this.formIdp.data.currentStep == this.formIdp.data.checkStep this.canSave = (this.formIdp.data.currentStep == this.formIdp.data.checkStep) && (this.masfromStatusType != 'Boss_finish' && this.masfromStatusType != 'Not_evaluating_yet')
this.canEdit = (this.formIdp.data.currentStep == this.formIdp.data.checkStep && (+(this.formIdp.data.checkStep) <= 1))
} }
switch (this.formIdp.data?.currentStep) { switch (this.formIdp.data?.currentStep) {
case ("0"): { case ("0"): {
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
<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-'+(i+1)" [class.active]="f" href="javascript:void(0);" [id]="'card-type-item-'+(i+1)"
[class.ti-btn-soft-mute]="!item.statusCheckDate" [class.ti-btn-soft-mute]="!item.statusCheckDate" [attr.data-hs-tab]="'#underline-'+(i+1)"
[attr.data-hs-tab]="'#underline-'+(i+1)" [attr.aria-controls]="'underline-'+(i+1)" [attr.aria-controls]="'underline-'+(i+1)" (click)="selectAppraisalCompentency(item)">
(click)="selectAppraisalCompentency(item)">
{{item.masfromEvaluationRound.tdesc}} {{item.masfromEvaluationRound.tdesc}}
</a> </a>
</nav> </nav>
...@@ -259,6 +258,7 @@ ...@@ -259,6 +258,7 @@
<ng-container *ngIf="onEdit=='pms'"> <ng-container *ngIf="onEdit=='pms'">
<app-pms-evalution [pathTitle]="['การประเมินผล', 'ประเมินตนเอง','ประเมิน']" <app-pms-evalution [pathTitle]="['การประเมินผล', 'ประเมินตนเอง','ประเมิน']"
(sendReturnPath)="getAppraisalCompentencyList();getAppraisalPmsList();onEdit='' ; pathTitle = ['การประเมินผล', 'ประเมินตนเอง']" (sendReturnPath)="getAppraisalCompentencyList();getAppraisalPmsList();onEdit='' ; pathTitle = ['การประเมินผล', 'ประเมินตนเอง']"
[masfromStatusType]="appraisalPms.select?.masfromStatusType?.code||''"
[evaluationRoundId]="appraisalPms.select?.pmsMasfromEvaluationRound?.pmsEvaluationRoundId || ''" [evaluationRoundId]="appraisalPms.select?.pmsMasfromEvaluationRound?.pmsEvaluationRoundId || ''"
[evaluaterId]="evaluatee.data.employeeId" [evaluateeId]="evaluatee.data.employeeId"></app-pms-evalution> [evaluaterId]="evaluatee.data.employeeId" [evaluateeId]="evaluatee.data.employeeId"></app-pms-evalution>
</ng-container> </ng-container>
\ No newline at end of file
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
[class.ti-btn-soft-warning]="item.statusIdp.statusType == 'BossEvaluating'" [class.ti-btn-soft-warning]="item.statusIdp.statusType == 'BossEvaluating'"
[class.ti-btn-soft-success]="item.statusIdp.statusType == 'Boss_finish'" [class.ti-btn-soft-success]="item.statusIdp.statusType == 'Boss_finish'"
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,'',subordinate.select?.evaluationRoundId);pageEvalution='idp'"> (click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,item.statusIdp.statusType);pageEvalution='idp'">
IDP IDP
</button> </button>
</div> </div>
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
<div class="flex justify-center"> <div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-mute" <button type="button" class="ti-btn rounded-sm ti-btn-soft-mute"
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,'',subordinate.select?.evaluationRoundId);pageEvalution='pms'"> (click)="selectSubordinate(item,'',subordinate.select?.evaluationRoundId,'');pageEvalution='pms'">
PMS PMS
</button> </button>
</div> </div>
...@@ -241,14 +241,14 @@ ...@@ -241,14 +241,14 @@
<ng-container *ngIf="pageEvalution=='idp'"> <ng-container *ngIf="pageEvalution=='idp'">
<app-idp-evalution [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']" <app-idp-evalution [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']"
(sendReturnPath)="getBossList();pageEvalution='' ; pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']" (sendReturnPath)="getBossList();pageEvalution='' ; pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']"
[evaluationRoundId]="formEvaluation.evaluationRoundId" [evaluaterId]="formEvaluation.evaluaterId" [masfromStatusType]="formEvaluation.masfromStatusType" [evaluationRoundId]="formEvaluation.evaluationRoundId"
[evaluateeId]="formEvaluation.evaluateeId"></app-idp-evalution> [evaluaterId]="formEvaluation.evaluaterId" [evaluateeId]="formEvaluation.evaluateeId"></app-idp-evalution>
</ng-container> </ng-container>
<ng-container *ngIf="pageEvalution=='pms'"> <ng-container *ngIf="pageEvalution=='pms'">
<app-pms-evalution [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']" <app-pms-evalution [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']"
(sendReturnPath)="getBossList();pageEvalution='' ; pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']" (sendReturnPath)="getBossList();pageEvalution='' ; pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']"
[evaluationRoundId]="formEvaluation.evaluationRoundId" [evaluaterId]="formEvaluation.evaluaterId" [masfromStatusType]="formEvaluation.masfromStatusType" [evaluationRoundId]="formEvaluation.evaluationRoundId"
[evaluateeId]="formEvaluation.evaluateeId"></app-pms-evalution> [evaluaterId]="formEvaluation.evaluaterId" [evaluateeId]="formEvaluation.evaluateeId"></app-pms-evalution>
</ng-container> </ng-container>
<ng-container *ngIf="pageEvalution=='evaluation'"> <ng-container *ngIf="pageEvalution=='evaluation'">
<app-evaluation [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']" <app-evaluation [pathTitle]="['การประเมินผล', 'ประเมินโดยหัวหน้า','ประเมิน']"
......
...@@ -19,7 +19,8 @@ export class SupervisorEvaluationComponent { ...@@ -19,7 +19,8 @@ export class SupervisorEvaluationComponent {
evaluateeId: "", evaluateeId: "",
evaluaterId: "", evaluaterId: "",
competencyTypeId: "", competencyTypeId: "",
evaluationRoundId: "" evaluationRoundId: "",
masfromStatusType: ""
} }
constructor(private appraisalService: AppraisalService, constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) { private cdr: ChangeDetectorRef) {
...@@ -66,11 +67,12 @@ export class SupervisorEvaluationComponent { ...@@ -66,11 +67,12 @@ export class SupervisorEvaluationComponent {
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: Masfromevaluationassessment, competencyTypeId: string, evaluationRoundId?: string) { selectSubordinate(data: Masfromevaluationassessment, competencyTypeId: string, evaluationRoundId?: string, masfromStatusType?: string) {
if (data && evaluationRoundId) { if (data && evaluationRoundId) {
this.formEvaluation.evaluateeId = data.apsassessy.employeeId this.formEvaluation.evaluateeId = data.apsassessy.employeeId
this.formEvaluation.competencyTypeId = competencyTypeId this.formEvaluation.competencyTypeId = competencyTypeId
this.formEvaluation.evaluationRoundId = evaluationRoundId this.formEvaluation.evaluationRoundId = evaluationRoundId
this.formEvaluation.masfromStatusType = masfromStatusType || ''
this.cdr.detectChanges() this.cdr.detectChanges()
} }
} }
......
...@@ -34,4 +34,7 @@ export class AppraisalService { ...@@ -34,4 +34,7 @@ export class AppraisalService {
getFormPmsById(evaluationRoundId: string, apsassessy: string): Observable<AppraisalPmsFormModel> { getFormPmsById(evaluationRoundId: string, apsassessy: string): Observable<AppraisalPmsFormModel> {
return this.http.get<AppraisalPmsFormModel>(this.urlApi + "/pms/" + evaluationRoundId + "/" + apsassessy) return this.http.get<AppraisalPmsFormModel>(this.urlApi + "/pms/" + evaluationRoundId + "/" + apsassessy)
} }
postPms(body: AppraisalPmsFormModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/pms", body)
}
} }
\ No newline at end of file
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