Commit 0e9ba3b9 by Nakarin Luankla

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

parents 13c2c8ba f4222918
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</div> </div>
<div class="px-1"> <div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md" <button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#edit-group-competencies-table-modal-select"> (click)="searchModalChange()" data-hs-overlay="#edit-group-competencies-table-modal-select">
<i class="ri-add-line"></i> <i class="ri-add-line"></i>
Add Add
</button> </button>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['รหัส','ชื่อประเภท','ระดับความคาดหวัง','การจัดการ']; let f = first; let l = last; let i = index"> *ngFor="let item of ['รหัส','ชื่อสมรรถนะ','ระดับความคาดหวัง','การจัดการ']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l"> [class.!text-center]="f||l">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
......
...@@ -158,10 +158,17 @@ export class EditGroupCompetenciesComponent { ...@@ -158,10 +158,17 @@ export class EditGroupCompetenciesComponent {
} }
deleteGroupAssessmentById() { deleteGroupAssessmentById() {
this.dataList = this.dataList.filter((item, i) => (this.groupAssessmentIndex == -1 ? !item.check : i != this.groupAssessmentIndex)); if (this.groupAssessmentIndex == -1) {
this.isDataListCheckedAll = false this.dataList = this.dataList.filter(item => !item.check);
this.dataListCheckAll() this.isDataListCheckedAll = false
this.cdr.detectChanges(); this.dataListCheckAll()
this.cdr.detectChanges();
} else {
this.dataList = this.dataList.splice(this.groupAssessmentIndex, 1)
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.detectChanges();
}
} }
showAlert(text: string, type: 'success' | 'error') { showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', { this.toastr[type](text, 'แจ้งเตือน', {
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
</a> </a>
<div class="ciricon flex text-start items-center cursor-pointer" <div class="ciricon flex text-start items-center cursor-pointer"
*ngIf="!seeTab" *ngIf="!seeTab"
(click)="assessmentToolsSelectIndex=[l,m];deleteAssessmentTools()"> (click)="dataSelectIndex=i;assessmentToolsSelectIndex=[l,m];deleteAssessmentTools()">
<i class="ri-close-line text-red-500"></i> <i class="ri-close-line text-red-500"></i>
</div> </div>
</ng-container> </ng-container>
......
...@@ -281,5 +281,4 @@ export class EditGroupIndicators implements OnInit { ...@@ -281,5 +281,4 @@ export class EditGroupIndicators implements OnInit {
positionClass: 'toast-top-right', positionClass: 'toast-top-right',
}) })
} }
} }
...@@ -119,7 +119,7 @@ export class IndicatorsAndCurriculumComponent { ...@@ -119,7 +119,7 @@ export class IndicatorsAndCurriculumComponent {
this.dataLoading = true this.dataLoading = true
this.competencytopicService.getList().subscribe({ this.competencytopicService.getList().subscribe({
next: response => { next: response => {
this.dataList = response.map(x => ({ code: x.competencyTopicId, name: x.tdesc, type: x.competencyType.tdesc, file: x.competencyFiles || "" })) this.dataList = response.map(x => ({ code: x.competencyTopicId || "", name: x.tdesc || "", type: x.competencyType.tdesc || "", file: x.competencyFiles || "" }))
this.indicatorsCoursesList = response this.indicatorsCoursesList = response
this.dataLoading = false this.dataLoading = false
this.searchChange() this.searchChange()
...@@ -146,42 +146,9 @@ export class IndicatorsAndCurriculumComponent { ...@@ -146,42 +146,9 @@ export class IndicatorsAndCurriculumComponent {
dataListFilter() { dataListFilter() {
return this.dataList.filter(x => { return this.dataList.filter(x => {
const match = x.code.toLowerCase().includes(this.search.toLowerCase()) || x.name.toLowerCase().includes(this.search.toLowerCase()); return x.code.toLowerCase().includes(this.search.toLowerCase()) || x.name.toLowerCase().includes(this.search.toLowerCase()) || x.type.toLowerCase().includes(this.search.toLowerCase())
return match;
}); });
} }
showSuccess() {
this.toastr.success('บันทึกข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessEdit() {
this.toastr.success('เเก้ไขข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessDelete() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
addUser() {
console.log('เพิ่มผู้ใช้งาน');
}
deleteUser() {
console.log('ลบผู้ใช้งาน');
}
editUser() {
console.log('แก้ไขผู้ใช้งาน');
}
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<div class="px-1"> <div class="px-1">
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name" class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by Name"
[(ngModel)]="search" (ngModelChange)="searchEMP()"> [(ngModel)]="search" (ngModelChange)="searchChange()">
<div <div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4"> class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i> <i class="ri-search-line text-gray"></i>
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
<div class="page px-rem"> <div class="page px-rem">
<div class="overflow-auto shadow-md rounded-t-md"> <div class="overflow-auto shadow-md rounded-t-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"> <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
style="table-layout: auto;width: 100%;overflow-x: hidden;white-space: normal; word-break: break-word;">
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
...@@ -66,13 +67,19 @@ ...@@ -66,13 +67,19 @@
<tbody *ngIf="!groupapprove_listLoading&&groupapprove_listFilter().length"> <tbody *ngIf="!groupapprove_listLoading&&groupapprove_listFilter().length">
<tr <tr
*ngFor="let item of groupapprove_listFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"> *ngFor="let item of groupapprove_listFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td>{{item.apsassessy.fname}} {{item.apsassessy.lname}}</td> <td style="word-break: break-word;white-space: normal;">{{item.apsassessy.fname}}
<td>{{item.apsapprove1.fname}} {{item.apsapprove1.lname}}</td> {{item.apsassessy.lname}}</td>
<td>{{item.apsapprove2.fname}} {{item.apsapprove2.lname}}</td> <td style="word-break: break-word;white-space: normal;">{{item.apsapprove1.fname}}
<td>{{item.apsapprove3.fname}} {{item.apsapprove3.lname}}</td> {{item.apsapprove1.lname}}</td>
<td>{{item.apsapprove4.fname}} {{item.apsapprove4.lname}}</td> <td style="word-break: break-word;white-space: normal;">{{item.apsapprove2.fname}}
<td>{{item.apsapprove5.fname}} {{item.apsapprove5.lname}}</td> {{item.apsapprove2.lname}}</td>
<td class="flex justify-center"> <td style="word-break: break-word;white-space: normal;">{{item.apsapprove3.fname}}
{{item.apsapprove3.lname}}</td>
<td style="word-break: break-word;white-space: normal;">{{item.apsapprove4.fname}}
{{item.apsapprove4.lname}}</td>
<td style="word-break: break-word;white-space: normal;">{{item.apsapprove5.fname}}
{{item.apsapprove5.lname}}</td>
<td style="word-break: break-word;white-space: normal;" class="text-center">
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" <i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
(click)="currentModel='edit';selectGroupapprove(item)" (click)="currentModel='edit';selectGroupapprove(item)"
data-hs-overlay="#set-approvers-modal"></i> data-hs-overlay="#set-approvers-modal"></i>
......
...@@ -116,6 +116,7 @@ export class SetApproversComponent { ...@@ -116,6 +116,7 @@ export class SetApproversComponent {
employee_listFilter() { employee_listFilter() {
return this.employee_list.filter(x => x.fname.toLowerCase().includes(this.search.toLowerCase()) || return this.employee_list.filter(x => x.fname.toLowerCase().includes(this.search.toLowerCase()) ||
x.lname.toLowerCase().includes(this.search.toLowerCase())) x.lname.toLowerCase().includes(this.search.toLowerCase()))
} }
searchEMP() { searchEMP() {
this.employeeModal.currentPage = 1 this.employeeModal.currentPage = 1
...@@ -156,15 +157,23 @@ export class SetApproversComponent { ...@@ -156,15 +157,23 @@ export class SetApproversComponent {
} }
searchChange() { searchChange() {
this.currentPage = 1 this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.groupapprove_listFilter().length / 10) }, (_, i) => i + 1); this.page = Array.from({ length: Math.ceil(this.groupapprove_listFilter().length / 10) }, (_, i) => i + 1)
} }
groupapprove_listFilter() { groupapprove_listFilter() {
return this.groupapprove_list.filter(x => x.apsapprove1.employeeId || x.apsapprove2.employeeId || x.apsapprove3.employeeId || x.apsapprove4.employeeId || x.apsapprove5.employeeId.toLowerCase().includes(this.search.toLowerCase()) || return this.groupapprove_list.filter(x =>
x.apsapprove1.fname || x.apsapprove1.lname.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsapprove2.fname || x.apsapprove2.lname.toLowerCase().includes(this.search.toLowerCase()) || x.apsapprove1.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsapprove3.fname || x.apsapprove3.lname.toLowerCase().includes(this.search.toLowerCase()) || x.apsapprove2.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsapprove4.fname || x.apsapprove4.lname.toLowerCase().includes(this.search.toLowerCase()) || x.apsapprove3.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsapprove5.fname || x.apsapprove5.lname.toLowerCase().includes(this.search.toLowerCase())) x.apsapprove4.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsapprove5.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
(x.apsassessy.fname.toLowerCase() + " " + x.apsassessy.lname.toLowerCase()).includes(this.search.toLowerCase()) ||
(x.apsapprove1.fname.toLowerCase() + " " + x.apsapprove1.lname.toLowerCase()).includes(this.search.toLowerCase()) ||
(x.apsapprove2.fname.toLowerCase() + " " + x.apsapprove2.lname.toLowerCase()).includes(this.search.toLowerCase()) ||
(x.apsapprove3.fname.toLowerCase() + " " + x.apsapprove3.lname.toLowerCase()).includes(this.search.toLowerCase()) ||
(x.apsapprove4.fname.toLowerCase() + " " + x.apsapprove4.lname.toLowerCase()).includes(this.search.toLowerCase()) ||
(x.apsapprove5.fname.toLowerCase() + " " + x.apsapprove5.lname.toLowerCase()).includes(this.search.toLowerCase())
)
} }
selectGroupapprove(groupapprove?: GroupApproveModel) { selectGroupapprove(groupapprove?: GroupApproveModel) {
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<div class="flex justify-end"> <div class="flex justify-end">
<div class="px-1"> <div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-success h-10 m-0 shadow-md" <button type="button" class="ti-btn ti-btn-soft-success h-10 m-0 shadow-md"
data-hs-overlay="#competency-configuration-alert-modal"> data-hs-overlay="#competency-configuration-alert-modal"
[class.ti-btn-disabled]="!setting.data.apsyear||checkEmpty(setting.data.expectationLevel)||!setting.data.settingGroupAssessment"
[disabled]="!setting.data.apsyear||checkEmpty(setting.data.expectationLevel)||!setting.data.settingGroupAssessment">
<i class="ri-save-3-line"></i> <i class="ri-save-3-line"></i>
Save Save
</button> </button>
......
...@@ -57,5 +57,18 @@ export class CompetencyConfigurationComponent { ...@@ -57,5 +57,18 @@ export class CompetencyConfigurationComponent {
}) })
} }
checkEmpty(data?: string | number) {
switch (typeof data) {
case ('number'): {
return data == null || data == undefined
}
case ('string'): {
return data == "" || data == null || data == undefined
}
default: {
return true
}
}
}
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['รหัสพนักงาน','ชื่อพนักงาน','ตำเเหน่งงาน','ประเมิน','เเผนพัฒนา','PMS','ผลประเมิน','เกรด','สถานะ','สถานะผู้ประเมิน']; let f = first; let l = last; let i = index"> *ngFor="let item of ['รหัสพนักงาน','ชื่อพนักงาน','ตำเเหน่งงาน','ประเมิน','เเผนพัฒนา','ผลประเมิน','เกรด','สถานะ','สถานะผู้ประเมิน']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l||'ประเมิน'||'เเผนพัฒนา'||'PMS'"> [class.!text-center]="f||l||'ประเมิน'||'เเผนพัฒนา'||'PMS'">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
...@@ -46,30 +46,19 @@ ...@@ -46,30 +46,19 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr <tr *ngFor="let item of subordinateFilter();let i = index">
*ngFor="let item of[ <td class="text-center" style="font-size: 12px; width: 150px;">
['10001', 'ธนพัต อาชาไชย', 'HRD training Officer', '', '', '', '70', 'c', 'ประเมินเเล้ว', 'ผู้อนุมัติลำดับที่ 1'], {{item.apsassessy.employeeId}}
['10002', 'พิชญาภา มหาเมธี', 'HRD training Officer', '', '', '', '-', '-', 'ยังไม่ประเมิน', '-'], </td>
['10003', 'นิรดา บุญเทพ', 'HRD training Officer', '', '', '', '76', '', 'ประเมินเเล้ว', 'ผู้อนุมัติลำดับที่3'], <td style="font-size: 12px; width: 175px;">
['10004', 'รัตน์ ธนากร', 'HRD training Officer', '', '', '', '79', '', 'ประเมินเเล้ว', 'ผู้อนุมัติลำดับที่ 1'], {{item.apsassessy.thFullName}}
['10005', 'ยศกร ศิริธาดา', 'HRD training Officer', '', '', '', '', '', 'ประเมินเเล้ว', 'ผู้อนุมัติลำดับที่ 2'], </td>
['10006', 'ธนิสรา นพรัตน์พร', 'HRD training Officer', '', '', '', '80', '', 'ประเมินเเล้ว', '-'], <td style="font-size: 12px;">{{item.apsassessy.position.tdesc}}</td>
['10007', 'เมริสา สุขทิพย์', 'HRD training Officer', '', '', '', '', '', 'ประเมินเเล้ว', '-']];let i = index">
<td class="text-center" style="font-size: 12px; width: 150px;">{{item[0]}}</td>
<td style="font-size: 12px; width: 175px;">{{item[1]}}</td>
<td style="font-size: 12px;">{{item[2]}}</td>
<td class="flex justify-center"> <td class="flex justify-center">
<button type="button" class="ti-btn rounded-sm ti-btn-secondary"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;" (click)="returnPage('c')">
CC
</button>
<button type="button" class="ti-btn rounded-sm ti-btn-warning"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;" (click)="returnPage('c')">
MC
</button>
<button type="button" class="ti-btn rounded-sm ti-btn-success" <button type="button" class="ti-btn rounded-sm ti-btn-success"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;" (click)="returnPage('c')"> style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;"
PC (click)="returnPage('evaluate')">
ประเมิน
</button> </button>
</td> </td>
<td style="width: 160px; text-align: center; vertical-align: middle;"> <td style="width: 160px; text-align: center; vertical-align: middle;">
...@@ -78,16 +67,10 @@ ...@@ -78,16 +67,10 @@
IDP IDP
</button> </button>
</td> </td>
<td class="text-center"> <td class="text-center" style="font-size: 12px;">{{item.sumScore}}</td>
<button type="button" class="ti-btn rounded-sm ti-btn-success" <td class="text-center" style="font-size: 12px;">{{item.gread}}</td>
style="height: 15px; width: 55px; font-size: 12px; display: flex; align-items: center; justify-content: center;" (click)="returnPage('pms')"> <td class="text-center" style="font-size: 12px;">{{item.masfromStatusType.tdesc}}</td>
ประเมิน <td class="text-center" style="font-size: 12px;">{{item.apsapproveType.tdesc}}</td>
</button>
</td>
<td class="text-center" style="font-size: 12px;">{{item[6]}}</td>
<td class="text-center" style="font-size: 12px;">{{item[7]}}</td>
<td class="text-center" style="font-size: 12px;">{{item[8]}}</td>
<td class="text-center" style="font-size: 12px;">{{item[9]}}</td>
</tr> </tr>
</tbody> </tbody>
......
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { AppraisalSubordinateModel, MyAppraisalSubordinateModel } from 'src/app/shared/model/appraisal-subordinate.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service';
@Component({ @Component({
selector: 'app-round-one', selector: 'app-round-one',
...@@ -10,84 +12,33 @@ export class RoundOneComponent { ...@@ -10,84 +12,33 @@ export class RoundOneComponent {
@Input() pathTitle = ['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', 'เครื่องมือประเมิน']; @Input() pathTitle = ['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', 'เครื่องมือประเมิน'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>(); @Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>(); @Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>();
activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น @Output() sendEmployeeId: EventEmitter<string> = new EventEmitter<string>();
isChecked: boolean = false;
subordinate: { loading: false, dataList: AppraisalSubordinateModel[] } = { loading: false, dataList: [] }
// ฟังก์ชันในการเปลี่ยนแท็บ search = ""
changeTab(tab: { id: string, text: string }) { constructor(private appraisalService: AppraisalService,
this.sendPathTitle.emit(['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', tab.text]); private cdr: ChangeDetectorRef) {
this.activeTab = tab.id; }
} ngOnInit(): void {
this.getBossList()
toggleCheckbox(): void { }
this.isChecked = !this.isChecked; getBossList() {
} this.appraisalService.getBossList().subscribe({
next: response => {
// การจัดการการเปิดปิด modal this.subordinate.dataList = response.map(x => new MyAppraisalSubordinateModel(x))
modalOptions: { this.cdr.detectChanges()
[nameModal: string]: { }, error: error => {
isModalOpen: boolean; this.cdr.detectChanges()
modalSize: string;
backdropClose: boolean;
};
} = {
"add": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
},
"edit": {
isModalOpen: false,
modalSize: 'm',
backdropClose: true,
} }
}; })
openModal(name: string, size: string, closeOnBackdrop?: boolean) {
this.modalOptions[name].modalSize = size;
this.modalOptions[name].backdropClose = closeOnBackdrop || false;
this.modalOptions[name].isModalOpen = true;
this.currentModal = name; // ตั้งค่าค่าของ currentModal เป็น 'add' หรือ 'edit'
document.body.style.overflow = 'hidden';
}
closeModal(name: string) {
this.modalOptions[name].isModalOpen = false;
if (!this.isAnyModalOpen()) {
document.body.style.overflow = ''; // คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
isAnyModalOpen(): boolean {
return Object.values(this.modalOptions).some(modal => modal.isModalOpen); // ตรวจสอบว่า modal อื่นยังเปิดอยู่หรือไม่
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addUser() {
}
currentModal = ""
constructor(private toastr: ToastrService) { }
showSuccess() {
this.toastr.success('บันทึกข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
}
showSuccessEdit() {
this.toastr.success('เเก้ไขข้อมูลสำเร็จ', 'เเจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
});
} }
showSuccessDelete() { subordinateFilter() {
this.toastr.success('ลบข้อมูลสำเร็จ', 'เเจ้งเตือน', { return this.subordinate.dataList.filter(x => {
timeOut: 3000, return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase())
positionClass: 'toast-top-right', })
});
} }
returnPage(text: string) { returnPage(text: string) {
this.sendEmployeeId.emit()
this.sendPageEvalution.emit(text) this.sendPageEvalution.emit(text)
} }
} }
......
...@@ -4,30 +4,12 @@ ...@@ -4,30 +4,12 @@
</div> </div>
<div class="block-main-content"> <div class="block-main-content">
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem"> <div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem">
ประเมินผล ประจำปี 2024 ประเมินผล ประจำปี {{currentDate.getFullYear()}}
</div> </div>
<div class="pt-0.75rem"> <div class="pt-50px px-2rem">
<div class="border-b border-gray-200 dark:border-white/10 px-2rem"> <div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<nav class=" flex space-x-2 rtl:space-x-reverse"> <app-round-one [pathTitle]="pathTitle" (sendPathTitle)="pathTitle=$event"
<a class="border justify-center rounded-top-4px bg-primary text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center text-gray-600 active" (sendPageEvalution)="pageEvalution=$event" (sendEmployeeId)="employeeId=$event"></app-round-one>
href="javascript:void(0);" id="card-type-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1">
รอบการประเมินที่ 1/2
</a>
<a class="border justify-center rounded-top-4px bg-primary text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center text-gray-600 active"
href="javascript:void(0);" id="card-type-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1">
รอบการประเมินที่ 2/2
</a>
</nav>
</div>
<div class="pt-50px px-2rem">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-round-one [pathTitle]="pathTitle" (sendPathTitle)="pathTitle=$event"
(sendPageEvalution)="pageEvalution=$event"></app-round-one>
</div>
<div id="underline-2" role="tabpanel" aria-labelledby="underline-item-2">
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -40,5 +22,7 @@ ...@@ -40,5 +22,7 @@
<app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution> <app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution>
</ng-container> </ng-container>
<ng-container *ngIf="pageEvalution=='c'"> <ng-container *ngIf="pageEvalution=='c'">
<app-c-evaluation (sendPageEvalution)="pageEvalution=$event"></app-c-evaluation> <!-- <app-c-evaluation (sendPageEvalution)="pageEvalution=$event"></app-c-evaluation> -->
<app-self-evaluation [pathTitle]="pathTitle" (sendPageEvalution)="pageEvalution=$event"
(sendPathTitle)="pathTitle=$event" (employeeId)="employeeId"></app-self-evaluation>
</ng-container> </ng-container>
\ No newline at end of file
...@@ -8,4 +8,6 @@ import { Component } from '@angular/core'; ...@@ -8,4 +8,6 @@ import { Component } from '@angular/core';
export class SupervisorEvaluationComponent { export class SupervisorEvaluationComponent {
pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า'] pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']
pageEvalution = '' pageEvalution = ''
employeeId?: string
currentDate = new Date()
} }
import { EmployeeModel, MyEmployeeModel } from "./employee.model"
import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model"
export interface AppraisalSubordinateModel {
companyId: string
active: boolean
masfromStatusType: StatusCodeModel
apsapproveType: StatusCodeModel
apsassessy: EmployeeModel
gread: string
sumScore: number
}
export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
companyId: string
active: boolean
masfromStatusType: StatusCodeModel
apsapproveType: StatusCodeModel
apsassessy: EmployeeModel
gread: string
sumScore: number
constructor(data: Partial<AppraisalSubordinateModel>) {
this.companyId = data.companyId || ""
this.active = data.active ?? false
this.masfromStatusType = new MyStatusCodeModel(data.masfromStatusType)
this.apsapproveType = new MyStatusCodeModel(data.apsapproveType)
this.apsassessy = new MyEmployeeModel(data.apsassessy)
this.gread = data.gread || ""
this.sumScore = data.sumScore ?? 0
}
}
...@@ -3,8 +3,9 @@ import { Injectable } from '@angular/core'; ...@@ -3,8 +3,9 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model'; import { AlertModel } from '../model/alert.model';
import { AppraisalModel } from '../model/appraisal.model';
import { AppraisalFormModel } from '../model/appraisal-form.model'; import { AppraisalFormModel } from '../model/appraisal-form.model';
import { AppraisalCompentencyModel, AppraisalCompentencyModel2 } from '../model/appraisal-competency.model';
import { AppraisalSubordinateModel } from '../model/appraisal-subordinate.model';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
...@@ -13,13 +14,16 @@ export class AppraisalService { ...@@ -13,13 +14,16 @@ export class AppraisalService {
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getFormCompentencyById(evaluationRoundId: string, apsassessy: string, typeId: string): Observable<AppraisalFormModel> { getFormCompentencyById(evaluationRoundId: string, apsassessy: string, typeId: string): Observable<AppraisalCompentencyModel2> {
return this.http.get<AppraisalFormModel>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId) return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId)
} }
getCompetencyList(): Observable<AppraisalModel[]> { getCompetencyList(): Observable<AppraisalCompentencyModel[]> {
return this.http.get<AppraisalModel[]>(this.urlApi + "/competency/emp") return this.http.get<AppraisalCompentencyModel[]>(this.urlApi + "/competency/emp")
} }
postCompetency(body: AppraisalFormModel): Observable<AlertModel> { postCompetency(body: AppraisalCompentencyModel2): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/competency", body) return this.http.post<AlertModel>(this.urlApi + "/competency", body)
} }
getBossList(): Observable<AppraisalSubordinateModel[]> {
return this.http.get<AppraisalSubordinateModel[]>(this.urlApi + "/boss/emp")
}
} }
\ No newline at end of file
...@@ -34,6 +34,12 @@ export class EmployeeService { ...@@ -34,6 +34,12 @@ export class EmployeeService {
getById(employeeId: string): Observable<EmployeeModel> { getById(employeeId: string): Observable<EmployeeModel> {
return this.http.get<EmployeeModel>(this.urlApi + "/profile?employeeId=" + employeeId) return this.http.get<EmployeeModel>(this.urlApi + "/profile?employeeId=" + employeeId)
} }
getWorking(): Observable<EmployeeModel> {
return this.http.get<EmployeeModel>(this.urlApi + "/working/mini")
}
getWorkingById(employeeId?: string): Observable<EmployeeModel> {
return this.http.get<EmployeeModel>(this.urlApi + "/working/mini" + (employeeId ? "?employeeId=" + employeeId : ''))
}
getProfile(): Observable<EmployeeModel> { getProfile(): Observable<EmployeeModel> {
return this.http.get<EmployeeModel>(this.urlApi + "/profile") return this.http.get<EmployeeModel>(this.urlApi + "/profile")
} }
......
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