Commit 085f5b9c by Nattana Chaiyamat

การประเมินสมรรถนะ

ทะเบียนกำหนดชื่อ
ประเภทสมรรถนะ
parent 7fd7a2f9
......@@ -218,6 +218,11 @@
<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, '')" [(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">
<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"
......
......@@ -10,6 +10,7 @@ export interface DataModel {
name: string
code: string
level: string
weight: number
checked: boolean
}
@Component({
......@@ -29,7 +30,7 @@ export class TypeRegistration {
dataSelectList: DataModel[] = [];
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_type: CompetencytypeModel = new MyCompetencytypeModel({})
modalStatus: 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add'
......@@ -101,7 +102,7 @@ export class TypeRegistration {
this.dataLoading = true
this.competencytypeService.getList().subscribe({
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.isDataListCheckedAll = false
this.dataListCheckAll()
......@@ -153,7 +154,7 @@ export class TypeRegistration {
let body: CompetencytypeModel | CompetencytypeModel[] = [];
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 {
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 }));
}
......@@ -205,7 +206,7 @@ export class TypeRegistration {
if (modalStatus == 'add') {
this.setData()
} 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 })
}
}
}
......
......@@ -103,19 +103,10 @@
<td class="text-center">
<div class="flex">
<button type="button" class="ti-btn rounded-sm ti-btn-soft-success"
*ngFor="let type of item.typeList"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item);pageEvalution='evaluation'">
PC
</button>
<button type="button" class="ti-btn rounded-sm ti-btn-soft-secondary"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item);pageEvalution='evaluation'">
MC
</button>
<button type="button" class="ti-btn rounded-sm ti-btn-soft-danger"
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;"
(click)="selectSubordinate(item);pageEvalution='evaluation'">
CC
(click)="selectSubordinate(item,type.shortName,type.shortName);pageEvalution='evaluation'">
{{type.shortName}}
</button>
</div>
</td>
......@@ -127,8 +118,7 @@
</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'">
style="height: 15px; width: 45px; font-size: 12px; display: flex; align-items: center; justify-content: center;margin-left:4px;">
ประเมิน
</button>
</td>
......@@ -196,8 +186,7 @@
<ng-container *ngIf="pageEvalution=='pms'">
<app-pms-evalution (sendPageEvalution)="pageEvalution=$event"></app-pms-evalution>
</ng-container>
<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 *ngIf="pageEvalution=='evaluation'">
<app-evaluation [evaluationRoundId]="evaluationRoundId" [evaluaterId]="evaluaterId" [evaluateeId]="evaluateeId"
[competencyTypeId]="competencyTypeId"></app-evaluation>
</ng-container>
\ No newline at end of file
......@@ -14,11 +14,17 @@ export class SupervisorEvaluationComponent {
subordinate: { loading: false, select: AppraisalSubordinateModel, dataList: AppraisalSubordinateModel[], dataListRound: AppraisalSubordinateModel[][] } = { loading: false, select: new MyAppraisalSubordinateModel(), dataListRound: [], dataList: [] }
search = ""
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
page = Array.from({ length: 1 }, (_, i) => i + 1)
evaluateeId = ""
evaluaterId = ""
competencyTypeId = ""
evaluationRoundId = ""
constructor(private appraisalService: AppraisalService,
private cdr: ChangeDetectorRef) {
}
ngOnInit(): void {
this.evaluaterId = this.decodeJWT(sessionStorage.getItem("accessToken") || '').employeeid
this.getBossList()
}
getBossList() {
......@@ -42,8 +48,12 @@ export class SupervisorEvaluationComponent {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.subordinateFilter().length / 10) }, (_, i) => i + 1);
}
selectSubordinate(data: AppraisalSubordinateModel) {
selectSubordinate(data: AppraisalSubordinateModel, competencyTypeId: string, evaluationRoundId: string) {
this.subordinate.select = new MyAppraisalSubordinateModel(data)
this.evaluateeId = this.subordinate.select.apsassessy.employeeId
this.competencyTypeId = competencyTypeId
this.evaluationRoundId = evaluationRoundId
this.cdr.detectChanges()
}
selectDataListRound(data: AppraisalSubordinateModel[]) {
......@@ -51,4 +61,13 @@ export class SupervisorEvaluationComponent {
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);
}
}
......@@ -9,6 +9,10 @@ export interface AppraisalSubordinateModel {
apsassessy: EmployeeModel
gread: string
sumScore: number
typeList: {
competencyTypeId: string,
shortName: string
}[]
}
export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
companyId: string
......@@ -18,6 +22,10 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
apsassessy: EmployeeModel
gread: string
sumScore: number
typeList: {
competencyTypeId: string,
shortName: string
}[]
constructor(data?: Partial<AppraisalSubordinateModel>) {
this.companyId = data?.companyId || ""
this.active = data?.active ?? false
......@@ -26,6 +34,9 @@ export class MyAppraisalSubordinateModel implements AppraisalSubordinateModel {
this.apsassessy = new MyEmployeeModel(data?.apsassessy)
this.gread = data?.gread || ""
this.sumScore = data?.sumScore ?? 0
this.typeList = data?.typeList?.map(x => ({
competencyTypeId: x.competencyTypeId || "",
shortName: x.shortName || ""
})) || []
}
}
......@@ -5,6 +5,7 @@ export interface CompetencytypeModel {
tdesc: string
shortName: string
expectationLevel: string
weight: number
}
......@@ -15,6 +16,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel {
tdesc: string
shortName: string
expectationLevel: string
weight: number
constructor(data?: Partial<CompetencytypeModel>) {
this.competencyTypeId = data?.competencyTypeId || ""
this.companyId = data?.companyId || ""
......@@ -22,6 +24,7 @@ export class MyCompetencytypeModel implements CompetencytypeModel {
this.tdesc = data?.tdesc || ""
this.shortName = data?.shortName || ""
this.expectationLevel = data?.expectationLevel || ""
this.weight = data?.weight ?? 0
}
}
......@@ -24922,3 +24922,7 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
.masked-input {
-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