Commit c9b15e25 by Nattana Chaiyamat

การประเมินจัดการประสิทธิภาพ

ทะเบียนกำหนดชื่อ
หัวข้อการประเมิน
parent b52cbad9
...@@ -230,11 +230,20 @@ ...@@ -230,11 +230,20 @@
<label class="ti-form-label mt-2rem">เป้าหมายผลงาน</label> <label class="ti-form-label mt-2rem">เป้าหมายผลงาน</label>
<input type="text" class="ti-form-input" [(ngModel)]="pmstopic.select.performanceGoalsDetail"> <input type="text" class="ti-form-input" [(ngModel)]="pmstopic.select.performanceGoalsDetail">
<label class="ti-form-label mt-2rem">หน่วยนับ</label> <label class="ti-form-label mt-2rem">หน่วยนับ</label>
<input type="text" class="ti-form-input" placeholder="???" > <input type="text" class="ti-form-input" [(ngModel)]="pmstopic.select.detailUnit">
<label class="ti-form-label mt-2rem">กำหนดเวลาแล้วเสร็จ</label> <label class="ti-form-label mt-2rem">กำหนดเวลาแล้วเสร็จ</label>
<input type="text" class="ti-form-input" placeholder="???" > <mat-form-field>
<input matInput [matDatepicker]="firstHireDate" type="text" class="ti-form-input"
[(ngModel)]="pmstopic.completionDateIso"
(ngModelChange)="changeDate(this.pmstopic.select, 'completionDate', pmstopic.completionDateIso);">
<mat-datepicker-toggle matSuffix [for]="firstHireDate"></mat-datepicker-toggle>
<mat-datepicker #firstHireDate></mat-datepicker>
</mat-form-field>
<label class="ti-form-label mt-2rem">น้ำหนัก</label> <label class="ti-form-label mt-2rem">น้ำหนัก</label>
<input type="text" class="ti-form-input" placeholder="???" > <input type="text" class="ti-form-input"
oninput="this.value = this.value.replace(/[^\d.]/g, '').replace(/(\..*?)\..*/g, '$1').replace(/(\..*?)(\d{2})./g, '$1$2');"
onchange="this.value = this.value.replace('', '0');this.value = parseFloat(this.value).toFixed(2)"
[(ngModel)]="pmstopic.select.weight">
<label class="ti-form-label mt-2rem">ค่าเป้าหมาย</label> <label class="ti-form-label mt-2rem">ค่าเป้าหมาย</label>
<div class="grid grid-cols-12 gap-x-2 mt-2rem"> <div class="grid grid-cols-12 gap-x-2 mt-2rem">
<label class="ti-form-label col-span-3 align-center m-0">A (5 คะแนน)</label> <label class="ti-form-label col-span-3 align-center m-0">A (5 คะแนน)</label>
...@@ -254,7 +263,7 @@ ...@@ -254,7 +263,7 @@
</div> </div>
<div class="grid grid-cols-12 gap-x-2 mt-2rem"> <div class="grid grid-cols-12 gap-x-2 mt-2rem">
<label class="ti-form-label col-span-3 align-center m-0">E (1 คะแนน)</label> <label class="ti-form-label col-span-3 align-center m-0">E (1 คะแนน)</label>
<input type="text" class="ti-form-input col-span-9" [(ngModel)]="pmstopic.select.targetFdetail"> <input type="text" class="ti-form-input col-span-9" [(ngModel)]="pmstopic.select.targetEdetail">
</div> </div>
<div class="flex justify-end mt-2rem mb-1rem"> <div class="flex justify-end mt-2rem mb-1rem">
<button type="button" <button type="button"
......
...@@ -22,7 +22,7 @@ export class AssessmentTopicsComponent { ...@@ -22,7 +22,7 @@ export class AssessmentTopicsComponent {
numDataListChecked = 0 numDataListChecked = 0
isDataListChecked = false isDataListChecked = false
isDataListCheckedAll = false isDataListCheckedAll = false
pmstopic: { loading: boolean, select: PmstopicModel, dataList: { check: boolean, data: PmstopicModel }[] } = { loading: false, select: new MyPmstopicModel(), dataList: [] } pmstopic: { loading: boolean, select: PmstopicModel, completionDateIso: string, dataList: { check: boolean, data: PmstopicModel }[] } = { loading: false, select: new MyPmstopicModel(), completionDateIso: "", dataList: [] }
pmstype: { loading: boolean, select: PmstypeModel, dataList: { check: boolean, data: PmstypeModel }[] } = { loading: false, select: new MyPmstypeModel(), dataList: [] } pmstype: { loading: boolean, select: PmstypeModel, dataList: { check: boolean, data: PmstypeModel }[] } = { loading: false, select: new MyPmstypeModel(), dataList: [] }
modal: table = { modal: table = {
currentPage: 1, currentPage: 1,
...@@ -103,6 +103,7 @@ export class AssessmentTopicsComponent { ...@@ -103,6 +103,7 @@ export class AssessmentTopicsComponent {
} }
selectPmstopic(data?: PmstopicModel) { selectPmstopic(data?: PmstopicModel) {
this.pmstopic.select = new MyPmstopicModel(data) this.pmstopic.select = new MyPmstopicModel(data)
this.pmstopic.completionDateIso = this.toISODate(new MyPmstopicModel(data).completionDate)
} }
updatePmstopic(typeApi: 'post' | 'delete') { updatePmstopic(typeApi: 'post' | 'delete') {
let body: PmstopicModel | PmstopicModel[] let body: PmstopicModel | PmstopicModel[]
...@@ -232,6 +233,26 @@ export class AssessmentTopicsComponent { ...@@ -232,6 +233,26 @@ export class AssessmentTopicsComponent {
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1); this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
} }
changeDate(target: { [key: string]: any }, field: string, dateIso: string) {
target[field] = this.toYYYYMMDD(dateIso)
}
toISODate(dateInput?: string | null): string {
if (!dateInput) return "";
const parsedDate = new Date(dateInput);
return isNaN(parsedDate.getTime()) ? new Date().toISOString() : parsedDate.toISOString();
}
toYYYYMMDD(dateInput?: string | null): string {
if (!dateInput) return "";
const parsedDate = new Date(dateInput);
const options: Intl.DateTimeFormatOptions = {
year: 'numeric',
month: '2-digit',
day: '2-digit',
};
const formattedDate = parsedDate.toLocaleDateString('en-GB', options);
const [day, month, year] = formattedDate.split('/');
return `${year}-${month}-${day}`;
}
} }
...@@ -16,7 +16,7 @@ export interface PmstopicModel { ...@@ -16,7 +16,7 @@ export interface PmstopicModel {
targetBdetail: string targetBdetail: string
targetCdetail: string targetCdetail: string
targetDdetail: string targetDdetail: string
targetFdetail: string targetEdetail: string
} }
export class MyPmstopicModel implements PmstopicModel { export class MyPmstopicModel implements PmstopicModel {
...@@ -35,7 +35,7 @@ export class MyPmstopicModel implements PmstopicModel { ...@@ -35,7 +35,7 @@ export class MyPmstopicModel implements PmstopicModel {
targetBdetail: string targetBdetail: string
targetCdetail: string targetCdetail: string
targetDdetail: string targetDdetail: string
targetFdetail: string targetEdetail: string
constructor(data?: Partial<PmstopicModel>) { constructor(data?: Partial<PmstopicModel>) {
this.pmsTopicId = data?.pmsTopicId || "" this.pmsTopicId = data?.pmsTopicId || ""
this.pmsType = new MyPmstypeModel(data?.pmsType) this.pmsType = new MyPmstypeModel(data?.pmsType)
...@@ -52,7 +52,7 @@ export class MyPmstopicModel implements PmstopicModel { ...@@ -52,7 +52,7 @@ export class MyPmstopicModel implements PmstopicModel {
this.targetBdetail = data?.targetBdetail || "" this.targetBdetail = data?.targetBdetail || ""
this.targetCdetail = data?.targetCdetail || "" this.targetCdetail = data?.targetCdetail || ""
this.targetDdetail = data?.targetDdetail || "" this.targetDdetail = data?.targetDdetail || ""
this.targetFdetail = data?.targetFdetail || "" this.targetEdetail = data?.targetEdetail || ""
} }
} }
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