Commit e59735fa by Nattana Chaiyamat

เปลี่ยนการจัดกลุ่มหัวข้อประเมิน จาก JL เป็น JD

parent 66a890c0
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="pl" class="py-2 border-b-2 border-collapse "> <div *ngIf="jobCode" class="py-2 border-b-2 border-collapse ">
<div class="grid grid-cols-3 gap-6"> <div class="grid grid-cols-3 gap-6">
<div class="col-span-1"> <div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">รหัส</label> <label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">รหัส</label>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="col-span-1"> <div class="col-span-1">
<input type="text" id="input-label" <input type="text" id="input-label"
class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly" class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
readonly [(ngModel)]="pl.plId"> readonly [(ngModel)]="jobCode.jobCodeId">
</div> </div>
</div> </div>
<div class="grid grid-cols-3 gap-6 mt-5"> <div class="grid grid-cols-3 gap-6 mt-5">
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
<div class="col-span-1"> <div class="col-span-1">
<input type="text" id="input-label" <input type="text" id="input-label"
class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly" class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
readonly [(ngModel)]="pl.tdesc"> readonly [(ngModel)]="jobCode.tdesc">
</div> </div>
<div class="col-span-1"> <div class="col-span-1">
<input type="text" id="input-label" <input type="text" id="input-label"
class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly" class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-2/3 rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
readonly [(ngModel)]="pl.edesc"> readonly [(ngModel)]="jobCode.edesc">
</div> </div>
</div> </div>
</div> </div>
......
...@@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angu ...@@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angu
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { GroupAssessmentModel, MyGroupAssessmentModel } from 'src/app/shared/model/group-assessment.model'; import { GroupAssessmentModel, MyGroupAssessmentModel } from 'src/app/shared/model/group-assessment.model';
import { GroupAssessment1ListModel, MyGroupAssessment1ListModel } from 'src/app/shared/model/group-assessment1-list.model'; import { GroupAssessment1ListModel, MyGroupAssessment1ListModel } from 'src/app/shared/model/group-assessment1-list.model';
import { MyPLModel, PLModel } from 'src/app/shared/model/pl.model'; import { MyJobcodeModel, JobcodeModel } from 'src/app/shared/model/jobcode.model';
import { GroupAssessmentService } from 'src/app/shared/services/group-assessment.service'; import { GroupAssessmentService } from 'src/app/shared/services/group-assessment.service';
import { IndicatorsCoursesService } from 'src/app/shared/services/indicators-courses.service'; import { IndicatorsCoursesService } from 'src/app/shared/services/indicators-courses.service';
import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1MiniModel } from 'src/app/shared/model/competency-indicators-courses1-mini.model'; import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1MiniModel } from 'src/app/shared/model/competency-indicators-courses1-mini.model';
...@@ -13,7 +13,7 @@ import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1Mi ...@@ -13,7 +13,7 @@ import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1Mi
styleUrls: ['./edit-group-competencies.component.scss'] styleUrls: ['./edit-group-competencies.component.scss']
}) })
export class EditGroupCompetenciesComponent { export class EditGroupCompetenciesComponent {
@Input() pl: PLModel = new MyPLModel() @Input() jobCode: JobcodeModel = new MyJobcodeModel()
@Output() sendEdit: EventEmitter<boolean> = new EventEmitter<boolean>(); @Output() sendEdit: EventEmitter<boolean> = new EventEmitter<boolean>();
groupCompetencies: GroupAssessmentModel = new MyGroupAssessmentModel() groupCompetencies: GroupAssessmentModel = new MyGroupAssessmentModel()
dataSelectList: GroupAssessment1ListModel[] = []; dataSelectList: GroupAssessment1ListModel[] = [];
...@@ -53,9 +53,9 @@ export class EditGroupCompetenciesComponent { ...@@ -53,9 +53,9 @@ export class EditGroupCompetenciesComponent {
getGroupAssessmentById() { getGroupAssessmentById() {
this.dataLoading = true; this.dataLoading = true;
this.groupAssessmentService.getById(this.pl.plId).subscribe({ this.groupAssessmentService.getById(this.jobCode.jobCodeId).subscribe({
next: response => { next: response => {[[]]
this.groupCompetencies = new MyGroupAssessmentModel({ ...response, personalLevel: new MyPLModel(this.pl) }) this.groupCompetencies = new MyGroupAssessmentModel({ ...response, jd: new MyJobcodeModel(this.jobCode) })
this.dataList = new MyGroupAssessmentModel(response).groupAssessment1List.map(x => ({ check: false, data: new MyGroupAssessment1ListModel(x) })) this.dataList = new MyGroupAssessmentModel(response).groupAssessment1List.map(x => ({ check: false, data: new MyGroupAssessment1ListModel(x) }))
this.dataList.sort((a, b) => { this.dataList.sort((a, b) => {
const topicA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase(); const topicA = a.data.competencyIndicatorsCourses1Mini.competencyIndicatorsCourses0.competencyTopic.competencyTopicId.toLowerCase();
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</ng-container> </ng-container>
<ng-container *ngIf="editTab"> <ng-container *ngIf="editTab">
<app-edit-group-competencies [pl]="groupCompetencies" <app-edit-group-competencies [jobCode]="groupCompetencies"
(sendEdit)="editTab=$event;pathTitleChange()"></app-edit-group-competencies> (sendEdit)="editTab=$event;pathTitleChange()"></app-edit-group-competencies>
</ng-container> </ng-container>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ColumnModel } from '@syncfusion/ej2-grids'; import { ColumnModel } from '@syncfusion/ej2-grids';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { MyPLModel, PLModel } from 'src/app/shared/model/pl.model'; import { JobcodeModel, MyJobcodeModel } from 'src/app/shared/model/jobcode.model';
import { FileService } from 'src/app/shared/services/file.service'; import { FileService } from 'src/app/shared/services/file.service';
import { PLService } from 'src/app/shared/services/pl.service'; import { JobcodeService } from 'src/app/shared/services/jobcode.service';
@Component({ @Component({
selector: 'app-group-competencies', selector: 'app-group-competencies',
...@@ -16,15 +16,15 @@ export class GroupCompetenciesComponent { ...@@ -16,15 +16,15 @@ export class GroupCompetenciesComponent {
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
groupCompetenciesList: PLModel[] = [] groupCompetenciesList: JobcodeModel[] = []
groupCompetencies: PLModel = new MyPLModel({}) groupCompetencies: JobcodeModel = new MyJobcodeModel({})
dataLoading = false dataLoading = false
selectedFile: File | null = null; selectedFile: File | null = null;
selectedFileName: string = 'กรุณาเลือกไฟล์'; selectedFileName: string = 'กรุณาเลือกไฟล์';
columns: ColumnModel[] = [{ columns: ColumnModel[] = [{
field: "plId", field: "jobCodeId",
headerText: "รหัส", headerText: "รหัส",
type: "string", type: "string",
isPrimaryKey: true, isPrimaryKey: true,
...@@ -45,7 +45,7 @@ export class GroupCompetenciesComponent { ...@@ -45,7 +45,7 @@ export class GroupCompetenciesComponent {
constructor(private toastr: ToastrService, constructor(private toastr: ToastrService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private fileService: FileService, private fileService: FileService,
private pLService: PLService, private jobcodeService: JobcodeService,
) { ) {
this.pathTitleChange() this.pathTitleChange()
} }
...@@ -106,11 +106,11 @@ export class GroupCompetenciesComponent { ...@@ -106,11 +106,11 @@ export class GroupCompetenciesComponent {
getGroupCompetenciesList() { getGroupCompetenciesList() {
this.dataLoading = true this.dataLoading = true
this.selectedItems.data.clear() this.selectedItems.data.clear()
this.pLService.getList().subscribe({ this.jobcodeService.getGroupAssessmentList().subscribe({
next: response => { next: response => {
this.groupCompetenciesList = response.map(x => { this.groupCompetenciesList = response.map(x => {
this.selectedItems.data.set(x.plId, false) this.selectedItems.data.set(x.jobCodeId, false)
return new MyPLModel(x) return new MyJobcodeModel(x)
}) })
this.groupCompetenciesList = response this.groupCompetenciesList = response
this.dataLoading = false this.dataLoading = false
...@@ -122,9 +122,9 @@ export class GroupCompetenciesComponent { ...@@ -122,9 +122,9 @@ export class GroupCompetenciesComponent {
}) })
} }
selectGroupCompetencies(data: PLModel) { selectGroupCompetencies(data: JobcodeModel) {
const groupCompetencies = this.groupCompetenciesList.find(x => x.plId == data.plId) const groupCompetencies = this.groupCompetenciesList.find(x => x.jobCodeId == data.jobCodeId)
this.groupCompetencies = new MyPLModel(groupCompetencies) this.groupCompetencies = new MyJobcodeModel(groupCompetencies)
} }
pathTitleChange() { pathTitleChange() {
...@@ -140,7 +140,7 @@ export class GroupCompetenciesComponent { ...@@ -140,7 +140,7 @@ export class GroupCompetenciesComponent {
} }
checkPrimary() { checkPrimary() {
return this.groupCompetenciesList.find(x => x.plId == this.groupCompetencies.plId) return this.groupCompetenciesList.find(x => x.jobCodeId == this.groupCompetencies.jobCodeId)
} }
} }
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['รหัสแบบฟอร์ม','ชื่อพนักงาน','ตำแหน่ง','ระดับพนักงาน','การจัดการ']; let f = first; let l = last; let i = index"> *ngFor="let item of ['รหัสแบบฟอร์ม','ชื่อพนักงาน','ตำแหน่ง','ลักษณะงาน','การจัดการ']; let f = first; let l = last; let i = index">
<th scope="col" <th scope="col"
class="relative px-10px py-10px bg-soft-secondary text-primary !text-center"> class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
{{item.masfromEvaluationRound.evaluationRoundId}}</td> {{item.masfromEvaluationRound.evaluationRoundId}}</td>
<td>{{item.apsassessy.fname}} {{item.apsassessy.lname}}</td> <td>{{item.apsassessy.fname}} {{item.apsassessy.lname}}</td>
<td class="text-center">{{item.apsassessy.position.tdesc}}</td> <td class="text-center">{{item.apsassessy.position.tdesc}}</td>
<td class="text-center">{{item.personalLevel.tdesc}}</td> <td class="text-center">{{item.jd.tdesc}}</td>
<td class="flex justify-center items-center space-x-2"> <td class="flex justify-center items-center space-x-2">
<i class="ti ti-edit cursor-pointer i-gray fs-xl px-1" *ngIf="item.active" (click)="openAddRoundModel(item.masfromEvaluationRound.evaluationRoundId,item.apsassessy.employeeId,item,'form-pm-emp')" ></i> <i class="ti ti-edit cursor-pointer i-gray fs-xl px-1" *ngIf="item.active" (click)="openAddRoundModel(item.masfromEvaluationRound.evaluationRoundId,item.apsassessy.employeeId,item,'form-pm-emp')" ></i>
<input type="checkbox" id="hs-small-switch{{i+1}}" [(ngModel)]="item.active" (ngModelChange)="saveAssessmentOne(item)" <input type="checkbox" id="hs-small-switch{{i+1}}" [(ngModel)]="item.active" (ngModelChange)="saveAssessmentOne(item)"
......
...@@ -102,14 +102,14 @@ ...@@ -102,14 +102,14 @@
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd" <input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd"
[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">ระดับพนักงาน (JL)</label> <label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label>
<div *ngFor="let item of evaluation_cycle.personalLevel;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
[ngClass]="{'input-list-f1': f&&!l, 'input-list-c1': !f&&!l, 'input-list-l1': !f&&l, 'input-list-fl1': f&&l,'!bg-input-readonly':modalStatus == 'edit'}" [ngClass]="{'input-list-f1': f&&!l, 'input-list-c1': !f&&!l, 'input-list-l1': !f&&l, 'input-list-fl1': f&&l,'!bg-input-readonly':modalStatus == 'edit'}"
[(ngModel)]="item.plId"> [(ngModel)]="item.jobCodeId">
<div <div
[ngClass]="{'input-list-line-f': f&&!l, 'input-list-line-c': !f&&!l, 'input-list-line-l': !f&&l, 'input-list-line-fl': f&&l}"> [ngClass]="{'input-list-line-f': f&&!l, 'input-list-line-c': !f&&!l, 'input-list-line-l': !f&&l, 'input-list-line-fl': f&&l}">
<div class="input-list-line"></div> <div class="input-list-line"></div>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
[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.plId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500" <button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500"
(click)="pl.selectIndex=i;selectPl()"> (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>
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
<ng-component *ngTemplateOutlet="plSearchButton"></ng-component> <ng-component *ngTemplateOutlet="plSearchButton"></ng-component>
</div> </div>
</div> </div>
<div class="grid grid-cols-2" *ngIf="!evaluation_cycle.personalLevel.length"> <div class="grid grid-cols-2" *ngIf="!evaluation_cycle.jd.length">
<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 input-list-fl1 pointer-events-none" readonly> <input type="text" class="ti-form-input input-list-fl1 pointer-events-none" readonly>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<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>
<span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JL ระบบจะทำการเลือกทั้งหมด</span> <span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JD ระบบจะทำการเลือกทั้งหมด</span>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button type="button" mat-button [mat-dialog-close] <button type="button" mat-button [mat-dialog-close]
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
<ng-template #PLModal let-modal> <ng-template #PLModal let-modal>
<h3 mat-dialog-title> <h3 mat-dialog-title>
ข้อมูลระดับพนักงาน (JL) ข้อมูลลักษณะงาน (JD)
</h3> </h3>
<mat-dialog-content> <mat-dialog-content>
<div class="flex justify-end pb-1rem"> <div class="flex justify-end pb-1rem">
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['ลำดับ','รหัสระดับพนักงาน (JL)','รายละเอียดฝ่าย (ไทย)','รายละเอียดฝ่าย (อังกฤษ)']; let f = first; let l = last"> *ngFor="let item of ['ลำดับ','รหัสลักษณะงาน (JD)','รายละเอียดฝ่าย (ไทย)','รายละเอียดฝ่าย (อังกฤษ)']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" [class.!text-center]="f"> <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" [class.!text-center]="f">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l"> <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
<td class="flex justify-center"> <td class="flex justify-center">
{{((PLsearchmodal.currentPage-1) * PLsearchmodal.pageSize)+(i+1)}} {{((PLsearchmodal.currentPage-1) * PLsearchmodal.pageSize)+(i+1)}}
</td> </td>
<td>{{item.plId}}</td> <td>{{item.jobCodeId}}</td>
<td>{{item.tdesc}}</td> <td>{{item.tdesc}}</td>
<td>{{item.edesc}}</td> <td>{{item.edesc}}</td>
</tr> </tr>
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd" <input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="evaluation_cycle.apsPeriodEnd"
[ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit"> [ngClass]="{'bg-input-readonly':!modalStatusEdit}" [readonly]="!modalStatusEdit">
<label for="input-label" class="ti-form-label mt-2rem">ระดับพนักงาน (JL)</label> <label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label>
<div *ngFor="let item of evaluation_cycle.personalLevel;let i = index;let f=first;let l = last" <div *ngFor="let item of evaluation_cycle.personalLevel;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">
...@@ -531,7 +531,7 @@ ...@@ -531,7 +531,7 @@
<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>
<span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JL ระบบจะทำการเลือกทั้งหมด</span> <span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JD ระบบจะทำการเลือกทั้งหมด</span>
<div class="flex justify-end mt-2rem mb-1rem"> <div class="flex justify-end mt-2rem mb-1rem">
<button type="button" <button type="button"
...@@ -663,7 +663,7 @@ ...@@ -663,7 +663,7 @@
<div class="max-h-full overflow-hidden ti-modal-content"> <div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header"> <div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary"> <h3 class="text-xxl font-bold text-primary">
ข้อมูลระดับพนักงาน (JL) ข้อมูลลักษณะงาน (JD)
</h3> </h3>
<div class="flex justify-end"> <div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger" <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
...@@ -692,7 +692,7 @@ ...@@ -692,7 +692,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['ลำดับ','รหัสระดับพนักงาน (JL)','รายละเอียด(ไทย)','รายละเอียด(อังกฤษ)']; let f = first; let l = last"> *ngFor="let item of ['ลำดับ','รหัสลักษณะงาน (JD)','รายละเอียด(ไทย)','รายละเอียด(อังกฤษ)']; 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"> [class.!text-center]="f">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
......
...@@ -2,11 +2,12 @@ import { ChangeDetectorRef, Component, EventEmitter, Output, Renderer2, ViewChil ...@@ -2,11 +2,12 @@ import { ChangeDetectorRef, Component, EventEmitter, Output, Renderer2, ViewChil
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { EvaluationCycleModel, MyEvaluationCycleModel } from 'src/app/shared/model/evaluation-cycle.model'; import { EvaluationCycleModel, MyEvaluationCycleModel } from 'src/app/shared/model/evaluation-cycle.model';
import { EvaluationCycleService } from 'src/app/shared/services/evaluation-cycle.service'; import { EvaluationCycleService } from 'src/app/shared/services/evaluation-cycle.service';
import { PLService } from 'src/app/shared/services/pl.service';
import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model'; import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ColumnModel } from '@syncfusion/ej2-grids'; import { ColumnModel } from '@syncfusion/ej2-grids';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { JobcodeService } from 'src/app/shared/services/jobcode.service';
import { JobcodeModel, MyJobcodeModel } from 'src/app/shared/model/jobcode.model';
export interface DataModal { export interface DataModal {
search: string, search: string,
currentPage: number, currentPage: number,
...@@ -34,7 +35,7 @@ export class EvaluationCycleComponent { ...@@ -34,7 +35,7 @@ export class EvaluationCycleComponent {
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
modalStatus : 'createForm' | 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add' modalStatus: 'createForm' | 'add' | 'edit' | 'delete' | 'deleteGroup' = 'add'
evaluation_cyclelist: EvaluationCycleModel[] = [] evaluation_cyclelist: EvaluationCycleModel[] = []
evaluation_cycle: EvaluationCycleModel = new MyEvaluationCycleModel({}) evaluation_cycle: EvaluationCycleModel = new MyEvaluationCycleModel({})
dataLoading = false dataLoading = false
...@@ -57,7 +58,7 @@ export class EvaluationCycleComponent { ...@@ -57,7 +58,7 @@ export class EvaluationCycleComponent {
search: "", search: "",
pageSize: 10 pageSize: 10
} }
pl: { loading: boolean, selectIndex: number, dataList: PLModel[] } = { loading: false, selectIndex: -1, dataList: [] } pl: { loading: boolean, selectIndex: number, dataList: JobcodeModel[] } = { loading: false, selectIndex: -1, dataList: [] }
currentDate = new Date() currentDate = new Date()
yearList = [ yearList = [
(this.currentDate.getFullYear() - 1) + "", (this.currentDate.getFullYear() - 1) + "",
...@@ -110,7 +111,7 @@ export class EvaluationCycleComponent { ...@@ -110,7 +111,7 @@ export class EvaluationCycleComponent {
private toastr: ToastrService, private toastr: ToastrService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private renderer: Renderer2, private renderer: Renderer2,
private pLService: PLService, private jobcodeService: JobcodeService,
private dialog: MatDialog private dialog: MatDialog
) { } ) { }
...@@ -132,9 +133,9 @@ export class EvaluationCycleComponent { ...@@ -132,9 +133,9 @@ export class EvaluationCycleComponent {
getPlList() { getPlList() {
this.pl.loading = false this.pl.loading = false
this.pLService.getList().subscribe({ this.jobcodeService.getGroupAssessmentList().subscribe({
next: response => { next: response => {
this.pl.dataList = response.map((x: any) => new MyPLModel(x)) this.pl.dataList = response.map((x: any) => new MyJobcodeModel(x))
this.pl.loading = false this.pl.loading = false
this.searchChange() this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -146,22 +147,22 @@ export class EvaluationCycleComponent { ...@@ -146,22 +147,22 @@ export class EvaluationCycleComponent {
} }
plListFilter() { plListFilter() {
return this.pl.dataList.filter(x => return this.pl.dataList.filter(x =>
(x.plId.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) || (x.jobCodeId.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) ||
x.tdesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) || x.tdesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) ||
x.edesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase())) && x.edesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase())) &&
!this.evaluation_cycle.personalLevel.some(y => y.plId == x.plId) !this.evaluation_cycle.jd.some(y => y.jobCodeId == x.jobCodeId)
); );
} }
onPLModalSearchChange() { onPLModalSearchChange() {
this.PLsearchmodal.currentPage = 1 this.PLsearchmodal.currentPage = 1
this.PLsearchmodal.page = Array.from({ length: Math.ceil(this.plListFilter().length / 10) }, (_, i) => i + 1); this.PLsearchmodal.page = Array.from({ length: Math.ceil(this.plListFilter().length / 10) }, (_, i) => i + 1);
} }
selectPl(data?: PLModel) { selectPl(data?: JobcodeModel) {
if (!data) { if (!data) {
this.evaluation_cycle.personalLevel.splice(this.pl.selectIndex, 1); this.evaluation_cycle.jd.splice(this.pl.selectIndex, 1);
return; return;
} }
this.evaluation_cycle.personalLevel.push(new MyPLModel(data)) this.evaluation_cycle.jd.push(new MyJobcodeModel(data))
} }
getEvaluationCycleList() { getEvaluationCycleList() {
...@@ -220,9 +221,6 @@ export class EvaluationCycleComponent { ...@@ -220,9 +221,6 @@ export class EvaluationCycleComponent {
} else if (this.modalStatus == 'add') { } else if (this.modalStatus == 'add') {
this.evaluation_cycle = new MyEvaluationCycleModel(); this.evaluation_cycle = new MyEvaluationCycleModel();
this.evaluationRoundId = ''; this.evaluationRoundId = '';
} else if (this.modalStatus == 'edit') {
this.evaluation_cycle = new MyEvaluationCycleModel({ evaluationRoundId: this.evaluation_cycle.evaluationRoundId });
this.evaluationRoundId = this.evaluation_cycle.evaluationRoundId;
} }
} }
...@@ -452,7 +450,7 @@ export class EvaluationCycleComponent { ...@@ -452,7 +450,7 @@ export class EvaluationCycleComponent {
}); });
} }
}); });
} }
checkPrimary() { checkPrimary() {
......
...@@ -109,7 +109,6 @@ import { SettingPerformanceEvalutionComponent } from '../performance-management- ...@@ -109,7 +109,6 @@ import { SettingPerformanceEvalutionComponent } from '../performance-management-
import { AssessmentSystemConfigurationComponent } from '../performance-management-evaluation/setting-performance-evalution/assessment-system-configuration/assessment-system-configuration.component'; import { AssessmentSystemConfigurationComponent } from '../performance-management-evaluation/setting-performance-evalution/assessment-system-configuration/assessment-system-configuration.component';
import { SelfEvaluationComponent } from '../performance-evaluation/self-evaluation/self-evaluation.component'; import { SelfEvaluationComponent } from '../performance-evaluation/self-evaluation/self-evaluation.component';
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 { PmsEvalutionComponent } from '../performance-evaluation/pms-evaluation/pms-evalution.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';
...@@ -324,7 +323,6 @@ export class CustomDateAdapter extends NativeDateAdapter { ...@@ -324,7 +323,6 @@ export class CustomDateAdapter extends NativeDateAdapter {
AssessmentSystemConfigurationComponent, AssessmentSystemConfigurationComponent,
SelfEvaluationComponent, SelfEvaluationComponent,
CompanyRegistrationPageComponent, CompanyRegistrationPageComponent,
PmsEvalutionComponent,
ManageUserComponent, ManageUserComponent,
PmsGradeRegistrationComponent, PmsGradeRegistrationComponent,
PmsGradeManagementComponent, PmsGradeManagementComponent,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -150,10 +150,10 @@ ...@@ -150,10 +150,10 @@
style="border-radius:10px" style="border-radius:10px"
(mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)" (mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)"
(mouseleave)="biScore.clear()" (mouseleave)="biScore.clear()"
(click)="bi.competencyBehavioral.scoreTopicExpectation=item;calnumberCheck()" [ngClass]="{ (click)="bi.competencyBehavioral.scoreTopicExpectationBoss=item;calnumberCheck()" [ngClass]="{
'!border-secondary': bi.competencyBehavioral.scoreTopicExpectation>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item , '!border-secondary': bi.competencyBehavioral.scoreTopicExpectationBoss>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item ,
'!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectation>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item, '!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectationBoss>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item,
'!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectation==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item , '!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectationBoss==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item ,
'pointer-events-none':!canEdit}"> 'pointer-events-none':!canEdit}">
{{item}} {{item}}
</button> </button>
...@@ -164,11 +164,11 @@ ...@@ -164,11 +164,11 @@
style="border-radius:10px" style="border-radius:10px"
(mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)" (mouseenter)="biScore.set(bi.behavioralIndicators+bi.assessmentId,item)"
(mouseleave)="biScore.clear()" (mouseleave)="biScore.clear()"
(click)="bi.competencyBehavioral.scoreTopicExpectationEmp=item;bi.competencyBehavioral.scoreTopicExpectation=item;calnumberCheck()" (click)="bi.competencyBehavioral.scoreTopicExpectationBoss=item;bi.competencyBehavioral.scoreTopicExpectationBoss=item;calnumberCheck()"
[ngClass]="{ [ngClass]="{
'!border-secondary': bi.competencyBehavioral.scoreTopicExpectation>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item , '!border-secondary': bi.competencyBehavioral.scoreTopicExpectationBoss>=item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>=item ,
'!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectation>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item, '!text-indigo-600':bi.competencyBehavioral.scoreTopicExpectationBoss>item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)>item,
'!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectation==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item , '!text-white !bg-secondary': bi.competencyBehavioral.scoreTopicExpectationBoss==item||(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)==item ,
'pointer-events-none':!canEdit}"> 'pointer-events-none':!canEdit}">
{{item}} {{item}}
</button> </button>
...@@ -180,13 +180,13 @@ ...@@ -180,13 +180,13 @@
{{scoreDescriptions[(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)] }} {{scoreDescriptions[(biScore.get(bi.behavioralIndicators+bi.assessmentId) ?? 0)] }}
</span> </span>
<span *ngIf="!biScore.get(bi.behavioralIndicators+bi.assessmentId)" class="text-indigo-600"> <span *ngIf="!biScore.get(bi.behavioralIndicators+bi.assessmentId)" class="text-indigo-600">
{{scoreDescriptions[bi.competencyBehavioral.scoreTopicExpectation] }} {{scoreDescriptions[bi.competencyBehavioral.scoreTopicExpectationBoss] }}
</span> </span>
</div> </div>
</td> </td>
<ng-container *ngIf="evaluaterId!=evaluateeId&&!complete"> <ng-container *ngIf="evaluaterId!=evaluateeId&&!complete">
<td class="py-2 text-center text-indigo-600 font-semibold" style="vertical-align: top"> <td class="py-2 text-center text-indigo-600 font-semibold" style="vertical-align: top">
{{bi.competencyBehavioral.scoreTopicExpectationEmp}} {{bi.competencyBehavioral.scoreTopicExpectationBoss}}
</td> </td>
</ng-container> </ng-container>
</tr> </tr>
......
...@@ -322,7 +322,7 @@ export class PmsFormEmployeeComponent { ...@@ -322,7 +322,7 @@ export class PmsFormEmployeeComponent {
selectDataList(data: CompetencyModel) { selectDataList(data: CompetencyModel) {
this.compentency.originalData = this.deepClone(data) this.compentency.originalData = this.deepClone(data)
this.compentency.data = this.deepClone(data) this.compentency.data = this.deepClone(data)
this.complete = this.compentency.data?.statusAll == 'complete' this.complete = this.compentency.data?.statusType == 'complete'
this.cdr.detectChanges() this.cdr.detectChanges()
if (this.compentency.data) { if (this.compentency.data) {
this.currentTap = this.firstCurrentTap || "ข้อมูลการประเมิน" this.currentTap = this.firstCurrentTap || "ข้อมูลการประเมิน"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="grid grid-cols-6"> <div class="grid grid-cols-6">
<input type="text" class="ti-form-input !bg-input-readonly" readonly [(ngModel)]="pl.plId"> <input type="text" class="ti-form-input !bg-input-readonly" readonly [(ngModel)]="pl.jobCodeId">
</div> </div>
<div class="grid grid-cols-3 gap-6 mt-5"> <div class="grid grid-cols-3 gap-6 mt-5">
<div class="col-span-1"> <div class="col-span-1">
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { MyPLModel, PLModel } from 'src/app/shared/model/pl.model'; import { MyJobcodeModel, JobcodeModel } from 'src/app/shared/model/jobcode.model';
import { MyPLModel } from 'src/app/shared/model/pl.model';
import { MyPmsGroupAssessmentModel } from 'src/app/shared/model/pms-group-assessment.model'; import { MyPmsGroupAssessmentModel } from 'src/app/shared/model/pms-group-assessment.model';
import { MyPmsGroupAssessment1Model, PmsGroupAssessment1Model } from 'src/app/shared/model/pms-group-assessment1.model'; import { MyPmsGroupAssessment1Model, PmsGroupAssessment1Model } from 'src/app/shared/model/pms-group-assessment1.model';
import { MyPmstopicModel, PmstopicModel } from 'src/app/shared/model/pmstopic.model'; import { MyPmstopicModel, PmstopicModel } from 'src/app/shared/model/pmstopic.model';
...@@ -18,7 +19,7 @@ export interface DataModal { ...@@ -18,7 +19,7 @@ export interface DataModal {
}) })
export class EditEvaluationGroupingComponent { export class EditEvaluationGroupingComponent {
@Output() sendOnEdit: EventEmitter<boolean> = new EventEmitter<boolean>(); @Output() sendOnEdit: EventEmitter<boolean> = new EventEmitter<boolean>();
@Input() pl: PLModel = new MyPLModel() @Input() pl: JobcodeModel = new MyJobcodeModel()
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
search = "" search = ""
...@@ -83,7 +84,7 @@ export class EditEvaluationGroupingComponent { ...@@ -83,7 +84,7 @@ export class EditEvaluationGroupingComponent {
getPmsGroupAssessmentBy_plId() { getPmsGroupAssessmentBy_plId() {
this.pmsGroupAssessment.loading = true this.pmsGroupAssessment.loading = true
this.pmsGroupAssessmentService.getBy_plId(this.pl.plId).subscribe({ this.pmsGroupAssessmentService.getBy_plId(this.pl.jobCodeId).subscribe({
next: response => { next: response => {
this.pmsGroupAssessment.dataList = response.pmsGroupAssessment1List.map(x => ({ check: false, data: new MyPmsGroupAssessment1Model(x) })) this.pmsGroupAssessment.dataList = response.pmsGroupAssessment1List.map(x => ({ check: false, data: new MyPmsGroupAssessment1Model(x) }))
this.pmsGroupAssessment.dataList.sort((a, b) => a.data.pmsTopic.pmsTopicId.localeCompare(b.data.pmsTopic.pmsTopicId)) this.pmsGroupAssessment.dataList.sort((a, b) => a.data.pmsTopic.pmsTopicId.localeCompare(b.data.pmsTopic.pmsTopicId))
...@@ -137,7 +138,8 @@ export class EditEvaluationGroupingComponent { ...@@ -137,7 +138,8 @@ export class EditEvaluationGroupingComponent {
savePmsGroupAssessment() { savePmsGroupAssessment() {
const body = { const body = {
personalLevel: new MyPLModel(this.pl), personalLevel: new MyPLModel(),
jd: new MyJobcodeModel(this.pl),
companyId: "", companyId: "",
pmsGroupAssessment1List: this.pmsGroupAssessment.dataList.map(x => new MyPmsGroupAssessment1Model(x.data)) pmsGroupAssessment1List: this.pmsGroupAssessment.dataList.map(x => new MyPmsGroupAssessment1Model(x.data))
} }
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model';
import { FileService } from 'src/app/shared/services/file.service'; import { FileService } from 'src/app/shared/services/file.service';
import { PLService } from 'src/app/shared/services/pl.service'; import { PLService } from 'src/app/shared/services/pl.service';
import { ColumnModel } from '@syncfusion/ej2-grids'; import { ColumnModel } from '@syncfusion/ej2-grids';
import { JobcodeService } from 'src/app/shared/services/jobcode.service';
import { JobcodeModel, MyJobcodeModel } from 'src/app/shared/model/jobcode.model';
@Component({ @Component({
selector: 'app-evaluation-grouping', selector: 'app-evaluation-grouping',
...@@ -24,14 +25,14 @@ export class EvaluationGroupingComponent { ...@@ -24,14 +25,14 @@ export class EvaluationGroupingComponent {
selectedFileName: string = 'กรุณาเลือกไฟล์'; selectedFileName: string = 'กรุณาเลือกไฟล์';
columns: ColumnModel[] = [{ columns: ColumnModel[] = [{
field: "plId", field: "jobCodeId",
headerText: "รหัส", headerText: "รหัส",
type: "string", type: "string",
isPrimaryKey: true, isPrimaryKey: true,
}, },
{ {
field: "tdesc", field: "tdesc",
headerText: "ชื่อระดับพนักงาน (ไทย)", headerText: "ชื่อลักษณะงาน (ไทย)",
type: "string" type: "string"
}] }]
searchSettings = { searchSettings = {
...@@ -41,8 +42,8 @@ export class EvaluationGroupingComponent { ...@@ -41,8 +42,8 @@ export class EvaluationGroupingComponent {
}; };
selectedItems: { key: string, count: number, data: Map<string, boolean> } = { key: '', count: 0, data: new Map<string, boolean>() }; selectedItems: { key: string, count: number, data: Map<string, boolean> } = { key: '', count: 0, data: new Map<string, boolean>() };
pl: { loading: boolean, select: PLModel, dataList: PLModel [] } = { loading: false, select: new MyPLModel(), dataList: [] } pl: { loading: boolean, select: JobcodeModel, dataList: JobcodeModel [] } = { loading: false, select: new MyJobcodeModel(), dataList: [] }
constructor(private toastr: ToastrService, private plService: PLService, private cdr: ChangeDetectorRef, private fileService: FileService) { } constructor(private toastr: ToastrService, private jobcodeService: JobcodeService, private cdr: ChangeDetectorRef, private fileService: FileService) { }
ngOnInit(): void { ngOnInit(): void {
this.onSendPathTitle() this.onSendPathTitle()
this.getPLList() this.getPLList()
...@@ -97,10 +98,10 @@ export class EvaluationGroupingComponent { ...@@ -97,10 +98,10 @@ export class EvaluationGroupingComponent {
} }
getPLList() { getPLList() {
this.pl.loading = true this.pl.loading = true
this.plService.getList().subscribe({ this.jobcodeService.getGroupAssessmentList().subscribe({
next: response => { next: response => {
this.pl.dataList = response.map(x => { this.pl.dataList = response.map(x => {
return new MyPLModel(x) return new MyJobcodeModel(x)
}) })
this.pl.loading = false this.pl.loading = false
this.cdr.detectChanges(); this.cdr.detectChanges();
...@@ -114,17 +115,17 @@ export class EvaluationGroupingComponent { ...@@ -114,17 +115,17 @@ export class EvaluationGroupingComponent {
plListFilter() { plListFilter() {
return this.pl.dataList.filter(x => { return this.pl.dataList.filter(x => {
const data = x const data = x
const match = data.plId.toLowerCase().includes(this.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.search.toLowerCase()) const match = data.jobCodeId.toLowerCase().includes(this.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.search.toLowerCase())
return match; return match;
}); });
} }
selectPl(data?: PLModel) { selectPl(data?: JobcodeModel) {
if (data) { if (data) {
this.pl.select = new MyPLModel(data) this.pl.select = new MyJobcodeModel(data)
} else if (this.currentModal == 'add') { } else if (this.currentModal == 'add') {
this.pl.select = new MyPLModel() this.pl.select = new MyJobcodeModel()
} else if (this.currentModal == 'edit') { } else if (this.currentModal == 'edit') {
this.pl.select = new MyPLModel({ plId: this.pl.select.plId }) this.pl.select = new MyJobcodeModel({ jobCodeId: this.pl.select.jobCodeId })
} }
} }
searchChange() { searchChange() {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['รหัสแบบฟอร์ม','ชื่อพนักงาน','ตำแหน่ง','ระดับพนักงาน','การจัดการ']; let f = first; let l = last; let i = index"> *ngFor="let item of ['รหัสแบบฟอร์ม','ชื่อพนักงาน','ตำแหน่ง','ลักษณะงาน','การจัดการ']; let f = first; let l = last; let i = index">
<th scope="col" <th scope="col"
class="relative px-10px py-10px bg-soft-secondary text-primary !text-center"> class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
{{item.pmsMasfromEvaluationRound.pmsEvaluationRoundId}}</td> {{item.pmsMasfromEvaluationRound.pmsEvaluationRoundId}}</td>
<td>{{item.apsassessy.fname}} {{item.apsassessy.lname}}</td> <td>{{item.apsassessy.fname}} {{item.apsassessy.lname}}</td>
<td class="text-center">{{item.apsassessy.position.tdesc}}</td> <td class="text-center">{{item.apsassessy.position.tdesc}}</td>
<td class="text-center">{{item.personalLevel.tdesc}}</td> <td class="text-center">{{item.jd.tdesc}}</td>
<td class="flex justify-center items-center space-x-2"> <td class="flex justify-center items-center space-x-2">
<i class="ti ti-edit cursor-pointer i-gray fs-xl px-1" *ngIf="item.active" (click)="openAddRoundModel(item.pmsMasfromEvaluationRound.pmsEvaluationRoundId,item.apsassessy.employeeId,item,'form-pm-emp')" ></i> <i class="ti ti-edit cursor-pointer i-gray fs-xl px-1" *ngIf="item.active" (click)="openAddRoundModel(item.pmsMasfromEvaluationRound.pmsEvaluationRoundId,item.apsassessy.employeeId,item,'form-pm-emp')" ></i>
<input type="checkbox" id="hs-small-switch{{i+1}}" [(ngModel)]="item.active" (ngModelChange)="saveAssessmentOne(item)" <input type="checkbox" id="hs-small-switch{{i+1}}" [(ngModel)]="item.active" (ngModelChange)="saveAssessmentOne(item)"
......
...@@ -115,9 +115,10 @@ export class EditEvaluationFormComponent { ...@@ -115,9 +115,10 @@ export class EditEvaluationFormComponent {
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.pmsMasfromEvaluationRound.pmsEvaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) || x.pmsMasfromEvaluationRound.pmsEvaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase())|| x.apsassessy.employeeId.toLowerCase().includes(this.search.toLowerCase()) ||
x.apsassessy.position.tdesc.toLowerCase().includes(this.search.toLowerCase())|| x.apsassessy.position.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
x.personalLevel.tdesc.toLowerCase().includes(this.search.toLowerCase()) x.personalLevel.tdesc.toLowerCase().includes(this.search.toLowerCase()) ||
x.jd.tdesc.toLowerCase().includes(this.search.toLowerCase())
) )
} }
searchChange() { searchChange() {
...@@ -126,7 +127,7 @@ export class EditEvaluationFormComponent { ...@@ -126,7 +127,7 @@ export class EditEvaluationFormComponent {
this.page = Array.from({ length: Math.ceil(filteredData.length / this.pageSize) }, (_, i) => i + 1); this.page = Array.from({ length: Math.ceil(filteredData.length / this.pageSize) }, (_, i) => i + 1);
} }
saveAssessmentOne(item:PmsMasfromEvaluationFullModel) { saveAssessmentOne(item: PmsMasfromEvaluationFullModel) {
this.pmsEvaluationAssessmentService.post(item).subscribe({ this.pmsEvaluationAssessmentService.post(item).subscribe({
next: response => { next: response => {
if (response.success) { if (response.success) {
...@@ -135,7 +136,7 @@ export class EditEvaluationFormComponent { ...@@ -135,7 +136,7 @@ export class EditEvaluationFormComponent {
} }
} }
}) })
} }
saveAssessmentList() { saveAssessmentList() {
let body = this.assessmentList.filter(x => x.active == true) let body = this.assessmentList.filter(x => x.active == true)
if (body.length > 0) { if (body.length > 0) {
...@@ -177,7 +178,7 @@ export class EditEvaluationFormComponent { ...@@ -177,7 +178,7 @@ export class EditEvaluationFormComponent {
console.error('Error fetching evaluation cycles:', err); console.error('Error fetching evaluation cycles:', err);
} }
}) })
}else { } else {
this.showAlert('กรุณาเลือกรายการ', 'error'); this.showAlert('กรุณาเลือกรายการ', 'error');
} }
} }
......
...@@ -122,14 +122,14 @@ ...@@ -122,14 +122,14 @@
[(ngModel)]="pmsMasfromEvaluation.select.apsPeriodEnd" [ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}" [(ngModel)]="pmsMasfromEvaluation.select.apsPeriodEnd" [ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}"
[readonly]="modalStatus =='edit'"> [readonly]="modalStatus =='edit'">
<label for="input-label" class="ti-form-label mt-2rem">ระดับพนักงาน (JL)</label> <label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label>
<div *ngFor="let item of pmsMasfromEvaluation.select.personalLevel;let i = index;let f=first;let l = last" <div *ngFor="let item of pmsMasfromEvaluation.select.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
[ngClass]="{'input-list-f1': f&&!l, 'input-list-c1': !f&&!l, 'input-list-l1': !f&&l, 'input-list-fl1': f&&l,'!bg-input-readonly':modalStatus == 'edit'}" [ngClass]="{'input-list-f1': f&&!l, 'input-list-c1': !f&&!l, 'input-list-l1': !f&&l, 'input-list-fl1': f&&l,'!bg-input-readonly':modalStatus == 'edit'}"
[(ngModel)]="item.plId"> [(ngModel)]="item.jobCodeId">
<div <div
[ngClass]="{'input-list-line-f': f&&!l, 'input-list-line-c': !f&&!l, 'input-list-line-l': !f&&l, 'input-list-line-fl': f&&l}"> [ngClass]="{'input-list-line-f': f&&!l, 'input-list-line-c': !f&&!l, 'input-list-line-l': !f&&l, 'input-list-line-fl': f&&l}">
<div class="input-list-line"></div> <div class="input-list-line"></div>
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
[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.plId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500" <button *ngIf="item.jobCodeId && modalStatus !== 'edit'" type="button" class="flex items-center text-red-500"
(click)="pl.selectIndex=i;selectPl();"> (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>
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<ng-component *ngTemplateOutlet="plSearchButton"></ng-component> <ng-component *ngTemplateOutlet="plSearchButton"></ng-component>
</div> </div>
</div> </div>
<div class="grid grid-cols-2" *ngIf="!pmsMasfromEvaluation.select.personalLevel.length"> <div class="grid grid-cols-2" *ngIf="!pmsMasfromEvaluation.select.jd.length">
<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 input-list-fl1 pointer-events-none" readonly> <input type="text" class="ti-form-input input-list-fl1 pointer-events-none" readonly>
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
<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>
<span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JL ระบบจะทำการเลือกทั้งหมด</span> <span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JD ระบบจะทำการเลือกทั้งหมด</span>
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button type="button" mat-button [mat-dialog-close] <button type="button" mat-button [mat-dialog-close]
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<ng-template #PLModal let-modal> <ng-template #PLModal let-modal>
<h3 mat-dialog-title> <h3 mat-dialog-title>
ข้อมูลระดับพนักงาน (JL) ข้อมูลลักษณะงาน (JD)
</h3> </h3>
<mat-dialog-content> <mat-dialog-content>
<div class="flex justify-end pb-1rem"> <div class="flex justify-end pb-1rem">
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['ลำดับ','รหัสระดับพนักงาน (JL)','รายละเอียดฝ่าย (ไทย)','รายละเอียดฝ่าย (อังกฤษ)']; let f = first; let l = last"> *ngFor="let item of ['ลำดับ','รหัสลักษณะงาน (JD)','รายละเอียดฝ่าย (ไทย)','รายละเอียดฝ่าย (อังกฤษ)']; let f = first; let l = last">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" [class.!text-center]="f"> <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary" [class.!text-center]="f">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l"> <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
<td class="flex justify-center"> <td class="flex justify-center">
{{((PLsearchmodal.currentPage-1) * PLsearchmodal.pageSize)+(i+1)}} {{((PLsearchmodal.currentPage-1) * PLsearchmodal.pageSize)+(i+1)}}
</td> </td>
<td>{{item.plId}}</td> <td>{{item.jobCodeId}}</td>
<td>{{item.tdesc}}</td> <td>{{item.tdesc}}</td>
<td>{{item.edesc}}</td> <td>{{item.edesc}}</td>
</tr> </tr>
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
<label for="input-label" class="ti-form-label mt-2rem">สิ้นสุดวันที่<span class="text-danger">*</span></label> <label for="input-label" class="ti-form-label mt-2rem">สิ้นสุดวันที่<span class="text-danger">*</span></label>
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="pmsMasfromEvaluation.apsPeriodEnd" [ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}" [readonly]="modalStatus =='edit'"> <input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="pmsMasfromEvaluation.apsPeriodEnd" [ngClass]="{'!bg-input-readonly': modalStatus == 'edit'}" [readonly]="modalStatus =='edit'">
<label for="input-label" class="ti-form-label mt-2rem">ระดับพนักงาน (JL)</label> <label for="input-label" class="ti-form-label mt-2rem">ลักษณะงาน (JD)</label>
<div *ngFor="let item of pmsMasfromEvaluation.personalLevel;let i = index;let f=first;let l = last" <div *ngFor="let item of pmsMasfromEvaluation.personalLevel;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">
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
<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>
<span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JL ระบบจะทำการเลือกทั้งหมด</span> <span class="text-danger mt-1">**หมายเหตุ ถ้าไม่เลือกระดับ JD ระบบจะทำการเลือกทั้งหมด</span>
<div class="flex justify-end mt-2rem mb-1rem"> <div class="flex justify-end mt-2rem mb-1rem">
<button type="button" <button type="button"
...@@ -643,7 +643,7 @@ ...@@ -643,7 +643,7 @@
<div class="max-h-full overflow-hidden ti-modal-content"> <div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header"> <div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary"> <h3 class="text-xxl font-bold text-primary">
ข้อมูลระดับพนักงาน (JL) ข้อมูลลักษณะงาน (JD)
</h3> </h3>
<div class="flex justify-end"> <div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger" <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['ลำดับ','รหัสระดับพนักงาน (JL)','รายละเอียดฝ่าย(ไทย)','รายละเอียดฝ่าย(อังกฤษ)']; let f = first; let l = last"> *ngFor="let item of ['ลำดับ','รหัสลักษณะงาน (JD)','รายละเอียดฝ่าย(ไทย)','รายละเอียดฝ่าย(อังกฤษ)']; 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"> [class.!text-center]="f">
<span class="text-sm">{{ item }}</span> <span class="text-sm">{{ item }}</span>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core';
import { ToastrService } from 'ngx-toastr'; import { ToastrService } from 'ngx-toastr';
import { PLModel, MyPLModel } from 'src/app/shared/model/pl.model';
import { MyPmsMasfromEvaluationModel, PmsMasfromEvaluationModel } from 'src/app/shared/model/pms-masfrom-evaluation.model'; import { MyPmsMasfromEvaluationModel, PmsMasfromEvaluationModel } from 'src/app/shared/model/pms-masfrom-evaluation.model';
import { PLService } from 'src/app/shared/services/pl.service';
import { PmsMasfromEvaluationCycleService } from 'src/app/shared/services/pms-masfrom-evaluation.service'; import { PmsMasfromEvaluationCycleService } from 'src/app/shared/services/pms-masfrom-evaluation.service';
import { ColumnModel } from '@syncfusion/ej2-grids'; import { ColumnModel } from '@syncfusion/ej2-grids';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { JobcodeService } from 'src/app/shared/services/jobcode.service';
import { JobcodeModel, MyJobcodeModel } from 'src/app/shared/model/jobcode.model';
export interface DataModal { export interface DataModal {
search: string, search: string,
...@@ -58,7 +58,7 @@ export class ManagementCycleComponent { ...@@ -58,7 +58,7 @@ export class ManagementCycleComponent {
search: "", search: "",
pageSize: 10 pageSize: 10
} }
pl: { loading: boolean, selectIndex: number, dataList: PLModel[] } = { loading: false, selectIndex: -1, dataList: [] } pl: { loading: boolean, selectIndex: number, dataList: JobcodeModel[] } = { loading: false, selectIndex: -1, dataList: [] }
currentDate = new Date() currentDate = new Date()
yearList = [ yearList = [
...@@ -117,7 +117,7 @@ export class ManagementCycleComponent { ...@@ -117,7 +117,7 @@ export class ManagementCycleComponent {
private dialog: MatDialog, private dialog: MatDialog,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private renderer: Renderer2, private renderer: Renderer2,
private pLService: PLService private jobcodeService: JobcodeService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
...@@ -137,9 +137,9 @@ export class ManagementCycleComponent { ...@@ -137,9 +137,9 @@ export class ManagementCycleComponent {
getPlList() { getPlList() {
this.pl.loading = false this.pl.loading = false
this.pLService.getList().subscribe({ this.jobcodeService.getGroupAssessmentList().subscribe({
next: response => { next: response => {
this.pl.dataList = response.map((x: any) => new MyPLModel(x)) this.pl.dataList = response.map((x: any) => new MyJobcodeModel(x))
this.pl.loading = false this.pl.loading = false
// this.searchChange() // this.searchChange()
this.cdr.detectChanges() this.cdr.detectChanges()
...@@ -151,10 +151,10 @@ export class ManagementCycleComponent { ...@@ -151,10 +151,10 @@ export class ManagementCycleComponent {
} }
plListFilter() { plListFilter() {
return this.pl.dataList.filter(x => return this.pl.dataList.filter(x =>
(x.plId.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) || (x.jobCodeId.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) ||
x.tdesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) || x.tdesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase()) ||
x.edesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase())) && x.edesc.toLowerCase().includes(this.PLsearchmodal.search.toLowerCase())) &&
!this.pmsMasfromEvaluation.select.personalLevel.some(y => y.plId == x.plId) !this.pmsMasfromEvaluation.select.jd.some(y => y.jobCodeId == x.jobCodeId)
); );
} }
...@@ -162,12 +162,12 @@ export class ManagementCycleComponent { ...@@ -162,12 +162,12 @@ export class ManagementCycleComponent {
this.PLsearchmodal.currentPage = 1 this.PLsearchmodal.currentPage = 1
this.PLsearchmodal.page = Array.from({ length: Math.ceil(this.plListFilter().length / 10) }, (_, i) => i + 1); this.PLsearchmodal.page = Array.from({ length: Math.ceil(this.plListFilter().length / 10) }, (_, i) => i + 1);
} }
selectPl(data?: PLModel) { selectPl(data?: JobcodeModel) {
if (!data) { if (!data) {
this.pmsMasfromEvaluation.select.personalLevel.splice(this.pl.selectIndex, 1); this.pmsMasfromEvaluation.select.jd.splice(this.pl.selectIndex, 1);
return; return;
} }
this.pmsMasfromEvaluation.select.personalLevel.push(new MyPLModel(data)) this.pmsMasfromEvaluation.select.jd.push(new MyJobcodeModel(data))
} }
...@@ -198,7 +198,7 @@ export class ManagementCycleComponent { ...@@ -198,7 +198,7 @@ export class ManagementCycleComponent {
} else if (this.modalStatus == 'add') { } else if (this.modalStatus == 'add') {
this.pmsMasfromEvaluation.select = new MyPmsMasfromEvaluationModel() this.pmsMasfromEvaluation.select = new MyPmsMasfromEvaluationModel()
} else if (this.modalStatus == 'edit') { } else if (this.modalStatus == 'edit') {
this.pmsMasfromEvaluation.select = new MyPmsMasfromEvaluationModel({ pmsEvaluationRoundId: this.pmsMasfromEvaluation.select.pmsEvaluationRoundId }) this.pmsMasfromEvaluation.select = new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select)
} }
} }
...@@ -217,7 +217,7 @@ export class ManagementCycleComponent { ...@@ -217,7 +217,7 @@ export class ManagementCycleComponent {
reverseButtons: true, reverseButtons: true,
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
if (this.pmsMasfromEvaluation.select.personalLevel.length === 0) { if (this.pmsMasfromEvaluation.select.jd.length === 0) {
this.plListFilter().forEach(x => this.selectPl(x)); this.plListFilter().forEach(x => this.selectPl(x));
} }
const body = new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select); const body = new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select);
...@@ -299,7 +299,7 @@ export class ManagementCycleComponent { ...@@ -299,7 +299,7 @@ export class ManagementCycleComponent {
if (this.modalStatus == 'add') { if (this.modalStatus == 'add') {
this.setData() this.setData()
} else if (this.modalStatus == 'edit') { } else if (this.modalStatus == 'edit') {
this.setData(new MyPmsMasfromEvaluationModel({ pmsEvaluationRoundId: this.pmsMasfromEvaluation.select.pmsEvaluationRoundId })) this.setData(new MyPmsMasfromEvaluationModel(this.pmsMasfromEvaluation.select))
} }
} }
......
import { AppraisalFormModel, MyAppraisalFormModel } from "./appraisal-form.model" import { AppraisalFormModel, MyAppraisalFormModel } from "./appraisal-form.model"
import { EmployeeModel, MyEmployeeModel } from "./employee.model" import { EmployeeModel, MyEmployeeModel } from "./employee.model"
import { EvaluationCycleModel, MyEvaluationCycleModel } from "./evaluation-cycle.model" import { EvaluationCycleModel, MyEvaluationCycleModel } from "./evaluation-cycle.model"
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model"
import { MyPLModel, PLModel } from "./pl.model" import { MyPLModel, PLModel } from "./pl.model"
export interface AppraisalModel { export interface AppraisalModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
masfromEvaluationRound: EvaluationCycleModel masfromEvaluationRound: EvaluationCycleModel
companyId: string companyId: string
active: boolean active: boolean
...@@ -19,6 +21,7 @@ export interface AppraisalModel { ...@@ -19,6 +21,7 @@ export interface AppraisalModel {
} }
export class MyAppraisalModel implements AppraisalModel { export class MyAppraisalModel implements AppraisalModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
masfromEvaluationRound: EvaluationCycleModel masfromEvaluationRound: EvaluationCycleModel
companyId: string companyId: string
active: boolean active: boolean
...@@ -32,6 +35,7 @@ export class MyAppraisalModel implements AppraisalModel { ...@@ -32,6 +35,7 @@ export class MyAppraisalModel implements AppraisalModel {
masfromEvaluationAssessment1: AppraisalFormModel[] masfromEvaluationAssessment1: AppraisalFormModel[]
constructor(data?: Partial<AppraisalModel>) { constructor(data?: Partial<AppraisalModel>) {
this.personalLevel = new MyPLModel(data?.personalLevel) this.personalLevel = new MyPLModel(data?.personalLevel)
this.jd = new MyJobcodeModel(data?.jd)
this.masfromEvaluationRound = new MyEvaluationCycleModel(data?.masfromEvaluationRound) this.masfromEvaluationRound = new MyEvaluationCycleModel(data?.masfromEvaluationRound)
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.active = data?.active ?? false this.active = data?.active ?? false
......
...@@ -2,7 +2,6 @@ export interface CompetencyModel { ...@@ -2,7 +2,6 @@ export interface CompetencyModel {
competency: Competency[] competency: Competency[]
idp: Idp idp: Idp
pms: Pms pms: Pms
statusAll: string
evaluationRoundId: string evaluationRoundId: string
tdesc: string tdesc: string
edesc: string edesc: string
...@@ -875,8 +874,8 @@ export interface BehavioralIndicatorsList { ...@@ -875,8 +874,8 @@ export interface BehavioralIndicatorsList {
} }
export interface CompetencyBehavioral { export interface CompetencyBehavioral {
scoreTopicExpectationBoss: number
scoreTopicExpectation: number scoreTopicExpectation: number
scoreTopicExpectationEmp: number
companyId: string companyId: string
} }
......
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model";
import { MyPLModel, PLModel } from "./pl.model"; import { MyPLModel, PLModel } from "./pl.model";
import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model"; import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model";
import { MyStatusFromModel, StatusFromModel } from "./status-from.model"; import { MyStatusFromModel, StatusFromModel } from "./status-from.model";
...@@ -13,6 +15,7 @@ export interface EvaluationCycleModel { ...@@ -13,6 +15,7 @@ export interface EvaluationCycleModel {
statusCode: StatusCodeModel statusCode: StatusCodeModel
statusFrom: StatusFromModel statusFrom: StatusFromModel
personalLevel: PLModel[] personalLevel: PLModel[]
jd: JobcodeModel[]
jlId: string jlId: string
active: number active: number
} }
...@@ -28,6 +31,7 @@ export class MyEvaluationCycleModel implements EvaluationCycleModel { ...@@ -28,6 +31,7 @@ export class MyEvaluationCycleModel implements EvaluationCycleModel {
statusCode: StatusCodeModel statusCode: StatusCodeModel
statusFrom: StatusFromModel statusFrom: StatusFromModel
personalLevel: PLModel[] personalLevel: PLModel[]
jd: JobcodeModel[]
jlId: string jlId: string
active: number active: number
constructor(data?: Partial<EvaluationCycleModel>) { constructor(data?: Partial<EvaluationCycleModel>) {
...@@ -43,6 +47,7 @@ export class MyEvaluationCycleModel implements EvaluationCycleModel { ...@@ -43,6 +47,7 @@ export class MyEvaluationCycleModel implements EvaluationCycleModel {
this.statusCode = new MyStatusCodeModel(data?.statusCode || {}) this.statusCode = new MyStatusCodeModel(data?.statusCode || {})
this.statusFrom = new MyStatusFromModel(data?.statusFrom || {}) this.statusFrom = new MyStatusFromModel(data?.statusFrom || {})
this.personalLevel = data?.personalLevel?.map(x => new MyPLModel(x)) || [] this.personalLevel = data?.personalLevel?.map(x => new MyPLModel(x)) || []
this.jd = data?.jd?.map(x => new MyJobcodeModel(x)) || []
} }
} }
import { EmployeeModel, MyEmployeeModel } from "./employee.model"; import { EmployeeModel, MyEmployeeModel } from "./employee.model";
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model";
import { MyPLModel, PLModel } from "./pl.model"; import { MyPLModel, PLModel } from "./pl.model";
export interface GroupApproveModel { export interface GroupApproveModel {
personalLevel: PLModel; personalLevel: PLModel;
jd: JobcodeModel;
apsassessy: EmployeeModel; apsassessy: EmployeeModel;
companyId: string; companyId: string;
apsapprove1: EmployeeModel; apsapprove1: EmployeeModel;
...@@ -16,6 +18,7 @@ export interface GroupApproveModel { ...@@ -16,6 +18,7 @@ export interface GroupApproveModel {
export class MyGroupApproveModel implements GroupApproveModel { export class MyGroupApproveModel implements GroupApproveModel {
personalLevel: PLModel; personalLevel: PLModel;
jd: JobcodeModel;
apsassessy: EmployeeModel apsassessy: EmployeeModel
companyId: string; companyId: string;
apsapprove1: EmployeeModel; apsapprove1: EmployeeModel;
...@@ -25,6 +28,7 @@ export class MyGroupApproveModel implements GroupApproveModel { ...@@ -25,6 +28,7 @@ export class MyGroupApproveModel implements GroupApproveModel {
apsapprove5: EmployeeModel; apsapprove5: EmployeeModel;
constructor(data: Partial<GroupApproveModel> = {}) { constructor(data: Partial<GroupApproveModel> = {}) {
this.personalLevel = new MyPLModel(data.personalLevel || {}); this.personalLevel = new MyPLModel(data.personalLevel || {});
this.jd = new MyJobcodeModel(data.jd || {});
this.apsassessy = new MyEmployeeModel(data.apsassessy || {}) this.apsassessy = new MyEmployeeModel(data.apsassessy || {})
this.companyId = data.companyId || ''; this.companyId = data.companyId || '';
this.apsapprove1 = new MyEmployeeModel(data.apsapprove1 || {}); this.apsapprove1 = new MyEmployeeModel(data.apsapprove1 || {});
......
import { GroupAssessment1ListModel, MyGroupAssessment1ListModel } from "./group-assessment1-list.model" import { GroupAssessment1ListModel, MyGroupAssessment1ListModel } from "./group-assessment1-list.model"
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model"
import { MyPLModel, PLModel } from "./pl.model" import { MyPLModel, PLModel } from "./pl.model"
export interface GroupAssessmentModel { export interface GroupAssessmentModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
companyId: string companyId: string
groupAssessment1List: GroupAssessment1ListModel[] groupAssessment1List: GroupAssessment1ListModel[]
} }
...@@ -10,10 +12,12 @@ export interface GroupAssessmentModel { ...@@ -10,10 +12,12 @@ export interface GroupAssessmentModel {
export class MyGroupAssessmentModel implements GroupAssessmentModel { export class MyGroupAssessmentModel implements GroupAssessmentModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
companyId: string companyId: string
groupAssessment1List: GroupAssessment1ListModel[] groupAssessment1List: GroupAssessment1ListModel[]
constructor(data?: Partial<GroupAssessmentModel>) { constructor(data?: Partial<GroupAssessmentModel>) {
this.personalLevel = new MyPLModel(data?.personalLevel || {}) this.personalLevel = new MyPLModel(data?.personalLevel || {})
this.jd = new MyJobcodeModel(data?.jd || {})
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.groupAssessment1List = data?.groupAssessment1List?.map(x => new MyGroupAssessment1ListModel(x)) || [] this.groupAssessment1List = data?.groupAssessment1List?.map(x => new MyGroupAssessment1ListModel(x)) || []
} }
......
...@@ -3,12 +3,15 @@ import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1Mi ...@@ -3,12 +3,15 @@ import { CompetencyIndicatorsCourses1MiniModel, MyCompetencyIndicatorsCourses1Mi
export interface GroupAssessment1ListModel { export interface GroupAssessment1ListModel {
competencyIndicatorsCourses1Mini: CompetencyIndicatorsCourses1MiniModel competencyIndicatorsCourses1Mini: CompetencyIndicatorsCourses1MiniModel
companyId: string companyId: string
jlId: string
} }
export class MyGroupAssessment1ListModel implements GroupAssessment1ListModel { export class MyGroupAssessment1ListModel implements GroupAssessment1ListModel {
competencyIndicatorsCourses1Mini: CompetencyIndicatorsCourses1MiniModel competencyIndicatorsCourses1Mini: CompetencyIndicatorsCourses1MiniModel
companyId: string companyId: string
jlId: string
constructor(data?: Partial<GroupAssessment1ListModel>) { constructor(data?: Partial<GroupAssessment1ListModel>) {
this.competencyIndicatorsCourses1Mini = new MyCompetencyIndicatorsCourses1MiniModel(data?.competencyIndicatorsCourses1Mini || {}) this.competencyIndicatorsCourses1Mini = new MyCompetencyIndicatorsCourses1MiniModel(data?.competencyIndicatorsCourses1Mini || {})
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.jlId = data?.jlId || ""
} }
} }
export interface JobcodeModel {
jobCodeId: string
tdesc: string
edesc: string
companyId: string
statusCom: boolean
statusPms: boolean
}
export class MyJobcodeModel implements JobcodeModel {
jobCodeId: string
tdesc: string
edesc: string
companyId: string
statusCom: boolean
statusPms: boolean
constructor(data?: Partial<JobcodeModel>) {
this.jobCodeId = data?.jobCodeId || ""
this.tdesc = data?.tdesc || ""
this.edesc = data?.edesc || ""
this.companyId = data?.companyId || ""
this.statusCom = data?.statusCom ?? false
this.statusPms = data?.statusPms ?? false
}
}
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model"
import { MyPLModel, PLModel } from "./pl.model" import { MyPLModel, PLModel } from "./pl.model"
import { MyPmsGroupAssessment1Model, PmsGroupAssessment1Model } from "./pms-group-assessment1.model" import { MyPmsGroupAssessment1Model, PmsGroupAssessment1Model } from "./pms-group-assessment1.model"
export interface PmsGroupAssessmentModel { export interface PmsGroupAssessmentModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
companyId: string companyId: string
pmsGroupAssessment1List: PmsGroupAssessment1Model[] pmsGroupAssessment1List: PmsGroupAssessment1Model[]
} }
...@@ -10,10 +12,12 @@ export interface PmsGroupAssessmentModel { ...@@ -10,10 +12,12 @@ export interface PmsGroupAssessmentModel {
export class MyPmsGroupAssessmentModel implements PmsGroupAssessmentModel { export class MyPmsGroupAssessmentModel implements PmsGroupAssessmentModel {
personalLevel: PLModel personalLevel: PLModel
jd: JobcodeModel
companyId: string companyId: string
pmsGroupAssessment1List: PmsGroupAssessment1Model[] pmsGroupAssessment1List: PmsGroupAssessment1Model[]
constructor(data?: Partial<PmsGroupAssessmentModel>) { constructor(data?: Partial<PmsGroupAssessmentModel>) {
this.personalLevel = new MyPLModel(data?.personalLevel) this.personalLevel = new MyPLModel(data?.personalLevel)
this.jd = new MyJobcodeModel(data?.jd)
this.companyId = data?.companyId || "" this.companyId = data?.companyId || ""
this.pmsGroupAssessment1List = data?.pmsGroupAssessment1List?.map(x => new MyPmsGroupAssessment1Model(x)) || [] this.pmsGroupAssessment1List = data?.pmsGroupAssessment1List?.map(x => new MyPmsGroupAssessment1Model(x)) || []
} }
......
import { JobcodeModel } from "./jobcode.model"
export interface PmsMasfromEvaluationFullModel { export interface PmsMasfromEvaluationFullModel {
personalLevel: PersonalLevel personalLevel: PersonalLevel
jd: JobcodeModel
pmsMasfromEvaluationRound: PmsMasfromEvaluationRoundModel pmsMasfromEvaluationRound: PmsMasfromEvaluationRoundModel
companyId?: string companyId?: string
active?: boolean active?: boolean
......
import { JobcodeModel, MyJobcodeModel } from "./jobcode.model";
import { PLModel, MyPLModel } from "./pl.model"; import { PLModel, MyPLModel } from "./pl.model";
import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model"; import { MyStatusCodeModel, StatusCodeModel } from "./status-code.model";
import { MyStatusFromModel, StatusFromModel } from "./status-from.model"; import { MyStatusFromModel, StatusFromModel } from "./status-from.model";
...@@ -14,6 +15,7 @@ export interface PmsMasfromEvaluationModel { ...@@ -14,6 +15,7 @@ export interface PmsMasfromEvaluationModel {
statusFrom: StatusFromModel statusFrom: StatusFromModel
active: number active: number
personalLevel: PLModel[] personalLevel: PLModel[]
jd: JobcodeModel[]
} }
export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel { export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel {
...@@ -28,6 +30,7 @@ export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel { ...@@ -28,6 +30,7 @@ export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel {
statusFrom: StatusFromModel statusFrom: StatusFromModel
active: number active: number
personalLevel: PLModel[] personalLevel: PLModel[]
jd: JobcodeModel[]
constructor(data?: Partial<PmsMasfromEvaluationModel>) { constructor(data?: Partial<PmsMasfromEvaluationModel>) {
this.pmsEvaluationRoundId = data?.pmsEvaluationRoundId || ""; this.pmsEvaluationRoundId = data?.pmsEvaluationRoundId || "";
this.companyId = data?.companyId || ""; this.companyId = data?.companyId || "";
...@@ -40,6 +43,7 @@ export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel { ...@@ -40,6 +43,7 @@ export class MyPmsMasfromEvaluationModel implements PmsMasfromEvaluationModel {
this.statusCode = new MyStatusCodeModel(data?.statusCode) this.statusCode = new MyStatusCodeModel(data?.statusCode)
this.statusFrom = new MyStatusFromModel(data?.statusFrom || {}) this.statusFrom = new MyStatusFromModel(data?.statusFrom || {})
this.personalLevel = data?.personalLevel?.map(x => new MyPLModel(x)) || [] this.personalLevel = data?.personalLevel?.map(x => new MyPLModel(x)) || []
this.jd = data?.jd?.map(x => new MyJobcodeModel(x)) || []
} }
} }
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 { JobcodeModel } from '../model/jobcode.model';
@Injectable({
providedIn: 'root'
})
export class JobcodeService {
api = "/jobcode"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getById(plId: string): Observable<JobcodeModel> {
return this.http.get<JobcodeModel>(this.urlApi + "/" + plId)
}
getList(): Observable<JobcodeModel[]> {
return this.http.get<JobcodeModel[]>(this.urlApi + "/lists")
}
getGroupAssessmentList(): Observable<JobcodeModel[]> {
return this.http.get<JobcodeModel[]>(this.urlApi + "/group-assessment/lists")
}
post(body: JobcodeModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: JobcodeModel | JobcodeModel[]): 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
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