Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mySkill-x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
mySkill-x
Commits
b3dfa482
Commit
b3dfa482
authored
Feb 26, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE รอบการประเมินผล
parent
34d18581
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
328 additions
and
450 deletions
+328
-450
evaluation-cycle-manager.component.ts
...ation-cycle-manager/evaluation-cycle-manager.component.ts
+2
-1
evaluation-cycle.component.html
...-manager/evaluation-cycle/evaluation-cycle.component.html
+4
-3
evaluation-cycle.component.ts
...le-manager/evaluation-cycle/evaluation-cycle.component.ts
+21
-3
edit-evaluation-form.component.html
.../edit-evaluation-form/edit-evaluation-form.component.html
+174
-276
edit-evaluation-form.component.ts
...rm/edit-evaluation-form/edit-evaluation-form.component.ts
+114
-167
styles.scss
src/styles.scss
+13
-0
No files found.
src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle-manager.component.ts
View file @
b3dfa482
...
...
@@ -8,6 +8,6 @@ import { StatusCodeModel } from 'src/app/shared/model/status-code.model';
export
class
EvaluationCycleManagerComponent
{
@
Input
()
pathTitle
=
[
'การประเมินสมรรถนะ'
,
'การจัดการรอบการประเมิน'
,
'รอบการประเมิน'
]
activeTab
:
string
=
'underline-
2
'
;
// Tab แรกแสดงเป็นค่าเริ่มต้น
activeTab
:
string
=
'underline-
1
'
;
// Tab แรกแสดงเป็นค่าเริ่มต้น
groupShow
=
'1'
}
\ No newline at end of file
src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle/evaluation-cycle.component.html
View file @
b3dfa482
...
...
@@ -95,6 +95,7 @@
id=
"checkbox-{{item.data.evaluationRoundId}}"
[(
ngModel
)]="
item
.
check
"
(
ngModelChange
)="
dataListCheck
()"
>
</td>
<td
>
<i
class=
"ti ti-user cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#evaluation-cycle-person-modal"
(
click
)="
openModal
('
evaluation-cycle-person-modal
',
item
.
data
.
evaluationRoundId
)"
></i>
<label
for=
"checkbox-{{item.data.evaluationRoundId}}"
>
{{item.data.evaluationRoundId}}
</label>
</td>
<td>
{{item.data.tdesc}}
</td>
...
...
@@ -136,7 +137,7 @@
<td
class=
"flex justify-center items-center"
>
<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-user cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#evaluation-cycle-person-modal"
(
click
)="
openModal
('
evaluation-cycle-person-modal
',
item
.
data
.
evaluationRoundId
)"
></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'"
...
...
@@ -350,7 +351,7 @@
</div>
<div
id=
"evaluation-cycle-person-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=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out
m-3 lg:!mx-auto "
style=
"min-width: 70%;
"
>
<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"
>
...
...
@@ -365,7 +366,7 @@
</div>
</div>
<div
class=
"ti-modal-body "
>
<app-edit-evaluation-form></app-edit-evaluation-form>
<app-edit-evaluation-form
*
ngIf=
"evaluationRoundId"
[
evaluationRoundId
]="
evaluationRoundId
"
></app-edit-evaluation-form>
</div>
</div>
</div>
...
...
src/app/components/competency-assessment/evaluation-cycle-manager/evaluation-cycle/evaluation-cycle.component.ts
View file @
b3dfa482
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Output
}
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'
;
import
{
EvaluationAssessmentService
}
from
'src/app/shared/services/evaluation-assessment.service'
;
export
interface
DataModel
{
evaluationRoundId
:
string
;
...
...
@@ -20,6 +21,7 @@ export interface DataModel {
styleUrls
:
[
'./evaluation-cycle.component.scss'
]
})
export
class
EvaluationCycleComponent
{
@
Output
()
evaluationRoundIdChange
=
new
EventEmitter
<
string
>
();
apsPeriodStart
:
string
=
''
;
apsPeriodEnd
:
string
=
''
;
...
...
@@ -35,10 +37,10 @@ export class EvaluationCycleComponent {
isDataListChecked
=
false
isDataListCheckedAll
=
false
numDataListChecked
=
0
evaluationRoundId
=
''
constructor
(
private
evaluationCycleService
:
EvaluationCycleService
,
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
private
cdr
:
ChangeDetectorRef
,
)
{
}
ngOnInit
():
void
{
...
...
@@ -171,6 +173,22 @@ export class EvaluationCycleComponent {
this
.
setData
(
new
MyEvaluationCycleModel
({
evaluationRoundId
:
this
.
dataSelect
.
evaluationRoundId
}))
}
}
openModal
(
id
:
string
,
evaluationRoundId
:
string
)
{
this
.
evaluationRoundId
=
''
if
(
id
==
'evaluation-cycle-person-modal'
){
this
.
evaluationRoundId
=
evaluationRoundId
this
.
evaluationRoundIdChange
.
emit
(
evaluationRoundId
)
setTimeout
(()
=>
{
document
.
getElementById
(
id
)?.
classList
.
add
(
'open'
);
document
.
getElementById
(
id
)?.
classList
.
remove
(
'hidden'
);
document
.
getElementById
(
id
)?.
setAttribute
(
'aria-overlay'
,
'false'
);
},
10
);
}
}
}
src/app/components/performance-management-evaluation/evaluation-cycle-performance/document-form/edit-evaluation-form/edit-evaluation-form.component.html
View file @
b3dfa482
...
...
@@ -20,10 +20,10 @@
</div>
<div
class=
"grid grid-cols-2 gap-6 mb-5"
>
<div
class=
"col-span-1"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
value=
"ช่วงเวลาที่ 2
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
[
value
]="
evaluationRound
.
tdesc
"
>
</div>
<div
class=
"col-span-1"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
value=
"2567
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
[
value
]="
evaluationRound
.
apsyear
"
>
</div>
</div>
</div>
...
...
@@ -35,7 +35,7 @@
<div
class=
"px-1"
>
<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"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
style=
"height: 40px;"
>
<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"
>
...
...
@@ -44,18 +44,17 @@
</div>
</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-form-alert-modal"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-success h-20px m-0 shadow-md"
(
click
)="
openModalClass
('
modal-alert
')"
>
<i
class=
"ri-save-3-line"
></i>
Save
</button>
</div>
<div
class=
"px-1"
>
<
!-- <
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>
...
...
@@ -68,145 +67,143 @@
<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>
*
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=
"!f&&!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of[
['F6702-01', 'พิมพร อุดมการ','Human Resource Development Officer S3','พนักงานระดับ S1-S2'],
['F6702-02', 'กรกนก อินทนิน','HRD Training Officer','พนักงานระดับ S3-S4'],
['F6702-03', 'ลลิตา อาเเว','Recruitment & Employment Officer','พนักงานระดับ S1-S2'],
['F6702-04', 'ภาวินี ย้อนเวลา','Time keeper & Doc.[Payroll] Officer','พนักงานระดับ S1-S2'],
['F6702-06', 'จิตรา อาคมเเคง','Employee Relations Officer','พนักงานระดับ S3-S4']];let i = index"
>
<td
class=
"text-center"
style=
"font-size: 12px; width: 12%;"
>
{{item[0]}}
</td>
<td
style=
"font-size: 12px; width: 40%;"
>
{{item[1]}}
</td>
<td
style=
"font-size: 12px; width: 15%; word-break: break-word; white-space: normal;"
>
{{item[2]}}
</td>
<td
style=
"font-size: 12px; width: 15%;"
>
{{item[3]}}
</td>
<td
class=
"text-center"
>
<div
class=
"flex justify-center items-center"
>
<div
class=
"flex justify-center items-center"
>
<i
*
ngIf=
"hsSwitchChecked[item[0]]"
class=
"ti ti-edit cursor-pointer i-gray fs-xl px-2 text-center"
data-hs-overlay=
"#edit-evaluation-form-table-modal-edit"
></i>
<input
type=
"checkbox"
id=
"hs-small-switch-{{item[0]}}"
class=
"ti-switch shrink-0 w-11 h-6 before:w-5 before:h-5"
[(
ngModel
)]="
hsSwitchChecked
[
item
[
0
]]"
>
</div>
</div>
<tr
*
ngFor=
"let item of assessmentListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<td
class=
"flex justify-center items-center"
>
{{item.masfromEvaluationRoundModel.evaluationRoundId}}
</td>
<td>
{{item.apsassessy.fname}} {{item.apsassessy.lname}}
</td>
<td
class=
"text-center"
>
{{item.apsassessy.position.tdesc}}
</td>
<td
class=
"text-center"
>
{{item.personalLevel.tdesc}}
</td>
<td
class=
"flex justify-center items-center space-x-2"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-xl px-1"
(
click
)="
openAddRoundModel
(
item
.
masfromEvaluationRoundModel
.
evaluationRoundId
,
item
.
apsassessy
.
employeeId
,'
form-pm-emp
')"
></i>
<input
type=
"checkbox"
id=
"hs-small-switch{{i+1}}"
[(
ngModel
)]="
item
.
active
"
class=
"ti-switch checked:bg-none checked:bg-green-600 checked:hover:bg-green-600 checked:focus:bg-green-600 focus:border-green-600 dark:checked:bg-green-600 checked:before:bg-green-200 dark:checked:before:bg-green-200 shrink-0 w-11 h-6 before:w-5 before:h-5"
>
</td>
</tr>
</tbody>
</table>
</div>
</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"
>
<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);"
>
<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><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&¤tPage!=1&¤tPage!=2&¤tPage!=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&¤tPage!=page.length&¤tPage!=page.length-1&¤tPage!=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
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);"
>
<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>
</nav>
</div>
</div>
</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 {{assessmentListFilter().length
<10
?
assessmentListFilter
().
length:
(
currentPage=
=page.length
?
((
currentPage
*
10
)
-
((
currentPage
*
10
)
-
assessmentListFilter
().
length
)
)
:
(
currentPage
*
10
)
)
}}
of
{{
assessmentListFilter
().
length
}}
items
</
span
>
</ul>
</
di
v>
</
na
v>
</div>
<div
id=
"edit-evaluation-form-table-modal-edit"
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
id=
"form-pm-emp"
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
mt-7
"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content
!width-80"
>
<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-form-table-modal-edit"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
(
click
)="
closeModalClass
('
form-pm-emp
')"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</div>
</div>
<div
class=
"ti-modal-body"
>
<div
class=
"body-content"
>
<div
class=
"page"
>
<div
class=
"border-b border-gray-200 dark:border-white/10"
>
<div
class=
"grid grid-cols-2 gap-6 mt-2"
>
<div
class=
"py-2 border-b-2 border-collapse "
>
<div
class=
"grid grid-cols-2 gap-6"
>
<div
class=
"col-span-1"
>
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label"
>
รหัสเเ
บบฟอร์ม
</label>
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label"
>
รหัสแ
บบฟอร์ม
</label>
</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-2 gap-6 mb-5
"
>
<div
class=
"grid grid-cols-2 gap-6
"
>
<div
class=
"col-span-1"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
value=
"F6702-01"
>
<input
type=
"text"
id=
"input-label"
class=
"py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
readonly
value=
"F6702-01"
>
</div>
<div
class=
"col-span-1"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
value=
"พิมพร อูรณการ"
>
</div>
</div
>
<input
type=
"text"
id=
"input-label"
class=
"py-2 px-3 ltr:pr-11 rtl:pl-11 ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
readonly
value=
"พิมพร อูรณการ"
>
</div>
</div>
</div>
<div
class=
"body-content-table"
>
<div
class=
"page"
>
<div
class=
"header-title-type"
>
<div
class=
"flex justify-between"
>
<div
class=
"flex pr-2"
>
<div
class=
"flex"
>
<!-- Content ของ div แรก -->
<div
class=
"flex gap-x-6"
>
<div
class=
"flex items-center"
>
<input
type=
"checkbox"
class=
"ti-form-checkbox pointer-events-none"
id=
"hs-default-checkbox"
[(
ngModel
)]="
isDataListChecked
"
>
<label
for=
"hs-default-checkbox"
class=
"text-sm text-gray-500 mx-2 pointer-events-none"
>
{{numDataListChecked}} Selected
</label>
</div>
<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>
<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>
</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>
</div>
</div>
<div
class=
"flex justify-end"
>
<div
class=
"px-1"
>
<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
"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()
"
>
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10
"
placeholder=
"Search by No. or Name"
style=
"height: 40px;
"
>
<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>
...
...
@@ -214,20 +211,22 @@
</div>
</div>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
data-hs-overlay=
"#edit-evaluation-form-add-table-modal-edit
"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md
"
>
<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"
data-hs-overlay=
"#edit-evaluation-form-alert-delete-modal"
>
<i
class=
"ti ti-trash fs-l"
></i>
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
data-hs-overlay=
"#edit-define-document-form-alert-delete-modal"
>
<i
class=
"ri-delete-bin-6-line"
></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-10 m-0 shadow-md"
>
<i
class=
"ti ti-book fs-l"
></i>
Help
</button>
...
...
@@ -235,210 +234,58 @@
</div>
</div>
</div>
</div>
<div
class=
"overflow-auto table-bordered"
style=
"border-radius: 5px;"
>
<div
class=
"overflow-auto border"
>
<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
"
>
*
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"
[
class
.!
text-center
]="
f
||
l
||
item =
==
'ระดับความหวัง'"
>
<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>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"!dataListFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"dataListFilter().length"
>
<tbody>
<tr
*
ngFor=
"let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<td
style=
"font-size: 12px; width: 15%;"
class=
"text-center"
>
<input
style=
"margin-right: 20px;"
type=
"checkbox"
class=
"ti-form-checkbox cursor-pointer "
[(
ngModel
)]="
item
.
check
"
(
ngModelChange
)="
dataListCheck
()"
>
<label>
{{item.code}}
</label>
</td>
<td
style=
"font-size: 12px; width: 40%; word-break: break-word; white-space: normal;"
>
{{item.headname}}
</td>
<td
style=
"font-size: 12px; width: 15%;"
>
{{item.type}}
</td>
<td
style=
"font-size: 12px; width: 15%;"
><span>
{{item.weight}}
</span></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-form-alert-delete-modal"
></i>
</td>
</tr>
</tbody>
</table>
</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&¤tPage!=1&¤tPage!=2&¤tPage!=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&¤tPage!=page.length&¤tPage!=page.length-1&¤tPage!=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>
</nav>
<div
class=
"flex justify-end mt-3rem 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-form-table-modal-edit"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#edit-evaluation-form-alert-modal"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
*
ngFor=
"let item of[
['CC-01', 'จิตสำนึกด้านความปลอดภัยและคุณภาพ (Safety & Quality)','ระดับที่ 1'],
['CC-02', 'การทำงานเป็นทีมแบบ TAT (TAT Teamwork)','ระดับที่ 1'],
['CC-03', 'ความรับผิดชอบในหน้าที่และโปร่งใส (Accountability & Ethics)','ระดับที่ 1'],
['CC-04', 'การพัฒนาอย่างต่อเนื่อง (Readiness to Learn & Continous Improvement)','ระดับที่ 1'],
['CC-05', 'การคิดอย่างเป็นระบบ (Systematic Thinking)','ระดับที่ 1']];let i = index"
>
<td>
<div
id=
"edit-evaluation-form-add-table-modal-edit"
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"
>
การประเมินผล
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#edit-evaluation-form-table-modal-edit"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</div>
</div>
<div
class=
"ti-modal-body"
>
<div
class=
"flex justify-end pb-1rem"
>
<div
class=
"px-1"
>
<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"
>
<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>
<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=
"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>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"!dataListFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"dataListFilter().length"
>
<tr
*
ngFor=
"let item of dataListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<td
style=
"font-size: 12px; width: 15%;"
class=
"text-center"
>
<input
style=
"margin-right: 20px;"
type=
"checkbox"
class=
"ti-form-checkbox cursor-pointer "
[(
ngModel
)]="
item
.
check
"
<!-- <td class="text-center">
<input type="checkbox" class="ti-form-checkbox cursor-pointer"
id="checkbox-{{item.data.evaluationRoundId}}" [(ngModel)]="item.check"
(ngModelChange)="dataListCheck()">
<label>
{{item.code}}
</label>
</td>
<td
style=
"font-size: 12px; width: 40%; word-break: break-word; white-space: normal;"
>
{{item.headname}}
</td>
<td
style=
"font-size: 12px; width: 15%;"
>
{{item.type}}
</td>
<td
class=
"text-center"
style=
"font-size: 12px; width: 15%;"
>
{{item.weight}}
</td>
<td>
<label
for="checkbox-{{item.data.evaluationRoundId}}"> {{item.data.evaluationRoundId}}</label>
</td> -->
<td
>
{{item[1]}}
</td>
<td
>
{{item[2]}}
</td>
<td
class=
"flex justify-center"
>
<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-form-alert-modal"
>
<i
class=
"ri-add-line"
></i>
Select
</button>
</div>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#edit-define-document-form-alert-delete-modal"
></i>
</td>
</tr>
</tbody>
</table>
</div>
</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=
"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"
>
...
...
@@ -447,7 +294,9 @@
<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 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>
...
...
@@ -468,11 +317,24 @@
<p>
Show 1 to 10 of 50 items
</p>
</ul>
</div>
<div
class=
"ti-modal-footer"
>
<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=
"#form-pm-emp"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#edit-define-document-form-alert-add-modal"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div
id=
"edit-evaluation-form-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"
>
...
...
@@ -500,7 +362,7 @@
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#edit-evaluation-form-alert-modal"
(
click
)="
addUser
();
showSuccess
()
"
>
data-hs-overlay=
"#edit-evaluation-form-alert-modal"
(
click
)="
addUser
();"
>
บันทึกข้อมูล
</a>
</div>
...
...
@@ -536,7 +398,7 @@
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#edit-evaluation-form-alert-delete-modal"
(
click
)="
addUser
()
;
showSuccessDelete
()
"
>
data-hs-overlay=
"#edit-evaluation-form-alert-delete-modal"
(
click
)="
addUser
()"
>
ลบข้อมูล
</a>
</div>
...
...
@@ -544,3 +406,39 @@
</div>
</div>
</div>
<div
id=
"modal-alert"
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"
(
click
)="
closeModalClass
('
modal-alert
')"
>
<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"
(
click
)="
closeModalClass
('
modal-alert
')"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
(
click
)="
saveAssessmentList
();
closeModalClass
('
modal-alert
')"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
src/app/components/performance-management-evaluation/evaluation-cycle-performance/document-form/edit-evaluation-form/edit-evaluation-form.component.ts
View file @
b3dfa482
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
AppraisalFormModel
}
from
'src/app/shared/model/appraisal-form.model'
;
import
{
EvaluationCycleModel
,
MyEvaluationCycleModel
}
from
'src/app/shared/model/evaluation-cycle.model'
;
import
{
EvaluationAssessmentService
}
from
'src/app/shared/services/evaluation-assessment.service'
;
import
{
EvaluationCycleService
}
from
'src/app/shared/services/evaluation-cycle.service'
;
export
interface
DataModel
{
check
:
boolean
,
code
:
string
,
headname
:
string
,
type
:
string
,
weight
:
string
,
}
@
Component
({
selector
:
'app-edit-evaluation-form'
,
...
...
@@ -15,199 +12,149 @@ export interface DataModel {
styleUrls
:
[
'./edit-evaluation-form.component.scss'
]
})
export
class
EditEvaluationFormComponent
{
@
Input
()
pathTitle
=
[
'การประเมินจัดการประสิทธิภาพ'
,
'รอบการประเมิน'
,
'กำหนดฟอร์มเอกสาร'
,
'เเก้ไขฟอร์มตามรอบการประเมิน'
];
@
Input
()
pathTitle
=
[
'การประเมินจัดการประสิทธิภาพ'
,
'รอบการประเมิน'
,
'กำหนดฟอร์มเอกสาร'
,
'เเก้ไขฟอร์มตามรอบการประเมิน'
];
@
Output
()
sendPathTitle
:
EventEmitter
<
string
[]
>
=
new
EventEmitter
<
string
[]
>
();
@
Output
()
sendGroupShow
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
activeTab
:
string
=
'tab1'
;
hsSwitchChecked
:
{
[
key
:
string
]:
boolean
};
@
Input
()
evaluationRoundId
=
''
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
search
=
""
numDataListChecked
=
0
isDataListChecked
=
false
isDataListCheckedAll
=
false
dataList
:
DataModel
[]
=
[
{
check
:
false
,
code
:
"HS-01"
,
headname
:
"C1 CUSTOMER ORIENTED (SQCDME)"
,
type
:
"HOSHIN"
,
weight
:
"5.0"
,
},
{
check
:
false
,
code
:
"HS-02"
,
headname
:
"C2 MANUFACTURING OPTIMIZATION"
,
type
:
"HOSHIN"
,
weight
:
"3.0"
,
},
{
check
:
false
,
code
:
"HS-03"
,
headname
:
"C3 INCREASE EMPLOYEE ENGAGEMENT"
,
type
:
"HOSHIN"
,
weight
:
"3.0"
,
},
{
check
:
false
,
code
:
"HS-04"
,
headname
:
"C4 HEALTHY FINANCIAL"
,
type
:
"HOSHIN"
,
weight
:
"3.0"
,
},
{
check
:
false
,
code
:
"HS-05"
,
headname
:
"C5 RISK MANAGEMENT (TAXATION)"
,
type
:
"HOSHIN"
,
weight
:
"1.0"
,
},
{
check
:
false
,
code
:
"KP-01"
,
headname
:
"ประสาทงานกับวิทยากร ผู้เข้ารับการอบรมทั้งภายในเเละภายนอกตามเเผนการฝึกอบรมพัฒนา"
,
type
:
"KPI"
,
weight
:
"10.0"
,
},
]
dataSelect
:
DataModel
=
{
check
:
false
,
code
:
""
,
headname
:
""
,
type
:
""
,
weight
:
""
,
}
constructor
(
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
)
{
this
.
hsSwitchChecked
=
{
'F6702-01'
:
false
,
'F6702-02'
:
false
,
'F6702-03'
:
false
,
'F6702-04'
:
false
,
'F6702-06'
:
false
};
}
dataListSelect
(
data
?:
DataModel
)
{
this
.
dataSelect
=
data
||
{
check
:
false
,
code
:
""
,
headname
:
""
,
type
:
""
,
weight
:
""
,
}
this
.
cdr
.
detectChanges
()
}
dataListFilter
()
{
return
this
.
dataList
.
filter
(
x
=>
{
const
match
=
x
.
code
.
includes
(
this
.
search
)
||
x
.
headname
.
includes
(
this
.
search
);
if
(
!
match
)
x
.
check
=
false
;
return
match
;
});
assessmentList
:
AppraisalFormModel
[]
=
[]
evaluationRound
:
EvaluationCycleModel
=
new
MyEvaluationCycleModel
()
isChecked
:
boolean
=
false
;
apsassessy
=
""
constructor
(
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
evaluationAssessmentService
:
EvaluationAssessmentService
,
private
evaluationCycleService
:
EvaluationCycleService
)
{
}
dataListCheck
()
{
const
dataCheck
=
this
.
dataListFilter
();
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
;
ngOnInit
():
void
{
}
ngOnChanges
():
void
{
if
(
this
.
evaluationRoundId
)
{
this
.
getAssessmentId
();
this
.
getAssessmentList
();
}
dataListCheckAll
()
{
const
selectAll
=
this
.
isDataListCheckedAll
;
this
.
dataList
.
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
}
getAssessmentId
()
{
this
.
evaluationCycleService
.
getById
(
this
.
evaluationRoundId
!
).
subscribe
({
next
:
response
=>
{
this
.
evaluationRound
=
response
this
.
cdr
.
detectChanges
();
},
error
:
err
=>
{
console
.
error
(
'Error fetching evaluation cycles:'
,
err
);
}
});
}
getAssessmentList
()
{
this
.
evaluationAssessmentService
.
getById
(
this
.
evaluationRoundId
!
).
subscribe
({
next
:
response
=>
{
this
.
assessmentList
=
response
this
.
cdr
.
detectChanges
();
},
error
:
err
=>
{
console
.
error
(
'Error fetching evaluation cycles:'
,
err
);
}
});
}
assessmentListFilter
()
{
return
this
.
assessmentList
.
filter
(
x
=>
x
.
apsassessy
.
fname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
efname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
elname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
masfromEvaluationRoundModel
.
evaluationRoundId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsassessy
.
employeeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
)
}
searchChange
()
{
this
.
currentPage
=
1
;
const
filteredData
=
this
.
data
ListFilter
();
const
filteredData
=
this
.
assessment
ListFilter
();
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
filteredData
.
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
dataListCheck
();
}
// ฟังก์ชันในการเปลี่ยนแท็บ
changeTab
(
tab
:
{
id
:
string
,
text
:
string
})
{
this
.
sendPathTitle
.
emit
([
'การประเมินจัดการประสิทธิภาพ'
,
'รอบการประเมิน'
,
'กำหนดฟอร์มเอกสาร'
,
tab
.
text
]);
this
.
activeTab
=
tab
.
id
;
}
onBack
()
{
this
.
sendGroupShow
.
emit
(
'1'
);
// เปลี่ยนกลับไปหน้า 1
}
// การจัดการการเปิดปิด modal
modalOptions
:
{
[
nameModal
:
string
]:
{
isModalOpen
:
boolean
;
modalSize
:
string
;
backdropClose
:
boolean
;
};
}
=
{
"add"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
},
"edit"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
}
};
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
this
.
modalOptions
[
name
].
isModalOpen
=
true
;
this
.
currentModal
=
name
;
// ตั้งค่าค่าของ currentModal เป็น 'add' หรือ 'edit'
document
.
body
.
style
.
overflow
=
'hidden'
;
openModalClass
(
id
:
string
)
{
document
.
getElementById
(
id
)?.
classList
.
add
(
'open'
);
document
.
getElementById
(
id
)?.
classList
.
remove
(
'hidden'
);
setTimeout
(()
=>
{
document
.
getElementById
(
id
)?.
setAttribute
(
'aria-overlay'
,
'true'
)
},
10
);
}
closeModal
(
name
:
string
)
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
if
(
!
this
.
isAnyModalOpen
()
)
{
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
closeModal
Class
(
id
:
string
)
{
const
modal
=
document
.
getElementById
(
id
)
;
if
(
modal
)
{
modal
.
classList
.
add
(
"hidden"
);
// ซ่อน Modal
}
}
isAnyModalOpen
():
boolean
{
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// ตรวจสอบว่า modal อื่นยังเปิดอยู่หรือไม่
}
// ฟังก์ชัน toggle checkbox
isChecked
:
boolean
=
false
;
// ใช้สำหรับตรวจสอบสถานะของ checkbox
toggleCheckbox
()
{
this
.
isChecked
=
!
this
.
isChecked
;
// สลับสถานะ
saveAssessmentList
()
{
let
body
=
this
.
assessmentList
.
filter
(
x
=>
x
.
active
==
true
)
if
(
body
.
length
>
0
)
{
this
.
evaluationAssessmentService
.
postList
(
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getAssessmentList
();
}
else
{
}
}
})
}
else
{
this
.
showAlert
(
'ไม่พบรายการ'
,
'error'
)
}
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
addUser
()
{
}
currentModal
=
""
;
// constructor(private toastr: ToastrService) { }
openAddRoundModel
(
evaluationRoundId
:
string
,
apsassessy
:
string
,
model
:
string
)
{
this
.
openModalClass
(
model
);
this
.
evaluationRoundId
=
evaluationRoundId
this
.
apsassessy
=
apsassessy
this
.
getApsassessy
()
}
showSuccess
()
{
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
getApsassessy
(){
this
.
evaluationAssessmentService
.
getApsassessy
(
this
.
evaluationRoundId
,
this
.
apsassessy
).
subscribe
({
next
:
response
=>
{
console
.
log
(
"🚀 ~ EditEvaluationFormComponent ~ this.evaluationAssessmentService.getApsassessy ~ response:"
,
response
)
this
.
cdr
.
detectChanges
();
},
error
:
err
=>
{
console
.
error
(
'Error fetching evaluation cycles:'
,
err
);
}
})
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
[
type
](
text
,
'แจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
showSuccessEdit
()
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
toggleCheckbox
()
{
this
.
isChecked
=
!
this
.
isChecked
;
// สลับสถานะ
}
showSuccessDelete
()
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
addUser
()
{
}
}
src/styles.scss
View file @
b3dfa482
...
...
@@ -364,3 +364,15 @@ ngx-dropzone {
font-size
:
12px
;
padding-left
:
1
.5rem
;
}
.width-80
{
width
:
80%
;
}
.
\
!
width-80
{
width
:
80%
!
important
;
}
.width-70
{
width
:
70%
;
}
.
\
!
width-70
{
width
:
70%
!
important
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment