Commit d552254c by Nattana Chaiyamat

เพิ่มการเก็บระยะเวลาที่พัฒนา ในส่วน IDP

เพิ่มหน้า เมนู ปัจจัยการประเมินสมรรถนะ
parent ec6babb4
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover"> <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead class="height-50px"> <thead class="height-50px">
<tr class="font-size-12px"> <tr class="font-size-12px">
<ng-container *ngFor="let item of pmsEaluationFactorsTableHeader; let f = first; let l = last"> <ng-container *ngFor="let item of comEvaluationFactorsTableHeader; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l"> [class.!text-center]="f||l">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</ng-container> </ng-container>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="pmsEaluationFactors.loading"> <tbody *ngIf="comEvaluationFactors.loading">
<tr> <tr>
<td class="text-center" colspan="100%"> <td class="text-center" colspan="100%">
<div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1" role="status" <div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1" role="status"
...@@ -72,27 +72,27 @@ ...@@ -72,27 +72,27 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="!pmsEaluationFactors.loading&&!dataListFilter().length"> <tbody *ngIf="!comEvaluationFactors.loading&&!dataListFilter().length">
<tr> <tr>
<td class="text-center" colspan="100%"> <td class="text-center" colspan="100%">
ไม่พบข้อมูล ไม่พบข้อมูล
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="!pmsEaluationFactors.loading&&dataListFilter().length"> <tbody *ngIf="!comEvaluationFactors.loading&&dataListFilter().length">
<tr <tr
*ngFor="let pmsEaluationFactors of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"> *ngFor="let comEvaluationFactors of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="text-center"> <td class="text-center">
<span> <span>
{{pmsEaluationFactors.personalLevel.plId }} {{comEvaluationFactors.jl.plId }}
</span> </span>
</td> </td>
<td *ngFor="let item of pmsEaluationFactors.pmsEvaluationFactors1ModelList"> <td *ngFor="let item of comEvaluationFactors.comEvaluationFactorsList">
<input type="text" class="ti-form-input" oninput="this.value = this.value.replace(/\D/g, '')" <input type="text" class="ti-form-input" oninput="this.value = this.value.replace(/\D/g, '')"
[(ngModel)]="item.pmsScore"> [(ngModel)]="item.comScore">
</td> </td>
<td class="text-center"> <td class="text-center">
{{calPmsEaluationFactors1Total(pmsEaluationFactors.pmsEvaluationFactors1ModelList) }} </td> {{calPmsEaluationFactors1Total(comEvaluationFactors.comEvaluationFactorsList) }} </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
ย้อนกลับ ย้อนกลับ
</button> </button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);" <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#define-evaluation-factors-alert-modal" (click)="savePmsEaluationFactors()"> data-hs-overlay="#define-evaluation-factors-alert-modal" (click)="saveComEvaluationFactors()">
บันทึกข้อมูล บันทึกข้อมูล
</a> </a>
</div> </div>
......
import { ChangeDetectorRef, Component } from '@angular/core'; import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { MyPmsEvaluationFactorsModel, PmsEvaluationFactorsModel } from 'src/app/shared/model/pms-ealuation-factors.model'; import { ComEvaluationFactorsDetailModel, ComEvaluationFactorsModel, MyComEvaluationFactorsDetailModel, MyComEvaluationFactorsModel, MyCompetencyTypeModel } from 'src/app/shared/model/com-ealuation-factors.model';
import { MyPmsEaluationFactors1Model, PmsEaluationFactors1Model } from 'src/app/shared/model/pms-ealuation-factors1.model'; import { ComEvaluationFactorsService } from 'src/app/shared/services/com-evaluation-factors.service';
import { MyPmstypeModel } from 'src/app/shared/model/pmstype.model';
import { PmsEaluationFactorsService } from 'src/app/shared/services/pms-ealuation-factors.service';
@Component({ @Component({
selector: 'app-competency-define-evaluation-factors', selector: 'app-competency-define-evaluation-factors',
templateUrl: './competency-define-evaluation-factors.component.html', templateUrl: './competency-define-evaluation-factors.component.html',
...@@ -14,89 +11,89 @@ export class CompetencyDefineEvaluationFactorsComponent { ...@@ -14,89 +11,89 @@ export class CompetencyDefineEvaluationFactorsComponent {
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
search = "" search = ""
pmsEaluationFactors: { loading: boolean, dataList: PmsEvaluationFactorsModel[] } = { loading: false, dataList: [] } comEvaluationFactors: { loading: boolean, dataList: ComEvaluationFactorsModel[] } = { loading: false, dataList: [] }
pmsEaluationFactorsTableHeader: string[] = ['ลักษณะงาน'] comEvaluationFactorsTableHeader: string[] = ['ลักษณะงาน']
constructor(private pmsEaluationFactorsService: PmsEaluationFactorsService, constructor(private comEvaluationFactorsService: ComEvaluationFactorsService,
private toastr: ToastrService, private toastr: ToastrService,
private cdr: ChangeDetectorRef private cdr: ChangeDetectorRef
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.getPmsEaluationFactorsList() this.getComEvaluationFactorsList()
} }
getPmsEaluationFactorsList() { getComEvaluationFactorsList() {
this.pmsEaluationFactors.loading = true this.comEvaluationFactors.loading = true
this.pmsEaluationFactorsTableHeader = ['ลักษณะงาน'] this.comEvaluationFactorsTableHeader = ['ลักษณะงาน']
this.pmsEaluationFactorsService.getList().subscribe({ this.comEvaluationFactorsService.getList().subscribe({
next: response => { next: response => {
this.pmsEaluationFactors.dataList = response.map(x => new MyPmsEvaluationFactorsModel(x)) this.comEvaluationFactors.dataList = response.map(x => new MyComEvaluationFactorsModel(x))
this.pmsEaluationFactors.loading = false this.comEvaluationFactors.loading = false
const maxItem = this.pmsEaluationFactors.dataList.reduce((max, item) => const maxItem = this.comEvaluationFactors.dataList.reduce((max, item) =>
item.pmsEvaluationFactors1ModelList.length > max.pmsEvaluationFactors1ModelList.length ? item : max, item.comEvaluationFactorsList.length > max.comEvaluationFactorsList.length ? item : max,
this.pmsEaluationFactors.dataList[0] this.comEvaluationFactors.dataList[0]
); );
const pmsTypeIds = maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.pmsTypeId) || []; const comTypeIds = maxItem?.comEvaluationFactorsList.map(x => x.competencyType.competencyTypeId) || [];
this.pmsEaluationFactorsTableHeader = this.pmsEaluationFactorsTableHeader.concat(maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.tdesc) || []).concat(['รวม']) this.comEvaluationFactorsTableHeader = this.comEvaluationFactorsTableHeader.concat(maxItem?.comEvaluationFactorsList.map(x => x.competencyType.tdesc) || []).concat(['รวม'])
this.pmsEaluationFactors.dataList.forEach(x => { this.comEvaluationFactors.dataList.forEach(x => {
while (x.pmsEvaluationFactors1ModelList.length < 5) { while (x.comEvaluationFactorsList.length < 5) {
const usedTypes = x.pmsEvaluationFactors1ModelList.map(y => y.pmsType.pmsTypeId); const usedTypes = x.comEvaluationFactorsList.map(y => y.competencyType.competencyTypeId);
const remainingTypes = pmsTypeIds.filter(type => !usedTypes.includes(type)); const remainingTypes = comTypeIds.filter(type => !usedTypes.includes(type));
if (remainingTypes.length === 0) { break } if (remainingTypes.length === 0) { break }
const pmsTypeId = remainingTypes[0]; const competencyTypeId = remainingTypes[0];
x.pmsEvaluationFactors1ModelList.push( x.comEvaluationFactorsList.push(
new MyPmsEaluationFactors1Model({ pmsType: new MyPmstypeModel({ pmsTypeId }) }) new MyComEvaluationFactorsDetailModel({ competencyType: new MyCompetencyTypeModel({ competencyTypeId }) })
) )
} }
x.pmsEvaluationFactors1ModelList.sort((a, b) => +(a.pmsType.pmsTypeId) - +(b.pmsType.pmsTypeId)) x.comEvaluationFactorsList.sort((a, b) => +(a.competencyType.competencyTypeId) - +(b.competencyType.competencyTypeId))
}) })
this.searchChange() this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
}, error: error => { }, error: error => {
this.pmsEaluationFactors.loading = false this.comEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}) })
} }
savePmsEaluationFactors() { saveComEvaluationFactors() {
this.pmsEaluationFactors.loading = true this.comEvaluationFactors.loading = true
const body = this.pmsEaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({ const body = this.comEvaluationFactors.dataList.map(x => new MyComEvaluationFactorsModel({
...x, ...x,
pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEaluationFactors1Model({ comEvaluationFactorsList: x.comEvaluationFactorsList.map(y => new MyComEvaluationFactorsDetailModel({
...y, ...y,
pmsScore: +(y.pmsScore) comScore: +(y.comScore)
})) }))
})) }))
this.pmsEaluationFactorsService.post(body).subscribe({ this.comEvaluationFactorsService.post(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
this.getPmsEaluationFactorsList() this.getComEvaluationFactorsList()
} else { } else {
this.showAlert(response.message, 'error') this.showAlert(response.message, 'error')
this.pmsEaluationFactors.loading = false this.comEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}, error: error => { }, error: error => {
this.showAlert(error.message, 'error') this.showAlert(error.message, 'error')
this.pmsEaluationFactors.loading = false this.comEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}) })
} }
clear() { clear() {
this.pmsEaluationFactors.dataList = this.pmsEaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({ this.comEvaluationFactors.dataList = this.comEvaluationFactors.dataList.map(x => new MyComEvaluationFactorsModel({
...x, ...x,
pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEaluationFactors1Model({ comEvaluationFactorsList: x.comEvaluationFactorsList.map(y => new MyComEvaluationFactorsDetailModel({
...y, ...y,
pmsScore: 0 comScore: 0
})) }))
})) }))
} }
calPmsEaluationFactors1Total(data: PmsEaluationFactors1Model[]) { calPmsEaluationFactors1Total(data: ComEvaluationFactorsDetailModel[]) {
return data.reduce((sum, num) => sum + +(num.pmsScore), 0); return data.reduce((sum, num) => sum + +(num.comScore), 0);
} }
dataListFilter() { dataListFilter() {
return this.pmsEaluationFactors.dataList.filter(x => x.personalLevel.plId.toLowerCase().includes(this.search.toLowerCase())) return this.comEvaluationFactors.dataList.filter(x => x.jl.plId.toLowerCase().includes(this.search.toLowerCase()))
} }
searchChange() { searchChange() {
......
...@@ -21,6 +21,7 @@ export class EditDefineDocumentFormComponent { ...@@ -21,6 +21,7 @@ export class EditDefineDocumentFormComponent {
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>(); @Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>(); @Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>();
@Input() evaluationRoundId = '' @Input() evaluationRoundId = ''
@Input() apsyear = ''
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
...@@ -60,7 +61,7 @@ export class EditDefineDocumentFormComponent { ...@@ -60,7 +61,7 @@ export class EditDefineDocumentFormComponent {
pageIndicator = Array.from({ length: 1 }, (_, i) => i + 1); pageIndicator = Array.from({ length: 1 }, (_, i) => i + 1);
pageSizeIndicator = 10 pageSizeIndicator = 10
competencyTopicIds: string[] = [] competencyTopicIds: string[] = []
dialogRef:any dialogRef: any
constructor(private toastr: ToastrService, constructor(private toastr: ToastrService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private evaluationAssessmentService: EvaluationAssessmentService, private evaluationAssessmentService: EvaluationAssessmentService,
...@@ -79,7 +80,7 @@ export class EditDefineDocumentFormComponent { ...@@ -79,7 +80,7 @@ export class EditDefineDocumentFormComponent {
document.getElementById('form-assessment')?.classList.add("hidden") document.getElementById('form-assessment')?.classList.add("hidden")
document.getElementById('modal-alert')?.classList.add("hidden") document.getElementById('modal-alert')?.classList.add("hidden")
}, 10); }, 10);
if (this.evaluationRoundId) { if (this.evaluationRoundId && this.apsyear) {
this.getAssessmentId(); this.getAssessmentId();
this.getAssessmentList(); this.getAssessmentList();
} }
...@@ -99,7 +100,7 @@ export class EditDefineDocumentFormComponent { ...@@ -99,7 +100,7 @@ export class EditDefineDocumentFormComponent {
} }
getAssessmentList() { getAssessmentList() {
this.loadingAssessmentList = true this.loadingAssessmentList = true
this.evaluationAssessmentService.getById(this.evaluationRoundId!).subscribe({ this.evaluationAssessmentService.getById(this.evaluationRoundId!, this.apsyear).subscribe({
next: response => { next: response => {
this.assessmentList = response this.assessmentList = response
this.searchChange() this.searchChange()
...@@ -112,19 +113,19 @@ export class EditDefineDocumentFormComponent { ...@@ -112,19 +113,19 @@ export class EditDefineDocumentFormComponent {
}); });
} }
assessmentListFilter() { assessmentListFilter() {
if (!Array.isArray(this.assessmentList)) { if (!Array.isArray(this.assessmentList)) {
return []; // หรือ return null แล้วจัดการใน HTML return []; // หรือ return null แล้วจัดการใน HTML
} }
return this.assessmentList.filter(x => return this.assessmentList.filter(x =>
x.apsassessy.fname.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.fname.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.lname.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.lname.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.efname.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.efname.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.elname.toLowerCase().includes(this.search.toLowerCase()) || x.apsassessy.elname.toLowerCase().includes(this.search.toLowerCase()) ||
x.masfromEvaluationRound.evaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) || x.masfromEvaluationRound.evaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase())
); );
} }
searchChange() { searchChange() {
this.currentPage = 1; this.currentPage = 1;
...@@ -192,7 +193,7 @@ export class EditDefineDocumentFormComponent { ...@@ -192,7 +193,7 @@ export class EditDefineDocumentFormComponent {
console.error('Error fetching evaluation cycles:', err); console.error('Error fetching evaluation cycles:', err);
} }
}) })
} }
}); });
...@@ -202,7 +203,7 @@ export class EditDefineDocumentFormComponent { ...@@ -202,7 +203,7 @@ export class EditDefineDocumentFormComponent {
} }
getApsassessy() { getApsassessy() {
this.loading = true this.loading = true
this.evaluationAssessmentService.getApsassessy(this.evaluationRoundId, this.apsassessy).subscribe({ this.evaluationAssessmentService.getApsassessy(this.evaluationRoundId, this.apsassessy, this.apsyear).subscribe({
next: response => { next: response => {
this.empassessmentList = response this.empassessmentList = response
this.loading = false this.loading = false
...@@ -215,7 +216,7 @@ export class EditDefineDocumentFormComponent { ...@@ -215,7 +216,7 @@ export class EditDefineDocumentFormComponent {
}) })
} }
getApsassessyMini() { getApsassessyMini() {
this.evaluationAssessmentService.getApsassessyMini(this.evaluationRoundId, this.apsassessy).subscribe({ this.evaluationAssessmentService.getApsassessyMini(this.evaluationRoundId, this.apsassessy, this.apsyear).subscribe({
next: response => { next: response => {
this.empassessmentRoundList = response this.empassessmentRoundList = response
this.empassessmentRoundListCheckbox = this.empassessmentRoundList.map(item => ({ checkbox: false, item })) this.empassessmentRoundListCheckbox = this.empassessmentRoundList.map(item => ({ checkbox: false, item }))
...@@ -349,9 +350,9 @@ export class EditDefineDocumentFormComponent { ...@@ -349,9 +350,9 @@ export class EditDefineDocumentFormComponent {
confirmButtonText: 'ตกลง', confirmButtonText: 'ตกลง',
}); });
} }
showAlertToastr(text: string, type: 'success' | 'error') { showAlertToastr(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', { this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000, timeOut: 3000,
positionClass: 'toast-top-right', positionClass: 'toast-top-right',
......
...@@ -103,8 +103,7 @@ ...@@ -103,8 +103,7 @@
[ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}" [readonly]="modalStatus == 'edit'"> [ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}" [readonly]="modalStatus == 'edit'">
<label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label> <label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label>
<div *ngFor="let item of evaluation_cycle.jd;let i = index;let f=first;let l = last" <div *ngFor="let item of evaluation_cycle.jd;let i = index;let f=first;let l = last" class="grid grid-cols-2">
class="grid grid-cols-2">
<div class="col-span-1"> <div class="col-span-1">
<div class="flex relative"> <div class="flex relative">
<input type="text" class="ti-form-input pointer-events-none" readonly <input type="text" class="ti-form-input pointer-events-none" readonly
...@@ -118,8 +117,8 @@ ...@@ -118,8 +117,8 @@
[ngClass]="{'input-list-f2': f&&!l, 'input-list-c2': !f&&!l, 'input-list-l2': !f&&l, 'input-list-fl2': f&&l,'!bg-input-readonly':modalStatus == 'edit'}" [ngClass]="{'input-list-f2': f&&!l, 'input-list-c2': !f&&!l, 'input-list-l2': !f&&l, 'input-list-fl2': f&&l,'!bg-input-readonly':modalStatus == 'edit'}"
[(ngModel)]="item.tdesc"> [(ngModel)]="item.tdesc">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"> <div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
<button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500" <button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button"
(click)="pl.selectIndex=i;selectPl()"> class="flex items-center text-red-500" (click)="pl.selectIndex=i;selectPl()">
<i class="ti ti-circle-x cursor-pointer"></i> <i class="ti ti-circle-x cursor-pointer"></i>
</button> </button>
</div> </div>
...@@ -146,7 +145,8 @@ ...@@ -146,7 +145,8 @@
<ng-template #plSearchButton> <ng-template #plSearchButton>
<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 !m-0 h-full" 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 !m-0 h-full"
style="height: 44.8px !important;" (click)="openDialogPL();PLsearchmodal.search='';searchModalChange(plListFilter())"> style="height: 44.8px !important;"
(click)="openDialogPL();PLsearchmodal.search='';searchModalChange(plListFilter())">
<i class="ri-search-line cursor-pointer text-gray"></i> <i class="ri-search-line cursor-pointer text-gray"></i>
</button> </button>
</ng-template> </ng-template>
...@@ -172,7 +172,8 @@ ...@@ -172,7 +172,8 @@
</h3> </h3>
<mat-dialog-content> <mat-dialog-content>
<app-edit-define-document-form *ngIf="evaluation_cycle?.evaluationRoundId" <app-edit-define-document-form *ngIf="evaluation_cycle?.evaluationRoundId"
[evaluationRoundId]="evaluation_cycle.evaluationRoundId"></app-edit-define-document-form> [evaluationRoundId]="evaluation_cycle.evaluationRoundId"
[apsyear]="evaluation_cycle.apsyear"></app-edit-define-document-form>
</mat-dialog-content> </mat-dialog-content>
......
...@@ -138,7 +138,7 @@ import { PmstypeService } from 'src/app/shared/services/pmstype.service'; ...@@ -138,7 +138,7 @@ import { PmstypeService } from 'src/app/shared/services/pmstype.service';
import { PmstopicService } from 'src/app/shared/services/pmstopic.service'; import { PmstopicService } from 'src/app/shared/services/pmstopic.service';
import { PmsGroupAssessmentService } from 'src/app/shared/services/pms-group-assessment.service'; import { PmsGroupAssessmentService } from 'src/app/shared/services/pms-group-assessment.service';
import { PmsGroupApproveService } from 'src/app/shared/services/pms-group-approve.service'; import { PmsGroupApproveService } from 'src/app/shared/services/pms-group-approve.service';
import { PmsEaluationFactorsService } from 'src/app/shared/services/pms-ealuation-factors.service'; import { PmsEvaluationFactorsService } from 'src/app/shared/services/pms-evaluation-factors.service';
import { PmsMasfromEvaluationCycleService } from 'src/app/shared/services/pms-masfrom-evaluation.service'; import { PmsMasfromEvaluationCycleService } from 'src/app/shared/services/pms-masfrom-evaluation.service';
import { PmsGroupGradeService } from 'src/app/shared/services/pms-group-grade.service'; import { PmsGroupGradeService } from 'src/app/shared/services/pms-group-grade.service';
import { PmsSettingAssessmentService } from 'src/app/shared/services/pms-setting-assessment.service'; import { PmsSettingAssessmentService } from 'src/app/shared/services/pms-setting-assessment.service';
...@@ -414,7 +414,7 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -414,7 +414,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
PmstopicService, PmstopicService,
PmsGroupAssessmentService, PmsGroupAssessmentService,
PmsGroupApproveService, PmsGroupApproveService,
PmsEaluationFactorsService, PmsEvaluationFactorsService,
PmsMasfromEvaluationCycleService, PmsMasfromEvaluationCycleService,
PmsGroupGradeService, PmsGroupGradeService,
PmsSettingAssessmentService, PmsSettingAssessmentService,
......
...@@ -21,6 +21,7 @@ export class EditEvaluationFormComponent { ...@@ -21,6 +21,7 @@ export class EditEvaluationFormComponent {
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>(); @Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
@Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>(); @Output() sendGroupShow: EventEmitter<string> = new EventEmitter<string>();
@Input() evaluationRoundId = '' @Input() evaluationRoundId = ''
@Input() apsyear = ''
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
...@@ -78,7 +79,7 @@ export class EditEvaluationFormComponent { ...@@ -78,7 +79,7 @@ export class EditEvaluationFormComponent {
document.getElementById('form-assessment')?.classList.add("hidden") document.getElementById('form-assessment')?.classList.add("hidden")
document.getElementById('modal-alert')?.classList.add("hidden") document.getElementById('modal-alert')?.classList.add("hidden")
}, 10); }, 10);
if (this.evaluationRoundId) { if (this.evaluationRoundId && this.apsyear) {
this.getAssessmentId(); this.getAssessmentId();
this.getAssessmentList(); this.getAssessmentList();
} }
...@@ -97,7 +98,7 @@ export class EditEvaluationFormComponent { ...@@ -97,7 +98,7 @@ export class EditEvaluationFormComponent {
} }
getAssessmentList() { getAssessmentList() {
this.pmsEvaluationAssessmentService.getById(this.evaluationRoundId!).subscribe({ this.pmsEvaluationAssessmentService.getById(this.evaluationRoundId!, this.apsyear).subscribe({
next: response => { next: response => {
this.assessmentList = response this.assessmentList = response
this.searchChange() this.searchChange()
...@@ -184,7 +185,7 @@ export class EditEvaluationFormComponent { ...@@ -184,7 +185,7 @@ export class EditEvaluationFormComponent {
} }
getApsassessy() { getApsassessy() {
this.loading = true this.loading = true
this.pmsEvaluationAssessmentService.getApsassessy(this.evaluationRoundId, this.apsassessy).subscribe({ this.pmsEvaluationAssessmentService.getApsassessy(this.evaluationRoundId, this.apsassessy, this.apsyear).subscribe({
next: response => { next: response => {
this.empassessmentList = response this.empassessmentList = response
this.loading = false this.loading = false
...@@ -197,7 +198,7 @@ export class EditEvaluationFormComponent { ...@@ -197,7 +198,7 @@ export class EditEvaluationFormComponent {
}) })
} }
getApsassessyMini() { getApsassessyMini() {
this.pmsEvaluationAssessmentService.getApsassessyMini(this.evaluationRoundId, this.apsassessy).subscribe({ this.pmsEvaluationAssessmentService.getApsassessyMini(this.evaluationRoundId, this.apsassessy, this.apsyear).subscribe({
next: response => { next: response => {
this.empassessmentRoundList = response this.empassessmentRoundList = response
this.empassessmentRoundListCheckbox = this.empassessmentRoundList.map(item => ({ checkbox: false, item })) this.empassessmentRoundListCheckbox = this.empassessmentRoundList.map(item => ({ checkbox: false, item }))
......
...@@ -138,8 +138,8 @@ ...@@ -138,8 +138,8 @@
[ngClass]="{'input-list-f2': f&&!l, 'input-list-c2': !f&&!l, 'input-list-l2': !f&&l, 'input-list-fl2': f&&l,'!bg-input-readonly':modalStatus == 'edit'}" [ngClass]="{'input-list-f2': f&&!l, 'input-list-c2': !f&&!l, 'input-list-l2': !f&&l, 'input-list-fl2': f&&l,'!bg-input-readonly':modalStatus == 'edit'}"
[(ngModel)]="item.tdesc"> [(ngModel)]="item.tdesc">
<div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"> <div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
<button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500" <button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button"
(click)="pl.selectIndex=i;selectPl();"> class="flex items-center text-red-500" (click)="pl.selectIndex=i;selectPl();">
<i class="ti ti-circle-x cursor-pointer"></i> <i class="ti ti-circle-x cursor-pointer"></i>
</button> </button>
</div> </div>
...@@ -166,7 +166,8 @@ ...@@ -166,7 +166,8 @@
<ng-template #plSearchButton> <ng-template #plSearchButton>
<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 !m-0 h-full" 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 !m-0 h-full"
style="height: 44.8px !important;" (click)="openPLDialog();PLsearchmodal.search='';searchModalChange(plListFilter())"> style="height: 44.8px !important;"
(click)="openPLDialog();PLsearchmodal.search='';searchModalChange(plListFilter())">
<i class="ri-search-line cursor-pointer text-gray"></i> <i class="ri-search-line cursor-pointer text-gray"></i>
</button> </button>
</ng-template> </ng-template>
...@@ -193,8 +194,9 @@ ...@@ -193,8 +194,9 @@
<mat-dialog-content> <mat-dialog-content>
<!-- <app-edit-define-document-form *ngIf="pmsMasfromEvaluation.select.pmsEvaluationRoundId" <!-- <app-edit-define-document-form *ngIf="pmsMasfromEvaluation.select.pmsEvaluationRoundId"
[evaluationRoundId]="pmsMasfromEvaluation.select.pmsEvaluationRoundId"></app-edit-define-document-form> --> [evaluationRoundId]="pmsMasfromEvaluation.select.pmsEvaluationRoundId"></app-edit-define-document-form> -->
<app-edit-evaluation-form *ngIf="pmsMasfromEvaluation.select.pmsEvaluationRoundId" <app-edit-evaluation-form *ngIf="pmsMasfromEvaluation.select.pmsEvaluationRoundId"
[evaluationRoundId]="pmsMasfromEvaluation.select.pmsEvaluationRoundId"></app-edit-evaluation-form> [evaluationRoundId]="pmsMasfromEvaluation.select.pmsEvaluationRoundId"
[apsyear]="pmsMasfromEvaluation.select.apsyear"></app-edit-evaluation-form>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover"> <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead class="height-50px"> <thead class="height-50px">
<tr class="font-size-12px"> <tr class="font-size-12px">
<ng-container *ngFor="let item of pmsEaluationFactorsTableHeader; let f = first; let l = last"> <ng-container *ngFor="let item of pmsEvaluationFactorsTableHeader; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l"> [class.!text-center]="f||l">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</ng-container> </ng-container>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="pmsEaluationFactors.loading"> <tbody *ngIf="pmsEvaluationFactors.loading">
<tr> <tr>
<td class="text-center" colspan="100%"> <td class="text-center" colspan="100%">
<div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1" role="status" <div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1" role="status"
...@@ -72,27 +72,27 @@ ...@@ -72,27 +72,27 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="!pmsEaluationFactors.loading&&!dataListFilter().length"> <tbody *ngIf="!pmsEvaluationFactors.loading&&!dataListFilter().length">
<tr> <tr>
<td class="text-center" colspan="100%"> <td class="text-center" colspan="100%">
ไม่พบข้อมูล ไม่พบข้อมูล
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody *ngIf="!pmsEaluationFactors.loading&&dataListFilter().length"> <tbody *ngIf="!pmsEvaluationFactors.loading&&dataListFilter().length">
<tr <tr
*ngFor="let pmsEaluationFactors of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"> *ngFor="let pmsEvaluationFactors of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="text-center"> <td class="text-center">
<span> <span>
{{pmsEaluationFactors.personalLevel.plId }} {{pmsEvaluationFactors.personalLevel.plId }}
</span> </span>
</td> </td>
<td *ngFor="let item of pmsEaluationFactors.pmsEvaluationFactors1ModelList"> <td *ngFor="let item of pmsEvaluationFactors.pmsEvaluationFactors1ModelList">
<input type="text" class="ti-form-input" oninput="this.value = this.value.replace(/\D/g, '')" <input type="text" class="ti-form-input" oninput="this.value = this.value.replace(/\D/g, '')"
[(ngModel)]="item.pmsScore"> [(ngModel)]="item.pmsScore">
</td> </td>
<td class="text-center"> <td class="text-center">
{{calPmsEaluationFactors1Total(pmsEaluationFactors.pmsEvaluationFactors1ModelList) }} </td> {{calPmsEvaluationFactors1Total(pmsEvaluationFactors.pmsEvaluationFactors1ModelList) }} </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
ย้อนกลับ ย้อนกลับ
</button> </button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);" <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#define-evaluation-factors-alert-modal" (click)="savePmsEaluationFactors()"> data-hs-overlay="#define-evaluation-factors-alert-modal" (click)="savePmsEvaluationFactors()">
บันทึกข้อมูล บันทึกข้อมูล
</a> </a>
</div> </div>
......
import { ChangeDetectorRef, Component } from '@angular/core'; import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { MyPmsEvaluationFactorsModel, PmsEvaluationFactorsModel } from 'src/app/shared/model/pms-ealuation-factors.model'; import { MyPmsEvaluationFactorsModel, PmsEvaluationFactorsModel } from 'src/app/shared/model/pms-evaluation-factors.model';
import { MyPmsEaluationFactors1Model, PmsEaluationFactors1Model } from 'src/app/shared/model/pms-ealuation-factors1.model'; import { MyPmsEvaluationFactors1Model, PmsEvaluationFactors1Model } from 'src/app/shared/model/pms-evaluation-factors1.model';
import { MyPmstypeModel } from 'src/app/shared/model/pmstype.model'; import { MyPmstypeModel } from 'src/app/shared/model/pmstype.model';
import { PmsEaluationFactorsService } from 'src/app/shared/services/pms-ealuation-factors.service'; import { PmsEvaluationFactorsService } from 'src/app/shared/services/pms-evaluation-factors.service';
@Component({ @Component({
selector: 'app-define-evaluation-factors', selector: 'app-define-evaluation-factors',
...@@ -14,36 +14,36 @@ export class DefineEvaluationFactorsComponent { ...@@ -14,36 +14,36 @@ export class DefineEvaluationFactorsComponent {
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
search = "" search = ""
pmsEaluationFactors: { loading: boolean, dataList: PmsEvaluationFactorsModel[] } = { loading: false, dataList: [] } pmsEvaluationFactors: { loading: boolean, dataList: PmsEvaluationFactorsModel[] } = { loading: false, dataList: [] }
pmsEaluationFactorsTableHeader: string[] = ['ระดับพนักงาน'] pmsEvaluationFactorsTableHeader: string[] = ['ระดับพนักงาน']
constructor(private pmsEaluationFactorsService: PmsEaluationFactorsService, constructor(private pmsEvaluationFactorsService: PmsEvaluationFactorsService,
private toastr: ToastrService, private toastr: ToastrService,
private cdr: ChangeDetectorRef private cdr: ChangeDetectorRef
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.getPmsEaluationFactorsList() this.getPmsEvaluationFactorsList()
} }
getPmsEaluationFactorsList() { getPmsEvaluationFactorsList() {
this.pmsEaluationFactors.loading = true this.pmsEvaluationFactors.loading = true
this.pmsEaluationFactorsTableHeader = ['ระดับพนักงาน'] this.pmsEvaluationFactorsTableHeader = ['ระดับพนักงาน']
this.pmsEaluationFactorsService.getList().subscribe({ this.pmsEvaluationFactorsService.getList().subscribe({
next: response => { next: response => {
this.pmsEaluationFactors.dataList = response.map(x => new MyPmsEvaluationFactorsModel(x)) this.pmsEvaluationFactors.dataList = response.map(x => new MyPmsEvaluationFactorsModel(x))
this.pmsEaluationFactors.loading = false this.pmsEvaluationFactors.loading = false
const maxItem = this.pmsEaluationFactors.dataList.reduce((max, item) => const maxItem = this.pmsEvaluationFactors.dataList.reduce((max, item) =>
item.pmsEvaluationFactors1ModelList.length > max.pmsEvaluationFactors1ModelList.length ? item : max, item.pmsEvaluationFactors1ModelList.length > max.pmsEvaluationFactors1ModelList.length ? item : max,
this.pmsEaluationFactors.dataList[0] this.pmsEvaluationFactors.dataList[0]
); );
const pmsTypeIds = maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.pmsTypeId) || []; const pmsTypeIds = maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.pmsTypeId) || [];
this.pmsEaluationFactorsTableHeader = this.pmsEaluationFactorsTableHeader.concat(maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.tdesc) || []).concat(['รวม']) this.pmsEvaluationFactorsTableHeader = this.pmsEvaluationFactorsTableHeader.concat(maxItem?.pmsEvaluationFactors1ModelList.map(x => x.pmsType.tdesc) || []).concat(['รวม'])
this.pmsEaluationFactors.dataList.forEach(x => { this.pmsEvaluationFactors.dataList.forEach(x => {
while (x.pmsEvaluationFactors1ModelList.length < 5) { while (x.pmsEvaluationFactors1ModelList.length < 5) {
const usedTypes = x.pmsEvaluationFactors1ModelList.map(y => y.pmsType.pmsTypeId); const usedTypes = x.pmsEvaluationFactors1ModelList.map(y => y.pmsType.pmsTypeId);
const remainingTypes = pmsTypeIds.filter(type => !usedTypes.includes(type)); const remainingTypes = pmsTypeIds.filter(type => !usedTypes.includes(type));
if (remainingTypes.length === 0) { break } if (remainingTypes.length === 0) { break }
const pmsTypeId = remainingTypes[0]; const pmsTypeId = remainingTypes[0];
x.pmsEvaluationFactors1ModelList.push( x.pmsEvaluationFactors1ModelList.push(
new MyPmsEaluationFactors1Model({ pmsType: new MyPmstypeModel({ pmsTypeId }) }) new MyPmsEvaluationFactors1Model({ pmsType: new MyPmstypeModel({ pmsTypeId }) })
) )
} }
x.pmsEvaluationFactors1ModelList.sort((a, b) => +(a.pmsType.pmsTypeId) - +(b.pmsType.pmsTypeId)) x.pmsEvaluationFactors1ModelList.sort((a, b) => +(a.pmsType.pmsTypeId) - +(b.pmsType.pmsTypeId))
...@@ -51,52 +51,52 @@ export class DefineEvaluationFactorsComponent { ...@@ -51,52 +51,52 @@ export class DefineEvaluationFactorsComponent {
this.searchChange() this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
}, error: error => { }, error: error => {
this.pmsEaluationFactors.loading = false this.pmsEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}) })
} }
savePmsEaluationFactors() { savePmsEvaluationFactors() {
this.pmsEaluationFactors.loading = true this.pmsEvaluationFactors.loading = true
const body = this.pmsEaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({ const body = this.pmsEvaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({
...x, ...x,
pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEaluationFactors1Model({ pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEvaluationFactors1Model({
...y, ...y,
pmsScore: +(y.pmsScore) pmsScore: +(y.pmsScore)
})) }))
})) }))
this.pmsEaluationFactorsService.post(body).subscribe({ this.pmsEvaluationFactorsService.post(body).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
this.showAlert(response.message, 'success') this.showAlert(response.message, 'success')
this.getPmsEaluationFactorsList() this.getPmsEvaluationFactorsList()
} else { } else {
this.showAlert(response.message, 'error') this.showAlert(response.message, 'error')
this.pmsEaluationFactors.loading = false this.pmsEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}, error: error => { }, error: error => {
this.showAlert(error.message, 'error') this.showAlert(error.message, 'error')
this.pmsEaluationFactors.loading = false this.pmsEvaluationFactors.loading = false
this.cdr.detectChanges() this.cdr.detectChanges()
} }
}) })
} }
clear() { clear() {
this.pmsEaluationFactors.dataList = this.pmsEaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({ this.pmsEvaluationFactors.dataList = this.pmsEvaluationFactors.dataList.map(x => new MyPmsEvaluationFactorsModel({
...x, ...x,
pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEaluationFactors1Model({ pmsEvaluationFactors1ModelList: x.pmsEvaluationFactors1ModelList.map(y => new MyPmsEvaluationFactors1Model({
...y, ...y,
pmsScore: 0 pmsScore: 0
})) }))
})) }))
} }
calPmsEaluationFactors1Total(data: PmsEaluationFactors1Model[]) { calPmsEvaluationFactors1Total(data: PmsEvaluationFactors1Model[]) {
return data.reduce((sum, num) => sum + +(num.pmsScore), 0); return data.reduce((sum, num) => sum + +(num.pmsScore), 0);
} }
dataListFilter() { dataListFilter() {
return this.pmsEaluationFactors.dataList.filter(x => x.personalLevel.plId.toLowerCase().includes(this.search.toLowerCase())) return this.pmsEvaluationFactors.dataList.filter(x => x.personalLevel.plId.toLowerCase().includes(this.search.toLowerCase()))
} }
searchChange() { searchChange() {
......
export interface ComEvaluationFactorsModel {
comEvaluationFactorsList: ComEvaluationFactorsDetailModel[]
companyId: string
jl: JlModel
}
export class MyComEvaluationFactorsModel implements ComEvaluationFactorsModel {
comEvaluationFactorsList: ComEvaluationFactorsDetailModel[]
companyId: string
jl: JlModel
constructor(data?: Partial<ComEvaluationFactorsModel>) {
this.jl = new MyJlModel(data?.jl)
this.companyId = data?.companyId || ""
this.comEvaluationFactorsList = (data?.comEvaluationFactorsList || []).map(x => new MyComEvaluationFactorsDetailModel(x)) || []
}
}
export interface ComEvaluationFactorsDetailModel {
companyId: string
competencyType: CompetencyTypeModel
comScore: number
}
export class MyComEvaluationFactorsDetailModel implements ComEvaluationFactorsDetailModel {
companyId: string
competencyType: CompetencyTypeModel
comScore: number
constructor(data?: Partial<ComEvaluationFactorsDetailModel>) {
this.companyId = data?.companyId || ""
this.competencyType = new MyCompetencyTypeModel(data?.competencyType)
this.comScore = data?.comScore ?? 0
}
}
export interface CompetencyTypeModel {
companyId: string
competencyTypeId: string
edesc: string
expectationLevel: string
shortName: string
tdesc: string
weight: number
}
export class MyCompetencyTypeModel implements CompetencyTypeModel {
companyId: string
competencyTypeId: string
edesc: string
expectationLevel: string
shortName: string
tdesc: string
weight: number
constructor(data?: Partial<CompetencyTypeModel>) {
this.companyId = data?.companyId || ""
this.competencyTypeId = data?.competencyTypeId || ""
this.edesc = data?.edesc || ""
this.expectationLevel = data?.expectationLevel || ""
this.shortName = data?.shortName || ""
this.tdesc = data?.tdesc || ""
this.weight = data?.weight ?? 0
}
}
export interface JlModel {
companyId: string
edesc: string
grade: GradeModel
plId: string
tdesc: string
}
export class MyJlModel implements JlModel {
companyId: string
edesc: string
grade: GradeModel
plId: string
tdesc: string
constructor(data?: Partial<JlModel>) {
this.companyId = data?.companyId || ""
this.edesc = data?.edesc || ""
this.grade = new MyGradeModel(data?.grade)
this.plId = data?.plId || ""
this.tdesc = data?.tdesc || ""
}
}
export interface GradeModel {
countAverage: string
countEmployee: string
countScore: string
gradeDetail: GradeDetailModel[]
}
export class MyGradeModel implements GradeModel {
countAverage: string
countEmployee: string
countScore: string
gradeDetail: GradeDetailModel[]
constructor(data?: Partial<GradeModel>) {
this.countAverage = data?.countAverage || ""
this.countEmployee = data?.countEmployee || ""
this.countScore = data?.countScore || ""
this.gradeDetail = (data?.gradeDetail || []).map(item => new MyGradeDetailModel(item))
}
}
export interface GradeDetailModel {
companyId: string
countAverage: string
countEmployee: string
countScore: string
edesc: string
gradeDetail: string
gradeId: string
gradeMaxScore: number
gradeMinScore: number
tdesc: string
weight: number
}
export class MyGradeDetailModel implements GradeDetailModel {
companyId: string
countAverage: string
countEmployee: string
countScore: string
edesc: string
gradeDetail: string
gradeId: string
gradeMaxScore: number
gradeMinScore: number
tdesc: string
weight: number
constructor(data?: Partial<GradeDetailModel>) {
this.companyId = data?.companyId || ""
this.countAverage = data?.countAverage || ""
this.countEmployee = data?.countEmployee || ""
this.countScore = data?.countScore || ""
this.edesc = data?.edesc || ""
this.gradeDetail = data?.gradeDetail || ""
this.gradeId = data?.gradeId || ""
this.gradeMaxScore = data?.gradeMaxScore ?? 0
this.gradeMinScore = data?.gradeMinScore ?? 0
this.tdesc = data?.tdesc || ""
this.weight = data?.weight ?? 0
}
}
...@@ -1722,7 +1722,9 @@ export interface CompetencyIndicatorsCourses1 { ...@@ -1722,7 +1722,9 @@ export interface CompetencyIndicatorsCourses1 {
competencyCourse: CompetencyCourse[] competencyCourse: CompetencyCourse[]
competencyCourseId: string competencyCourseId: string
idpDevelopmentPlan: IdpDevelopmentPlan | null idpDevelopmentPlan: IdpDevelopmentPlan | null
indicatorsCourses0: IndicatorsCourses0 indicatorsCourses0: IndicatorsCourses0,
startDate: string
endDate: string
} }
export interface BehavioralIndicator { export interface BehavioralIndicator {
......
...@@ -1464,6 +1464,8 @@ export interface CompetencyIndicatorsCourses1 { ...@@ -1464,6 +1464,8 @@ export interface CompetencyIndicatorsCourses1 {
competencyCourse: CompetencyCourse[] competencyCourse: CompetencyCourse[]
behavioralIndicators: BehavioralIndicator[] behavioralIndicators: BehavioralIndicator[]
idpDevelopmentPlan?: IdpDevelopmentPlan idpDevelopmentPlan?: IdpDevelopmentPlan
startDate: string
endDate: string
} }
export interface IndicatorsCourses0 { export interface IndicatorsCourses0 {
......
import { PLModel, MyPLModel } from "./pl.model" import { PLModel, MyPLModel } from "./pl.model"
import { MyPmsEaluationFactors1Model, PmsEaluationFactors1Model } from "./pms-ealuation-factors1.model" import { MyPmsEvaluationFactors1Model, PmsEvaluationFactors1Model } from "./pms-evaluation-factors1.model"
export interface PmsEvaluationFactorsModel { export interface PmsEvaluationFactorsModel {
personalLevel: PLModel personalLevel: PLModel
companyId: string companyId: string
pmsEvaluationFactors1ModelList: PmsEaluationFactors1Model[] pmsEvaluationFactors1ModelList: PmsEvaluationFactors1Model[]
} }
export class MyPmsEvaluationFactorsModel implements PmsEvaluationFactorsModel { export class MyPmsEvaluationFactorsModel implements PmsEvaluationFactorsModel {
personalLevel: PLModel personalLevel: PLModel
companyId: string companyId: string
pmsEvaluationFactors1ModelList: PmsEaluationFactors1Model[] pmsEvaluationFactors1ModelList: PmsEvaluationFactors1Model[]
constructor(data?: Partial<PmsEvaluationFactorsModel>) { constructor(data?: Partial<PmsEvaluationFactorsModel>) {
this.personalLevel = new MyPLModel(data?.personalLevel) this.personalLevel = new MyPLModel(data?.personalLevel)
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.pmsEvaluationFactors1ModelList = data?.pmsEvaluationFactors1ModelList?.map(x => new MyPmsEaluationFactors1Model(x)) || [] this.pmsEvaluationFactors1ModelList = data?.pmsEvaluationFactors1ModelList?.map(x => new MyPmsEvaluationFactors1Model(x)) || []
} }
} }
import { MyPmstypeModel, PmstypeModel } from "./pmstype.model"; import { MyPmstypeModel, PmstypeModel } from "./pmstype.model";
export interface PmsEaluationFactors1Model { export interface PmsEvaluationFactors1Model {
pmsType: PmstypeModel pmsType: PmstypeModel
companyId: string companyId: string
pmsScore: number pmsScore: number
} }
export class MyPmsEaluationFactors1Model implements PmsEaluationFactors1Model { export class MyPmsEvaluationFactors1Model implements PmsEvaluationFactors1Model {
pmsType: PmstypeModel pmsType: PmstypeModel
companyId: string companyId: string
pmsScore: number pmsScore: number
constructor(data?: Partial<PmsEaluationFactors1Model>) { constructor(data?: Partial<PmsEvaluationFactors1Model>) {
this.pmsType = new MyPmstypeModel(data?.pmsType) this.pmsType = new MyPmstypeModel(data?.pmsType)
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.pmsScore = data?.pmsScore ?? 0 this.pmsScore = data?.pmsScore ?? 0
......
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 { ComEvaluationFactorsModel } from '../model/com-ealuation-factors.model';
@Injectable({
providedIn: 'root'
})
export class ComEvaluationFactorsService {
api = "/com-evaluation-factors"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getList(): Observable<ComEvaluationFactorsModel[]> {
return this.http.get<ComEvaluationFactorsModel[]>(this.urlApi + "/lists")
}
post(body: ComEvaluationFactorsModel[]): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
}
\ No newline at end of file
...@@ -9,51 +9,51 @@ import { AppraisalRoundModel } from '../model/appraisal-aps.model'; ...@@ -9,51 +9,51 @@ import { AppraisalRoundModel } from '../model/appraisal-aps.model';
import { EvaluationModal } from '../model/evaluation-form.modal'; import { EvaluationModal } from '../model/evaluation-form.modal';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class EvaluationAssessmentService { export class EvaluationAssessmentService {
api = "/evaluation-assessment" api = "/evaluation-assessment"
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getList(): Observable<EvaluationCycleModel[]> { getList(): Observable<EvaluationCycleModel[]> {
return this.http.get<EvaluationCycleModel[]>(this.urlApi + "/lists") return this.http.get<EvaluationCycleModel[]>(this.urlApi + "/lists")
} }
getById(evaluationRoundId: string): Observable<any[]> { getById(evaluationRoundId: string, apsyear: string): Observable<any[]> {
return this.http.get<any[]>(this.urlApi + "/" + evaluationRoundId) return this.http.get<any[]>(this.urlApi + "/" + evaluationRoundId + "/" + apsyear)
} }
getApsassessy(evaluationRoundId: string,apsassessy:string): Observable<EvaluationModal> { getApsassessy(evaluationRoundId: string, apsassessy: string, apsyear: string): Observable<EvaluationModal> {
return this.http.get<EvaluationModal>(this.urlApi + "/" + evaluationRoundId+"/"+apsassessy) return this.http.get<EvaluationModal>(this.urlApi + "/" + evaluationRoundId + "/" + apsassessy + "/" + apsyear)
} }
getApsassessyMini(evaluationRoundId: string,apsassessy:string): Observable<AppraisalRoundModel[]> { getApsassessyMini(evaluationRoundId: string, apsassessy: string, apsyear: string): Observable<AppraisalRoundModel[]> {
return this.http.get<AppraisalRoundModel[]>(this.urlApi + "/mini/" + evaluationRoundId+"/"+apsassessy) return this.http.get<AppraisalRoundModel[]>(this.urlApi + "/mini/" + evaluationRoundId + "/" + apsassessy + "/" + apsyear)
} }
getIndicators(plId: string): Observable<AppraisalRoundModel[]> { getIndicators(plId: string): Observable<AppraisalRoundModel[]> {
return this.http.get<AppraisalRoundModel[]>(this.urlApi + "/indicators/list/" + plId) return this.http.get<AppraisalRoundModel[]>(this.urlApi + "/indicators/list/" + plId)
} }
post(body: AppraisalModel): Observable<AlertModel> { post(body: AppraisalModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body) return this.http.post<AlertModel>(this.urlApi, body)
} }
postList(body:any): Observable<AlertModel> { postList(body: any): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi+"/create-list", body) return this.http.post<AlertModel>(this.urlApi + "/create-list", body)
} }
delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> { delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
"Content-Type": "application/json", "Content-Type": "application/json",
}), }),
body: body body: body
}; };
return this.http.delete<AlertModel>(this.urlApi, options) return this.http.delete<AlertModel>(this.urlApi, options)
} }
deletemMini(body: AppraisalRoundModel[],apsassessy:string,evaluationRoundId:string): Observable<AlertModel> { deletemMini(body: AppraisalRoundModel[], apsassessy: string, evaluationRoundId: string): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
"Content-Type": "application/json", "Content-Type": "application/json",
}), }),
body: body body: body
}; };
return this.http.delete<AlertModel>(this.urlApi+'/delete-mini'+"/"+apsassessy+"/"+evaluationRoundId, options) return this.http.delete<AlertModel>(this.urlApi + '/delete-mini' + "/" + apsassessy + "/" + evaluationRoundId, options)
} }
} }
...@@ -11,51 +11,51 @@ import { PmsMasfromEvaluationModel } from '../model/pms-masfrom-evaluation.model ...@@ -11,51 +11,51 @@ import { PmsMasfromEvaluationModel } from '../model/pms-masfrom-evaluation.model
import { MasfromEvaluationAssessment1lList, PmsMasfromEvaluationFullModel } from '../model/pms-masfrom-evaluation-list.model'; import { MasfromEvaluationAssessment1lList, PmsMasfromEvaluationFullModel } from '../model/pms-masfrom-evaluation-list.model';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class PmsEvaluationAssessmentService { export class PmsEvaluationAssessmentService {
api = "/pms-evaluation-assessment" api = "/pms-evaluation-assessment"
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getList(): Observable<EvaluationCycleModel[]> { getList(): Observable<EvaluationCycleModel[]> {
return this.http.get<EvaluationCycleModel[]>(this.urlApi + "/lists") return this.http.get<EvaluationCycleModel[]>(this.urlApi + "/lists")
} }
getById(evaluationRoundId: string): Observable<PmsMasfromEvaluationFullModel[]> { getById(evaluationRoundId: string, apsyear: string): Observable<PmsMasfromEvaluationFullModel[]> {
return this.http.get<PmsMasfromEvaluationFullModel[]>(this.urlApi + "/" + evaluationRoundId) return this.http.get<PmsMasfromEvaluationFullModel[]>(this.urlApi + "/" + evaluationRoundId + "/" + apsyear)
} }
getApsassessy(evaluationRoundId: string,apsassessy:string): Observable<EvaluationModal> { getApsassessy(evaluationRoundId: string, apsassessy: string, apsyear: string): Observable<EvaluationModal> {
return this.http.get<EvaluationModal>(this.urlApi + "/" + evaluationRoundId+"/"+apsassessy) return this.http.get<EvaluationModal>(this.urlApi + "/" + evaluationRoundId + "/" + apsassessy + "/" + apsyear)
} }
getApsassessyMini(evaluationRoundId: string,apsassessy:string): Observable<MasfromEvaluationAssessment1lList[]> { getApsassessyMini(evaluationRoundId: string, apsassessy: string, apsyear: string): Observable<MasfromEvaluationAssessment1lList[]> {
return this.http.get<MasfromEvaluationAssessment1lList[]>(this.urlApi + "/mini/" + evaluationRoundId+"/"+apsassessy) return this.http.get<MasfromEvaluationAssessment1lList[]>(this.urlApi + "/mini/" + evaluationRoundId + "/" + apsassessy + "/" + apsyear)
} }
getIndicators(plId: string): Observable<MasfromEvaluationAssessment1lList[]> { getIndicators(plId: string): Observable<MasfromEvaluationAssessment1lList[]> {
return this.http.get<MasfromEvaluationAssessment1lList[]>(this.urlApi + "/pms-topic/list/" + plId) return this.http.get<MasfromEvaluationAssessment1lList[]>(this.urlApi + "/pms-topic/list/" + plId)
} }
post(body: PmsMasfromEvaluationFullModel): Observable<AlertModel> { post(body: PmsMasfromEvaluationFullModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body) return this.http.post<AlertModel>(this.urlApi, body)
} }
postList(body:any): Observable<AlertModel> { postList(body: any): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi+"/create-list", body) return this.http.post<AlertModel>(this.urlApi + "/create-list", body)
} }
delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> { delete(body: EvaluationCycleModel | EvaluationCycleModel[]): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
"Content-Type": "application/json", "Content-Type": "application/json",
}), }),
body: body body: body
}; };
return this.http.delete<AlertModel>(this.urlApi, options) return this.http.delete<AlertModel>(this.urlApi, options)
} }
deletemMini(body: AppraisalRoundModel[],apsassessy:string,evaluationRoundId:string): Observable<AlertModel> { deletemMini(body: AppraisalRoundModel[], apsassessy: string, evaluationRoundId: string): Observable<AlertModel> {
const options = { const options = {
headers: new HttpHeaders({ headers: new HttpHeaders({
"Content-Type": "application/json", "Content-Type": "application/json",
}), }),
body: body body: body
}; };
return this.http.delete<AlertModel>(this.urlApi+'/delete-mini'+"/"+apsassessy+"/"+evaluationRoundId, options) return this.http.delete<AlertModel>(this.urlApi + '/delete-mini' + "/" + apsassessy + "/" + evaluationRoundId, options)
} }
} }
...@@ -3,13 +3,13 @@ import { Injectable } from '@angular/core'; ...@@ -3,13 +3,13 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AlertModel } from '../model/alert.model'; import { AlertModel } from '../model/alert.model';
import { PmsEvaluationFactorsModel } from '../model/pms-ealuation-factors.model'; import { PmsEvaluationFactorsModel } from '../model/pms-evaluation-factors.model';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class PmsEaluationFactorsService { export class PmsEvaluationFactorsService {
api = "/pms-ealuation-factors" api = "/pms-evaluation-factors"
urlApi = environment.baseUrl + this.api urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
......
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