Commit b0875272 by Nattana Chaiyamat

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

parent b27d54ee
...@@ -284,14 +284,11 @@ export class UserSettingsComponent { ...@@ -284,14 +284,11 @@ export class UserSettingsComponent {
clearDataUser(currentModal: string) { clearDataUser(currentModal: string) {
if (currentModal == 'add') { if (currentModal == 'add') {
this.user.select.usernameId = '' this.selectUser()
this.user.select.employee.employeeId = ''
this.user.select.role.roleId = ''
this.user.select.level.userLevel = ''
} else if (currentModal == 'edit') { } else if (currentModal == 'edit') {
this.user.select.employee.employeeId = '' this.selectEmployee()
this.user.select.role.roleId = '' this.selectRole()
this.user.select.level.userLevel = '' this.selectLevel()
} }
} }
showAlert(text: string, type: 'success' | 'error') { showAlert(text: string, type: 'success' | 'error') {
......
...@@ -12,36 +12,33 @@ ...@@ -12,36 +12,33 @@
</div> </div>
</div> </div>
</div> </div>
<div class="py-2 border-b-2 border-collapse "> <div class="mt-2rem pb-1rem border-b-2 border-collapse ">
<div class="grid grid-cols-3 gap-6 mt-2 "> <div class="grid grid-cols-3">
<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 class="ti-form-label">ระดับพนักงาน</label>
</div> </div>
</div> </div>
<div class="grid"> <div class="grid grid-cols-6">
<input type="text" id="input-label" <input type="text" class="ti-form-input !bg-input-readonly" readonly [(ngModel)]="pl.plId">
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> </div>
</div> </div>
<div class="header-title-type"> <div class="header-title-type mt-2rem mb-1rem">
<div class="flex justify-between"> <div class="flex justify-between ">
<div class="flex"> <div class="flex">
<!-- Content ของ div แรก -->
<div class="flex gap-x-6"> <div class="flex gap-x-6">
<div class="flex items-center"> <div class="flex items-center">
<input type="checkbox" class="ti-form-checkbox mt-0.5" id="hs-checkbox-group-1"> <input type="checkbox" class="ti-form-checkbox pointer-events-none" [(ngModel)]="isDataListChecked">
<label for="hs-checkbox-group-1" <label class="text-sm text-gray-500 mx-2 pointer-events-none">
class="text-sm text-gray-500 ltr:ml-2 rtl:mr-2 dark:text-white/70">0 Selected</label> {{numDataListChecked}} Selected</label>
</div> </div>
<div class="mx-1 flex items-center">
<div class="flex items-center"> <button (click)="isDataListCheckedAll = !isDataListCheckedAll;dataListCheckAll()"
<!-- <i (click)="toggleCheckbox()" class="focus:ring-2 focus:ring-primary rounded-sm flex item-center">
[ngClass]="{'ri-checkbox-multiple-line': !isChecked, 'ri-checkbox-multiple-fill': isChecked}" <i class="fs-l transition-all duration-200"
class="ri-checkbox-multiple-line text-gray-500 dark:text-white/70"></i> [ngClass]="{'ri-checkbox-multiple-line text-gray-500': !isDataListCheckedAll, 'ri-checkbox-multiple-fill text-primary': isDataListCheckedAll}"></i>
<label for="hs-checkbox-group-2" class="text-sm text-gray-500 ltr:ml-2 rtl:mr-2 dark:text-white/70" </button>
(click)="toggleCheckbox()">Select All</label> --> <label class="text-sm text-gray-500 ml-2">Select All</label>
</div> </div>
</div> </div>
</div> </div>
...@@ -51,7 +48,7 @@ ...@@ -51,7 +48,7 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <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" 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 <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"> 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> <i class="ri-search-line text-gray"></i>
...@@ -60,21 +57,23 @@ ...@@ -60,21 +57,23 @@
</div> </div>
<div class="px-1"> <div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-success h-20px m-0 shadow-md" <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> <i class="ri-save-3-line"></i>
Save Save
</button> </button>
</div> </div>
<div class="px-1"> <div class="px-1">
<button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md" <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> <i class="ri-add-line"></i>
Add Add
</button> </button>
</div> </div>
<div class="px-1"> <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px 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="#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> <i class="ri-delete-bin-6-line"></i>
Delete Delete
</button> </button>
...@@ -92,7 +91,6 @@ ...@@ -92,7 +91,6 @@
<div class="page px-rem"> <div class="page px-rem">
<div class="overflow-auto table-bordered rounded-t-md"> <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"> <div class="overflow-auto shadow-md">
<table class="ti-custom-table ti-custom-table-head ti-custom-table-hover"> <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead> <thead>
...@@ -100,89 +98,102 @@ ...@@ -100,89 +98,102 @@
<ng-container <ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; 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" <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
[class.!text-center]="f||l"> [class.!text-center]="f || l || item === 'ระดับความหวัง'">
<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&&!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> </th>
</ng-container> </ng-container>
</tr> </tr>
</thead> </thead>
<tbody> <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 <tr
*ngFor="let item of[ *ngFor="let item of pmsGroupAssessmentListFilter()| slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
['HS-01', 'C1 CUSTOMER ORIENTED (SQCOME)','HOSHIN','5.0'], <td class="text-center">
['HS-02', 'C2 MANUFACTURING OPTIMIZATION','HOSHIN','3.0'], <input type="checkbox" class="ti-form-checkbox cursor-pointer"
['HS-03', 'C3 INCREASE EMPLOYEE ENGAGEMENT','HOSHIN','3.0'], id="checkbox-{{item.data.pmsTopic.pmsTopicId}}" [(ngModel)]="item.check"
['HS-04', 'C4 HEALTHY FINANCIAL','HOSHIN','3.0'], (ngModelChange)="dataListCheck()">
['HS-05', 'C5 RISK MANAGEMENT (TAXATION)','HOSHIN','1.0'], <label for="checkbox-{{item.data.pmsTopic.pmsTopicId}}">
['KP-01', 'ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา','KPI','10.0']];let i = index"> &nbsp;{{item.data.pmsTopic.pmsTopicId}}
<td style="font-size: 12px; width: 10%;" class="text-center"> </label>
<input style="margin-right: 20px;" type="checkbox" </td>
class="ti-form-checkbox cursor-pointer "> <td style="font-size: 12px; width: 60%;">
<label>{{item[0]}}</label> {{item.data.pmsTopic.tdesc}}
</td> </td>
<td style="font-size: 12px; width: 35%; word-break: break-word; white-space: normal;"> <td style="font-size: 12px">
{{item[1]}} {{item.data.pmsTopic.pmsType.tdesc}}
</td> </td>
<td style="font-size: 12px; width: 20%;">{{item[2]}}</td> <td style="font-size: 12px;">
<td class="text-center" style="font-size: 12px; width: 15%;">{{item[3]}}</td> {{item.data.pmsTopic.weight}}
<td class="flex justify-center items-center"> </td>
<td class="flex justify-center">
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" <i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal"></i> data-hs-overlay="#edit-evaluation-grouping-alert-modal"
(click)="currentModal='delete';pmsGroupAssessmentIndex=(((currentPage-1) * 10)+i);pmsGroupAssessmentIndex=i;searchModalChange(pmstopicListFilter())"></i>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> <nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
<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"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"> <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> <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a> </a>
</li> </li>
<li><a class="page-link active" href="javascript:void(0);" aria-current="page">1</a> <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>
<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> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"> <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> <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a> </a>
</li> </li>
</ul> </ul>
</nav> <ul class="nav-tabs mt-3">
</div> <span>Show {{((currentPage-1) * 10)+1}} to {{pmsGroupAssessmentListFilter().length<10
</div> ?pmsGroupAssessmentListFilter().length: (currentPage==page.length ? ((currentPage * 10) -
</ul> ((currentPage * 10) - pmsGroupAssessmentListFilter().length) ) :(currentPage * 10) ) }} of
<ul class="nav-tabs mt-1"> {{pmsGroupAssessmentListFilter().length}} items</span>
<p>Show 1 to 10 of 50 items</p>
</ul> </ul>
</div> </nav>
</div> </div>
<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 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 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">
...@@ -190,7 +201,7 @@ ...@@ -190,7 +201,7 @@
</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"
data-hs-overlay="#edit-evaluation-grouping-table-modal-select"> data-hs-overlay="#edit-evaluation-grouping-pmstopic-table-modal">
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i> <i class="ti ti-circle-x fs-xxl"></i>
</button> </button>
...@@ -202,161 +213,130 @@ ...@@ -202,161 +213,130 @@
<div class="relative shadow-md"> <div class="relative shadow-md">
<input type="text" id="hs-leading-icon" name="hs-leading-icon" <input type="text" id="hs-leading-icon" name="hs-leading-icon"
class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " 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 <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"> 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> <i class="ri-search-line text-gray"></i>
</div> </div>
</div> </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>
<div class="overflow-auto table-bordered" style="border-radius: 5px;"> <div class="page px-rem">
<div class="overflow-auto border"> <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"> <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover">
<thead> <thead>
<tr> <tr>
<ng-container <ng-container
*ngFor="let item of ['รหัส','ชื่อหัวข้อ','ประเภท','น้ำหนัก','Action']; 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" <th scope="col"
[class.!text-center]="f||l"> class=" px-10px py-10px bg-soft-secondary text-primary !text-center">
<span class="text-sm">{{ item }}</span> <span class="font-size-12px font-weight-700">{{ item }}</span>
<div class="absolute top-1/2 transform -translate-y-1/2 right-0" <div class="absolute top-1/2 transform -translate-y-1/2 right-0">
*ngIf="!f && i==1"> <i class="ti ti-dots-vertical fs-l"></i>
<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>
<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> </div>
</th> </th>
</ng-container> </ng-container>
</tr> </tr>
</thead> </thead>
<tbody> <tbody *ngIf="pmstopic.loading">
<tr <tr>
*ngFor="let item of[ <td class="text-center" colspan="100%">
['HS-01', 'C1 CUSTOMER ORIENTED (SQCOME)','HOSHIN','5.0'], <div *ngFor="let item of [1,2,3]"
['HS-02', 'C2 MANUFACTURING OPTIMIZATION','HOSHIN','3.0'], class="ti-spinner w-8 h-8 text-secondary mx-1" role="status"
['HS-03', 'C3 INCREASE EMPLOYEE ENGAGEMENT','HOSHIN','3.0'], aria-label="loading">
['HS-04', 'C4 HEALTHY FINANCIAL','HOSHIN','3.0'], <span class="sr-only">Loading...</span>
['HS-05', 'C5 RISK MANAGEMENT (TAXATION)','HOSHIN','1.0'], </div>
['KP-01', 'ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา','KPI','10.0']];let i = index">
<td style="font-size: 12px; width: 10%;" class="text-center">
{{item[0]}}
</td> </td>
<td </tr>
style="font-size: 12px; width: 35%; word-break: break-word; white-space: normal;"> </tbody>
{{item[1]}} <tbody *ngIf="!pmstopic.loading&&!pmstopicListFilter().length">
<tr>
<td class="text-center" colspan="100%">
ไม่พบข้อมูล
</td> </td>
<td style="font-size: 12px; width: 20%;">{{item[2]}}</td> </tr>
<td class="text-center" style="font-size: 12px; width: 15%;">{{item[3]}}</td> </tbody>
<td class="flex justify-center"> <tbody *ngIf="!pmstopic.loading&&pmstopicListFilter().length">
<div class="px-1"> <tr
<button type="button" *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" 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> <i class="ri-add-line"></i>
Select Select
</button> </button></td>
</div>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="body-content" style="margin-top: 20px;"> <nav class="pagination-style-3 overflow-auto my-5" *ngIf="modal.page.length">
<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"> <ul class="ti-pagination">
<li> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"> <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> <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
</a> </a>
</li> </li>
<li><a class="page-link active" href="javascript:void(0);" <li *ngFor="let item of modal.page;let f = first;let l = last">
aria-current="page">1</a></li> <ng-container
<li><a class="page-link" href="javascript:void(0);">2</a></li> *ngIf="item==3&&modal.currentPage!=1&&modal.currentPage!=2&&modal.currentPage!=3">
<li><a class="page-link" href="javascript:void(0);">3</a></li> <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i
<li><a class="page-link" href="javascript:void(0);">4</a></li> class="ri-more-line"></i>
<li><a class="page-link" href="javascript:void(0);">5</a></li> </a>
<li><a class="page-link" href="javascript:void(0);">...</a></li> </ng-container>
<li><a class="page-link" href="javascript:void(0);">31</a></li> <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> <li>
<a aria-label="anchor" class="page-link" href="javascript:void(0);"> <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> <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
</a> </a>
</li> </li>
</ul> </ul>
</nav> <ul class="nav-tabs mt-3">
</div> <span>Show {{((modal.currentPage-1) * 10)+1}} to {{pmstopicListFilter().length<10
</div> ?pmstopicListFilter().length: (modal.currentPage==modal.page.length ?
</ul> ((modal.currentPage * 10) - ((modal.currentPage * 10) - pmstopicListFilter().length)
<ul class="nav-tabs mt-1"> ) :(modal.currentPage * 10) ) }} of {{pmstopicListFilter().length}} items</span>
<p>Show 1 to 10 of 50 items</p>
</ul> </ul>
</nav>
</div> </div>
</div> <div class="flex justify-end mt-2rem mb-1rem space-x-4">
</div>
</div>
</div>
<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>
</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" <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" 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> </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>
</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="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="max-h-full overflow-hidden ti-modal-content w-full">
<div class="ti-modal-header"> <div class="ti-modal-header">
...@@ -365,64 +345,43 @@ ...@@ -365,64 +345,43 @@
</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"
data-hs-overlay="#edit-evaluation-grouping-alert-edit-modal"> data-hs-overlay="#edit-evaluation-grouping-alert-modal">
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
<i class="ti ti-circle-x fs-xxl"></i> <i class="ti ti-circle-x fs-xxl"></i>
</button> </button>
</div> </div>
</div> </div>
<div class="ti-modal-body "> <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> </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" <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" 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> </button>
<!-- <a class="ti-btn ti-btn-success" href="javascript:void(0);" <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-edit-modal" data-hs-overlay="#edit-evaluation-grouping-alert-modal" (click)="savePmsGroupAssessment()">
(click)="addUser();showSuccessEdit()">
บันทึกข้อมูล บันทึกข้อมูล
</a> --> </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>
</div>
</div> </div>
<div class="ti-modal-body "> <div class="flex justify-end mt-2rem mb-1rem"
<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">
<button type="button" <button type="button"
class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary 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" 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> </button>
<!-- <a class="ti-btn ti-btn-success" href="javascript:void(0);" <a class="ti-btn ti-btn-success" href="javascript:void(0);"
data-hs-overlay="#edit-evaluation-grouping-alert-delete-modal" data-hs-overlay="#edit-evaluation-grouping-alert-modal" (click)="deletePmsGroupAssessment()">
(click)="addUser();showSuccessDelete()">
ลบข้อมูล ลบข้อมูล
</a> --> </a>
</div> </div>
</div> </div>
</div> </div>
......
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 { 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 { 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 { 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({ @Component({
selector: 'app-edit-evaluation-grouping', selector: 'app-edit-evaluation-grouping',
templateUrl: './edit-evaluation-grouping.component.html', templateUrl: './edit-evaluation-grouping.component.html',
...@@ -14,19 +22,60 @@ export class EditEvaluationGroupingComponent { ...@@ -14,19 +22,60 @@ export class EditEvaluationGroupingComponent {
currentPage = 1 currentPage = 1
page = Array.from({ length: 1 }, (_, i) => i + 1); page = Array.from({ length: 1 }, (_, i) => i + 1);
search = "" 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: [] } 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 numDataListChecked = 0
isDataListChecked = false isDataListChecked = false
isDataListCheckedAll = false isDataListCheckedAll = false
constructor(private toastr: ToastrService, constructor(private toastr: ToastrService,
private pmsGroupAssessmentService: PmsGroupAssessmentService, private pmsGroupAssessmentService: PmsGroupAssessmentService,
private cdr: ChangeDetectorRef private cdr: ChangeDetectorRef,
private pmstopicService: PmstopicService
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.getPmsGroupAssessmentBy_plId() 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() { getPmsGroupAssessmentBy_plId() {
...@@ -56,6 +105,11 @@ export class EditEvaluationGroupingComponent { ...@@ -56,6 +105,11 @@ export class EditEvaluationGroupingComponent {
this.pmsGroupAssessment.select = new MyPmsGroupAssessment1Model(data) 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() { searchChange() {
this.currentPage = 1 this.currentPage = 1
this.page = Array.from({ length: Math.ceil(this.pmsGroupAssessmentListFilter().length / 10) }, (_, i) => i + 1) this.page = Array.from({ length: Math.ceil(this.pmsGroupAssessmentListFilter().length / 10) }, (_, i) => i + 1)
...@@ -74,6 +128,49 @@ export class EditEvaluationGroupingComponent { ...@@ -74,6 +128,49 @@ export class EditEvaluationGroupingComponent {
this.isDataListChecked = Boolean(this.numDataListChecked) 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() { onBack() {
this.sendOnEdit.emit(false); this.sendOnEdit.emit(false);
} }
......
...@@ -54,8 +54,26 @@ ...@@ -54,8 +54,26 @@
</ng-container> </ng-container>
</tr> </tr>
</thead> </thead>
<tbody> <tbody *ngIf="pl.loading">
<tr *ngFor="let item of pl.dataList;let i = index"> <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: 4rem;">{{item.data.plId}}</td>
<td style="font-size: 12px; padding-left: 1.5rem; width: 600px;">{{item.data.tdesc}} <td style="font-size: 12px; padding-left: 1.5rem; width: 600px;">{{item.data.tdesc}}
</td> </td>
......
...@@ -99,7 +99,7 @@ export class EvaluationGroupingComponent { ...@@ -99,7 +99,7 @@ export class EvaluationGroupingComponent {
plListFilter() { plListFilter() {
return this.pl.dataList.filter(x => { return this.pl.dataList.filter(x => {
const data = x.data 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; return match;
}); });
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,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 ['รหัส','ชื่อประเภท','ชื่อย่อ','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"> <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> <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"> <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
...@@ -175,7 +175,8 @@ ...@@ -175,7 +175,8 @@
<div class="w-full flex justify-end"> <div class="w-full flex justify-end">
<div class="absolute flex"> <div class="absolute flex">
<div class="px-1"> <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" <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" 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)"> transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
......
...@@ -24729,6 +24729,9 @@ div:where(.swal2-container) div:where(.swal2-validation-message) { ...@@ -24729,6 +24729,9 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
.bg-input-readonly { .bg-input-readonly {
background-color: rgb(241 245 249 / var(--tw-bg-opacity)); background-color: rgb(241 245 249 / var(--tw-bg-opacity));
} }
.\!bg-input-readonly {
background-color: rgb(241 245 249) !important;
}
.ml-8 { .ml-8 {
margin-left: 2rem; margin-left: 2rem;
...@@ -24907,7 +24910,6 @@ div:where(.swal2-container) div:where(.swal2-validation-message) { ...@@ -24907,7 +24910,6 @@ div:where(.swal2-container) div:where(.swal2-validation-message) {
margin-top: -0.75rem !important; margin-top: -0.75rem !important;
} }
.\!rounded-t-none { .\!rounded-t-none {
border-top-left-radius: 0rem !important; border-top-left-radius: 0rem !important;
border-top-right-radius: 0rem !important; border-top-right-radius: 0rem !important;
......
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