Commit 5beee0d8 by Nattana Chaiyamat

idp pms

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