Commit 7fd7a2f9 by Nattana Chaiyamat

การประเมินจัดการประสิทธิภาพ

ทะเบียนกำหนดชื่อ
หัวข้อการประเมิน
parent 7ec12de4
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
</table> </table>
</div> </div>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -510,7 +510,7 @@ ...@@ -510,7 +510,7 @@
</table> </table>
</div> </div>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
</table> </table>
</div> </div>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
......
...@@ -584,7 +584,7 @@ ...@@ -584,7 +584,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -712,7 +712,7 @@ ...@@ -712,7 +712,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -839,7 +839,7 @@ ...@@ -839,7 +839,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -967,7 +967,7 @@ ...@@ -967,7 +967,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -1095,7 +1095,7 @@ ...@@ -1095,7 +1095,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -1223,7 +1223,7 @@ ...@@ -1223,7 +1223,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
...@@ -1351,7 +1351,7 @@ ...@@ -1351,7 +1351,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
......
...@@ -88,7 +88,6 @@ import { EditDefineDocumentFormComponent } from '../competency-assessment/evalua ...@@ -88,7 +88,6 @@ import { EditDefineDocumentFormComponent } from '../competency-assessment/evalua
import { EvaluationCyclePerformanceComponent } from '../performance-management-evaluation/evaluation-cycle-performance/evaluation-cycle-performance.component'; import { EvaluationCyclePerformanceComponent } from '../performance-management-evaluation/evaluation-cycle-performance/evaluation-cycle-performance.component';
import { DocumentFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/document-form.component'; import { DocumentFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/document-form.component';
import { EditEvaluationFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/edit-evaluation-form/edit-evaluation-form.component'; import { EditEvaluationFormComponent } from '../performance-management-evaluation/evaluation-cycle-performance/document-form/edit-evaluation-form/edit-evaluation-form.component';
import { RoundOneComponent } from '../performance-evaluation/supervisor-evaluation/round-one/round-one.component';
import { SupervisorEvaluationComponent } from '../performance-evaluation/supervisor-evaluation/supervisor-evaluation.component'; import { SupervisorEvaluationComponent } from '../performance-evaluation/supervisor-evaluation/supervisor-evaluation.component';
import { EmployeeRegistrationComponent } from '../company-components/employee-registration/employee-registration.component'; import { EmployeeRegistrationComponent } from '../company-components/employee-registration/employee-registration.component';
import { SubEmployeeRegistrationComponent } from '../company-components/employee-registration/sub-employee-registration/sub-employee-registration.component'; import { SubEmployeeRegistrationComponent } from '../company-components/employee-registration/sub-employee-registration/sub-employee-registration.component';
...@@ -112,7 +111,7 @@ import { SelfEvaluationComponent } from '../performance-evaluation/self-evaluati ...@@ -112,7 +111,7 @@ import { SelfEvaluationComponent } from '../performance-evaluation/self-evaluati
import { CompanyRegistrationPageComponent } from '../company-components/company-registration/company-registration-page/company-registration-page.component'; import { CompanyRegistrationPageComponent } from '../company-components/company-registration/company-registration-page/company-registration-page.component';
import { IdpEvalutionComponent } from '../performance-evaluation/idp-evaluation/idp-evalution.component'; import { IdpEvalutionComponent } from '../performance-evaluation/idp-evaluation/idp-evalution.component';
import { PmsEvalutionComponent } from '../performance-evaluation/pms-evaluation/pms-evalution.component'; import { PmsEvalutionComponent } from '../performance-evaluation/pms-evaluation/pms-evalution.component';
import { CEvaluationComponent } from '../performance-evaluation/c-evaluation/c-evaluation.component'; import { EvaluationComponent } from '../performance-evaluation/evaluation/evaluation.component';
import { CompanyService } from 'src/app/shared/services/company.service'; import { CompanyService } from 'src/app/shared/services/company.service';
import { CompetencytypeService } from 'src/app/shared/services/competencytype.service'; import { CompetencytypeService } from 'src/app/shared/services/competencytype.service';
import { CompetencytopicService } from 'src/app/shared/services/competencytopic.service'; import { CompetencytopicService } from 'src/app/shared/services/competencytopic.service';
...@@ -247,7 +246,6 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -247,7 +246,6 @@ export class CustomDateAdapter extends NativeDateAdapter {
EvaluationCyclePerformanceComponent, EvaluationCyclePerformanceComponent,
DocumentFormComponent, DocumentFormComponent,
EditEvaluationFormComponent, EditEvaluationFormComponent,
RoundOneComponent,
SupervisorEvaluationComponent, SupervisorEvaluationComponent,
EmployeeRegistrationComponent, EmployeeRegistrationComponent,
SubEmployeeRegistrationComponent, SubEmployeeRegistrationComponent,
...@@ -270,7 +268,7 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -270,7 +268,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
IdpEvalutionComponent, IdpEvalutionComponent,
CompanyRegistrationPageComponent, CompanyRegistrationPageComponent,
PmsEvalutionComponent, PmsEvalutionComponent,
CEvaluationComponent, EvaluationComponent,
ManageUserComponent, ManageUserComponent,
PmsGradeRegistrationComponent, PmsGradeRegistrationComponent,
PmsGradeManagementComponent, PmsGradeManagementComponent,
......
import { Component, EventEmitter, OnInit, Output, TemplateRef, ViewChild } from '@angular/core';
import Swal from 'sweetalert2';
export interface DataModel {
code: string,
name: string,
bi: BiModel[],
}
export interface BiModel {
name: string,
tools: string[],
degree: string
}
export interface Data2Model {
score: string[],
condition: string[],
e: string,
a: string,
gap: string
}
@Component({
selector: 'app-c-evaluation',
templateUrl: './c-evaluation.component.html',
styleUrls: ['./c-evaluation.component.scss']
})
export class CEvaluationComponent implements OnInit {
@Output() sendPageEvalution: EventEmitter<string> = new EventEmitter<string>();
pathTitle = ['การประเมินผล', 'ประเมินตนเอง']
hoveredCode: string | null = null;
dataList: DataModel[] = [
{
code: "CC-01",
name: "จิตสำนึกด้านความปลอดภัยและคุณภาพ (Safety & Quality)",
bi: [{
name: "สอนงานด้านความปลอดภัย และคุณภาพของบริษัทให้กับพนักงานในหน่วยงาน",
tools: ["O"],
degree: "4"
}, {
name: "ติดตามและปรับปรุงการทำงานด้านความปลอดภัยและคุณภาพของทีมงาน",
tools: ["O", "D"],
degree: "5"
}],
},
{
code: "CC-02",
name: "การทำงานเป็นทีมแบบ TAT (TAT Teamwork)",
bi: [{
name: "คิดวิเคราะห์เพื่อแก้ปัญหาด้านความปลอดภัยและคุณภาพในหน่วยงานที่รับผิดชอบ",
tools: ["O", "D"],
degree: "5"
}, {
name: "นำเสนอและจัดทำรายงานด้านความปลอดภัยและคุณภาพทั้งภาษาไทยและภาษาอังกฤษ",
tools: ["O"],
degree: "2"
},
{
name: "สอนงาน และพัฒนาทีมงานให้เกิดการทำงานเป็นทีม โดยยึดเป้าหมายเดียวกัน (TAT Goal) และคำนึงถึง ความต้องการของลูกค้าเป็นหลัก (Next Customer)",
tools: ["O"],
degree: "2"
},
{
name: "สนับสนุนทีมงานให้ดำเนินการตามเป้าหมายของทีม และสิ่งที่ตนเองได้รับมอบหมาย",
tools: ["O", "D"],
degree: "4"
},
{
name: "วิเคราะห์และแก้ไขปัญหาที่เกิดจากการทำงานเป็นทีม รวมถึงการควบคุมดูแลให้เป็นไปตามเป้าหมาย",
tools: ["O"],
degree: "5"
},
{
name: "สื่อสารเพื่อสร้างความเข้าใจ และรับฟังความคิดเห็น ของสมาชิกในทีม ชื่นชมทีมงานแต่ละคนที่เป็น ส่วนหนึ่งในความสำเร็จของทีมร่วมกัน",
tools: ["O", "D"],
degree: "5"
}],
}
]
dataList2: Data2Model[] = [{
score: ["หากได้คะแนน 90 - 100% ถือว่า Gap +1", "หากได้คะแนน 80 - 89% ถือว่า ไม่มี Gap", "หากได้คะแนน 60 - 79% ถือว่า Gap - 1", "หากได้คะแนน 40 - 59% ถือว่า Gap -", "หากได้คะแนน 0 - 39% ถือว่า Gap - 3"],
condition: ["1.หากได้คะแนนสูงกว่า 80% แต่มี 3 2 หรือ 1 ด้วย ถือว่า Gap -1", "2.หากได้คะแนนต่ำกว่า 80% แต่มี 4 และ 5 ให้คิด Gap ตาม %", "3.คะแนนต่ำกว่า 80% แต่มี 2 และ 1 ให้คิด Gap ตาม %"],
e: "4",
a: "3",
gap: "-1"
}]
@ViewChild('selfEvaluation1_2', { static: true }) selfEvaluation1_2!: TemplateRef<any>;
@ViewChild('selfEvaluation1_2Edit', { static: true }) selfEvaluation1_2Edit!: TemplateRef<any>;
currentTemplate: TemplateRef<any> = this.selfEvaluation1_2
ngOnInit(): void {
this.currentTemplate = this.selfEvaluation1_2
}
dataListFilter() {
return this.dataList
}
dataList2Filter() {
return this.dataList2
}
showTools(data: string[]) {
return data.join("/")
}
saveDraft() {
Swal.fire({
iconHtml: `
<div class="flex items-center justify-center rounded-full !h-80px !w-80px" style="background-color: #E8F8EE;">
<svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="39" height="39" fill="#D2D2D2"/>
<g id="Component">
<g id="alert cart">
<g id="mdi:file-export">
<circle cx="22.5" cy="19.5" r="33.5" fill="#E8F8EE"/>
<path d="M9.75 3.25C8.88805 3.25 8.0614 3.59241 7.4519 4.2019C6.84241 4.8114 6.5 5.63805 6.5 6.5V32.5C6.5 33.362 6.84241 34.1886 7.4519 34.7981C8.0614 35.4076 8.88805 35.75 9.75 35.75H29.25C30.112 35.75 30.9386 35.4076 31.5481 34.7981C32.1576 34.1886 32.5 33.362 32.5 32.5V13L22.75 3.25M21.125 5.6875L30.0625 14.625H21.125M14.5113 19.8575H26V31.3463L22.555 27.9013L17.9563 32.5L13.3575 27.9013L17.9563 23.3188"
fill="#1DBE5A"/>
</g>
</g>
</g>
</svg>
</div>
`,
title: 'บันทึกแบบร่าง',
text: 'คุณต้องการบันทึกแบบร่างของการประเมินนี้ใช่หรือไม่',
showCancelButton: true,
confirmButtonText: 'ยืนยันการบันทึก',
cancelButtonText: 'ย้อนกลับ',
customClass: {
title: '!swal2-title-mt-20px',
actions: '!swal2-actions-mt-20px',
icon: '!swal2-icon-no-border',
confirmButton: '!swal2-button-bg-green',
cancelButton: '!swal2-button-bg-gray',
},
}).then((result) => {
if (result.isConfirmed) {
Swal.fire({
title: 'บันทึกสำเร็จ!',
text: 'การประเมินของคุณถูกบันทึกแล้ว',
icon: 'success',
customClass: {
confirmButton: '!swal2-button-bg-green',
}
});
} else if (result.dismiss === Swal.DismissReason.cancel) {
Swal.fire({
title: 'ยกเลิก!',
text: 'การบันทึกถูกยกเลิก',
icon: 'error',
customClass: {
confirmButton: '!swal2-button-bg-danger',
}
});
}
});
}
returnPage() {
this.sendPageEvalution.emit("")
}
}
import { ChangeDetectorRef, Component, EventEmitter, OnInit, Output, TemplateRef, ViewChild } from '@angular/core';
import { AppraisalCompentencyModel2 } from 'src/app/shared/model/appraisal-competency.model';
import { AppraisalService } from 'src/app/shared/services/appraisal.service';
import { EmployeeService } from 'src/app/shared/services/employee.service';
import { SettingAssessmentService } from 'src/app/shared/services/setting-assessment.service';
import Swal from 'sweetalert2';
@Component({
selector: 'app-evaluation',
templateUrl: './evaluation.component.html',
styleUrls: ['./evaluation.component.scss']
})
export class EvaluationComponent implements OnInit {
appraisalCompentency2: { loading: boolean, data?: AppraisalCompentencyModel2 } = { loading: false, data: undefined }
evaluationRoundId = ""
employeeId = ""
typeId = ""
constructor(private appraisalService: AppraisalService,
private employeeService: EmployeeService,
private cdr: ChangeDetectorRef,
private settingAssessmentService: SettingAssessmentService
) {
}
ngOnInit(): void {
// this.getEvaluatee()
// this.getAppraisalCompentencyList()
// this.getSettingList()
}
getAppraisalCompentencyForm(typeId: string) {
// this.appraisalCompentency2.loading = true
// const evaluationRoundId = this.appraisalCompentency.select?.masfromEvaluationRound.evaluationRoundId || "test1"
// if (evaluationRoundId || this.byBoss) {
// this.appraisalService.getFormCompentencyById(this.evaluationRoundId, employeeId, typeId).subscribe({
// next: response => {
// this.appraisalCompentency2.data = JSON.parse(JSON.stringify(response))
// if (this.appraisalCompentency2.data?.masfromEvaluationAssessment1lList[0]) {
// switch (this.appraisalCompentency2.data?.currentStep) {
// case ("0"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsassessyDate = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsassessy.employeeId
// break
// }
// case ("1"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsapprove1Date = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsapprove1.employeeId
// break
// }
// case ("2"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsapprove2Date = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsapprove2.employeeId
// break
// }
// case ("3"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsapprove3Date = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsapprove3.employeeId
// break
// }
// case ("4"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsapprove4Date = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsapprove4.employeeId
// break
// }
// case ("5"): {
// this.appraisalCompentency2.data.masfromEvaluationAssessment1lList[0].apsapprove5Date = this.currentDate.toISOString().split('T')[0];
// this.employee.evaluate = this.employee.data.employeeId == this.appraisalCompentency2.data.apsapprove5.employeeId
// break
// }
// default: { return }
// }
// }
// this.calnumberCheck()
// this.appraisalCompentency2.loading = false
// this.cdr.detectChanges()
// }, error: error => {
// this.appraisalCompentency2.loading = false
// this.cdr.detectChanges()
// }
// })
// }
}
}
...@@ -9,18 +9,8 @@ ...@@ -9,18 +9,8 @@
<div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem" *ngIf="!byBoss"> <div class="font-size-18px font-weight-700 pt-1.5rem text-primary px-2rem" *ngIf="!byBoss">
ประเมินผลประจำปี {{currentDate.getFullYear()}} ประเมินผลประจำปี {{currentDate.getFullYear()}}
</div> </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="pt-0.75rem">
<div class="border-b border-gray-200 dark:border-white/10 px-2rem"> <div class=" px-2rem" [ngClass]="{'border-gray-200 border-b': appraisalCompentency.dataList.length}">
<nav class=" flex space-x-2 rtl:space-x-reverse"> <nav class=" flex space-x-2 rtl:space-x-reverse">
<a *ngFor="let item of appraisalCompentency.dataList; let i=index ; let f= first" <a *ngFor="let item of appraisalCompentency.dataList; let i=index ; let f= first"
class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900" class="border justify-center rounded-top-4px hs-tab-active:!bg-primary hs-tab-active:text-white -mb-px py-2 px-3 inline-flex items-center gap-2 font-size-16px font-weight-500 text-center hover:text-gray-900"
...@@ -31,7 +21,7 @@ ...@@ -31,7 +21,7 @@
</a> </a>
</nav> </nav>
</div> </div>
<div class="pt-50px"> <div class="pt-50px" *ngIf="appraisalCompentency.dataList.length">
<div *ngFor="let item of appraisalCompentency.dataList; let i=index" [id]="'underline-'+(i+1)" <div *ngFor="let item of appraisalCompentency.dataList; let i=index" [id]="'underline-'+(i+1)"
role="tabpanel"> role="tabpanel">
<div class="pb-2"> <div class="pb-2">
...@@ -127,9 +117,8 @@ ...@@ -127,9 +117,8 @@
{{masfromEvaluationAssessment1.masfromStatusType.tdesc}} {{masfromEvaluationAssessment1.masfromStatusType.tdesc}}
</td> </td>
<td class="flex justify-center items-center"> <td class="flex justify-center items-center">
<span class="rounded-md bg-success text-white px-3 py-1 cursor-pointer" <span class="rounded-md bg-success text-white px-3 py-1 cursor-pointer" (click)="getAppraisalCompentencyForm(masfromEvaluationAssessment1.competencyType.competencyTypeId);currentTemplate = selfEvaluationEdit ;
(click)="getAppraisalCompentencyForm(masfromEvaluationAssessment1.competencyType.competencyTypeId);currentTemplate = selfEvaluationEdit ; pathTitle = ['การประเมินผล', 'ประเมินตนเอง','ประเมินผล']">
pathTitle = byBoss?['การประเมินผล','ประเมินโดยหัวหน้า','ประเมินลูกน้อง', 'ประเมินผล']:['การประเมินผล', 'ประเมินตนเอง','ประเมินผล']">
ประเมิน ประเมิน
</span> </span>
</td> </td>
...@@ -217,7 +206,7 @@ ...@@ -217,7 +206,7 @@
<div class="flex"> <div class="flex">
<button type="button" <button type="button"
class="ti-btn ti-btn-outline ti-btn-outline-light h-20px m-0 shadow-md text-blue-500" class="ti-btn ti-btn-outline ti-btn-outline-light h-20px m-0 shadow-md text-blue-500"
(click)="currentTemplate = selfEvaluation ; pathTitle = byBoss?['การประเมินผล','ประเมินโดยหัวหน้า','ประเมินลูกน้อง']:['การประเมินผล', 'ประเมินตนเอง']"> (click)="returnPath()">
<i class="ti ti-chevron-left"></i> <i class="ti ti-chevron-left"></i>
ย้อนกลับ ย้อนกลับ
</button> </button>
......
...@@ -35,7 +35,6 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -35,7 +35,6 @@ export class SelfEvaluationComponent implements OnInit {
@ViewChild('selfEvaluation', { static: true }) selfEvaluation!: TemplateRef<any>; @ViewChild('selfEvaluation', { static: true }) selfEvaluation!: TemplateRef<any>;
@ViewChild('selfEvaluationEdit', { static: true }) selfEvaluationEdit!: TemplateRef<any>; @ViewChild('selfEvaluationEdit', { static: true }) selfEvaluationEdit!: TemplateRef<any>;
currentTemplate: TemplateRef<any> = this.selfEvaluation currentTemplate: TemplateRef<any> = this.selfEvaluation
appraisalCompentency: { loading: boolean, select?: AppraisalCompentencyModel, dataList: AppraisalCompentencyModel[] } = { loading: false, select: undefined, dataList: [] } appraisalCompentency: { loading: boolean, select?: AppraisalCompentencyModel, dataList: AppraisalCompentencyModel[] } = { loading: false, select: undefined, dataList: [] }
appraisalCompentency2: { loading: boolean, data?: AppraisalCompentencyModel2 } = { loading: false, data: undefined } appraisalCompentency2: { loading: boolean, data?: AppraisalCompentencyModel2 } = { loading: false, data: undefined }
appraisalPms: { loading: boolean, select: undefined, dataList: { check: boolean, data: undefined }[] } = { loading: false, select: undefined, dataList: [] } appraisalPms: { loading: boolean, select: undefined, dataList: { check: boolean, data: undefined }[] } = { loading: false, select: undefined, dataList: [] }
...@@ -55,9 +54,6 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -55,9 +54,6 @@ export class SelfEvaluationComponent implements OnInit {
this.getEvaluatee() this.getEvaluatee()
this.getAppraisalCompentencyList() this.getAppraisalCompentencyList()
this.getSettingList() this.getSettingList()
if (this.pathTitle.find(x => ['การประเมินผล', 'ประเมินโดยหัวหน้า'].includes(x))) {
this.returnPageTitle()
}
} }
returnPageTitle() { returnPageTitle() {
...@@ -86,6 +82,11 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -86,6 +82,11 @@ export class SelfEvaluationComponent implements OnInit {
this.employeeService.getWorkingById(this.employeeId).subscribe({ this.employeeService.getWorkingById(this.employeeId).subscribe({
next: response => { next: response => {
this.evaluatee.data = new MyEmployeeModel(response) this.evaluatee.data = new MyEmployeeModel(response)
if (this.byBoss) {
this.currentTemplate = this.selfEvaluationEdit
this.returnPageTitle()
this.getAppraisalCompentencyForm("02")
}
this.evaluatee.loading = false this.evaluatee.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
}, error: error => { }, error: error => {
...@@ -131,8 +132,9 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -131,8 +132,9 @@ export class SelfEvaluationComponent implements OnInit {
} }
getAppraisalCompentencyForm(typeId: string) { getAppraisalCompentencyForm(typeId: string) {
this.appraisalCompentency2.loading = true this.appraisalCompentency2.loading = true
if (this.appraisalCompentency.select) { const evaluationRoundId = this.appraisalCompentency.select?.masfromEvaluationRound.evaluationRoundId || "test1"
this.appraisalService.getFormCompentencyById(this.appraisalCompentency.select.masfromEvaluationRound.evaluationRoundId, this.evaluatee.data.employeeId, typeId).subscribe({ if (evaluationRoundId || this.byBoss) {
this.appraisalService.getFormCompentencyById(evaluationRoundId, this.evaluatee.data.employeeId, typeId).subscribe({
next: response => { next: response => {
this.appraisalCompentency2.data = JSON.parse(JSON.stringify(response)) this.appraisalCompentency2.data = JSON.parse(JSON.stringify(response))
if (this.appraisalCompentency2.data?.masfromEvaluationAssessment1lList[0]) { if (this.appraisalCompentency2.data?.masfromEvaluationAssessment1lList[0]) {
...@@ -169,7 +171,6 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -169,7 +171,6 @@ export class SelfEvaluationComponent implements OnInit {
} }
default: { return } default: { return }
} }
console.log(" 🐒 this.employee.evaluate:", this.employee.evaluate)
} }
this.calnumberCheck() this.calnumberCheck()
this.appraisalCompentency2.loading = false this.appraisalCompentency2.loading = false
...@@ -577,4 +578,13 @@ export class SelfEvaluationComponent implements OnInit { ...@@ -577,4 +578,13 @@ export class SelfEvaluationComponent implements OnInit {
return "1"; return "1";
} }
} }
returnPath() {
if (this.byBoss) {
this.returnPageEvalution()
} else {
this.currentTemplate = this.selfEvaluation;
this.pathTitle = ['การประเมินผล', 'ประเมินตนเอง']
}
}
} }
\ No newline at end of file
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
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({
selector: 'app-round-one',
templateUrl: './round-one.component.html',
styleUrls: ['./round-one.component.scss']
})
export class RoundOneComponent {
}
...@@ -11,8 +11,10 @@ export class SupervisorEvaluationComponent { ...@@ -11,8 +11,10 @@ export class SupervisorEvaluationComponent {
pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า'] pathTitle = ['การประเมินผล', 'ประเมินโดยหัวหน้า']
pageEvalution = '' pageEvalution = ''
currentDate = new Date() currentDate = new Date()
subordinate: { loading: false, select: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[] } = { loading: false, select: new MyAppraisalSubordinateModel(), dataList: [] } subordinate: { loading: false, select: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[], dataListRound: AppraisalSubordinateModel[][] } = { loading: false, select: new MyAppraisalSubordinateModel(), dataListRound: [], dataList: [] }
search = "" search = ""
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
constructor(private appraisalService: AppraisalService, constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) { private cdr: ChangeDetectorRef) {
} }
...@@ -22,7 +24,9 @@ export class SupervisorEvaluationComponent { ...@@ -22,7 +24,9 @@ export class SupervisorEvaluationComponent {
getBossList() { getBossList() {
this.appraisalService.getBossList().subscribe({ this.appraisalService.getBossList().subscribe({
next: response => { next: response => {
this.subordinate.dataList = response.map(x => new MyAppraisalSubordinateModel(x)) this.subordinate.dataListRound = [response.map(x => new MyAppraisalSubordinateModel(x))]
this.subordinate.dataList = this.subordinate.dataListRound.map(x => x.map(y => new MyAppraisalSubordinateModel(y)))?.[0] || []
this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
}, error: error => { }, error: error => {
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -34,8 +38,17 @@ export class SupervisorEvaluationComponent { ...@@ -34,8 +38,17 @@ export class SupervisorEvaluationComponent {
return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase()) return x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.thFullName.toLowerCase().includes(this.search.toLowerCase())
}) })
} }
searchChange() {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.subordinateFilter().length / 10) }, (_, i) => i + 1);
}
selectSubordinate(data: AppraisalSubordinateModel) { selectSubordinate(data: AppraisalSubordinateModel) {
this.subordinate.select = new MyAppraisalSubordinateModel(data) this.subordinate.select = new MyAppraisalSubordinateModel(data)
this.cdr.detectChanges() this.cdr.detectChanges()
} }
selectDataListRound(data: AppraisalSubordinateModel[]) {
this.subordinate.dataList = data.map(x => new MyAppraisalSubordinateModel(x))
this.searchChange()
this.cdr.detectChanges()
}
} }
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</table> </table>
</div> </div>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
......
...@@ -431,7 +431,7 @@ ...@@ -431,7 +431,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length"> <nav class="pagination-style-3 my-5" *ngIf="modal.page.length">
<ul class="ti-pagination"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);" <a aria-label="anchor" class="page-link" href="javascript:void(0);"
......
...@@ -159,7 +159,7 @@ export class AssessmentTopicsComponent { ...@@ -159,7 +159,7 @@ export class AssessmentTopicsComponent {
const formData = new FormData(); const formData = new FormData();
formData.append('file', this.selectedFile); formData.append('file', this.selectedFile);
this.pmstopic.loading = true this.pmstopic.loading = true
this.fileService.uploadExcel(formData, '').subscribe({ this.fileService.uploadExcel(formData, 'PMS_TOPIC').subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
...@@ -178,7 +178,7 @@ export class AssessmentTopicsComponent { ...@@ -178,7 +178,7 @@ export class AssessmentTopicsComponent {
} }
downloadFile() { downloadFile() {
const fileName = '.xlsx' const fileName = 'IMPORT_PMS_TOPIC.xlsx'
this.fileService.downloadTemplate(fileName).subscribe({ this.fileService.downloadTemplate(fileName).subscribe({
next: response => { next: response => {
const url = window.URL.createObjectURL(response); const url = window.URL.createObjectURL(response);
......
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