Commit 6fdd5cec by Nattana Chaiyamat

JD (ข้อมูลทั่วไป) : เพิ่มตัวเลือกเก็บข้อมูล และแก้ไขตัวเลือกตำแหน่งผู้บังคับบัญชา

parent d552254c
......@@ -148,28 +148,28 @@
</ng-select>
<label for="detail_eng" class="ti-form-label mt-2rem">ตำแหน่งผู้บังคับบัญชา</label>
<ng-select class="ti-form-select" data-trigger name="choices-single-position"
id="choices-single-position" [(ngModel)]="jd" (ngModelChange)="changSupervisorJd()">
<ng-select class="ti-form-select" data-trigger name="choices-single-supervisorJobCode"
id="choices-single-supervisorJobCode" [(ngModel)]="jd" (ngModelChange)="changSupervisorJobCode()">
<ng-option *ngFor="let item of jdList" [value]="item.jobCodeId">{{item.tdesc}}</ng-option>
</ng-select>
<label for="detail_eng" class="ti-form-label mt-2rem">ระดับพนักงาน</label>
<ng-select class="ti-form-select" data-trigger name="choices-single-position"
id="choices-single-position" [(ngModel)]="jl" (ngModelChange)="changJl()">
<ng-select class="ti-form-select" data-trigger name="choices-single-jl"
id="choices-single-jl" [(ngModel)]="jl" (ngModelChange)="changJl()">
<ng-option *ngFor="let item of jlList" [value]="item.plId">{{item.tdesc}}</ng-option>
</ng-select>
<label for="detail_eng" class="ti-form-label mt-2rem">ระดับความคาดหวัง</label>
<ng-select class="ti-form-select" data-trigger name="choices-single-position"
id="choices-single-position" [(ngModel)]="empLevel" (ngModelChange)="changEmpLevel()">
<ng-option *ngFor="let item of ['1','2','3','4','5']" [value]="item">{{item}}</ng-option>
<ng-select class="ti-form-select" data-trigger name="choices-single-expectation"
id="choices-single-expectation" [(ngModel)]="expectation" (ngModelChange)="changExpectation()">
<ng-option *ngFor="let item of [1,2,3,4,5]" [value]="item">{{item}}</ng-option>
</ng-select>
<label for="detail_eng" class="ti-form-label mt-2rem">วัตถุประสงค์ของตำแหน่งงาน (Objective)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="selectJob.jobObjective">
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
<button type="button" (click)="save()"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay="#sub-job-competency-component-modal-edit">
ย้อนกลับ
......
......@@ -9,7 +9,7 @@ import { Bu5Model, MyBu5Model } from 'src/app/shared/model/bu5.model';
import { Bu6Model, MyBu6Model } from 'src/app/shared/model/bu6.model';
import { Bu7Model, MyBu7Model } from 'src/app/shared/model/bu7.model';
import { EmployeeModel, MyEmployeeModel } from 'src/app/shared/model/employee.model';
import { JobCodeModel, MyJobCodeModel } from 'src/app/shared/model/job-code.model';
import { JobCodeModel, MyJlModel, MyJobCodeModel, MySupervisorJobCodeModel } from 'src/app/shared/model/job-code.model';
import { JobcodeModel, MyJobcodeModel } from 'src/app/shared/model/jobcode.model';
import { MyPLModel, PLModel } from 'src/app/shared/model/pl.model';
import { MyPositionModel, PositionModel } from 'src/app/shared/model/position.model';
......@@ -75,7 +75,7 @@ export class ImportDataComponent {
jlList: PLModel[] = []
jl = ''
empLevel = ''
expectation: number | null = null
currentModal: 'add' | 'edit' | 'delete' = "add"
columns: ColumnModel[] = [{
......@@ -192,7 +192,9 @@ export class ImportDataComponent {
this.selectJob = new MyJobCodeModel(item)
this.positionId = item.position.positionId
this.jd = item.supervisorPosition.positionId
this.jd = item.supervisorJobCode.jobCodeId
this.jl = item.jl.plId
this.expectation = item.expectation
this.bu1Id = item.bu1.bu1id
this.bu2Id = item.bu2.bu2id
this.bu3Id = item.bu3.bu3id
......@@ -206,6 +208,8 @@ export class ImportDataComponent {
this.checkJobCodeId = false
this.positionId = ''
this.jd = ''
this.jl = ''
this.expectation = null
this.bu1Id = ''
this.bu2Id = ''
this.bu3Id = ''
......@@ -219,9 +223,15 @@ export class ImportDataComponent {
clearValue() {
this.selectJob.jobObjective = ''
this.selectJob.supervisorPosition = new MyPositionModel({})
this.selectJob.supervisorJobCode = new MySupervisorJobCodeModel({})
this.jd = ''
this.selectJob.jl = new MyJlModel({})
this.jl = ''
this.selectJob.expectation = null
this.expectation = null
this.selectJob.position = new MyPositionModel({})
this.positionId = ''
......@@ -251,6 +261,7 @@ export class ImportDataComponent {
if (response.success) {
this.showAlert(response.message, 'success')
this.selectJob = new MyJobCodeModel({})
this.search = ''
this.getListJob();
} else {
this.showAlert(response.message, 'error')
......@@ -346,24 +357,24 @@ export class ImportDataComponent {
this.selectJob.position = new MyPositionModel({})
}
}
changSupervisorJd() {
changSupervisorJobCode() {
let value = this.jdList.find(x => x.jobCodeId == this.jd);
if (value) {
// this.selectJob.supervisorJD = value
this.selectJob.supervisorJobCode = value
} else {
// this.selectJob.supervisorJD = new MyJobcodeModel({})
this.selectJob.supervisorJobCode = new MySupervisorJobCodeModel()
}
}
changJl() {
let value = this.jlList.find(x => x.plId == this.jd);
if (value) {
// this.selectJob.supervisorJD = value
this.selectJob.jl = value
} else {
// this.selectJob.supervisorJD = new MyJobcodeModel({})
this.selectJob.jl = new MyJlModel()
}
}
changEmpLevel() {
// this.selectJob.supervisorJD = this.empLevel
changExpectation() {
this.selectJob.expectation = this.expectation
}
getBu1List() {
......
......@@ -34,7 +34,6 @@ export interface JobCodeModel {
jobObjective: string
supervisor: string
competencyWorkText: string
supervisorPosition:PositionModel
serviceWorkText: string
serviceWorkPercent: number
responsibleWorkText: string
......@@ -50,6 +49,9 @@ export interface JobCodeModel {
cerLicensedText: string
especiallyTrainingText: string
otherAbilitiesText: string
jl: JlModel
supervisorJobCode: SupervisorJobCodeModel
expectation: number | null
}
export class MyJobCodeModel implements JobCodeModel {
......@@ -78,7 +80,6 @@ export class MyJobCodeModel implements JobCodeModel {
jobObjective: string
supervisor: string
competencyWorkText: string
supervisorPosition:PositionModel
serviceWorkText: string
serviceWorkPercent: number
responsibleWorkText: string
......@@ -94,6 +95,9 @@ export class MyJobCodeModel implements JobCodeModel {
cerLicensedText: string
especiallyTrainingText: string
otherAbilitiesText: string
jl: JlModel
supervisorJobCode: SupervisorJobCodeModel
expectation: number | null
constructor(data: Partial<JobCodeModel>) {
this.jobcodeId = data.jobcodeId || ""
this.companyId = data.companyId || ""
......@@ -120,7 +124,6 @@ export class MyJobCodeModel implements JobCodeModel {
this.jobObjective = data.jobObjective || ""
this.supervisor = data.supervisor || ""
this.competencyWorkText = data.competencyWorkText || ""
this.supervisorPosition = new MyPositionModel(data.supervisorPosition || {})
this.serviceWorkText = data.serviceWorkText || ""
this.serviceWorkPercent = data.serviceWorkPercent ?? 0
this.responsibleWorkText = data.responsibleWorkText || ""
......@@ -136,6 +139,56 @@ export class MyJobCodeModel implements JobCodeModel {
this.cerLicensedText = data.cerLicensedText || ""
this.especiallyTrainingText = data.especiallyTrainingText || ""
this.otherAbilitiesText = data.otherAbilitiesText || ""
this.jl = new MyJlModel(data?.jl)
this.supervisorJobCode = new MySupervisorJobCodeModel(data?.supervisorJobCode)
this.expectation = data?.expectation ?? null
}
}
export interface SupervisorJobCodeModel {
jobCodeId: string
tdesc: string
edesc: string
companyId: string
statusCom: boolean
statusPms: boolean
}
export class MySupervisorJobCodeModel implements SupervisorJobCodeModel {
jobCodeId: string
tdesc: string
edesc: string
companyId: string
statusCom: boolean
statusPms: boolean
constructor(data?: Partial<SupervisorJobCodeModel>) {
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
}
}
export interface JlModel {
plId: string
tdesc: string
edesc: string
companyId: string
}
export class MyJlModel implements JlModel {
plId: string
tdesc: string
edesc: string
companyId: string
constructor(data?: Partial<JlModel>) {
this.plId = data?.plId || ''
this.tdesc = data?.tdesc || ''
this.edesc = data?.edesc || ''
this.companyId = data?.companyId || ''
}
}
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