Commit 0d2f30d6 by Nakarin Luankla

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

parents c4389a2c bac096ae
...@@ -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);"
......
...@@ -218,6 +218,11 @@ ...@@ -218,6 +218,11 @@
<label for="detail_eng" class="ti-form-label mt-1rem">ระดับความคาดหวัง *</label> <label for="detail_eng" class="ti-form-label mt-1rem">ระดับความคาดหวัง *</label>
<input type="text" id="detail_eng" class="ti-form-input" style="width: 200px;" <input type="text" id="detail_eng" class="ti-form-input" style="width: 200px;"
oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="dataSelect.level"> oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="dataSelect.level">
<label for="detail_eng" class="ti-form-label mt-1rem">น้ำหนัก</label>
<input type="text" id="detail_eng" class="ti-form-input" style="width: 200px;"
oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
[(ngModel)]="dataSelect.weight">
<div class="flex justify-end mt-2rem mb-1rem"> <div class="flex justify-end mt-2rem mb-1rem">
<button type="button" <button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10" class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
......
...@@ -10,6 +10,7 @@ export interface DataModel { ...@@ -10,6 +10,7 @@ export interface DataModel {
name: string name: string
code: string code: string
level: string level: string
weight: number
checked: boolean checked: boolean
} }
@Component({ @Component({
...@@ -29,7 +30,7 @@ export class TypeRegistration { ...@@ -29,7 +30,7 @@ export class TypeRegistration {
dataSelectList: DataModel[] = []; dataSelectList: DataModel[] = [];
dataLoading = false dataLoading = false
dataSelect: DataModel = { id: "", companyId: "", edesc: "", name: "", code: "", level: "", checked: false } dataSelect: DataModel = { id: "", companyId: "", edesc: "", name: "", code: "", level: "", weight: 0.00, checked: false }
competoncy_typeList: { check: boolean; data: DataModel & { checked?: boolean } }[] = [] competoncy_typeList: { check: boolean; data: DataModel & { checked?: boolean } }[] = []
competoncy_type: CompetencytypeModel = new MyCompetencytypeModel({}) competoncy_type: CompetencytypeModel = new MyCompetencytypeModel({})
modalStatus: 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add' modalStatus: 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add'
...@@ -101,7 +102,7 @@ export class TypeRegistration { ...@@ -101,7 +102,7 @@ export class TypeRegistration {
this.dataLoading = true this.dataLoading = true
this.competencytypeService.getList().subscribe({ this.competencytypeService.getList().subscribe({
next: response => { next: response => {
this.competoncy_typeList = response.map(x => ({ check: false, data: { id: x.competencyTypeId, companyId: x.companyId, edesc: x.edesc, name: x.tdesc, code: x.shortName, level: x.expectationLevel, checked: false } })) this.competoncy_typeList = response.map(x => ({ check: false, data: { id: x.competencyTypeId, companyId: x.companyId, edesc: x.edesc, name: x.tdesc, code: x.shortName, weight: x.weight, level: x.expectationLevel, checked: false } }))
this.dataLoading = false this.dataLoading = false
this.isDataListCheckedAll = false this.isDataListCheckedAll = false
this.dataListCheckAll() this.dataListCheckAll()
...@@ -130,7 +131,7 @@ export class TypeRegistration { ...@@ -130,7 +131,7 @@ export class TypeRegistration {
} }
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล // ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addType_registration() { addType_registration() {
const body = new MyCompetencytypeModel({ competencyTypeId: this.dataSelect.id, tdesc: this.dataSelect.name, edesc: this.dataSelect.edesc, shortName: this.dataSelect.code, expectationLevel: this.dataSelect.level }) const body = new MyCompetencytypeModel({ competencyTypeId: this.dataSelect.id, tdesc: this.dataSelect.name, edesc: this.dataSelect.edesc, shortName: this.dataSelect.code, weight: +(this.dataSelect.weight), expectationLevel: this.dataSelect.level })
this.dataLoading = true this.dataLoading = true
this.competencytypeService.post(body).subscribe({ this.competencytypeService.post(body).subscribe({
next: response => { next: response => {
...@@ -153,9 +154,9 @@ export class TypeRegistration { ...@@ -153,9 +154,9 @@ export class TypeRegistration {
let body: CompetencytypeModel | CompetencytypeModel[] = []; let body: CompetencytypeModel | CompetencytypeModel[] = [];
if (this.dataSelect.id) { if (this.dataSelect.id) {
body = new MyCompetencytypeModel({ competencyTypeId: this.dataSelect.id, tdesc: this.dataSelect.name, edesc: this.dataSelect.edesc, shortName: this.dataSelect.code, expectationLevel: this.dataSelect.level }); body = new MyCompetencytypeModel({ competencyTypeId: this.dataSelect.id, tdesc: this.dataSelect.name, edesc: this.dataSelect.edesc, shortName: this.dataSelect.code, weight: +(this.dataSelect.weight), expectationLevel: this.dataSelect.level });
} else { } else {
body = this.competoncy_typeList.filter(x => x.check).map(x => new MyCompetencytypeModel({ competencyTypeId: x.data.id, tdesc: x.data.name, edesc: x.data.edesc, shortName: x.data.code, expectationLevel: x.data.level })); body = this.competoncy_typeList.filter(x => x.check).map(x => new MyCompetencytypeModel({ competencyTypeId: x.data.id, tdesc: x.data.name, edesc: x.data.edesc, shortName: x.data.code, weight: +(this.dataSelect.weight), expectationLevel: x.data.level }));
} }
this.dataLoading = true this.dataLoading = true
this.competencytypeService.delete(body).subscribe({ this.competencytypeService.delete(body).subscribe({
...@@ -205,7 +206,7 @@ export class TypeRegistration { ...@@ -205,7 +206,7 @@ export class TypeRegistration {
if (modalStatus == 'add') { if (modalStatus == 'add') {
this.setData() this.setData()
} else if (modalStatus == 'edit') { } else if (modalStatus == 'edit') {
this.setData({ id: this.dataSelect.id, companyId: "", name: "", edesc: "", code: "", level: "", checked: this.dataSelect.checked }) this.setData({ id: this.dataSelect.id, companyId: "", name: "", edesc: "", code: "", level: "", weight: 0.00, checked: this.dataSelect.checked })
} }
} }
} }
......
...@@ -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, 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,18 +11,28 @@ export class SupervisorEvaluationComponent { ...@@ -11,18 +11,28 @@ 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)
evaluateeId = ""
evaluaterId = ""
competencyTypeId = ""
evaluationRoundId = ""
constructor(private appraisalService: AppraisalService, constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) { private cdr: ChangeDetectorRef) {
} }
ngOnInit(): void { ngOnInit(): void {
this.evaluaterId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').employeeid
this.getBossList() this.getBossList()
} }
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 +44,30 @@ export class SupervisorEvaluationComponent { ...@@ -34,8 +44,30 @@ 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())
}) })
} }
selectSubordinate(data: AppraisalSubordinateModel) { searchChange() {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.subordinateFilter().length / 10) }, (_, i) => i + 1);
}
selectSubordinate(data: AppraisalSubordinateModel, competencyTypeId: string, evaluationRoundId: string) {
this.subordinate.select = new MyAppraisalSubordinateModel(data) this.subordinate.select = new MyAppraisalSubordinateModel(data)
this.evaluateeId = this.subordinate.select.apsassessy.employeeId
this.competencyTypeId = competencyTypeId
this.evaluationRoundId = evaluationRoundId
this.cdr.detectChanges() this.cdr.detectChanges()
} }
selectDataListRound(data: AppraisalSubordinateModel[]) {
this.subordinate.dataList = data.map(x => new MyAppraisalSubordinateModel(x))
this.searchChange()
this.cdr.detectChanges()
}
decodeJWT(token: string) {
let base64Url = token.split('.')[1]; // ดึงส่วนที่เป็น Payload
let base64 = base64Url.replace('-', '+').replace('_', '/'); // แก้ไข base64 ให้ถูกต้อง
let jsonPayload = decodeURIComponent(atob(base64).split('').map(function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
return JSON.parse(jsonPayload);
}
} }
...@@ -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);
......
...@@ -9,6 +9,10 @@ export interface AppraisalSubordinateModel { ...@@ -9,6 +9,10 @@ export interface AppraisalSubordinateModel {
apsassessy: EmployeeModel apsassessy: EmployeeModel
gread: string gread: string
sumScore: number sumScore: number
typeList: {
competencyTypeId: string,
shortName: string
}[]
} }
export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel { export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
companyId: string companyId: string
...@@ -18,6 +22,10 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel { ...@@ -18,6 +22,10 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
apsassessy: EmployeeModel apsassessy: EmployeeModel
gread: string gread: string
sumScore: number sumScore: number
typeList: {
competencyTypeId: string,
shortName: string
}[]
constructor(data?: Partial<AppraisalSubordinateModel>) { constructor(data?: Partial<AppraisalSubordinateModel>) {
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.active = data?.active ?? false this.active = data?.active ?? false
...@@ -26,6 +34,9 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel { ...@@ -26,6 +34,9 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
this.apsassessy = new MyEmployeeModel(data?.apsassessy) this.apsassessy = new MyEmployeeModel(data?.apsassessy)
this.gread = data?.gread || "" this.gread = data?.gread || ""
this.sumScore = data?.sumScore ?? 0 this.sumScore = data?.sumScore ?? 0
this.typeList = data?.typeList?.map(x => ({
competencyTypeId: x.competencyTypeId || "",
shortName: x.shortName || ""
})) || []
} }
} }
...@@ -5,6 +5,7 @@ export interface CompetencytypeModel { ...@@ -5,6 +5,7 @@ export interface CompetencytypeModel {
tdesc: string tdesc: string
shortName: string shortName: string
expectationLevel: string expectationLevel: string
weight: number
} }
...@@ -15,6 +16,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel { ...@@ -15,6 +16,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel {
tdesc: string tdesc: string
shortName: string shortName: string
expectationLevel: string expectationLevel: string
weight: number
constructor(data?: Partial<CompetencytypeModel>) { constructor(data?: Partial<CompetencytypeModel>) {
this.competencyTypeId = data?.competencyTypeId || "" this.competencyTypeId = data?.competencyTypeId || ""
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
...@@ -22,6 +24,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel { ...@@ -22,6 +24,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel {
this.tdesc = data?.tdesc || "" this.tdesc = data?.tdesc || ""
this.shortName = data?.shortName || "" this.shortName = data?.shortName || ""
this.expectationLevel = data?.expectationLevel || "" this.expectationLevel = data?.expectationLevel || ""
this.weight = data?.weight ?? 0
} }
} }
...@@ -24922,3 +24922,7 @@ div:where(.swal2-container) div:where(.swal2-validation-message) { ...@@ -24922,3 +24922,7 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
.masked-input { .masked-input {
-webkit-text-security: disc; /* Safari, Chrome */ -webkit-text-security: disc; /* Safari, Chrome */
} }
.cursor-not-allowed{
cursor: not-allowed
}
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