Commit ec9cdf18 by Nakarin Luankla

Merge branch 'DEV' of https://mygit.myhr.co.th/angular/myAppraisal into DEV

parents 23e93f30 cdc2d0e7
......@@ -26,7 +26,7 @@
<thead>
<tr>
<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" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
......@@ -154,7 +154,7 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label class="ti-form-label mt-2rem">ชื่อล็ออิน</label>
<label class="ti-form-label mt-2rem">ชื่อล็ออิน</label>
<input type="text" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="userPassword.usernameId">
<label class="ti-form-label mt-2rem">รหัสพนักงาน</label>
......
......@@ -26,7 +26,7 @@
<thead>
<tr>
<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" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
......@@ -153,12 +153,12 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label class="ti-form-label mt-2rem">ชื่อล็ออิน</label>
<label class="ti-form-label mt-2rem">ชื่อล็ออิน</label>
<input type="text" class="ti-form-input bg-input-readonly" readonly
[(ngModel)]="userPassword.usernameId">
<label class="ti-form-label mt-2rem">รหัสพนักงาน</label>
<input type="text" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="userPassword.empId">
<label class="ti-form-label mt-2rem">กำหนดผ่านใหม่*</label>
<label class="ti-form-label mt-2rem">กำหนดรหัสผ่านใหม่*</label>
<input type="text" class="masked-input ti-form-input" [(ngModel)]="userPassword.newPassword">
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
......
......@@ -74,7 +74,7 @@
<thead>
<tr>
<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" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l&&!f">
......@@ -212,7 +212,7 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label class="ti-form-label mt-2rem">ชื่อล็ออิน*</label>
<label class="ti-form-label mt-2rem">ชื่อล็ออิน*</label>
<input type="text" class="ti-form-input"
oninput="this.value = this.value.replace(/[\u0E00-\u0E7F]/g, '')"
[ngClass]="{'bg-input-readonly':currentModal=='edit'}" [readonly]="currentModal=='edit'"
......
......@@ -284,14 +284,11 @@ export class UserSettingsComponent {
clearDataUser(currentModal: string) {
if (currentModal == 'add') {
this.user.select.usernameId = ''
this.user.select.employee.employeeId = ''
this.user.select.role.roleId = ''
this.user.select.level.userLevel = ''
this.selectUser()
} else if (currentModal == 'edit') {
this.user.select.employee.employeeId = ''
this.user.select.role.roleId = ''
this.user.select.level.userLevel = ''
this.selectEmployee()
this.selectRole()
this.selectLevel()
}
}
showAlert(text: string, type: 'success' | 'error') {
......
......@@ -196,27 +196,6 @@
</div>
</div>
<div id="development-course-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
<div class="max-h-full overflow-hidden ti-modal-content">
......@@ -225,7 +204,7 @@
เพิ่มหลักสูตรการพัฒนา
</h3>
<h3 class="text-xxl font-bold text-primary" *ngIf="currentModal=='edit'">
แก้ไขหัวข้อสมรรถนะ
แก้ไขหลักสูตรการพัฒนา
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......
......@@ -31,21 +31,21 @@
</div>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#evaluation-cycle-page-modal" (click)="modalStatus='add';setData()">
<i class="ri-add-line"></i>
Add
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
data-hs-overlay="#evaluation-cycle-page-alert-modal" (click)="modalStatus='deleteGroup';setData()">
<i class="ti ti-trash fs-l"></i>
Delete
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
......@@ -137,31 +137,29 @@
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="modalStatus='edit';setData(item.data)"
data-hs-overlay="#evaluation-cycle-page-modal"></i>
<i class="ti ti-user cursor-pointer i-gray fs-l px-1" data-hs-overlay="#evaluation-cycle-person-modal"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" data-hs-overlay="#evaluation-cycle-delete-modal"></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';setData(item.data)"
data-hs-overlay="#evaluation-cycle-page-alert-modal"></i>
<!-- <span class="badge text-white m-1" *ngIf="item.data.statusCode.code!='1'"
[ngClass]="{'bg-primary':item.data.statusCode.code=='1','bg-gray-400':item.data.statusCode.code!='3'}">ปิดรอบประเมิน</span>
<span class="badge text-white m-1 bg-secondary" *ngIf="item.data.statusCode.code=='0'">สร้างแบบฟอร์ม</span> -->
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '0'"
[ngClass]="{
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '0'" [ngClass]="{
'bg-primary': item.data.statusCode.code == '0',
'text-white': item.data.statusCode.code == '0'
}">
ปิดรอบประเมิน
</span>
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '1'"
[ngClass]="{
ปิดรอบประเมิน
</span>
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '1'" [ngClass]="{
'bg-secondary': item.data.statusCode.code == '1',
'text-white': item.data.statusCode.code == '1'
}">
สร้างแบบฟอร์ม
</span>
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '2'"
[ngClass]="{
สร้างแบบฟอร์ม
</span>
<span class="badge text-white m-1" *ngIf="item.data.statusCode.code == '2'" [ngClass]="{
'bg-gray-400': item.data.statusCode.code == '2',
'text-white': item.data.statusCode.code == '2'
}">
ปิดรอบประเมิน
</span>
ปิดรอบประเมิน
</span>
</td>
</tr>
</tbody>
......@@ -250,24 +248,25 @@
</div>
</div>
<div class="ti-modal-body padding-16px pt-0 overflow-y-0">
<label for="input-label" class="ti-form-label mt-2rem">รหัส รอบการประเมิน *</label>
<label for="input-label" class="ti-form-label mt-2rem">รหัส รอบการประเมิน*</label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
[ngClass]="{'bg-input-readonly':modalStatus=='edit'}" [readonly]="modalStatus=='edit'"
[(ngModel)]="dataSelect.evaluationRoundId">
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย) *</label>
<label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย)*</label>
<input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="dataSelect.tdesc">
<label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="dataSelect.edesc">
<label for="input-label" class="ti-form-label mt-2rem">ปีการประเมิน</label>
<input type="text" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="dataSelect.apsyear">
<label for="input-label" class="ti-form-label mt-2rem">ปีการประเมิน*</label>
<input type="text" id="input-label" class="ti-form-input w-1/2"
oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="dataSelect.apsyear">
<label for="input-label" class="ti-form-label mt-2rem">เริ่มวันที่</label>
<label for="input-label" class="ti-form-label mt-2rem">เริ่มวันที่*</label>
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="dataSelect.apsPeriodStart">
<label for="input-label" class="ti-form-label mt-2rem">สิ้นสุดวันที่</label>
<label for="input-label" class="ti-form-label mt-2rem">สิ้นสุดวันที่*</label>
<input type="date" id="input-label" class="ti-form-input w-1/2" [(ngModel)]="dataSelect.apsPeriodEnd">
<div class="flex justify-end mt-2rem mb-1rem">
......@@ -276,10 +275,11 @@
data-hs-overlay="#evaluation-cycle-page-modal">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#evaluation-cycle-page-alert-modal">
<button type="button" class="ti-btn ti-btn-success" data-hs-overlay="#evaluation-cycle-page-alert-modal"
[class.ti-btn-disabled]="!dataSelect.evaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd"
[disabled]="!dataSelect.evaluationRoundId||!dataSelect.tdesc||!dataSelect.apsyear||!dataSelect.apsPeriodStart||!dataSelect.apsPeriodEnd">
บันทึกข้อมูล
</a>
</button>
</div>
</div>
</div>
......
import { ChangeDetectorRef, Component} from '@angular/core';
import { ChangeDetectorRef, Component } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { EvaluationCycleModel, MyEvaluationCycleModel } from 'src/app/shared/model/evaluation-cycle.model';
import { EvaluationCycleService } from 'src/app/shared/services/evaluation-cycle.service';
import { MyStatusCodeModel, StatusCodeModel } from 'src/app/shared/model/status-code.model';
export interface DataModel {
evaluationRoundId: string;
tdesc: string;
edesc: string;
apsyear: string;
apsPeriodStart: string;
apsPeriodEnd: string;
statusCode: StatusCodeModel;
evaluationRoundId: string;
tdesc: string;
edesc: string;
apsyear: string;
apsPeriodStart: string;
apsPeriodEnd: string;
statusCode: StatusCodeModel;
}
@Component({
selector: 'app-evaluation-cycle',
templateUrl: './evaluation-cycle.component.html',
styleUrls: ['./evaluation-cycle.component.scss']
selector: 'app-evaluation-cycle',
templateUrl: './evaluation-cycle.component.html',
styleUrls: ['./evaluation-cycle.component.scss']
})
export class EvaluationCycleComponent {
apsPeriodStart: string = '';
apsPeriodEnd: string = '';
apsPeriodEnd: string = '';
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
......@@ -30,7 +30,7 @@ export class EvaluationCycleComponent {
evaluation_cyclelist: { check: boolean, data: DataModel }[] = []
evaluation_cycle: EvaluationCycleModel = new MyEvaluationCycleModel({})
dataLoading = false
dataSelect: DataModel = { evaluationRoundId: "", tdesc: "", edesc: "", apsyear: "", apsPeriodStart: "", apsPeriodEnd: "", statusCode: new MyStatusCodeModel({})}
dataSelect: DataModel = { evaluationRoundId: "", tdesc: "", edesc: "", apsyear: "", apsPeriodStart: "", apsPeriodEnd: "", statusCode: new MyStatusCodeModel({}) }
itemToDelete: EvaluationCycleModel | null = null;
isDataListChecked = false
isDataListCheckedAll = false
......@@ -40,82 +40,92 @@ export class EvaluationCycleComponent {
private toastr: ToastrService,
private cdr: ChangeDetectorRef
) { }
ngOnInit(): void {
this.getEvaluationCycleList()
}
getEvaluationCycleList() {
this.dataLoading = true
this.evaluationCycleService.getList().subscribe({
next: response => {
console.log('API response:', response);
this.evaluation_cyclelist = response.map(x => ({
check: false,
data: {
evaluationRoundId: x.evaluationRoundId,
tdesc: x.tdesc,
edesc: x.edesc,
apsyear: x.apsyear,
apsPeriodStart: x.apsPeriodStart,
apsPeriodEnd: x.apsPeriodEnd,
statusCode: new MyStatusCodeModel(x.statusCode || {})
}
check: false,
data: {
evaluationRoundId: x.evaluationRoundId,
tdesc: x.tdesc,
edesc: x.edesc,
apsyear: x.apsyear,
apsPeriodStart: x.apsPeriodStart,
apsPeriodEnd: x.apsPeriodEnd,
statusCode: new MyStatusCodeModel(x.statusCode || {})
}
}));
this.dataLoading = false
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.searchChange();
this.cdr.detectChanges();
},
error: err => {
console.error('Error fetching evaluation cycles:', err);
this.dataLoading = false
this.cdr.detectChanges();
}
});
}
dataListCheck() {
const dataCheck = this.evaluation_cycleListFilter();
this.isDataListChecked = dataCheck.some(x => x.check);
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = dataCheck.filter(x => x.check).length;
}
dataListCheckAll() {
dataListCheckAll() {
const selectAll = this.isDataListCheckedAll;
this.evaluation_cyclelist.forEach(x => x.check = selectAll);
this.evaluation_cycleListFilter().forEach(x => x.check = selectAll);
this.dataListCheck();
}
}
dataListCheck() {
const dataCheck = this.evaluation_cycleListFilter();
this.isDataListCheckedAll = dataCheck.length ? dataCheck.every(x => x.check) : false;
this.numDataListChecked = this.evaluation_cyclelist.filter(x => x.check).length;
this.isDataListChecked = Boolean(this.numDataListChecked)
}
searchChange() {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.evaluation_cycleListFilter().length / 10) }, (_, i) => i + 1);
this.dataListCheck()
}
evaluation_cycleListFilter() {
return this.evaluation_cyclelist.filter(x => {
const data = x.data
const match = data.evaluationRoundId.includes(this.search) || data.tdesc.includes(this.search) || data.edesc.includes(this.search);
const match = data.evaluationRoundId.toLowerCase().includes(this.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.search.toLowerCase()) || data.edesc.toLowerCase().includes(this.search.toLowerCase());
return match;
});
}
setData(data?: DataModel) {
this.dataSelect = JSON.parse(JSON.stringify(data || {
evaluationRoundId: "",
tdesc: "",
edesc: "",
apsyear: "",
apsPeriodStart: "",
apsPeriodEnd: "",
statusCode: new MyStatusCodeModel({})
evaluationRoundId: "",
tdesc: "",
edesc: "",
apsyear: "",
apsPeriodStart: "",
apsPeriodEnd: "",
statusCode: new MyStatusCodeModel({})
}));
}
}
addevaluation_cycle() {
const body = new MyEvaluationCycleModel({ evaluationRoundId: this.dataSelect.evaluationRoundId, tdesc: this.dataSelect.tdesc, edesc: this.dataSelect.edesc, apsyear: this.dataSelect.apsyear, apsPeriodStart: this.dataSelect.apsPeriodStart, apsPeriodEnd: this.dataSelect.apsPeriodEnd, statusCode: this.dataSelect.statusCode })
this.dataLoading = true
this.evaluationCycleService.post(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getEvaluationCycleList()
} else {
this.dataLoading = false
this.showAlert(response.message, 'error')
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
})
}
......@@ -127,16 +137,22 @@ dataListCheckAll() {
} else {
body = this.evaluation_cyclelist.filter(x => x.check).map(x => new MyEvaluationCycleModel({ evaluationRoundId: x.data.evaluationRoundId, tdesc: x.data.tdesc, edesc: x.data.edesc, apsyear: x.data.apsyear, apsPeriodStart: x.data.apsPeriodStart, apsPeriodEnd: x.data.apsPeriodEnd, statusCode: x.data.statusCode }))
}
this.dataLoading = true
this.evaluationCycleService.delete(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getEvaluationCycleList()
} else {
this.dataLoading = false
this.showAlert(response.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.dataLoading = false
this.cdr.detectChanges()
}
})
}
......
<div class="header-title-type">
<div class="flex justify-end">
<div class="px-1">
<button type="button"
class="ti-btn ti-btn-soft-success h-10 m-0 shadow-md">
<i class="ri-save-3-line"></i>
Save
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="flex justify-end">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-success h-10 m-0 shadow-md"
data-hs-overlay="#competency-configuration-alert-modal">
<i class="ri-save-3-line"></i>
Save
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-10 m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
</div>
<div class="body-content">
<div class="body-content">
<div class="page">
<div class="grid grid-cols-3 gap-6">
<div class="col-span-1">
......@@ -25,58 +25,132 @@
</div>
<div class="grid grid-cols-3 gap-6">
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-2/3 pr-10" value="{{ setting.apsyear }}">
<input type="text" class="ti-form-input w-2/3 pr-10"
oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="setting.data.apsyear">
</div>
</div>
<div class="grid grid-cols-3 gap-6 mt-10">
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ระดับความคาดหวัง *</label>
</div>
</div>
<div class="grid grid-cols-3 gap-6">
<div class="col-span-1">
<input type="text" id="input-label" class="ti-form-input w-2/3 pr-10" value="{{ setting.expectationLevel }}">
</div>
</div>
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ระดับความคาดหวัง *</label>
</div>
</div>
<div class="grid grid-cols-3 gap-6">
<div class="col-span-1">
<input type="text" class="ti-form-input w-2/3 pr-10"
oninput="this.value = this.value.replace(/\D/g, '')" [(ngModel)]="setting.data.expectationLevel">
</div>
</div>
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label mt-10">จัดการสมรรถนะกับกลุ่ม *</label>
<div class="box-body">
<div class="grid grid-cols-6 flex gap-x-6">
<div class="flex col-span-1 mt-5">
<input type="radio" name="hs-radio-group" class="ti-form-radio" id="hs-radio-group-1" checked>
<label for="hs-radio-group-1" class="text-sm text-gray-500 ltr:ml-5 rtl:mr-2 dark:text-white/70">{{ setting.companyId }}</label>
</div>
<!-- <div class="flex col-span-2 mt-5 ml-4rem">
<input type="radio" name="hs-radio-group" class="ti-form-radio" id="hs-radio-group-2">
<label for="hs-radio-group-2" class="text-sm text-gray-500 ltr:ml-5 rtl:mr-2 dark:text-white/70">ลักษณะงาน ( JD)</label>
</div> -->
<div class="grid grid-cols-6 gap-2">
<div class="grid col-span-1 grid-cols-6 gap-2">
<div class="col-span-1">
<input type="checkbox" class="ti-form-checkbox" id="settingGroupAssessment-0"
[class.pointer-events-none]="setting.data.settingGroupAssessment=='0'"
name="settingGroupAssessment" (change)="setting.data.settingGroupAssessment='0'"
[value]="'0'" [checked]="setting.data.settingGroupAssessment=='0'">
</div>
<div class="col-span-5">
<label for="settingGroupAssessment-0" class="text-sm text-gray-500"
[class.pointer-events-none]="setting.data.settingGroupAssessment=='0'">
ระดับพนักงาน (PL)
</label>
</div>
</div>
<div class="grid col-span-1 grid-cols-6 gap-2">
<div class="col-span-1">
<input type="checkbox" class="ti-form-checkbox" id="settingGroupAssessment-1"
[class.pointer-events-none]="setting.data.settingGroupAssessment=='1'"
name="settingGroupAssessment" (change)="setting.data.settingGroupAssessment='1'"
[checked]="setting.data.settingGroupAssessment=='1'">
</div>
<div class="col-span-5">
<label for="settingGroupAssessment-1" class="text-sm text-gray-500"
[class.pointer-events-none]="setting.data.settingGroupAssessment=='1'">
ลักษณะงาน (JD)
</label>
</div>
</div>
</div>
</div>
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label mt-10">น้ำหนักปัจจัยการประเมิน</label>
<div class="overflow-auto contenttable">
<table>
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
style="min-width: 75% !important;width: 75% !important">
<thead>
<tr>
<th>คะเเนน</th>
<th>5</th>
<th>4</th>
<th>3</th>
<th>2</th>
<th>1</th>
<th class="text-center">5</th>
<th class="text-center">4</th>
<th class="text-center">3</th>
<th class="text-center">2</th>
<th class="text-center">1</th>
</tr>
</thead>
<tbody>
<tr>
<td>น้ำหนัก</td>
<td><span>{{ setting.settingScore5 }}</span></td>
<td><span>{{ setting.settingScore4 }}</span></td>
<td><span>{{ setting.settingScore3 }}</span></td>
<td><span>{{ setting.settingScore2 }}</span></td>
<td><span>{{ setting.settingScore1 }}</span></td>
<td> <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)]="setting.data.settingScore5"></td>
<td> <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)]="setting.data.settingScore4"></td>
<td> <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)]="setting.data.settingScore3"></td>
<td> <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)]="setting.data.settingScore2"></td>
<td> <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)]="setting.data.settingScore1"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="competency-configuration-alert-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#competency-configuration-alert-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการบันทึกข้อมูลหรือไม่
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary 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="#competency-configuration-alert-modal">
ย้อนกลับ
</button>
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#competency-configuration-alert-modal" (click)="saveSetting()">
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
.button-clear {
position: absolute;
top: 96px;
z-index: 1;
right: 41vw;
}
.button-help {
position: absolute;
top: 0px;
z-index: 1;
right: 0vw;
margin: 4.2rem;
margin-right: 10px; /* เพิ่มใหม่ 12/16*/
}
a.custom-link {
padding: 10px 40px; /* ปรับ padding ให้เพิ่มขนาด */
}
/* สไตล์ของแถบเมนู */
.nav-tabs {
display: flex;
width: 100%;
cursor: pointer;
margin-bottom: 10px;
height: 20%;
}
.nav-item {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link {
text-decoration: none;
padding: 10px 20px;
display: inline-block;
font-size: large;
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: #ccc;
border-radius: 5px 5px 0px 0px;
}
.nav-link:hover {
background-color: #f0f0f0; /* เปลี่ยนสีเมื่อ hover */
}
.nav-link.active {
color: #ffffff; /* สีตัวอักษรในสถานะ active */
font-size: large;
border-bottom: 3.5px solid rgb(var(--color-primary)); /* เส้นใต้ */
background-color: rgb(var(--color-primary));
border-width: 2px 2px 0px 2px;
border-style: solid;
border-color: rgb(var(--color-primary));
border-radius: 5px 5px 0px 0px;
}
.tab-content {
margin-top: 20px;
}
.tab-pane.active {
display: block;
}
.nav-item-text {
list-style: none;
margin-right: 10px; /* ช่องว่างระหว่างเมนู */
}
.nav-link-text {
text-decoration: none;
display: inline-block;
font-size: large;
color: #569bf5;
border-bottom: 2px solid #569bf5;
line-height: 0.8;
}
.ti-pagination .page-link.active {
background-color: #569bf5;
color: white;
border-radius: 50%;
padding: 8px 12px;
}
.box-body{
padding: 0rem;
}
.page{
min-height: 0vh;
}
.ti-modal-content-alert{
width: 35%; /* ความกว้างที่คุณต้องการ */
position: absolute; /* ทำให้สามารถจัดตำแหน่งได้ */
top: 50%; /* ให้อยู่กลางในแนวตั้ง */
left: 50%; /* ให้อยู่กลางในแนวนอน */
transform: translate(-50%, -50%); /* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color: #ffffff;
}
.header-title-type {
width: 100%;
min-height: 50px; /* ใช้ min-height เพื่อให้มีความยืดหยุ่น */
justify-content: space-between; /* จัดเรียงองค์ประกอบภายใน */
align-items: center; /* จัดกลางแนวตั้ง */
padding-top: 50px;
padding-bottom: 1rem;
}
.body-content{
margin-bottom: 30px;
height: 100%;
width: 100%;
}
table {
width: 50%;
border-collapse: collapse;
border: 1px solid black;
}
th{
font-weight: bold;
}
th, td {
border: 1px solid black; /* เส้นขอบของเซลล์ */
padding: 15px;
text-align: center;
}
th:first-child{
width: 125px;
font-size: 18px;
}
td{
padding-top: 8px;
padding-bottom: 8px;
}
td:first-child{
font-size: 18px;
font-weight: bold;
}
td span {
display: inline-block; /*span มีลักษณะเป็นกรอบ */
padding: 5px 10px;
border: 1px solid black;
border-radius: 10px;
background-color: #f9f9f9;
width: 60px;
}
input[type="radio"]:checked {
background-color: #569BF5;
border-color: #569BF5;
}
\ No newline at end of file
......@@ -4,19 +4,12 @@ import { MySettingAssessmentModel, SettingAssessmentModel } from 'src/app/shared
import { SettingAssessmentService } from 'src/app/shared/services/setting-assessment.service';
@Component({
selector: 'app-competency-configuration',
templateUrl: './competency-configuration.component.html',
styleUrls: ['./competency-configuration.component.scss']
selector: 'app-competency-configuration',
templateUrl: './competency-configuration.component.html',
styleUrls: ['./competency-configuration.component.scss']
})
export class CompetencyConfigurationComponent {
@Input() pathTitle = ['การประเมินสมรรถนะ', 'การตั้งค่า', 'กำหนดค่าระบบประเมินสมรรถนะ'];
@Output() sendPathTitle: EventEmitter<string[]> = new EventEmitter<string[]>();
activeTab: string = 'tab1'; // กำหนด tab เริ่มต้น
isChecked: boolean = false;
settingList: SettingAssessmentModel[] = []
settingListLoading = false
setting: SettingAssessmentModel = new MySettingAssessmentModel({})
search = ""
setting: { loading: boolean, data: SettingAssessmentModel } = { loading: false, data: new MySettingAssessmentModel() }
constructor(private settingAssessmentService: SettingAssessmentService,
private toastr: ToastrService,
private cdr: ChangeDetectorRef
......@@ -25,58 +18,43 @@ export class CompetencyConfigurationComponent {
this.getSettingList()
}
getSettingList() {
this.settingListLoading = true
this.settingAssessmentService.getList().subscribe({
this.setting.loading = true
this.settingAssessmentService.get().subscribe({
next: response => {
this.settingList = response
this.settingListLoading = false
this.setting.data = new MySettingAssessmentModel(response)
this.setting.loading = false
this.cdr.detectChanges()
}, error: error => {
this.settingListLoading = false
this.setting.loading = false
this.cdr.detectChanges()
}
})
}
selectsetting(setting?: SettingAssessmentModel) {
this.setting = new MySettingAssessmentModel(setting || {})
}
// showSuccessAdd() {
// this.toastr.success('บันทึกข้อมูลสำเร็จ', 'แจ้งเตือน', {
// timeOut: 3000,
// positionClass: 'toast-top-right',
// });
// }
// showSuccessDelete() {
// this.toastr.success('ลบข้อมูลสำเร็จ', 'แจ้งเตือน', {
// timeOut: 3000,
// positionClass: 'toast-top-right',
// });
// }
// addsetting() {
// this.settingAssessmentService.post(this.setting).subscribe((response: any) => {
// if (response.success) {
// this.showSuccessAdd()
// this.getSettingList()
// }
// })
// }
// deletesetting() {
// this.settingAssessmentService.delete(this.setting).subscribe((response: any) => {
// if (response.success) {
// this.showSuccessDelete()
// this.getSettingList()
// }
// })
// }
changeTab(tab: { id: string, text: string }) {
this.sendPathTitle.emit(['การประเมินสมรรถนะ', 'การตั้งค่า', tab.text]);
this.activeTab = tab.id;
saveSetting() {
this.setting.loading = true
this.settingAssessmentService.post(new MySettingAssessmentModel({ ...this.setting.data, expectationLevel: +(this.setting.data.expectationLevel) })).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
this.getSettingList()
} else {
this.showAlert(response.message, 'error')
this.setting.loading = false
this.cdr.detectChanges()
}
}, error: error => {
this.showAlert(error.message, 'error')
this.setting.loading = false
this.cdr.detectChanges()
}
})
}
toggleCheckbox(): void {
this.isChecked = !this.isChecked;
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
})
}
}
......
......@@ -10,15 +10,15 @@
<nav class="-mb-0.5 flex space-x-6 rtl:space-x-reverse">
<a class="text-base font-medium hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 dark:text-white/70 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1" (click)="pathTitle = ['การประเมินสมรรถนะ','การตั้งค่า','กำหนดค่าระบบประเมินสมรรถนะ']">
aria-controls="underline-1"
(click)="pathTitle = ['การประเมินสมรรถนะ','การตั้งค่า','กำหนดค่าระบบประเมินสมรรถนะ']">
กำหนดค่าระบบประเมินสมรรถนะ
</a>
</nav>
</div>
<div class="mt-3 px-3rem">
<div id="underline-1" role="tabpanel" aria-labelledby="underline-item-1">
<app-competency-configuration [pathTitle]="pathTitle"
(sendPathTitle)="pathTitle=$event"></app-competency-configuration>
<app-competency-configuration></app-competency-configuration>
</div>
</div>
</div>
......
......@@ -129,7 +129,7 @@
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
เพิ่มข้อมูลรายละเอียดของงาน
เพิ่มข้อมูลโครงสร้างสายการบังคับบัญชา
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......@@ -169,9 +169,9 @@
</div>
</div>
<div class="ti-modal-body mt-1">
<label for="input-label" class="ti-form-label">รหัสงาน*</label>
<label for="input-label" class="ti-form-label">รหัสงาน</label>
<input type="text" id="input-label" class="ti-form-input w-1/2 bg-input-readonly" readonly value="001">
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (ไทย)</label>
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (ไทย)*</label>
<input type="text" id="input-label" class="ti-form-input h-10 bg-input-readonly" readonly value="Department Manager 1">
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (อังกฤษ)</label>
<input type="text" id="input-label" class="ti-form-input h-10 bg-input-readonly" readonly value="Department Manager 1">
......@@ -236,7 +236,7 @@
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แก้ไขข้อมูลรายละเอียดของงาน
แก้ไขข้อมูลโครงสร้างสายการบังคับบัญชา
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......@@ -276,9 +276,9 @@
</div>
</div>
<div class="ti-modal-body mt-1">
<label for="input-label" class="ti-form-label">รหัสงาน*</label>
<label for="input-label" class="ti-form-label">รหัสงาน</label>
<input type="text" id="input-label" class="ti-form-input w-1/2 bg-input-readonly" readonly value="001">
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (ไทย)</label>
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (ไทย)*</label>
<input type="text" id="input-label" class="ti-form-input h-10 bg-input-readonly" readonly value="Department Manager 1">
<label for="input-label" class="ti-form-label mt-2rem">ชื่อลักษณะงาน (อังกฤษ)</label>
<input type="text" id="input-label" class="ti-form-input h-10 bg-input-readonly" readonly value="Department Manager 1">
......
......@@ -149,7 +149,7 @@
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
เเก้ไขข้อมูลความสามารถในตำเเหน่งงาน
เเก้ไขข้อมูลรายละเอียดของงาน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......@@ -189,12 +189,11 @@
<div class="ti-modal-body" style="padding-top: 0px;">
<label for="input-label" class="ti-form-label mt-1rem">รหัสงาน</label>
<input type="text" id="input-label" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.jobcodeId">
<label for="detail_th" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (ไทย)</label>
<label for="detail_th" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (ไทย)*</label>
<input type="text" id="detail_th" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.tdesc">
<label for="detail_eng" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.edesc">
<div class="flex space-x-4 justify-center">
<!-- label และ textarea แรก -->
<div class="flex flex-col w-full">
<label for="input-label" class="ti-form-label mt-2rem">งานบริหาร (Management) </label>
<textarea id="input-label" class="ti-form-input w-80" rows="4" cols="50" [(ngModel)]="selectJob.serviceWorkText"></textarea>
......@@ -207,7 +206,6 @@
</div>
</div>
<div class="flex space-x-4 justify-center">
<!-- label และ textarea แรก -->
<div class="flex flex-col w-full">
<label for="input-label" class="ti-form-label mt-2rem">งานที่รับผิดชอบ
(งานปฏิบัติ)</label>
......@@ -221,7 +219,6 @@
</div>
</div>
<div class="flex space-x-4 justify-center">
<!-- label และ textarea แรก -->
<div class="flex flex-col w-full">
<label for="input-label" class="ti-form-label mt-2rem">งานที่ได้รับมอบหมายพิเศษ</label>
<textarea id="input-label" class="ti-form-input w-80" rows="4" cols="50" [(ngModel)]="selectJob.specialWorkText"></textarea>
......@@ -234,7 +231,6 @@
</div>
</div>
<div class="flex space-x-4 justify-center">
<!-- label และ textarea แรก -->
<div class="flex flex-col w-full">
<label for="input-label"
class="ti-form-label mt-2rem">งานที่ทุกตำแหน่งต้องปฏิบัติ</label>
......@@ -248,7 +244,6 @@
</div>
</div>
<div class="flex space-x-4 justify-center">
<!-- label และ textarea แรก -->
<div class="flex flex-col w-full">
<label for="input-label" class="ti-form-label mt-2rem">อื่นๆ</label>
<textarea id="input-label" class="ti-form-input w-80" rows="4" cols="50" [(ngModel)]="selectJob.otherWorkText"></textarea>
......
......@@ -11,7 +11,7 @@
<a class="font-size-16px font-weight-500 hs-tab-active:font-weight-700 hs-tab-active:border-secondary hs-tab-active:text-secondary pb-3 inline-flex items-center gap-2 border-b-[3px] border-transparent whitespace-nowrap text-gray-500 hover:text-secondary active"
href="javascript:void(0);" id="underline-item-1" data-hs-tab="#underline-1"
aria-controls="underline-1"
(click)="pathTitle = ['การจัดการรายละเอียดงาน','ตัวชี้วัดของตำแหน่งงานd']">
(click)="pathTitle = ['การจัดการรายละเอียดงาน','ตัวชี้วัดของตำแหน่งงาน']">
ตัวชี้วัดของตำแหน่งงาน
</a>
</nav>
......
......@@ -149,7 +149,7 @@
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
เเก้ไขข้อมูลความสามารถในตำเเหน่งงาน
เเก้ไขข้อมูลตัวชี้วัดของตำแหน่งงาน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
......@@ -189,7 +189,7 @@
<div class="ti-modal-body" style="padding-top: 0px;">
<label for="input-label" class="ti-form-label mt-1rem">รหัสงาน</label>
<input type="text" id="input-label" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.jobcodeId">
<label for="detail_th" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (ไทย)</label>
<label for="detail_th" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (ไทย)*</label>
<input type="text" id="detail_th" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.tdesc">
<label for="detail_eng" class="ti-form-label mt-1rem">ชื่อลักษณะงาน (อังกฤษ)</label>
<input type="text" id="detail_eng" class="ti-form-input bg-input-readonly" readonly [(ngModel)]="selectJob.edesc">
......
......@@ -12,36 +12,33 @@
</div>
</div>
</div>
<div class="py-2 border-b-2 border-collapse ">
<div class="grid grid-cols-3 gap-6 mt-2 ">
<div class="mt-2rem pb-1rem border-b-2 border-collapse ">
<div class="grid grid-cols-3">
<div class="col-span-1">
<label for="hs-trailing-button-add-on-with-icon" class="ti-form-label">ระดับพนักงาน</label>
<label class="ti-form-label">ระดับพนักงาน</label>
</div>
</div>
<div class="grid">
<input type="text" id="input-label"
class="py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input w-full rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 w-1/2 bg-input-readonly"
readonly [(ngModel)]="pl.tdesc">
<div class="grid grid-cols-6">
<input type="text" class="ti-form-input !bg-input-readonly" readonly [(ngModel)]="pl.plId">
</div>
</div>
<div class="header-title-type">
<div class="flex justify-between">
<div class="header-title-type mt-2rem mb-1rem">
<div class="flex justify-between ">
<div class="flex">
<!-- Content ของ div แรก -->
<div class="flex gap-x-6">
<div class="flex items-center">
<input type="checkbox" class="ti-form-checkbox mt-0.5" id="hs-checkbox-group-1">
<label for="hs-checkbox-group-1"
class="text-sm text-gray-500 ltr:ml-2 rtl:mr-2 dark:text-white/70">0 Selected</label>
<input type="checkbox" class="ti-form-checkbox pointer-events-none" [(ngModel)]="isDataListChecked">
<label class="text-sm text-gray-500 mx-2 pointer-events-none">
{{numDataListChecked}} Selected</label>
</div>
<div class="flex items-center">
<!-- <i (click)="toggleCheckbox()"
[ngClass]="{'ri-checkbox-multiple-line': !isChecked, 'ri-checkbox-multiple-fill': isChecked}"
class="ri-checkbox-multiple-line text-gray-500 dark:text-white/70"></i>
<label for="hs-checkbox-group-2" class="text-sm text-gray-500 ltr:ml-2 rtl:mr-2 dark:text-white/70"
(click)="toggleCheckbox()">Select All</label> -->
<div class="mx-1 flex items-center">
<button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()"
class="focus:ring-2 focus:ring-primary rounded-sm flex item-center">
<i class="fs-l transition-all duration-200"
[ngClass]="{'ri-checkbox-multiple-line text-gray-500': !isDataListCheckedAll, 'ri-checkbox-multiple-fill text-primary': isDataListCheckedAll}"></i>
</button>
<label class="text-sm text-gray-500 ml-2">Select All</label>
</div>
</div>
</div>
......@@ -51,7 +48,7 @@
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
style="height: 40px;">
style="height: 40px;" [(ngModel)]="search" (ngModelChange)="searchChange()">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
......@@ -60,21 +57,23 @@
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-success h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-grouping-alert-add-modal">
data-hs-overlay="#edit-evaluation-grouping-alert-modal" (click)="currentModal='save'">
<i class="ri-save-3-line"></i>
Save
</button>
</div>
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-grouping-table-modal-select">
(click)="modal.search='';searchModalChange(pmstopicListFilter())"
data-hs-overlay="#edit-evaluation-grouping-pmstopic-table-modal">
<i class="ri-add-line"></i>
Add
</button>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal">
data-hs-overlay="#edit-evaluation-grouping-alert-modal"
(click)="currentModal='deleteGroup';pmsGroupAssessmentIndex=-1">
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
......@@ -92,97 +91,109 @@
<div class="page px-rem">
<div class="overflow-auto table-bordered rounded-t-md">
<div id="card-type-1" role="tabpanel" aria-labelledby="card-type-item-1">
<div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l&&!f">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg" width="50"
height="16" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr
*ngFor="let item of[
['HS-01', 'C1 CUSTOMER ORIENTED (SQCOME)','HOSHIN','5.0'],
['HS-02', 'C2 MANUFACTURING OPTIMIZATION','HOSHIN','3.0'],
['HS-03', 'C3 INCREASE EMPLOYEE ENGAGEMENT','HOSHIN','3.0'],
['HS-04', 'C4 HEALTHY FINANCIAL','HOSHIN','3.0'],
['HS-05', 'C5 RISK MANAGEMENT (TAXATION)','HOSHIN','1.0'],
['KP-01', 'ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา','KPI','10.0']];let i = index">
<td style="font-size: 12px; width: 10%;" class="text-center">
<input style="margin-right: 20px;" type="checkbox"
class="ti-form-checkbox cursor-pointer ">
<label>{{item[0]}}</label>
</td>
<td style="font-size: 12px; width: 35%; word-break: break-word; white-space: normal;">
{{item[1]}}
</td>
<td style="font-size: 12px; width: 20%;">{{item[2]}}</td>
<td class="text-center" style="font-size: 12px; width: 15%;">{{item[3]}}</td>
<td class="flex justify-center items-center">
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal"></i>
</td>
</tr>
</tbody>
</table>
</div>
<div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f || l || item === 'ระดับความหวัง'">
<span class="text-sm">{{ item }}</span>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="pmsGroupAssessment.loading">
<tr>
<td class="text-center" colspan="100%">
<div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1"
role="status" aria-label="loading">
<span class="sr-only">Loading...</span>
</div>
</td>
</tr>
</tbody>
<tbody *ngIf="!pmsGroupAssessment.loading&&!pmsGroupAssessmentListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="!pmsGroupAssessment.loading&&pmsGroupAssessmentListFilter().length">
<tr
*ngFor="let item of pmsGroupAssessmentListFilter()| slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer"
id="checkbox-{{item.data.pmsTopic.pmsTopicId}}" [(ngModel)]="item.check"
(ngModelChange)="dataListCheck()">
<label for="checkbox-{{item.data.pmsTopic.pmsTopicId}}">
&nbsp;{{item.data.pmsTopic.pmsTopicId}}
</label>
</td>
<td style="font-size: 12px; width: 60%;">
{{item.data.pmsTopic.tdesc}}
</td>
<td style="font-size: 12px">
{{item.data.pmsTopic.pmsType.tdesc}}
</td>
<td style="font-size: 12px;">
{{item.data.pmsTopic.weight}}
</td>
<td class="flex justify-center">
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#edit-evaluation-grouping-alert-modal"
(click)="currentModal='delete';pmsGroupAssessmentIndex=(((currentPage-1) * 10)+i);pmsGroupAssessmentIndex=i;searchModalChange(pmstopicListFilter())"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 py-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li><a class="page-link active" href="javascript:void(0);" aria-current="page">1</a>
</li>
<li><a class="page-link" href="javascript:void(0);">2</a></li>
<li><a class="page-link" href="javascript:void(0);">3</a></li>
<li><a class="page-link" href="javascript:void(0);">4</a></li>
<li><a class="page-link" href="javascript:void(0);">5</a></li>
<li><a class="page-link" href="javascript:void(0);">...</a></li>
<li><a class="page-link" href="javascript:void(0);">31</a></li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage-1 || 1)">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li *ngFor="let item of page;let f = first;let l = last">
<ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
<ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
<a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
(click)="currentPage=item">{{item}}
</a>
</ng-container>
<ng-container
*ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a>
</ng-container>
</li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
<ul class="nav-tabs mt-1">
<p>Show 1 to 10 of 50 items</p>
<ul class="nav-tabs mt-3">
<span>Show {{((currentPage-1) * 10)+1}} to {{pmsGroupAssessmentListFilter().length<10
?pmsGroupAssessmentListFilter().length: (currentPage==page.length ? ((currentPage * 10) -
((currentPage * 10) - pmsGroupAssessmentListFilter().length) ) :(currentPage * 10) ) }} of
{{pmsGroupAssessmentListFilter().length}} items</span>
</ul>
</div>
</nav>
</div>
<div id="edit-evaluation-grouping-table-modal-select" class="hs-overlay hidden ti-modal">
<div
class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:mx-auto h-[calc(100%-3.5rem)] items-center">
<div id="edit-evaluation-grouping-pmstopic-table-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto">
<div class="max-h-full overflow-hidden ti-modal-content">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
......@@ -190,7 +201,7 @@
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-grouping-table-modal-select">
data-hs-overlay="#edit-evaluation-grouping-pmstopic-table-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
......@@ -202,161 +213,130 @@
<div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder="Search by No. or Name">
placeholder="Search by No. or Name" [(ngModel)]="modal.search"
(ngModelChange)="searchModalChange(pmstopicListFilter())">
<div
class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
<i class="ri-search-line text-gray"></i>
</div>
</div>
</div>
<div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div>
</div>
<div class="overflow-auto table-bordered" style="border-radius: 5px;">
<div class="overflow-auto border">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l">
<span class="text-sm">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0"
*ngIf="!f && i==1">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg"
width="30" height="13" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
<div class="page px-rem">
<div class="overflow-auto table-bordered rounded-t-md">
<div class="overflow-auto shadow-md rounded-t-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; let f = first; let l = last; let i = index">
<th scope="col"
class=" px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0">
<i class="ti ti-dots-vertical fs-l"></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody *ngIf="pmstopic.loading">
<tr>
<td class="text-center" colspan="100%">
<div *ngFor="let item of [1,2,3]"
class="ti-spinner w-8 h-8 text-secondary mx-1" role="status"
aria-label="loading">
<span class="sr-only">Loading...</span>
</div>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0"
*ngIf="!f && i==2">
<svg class="head-table-icon" xmlns="http://www.w3.org/2000/svg"
width="20" height="13" fill="currentColor" viewBox="0 0 16 16">
<path
d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z">
</path>
</svg>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr
*ngFor="let item of[
['HS-01', 'C1 CUSTOMER ORIENTED (SQCOME)','HOSHIN','5.0'],
['HS-02', 'C2 MANUFACTURING OPTIMIZATION','HOSHIN','3.0'],
['HS-03', 'C3 INCREASE EMPLOYEE ENGAGEMENT','HOSHIN','3.0'],
['HS-04', 'C4 HEALTHY FINANCIAL','HOSHIN','3.0'],
['HS-05', 'C5 RISK MANAGEMENT (TAXATION)','HOSHIN','1.0'],
['KP-01', 'ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา','KPI','10.0']];let i = index">
<td style="font-size: 12px; width: 10%;" class="text-center">
{{item[0]}}
</td>
<td
style="font-size: 12px; width: 35%; word-break: break-word; white-space: normal;">
{{item[1]}}
</td>
<td style="font-size: 12px; width: 20%;">{{item[2]}}</td>
<td class="text-center" style="font-size: 12px; width: 15%;">{{item[3]}}</td>
<td class="flex justify-center">
<div class="px-1">
<button type="button"
</td>
</tr>
</tbody>
<tbody *ngIf="!pmstopic.loading&&!pmstopicListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="!pmstopic.loading&&pmstopicListFilter().length">
<tr
*ngFor="let item of pmstopicListFilter() | slice:((modal.currentPage-1) * 10) : (((modal.currentPage-1) * 10) + 10);let i = index">
<td class="text-center">
{{item.data.pmsTopicId}}
</td>
<td>{{item.data.tdesc}}</td>
<td>{{item.data.pmsType.tdesc}}</td>
<td>{{item.data.weight}}</td>
<td class="text-center"> <button type="button"
class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay="#edit-evaluation-grouping-table-modal-select">
data-hs-overlay="#edit-evaluation-grouping-pmstopic-table-modal"
(click)="selectPmstopic(item.data)">
<i class="ri-add-line"></i>
Select
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body-content" style="margin-top: 20px;">
<ul class="nav-tabs">
<div class="px-1 bg-white rounded-2 shadow justify-content-center align-items-center">
<div class="box-body">
<nav class="pagination-style-3 overflow-auto">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li><a class="page-link active" href="javascript:void(0);"
aria-current="page">1</a></li>
<li><a class="page-link" href="javascript:void(0);">2</a></li>
<li><a class="page-link" href="javascript:void(0);">3</a></li>
<li><a class="page-link" href="javascript:void(0);">4</a></li>
<li><a class="page-link" href="javascript:void(0);">5</a></li>
<li><a class="page-link" href="javascript:void(0);">...</a></li>
<li><a class="page-link" href="javascript:void(0);">31</a></li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
</ul>
<ul class="nav-tabs mt-1">
<p>Show 1 to 10 of 50 items</p>
</ul>
</div>
</div>
</div>
</div>
</div>
</button></td>
<div id="edit-evaluation-grouping-alert-add-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-grouping-alert-add-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</tr>
</tbody>
</table>
</div>
</div>
<nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length">
<ul class="ti-pagination">
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="modal.currentPage = (modal.currentPage-1 || 1)">
<i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
<li *ngFor="let item of modal.page;let f = first;let l = last">
<ng-container
*ngIf="item==3&&modal.currentPage!=1&&modal.currentPage!=2&&modal.currentPage!=3">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i
class="ri-more-line"></i>
</a>
</ng-container>
<ng-container
*ngIf="(f||l)||(item==modal.currentPage-1||item==modal.currentPage||item==modal.currentPage+1)">
<a class="page-link" href="javascript:void(0);"
[class.active]="item==modal.currentPage"
(click)="modal.currentPage=item">{{item}}
</a>
</ng-container>
<ng-container
*ngIf="item==modal.page.length-2&&modal.currentPage!=modal.page.length&&modal.currentPage!=modal.page.length-1&&modal.currentPage!=modal.page.length-2">
<a aria-label="anchor" class="page-link" href="javascript:void(0);"><i
class="ri-more-line"></i>
</a>
</ng-container>
</li>
<li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"
(click)="modal.currentPage = (modal.currentPage > modal.page.length-1 ? modal.currentPage: modal.currentPage+1 )">
<i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a>
</li>
</ul>
<ul class="nav-tabs mt-3">
<span>Show {{((modal.currentPage-1) * 10)+1}} to {{pmstopicListFilter().length<10
?pmstopicListFilter().length: (modal.currentPage==modal.page.length ?
((modal.currentPage * 10) - ((modal.currentPage * 10) - pmstopicListFilter().length)
) :(modal.currentPage * 10) ) }} of {{pmstopicListFilter().length}} items</span>
</ul>
</nav>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการบันทึกข้อมูลหรือไม่
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<div class="flex justify-end mt-2rem mb-1rem space-x-4">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary 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="#edit-evaluation-grouping-modal-add">
data-hs-overlay="#edit-evaluation-grouping-pmstopic-table-modal">
ย้อนกลับ
</button>
<!-- <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-add-modal" (click)="addUser();showSuccess()">
บันทึกข้อมูล
</a> -->
</div>
</div>
</div>
</div>
</div>
<div id="edit-evaluation-grouping-alert-edit-modal" class="hs-overlay hidden ti-modal">
<div id="edit-evaluation-grouping-alert-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content w-full">
<div class="ti-modal-header">
......@@ -365,64 +345,43 @@
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-grouping-alert-edit-modal">
data-hs-overlay="#edit-evaluation-grouping-alert-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการเเก้ไขข้อมูลหรือไม่
<p class="mt-1 text-gray-800 dark:text-white/70" *ngIf="currentModal=='save'">
ยืนยันการบันทึกข้อมูลหรือไม่!
</p>
<p class="mt-1 text-gray-800 dark:text-white/70"
*ngIf="currentModal=='delete'||currentModal=='deleteGroup'">
ยืนยันการลบข้อมูลหรือไม่
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<div class="flex justify-end mt-2rem mb-1rem" *ngIf="currentModal=='save'">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary 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="#edit-evaluation-grouping-modal-edit">
data-hs-overlay="#edit-evaluation-grouping-alert-modal">
ย้อนกลับ
</button>
<!-- <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-edit-modal"
(click)="addUser();showSuccessEdit()">
<a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-modal" (click)="savePmsGroupAssessment()">
บันทึกข้อมูล
</a> -->
</div>
</div>
</div>
</div>
</div>
<div id="edit-evaluation-grouping-alert-delete-modal" class="hs-overlay hidden ti-modal">
<div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
<div class="max-h-full overflow-hidden ti-modal-content w-full">
<div class="ti-modal-header">
<h3 class="text-xxl font-bold text-primary">
แจ้งเตือน
</h3>
<div class="flex justify-end">
<button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal">
<span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i>
</button>
</a>
</div>
</div>
<div class="ti-modal-body ">
<p class="mt-1 text-gray-800 dark:text-white/70">
ยืนยันการลบข้อมูลหรือไม่!
</p>
<div class="flex justify-end mt-2rem mb-1rem">
<div class="flex justify-end mt-2rem mb-1rem"
*ngIf="currentModal=='delete'||currentModal=='deleteGroup'">
<button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary 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="#edit-evaluation-grouping-alert-delete-modal">
data-hs-overlay="#edit-evaluation-grouping-alert-modal">
ย้อนกลับ
</button>
<!-- <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal"
(click)="addUser();showSuccessDelete()">
<a class="ti-btn ti-btn-danger" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-modal" (click)="deletePmsGroupAssessment()">
ลบข้อมูล
</a> -->
</a>
</div>
</div>
</div>
......
import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { MyPLModel, PLModel } from 'src/app/shared/model/pl.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 { MyPmstopicModel, PmstopicModel } from 'src/app/shared/model/pmstopic.model';
import { PmsGroupAssessmentService } from 'src/app/shared/services/pms-group-assessment.service';
import { PmstopicService } from 'src/app/shared/services/pmstopic.service';
export interface DataModal {
search: string,
currentPage: number,
page: number[]
}
@Component({
selector: 'app-edit-evaluation-grouping',
templateUrl: './edit-evaluation-grouping.component.html',
......@@ -14,19 +22,60 @@ export class EditEvaluationGroupingComponent {
currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1);
search = ""
currentModal: 'add' | 'edit' | 'delete' | 'deleteGroup' = "add"
currentModal: 'save' | 'delete' | 'deleteGroup' = "save"
modal: DataModal = {
search: "",
currentPage: 1,
page: Array.from({ length: 1 }, (_, i) => i + 1)
}
pmsGroupAssessment: { loading: boolean, select: PmsGroupAssessment1Model, dataList: { check: boolean, data: PmsGroupAssessment1Model }[] } = { loading: false, select: new MyPmsGroupAssessment1Model(), dataList: [] }
pmsGroupAssessmentIndex = -1
pmstopic: { loading: boolean, select: PmstopicModel, dataList: { check: boolean, data: PmstopicModel }[] } = { loading: false, select: new MyPmstopicModel(), dataList: [] }
numDataListChecked = 0
isDataListChecked = false
isDataListCheckedAll = false
constructor(private toastr: ToastrService,
private pmsGroupAssessmentService: PmsGroupAssessmentService,
private cdr: ChangeDetectorRef
private cdr: ChangeDetectorRef,
private pmstopicService: PmstopicService
) { }
ngOnInit(): void {
this.getPmsGroupAssessmentBy_plId()
this.getPmstopicList()
}
getPmstopicList() {
this.pmstopic.loading = true
this.pmstopicService.getList().subscribe({
next: response => {
this.pmstopic.dataList = response.map(x => ({ check: false, data: new MyPmstopicModel(x) }))
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.pmstopic.loading = false
this.cdr.detectChanges()
}, error: error => {
this.pmstopic.loading = false
this.cdr.detectChanges()
}
})
}
pmstopicListFilter() {
return this.pmstopic.dataList.filter(x => {
const data = x.data
if (this.pmsGroupAssessment.dataList.some(y => y.data.pmsTopic.pmsTopicId == data.pmsTopicId)) {
return
}
const match = data.pmsTopicId.toLowerCase().includes(this.modal.search.toLowerCase()) ||
data.tdesc.toLowerCase().includes(this.modal.search.toLowerCase())
return match
})
}
selectPmstopic(data?: PmstopicModel) {
this.pmsGroupAssessment.dataList.push({ check: false, data: new MyPmsGroupAssessment1Model({ pmsTopic: new MyPmstopicModel(data) }) })
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.markForCheck()
}
getPmsGroupAssessmentBy_plId() {
......@@ -56,6 +105,11 @@ export class EditEvaluationGroupingComponent {
this.pmsGroupAssessment.select = new MyPmsGroupAssessment1Model(data)
}
searchModalChange(dataList: any[]) {
this.modal.currentPage = 1
this.modal.page = Array.from({ length: Math.ceil(dataList.length / 10) }, (_, i) => i + 1);
this.cdr.markForCheck()
}
searchChange() {
this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.pmsGroupAssessmentListFilter().length / 10) }, (_, i) => i + 1)
......@@ -74,6 +128,49 @@ export class EditEvaluationGroupingComponent {
this.isDataListChecked = Boolean(this.numDataListChecked)
}
savePmsGroupAssessment() {
const body = {
personalLevel: new MyPLModel(this.pl),
companyId: "",
pmsGroupAssessment1List: this.pmsGroupAssessment.dataList.map(x => new MyPmsGroupAssessment1Model(x.data))
}
this.pmsGroupAssessmentService.post(body).subscribe({
next: response => {
if (response.success) {
this.showAlert(response.message, 'success')
} else {
this.showAlert(response.message, 'error')
}
this.cdr.detectChanges()
}, error: error => {
this.showAlert(error.message, 'error')
this.cdr.detectChanges()
}
})
}
deletePmsGroupAssessment() {
switch (this.currentModal) {
case ('delete'): {
this.pmsGroupAssessment.dataList = this.pmsGroupAssessment.dataList.filter((_, i) => i != this.pmsGroupAssessmentIndex)
break;
}
case ('deleteGroup'): {
this.pmsGroupAssessment.dataList = this.pmsGroupAssessment.dataList.filter((x) => !x.check)
break;
}
}
this.isDataListCheckedAll = false
this.dataListCheckAll()
this.cdr.markForCheck()
}
showAlert(text: string, type: 'success' | 'error') {
this.toastr[type](text, 'แจ้งเตือน', {
timeOut: 3000,
positionClass: 'toast-top-right',
})
}
onBack() {
this.sendOnEdit.emit(false);
}
......
......@@ -54,8 +54,26 @@
</ng-container>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of pl.dataList;let i = index">
<tbody *ngIf="pl.loading">
<tr>
<td class="text-center" colspan="100%">
<div *ngFor="let item of [1,2,3]" class="ti-spinner w-8 h-8 text-secondary mx-1"
role="status" aria-label="loading">
<span class="sr-only">Loading...</span>
</div>
</td>
</tr>
</tbody>
<tbody *ngIf="!pl.loading&&!plListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody *ngIf="!pl.loading&&plListFilter().length">
<tr
*ngFor="let item of plListFilter()| slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
<td style="font-size: 12px; padding-left: 4rem;">{{item.data.plId}}</td>
<td style="font-size: 12px; padding-left: 1.5rem; width: 600px;">{{item.data.tdesc}}
</td>
......
......@@ -99,7 +99,7 @@ export class EvaluationGroupingComponent {
plListFilter() {
return this.pl.dataList.filter(x => {
const data = x.data
const match = data.plId.toLowerCase().includes(this.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.search.toLowerCase()) || data.edesc.toLowerCase().includes(this.search.toLowerCase());
const match = data.plId.toLowerCase().includes(this.search.toLowerCase()) || data.tdesc.toLowerCase().includes(this.search.toLowerCase())
return match;
});
}
......
......@@ -68,7 +68,7 @@
<thead>
<tr>
<ng-container
*ngFor="let item of ['รหัส','ชื่อประเภท','ชื่อย่อ','การจัดการ']; let f = first; let l = last; let i = index">
*ngFor="let item of ['รหัส','ชื่อประเภท','ชื่อย่อ','Action']; let f = first; let l = last; let i = index">
<th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
......@@ -175,7 +175,8 @@
<div class="w-full flex justify-end">
<div class="absolute flex">
<div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md" (click)="clearPmstopic(modalStatus)">
<button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(click)="clearPmstopic(modalStatus)">
<svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
......
export interface SettingAssessmentModel {
apsyear: string;
companyId: string;
expectationLevel: number;
settingGroupAssessment: string;
settingScore5: number;
settingScore4: number;
settingScore3: number;
settingScore2: number;
settingScore1: number;
apsyear: string;
companyId: string;
expectationLevel: number;
settingGroupAssessment: string;
settingScore5: number;
settingScore4: number;
settingScore3: number;
settingScore2: number;
settingScore1: number;
}
export class MySettingAssessmentModel implements SettingAssessmentModel {
apsyear: string;
companyId: string;
expectationLevel: number;
settingGroupAssessment: string;
settingScore5: number;
settingScore4: number;
settingScore3: number;
settingScore2: number;
settingScore1: number;
constructor(data?: Partial<SettingAssessmentModel>) {
this.apsyear = data?.apsyear || "";
this.companyId = data?.companyId || "";
this.expectationLevel = data?.expectationLevel ?? 0;
this.settingGroupAssessment = data?.settingGroupAssessment || "";
this.settingScore5 = data?.settingScore5 ?? 0;
this.settingScore4 = data?.settingScore4 ?? 0;
this.settingScore3 = data?.settingScore3 ?? 0;
this.settingScore2 = data?.settingScore2 ?? 0;
this.settingScore1 = data?.settingScore1 ?? 0;
}
export class MySettingAssessmentModel implements SettingAssessmentModel {
apsyear: string;
companyId: string;
expectationLevel: number;
settingGroupAssessment: string;
settingScore5: number;
settingScore4: number;
settingScore3: number;
settingScore2: number;
settingScore1: number;
constructor(data: Partial<SettingAssessmentModel>) {
this.apsyear = data.apsyear || "";
this.companyId = data.companyId || "";
this.expectationLevel = data.expectationLevel ?? 0;
this.settingGroupAssessment = data.settingGroupAssessment || "";
this.settingScore5 = data.settingScore5 ?? 0;
this.settingScore4 = data.settingScore4 ?? 0;
this.settingScore3 = data.settingScore3 ?? 0;
this.settingScore2 = data.settingScore2 ?? 0;
this.settingScore1 = data.settingScore1 ?? 0;
}
}
\ No newline at end of file
}
......@@ -6,29 +6,29 @@ import { AlertModel } from '../model/alert.model';
import { SettingAssessmentModel } from '../model/setting-assessment.model';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class SettingAssessmentService {
api = "/setting-assessment"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
getList(): Observable<SettingAssessmentModel[]> {
return this.http.get<SettingAssessmentModel[]>(this.urlApi + "/lists")
}
// getById(companyId: string): Observable<SettingAssessmentModel> {
// return this.http.get<SettingAssessmentModel>(this.urlApi + "/" + companyId)
// }
post(body: SettingAssessmentModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: SettingAssessmentModel | SettingAssessmentModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
api = "/setting-assessment"
urlApi = environment.baseUrl + this.api
constructor(private http: HttpClient) {
}
get(): Observable<SettingAssessmentModel> {
return this.http.get<SettingAssessmentModel>(this.urlApi + "")
}
// getById(companyId: string): Observable<SettingAssessmentModel> {
// return this.http.get<SettingAssessmentModel>(this.urlApi + "/" + companyId)
// }
post(body: SettingAssessmentModel): Observable<AlertModel> {
return this.http.post<AlertModel>(this.urlApi, body)
}
delete(body: SettingAssessmentModel | SettingAssessmentModel[]): Observable<AlertModel> {
const options = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
};
return this.http.delete<AlertModel>(this.urlApi, options)
}
}
}
......@@ -24729,6 +24729,9 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
.bg-input-readonly {
background-color: rgb(241 245 249 / var(--tw-bg-opacity));
}
.\!bg-input-readonly {
background-color: rgb(241 245 249) !important;
}
.ml-8 {
margin-left: 2rem;
......@@ -24907,10 +24910,9 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
margin-top: -0.75rem !important;
}
.\!rounded-t-none {
border-top-left-radius: 0rem !important;
border-top-right-radius: 0rem !important;
border-top-left-radius: 0rem !important;
border-top-right-radius: 0rem !important;
}
.rounded-t-none {
border-top-left-radius: 0rem;
......@@ -24919,4 +24921,4 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
.masked-input {
-webkit-text-security: disc; /* Safari, Chrome */
}
\ 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