Commit bd3515dc by Nakarin Luankla

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

parents 1671ea1d 0b1de934
......@@ -94,7 +94,7 @@ export class RolePermissionConfigComponent {
}
})
this.configPermission.select.menuBody.forEach(x => {
this.menuItemsShow.set(x.path + x.title, true)
this.menuItemsShow.set(x.path + x.title, false)
})
this.cdr.detectChanges()
}
......
......@@ -196,9 +196,14 @@
readonly [value]="bu1.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">เเผนก<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">เเผนก<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
เเผนกซ้ำ
</ng-container>
</span></label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu2.bu2id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu2.bu2id">
</div>
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดแผนก (ไทย)<span
class="text-danger">*</span></label>
......@@ -212,8 +217,8 @@
ย้อนกลับ
</button>
<button class="ti-btn ti-btn-success" type="button" data-hs-overlay="#department-list-alert-modal"
[class.ti-btn-disabled]="!bu1.bu1id||!bu2.bu2id||!bu2.tdesc"
[disabled]="!bu1.bu1id||!bu2.bu2id||!bu2.tdesc">
[class.ti-btn-disabled]="!bu1.bu1id||!bu2.bu2id||!bu2.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!bu1.bu1id||!bu2.bu2id||!bu2.tdesc||(currentModal=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -531,7 +536,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#department-list-alert-delete-modal" (click)="deleteBu2()" *ngIf="numDataListChecked">
data-hs-overlay="#department-list-alert-delete-modal" (click)="deleteBu2()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -244,5 +244,9 @@ export class DepartmentListComponent implements OnInit {
this.numDataListChecked = this.bu2List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu2List.find(x => x.data.bu2id == this.bu2.bu2id)
}
}
......@@ -172,8 +172,15 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label for="input-label" class="ti-form-label mt-2rem">ฝ่าย<span class="text-danger">*</span></label>
<input type="text" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="bu1.bu1id">
<label for="input-label" class="ti-form-label mt-2rem">ฝ่าย
<span class="text-danger"> *
<ng-container *ngIf="checkPrimary()">
ฝ่ายซ้ำ
</ng-container>
</span>
</label>
<input type="text" id="input-label" class="ti-form-input w-1/2" [class.!border-red]="checkPrimary()"
[(ngModel)]="bu1.bu1id">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย)<span
class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="bu1.tdesc">
......@@ -187,7 +194,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#department-register-alert-modal"
[class.ti-btn-disabled]="!bu1.bu1id||!bu1.tdesc" [disabled]="!bu1.bu1id||!bu1.tdesc">
[class.ti-btn-disabled]="!bu1.bu1id||!bu1.tdesc||checkPrimary()"
[disabled]="!bu1.bu1id||!bu1.tdesc||checkPrimary()">
บันทึกข้อมูล
</button>
</div>
......
......@@ -170,4 +170,8 @@ export class DepartmentRegisterComponent implements OnInit {
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu1List.find(x => x.data.bu1id == this.bu1.bu1id)
}
}
......@@ -197,9 +197,16 @@
readonly [value]="bu2.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">ส่วน<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">ส่วน
<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
ส่วนซ้ำ
</ng-container>
</span>
</label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu3.bu3id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu3.bu3id">
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
......@@ -228,8 +235,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#section-registration-alert-modal"
[class.ti-btn-disabled]="!bu2.bu2id||!bu3.bu3id||!bu3.tdesc"
[disabled]="!bu2.bu2id||!bu3.bu3id||!bu3.tdesc">
[class.ti-btn-disabled]="!bu2.bu2id||!bu3.bu3id||!bu3.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!bu2.bu2id||!bu3.bu3id||!bu3.tdesc||(currentModal=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -549,7 +556,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#section-registration-alert-delete-modal" (click)="deleteBu3()" *ngIf="numDataListChecked">
data-hs-overlay="#section-registration-alert-delete-modal" (click)="deleteBu3()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -242,5 +242,9 @@ export class SectionRegistrationComponent implements OnInit {
this.numDataListChecked = this.bu3List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu3List.find(x => x.data.bu3id == this.bu3.bu3id)
}
}
......@@ -196,9 +196,16 @@
readonly [value]="bu6.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">ส่วนย่อย4<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">ส่วนย่อย4
<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
ส่วนย่อย4ซ้ำ
</ng-container>
</span>
</label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu7.bu7id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu7.bu7id">
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
......@@ -227,8 +234,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#sub-department-four-alert-add-modal"
[class.ti-btn-disabled]="!bu6.bu6id||!bu7.bu7id||!bu7.tdesc"
[disabled]="!bu6.bu6id||!bu7.bu7id||!bu7.tdesc">
[class.ti-btn-disabled]="!bu6.bu6id||!bu7.bu7id||!bu7.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]=" !bu6.bu6id||!bu7.bu7id||!bu7.tdesc||(currentModal=='add' &&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -548,7 +555,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#sub-department-four-alert-delete-modal" (click)="deleteBu7();" *ngIf="numDataListChecked">
data-hs-overlay="#sub-department-four-alert-delete-modal" (click)="deleteBu7();"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -238,6 +238,10 @@ export class SubDepartmentFourComponent implements OnInit {
this.numDataListChecked = this.bu7List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu7List.find(x => x.data.bu7id == this.bu7.bu7id)
}
}
......@@ -198,9 +198,16 @@
readonly [value]="bu3.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">ส่วนย่อย1<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">ส่วนย่อย1
<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
ส่วนย่อย1ซ้ำ
</ng-container>
</span>
</label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu4.bu4id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu4.bu4id">
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
......@@ -229,8 +236,8 @@
</button>
<button class="ti-btn ti-btn-success" type="button"
data-hs-overlay="#sub-department-one-alert-modal"
[class.ti-btn-disabled]="!bu3.bu3id||!bu4.bu4id||!bu4.tdesc"
[disabled]="!bu3.bu3id||!bu4.bu4id||!bu4.tdesc">
[class.ti-btn-disabled]="!bu3.bu3id||!bu4.bu4id||!bu4.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!bu3.bu3id||!bu4.bu4id||!bu4.tdesc||(currentModal=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -556,7 +563,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#sub-department-one-alert-delete-modal" (click)="deleteBu4();" *ngIf="numDataListChecked">
data-hs-overlay="#sub-department-one-alert-delete-modal" (click)="deleteBu4();"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -236,6 +236,11 @@ export class SubDepartmentOneComponent implements OnInit {
this.numDataListChecked = this.bu4List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu4List.find(x => x.data.bu4id == this.bu4.bu4id)
}
}
......@@ -123,9 +123,9 @@
</tbody>
</table>
</div>
<app-pagination [totalItems]="filterBu5Modal().length" [pageSize]="bu5Modal.pageSize"
(pageChange)="bu5Modal.currentPage = $event"
(pageSizeChange)="bu5Modal.pageSize = $event;bu5Modal.currentPage = 1"></app-pagination>
<app-pagination [totalItems]="filterBu6Table().length" [pageSize]="bu6Table.pageSize"
(pageChange)="bu6Table.currentPage = $event"
(pageSizeChange)="bu6Table.pageSize = $event;bu6Table.currentPage = 1"></app-pagination>
</div>
......@@ -196,9 +196,16 @@
readonly [value]="bu5.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">ส่วนย่อย3<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">ส่วนย่อย3
<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
ส่วนย่อย3ซ้ำ
</ng-container>
</span>
</label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu6.bu6id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu6.bu6id">
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
......@@ -227,8 +234,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#sub-department-three-alert-add-modal"
[class.ti-btn-disabled]="!bu5.bu5id||!bu6.bu6id||!bu6.tdesc"
[disabled]="!bu5.bu5id||!bu6.bu6id||!bu6.tdesc">
[class.ti-btn-disabled]="!bu5.bu5id||!bu6.bu6id||!bu6.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!bu5.bu5id||!bu6.bu6id||!bu6.tdesc||(currentModal=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -305,8 +312,8 @@
readonly [value]="bu5.tdesc">
</div>
</div>
<label for="input-label" class="ti-form-label mt-2rem">ส่วนย่อย3<span
class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label mt-2rem">ส่วนย่อย3
</label>
<div class="sm:grid grid-cols-2 gap-1">
<div class="relative w-full">
<input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly"
......@@ -573,7 +580,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#sub-department-three-alert-delete-modal" (click)="deleteBu6()" *ngIf="numDataListChecked">
data-hs-overlay="#sub-department-three-alert-delete-modal" (click)="deleteBu6()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -238,6 +238,10 @@ export class SubDepartmentThreeComponent implements OnInit {
this.numDataListChecked = this.bu6List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu6List.find(x => x.data.bu6id == this.bu6.bu6id)
}
}
......@@ -196,9 +196,16 @@
readonly [value]="bu4.tdesc">
</div>
</div>
<label class="ti-form-label mt-2rem">ส่วนย่อย2<span class="text-danger">*</span></label>
<label class="ti-form-label mt-2rem">ส่วนย่อย2
<span class="text-danger">*
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
ส่วนย่อย2ซ้ำ
</ng-container>
</span>
</label>
<div class="relative flex rounded-md w-1/2">
<input type="text" class="ti-form-input h-16" [(ngModel)]="bu5.bu5id">
<input type="text" class="ti-form-input h-16"
[class.!border-red]="currentModal=='add'&&checkPrimary()" [(ngModel)]="bu5.bu5id">
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
name="hs-leading-button-add-on-with-icon-and-button"
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
......@@ -227,8 +234,8 @@
</button>
<button class="ti-btn ti-btn-success" type="button"
data-hs-overlay="#sub-department-two-alert-add-modal"
[class.ti-btn-disabled]="!bu4.bu4id||!bu5.bu5id||!bu5.tdesc"
[disabled]="!bu4.bu4id||!bu5.bu5id||!bu5.tdesc">
[class.ti-btn-disabled]="!bu4.bu4id||!bu5.bu5id||!bu5.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!bu4.bu4id||!bu5.bu5id||!bu5.tdesc||(currentModal=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -570,7 +577,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#sub-department-two-alert-delete-modal" (click)="deleteBu5()" *ngIf="numDataListChecked">
data-hs-overlay="#sub-department-two-alert-delete-modal" (click)="deleteBu5()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</div>
......
......@@ -238,5 +238,9 @@ export class SubDepartmentTwoComponent implements OnInit {
this.numDataListChecked = this.bu5List.filter(x => x.check).length
this.isDataListChecked = Boolean(this.numDataListChecked)
}
checkPrimary() {
return this.bu5List.find(x => x.data.bu5id == this.bu5.bu5id)
}
}
......@@ -169,9 +169,14 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label for="input-label" class="ti-form-label mt-2rem">รหัสบริษัท<span
class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label mt-2rem">รหัสบริษัท<span class="text-danger">
*
<ng-container *ngIf="modalStatus=='add'&&checkPrimary()">
รหัสบริษัทซ้ำ
</ng-container>
</span></label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[class.!border-red]="modalStatus=='add'&&checkPrimary()"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.code" [maxLength]="5">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียด (ไทย)<span
......@@ -191,8 +196,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#company-registration-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.code||!dataSelect.tdesc"
[disabled]="!dataSelect.code||!dataSelect.tdesc">
[class.ti-btn-disabled]="!dataSelect.code||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())"
[disabled]="!dataSelect.code||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......
......@@ -200,4 +200,8 @@ export class CompanyRegistrationPageComponent {
this.setData({ code: this.dataSelect.code, tdesc: "", edesc: "", address: "", contact: "" })
}
}
checkPrimary() {
return this.dataList.find(x => x.data.code == this.dataSelect.code)
}
}
......@@ -171,9 +171,15 @@
</div>
</div>
<div class="ti-modal-body" style="margin-top: 40px;">
<label for="input-label" class="ti-form-label">รหัสประเภทพนักงาน<span
class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label">รหัสประเภทพนักงาน
<span class="text-danger">
*
<ng-container *ngIf="modalStatus=='add'&&checkPrimary()">
รหัสประเภทพนักงานซ้ำ
</ng-container>
</span></label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[class.!border-red]="modalStatus=='add'&&checkPrimary()"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.codeId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดประเภทพนักงาน (ไทย)<span
......@@ -189,8 +195,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#employee-categories-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.codeId||!dataSelect.tdesc"
[disabled]="!dataSelect.codeId||!dataSelect.tdesc">
[class.ti-btn-disabled]="!dataSelect.codeId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())"
[disabled]="!dataSelect.codeId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -257,7 +263,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#employee-categories-page-alert-modal" (click)="deleteEmp_type()" *ngIf="numDataListChecked">
data-hs-overlay="#employee-categories-page-alert-modal" (click)="deleteEmp_type()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</ng-container>
......
......@@ -207,4 +207,8 @@ export class EmployeeCategories {
this.dataSelect.edesc = ''
}
}
checkPrimary() {
return this.emp_typelist.find(x => x.data.codeId == this.dataSelect.codeId)
}
}
......@@ -168,9 +168,16 @@
</div>
</div>
<div class="ti-modal-body ">
<label for="input-label" class="ti-form-label mt-2rem">รหัสกลุ่มพนักงาน<span
class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label mt-2rem">รหัสกลุ่มพนักงาน
<span class="text-danger">
*
<ng-container *ngIf="modalStatus=='add'&&checkPrimary()">
รหัสกลุ่มพนักงานซ้ำ
</ng-container>
</span>
</label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[class.!border-red]="modalStatus=='add'&&checkPrimary()"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.groupId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดกลุ่มพนักงาน (ไทย)<span
......@@ -186,8 +193,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#employee-group-unit-component-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.groupId||!dataSelect.tdesc"
[disabled]="!dataSelect.groupId||!dataSelect.tdesc">
[class.ti-btn-disabled]="!dataSelect.groupId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())"
[disabled]="!dataSelect.groupId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......
......@@ -205,4 +205,8 @@ export class EmployeeGroupUnit implements OnInit {
this.dataSelect.edesc = ''
}
}
checkPrimary() {
return this.emp_groupList.find(x => x.data.groupId == this.dataSelect.groupId)
}
}
......@@ -167,10 +167,17 @@
</div>
</div>
<div class="ti-modal-body" style="margin-top: 40px;">
<label for="input-label" class="ti-form-label">รหัสระดับพนักงาน(JL)<span class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label">รหัสระดับพนักงาน(JL)
<span class="text-danger">
*
<ng-container *ngIf="modalStatus=='add'&&checkPrimary()">
รหัสระดับพนักงาน(JL)ซ้ำ
</ng-container>
</span>
</label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.plId">
[class.!border-red]="modalStatus=='add'&&checkPrimary()" [ngClass]="{'bg-input-readonly':modalStatus=='edit'}"
[readonly]="modalStatus=='edit'" [(ngModel)]="dataSelect.plId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดระดับพนักงาน(JL) (ไทย)<span
class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="dataSelect.tdesc">
......@@ -183,8 +190,8 @@
ย้อนกลับ
</button>
<button type="button" class="ti-btn ti-btn-success" data-hs-overlay="#employee-level-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.plId||!dataSelect.tdesc"
[disabled]="!dataSelect.plId||!dataSelect.tdesc">
[class.ti-btn-disabled]="!dataSelect.plId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())"
[disabled]="!dataSelect.plId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......
......@@ -212,4 +212,9 @@ export class EmployeeLevel implements OnInit {
this.dataSelect.edesc = ''
}
}
checkPrimary() {
return this.plList.find(x => x.data.plId == this.dataSelect.plId)
}
}
......@@ -169,8 +169,13 @@
</div>
</div>
<div class="ti-modal-body ">
<label for="input-label" class="ti-form-label mt-2rem">รหัสตำแหน่ง<span
class="text-danger">*</span></label>
<label for="input-label" class="ti-form-label mt-2rem">
<span class="text-danger">
*
<ng-container *ngIf="modalStatus=='add'&&checkPrimary()">
รหัสตำแหน่งซ้ำ
</ng-container>
</span></label>
<input type="text" id="input-label" class="ti-form-input w-1/2 "
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.positionId">
......@@ -187,8 +192,8 @@
</button>
<button type="button" class="ti-btn ti-btn-success"
data-hs-overlay="#position-unit-component-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.positionId||!dataSelect.tdesc"
[disabled]="!dataSelect.positionId||!dataSelect.tdesc">
[class.ti-btn-disabled]="!dataSelect.positionId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())"
[disabled]="!dataSelect.positionId||!dataSelect.tdesc||(modalStatus=='add'&&checkPrimary())">
บันทึกข้อมูล
</button>
</div>
......@@ -255,7 +260,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#position-unit-component-page-alert-modal" (click)="deletePosition()" *ngIf="numDataListChecked">
data-hs-overlay="#position-unit-component-page-alert-modal" (click)="deletePosition()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</ng-container>
......
......@@ -205,5 +205,9 @@ export class PositionUnitComponent implements OnInit {
this.dataSelect.edesc = ''
}
}
checkPrimary() {
return this.positionList.find(x => x.data.positionId == this.dataSelect.positionId)
}
}
......@@ -38,6 +38,7 @@ export class EditGroupIndicators implements OnInit {
@Output() sendEdit: EventEmitter<boolean> = new EventEmitter<boolean>();
search = ""
currentPage = 1
pageSize = 10
page = Array.from({ length: 1 }, (_, i) => i + 1);
dataList: DataModel[] = []
dataSelect: DataModel = {
......@@ -51,6 +52,7 @@ export class EditGroupIndicators implements OnInit {
dataSelectAssessmentToolsIndex: number = -1
searchModal = ""
currentPageModal = 1
pageSizeModal = 10
pageModal = Array.from({ length: 1 }, (_, i) => i + 1);
assessmentToolsLoading = false
assessmentToolsList: AssessmentToolsModal[] = []
......@@ -60,7 +62,6 @@ export class EditGroupIndicators implements OnInit {
curriculumSelectIndex: number = -1
dataLoading = false
constructor(private assessmentService: AssessmentService,
private cdr: ChangeDetectorRef,
private toastr: ToastrService,
......
......@@ -20,12 +20,12 @@
import
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
<div class="page px-rem">
......@@ -62,7 +62,7 @@
</tbody>
<tbody *ngIf="!dataLoading&&dataListFilter().length">
<tr
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
*ngFor="let item of dataListFilter() | slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index">
<td class="text-center">
{{item.code}}
</td>
......@@ -80,43 +80,8 @@
</tbody>
</table>
</div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link !pl-0" href="javascript:void(0);"
(click)="currentPage = (currentPage-1 || 1)">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li *ngFor="let item of page;let f = first;let l = last">
<ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
<ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
<a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
(click)="currentPage=item">{{item}}
</a>
</ng-container>
<ng-container
*ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
</li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
<ul class="nav-tabs mt-3">
<span>Show {{((currentPage-1) * 10)+1}} to {{dataListFilter().length<10 ?dataListFilter().length:
(currentPage==page.length ? ((currentPage * 10) - ((currentPage * 10) - dataListFilter().length) )
:(currentPage * 10) ) }} of {{dataListFilter().length}} items</span>
</ul>
</nav>
<app-pagination [totalItems]="dataListFilter().length" [pageSize]="pageSize" (pageChange)="currentPage = $event"
(pageSizeChange)="pageSize = $event;currentPage = 1"></app-pagination>
</div>
</ng-container>
......
......@@ -21,7 +21,7 @@ export class IndicatorsAndCurriculumComponent {
currentPage = 1
search = ""
page = Array.from({ length: 1 }, (_, i) => i + 1);
pageSize = 10
dataList: DataModel[] = []
indicatorsCoursesList: CompetencytopicModel[] = []
indicatorsCourses: CompetencytopicModel = new MyCompetencytopicModel({})
......
......@@ -20,12 +20,12 @@
import
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
......
......@@ -135,7 +135,8 @@
</span>
</td>
<td class="flex justify-center items-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="modalStatus='edit';modalStatusEdit=(item.data.statusFrom.code== '0'?true:false);setData(item.data)"
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
(click)="modalStatus='edit';modalStatusEdit=(item.data.statusFrom.code== '0'?true:false);setData(item.data)"
data-hs-overlay="#evaluation-cycle-page-modal"></i>
<i class="ti ti-user cursor-pointer i-gray fs-l px-1" *ngIf="item.data.statusFrom.code =='1'"
data-hs-overlay="#evaluation-cycle-person-modal"
......@@ -260,23 +261,28 @@
[(ngModel)]="evaluation_cycle.evaluationRoundId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียด (ไทย)<span class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit" [(ngModel)]="evaluation_cycle.tdesc">
<input type="text" id="detail_th" class="ti-form-input h-16" [ngClass]="{'bg-input-readonly':!modalStatusEdit}"
[readonly]="!modalStatusEdit" [(ngModel)]="evaluation_cycle.tdesc">
<label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียด (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit" [(ngModel)]="evaluation_cycle.edesc">
<input type="text" id="detail_eng" class="ti-form-input h-16" [ngClass]="{'bg-input-readonly':!modalStatusEdit}"
[readonly]="!modalStatusEdit" [(ngModel)]="evaluation_cycle.edesc">
<label for="input-label" class="ti-form-label mt-2rem">ปีการประเมิน<span class="text-danger">*</span></label>
<!-- <input type="text" id="input-label" class="ti-form-input w-1/2"
oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="evaluation_cycle.apsyear"> -->
<select class="ti-form-select" [(ngModel)]="evaluation_cycle.apsyear" [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [disabled]="!modalStatusEdit">
<select class="ti-form-select" [(ngModel)]="evaluation_cycle.apsyear"
[ngClass]="{'bg-input-readonly':!modalStatusEdit}" [disabled]="!modalStatusEdit">
<option *ngFor="let item of yearList" [ngValue]="item">{{ item }}</option>
</select>
<label for="input-label" class="ti-form-label mt-2rem">เริ่มวันที่<span class="text-danger">*</span></label>
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodStart" [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit">
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodStart"
[ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit">
<label for="input-label" class="ti-form-label mt-2rem">สิ้นสุดวันที่<span class="text-danger">*</span></label>
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd" [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit">
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd"
[ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit">
<label for="input-label" class="ti-form-label mt-2rem">ระดับพนักงาน (JL)</label>
<div *ngFor="let item of evaluation_cycle.personalLevel;let i = index;let f=first;let l = last"
......@@ -408,7 +414,8 @@
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#evaluation-cycle-page-alert-modal" (click)="deleteevaluation_cycle()" *ngIf="numDataListChecked">
data-hs-overlay="#evaluation-cycle-page-alert-modal" (click)="deleteevaluation_cycle()"
*ngIf="numDataListChecked">
ลบข้อมูล
</a>
</ng-container>
......
......@@ -43,11 +43,9 @@ export class EvaluationCycleComponent {
pl: { loading: boolean, selectIndex: number, dataList: PLModel[] } = { loading: false, selectIndex: -1, dataList: [] }
currentDate = new Date()
yearList = [
(this.currentDate.getFullYear() - 2) + "",
(this.currentDate.getFullYear() - 1) + "",
(this.currentDate.getFullYear()) + "",
(this.currentDate.getFullYear() + 1) + "",
(this.currentDate.getFullYear() + 2) + "",
]
modalStatusEdit= false
constructor(private evaluationCycleService: EvaluationCycleService,
......
......@@ -43,12 +43,12 @@
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -163,12 +163,11 @@ export class TypeRegistration {
next: response => {
if (response.success) {
this.showAlert(response.message, 'success');
this.getCompetencytypeList();
} else {
this.showAlert(response.message, 'error');
this.dataLoading = false
this.cdr.detectChanges()
}
this.getCompetencytypeList();
this.cdr.detectChanges()
},
error: error => {
this.showAlert(error.message, 'error')
......
......@@ -12,17 +12,9 @@ export class CompetencyConfigurationComponent {
setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() }
currentDate = new Date()
yearList = [
(this.currentDate.getFullYear() - 5) + "",
(this.currentDate.getFullYear() - 4) + "",
(this.currentDate.getFullYear() - 3) + "",
(this.currentDate.getFullYear() - 2) + "",
(this.currentDate.getFullYear() - 1) + "",
(this.currentDate.getFullYear()) + "",
(this.currentDate.getFullYear() + 1) + "",
(this.currentDate.getFullYear() + 2) + "",
(this.currentDate.getFullYear() + 3) + "",
(this.currentDate.getFullYear() + 4) + "",
(this.currentDate.getFullYear() + 5) + "",
(this.currentDate.getFullYear() + 1) + ""
]
constructor(private settingAssessmentService: SettingAssessmentService,
private toastr: ToastrService,
......
......@@ -162,6 +162,8 @@ import { EmpStatusService } from 'src/app/shared/services/emp-status.service';
import { PaginationComponent } from '../pagination/pagination.component';
import { RolePermissionConfigComponent } from '../company-components/account-settings/role-permission-config/role-permission-config.component';
import { ConfigPermissionService } from 'src/app/shared/services/config-permission.service';
import { TimeAttendanceManageComponent } from '../performance-management-evaluation/time-attendance/time-attendance-manage/time-attendance-manage.component';
import { TimeAttendanceStatisticsComponent } from '../performance-management-evaluation/time-attendance/time-attendance-statistics/time-attendance-statistics.component';
export const MY_DATE_FORMATS = {
......@@ -290,6 +292,8 @@ export class CustomDateAdapter extends NativeDateAdapter {
TimeAttendanceComponent,
PaginationComponent,
RolePermissionConfigComponent,
TimeAttendanceManageComponent,
TimeAttendanceStatisticsComponent,
],
imports: [
CommonModule,
......
......@@ -17,7 +17,42 @@
<ng-container *ngIf="appraisalCompentency.data">
<div class="pb-2rem px-2rem">
<div class="font-size-18px font-weight-700 text-primary">
แบบประเมินสมรรถนะพนักงาน {{currentDate.getFullYear()}}
แบบประเมินสมรรถนะพนักงาน
</div>
</div>
<div class="pb-2rem">
<div class="w-full min-height-50px justify-between items-center pb-2">
<div class="px-2rem py-3 bg-soft-secondary font-size-18px font-weight-700 text-primary">
ข้อมูลพนักงาน
</div>
</div>
<div class="p-2 grid grid-cols-12">
<div class="col-span-2"></div>
<div class="col-span-1 text-secondary">รหัสพนักงาน</div>
<div class="col-span-2">{{evaluatee.data.employeeId}}</div>
<div class="col-span-1 text-secondary">ชื่อ - สกุล</div>
<div class="col-span-6">{{evaluatee.data.thFullName}}</div>
</div>
<div class="p-2 grid grid-cols-12">
<div class="col-span-2"></div>
<div class="col-span-1 text-secondary">ตำเเหน่ง</div>
<div class="col-span-2">{{evaluatee.data.position.tdesc || ''}}</div>
<div class="col-span-1 text-secondary">ฝ่าย</div>
<div class="col-span-6">{{evaluatee.data.bu1.tdesc || ''}}</div>
</div>
<div class="p-2 grid grid-cols-12">
<div class="col-span-2"></div>
<div class="col-span-1 text-secondary">แผนก</div>
<div class="col-span-2">{{evaluatee.data.bu2.tdesc || ''}}</div>
<div class="col-span-1 text-secondary">ส่วน</div>
<div class="col-span-6">{{evaluatee.data.bu3.tdesc || ''}}</div>
</div>
<div class="p-2 grid grid-cols-12">
<div class="col-span-2"></div>
<div class="col-span-1 text-secondary">ส่วนย่อย 1</div>
<div class="col-span-2">{{evaluatee.data.bu4.tdesc || ''}}</div>
<div class="col-span-1 text-secondary">ส่วนย่อย 2</div>
<div class="col-span-6">{{evaluatee.data.bu5.tdesc || ''}}</div>
</div>
</div>
<div class="pb-2rem px-2rem">
......@@ -94,9 +129,9 @@
<tbody *ngIf="!appraisalCompentency.loading&&appraisalCompentencyFilter().length">
<ng-container *ngFor="let item2 of appraisalCompentencyFilter();let i = index">
<tr *ngFor="let bi of item2.groupAssessment1.competencyIndicatorsCourses1Mini.behavioralIndicatorsList;let i2 = index;let f = first"
(mouseenter)="hoveredCode = item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyCourseId"
(mouseenter)="hoveredCode = item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId"
(mouseleave)="hoveredCode = null"
[ngClass]="{ 'table-hover2': item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyCourseId === hoveredCode ,'border-none':!f }">
[ngClass]="{ 'table-hover2': item2.groupAssessment1.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId === hoveredCode ,'border-none':!f }">
<td class="align-start text-center">
<ng-container *ngIf="f">
{{i+1}}
......@@ -174,7 +209,8 @@
<div class="col-span-8">คะแนนรวมหลังถ่วงน้ำ</div>
<div class="col-span-3 grid grid-cols-5">
<div class="col-span-5 text-center">
{{appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal}}</div>
{{showNumber(appraisalCompentency.data.masfromEvaluationAssessment1lList[0].weightedTotal)}}
</div>
</div>
</div>
<div class="py-2 grid grid-cols-11">
......@@ -189,23 +225,14 @@
<div class="pb-2rem px-2rem">
<div class="overflow-auto rounded-top-0.65rem">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover2">
<thead class="height-50px">
<tr class="font-size-12px">
<ng-container
*ngFor="let item of ['เกณฑ์การให้คะแนนการประประเมิน Check Sheet E01','ผลประเมิน (A)','สรุปผล Gap'];let f = first ;let l = last">
*ngFor="let item of ['เกณฑ์การให้คะแนนการประเมิน','ผลประเมิน (A)','สรุปผล Gap'];let f = first ;let l = last">
<th scope="col" [attr.rowspan]="f?'1':'2'" [attr.colspan]="f?'2':'1'"
class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700 ">{{ item }}</span>
<div *ngIf="!f&&!l" class="absolute top-1/2 transform -translate-y-1/2 right-0">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
<th *ngIf="f" scope="col" rowspan="2"
class="relative bg-soft-secondary text-primary !text-center !p-0">
<div class="absolute top-1/2 transform -translate-y-1/2 right-0">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
......@@ -219,7 +246,8 @@
</tr>
</thead>
<tbody *ngIf="checkSheet.length">
<tr *ngFor="let item of checkSheet;let i = index">
<tr *ngFor="let item of checkSheet;let i = index" (mouseenter)="hoveredCode2 = 'true'"
(mouseleave)="hoveredCode2 = null" [ngClass]="{ 'table-hover2': 'true' === hoveredCode2 }">
<td class="align-start" rowspan="2">
<div *ngFor="let item2 of item.score">
<span>{{item2}} </span><br>
......@@ -230,7 +258,6 @@
<span>{{item2}} </span><br>
</div>
</td>
<td class="!p-0"></td>
<td class="align-start text-center">
{{calAverage(appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore)}}
</td>
......@@ -238,7 +265,8 @@
{{calGap(appraisalCompentency.data.masfromEvaluationAssessment1lList[0].averageScore)}}
</td>
</tr>
<tr>
<tr (mouseenter)="hoveredCode2 = 'true'" (mouseleave)="hoveredCode2 = null"
[ngClass]="{ 'table-hover2': 'true' === hoveredCode2 }">
<td class="align-start !white-space-normal" colspan="4">
หมายเหตุ<br>
ผลการประเมินอาจมีการเปลี่ยนแปลงเงื่อนไขข้อ 1-3 เนื่องจากมีคะแนนต่ำกว่าเกณฑ์ในบางข้อ
......@@ -250,7 +278,7 @@
</div>
<div class="py-1rem px-2rem">
<div class="py-2 grid grid-cols-7 gap-3">
<div class="col-span-1">ผู้ถูกประเมิน</div>
<div class="col-span-1">ผู้รับการประเมิน</div>
<div class="col-span-1">
{{appraisalCompentency.data.apsassessy.thFullName}}</div>
<div class="col-span-1">
......
......@@ -31,36 +31,44 @@ export class IdpEvalutionComponent {
this.evaluationIdpService.getFormIdp(this.evaluationRoundId, this.evaluateeId).subscribe({
next: response => {
this.formIdp.data = JSON.parse(JSON.stringify(response))
console.log(" 🐒 this.formIdp.data:", this.formIdp.data?.competencyIndicatorsCourses1)
if (this.formIdp.data) {
this.canEdit = this.formIdp.data.currentStep == this.formIdp.data.checkStep
}
switch (this.formIdp.data?.currentStep) {
case ("0"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsassessyDate = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsassessy.employeeId
}
break
}
case ("1"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsapprove1Date = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsapprove1.employeeId
}
break
}
case ("2"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsapprove2Date = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsapprove2.employeeId
}
break
}
case ("3"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsapprove3Date = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsapprove3.employeeId
}
break
}
case ("4"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsapprove4Date = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsapprove4.employeeId
}
break
}
case ("5"): {
if (this.canEdit) {
this.formIdp.data.masfromEvaluationIdp.apsapprove5Date = this.currentDate.toISOString().split('T')[0];
this.canEdit = this.evaluaterId == this.formIdp.data.apsapprove5.employeeId
}
break
}
default: { return }
......
......@@ -122,8 +122,8 @@
<button type="button" class="ti-btn rounded-sm " (click)="selectCompentencyForm(masfromEvaluationAssessment1.competencyType.competencyTypeId);onEdit = true ;
pathTitle = ['การประเมินผล', 'ประเมินตนเอง','ประเมินผล']"
[class.ti-btn-soft-secondary]="masfromEvaluationAssessment1.masfromStatusType.code == 'employee'"
[class.ti-btn-soft-warning]="masfromEvaluationAssessment1.masfromStatusType.code != 'employee'&&masfromEvaluationAssessment1.masfromStatusType.code != 'Boss_finish'"
[class.ti-btn-soft-success]="masfromEvaluationAssessment1.masfromStatusType.code == 'Boss_finish'">
[class.ti-btn-soft-warning]="masfromEvaluationAssessment1.masfromStatusType.code == 'evaluating'"
[class.ti-btn-soft-success]="masfromEvaluationAssessment1.masfromStatusType.code == 'employee_finish'">
ประเมิน
</button>
</td>
......
......@@ -107,8 +107,9 @@
<div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm "
*ngFor="let type of item.typeList"
[class.ti-btn-soft-secondary]="type.statusType == 'employee'"
[class.ti-btn-soft-warning]="type.statusType != 'employee'&&type.statusType != 'Boss_finish'"
[class.ti-btn-soft-mute]="type.statusType == 'Not_evaluating_yet'"
[class.ti-btn-soft-secondary]="type.statusType == 'Boss'"
[class.ti-btn-soft-warning]="type.statusType == 'BossEvaluating'"
[class.ti-btn-soft-success]="type.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,type.competencyTypeId,subordinate.select?.evaluationRoundId);pageEvalution='evaluation'">
......@@ -119,8 +120,9 @@
<td class="text-center">
<div class="flex justify-center">
<button type="button" class="ti-btn rounded-sm"
[class.ti-btn-soft-secondary]="item.statusIdp.statusType == 'employee'"
[class.ti-btn-soft-warning]="item.statusIdp.statusType != 'employee'&&item.statusIdp.statusType != 'Boss_finish'"
[class.ti-btn-soft-mute]="item.statusIdp.statusType == 'Not_evaluating_yet'"
[class.ti-btn-soft-secondary]="item.statusIdp.statusType == 'Boss'"
[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'">
......
......@@ -22,12 +22,12 @@
import
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -43,17 +43,9 @@ export class ManagementCycleComponent {
currentDate = new Date()
yearList = [
(this.currentDate.getFullYear() - 5) + "",
(this.currentDate.getFullYear() - 4) + "",
(this.currentDate.getFullYear() - 3) + "",
(this.currentDate.getFullYear() - 2) + "",
(this.currentDate.getFullYear() - 1) + "",
(this.currentDate.getFullYear()) + "",
(this.currentDate.getFullYear() + 1) + "",
(this.currentDate.getFullYear() + 2) + "",
(this.currentDate.getFullYear() + 3) + "",
(this.currentDate.getFullYear() + 4) + "",
(this.currentDate.getFullYear() + 5) + "",
]
constructor(private pmsMasfromEvaluationCycleService: PmsMasfromEvaluationCycleService,
private toastr: ToastrService,
......
......@@ -52,12 +52,12 @@
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -43,12 +43,12 @@
Delete
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -7,12 +7,12 @@
Save
</button>
</div>
<div class="px-1">
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div> -->
</div>
</div>
......
......@@ -11,17 +11,9 @@ export class AssessmentSystemConfigurationComponent {
setting: { loading: boolean, data: PmsSettingAssessmentModel } = { loading: false, data: new MyPmsSettingAssessmentModel() }
currentDate = new Date()
yearList = [
(this.currentDate.getFullYear() - 5) + "",
(this.currentDate.getFullYear() - 4) + "",
(this.currentDate.getFullYear() - 3) + "",
(this.currentDate.getFullYear() - 2) + "",
(this.currentDate.getFullYear() - 1) + "",
(this.currentDate.getFullYear()) + "",
(this.currentDate.getFullYear() + 1) + "",
(this.currentDate.getFullYear() + 2) + "",
(this.currentDate.getFullYear() + 3) + "",
(this.currentDate.getFullYear() + 4) + "",
(this.currentDate.getFullYear() + 5) + "",
]
constructor(private pmsSettingAssessmentService: PmsSettingAssessmentService,
private toastr: ToastrService,
......
import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { MyEmeventgrpModel } from 'src/app/shared/model/emeventgrp.model';
import { EventgrpModel, MyEventgrpModel, } from 'src/app/shared/model/eventgrp.model';
import { PmsWorkingTimeModel, MyPmsWorkingTimeModel } from 'src/app/shared/model/pms-working-time.model';
import { EventgrpService } from 'src/app/shared/services/eventgrp.service';
import { FileService } from 'src/app/shared/services/file.service';
import { PmsWorkingTimeService } from 'src/app/shared/services/pms-working-time.service';
interface table {
currentPage: number,
page: number[],
search: string
}
@Component({
selector: 'app-time-attendance-manage',
templateUrl: './time-attendance-manage.component.html',
styleUrls: ['./time-attendance-manage.component.scss']
})
export class TimeAttendanceManageComponent {
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
currentPage = 1;
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = '';
modalStatus: "add" | "edit" | "delete" | "deleteGroup" = "add"
modal: table = {
currentPage: 1,
page: Array.from({ length: 1 }, (_, i) => i + 1),
search: ""
}
eventgrp: { loading: boolean, selectIndex: number, selectList: EventgrpModel[], dataList: { check: boolean, data: EventgrpModel }[] } = { loading: false, selectIndex: -1, selectList: [new MyEventgrpModel()], dataList: [] }
pmsWorkingTime: { loading: boolean, select: PmsWorkingTimeModel, dataList: { check: boolean, data: PmsWorkingTimeModel }[] } = { loading: false, select: new MyPmsWorkingTimeModel(), dataList: [] }
constructor(
private toastr: ToastrService,
private cdr: ChangeDetectorRef,
private fileService: FileService,
private eventgrpService: EventgrpService,
private pmsWorkingTimeService: PmsWorkingTimeService,
) { }
ngOnInit(): void {
this.getEventgrpList()
this.getPmsWorkingTimeList()
}
getPmsWorkingTimeList() {
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.getList().subscribe({
next: response => {
this.pmsWorkingTime.dataList = response.map(x => ({ check: false, data: new MyPmsWorkingTimeModel(x) }))
this.pmsWorkingTime.loading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.searchChange()
this.cdr.detectChanges();
}, error: error => {
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
pmsWorkingTimeFilter() {
return this.pmsWorkingTime.dataList.filter((x) => {
const data = x.data
const match = data.pmsWorkingTimeId.toLowerCase().includes(this.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
data.detailUnit.toLowerCase().includes(this.search.toLowerCase()) ||
(data.weight + "").toLowerCase().includes(this.search.toLowerCase())
return match;
});
}
searchChange() {
this.currentPage = 1;
const filteredData = this.pmsWorkingTimeFilter();
this.page = Array.from({ length: Math.ceil(filteredData.length / 10) }, (_, i) => i + 1);
this.dataListCheck();
}
selectData(data?: PmsWorkingTimeModel) {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel(data)
}
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.pmsWorkingTimeFilter().forEach(x => x.check = selectAll);
this.dataListCheck();
}
dataListCheck() {
const dataCheck = this.pmsWorkingTimeFilter();
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = this.pmsWorkingTime.dataList.filter(x => x.check).length;
this.isDataListChecked = Boolean(this.numDataListChecked)
}
getEventgrpList() {
this.eventgrp.loading = true
this.eventgrpService.getList().subscribe({
next: response => {
this.eventgrp.dataList = response.map(x => ({ check: false, data: new MyEventgrpModel(x) }))
this.eventgrp.loading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.searchChange()
this.cdr.detectChanges();
}, error: error => {
this.eventgrp.loading = false
this.cdr.detectChanges()
}
})
}
eventgrpListFilter() {
return this.eventgrp.dataList.filter(x => {
const data = x.data
const match = data.eventgrpId.toLowerCase().includes(this.modal.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()) || data.edesc.toLowerCase().includes(this.modal.search.toLowerCase());
return match;
})
}
selectEventgrp(data?: EventgrpModel) {
if (!data) {
this.pmsWorkingTime.select.emeventgrp.splice(this.eventgrp.selectIndex, 1);
return;
}
this.pmsWorkingTime.select.emeventgrp.push(new MyEmeventgrpModel(data))
}
clearData(modalStatus: string) {
if (modalStatus == 'add') {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel()
} else if (modalStatus == 'edit') {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel({ pmsWorkingTimeId: this.pmsWorkingTime.select.pmsWorkingTimeId })
}
this.eventgrp.selectList = [new MyEventgrpModel()]
}
modalSearchChange(dataList: any) {
this.modal.currentPage = 1
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
}
updatePmsWorkingTime() {
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.post(new MyPmsWorkingTimeModel(this.pmsWorkingTime.select)).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmsWorkingTimeList()
this.searchChange()
} else {
this.showAlert(response.message, 'error')
this.pmsWorkingTime.loading = false
}
this.cdr.detectChanges()
}, error: error => {
this.showAlert(error.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
deletePmsWorkingTime() {
let body: PmsWorkingTimeModel[] = []
if (this.modalStatus == "deleteGroup") {
body = this.pmsWorkingTime.dataList.filter(x => x.check).map(x => new MyPmsWorkingTimeModel(x.data))
} else {
body = [new MyPmsWorkingTimeModel(this.pmsWorkingTime.select)]
}
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.delete(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmsWorkingTimeList()
} else {
this.showAlert(response.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
})
}
}
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md">
<div class="ti-modal-header bg-primary text-center">
<h5 class="text-xxl font-bold text-white">
นำเข้าข้อมูลสถิติเวลาทำงาน
</h5>
</div>
<div class="ti-modal-body max-h-full overflow-hidden ti-modal-content !rounded-t-none !rounded-b-sm">
<h1 class="mt-2rem text-xl" style="text-align: center;">ไฟล์</h1>
<div class="mt-2rem p-2">
<div class="flex rounded-md">
<input #fileInput id="fileInput" type="file" (change)="onFileSelected($event)" hidden>
<input type="text" [value]="selectedFileName" readonly (click)="fileInput.click()"
class="ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10 cursor-pointer">
<button type="button" (click)="fileInput.click()"
class="inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-secondary text-white hover:bg-secondary focus:z-10 focus:outline-none focus:ring-0 focus:ring-secondary transition-all text-sm">
<i class="ti ti-upload"></i>
</button>
</div>
<div class="flex justify-center mt-2rem ">
<h1 class="cursor-pointer justify-center -mb-px inline-flex items-center gap-2
text-center text-secondary border-secondary border-b-2 align-items-end text-xl"
(click)="downloadFile()">
ดาวน์โหลดตัวอย่างไฟล์</h1>
</div>
<div class="flex justify-center mt-2rem mb-1rem space-x-4">
<button type="submit" class="ti-btn ti-btn-secondary"
data-hs-overlay="#company-registration-page-upload-modal" [class.ti-btn-disabled]="!selectedFile"
(click)="uploadFile()" [disabled]="!selectedFile" [disabled]="!selectedFile">
อัปโหลด
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { FileService } from 'src/app/shared/services/file.service';
interface table {
currentPage: number,
page: number[],
search: string
}
@Component({
selector: 'app-time-attendance-statistics',
templateUrl: './time-attendance-statistics.component.html',
styleUrls: ['./time-attendance-statistics.component.scss']
})
export class TimeAttendanceStatisticsComponent {
selectedFile: File | null = null;
selectedFileName: string = 'กรุณาเลือกไฟล์';
constructor(private toastr: ToastrService,
private cdr: ChangeDetectorRef,
private fileService: FileService) { }
onFileSelected(event: any) {
this.selectedFile = event.target.files.length > 0 ? event.target.files[0] : null;
this.selectedFileName = this.selectedFile?.name || "กรุณาเลือกไฟล์"
}
uploadFile() {
if (!this.selectedFile) {
alert('กรุณาเลือกไฟล์ก่อนอัปโหลด')
return
}
const formData = new FormData();
formData.append('file', this.selectedFile);
this.fileService.uploadExcel(formData, 'PMS_WORKING_TIME_EMP').subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
} else {
this.showAlert(response.message, 'error')
this.cdr.detectChanges();
}
}, error: error => {
this.showAlert(error.message, 'error')
this.cdr.detectChanges();
}
})
}
downloadFile() {
const fileName = 'IMPORT_PMS_WORKING_TIME_EMP.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({
next: response => {
const url = window.URL.createObjectURL(response);
const a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}, error: error => {
this.showAlert(error.message, 'error')
}
})
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
}
\ No newline at end of file
import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { MyEmeventgrpModel } from 'src/app/shared/model/emeventgrp.model';
import { EventgrpModel, MyEventgrpModel, } from 'src/app/shared/model/eventgrp.model';
import { PmsWorkingTimeModel, MyPmsWorkingTimeModel } from 'src/app/shared/model/pms-working-time.model';
import { EventgrpService } from 'src/app/shared/services/eventgrp.service';
import { FileService } from 'src/app/shared/services/file.service';
import { PmsWorkingTimeService } from 'src/app/shared/services/pms-working-time.service';
import { Component } from '@angular/core';
interface table {
currentPage: number,
page: number[],
......@@ -18,176 +11,5 @@ interface table {
})
export class TimeAttendanceComponent {
pathTitle = ['การประเมินจัดการประสิทธิภาพ', 'ทะเบียนการประเมินเวลาทำงาน', 'การจัดการหัวข้อการประเมินเวลาทำงาน']
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
currentPage = 1;
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = '';
modalStatus: "add" | "edit" | "delete" | "deleteGroup" = "add"
modal: table = {
currentPage: 1,
page: Array.from({ length: 1 }, (_, i) => i + 1),
search: ""
}
eventgrp: { loading: boolean, selectIndex: number, selectList: EventgrpModel[], dataList: { check: boolean, data: EventgrpModel }[] } = { loading: false, selectIndex: -1, selectList: [new MyEventgrpModel()], dataList: [] }
pmsWorkingTime: { loading: boolean, select: PmsWorkingTimeModel, dataList: { check: boolean, data: PmsWorkingTimeModel }[] } = { loading: false, select: new MyPmsWorkingTimeModel(), dataList: [] }
constructor(
private toastr: ToastrService,
private cdr: ChangeDetectorRef,
private fileService: FileService,
private eventgrpService: EventgrpService,
private pmsWorkingTimeService: PmsWorkingTimeService,
) { }
ngOnInit(): void {
this.getEventgrpList()
this.getPmsWorkingTimeList()
}
getPmsWorkingTimeList() {
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.getList().subscribe({
next: response => {
this.pmsWorkingTime.dataList = response.map(x => ({ check: false, data: new MyPmsWorkingTimeModel(x) }))
this.pmsWorkingTime.loading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.searchChange()
this.cdr.detectChanges();
}, error: error => {
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
pmsWorkingTimeFilter() {
return this.pmsWorkingTime.dataList.filter((x) => {
const data = x.data
const match = data.pmsWorkingTimeId.toLowerCase().includes(this.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
data.detailUnit.toLowerCase().includes(this.search.toLowerCase()) ||
(data.weight + "").toLowerCase().includes(this.search.toLowerCase())
return match;
});
}
searchChange() {
this.currentPage = 1;
const filteredData = this.pmsWorkingTimeFilter();
this.page = Array.from({ length: Math.ceil(filteredData.length / 10) }, (_, i) => i + 1);
this.dataListCheck();
}
selectData(data?: PmsWorkingTimeModel) {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel(data)
}
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.pmsWorkingTimeFilter().forEach(x => x.check = selectAll);
this.dataListCheck();
}
dataListCheck() {
const dataCheck = this.pmsWorkingTimeFilter();
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = this.pmsWorkingTime.dataList.filter(x => x.check).length;
this.isDataListChecked = Boolean(this.numDataListChecked)
}
getEventgrpList() {
this.eventgrp.loading = true
this.eventgrpService.getList().subscribe({
next: response => {
this.eventgrp.dataList = response.map(x => ({ check: false, data: new MyEventgrpModel(x) }))
this.eventgrp.loading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.searchChange()
this.cdr.detectChanges();
}, error: error => {
this.eventgrp.loading = false
this.cdr.detectChanges()
}
})
}
eventgrpListFilter() {
return this.eventgrp.dataList.filter(x => {
const data = x.data
const match = data.eventgrpId.toLowerCase().includes(this.modal.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()) || data.edesc.toLowerCase().includes(this.modal.search.toLowerCase());
return match;
})
}
selectEventgrp(data?: EventgrpModel) {
if (!data) {
this.pmsWorkingTime.select.emeventgrp.splice(this.eventgrp.selectIndex, 1);
return;
}
this.pmsWorkingTime.select.emeventgrp.push(new MyEmeventgrpModel(data))
}
clearData(modalStatus: string) {
if (modalStatus == 'add') {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel()
} else if (modalStatus == 'edit') {
this.pmsWorkingTime.select = new MyPmsWorkingTimeModel({ pmsWorkingTimeId: this.pmsWorkingTime.select.pmsWorkingTimeId })
}
this.eventgrp.selectList = [new MyEventgrpModel()]
}
modalSearchChange(dataList: any) {
this.modal.currentPage = 1
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
}
updatePmsWorkingTime() {
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.post(new MyPmsWorkingTimeModel(this.pmsWorkingTime.select)).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmsWorkingTimeList()
this.searchChange()
} else {
this.showAlert(response.message, 'error')
this.pmsWorkingTime.loading = false
}
this.cdr.detectChanges()
}, error: error => {
this.showAlert(error.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
deletePmsWorkingTime() {
let body: PmsWorkingTimeModel[] = []
if (this.modalStatus == "deleteGroup") {
body = this.pmsWorkingTime.dataList.filter(x => x.check).map(x => new MyPmsWorkingTimeModel(x.data))
} else {
body = [new MyPmsWorkingTimeModel(this.pmsWorkingTime.select)]
}
this.pmsWorkingTime.loading = true
this.pmsWorkingTimeService.delete(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getPmsWorkingTimeList()
} else {
this.showAlert(response.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.pmsWorkingTime.loading = false
this.cdr.detectChanges()
}
})
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
})
}
currentPath = 1
}
......@@ -85,6 +85,7 @@ export class SidebarComponent {
this.getConfigPermissionByUserLevel()
this.ParentActive();
this.router.events.subscribe((event) => {
sessionStorage.setItem('currentUrl', this.router.url)
if (event instanceof NavigationEnd) {
this.ParentActive();
}
......@@ -115,25 +116,32 @@ export class SidebarComponent {
this.configPermission.data = new MyConfigPermissionModel(response)
this.menuItems.forEach(x => {
// เปิดทุกเมนู
x.show = true
x.children?.forEach(y => {
y.show = true
})
// เปิดตาม config
// const configMenu = this.configPermission.data.menuBody.find(y => y.id == x.id)
// if (configMenu) {
// x.show = configMenu.show
// x.show = true
// x.children?.forEach(y => {
// const configChildren = configMenu.children.find(z => z.id == y.id)
// if (configChildren) {
// y.show = configChildren.show
// }
// y.show = true
// })
// }
// เปิดตาม config
const configMenu = this.configPermission.data.menuBody.find(y => y.id == x.id)
if (configMenu) {
x.show = configMenu.show
x.children?.forEach(y => {
const configChildren = configMenu.children.find(z => z.id == y.id)
if (configChildren) {
y.show = configChildren.show
}
})
}
})
let path404check = '/404page'
this.menuItems.forEach(x => {
const children = x.children?.find(y => y.path == sessionStorage.getItem('currentUrl'))
if (children?.show && path404check == '/404page') {
path404check = children.path || '/404page'
}
})
if (path404check == '/404page') {
this.menuItems.forEach(x => {
if (x.show && path404check == '/404page') {
x.children?.forEach(y => {
if (y.show) {
......@@ -142,6 +150,7 @@ export class SidebarComponent {
})
}
})
}
this.router.navigate([path404check]);
this.configPermission.loading = false
this.cdr.detectChanges()
......
......@@ -740,6 +740,7 @@ export interface AppraisalCompentencyModel2 {
masfromEvaluationAssessment1lList: MasfromEvaluationAssessment1lList[]
currentStep: string
lastStep: string
checkStep: string
masfromStatusType: MasfromStatusType
}
export interface MasfromStatusType {
......
......@@ -19,6 +19,8 @@ export interface Masfromevaluationassessment {
shortName: string,
statusType: string
}
checkStep: string
currentStep: string
}
export interface MasfromStatusType {
......
......@@ -15,6 +15,7 @@ export interface IdpFormModel {
masfromEvaluationIdp: MasfromEvaluationIdp
competencyIndicatorsCourses1: CompetencyIndicatorsCourses1[]
boss: Boss
checkStep: string
}
export interface PersonalLevel {
......
......@@ -25027,5 +25027,9 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
}
.ti-btn-soft-mute:hover {
background-color: rgb(0 0 0 / 0.5);
color: white
color: white;
}
.\!border-red {
border-color: red !important;
}
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