Commit 2eda4fa7 by Nattana Chaiyamat

แก้หน้าประเมิน เพิ่มjobfamily

parent 86f3cb2f
......@@ -21,14 +21,14 @@
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
(click)="currentModal='add';selectPosition();openDialog()">
(click)="currentModal='add';selectJobFamily();openDialog()">
<i class="ri-add-line"></i>
{{'Add' | translate}}
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
(click)="currentModal='delete';selectPosition();deletePosition()">
(click)="currentModal='delete';selectJobFamily();deleteJobFamily()">
<i class="ri-delete-bin-6-line"></i>
{{'Delete' | translate}}
</button>
......@@ -37,9 +37,9 @@
</div>
<div class="page px-rem">
<app-datagrid-syncfution [searchSettings]="searchSettings" [searchText]="search" [dataSource]="position.dataList"
<app-datagrid-syncfution [searchSettings]="searchSettings" [searchText]="search" [dataSource]="jobFamily.dataList"
[columns]="columns" [selectedItems]="selectedItems"
(sendSelectData)="currentModal='edit';selectPosition($event);openDialog()"
(sendSelectData)="currentModal='edit';selectJobFamily($event);openDialog()"
(sendSelectedItems)="onSelectItemChange($event)">
</app-datagrid-syncfution>
</div>
......@@ -50,7 +50,8 @@
<div class="w-full flex justify-end mb-1rem">
<div class="absolute flex">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="selectPosition()">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(click)="selectJobFamily(jobFamily.select)">
<i class="ti ti-eraser text-base"></i>
{{'Clear' |translate}}
</button>
......@@ -65,19 +66,20 @@
<ng-container *ngIf="currentModal=='add'&&checkPrimary()">
{{'DuplicateJobFamilyCode' | translate}}
</ng-container>
</span></label>
</span>
</label>
<input type="text" id="input-label" class="ti-form-input w-1/2 "
[ngClass]="{'bg-input-readonly':currentModal=='edit'}" [readonly]="currentModal=='edit'"
[(ngModel)]="position.select.positionId">
[ngClass]="{'!bg-input-readonly':currentModal=='edit'}" [readonly]="currentModal=='edit'"
[(ngModel)]="jobFamily.select.jobFamilyId">
<label for="detail_th" class="ti-form-label mt-2rem">{{'JobFamilyNameThai' | translate}}<span
class="text-danger">*</span></label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="position.select.tdesc">
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="jobFamily.select.tdesc">
<label for="detail_eng" class="ti-form-label mt-2rem">{{'JobFamilyNameEng' | translate}}<span
class="text-danger">*</span></label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="position.select.edesc">
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="jobFamily.select.edesc">
<label for="detail_short" class="ti-form-label mt-2rem">{{'JobFamilyAbbr' | translate}}<span
class="text-danger">*</span></label>
<input type="text" id="detail_short" class="ti-form-input h-16" [(ngModel)]="position.select.edesc">
<input type="text" id="detail_short" class="ti-form-input h-16" [(ngModel)]="jobFamily.select.shortName">
<div class="grid grid-cols-12 gap-x-6 mt-2rem">
<label class="col-span-3 ti-form-label text-primary mt-2 align-center">{{'Image' |
translate}}</label>
......@@ -87,16 +89,16 @@
aria-label="loading" style="height: 9rem;width: 9rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- [src]="employee.select.picture?getImg(employee.select.picture):'./assets/img/users/defaultperson.jpg'" -->
<img *ngIf="!imgLoading" [src]="'./assets/img/users/defaultperson.jpg'"
<img *ngIf="!imgLoading"
[src]="jobFamily.select.jobGroupPicture?getImg(jobFamily.select.jobGroupPicture):'./assets/img/users/defaultperson.jpg'"
(error)="onImageError($event)" class="rounded-full ring-4 ring-white/10 mx-auto object-cover"
id="profile-img" alt="profile-img" style="height: 10rem;width: 10rem;">
id="profile-img" alt="profile-img" style="height: 10rem;width: 10rem;object-fit: contain;">
</div>
<div *ngIf="!imgLoading" class="relative" style="margin-left:-30px">
<i class="ri ri-pencil-line cursor-pointer" (click)="fileImg.click()"></i>
<input #fileImg id="fileImg" type="file" (change)="onImgSelected($event)" hidden>
<i class="ri-delete-bin-6-line text-danger cursor-pointer"></i>
<!-- (click)="employee.select.picture = ''"> -->
<i class="ri-delete-bin-6-line text-danger cursor-pointer"
(click)="jobFamily.select.jobGroupPicture = ''"></i>
</div>
</div>
</div>
......@@ -106,9 +108,9 @@
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">
{{'Back' | translate}}
</button>
<button type="button" class="ti-btn ti-btn-success" mat-button (click)="addPosition()"
[class.ti-btn-disabled]="!position.select.positionId||!position.select.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!position.select.positionId||!position.select.tdesc||(currentModal=='add'&&checkPrimary())">
<button type="button" class="ti-btn ti-btn-success" mat-button (click)="addJobFamily()"
[class.ti-btn-disabled]="!jobFamily.select.jobFamilyId||!jobFamily.select.edesc||!jobFamily.select.shortName||!jobFamily.select.tdesc||(currentModal=='add'&&checkPrimary())"
[disabled]="!jobFamily.select.jobFamilyId||!jobFamily.select.edesc||!jobFamily.select.shortName||!jobFamily.select.tdesc||(currentModal=='add'&&checkPrimary())">
{{'SaveData' | translate}}
</button>
</mat-dialog-actions>
......
......@@ -81,8 +81,9 @@
</ng-template>
<ng-template #template let-data *ngIf="actionSetting">
<i class="ti ti-eye cursor-pointer i-gray fs-l px-1" (click)="onNextPageView(data)" *ngIf="childView"></i>
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" [attr.data-hs-overlay]="modalName" *ngIf="canEdit"
(click)="onSelectData(data)"></i>
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" *ngIf="canEdit&&modalName"
[attr.data-hs-overlay]="modalName" (click)="onSelectData(data)"></i>
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" *ngIf="canEdit&&!modalName" (click)="onSelectData(data)"></i>
<i class="ti ti-file-download cursor-pointer i-gray fs-l px-1" (click)="onFileDownload(data)"
*ngIf="canDownload && data.competencyFiles"></i>
<i class="ti ti-menu-2 cursor-pointer i-gray fs-l px-1" (click)="onNextPage(data)" *ngIf="canChild"></i>
......@@ -98,7 +99,6 @@
[ngClass]="{'bg-primary': true, 'text-white': true}">
{{'EndPeriod' | translate}}
</span>
<span class="badge text-white m-1" *ngIf="statusFrom.code == '2'"
[ngClass]="{'bg-gray-400': true, 'text-white': true}">
{{'EndPeriod' | translate}}
......
......@@ -55,15 +55,23 @@ export class PmsCompetencyComponent {
score: ["IfScore90to100", "IfScore80to89", "IfScore60to79", "IfScore40to59", "IfScore0to39"],
condition: ["Condition1", "Condition2", "Condition3"],
}]
// scoreDescriptions = [
// '',
// 'ทำได้ต่ำกว่าความคาดหวัง ในระดับถัดลงมา 1 ระดับ จำนวน 1-2 ข้อ',
// 'ทำได้ต่ำกว่าความคาดหวัง ในระดับถัดลงมา 1 ระดับ จำนวน 3-5 ข้อ',
// 'ได้ตามความคาดหวัง 1-2 ข้อ',
// 'ได้ตามความคาดหวัง 3-4 ข้อ',
// 'ได้ตามความคาดหวัง 5 ข้อ',
// 'ได้เกินความคาดหวัง ในระดับถัดขึ้นไป 1 ระดับ จำนวน 2-3 ข้อ',
// 'ได้เกินความคาดหวัง ในระดับถัดขึ้นไป 1 ระดับ จำนวน 4-5 ข้อ'
// ];
scoreDescriptions = [
'',
'ทำได้ต่ำกว่าความคาดหวัง ในระดับถัดลงมา 1 ระดับ จำนวน 1-2 ข้อ',
'ทำได้ต่ำกว่าความคาดหวัง ในระดับถัดลงมา 1 ระดับ จำนวน 3-5 ข้อ',
'ได้ตามความคาดหวัง 1-2 ข้อ',
'ได้ตามความคาดหวัง 3-4 ข้อ',
'ได้ตามความคาดหวัง 5 ข้อ',
'ได้เกินความคาดหวัง ในระดับถัดขึ้นไป 1 ระดับ จำนวน 2-3 ข้อ',
'ได้เกินความคาดหวัง ในระดับถัดขึ้นไป 1 ระดับ จำนวน 4-5 ข้อ'
'มีความชำนาญ เชี่ยวชาญ เป็นที่ยอมรับ ในองค์กร',
'สอนผู้อื่นได้ มีความคล่องตัว เชื่อมโยง ความรู้ในงานได้',
'นำความรู้มาประยุกต์ใช้ในงานได้ ปฏิบัติงานเองได้ด้วยตัวเองแก้ไขปัญหาหน้างานได้',
'มีความรู้ในงานบ้างแต่ยังไม่สามารถ ประยุกต์ใช้ในงานได้',
'ไม่มีความรู้พื้นฐานเลย ขาดทักษะในงาน',
];
evaluatee: { loading: boolean, data: EmployeeModel } = { loading: false, data: new MyEmployeeModel() }
biOpen: Map<string, boolean> = new Map<string, boolean>()
......@@ -225,12 +233,12 @@ export class PmsCompetencyComponent {
case (5): {
return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore5Boss)
}
case (6): {
return this.showNumber((this.setting.data.settingScore6) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore6Boss)
}
case (7): {
return this.showNumber((this.setting.data.settingScore7) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore7Boss)
}
// case (6): {
// return this.showNumber((this.setting.data.settingScore6) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore6Boss)
// }
// case (7): {
// return this.showNumber((this.setting.data.settingScore7) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore7Boss)
// }
default: { return }
}
}
......@@ -254,12 +262,12 @@ export class PmsCompetencyComponent {
case (5): {
return this.showNumber((this.setting.data.settingScore5) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore5)
}
case (6): {
return this.showNumber((this.setting.data.settingScore6) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore6)
}
case (7): {
return this.showNumber((this.setting.data.settingScore7) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore7)
}
// case (6): {
// return this.showNumber((this.setting.data.settingScore6) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore6)
// }
// case (7): {
// return this.showNumber((this.setting.data.settingScore7) * this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightScore7)
// }
default: { return }
}
}
......@@ -409,7 +417,8 @@ export class PmsCompetencyComponent {
this.inFormRemain(data)
).filter(data => data != 0).length
).filter(data => data != 0).length
const score = [1, 2, 3, 4, 5, 6, 7]
// const score = [1, 2, 3, 4, 5, 6, 7]
const score = [1, 2, 3, 4, 5]
this.compentencyScoreBoss.emit(score.map(x => this.calWeightScoreBoss(x)))
this.compentencyWeightTotalBoss.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].weightedTotalBoss))
this.compentencyWeightScoreBoss.emit(this.showNumber(this.appraisalCompentencyList[this.appraisalCompentencyIndex].masfromEvaluationAssessment1List[0].averageScoreBoss))
......
......@@ -147,7 +147,8 @@
</div>
</div>
</div>
<div class="w-full" *ngIf="currentTap=='CompetencyEva'&&(evaluaterId!=evaluateeId||complete)">
<div class="w-full" *ngIf="currentTap=='CompetencyEva'">
<!-- &&(evaluaterId!=evaluateeId||complete) -->
<div class="box shadow-md hover:shadow-xl transition m-0" style="border-radius:20px">
<div class="box-header" [class.border-none]="menuClose.get('WeightedScoreByTargetDegree')">
<div class="flex justify-between">
......@@ -218,7 +219,7 @@
<div class="w-full" *ngIf="currentTap=='CompetencyEva'&&false">
<div class="box shadow-md hover:shadow-xl transition m-0" style="border-radius:20px">
<div class="box-header"
[class.border-none]="menuClose.get('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ')">
[class.border-none]="menuClose.get('CompetencyEva')">
<div class="flex justify-between">
<ng-container *ngIf="evaluaterId==evaluateeId&&!complete">
<h5 class="box-title align-center">{{'WeightedScoreByTargetDegree' | translate}}</h5>
......@@ -226,18 +227,18 @@
<ng-container *ngIf="evaluaterId!=evaluateeId||complete">
<h5 class="box-title align-center">ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ</h5>
</ng-container>
<i *ngIf="menuClose.get('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ')" title="แสดง"
<i *ngIf="menuClose.get('CompetencyEva')" title="แสดง"
class="bg-white cursor-pointer border ti ti-chevron-down"
style="padding: 1px;border-radius:10px;font-size:27px;height:33px"
(click)="menuClose.set('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ',false)"></i>
<i *ngIf="!menuClose.get('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ')" title="ปิด"
(click)="menuClose.set('CompetencyEva',false)"></i>
<i *ngIf="!menuClose.get('CompetencyEva')" title="ปิด"
class="bg-white cursor-pointer border ti ti-chevron-up"
style="padding: 1px;border-radius:10px;font-size:27px;height:33px"
(click)="menuClose.set('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ',true)"></i>
(click)="menuClose.set('CompetencyEva',true)"></i>
</div>
</div>
<div class="box-body py-2"
[class.hidden]="menuClose.get('ค่าถ่วงน้ำหนักตนเองของความสามารถในแต่ละระดับ')">
[class.hidden]="menuClose.get('CompetencyEva')">
<div class="w-full flex flex-col gap-2" *ngIf="compentency.data">
<div class="w-full flex flex-col gap-2 mt-2">
<div class="w-full flex flex-row gap-2">
......@@ -313,7 +314,7 @@
<ng-container *ngIf="i<4 && i< kpiScorePartBoss.length-2">
<div class="flex flex-row">
<div class="flex-1" style="align-content:center">
{{item.text}}
{{item.text | translate}}
</div>
<div class="flex-1 border border-secondary text-center align-center"
style="border-radius:10px;--tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity));height: 30px;">
......@@ -472,7 +473,7 @@
<div class="sm:flex">
<h3 class="text-start my-auto text-gray-500 " style="line-height: 1.5">
<p style="font-size: 1rem;font-weight: 500;color:black">
{{assessmentStatusText(compentency.data.currentStep,i,returnField(compentency.data,apsEmp+'.status'))}}
{{assessmentStatusText(compentency.data.currentStep,i,returnField(compentency.data,apsEmp+'.status')) | translate}}
</p>
<p class="font-medium ">
<ng-container *ngIf="i==0">
......
export interface JobFamilyModel {
jobFamilyId: string
companyId: string
tdesc: string
edesc: string
shortName: string
jobGroupPicture: string
}
export class MyJobFamilyModel implements JobFamilyModel {
jobFamilyId: string
companyId: string
tdesc: string
edesc: string
shortName: string
jobGroupPicture: string
constructor(data?: Partial<JobFamilyModel>) {
this.jobFamilyId = data?.jobFamilyId || ""
this.tdesc = data?.tdesc || ""
this.edesc = data?.edesc || ""
this.jobGroupPicture = data?.jobGroupPicture || ""
this.shortName = data?.shortName || ""
this.companyId = data?.companyId || ""
}
}
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model';
import { JobFamilyModel } from '../model/job-family.model';
@Injectable({
providedIn: 'root'
})
export class JobFamilyService {
api = "/job-family"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getById(positionId:string): Observable<JobFamilyModel> {
return this.http.get<JobFamilyModel>(this.urlApi + "/" + positionId)
}
getList(): Observable<JobFamilyModel[]> {
return this.http.get<JobFamilyModel[]>(this.urlApi + "/lists")
}
post(body: JobFamilyModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: JobFamilyModel | JobFamilyModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi, options)
}
}
\ No newline at end of file
......@@ -416,5 +416,6 @@
"End Date DEV.": "กำหนดเสร็จ",
"Assessment Tools": "เครื่องมือพัฒนา",
"Supervisor Follow Gap": "ติดตาม Gap โดยหัวหน้า",
"Gap Status": "สถานะ Gap"
"Gap Status": "สถานะ Gap",
"TotalWeightedScore": "คะแนนรวมหลังถ่วงน้ำหนัก"
}
\ No newline at end of file
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