Commit 22415e8c by Nattana Chaiyamat

ผู้อนุมัติ 1 ลงไป แก้ได้เท่านั้น

parent bd3515dc
...@@ -289,8 +289,8 @@ ...@@ -289,8 +289,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='0'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='0'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='0'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='0'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsassessyComment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsassessyComment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -312,8 +312,8 @@ ...@@ -312,8 +312,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='1'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='1'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='1'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='1'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove1Comment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove1Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -335,8 +335,8 @@ ...@@ -335,8 +335,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='2'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='2'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='2'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='2'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove2Comment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove2Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -358,8 +358,8 @@ ...@@ -358,8 +358,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='3'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='3'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='3'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='3'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove3Comment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove3Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -381,8 +381,8 @@ ...@@ -381,8 +381,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='4'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='4'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='4'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='4'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove4Comment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove4Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -404,8 +404,8 @@ ...@@ -404,8 +404,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]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='5'||!canEdit" [class.!bg-input-readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='5'||!canSave"
[readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='5'||!canEdit" [readonly]="!appraisalCompentency.data||appraisalCompentency.data.currentStep!='5'||!canSave"
[(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove5Comment"></textarea> [(ngModel)]="appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove5Comment"></textarea>
<span class="pt-2"> <span class="pt-2">
วันที่ : วันที่ :
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,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>
......
...@@ -19,6 +19,7 @@ export class EvaluationComponent implements OnInit { ...@@ -19,6 +19,7 @@ export class EvaluationComponent implements OnInit {
@Input() competencyTypeId = "" @Input() competencyTypeId = ""
@Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>(); @Output() sendReturnPath: EventEmitter<any> = new EventEmitter<any>();
canEdit = false canEdit = false
canSave = false
hoveredCode: string | null = null; hoveredCode: string | null = null;
hoveredCode2: string | null = null; hoveredCode2: string | null = null;
currentDate = new Date() currentDate = new Date()
...@@ -80,40 +81,41 @@ export class EvaluationComponent implements OnInit { ...@@ -80,40 +81,41 @@ export class EvaluationComponent implements OnInit {
next: response => { next: response => {
this.appraisalCompentency.data = JSON.parse(JSON.stringify(response)) this.appraisalCompentency.data = JSON.parse(JSON.stringify(response))
if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentency.data?.masfromEvaluationAssessment1lList[0]) {
this.canEdit = this.appraisalCompentency.data.currentStep == this.appraisalCompentency.data.checkStep this.canSave = this.appraisalCompentency.data.currentStep == this.appraisalCompentency.data.checkStep
this.canEdit = (this.appraisalCompentency.data.currentStep == this.appraisalCompentency.data.checkStep && (+(this.appraisalCompentency.data.checkStep) <= 1))
switch (this.appraisalCompentency.data?.currentStep) { switch (this.appraisalCompentency.data?.currentStep) {
case ("0"): { case ("0"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsassessyDate = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsassessyDate = this.currentDate.toISOString().split('T')[0];
} }
break break
} }
case ("1"): { case ("1"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove1Date = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove1Date = this.currentDate.toISOString().split('T')[0];
} }
break break
} }
case ("2"): { case ("2"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove2Date = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove2Date = this.currentDate.toISOString().split('T')[0];
} }
break break
} }
case ("3"): { case ("3"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove3Date = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove3Date = this.currentDate.toISOString().split('T')[0];
} }
break break
} }
case ("4"): { case ("4"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove4Date = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove4Date = this.currentDate.toISOString().split('T')[0];
} }
break break
} }
case ("5"): { case ("5"): {
if (this.canEdit) { if (this.canSave) {
this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove5Date = this.currentDate.toISOString().split('T')[0]; this.appraisalCompentency.data.masfromEvaluationAssessment1lList[0].apsapprove5Date = this.currentDate.toISOString().split('T')[0];
} }
break break
......
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