Commit 7961588b by Natthaphat

การประเมินสมรรถนะ > การจัดการรอบการประเมิน > รอบการประเมิน

การประเมินจัดการประสิทธิภาพ > รอบการประเมิน > รอบการประเมิน
parent 52f56c3d
......@@ -12,10 +12,10 @@
</div>
<div class="grid grid-cols-2 gap-6 mb-5">
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly [value]="evaluationRound.tdesc">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly [value]="evaluationRound?.tdesc">
</div>
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly [value]="evaluationRound.apsyear">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly" readonly [value]="evaluationRound?.apsyear">
</div>
</div>
</div>
......@@ -472,7 +472,7 @@
</ng-template>
<div id="form-pm-emp" class="hs-overlay hidden ti-modal" >
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto mt-7">
<div class="hs-overlay-open:mt-7 ti-modal-box ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto mt-7">
<div class="max-h-full overflow-hidden ti-modal-content !width-80 !box-modal" >
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
......@@ -670,7 +670,7 @@
</div>
<div id="form-assessment" class="hs-overlay hidden ti-modal" >
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto mt-7">
<div class="hs-overlay-open:mt-7 ti-modal-box ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto mt-7">
<div class="max-h-full overflow-hidden ti-modal-content !width-80 !box-modal" >
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
......
......@@ -112,6 +112,10 @@ export class EditDefineDocumentFormComponent {
});
}
assessmentListFilter() {
if (!Array.isArray(this.assessmentList)) {
return []; // หรือ return null แล้วจัดการใน HTML
}
return this.assessmentList.filter(x =>
x.apsassessy.fname.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.lname.toLowerCase().includes(this.search.toLowerCase()) ||
......@@ -119,8 +123,9 @@ export class EditDefineDocumentFormComponent {
x.apsassessy.elname.toLowerCase().includes(this.search.toLowerCase()) ||
x.masfromEvaluationRound.evaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase())
)
}
);
}
searchChange() {
this.currentPage = 1;
const filteredData = this.assessmentListFilter();
......
......@@ -29,8 +29,31 @@
<ng-template #headerTemplate let-data>
<span class="font-size-12px font-weight-700 text-primary">{{ col.headerText }}</span>
</ng-template>
<ng-template #template let-data *ngIf="col.field == 'statusCode.tdesc'">
<div class="flex justify-center items-center w-full h-full">
<span
class="hs-tooltip ti-main-tooltip [--trigger:hover] flex items-center justify-center rounded-full h-6 w-6 text-white"
[ngClass]="{
'bg-success': data.statusCode.tdesc == 'กำลังดำเนินการประเมิน',
'bg-warning': data.statusCode.tdesc == 'รอดำเนินการ',
'bg-gray-400': data.statusCode.tdesc == 'สิ้นสุดช่วงเวลาประเมิน'
}" role="tooltip">
<ng-container [ngSwitch]="data.statusCode.tdesc">
<i *ngSwitchCase="'กำลังดำเนินการประเมิน'" class="ti ti-clock hs-tooltip-toggle ti-main-tooltip-toggle"></i>
<i *ngSwitchCase="'รอดำเนินการ'" class="ti ti-hourglass-empty hs-tooltip-toggle ti-main-tooltip-toggle"></i>
<i *ngSwitchCase="'สิ้นสุดช่วงเวลาประเมิน'" class="ti ti-check hs-tooltip-toggle ti-main-tooltip-toggle"></i>
</ng-container>
<span
class="hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-primary text-white shadow-sm dark:bg-slate-700">
{{ data.statusCode.tdesc }}
</span>
</span>
</div>
</ng-template>
</e-column>
<e-column headerText='action' width='150' textAlign='Center' *ngIf="actionSetting">
<e-column headerText='action' width='205' textAlign='Center' *ngIf="actionSetting">
<ng-template #headerTemplate let-data *ngIf="actionSetting">
<span class="font-size-12px font-weight-700 text-primary">การจัดการ</span>
</ng-template>
......@@ -41,6 +64,28 @@
<i class="ti ti-file-download cursor-pointer i-gray fs-l px-1" (click)="onFileDownload(data)"
*ngIf="canDownload && data.competencyFiles"></i>
<i class="ti ti-menu-2 cursor-pointer i-gray fs-l px-1" (click)="onNextPage(data)" *ngIf="canChild"></i>
<i class="ti ti-user cursor-pointer i-gray fs-l px-1" (click)="onNextPageForm(data)" *ngIf="childForm"></i>
<ng-container *ngIf="data.statusFrom as statusFrom">
<ng-container [ngSwitch]="statusFrom.code">
<span class="badge text-white m-1 cursor-pointer"
(click)="modalStatus='createForm'; createFormEvent.emit(data)" *ngIf="statusFrom.code == '0'"
[ngClass]="{'bg-secondary': true, 'text-white': true}">
สร้างแบบฟอร์ม
</span>
<span class="badge text-white m-1" *ngIf="statusFrom.code == '1'"
[ngClass]="{'bg-primary': true, 'text-white': true}">
ปิดรอบประเมิน
</span>
<span class="badge text-white m-1" *ngIf="statusFrom.code == '2'"
[ngClass]="{'bg-gray-400': true, 'text-white': true}">
ปิดรอบประเมิน
</span>
</ng-container>
</ng-container>
</ng-template>
</e-column>
</e-columns>
......
......@@ -108,6 +108,10 @@ export class DatagridSyncfutionComponent implements OnInit {
@Output() sendNextPageView = new EventEmitter<any>();
@Input() canDownload = false
@Output() sendFileDownload = new EventEmitter<any>();
@Input() childForm = false
@Output() sendNextPageForm = new EventEmitter<any>();
modalStatus = '';
@Output() createFormEvent = new EventEmitter<any>();
@Input() checkBoxSetting = true
@Input() actionSetting = true
......@@ -376,12 +380,13 @@ export class DatagridSyncfutionComponent implements OnInit {
}
}
onNextPageView(data: any) {
this.sendNextPageView.emit(data);
}
onFileDownload(data: any) {
this.sendFileDownload.emit(data);
}
onNextPageForm(data: any) {
this.sendNextPageForm.emit(data);
}
}
......@@ -108,6 +108,8 @@ export class ManagementCycleComponent {
dialogRef: any
@ViewChild("PLModal") PLModal: any;
dialogRefPL: any
@ViewChild("managementEvaluationCycleModalForm") managementEvaluationCycleModalForm: any;
dialogRefForm: any
modalStatusEdit = false
constructor(private pmsMasfromEvaluationCycleService: PmsMasfromEvaluationCycleService,
......@@ -203,6 +205,7 @@ export class ManagementCycleComponent {
setData(data?: PmsMasfromEvaluationModel) {
this.pmsMasfromEvaluation.select = new MyPmsMasfromEvaluationModel(data)
}
addPmsMasfromEvaluation() {
Swal.fire({
icon: 'question',
......@@ -257,15 +260,10 @@ export class ManagementCycleComponent {
}).then((result) => {
if (result.isConfirmed) {
this.dataLoading = true;
let body: PmsMasfromEvaluationModel[] = [];
if (this.pmsMasfromEvaluation.select.pmsEvaluationRoundId) {
body = [new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select)];
} else {
const selectedKeys = Array.from(this.selectedItems.data.keys());
body = this.pmsMasfromEvaluation.dataList
.filter(x => selectedKeys.includes(x.pmsEvaluationRoundId) && this.selectedItems.data.get(x.pmsEvaluationRoundId))
.map(x => new MyPmsMasfromEvaluationModel(x));
}
const body = this.pmsMasfromEvaluation.dataList.filter(x => selectedKeys.includes(x.pmsEvaluationRoundId) && this.selectedItems.data.get(x.pmsEvaluationRoundId)).map(x => new MyPmsMasfromEvaluationModel(x))
console.log(body);
this.pmsMasfromEvaluationCycleService.delete(body).subscribe({
next: response => {
if (response.success) {
......@@ -289,11 +287,14 @@ export class ManagementCycleComponent {
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
Swal.fire({
title: 'แจ้งเตือน',
text: text,
icon: type,
confirmButtonText: 'ตกลง',
});
}
clear() {
if (this.modalStatus == 'add') {
this.setData()
......@@ -319,7 +320,19 @@ export class ManagementCycleComponent {
this.modal.currentPage = 1
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
}
createForm() {
createForm(data: any) {
Swal.fire({
title: 'สร้างแบบฟอร์ม?',
text: 'คุณต้องการสร้างแบบฟอร์มการประเมินใหม่หรือไม่',
icon: 'question',
showCancelButton: true,
confirmButtonText: 'ยืนยัน',
cancelButtonText: 'ยกเลิก',
reverseButtons: true,
}).then((result) => {
if (result.isConfirmed) {
this.modalStatus = 'createForm';
this.setData(data); // เซ็ตข้อมูลก่อน
const body = new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select)
body.active = 1
this.dataLoading = true
......@@ -353,7 +366,9 @@ export class ManagementCycleComponent {
this.dataLoading = false
this.cdr.detectChanges()
}
})
});
}
});
}
checkPrimary() {
......@@ -371,13 +386,21 @@ export class ManagementCycleComponent {
width: '800px',
})
}
openDialogForm() {
this.dialogRefForm = this.dialog.open(this.managementEvaluationCycleModalForm, {
width: '1200px',
disableClose: false,
});
}
closeDialog() {
this.dialogRef.close()
}
closePLDialog() {
this.dialogRefPL.close()
}
closeDialogForm() {
this.dialogRefForm.close()
}
onSelectItemChange(arg: any) {
this.selectedItems = arg
console.log(this.selectedItems)
......
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