Commit b6c8325c by Nakarin Luankla

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

parents 73cd9771 f7949afd
......@@ -57,6 +57,13 @@ export class EditGroupCompetenciesComponent {
next: response => {
this.groupCompetencies = new MyGroupAssessmentModel({ ...response, personalLevel: new MyPLModel(this.pl) })
this.dataList = new MyGroupAssessmentModel(response).groupAssessment1List.map(x => ({ check: false, data: new MyGroupAssessment1ListModel(x) }))
this.dataList.sort((a, b) => {
const topicA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const topicB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const expectationA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
const expectationB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
return topicA.localeCompare(topicB) || expectationA.localeCompare(expectationB);
})
this.dataLoading = false;
this.searchChange();
this.cdr.detectChanges();
......@@ -84,13 +91,6 @@ export class EditGroupCompetenciesComponent {
data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase().includes(this.search.toLowerCase());
return match;
})
.sort((a, b) => {
const topicA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const topicB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const expectationA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
const expectationB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
return topicA.localeCompare(topicB) || expectationA.localeCompare(expectationB);
});
}
......@@ -117,6 +117,13 @@ export class EditGroupCompetenciesComponent {
competencyIndicatorsCourses1Mini: new MyCompetencyIndicatorsCourses1MiniModel(data)
})
})
this.dataList.sort((a, b) => {
const topicA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const topicB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
const expectationA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
const expectationB = b.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.expectation.toLowerCase();
return topicA.localeCompare(topicB) || expectationA.localeCompare(expectationB);
});
this.isDataListCheckedAll = false
this.searchChange()
this.dataListCheckAll()
......@@ -164,7 +171,7 @@ export class EditGroupCompetenciesComponent {
this.dataListCheckAll()
this.cdr.detectChanges();
} else {
this.dataList = this.dataList.splice(this.groupAssessmentIndex, 1)
this.dataList = this.dataList.filter((_, index) => index !== this.groupAssessmentIndex);
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.detectChanges();
......
......@@ -6,8 +6,18 @@
</div>
<ng-template #selfEvaluation>
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem">
ประเมินผล ประจำปี {{currentDate.getFullYear()}}
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem" *ngIf="!byBoss">
ประเมินผลประจำปี {{currentDate.getFullYear()}}
</div>
<div class="flex pt-2rem px-2rem" *ngIf="byBoss">
<button type="button" class="ti-btn ti-btn-outline ti-btn-outline-light h-20px m-0 shadow-md text-blue-500"
(click)="returnPageEvalution()">
<i class="ti ti-chevron-left"></i>
ย้อนกลับ
</button>
<div class="font-size-18px font-weight-700 align-center text-primary pl-1rem">
ประเมินผลประจำปี {{currentDate.getFullYear()}}
</div>
</div>
<div class="pt-0.75rem">
<div class="border-b border-gray-200 dark:border-white/10 px-2rem">
......@@ -33,30 +43,30 @@
<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">{{employee.data.employeeId}}</div>
<div class="col-span-2">{{evaluatee.data.employeeId}}</div>
<div class="col-span-1 text-secondary">ตำเเหน่ง</div>
<div class="col-span-6">{{employee.data.position.tdesc}}</div>
<div class="col-span-6">{{evaluatee.data.position.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">{{employee.data.thFullName}}</div>
<div class="col-span-2">{{evaluatee.data.thFullName}}</div>
<div class="col-span-1 text-secondary">ฝ่าย</div>
<div class="col-span-6">{{employee.data.bu1.tdesc}}</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">{{employee.data.bu2.tdesc}}</div>
<div class="col-span-2">{{evaluatee.data.bu2.tdesc}}</div>
<div class="col-span-1 text-secondary">ส่วน</div>
<div class="col-span-6">{{employee.data.bu3.tdesc}}</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">ส่วนย่อย</div>
<div class="col-span-2">{{employee.data.bu4.tdesc}}</div>
<div class="col-span-2">{{evaluatee.data.bu4.tdesc}}</div>
<div class="col-span-1 text-secondary">ส่วนย่อย 1 </div>
<div class="col-span-6">{{employee.data.bu5.tdesc}}</div>
<div class="col-span-6">{{evaluatee.data.bu5.tdesc}}</div>
</div>
</div>
<div class="pb-2">
......@@ -118,7 +128,8 @@
</td>
<td class="flex justify-center items-center">
<span class="rounded-md bg-success text-white px-3 py-1 cursor-pointer"
(click)="getAppraisalCompentencyForm(masfromEvaluationAssessment1.competencyType.competencyTypeId);currentTemplate = selfEvaluationEdit ; pathTitle = ['การประเมินผล', 'ประเมินผล']">
(click)="getAppraisalCompentencyForm(masfromEvaluationAssessment1.competencyType.competencyTypeId);currentTemplate = selfEvaluationEdit ;
pathTitle = byBoss?['การประเมินผล','ประเมินโดยหัวหน้า','ประเมินลูกน้อง', 'ประเมินผล']:['การประเมินผล', 'ประเมินตนเอง','ประเมินผล']">
ประเมิน
</span>
</td>
......@@ -206,12 +217,12 @@
<div class="flex">
<button type="button"
class="ti-btn ti-btn-outline ti-btn-outline-light h-20px m-0 shadow-md text-blue-500"
(click)="currentTemplate = selfEvaluation ; pathTitle = ['การประเมินผล', 'ประเมินตนเอง']">
(click)="currentTemplate = selfEvaluation ; pathTitle = byBoss?['การประเมินผล','ประเมินโดยหัวหน้า','ประเมินลูกน้อง']:['การประเมินผล', 'ประเมินตนเอง']">
<i class="ti ti-chevron-left"></i>
ย้อนกลับ
</button>
<div class="font-size-18px font-weight-700 align-center text-primary pl-1rem">
ประเมินผล ประจำปี 2024
ประเมินผลประจำปี {{currentDate.getFullYear()}}
</div>
</div>
</div>
......@@ -320,8 +331,7 @@
</td>
<td class="align-center text-center" *ngFor="let value of [5,4,3,2,1]; let i3=index">
<input type="radio" [name]="'radio'+i+''+i2" class="ti-form-radio cursor-pointer"
[id]="'radio'+i+''+i2+''+i3" [value]="value"
[disabled]="!employee.evaluate"
[id]="'radio'+i+''+i2+''+i3" [value]="value" [disabled]="!employee.evaluate"
[(ngModel)]="bi.competencyBehavioral.scoreTopicExpectation"
(ngModelChange)="calnumberCheck()">
</td>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
import { AppraisalCompentencyModel, AppraisalCompentencyModel2 } from 'src/app/shared/model/appraisal-competency.model';
import { EmployeeModel, MyEmployeeModel } from 'src/app/shared/model/employee.model';
import { MySettingAssessmentModel, SettingAssessmentModel } from 'src/app/shared/model/setting-assessment.model';
......@@ -21,6 +21,7 @@ export interface BiModel {
export class SelfEvaluationComponent implements OnInit {
@Input() pathTitle = ['การประเมินผล', 'ประเมินตนเอง']
@Input() employeeId?: string
@Input() byBoss: boolean = false
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>();
hoveredCode: string | null = null;
......@@ -39,6 +40,7 @@ export class SelfEvaluationComponent implements OnInit {
appraisalCompentency2: { loading: boolean, data?: AppraisalCompentencyModel2 } = { loading: false, data: undefined }
appraisalPms: { loading: boolean, select: undefined, dataList: { check: boolean, data: undefined }[] } = { loading: false, select: undefined, dataList: [] }
employee: { loading: boolean, data: EmployeeModel, evaluate: boolean } = { loading: false, data: new MyEmployeeModel(), evaluate: false }
evaluatee: { loading: boolean, data: EmployeeModel } = { loading: false, data: new MyEmployeeModel() }
setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() }
currentDate = new Date()
constructor(private appraisalService: AppraisalService,
......@@ -50,6 +52,7 @@ export class SelfEvaluationComponent implements OnInit {
ngOnInit(): void {
this.currentTemplate = this.selfEvaluation
this.getWorking()
this.getEvaluatee()
this.getAppraisalCompentencyList()
this.getSettingList()
if (this.pathTitle.find(x => ['การประเมินผล', 'ประเมินโดยหัวหน้า'].includes(x))) {
......@@ -61,6 +64,7 @@ export class SelfEvaluationComponent implements OnInit {
this.sendPathTitle.emit(['การประเมินผล', 'ประเมินโดยหัวหน้า', 'ประเมินลูกน้อง'])
}
returnPageEvalution() {
this.sendPathTitle.emit(['การประเมินผล', 'ประเมินโดยหัวหน้า'])
this.sendPageEvalution.emit("")
}
......@@ -77,9 +81,22 @@ export class SelfEvaluationComponent implements OnInit {
}
})
}
getEvaluatee() {
this.evaluatee.loading = true
this.employeeService.getWorkingById(this.employeeId).subscribe({
next: response => {
this.evaluatee.data = new MyEmployeeModel(response)
this.evaluatee.loading = false
this.cdr.detectChanges()
}, error: error => {
this.evaluatee.loading = false
this.cdr.detectChanges()
}
})
}
getWorking() {
this.employee.loading = true
this.employeeService.getWorkingById(this.employeeId).subscribe({
this.employeeService.getWorking().subscribe({
next: response => {
this.employee.data = new MyEmployeeModel(response)
this.employee.loading = false
......@@ -92,7 +109,7 @@ export class SelfEvaluationComponent implements OnInit {
}
getAppraisalCompentencyList() {
this.appraisalCompentency.loading = true
this.appraisalService.getCompetencyList().subscribe({
this.appraisalService.getCompetencyList(this.employeeId).subscribe({
next: response => {
this.appraisalCompentency.dataList = JSON.parse(JSON.stringify(response))
if (this.appraisalCompentency.dataList.length) {
......@@ -115,7 +132,7 @@ export class SelfEvaluationComponent implements OnInit {
getAppraisalCompentencyForm(typeId: string) {
this.appraisalCompentency2.loading = true
if (this.appraisalCompentency.select) {
this.appraisalService.getFormCompentencyById(this.appraisalCompentency.select.masfromEvaluationRound.evaluationRoundId, this.employee.data.employeeId, typeId).subscribe({
this.appraisalService.getFormCompentencyById(this.appraisalCompentency.select.masfromEvaluationRound.evaluationRoundId, this.evaluatee.data.employeeId, typeId).subscribe({
next: response => {
this.appraisalCompentency2.data = JSON.parse(JSON.stringify(response))
if (this.appraisalCompentency2.data?.masfromEvaluationAssessment1lList[0]) {
......
<div class="header-title-type p-0">
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<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"
style="height: 40px;">
<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">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<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 class="header-title-table bg-soft-secondary text-primary">
<span>ประเมินสมรรถนะ</span>
</div>
<div class="overflow-auto table-bordered rounded-t-md">
<div id="card-type-1" role="tabpanel" aria-labelledby="card-type-item-1">
<div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*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"
[class.!text-center]="f||l||'ประเมิน'||'เเผนพัฒนา'||'PMS'">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l&&!f&&!i">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg" width="50"
height="16" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of subordinateFilter();let i = index">
<td class="text-center" style="font-size: 12px; width: 150px;">
{{item.apsassessy.employeeId}}
</td>
<td style="font-size: 12px; width: 175px;">
{{item.apsassessy.thFullName}}
</td>
<td style="font-size: 12px;">{{item.apsassessy.position.tdesc}}</td>
<td class="flex justify-center">
<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('evaluate')">
ประเมิน
</button>
</td>
<td style="width: 160px; text-align: center; vertical-align: middle;">
<button type="button" class="ti-btn rounded-sm soft-dark text-white text-center"
style="height: 15px; width: 45px; font-size: 12px;" (click)="returnPage('idp')">
IDP
</button>
</td>
<td class="text-center" style="font-size: 12px;">{{item.sumScore}}</td>
<td class="text-center" style="font-size: 12px;">{{item.gread}}</td>
<td class="text-center" style="font-size: 12px;">{{item.masfromStatusType.tdesc}}</td>
<td class="text-center" style="font-size: 12px;">{{item.apsapproveType.tdesc}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
\ No newline at end of file
.button-clear {
position: absolute;
top: 96px;
z-index: 1;
right: 41vw;
}
.button-help {
position: absolute;
top: 0px;
z-index: 1;
right: 0vw;
margin: 4.2rem;
margin-right: 10px; /* เพิ่มใหม่ 12/16*/
}
table.ti-custom-table thead {
height: 60px;
}
table.ti-custom-table thead th span {
font-size: 12px;
font-weight: bold;
}
.ti-custom-table td{
padding-left: 0.9rem;
padding-right: 1rem;
}
.ti-custom-table thead th:first-child {
width: 105px; /* ปรับความกว้างตามที่ต้องการ */
text-align: left; /* จัดตำแหน่งข้อความถ้าต้องการ */
}
.ti-custom-table thead th:last-child {
width: 150px; /* ปรับความกว้างตามที่ต้องการ */
}
a.custom-link {
padding: 10px 40px; /* ปรับ padding ให้เพิ่มขนาด */
}
/* สไตล์ของแถบเมนู */
.nav-tabs {
display: flex;
width: 100%;
cursor: pointer;
margin-bottom: 10px;
height: 20%;
}
.nav-item {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link {
text-decoration: none;
padding: 10px 20px;
display: inline-block;
font-size: large;
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: #ccc;
border-radius: 5px 5px 0px 0px;
}
.nav-link:hover {
background-color: #f0f0f0; /* เปลี่ยนสีเมื่อ hover */
}
.nav-link.active {
color: #ffffff; /* สีตัวอักษรในสถานะ active */
font-size: large;
border-bottom: 3.5px solid rgb(var(--color-primary)); /* เส้นใต้ */
background-color: rgb(var(--color-primary));
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: rgb(var(--color-primary));
border-radius: 5px 5px 0px 0px;
}
.tab-content {
margin-top: 20px;
}
.tab-pane.active {
display: block;
}
.nav-item-text {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link-text {
text-decoration: none;
display: inline-block;
font-size: large;
color: #569bf5;
border-bottom: 2px solid #569bf5;
line-height: 0.8;
}
.ti-pagination .page-link.active {
background-color: #569bf5;
color: white;
border-radius: 50%;
padding: 8px 12px;
}
.box-body{
padding: 0rem;
}
.page{
min-height: 0vh;
}
.ti-modal-content{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
.header-title-type {
width: 100%;
min-height: 50px; /* ใช้ min-height เพื่อให้มีความยืดหยุ่น */
// margin-top: 50px;
// margin-bottom: 10px;
justify-content: space-between; /* จัดเรียงองค์ประกอบภายใน */
align-items: center; /* จัดกลางแนวตั้ง */
padding-bottom: 1rem;
}
.header-title-table {
display: flex;
align-items: center; /* จัดกึ่งกลางในแนวตั้ง */
justify-content: flex-start; /* จัดตัวอักษรชิดซ้าย */
height: 60px; /* ความสูงของกรอบ */
padding-left: 20px; /* ระยะชิดซ้าย */
margin-bottom: 10px;
border-radius: 5px;
}
.header-title-table span {
font-size: 18px;
font-weight: bold;
}
.soft-dark{
background-color: #838282;
}
\ No newline at end of file
......@@ -9,37 +9,6 @@ import { AppraisalService } from 'src/app/shared/services/appraisal.service';
styleUrls: ['./round-one.component.scss']
})
export class RoundOneComponent {
@Input() pathTitle = ['การประเมินสมรรถนะ', 'ทะเบียนเครื่องมือ', 'เครื่องมือประเมิน'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>();
@Output() sendEmployeeId: EventEmitter<string> = new EventEmitter<string>();
subordinate: { loading: false, dataList: AppraisalSubordinateModel[] } = { loading: false, dataList: [] }
search = ""
constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) {
}
ngOnInit(): void {
this.getBossList()
}
getBossList() {
this.appraisalService.getBossList().subscribe({
next: response => {
this.subordinate.dataList = response.map(x => new MyAppraisalSubordinateModel(x))
this.cdr.detectChanges()
}, error: error => {
this.cdr.detectChanges()
}
})
}
subordinateFilter() {
return this.subordinate.dataList.filter(x => {
return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase())
})
}
returnPage(text: string) {
this.sendEmployeeId.emit()
this.sendPageEvalution.emit(text)
}
}
......@@ -4,12 +4,91 @@
</div>
<div class="block-main-content">
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem">
ประเมินผล ประจำปี {{currentDate.getFullYear()}}
ประเมินผลประจำปี {{currentDate.getFullYear()}}
</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" (sendEmployeeId)="employeeId=$event"></app-round-one>
<div class="pt-50px px-2rem pb-2rem">
<div class="header-title-type p-0">
<div class="flex justify-end">
<div class="px-1">
<div class="relative shadow-md">
<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" style="height: 40px;">
<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">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<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 class="w-full min-height-50px justify-between items-center py-2">
<div class="px-2rem py-3 bg-soft-secondary font-size-18px font-weight-700 text-primary">
ประเมินสมรรถนะ
</div>
</div>
<div class="overflow-auto table-bordered rounded-t-md">
<div id="card-type-1" role="tabpanel" aria-labelledby="card-type-item-1">
<div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*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"
[class.!text-center]="f||l||'ประเมิน'||'เเผนพัฒนา'||'PMS'">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0"
*ngIf="!l&&!f&&!i">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg"
width="50" height="16" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of subordinateFilter();let i = index">
<td class="text-center" style="font-size: 12px; width: 150px;">
{{item.apsassessy.employeeId}}
</td>
<td style="font-size: 12px; width: 175px;">
{{item.apsassessy.thFullName}}
</td>
<td style="font-size: 12px;">{{item.apsassessy.position.tdesc}}</td>
<td class="text-center">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-success"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item);pageEvalution='evaluation'">
ประเมิน
</button>
</td>
<td class="text-center">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-dark"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;">
IDP
</button>
</td>
<td class="text-center" style="font-size: 12px;">{{item.sumScore}}</td>
<td class="text-center" style="font-size: 12px;">{{item.gread}}</td>
<td class="text-center" style="font-size: 12px;">{{item.masfromStatusType.tdesc}}
</td>
<td class="text-center" style="font-size: 12px;">{{item.apsapproveType.tdesc}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
......@@ -21,8 +100,8 @@
<ng-container *ngIf="pageEvalution=='pms'">
<app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution>
</ng-container>
<ng-container *ngIf="pageEvalution=='c'">
<!-- <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 *ngIf="pageEvalution=='evaluation'&&subordinate.select.apsassessy.employeeId">
<app-self-evaluation [byBoss]="true" [pathTitle]="pathTitle" (sendPageEvalution)="pageEvalution=$event"
(sendPathTitle)="pathTitle=$event"
[employeeId]="subordinate.select.apsassessy.employeeId"></app-self-evaluation>
</ng-container>
\ No newline at end of file
import { Component } from '@angular/core';
import { ChangeDetectorRef, Component } from '@angular/core';
import { AppraisalSubordinateModel, MyAppraisalSubordinateModel } from 'src/app/shared/model/appraisal-subordinate.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service';
@Component({
selector: 'app-supervisor-evaluation',
......@@ -8,6 +10,32 @@ import { Component } from '@angular/core';
export class SupervisorEvaluationComponent {
pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']
pageEvalution = ''
employeeId?: string
currentDate = new Date()
subordinate: { loading: false, select: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[] } = { loading: false, select: new MyAppraisalSubordinateModel(), dataList: [] }
search = ""
constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) {
}
ngOnInit(): void {
this.getBossList()
}
getBossList() {
this.appraisalService.getBossList().subscribe({
next: response => {
this.subordinate.dataList = response.map(x => new MyAppraisalSubordinateModel(x))
this.cdr.detectChanges()
}, error: error => {
this.cdr.detectChanges()
}
})
}
subordinateFilter() {
return this.subordinate.dataList.filter(x => {
return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase())
})
}
selectSubordinate(data: AppraisalSubordinateModel) {
this.subordinate.select = new MyAppraisalSubordinateModel(data)
this.cdr.detectChanges()
}
}
......@@ -73,6 +73,7 @@ export class EditEvaluationGroupingComponent {
}
selectPmstopic(data?: PmstopicModel) {
this.pmsGroupAssessment.dataList.push({ check: false, data: new MyPmsGroupAssessment1Model({ pmsTopic: new MyPmstopicModel(data) }) })
this.pmsGroupAssessment.dataList.sort((a, b) => a.data.pmsTopic.pmsTopicId.localeCompare(b.data.pmsTopic.pmsTopicId))
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.markForCheck()
......@@ -83,6 +84,7 @@ export class EditEvaluationGroupingComponent {
this.pmsGroupAssessmentService.getBy_plId(this.pl.plId).subscribe({
next: response => {
this.pmsGroupAssessment.dataList = response.pmsGroupAssessment1List.map(x => ({ check: false, data: new MyPmsGroupAssessment1Model(x) }))
this.pmsGroupAssessment.dataList.sort((a, b) => a.data.pmsTopic.pmsTopicId.localeCompare(b.data.pmsTopic.pmsTopicId))
this.pmsGroupAssessment.loading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
......@@ -159,6 +161,7 @@ export class EditEvaluationGroupingComponent {
break;
}
}
this.pmsGroupAssessment.dataList.sort((a, b) => a.data.pmsTopic.pmsTopicId.localeCompare(b.data.pmsTopic.pmsTopicId))
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.markForCheck()
......
......@@ -29,7 +29,7 @@
</div>
</div>
</div>
<!-- <div class="px-1">
<div class="px-1">
<button type="button"
class="ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-10 m-0 shadow-md"
data-hs-overlay="#assessment-topics-upload-modal"
......@@ -37,7 +37,7 @@
<i class="ti ti-file-plus"></i>
import
</button>
</div> -->
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-10 m-0 shadow-md"
data-hs-overlay="#assessment-topics-modal" (click)="modalStatus='add';selectPmstopic()">
......@@ -68,7 +68,7 @@
<thead>
<tr>
<ng-container
*ngFor="let item of ['','รหัส','ชื่อประเภท','ชื่อย่อ','Action']; 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 !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l&&!f">
......@@ -98,10 +98,10 @@
<tbody *ngIf="!pmstopic.loading&&pmstopicListFilter().length">
<tr
*ngFor="let item of pmstopicListFilter()| slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="text-center"><input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.data.pmsTopicId}}"
[(ngModel)]="item.check" (change)="dataListCheck()"></td>
<td >
<td class="text-center"><input type="checkbox" class="ti-form-checkbox cursor-pointer"
id="checkbox-{{item.data.pmsTopicId}}" [(ngModel)]="item.check" (change)="dataListCheck()"></td>
<td>
<label for="checkbox-{{item.data.pmsTopicId}}">&nbsp;{{item.data.pmsTopicId}}</label>
</td>
<td>{{item.data.tdesc}}</td>
......@@ -374,7 +374,7 @@
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
ข้อมูลประเภทการประเมิน
รายการประเภทการประเมิน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......@@ -402,7 +402,7 @@
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container *ngFor="let item of ['รหัส', 'ชื่อประเภท', 'ชื่อย่อ']; let f = first; let l = last">
<ng-container *ngFor="let item of ['รหัส', 'ชื่อหัวข้อ', 'ชื่อประเภท']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f">
<span class="text-sm">{{ item }}</span>
......
......@@ -64,10 +64,13 @@ export class AssessmentTopicsComponent {
pmstypeListFilter() {
return this.pmstype.dataList.filter(x => {
const data = x.data
const match = data.pmsTypeId.toLowerCase().includes(this.modal.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()) ||
data.shortName.toLowerCase().includes(this.modal.search.toLowerCase())
return match
if (x.data.pmsTypeId != '06' && x.data.pmsTypeId != '07') {
const match = data.pmsTypeId.toLowerCase().includes(this.modal.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.modal.search.toLowerCase()) ||
data.shortName.toLowerCase().includes(this.modal.search.toLowerCase())
return match
}
return
})
}
selectPmstype(data?: PmstypeModel) {
......
......@@ -18,14 +18,14 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
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
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
}
}
......@@ -17,8 +17,8 @@ export class AppraisalService {
getFormCompentencyById(evaluationRoundId: string, apsassessy: string, typeId: string): Observable<AppraisalCompentencyModel2> {
return this.http.get<AppraisalCompentencyModel2>(this.urlApi + "/competency/" + evaluationRoundId + "/" + apsassessy + "/" + typeId)
}
getCompetencyList(): Observable<AppraisalCompentencyModel[]> {
return this.http.get<AppraisalCompentencyModel[]>(this.urlApi + "/competency/emp")
getCompetencyList(employeeId?: string): Observable<AppraisalCompentencyModel[]> {
return this.http.get<AppraisalCompentencyModel[]>(this.urlApi + "/competency/emp" + (employeeId ? "?employeeid=" + employeeId : ''))
}
postCompetency(body: AppraisalCompentencyModel2): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi + "/competency", body)
......
......@@ -38,7 +38,7 @@ export class EmployeeService {
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 : ''))
return this.http.get<EmployeeModel>(this.urlApi + "/working/mini" + (employeeId ? "?employeeid=" + employeeId : ''))
}
getProfile(): Observable<EmployeeModel> {
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