Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
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
myAppraisal
Commits
a19d8b26
Commit
a19d8b26
authored
Feb 21, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
การประเมินจัดการประสิทธิภาพ > การจัดการประเมิน > กำหนดผู้ประเมิน
parent
ec9cdf18
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
752 additions
and
419 deletions
+752
-419
competency-management.component.html
...ompetency-management/competency-management.component.html
+1
-1
set-approvers.component.html
...ncy-management/set-approvers/set-approvers.component.html
+86
-39
set-approvers.component.ts
...tency-management/set-approvers/set-approvers.component.ts
+69
-23
dashboard.module.ts
src/app/components/dashboard/dashboard.module.ts
+2
-0
assigning-approvers.component.html
...nt/assigning-approvers/assigning-approvers.component.html
+359
-273
assigning-approvers.component.ts
...ment/assigning-approvers/assigning-approvers.component.ts
+200
-83
pms-group-approve.service.ts
src/app/shared/services/pms-group-approve.service.ts
+35
-0
No files found.
src/app/components/competency-assessment/competency-management/competency-management.component.html
View file @
a19d8b26
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
</div>
</div>
<div
*
ngIf=
"currentPath==3"
id=
"underline-3"
class=
"hidden"
role=
"tabpanel"
<div
*
ngIf=
"currentPath==3"
id=
"underline-3"
class=
"hidden"
role=
"tabpanel"
aria-labelledby=
"underline-item-3"
>
aria-labelledby=
"underline-item-3"
>
<app-set-approvers
(
sendPathTitle
)="
pathTitle=
$event"
></app-set-approvers>
<app-set-approvers></app-set-approvers>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/components/competency-assessment/competency-management/set-approvers/set-approvers.component.html
View file @
a19d8b26
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
<button
type=
"button"
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-45px m-0 shadow-md"
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-45px m-0 shadow-md"
data-hs-overlay=
"#"
>
data-hs-overlay=
"#set-approvers-upload-modal"
(
click
)="
fileInput
.
value =
''
;
selectedFile=
null;selectedFileName
=
'กรุณาเลือกไฟล์'"
>
<i
class=
"ti ti-file-plus"
></i>
<i
class=
"ti ti-file-plus"
></i>
import
import
</button>
</button>
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
<td
class=
"flex justify-center"
>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
currentModel=
'edit'
;
selectGroupapprove
(
item
)"
(
click
)="
currentModel=
'edit'
;
selectGroupapprove
(
item
)"
data-hs-overlay=
"#set-approvers-modal
-edit
"
></i>
data-hs-overlay=
"#set-approvers-modal"
></i>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
@@ -116,7 +117,7 @@
...
@@ -116,7 +117,7 @@
<div
id=
"set-approvers-modal
-edit
"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"set-approvers-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=
"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"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
...
@@ -125,7 +126,7 @@
...
@@ -125,7 +126,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=
"#set-approvers-modal
-edit
"
>
data-hs-overlay=
"#set-approvers-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>
...
@@ -134,7 +135,7 @@
...
@@ -134,7 +135,7 @@
<div
class=
"ti-modal-center"
>
<div
class=
"ti-modal-center"
>
<div
class=
"flex justify-end"
style=
"padding-right: 1rem;"
>
<div
class=
"flex justify-end"
style=
"padding-right: 1rem;"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(
click
)="
clear
()"
>
<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)"
>
...
@@ -169,15 +170,17 @@
...
@@ -169,15 +170,17 @@
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
readonly
style=
"padding-right: 2.5rem;"
[(
ngModel
)]="
groupapprove
.
apsapprove1
.
fname
"
>
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove1
.
fname
+'
'+
groupapprove
.
apsapprove1
.
lname
"
>
<div
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectEMP
()"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
1;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
(
click
)="
empnumber =
1"
data-hs-overlay=
"#set-approvers-table-modal
-edit
"
>
(
click
)="
empnumber =
1"
data-hs-overlay=
"#set-approvers-table-modal"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</button>
</div>
</div>
...
@@ -187,15 +190,17 @@
...
@@ -187,15 +190,17 @@
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
readonly
style=
"padding-right: 2.5rem;"
[(
ngModel
)]="
groupapprove
.
apsapprove2
.
fname
"
>
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove2
.
fname
+'
'+
groupapprove
.
apsapprove2
.
lname
"
>
<div
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectEMP
()"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
2;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#set-approvers-table-modal
-edit
"
(
click
)="
empnumber =
2"
>
data-hs-overlay=
"#set-approvers-table-modal"
(
click
)="
empnumber =
2"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</button>
</div>
</div>
...
@@ -205,15 +210,17 @@
...
@@ -205,15 +210,17 @@
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
readonly
style=
"padding-right: 2.5rem;"
[(
ngModel
)]="
groupapprove
.
apsapprove3
.
fname
"
>
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove3
.
fname
+'
'+
groupapprove
.
apsapprove3
.
lname
"
>
<div
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
3;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#set-approvers-table-modal
-edit
"
(
click
)="
empnumber =
3"
>
data-hs-overlay=
"#set-approvers-table-modal"
(
click
)="
empnumber =
3"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</button>
</div>
</div>
...
@@ -223,15 +230,17 @@
...
@@ -223,15 +230,17 @@
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
readonly
style=
"padding-right: 2.5rem;"
[(
ngModel
)]="
groupapprove
.
apsapprove4
.
fname
"
>
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove4
.
fname
+'
'+
groupapprove
.
apsapprove4
.
lname
"
>
<div
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
4;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#set-approvers-table-modal
-edit
"
(
click
)="
empnumber =
4"
>
data-hs-overlay=
"#set-approvers-table-modal"
(
click
)="
empnumber =
4"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</button>
</div>
</div>
...
@@ -241,15 +250,17 @@
...
@@ -241,15 +250,17 @@
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10 bg-input-readonly"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
readonly
style=
"padding-right: 2.5rem;"
[(
ngModel
)]="
groupapprove
.
apsapprove5
.
fname
"
>
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove5
.
fname
+'
'+
groupapprove
.
apsapprove5
.
lname
"
>
<div
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
5;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#set-approvers-table-modal
-edit
"
(
click
)="
empnumber =
5"
>
data-hs-overlay=
"#set-approvers-table-modal"
(
click
)="
empnumber =
5"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</button>
</div>
</div>
...
@@ -258,11 +269,11 @@
...
@@ -258,11 +269,11 @@
<div
class=
"flex justify-end mt-3rem mb-1rem space-x-4"
>
<div
class=
"flex justify-end mt-3rem mb-1rem space-x-4"
>
<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=
"#set-approvers-modal
-edit
"
>
data-hs-overlay=
"#set-approvers-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=
"#set-approvers-alert-
edit-
modal"
>
data-hs-overlay=
"#set-approvers-alert-modal"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
@@ -271,7 +282,7 @@
...
@@ -271,7 +282,7 @@
</div>
</div>
</div>
</div>
<div
id=
"set-approvers-table-modal
-edit
"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"set-approvers-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=
"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=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
...
@@ -280,7 +291,7 @@
...
@@ -280,7 +291,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=
"#set-approvers-modal
-edit
"
>
data-hs-overlay=
"#set-approvers-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>
...
@@ -291,8 +302,9 @@
...
@@ -291,8 +302,9 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<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 "
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
placeholder=
"Search by No. or Name"
[(
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>
...
@@ -347,8 +359,8 @@
...
@@ -347,8 +359,8 @@
</tbody>
</tbody>
<tbody
*
ngIf=
"employee_listFilter().length"
>
<tbody
*
ngIf=
"employee_listFilter().length"
>
<ng-container
*
ngIf=
"currentModel=='edit'"
>
<ng-container
*
ngIf=
"currentModel=='edit'"
>
<tr
*
ngFor=
"let item of employee_listFilter() | slice:((employeeModal.currentPage-1) * 10) : (((employeeModal.currentPage-1) * 10) + 10);let i = index"
<tr
class=
"cursor-pointer
"
>
*
ngFor=
"let item of employee_listFilter() | slice:((employeeModal.currentPage-1) * 10) : (((employeeModal.currentPage-1) * 10) + 10);let i = index
"
>
<td
style=
"font-size: 12px;"
>
{{item.employeeId}}
</td>
<td
style=
"font-size: 12px;"
>
{{item.employeeId}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.fname}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.fname}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.lname}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.lname}}
</td>
...
@@ -361,8 +373,7 @@
...
@@ -361,8 +373,7 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
<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"
(
click
)="
selectEMP
(
item
)"
(
click
)="
selectEMP
(
item
)"
data-hs-overlay=
"#set-approvers-modal"
>
data-hs-overlay=
"#set-approvers-modal-edit"
>
<i
class=
"ri-add-line"
></i>
<i
class=
"ri-add-line"
></i>
Select
Select
</button>
</button>
...
@@ -401,7 +412,43 @@
...
@@ -401,7 +412,43 @@
</div>
</div>
</div>
</div>
<div
id=
"set-approvers-alert-edit-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"set-approvers-upload-modal"
class=
"hs-overlay hidden ti-modal"
aria-overlay=
"'false'"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md"
>
<div
class=
"ti-modal-header bg-primary !rounded-none !rounded-t-sm"
>
<h5
class=
"text-xxl font-bold text-white"
>
นำเข้าผู้ประเมิน
</h5>
</div>
<div
class=
"ti-modal-body max-h-full overflow-hidden ti-modal-content !rounded-t-none !rounded-b-sm"
>
<h1
class=
"mt-2"
style=
"text-align: center;"
>
ไฟล์
</h1>
<div
class=
"mt-2 p-2"
>
<div
class=
"flex rounded-md"
>
<input
#
fileInput
id=
"fileInput"
type=
"file"
(
change
)="
onFileSelected
($
event
)"
hidden
>
<input
type=
"text"
[
value
]="
selectedFileName
"
readonly
(
click
)="
fileInput
.
click
()"
class=
"ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10 cursor-pointer"
>
<button
type=
"button"
(
click
)="
fileInput
.
click
()"
class=
"inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-secondary text-white hover:bg-secondary focus:z-10 focus:outline-none focus:ring-0 focus:ring-secondary transition-all text-sm"
>
<i
class=
"ti ti-upload"
></i>
</button>
</div>
<div
class=
"flex justify-center mt-2rem "
>
<h1
class=
"cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end"
(
click
)="
downloadFile
()"
>
ดาวน์โหลดตัวอย่างไฟล์
</h1>
</div>
<div
class=
"flex justify-center mt-2rem mb-1rem space-x-4"
>
<button
type=
"submit"
data-hs-overlay=
"#set-approvers-upload-modal"
class=
"ti-btn ti-btn-secondary"
[
class
.
ti-btn-disabled
]="!
selectedFile
"
(
click
)="
uploadFile
()"
[
disabled
]="!
selectedFile
"
>
อัปโหลด
</button>
</div>
</div>
</div>
</div>
</div>
<div
id=
"set-approvers-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"
>
...
@@ -410,7 +457,7 @@
...
@@ -410,7 +457,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=
"#set-approvers-
alert-edit-
modal"
>
data-hs-overlay=
"#set-approvers-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>
...
@@ -424,11 +471,11 @@
...
@@ -424,11 +471,11 @@
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<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=
"#set-approvers-modal
-edit
"
>
data-hs-overlay=
"#set-approvers-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=
"#set-approvers-alert-
edit-modal"
(
click
)="
addgroupapprove
();
showSuccessEdit
()"
>
data-hs-overlay=
"#set-approvers-alert-
modal"
(
click
)="
addgroupapprove
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
...
src/app/components/competency-assessment/competency-management/set-approvers/set-approvers.component.ts
View file @
a19d8b26
...
@@ -3,6 +3,7 @@ import { ToastrService } from 'ngx-toastr';
...
@@ -3,6 +3,7 @@ import { ToastrService } from 'ngx-toastr';
import
{
EmployeeModel
,
MyEmployeeModel
}
from
'src/app/shared/model/employee.model'
;
import
{
EmployeeModel
,
MyEmployeeModel
}
from
'src/app/shared/model/employee.model'
;
import
{
GroupApproveModel
,
MyGroupApproveModel
}
from
'src/app/shared/model/group-approve.model'
;
import
{
GroupApproveModel
,
MyGroupApproveModel
}
from
'src/app/shared/model/group-approve.model'
;
import
{
EmployeeService
}
from
'src/app/shared/services/employee.service'
;
import
{
EmployeeService
}
from
'src/app/shared/services/employee.service'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
GroupApproveService
}
from
'src/app/shared/services/group-approve.service'
;
import
{
GroupApproveService
}
from
'src/app/shared/services/group-approve.service'
;
interface
table
{
interface
table
{
currentPage
:
number
,
currentPage
:
number
,
...
@@ -16,7 +17,7 @@ interface table {
...
@@ -16,7 +17,7 @@ interface table {
styleUrls
:
[
'./set-approvers.component.scss'
]
styleUrls
:
[
'./set-approvers.component.scss'
]
})
})
export
class
SetApproversComponent
{
export
class
SetApproversComponent
{
@
Output
()
sendPathTitle
:
EventEmitter
<
string
[]
>
=
new
EventEmitter
<
string
[]
>
();
currentPage
=
1
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
groupapprove_list
:
GroupApproveModel
[]
=
[]
groupapprove_list
:
GroupApproveModel
[]
=
[]
...
@@ -35,16 +36,67 @@ export class SetApproversComponent {
...
@@ -35,16 +36,67 @@ export class SetApproversComponent {
empnumber
=
0
empnumber
=
0
currentModel
:
'add'
|
'edit'
|
'delete'
=
"add"
currentModel
:
'add'
|
'edit'
|
'delete'
=
"add"
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
constructor
(
private
groupapproveService
:
GroupApproveService
,
constructor
(
private
groupapproveService
:
GroupApproveService
,
private
toastr
:
ToastrService
,
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
cdr
:
ChangeDetectorRef
,
private
employeeService
:
EmployeeService
,
private
employeeService
:
EmployeeService
,
private
fileService
:
FileService
)
{
}
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
getGroupapprove_list
()
this
.
getGroupapprove_list
()
this
.
getEemployeeList
()
this
.
getEemployeeList
()
}
}
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
selectedFileName
=
this
.
selectedFile
?.
name
||
"กรุณาเลือกไฟล์"
}
uploadFile
()
{
if
(
!
this
.
selectedFile
)
{
alert
(
'กรุณาเลือกไฟล์ก่อนอัปโหลด'
)
return
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
groupapprove_listLoading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
''
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
downloadFile
()
{
const
fileName
=
'.xlsx'
this
.
fileService
.
downloadTemplate
(
fileName
).
subscribe
({
next
:
response
=>
{
const
url
=
window
.
URL
.
createObjectURL
(
response
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
url
;
a
.
download
=
fileName
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
window
.
URL
.
revokeObjectURL
(
url
);
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
}
})
}
getEemployeeList
()
{
getEemployeeList
()
{
this
.
employee_listLoading
=
true
this
.
employee_listLoading
=
true
this
.
employeeService
.
getList
().
subscribe
({
this
.
employeeService
.
getList
().
subscribe
({
...
@@ -85,7 +137,7 @@ export class SetApproversComponent {
...
@@ -85,7 +137,7 @@ export class SetApproversComponent {
this
.
groupapprove
.
apsapprove4
=
data
this
.
groupapprove
.
apsapprove4
=
data
}
else
if
(
this
.
empnumber
==
5
)
{
}
else
if
(
this
.
empnumber
==
5
)
{
this
.
groupapprove
.
apsapprove5
=
data
this
.
groupapprove
.
apsapprove5
=
data
}
}
}
}
getGroupapprove_list
()
{
getGroupapprove_list
()
{
...
@@ -107,7 +159,7 @@ export class SetApproversComponent {
...
@@ -107,7 +159,7 @@ export class SetApproversComponent {
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
groupapprove_listFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
groupapprove_listFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
}
groupapprove_listFilter
()
{
groupapprove_listFilter
()
{
return
this
.
groupapprove_list
.
filter
(
x
=>
x
.
apsapprove1
.
employeeId
||
x
.
apsapprove2
.
employeeId
||
x
.
apsapprove3
.
employeeId
||
x
.
apsapprove4
.
employeeId
||
x
.
apsapprove5
.
employeeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
return
this
.
groupapprove_list
.
filter
(
x
=>
x
.
apsapprove1
.
employeeId
||
x
.
apsapprove2
.
employeeId
||
x
.
apsapprove3
.
employeeId
||
x
.
apsapprove4
.
employeeId
||
x
.
apsapprove5
.
employeeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove1
.
fname
||
x
.
apsapprove1
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove1
.
fname
||
x
.
apsapprove1
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove2
.
fname
||
x
.
apsapprove2
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove2
.
fname
||
x
.
apsapprove2
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove3
.
fname
||
x
.
apsapprove3
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove3
.
fname
||
x
.
apsapprove3
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
...
@@ -130,14 +182,17 @@ export class SetApproversComponent {
...
@@ -130,14 +182,17 @@ export class SetApproversComponent {
this
.
groupapproveService
.
post
(
this
.
groupapprove
).
subscribe
({
this
.
groupapproveService
.
post
(
this
.
groupapprove
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
if
(
response
.
success
)
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
this
.
getGroupapprove_list
()
}
else
{
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
}
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
}
})
})
}
}
...
@@ -146,36 +201,26 @@ export class SetApproversComponent {
...
@@ -146,36 +201,26 @@ export class SetApproversComponent {
this
.
groupapproveService
.
delete
(
this
.
groupapprove
).
subscribe
({
this
.
groupapproveService
.
delete
(
this
.
groupapprove
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
if
(
response
.
success
)
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
this
.
getGroupapprove_list
()
}
else
{
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
}
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
}
})
})
}
}
clear
()
{
showSuccess
()
{
const
data
=
new
MyEmployeeModel
({});
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
this
.
groupapprove
.
apsapprove1
=
data
timeOut
:
3000
,
this
.
groupapprove
.
apsapprove2
=
data
positionClass
:
'toast-top-right'
,
this
.
groupapprove
.
apsapprove3
=
data
});
this
.
groupapprove
.
apsapprove4
=
data
}
this
.
groupapprove
.
apsapprove5
=
data
showSuccessEdit
()
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
showSuccessDelete
()
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
}
}
}
\ No newline at end of file
src/app/components/dashboard/dashboard.module.ts
View file @
a19d8b26
...
@@ -141,6 +141,7 @@ import { ManageUserComponent } from '../company-components/account-settings/mana
...
@@ -141,6 +141,7 @@ import { ManageUserComponent } from '../company-components/account-settings/mana
import
{
PmstypeService
}
from
'src/app/shared/services/pmstype.service'
;
import
{
PmstypeService
}
from
'src/app/shared/services/pmstype.service'
;
import
{
PmstopicService
}
from
'src/app/shared/services/pmstopic.service'
;
import
{
PmstopicService
}
from
'src/app/shared/services/pmstopic.service'
;
import
{
PmsGroupAssessmentService
}
from
'src/app/shared/services/pms-group-assessment.service'
;
import
{
PmsGroupAssessmentService
}
from
'src/app/shared/services/pms-group-assessment.service'
;
import
{
PmsGroupApproveService
}
from
'src/app/shared/services/pms-group-approve.service'
;
export
const
MY_DATE_FORMATS
=
{
export
const
MY_DATE_FORMATS
=
{
parse
:
{
parse
:
{
...
@@ -312,6 +313,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
...
@@ -312,6 +313,7 @@ export class CustomDateAdapter extends NativeDateAdapter {
PmstypeService
,
PmstypeService
,
PmstopicService
,
PmstopicService
,
PmsGroupAssessmentService
,
PmsGroupAssessmentService
,
PmsGroupApproveService
,
{
{
provide
:
HTTP_INTERCEPTORS
,
provide
:
HTTP_INTERCEPTORS
,
useClass
:
HttpRequestInterceptor
,
useClass
:
HttpRequestInterceptor
,
...
...
src/app/components/performance-management-evaluation/assessment-management/assigning-approvers/assigning-approvers.component.html
View file @
a19d8b26
<div
class=
"header-title-type"
>
<div
class=
"w-full min-height-50px mb-10px justify-between items-center"
>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<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"
style=
"height: 40px;"
>
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
<div
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchEMP
()"
>
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"
>
<div
<i
class=
"ri-search-line text-gray"
></i>
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"
>
</div>
<i
class=
"ri-search-line text-gray"
></i>
</div>
</div>
</div>
</div>
<div
class=
"px-1"
>
</div>
<button
type=
"button"
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-10 m-0 shadow-md"
<div
class=
"px-1"
>
data-hs-overlay=
"#"
>
<button
type=
"button"
<i
class=
"ti ti-file-plus"
></i>
class=
"ti-btn ti-btn bg-pink-500/10 text-pink-500 hover:text-white hover:bg-pink-500 ring-offset-white focus:ring-pink-500 dark:focus:ring-offset-white/10 h-45px m-0 shadow-md"
import
data-hs-overlay=
"#assigning-approvers-upload-modal"
</button>
(
click
)="
fileInput
.
value =
''
;
selectedFile=
null;selectedFileName
=
'กรุณาเลือกไฟล์'"
>
</div>
<i
class=
"ti ti-file-plus"
></i>
<div
class=
"px-1"
>
import
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-warning h-10 m-0 shadow-md"
>
</button>
<i
class=
"ti ti-book fs-l"
></i>
</div>
Help
<div
class=
"px-1"
>
</button>
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-warning h-45px m-0 shadow-md"
>
</div>
<i
class=
"ti ti-book fs-l"
></i>
</div>
Help
</div>
</button>
</div>
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto table-bordered rounded-t-md"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<div
id=
"card-type-1"
role=
"tabpanel"
aria-labelledby=
"card-type-item-1"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<div
class=
"overflow-auto shadow-md"
>
<thead>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover"
>
<tr>
<thead>
<ng-container
<tr>
*
ngFor=
"let item of ['ชื่อพนักงาน','ลำดับที่ 1','ลำดับที่ 2','ลำดับที่ 3','ลำดับที่ 4','ลำดับที่ 5','การจัดการ']; let f = first; let l = last; let i = index"
>
<ng-container
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
*
ngFor=
"let item of ['พนักงาน','ระดับ 1','ระดับ 2','ระดับ 3','ระดับ 4','ระดับ 5','Action']; let f = first; let l = last; let i = index"
>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary"
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
[
class
.!
text-center
]="
f
||
l
"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
<span
class=
"text-sm"
>
{{ item }}
</span>
</div>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!f && !l"
>
</th>
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"30"
</ng-container>
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
</tr>
<path
</thead>
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"
>
<tbody
*
ngIf=
"groupapprove_listLoading"
>
</path>
<tr>
</svg>
<td
class=
"text-center"
colspan=
"100%"
>
</div>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"ti-spinner w-8 h-8 text-secondary mx-1"
role=
"status"
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!f && i==2"
>
aria-label=
"loading"
>
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"30"
<span
class=
"sr-only"
>
Loading...
</span>
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
</div>
<path
</td>
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"
>
</tr>
</path>
</tbody>
</svg>
<tbody
*
ngIf=
"!groupapprove_listLoading&&!groupapprove_listFilter().length"
>
</div>
<tr>
</th>
<td
class=
"text-center"
colspan=
"100%"
>
</ng-container>
ไม่พบข้อมูล
</tr>
</td>
</thead>
</tr>
<tbody>
</tbody>
<tr
*
ngFor=
"let item of[
<tbody
*
ngIf=
"!groupapprove_listLoading&&groupapprove_listFilter().length"
>
['สุชาตา บาทวงษ์','อุทุมพร ประชาดี','พรเทพ ทองแย้ม','มัทนา ย่าล่า','',''],
<tr
['ฐานปนีย์ สกุลวงษ์','อุทุมพร ประชาดี','พรเทพ ทองแย้ม','มัทนา ย่าล่า','',''],
*
ngFor=
"let item of groupapprove_listFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
['วิครุฑ มานะดี','อุทุมพร ประชาดี','พรเทพ ทองแย้ม','','',''],
<td>
{{item.apsassessy.fname}} {{item.apsassessy.lname}}
</td>
['สุมาลี รักษีสิงห์','อุทุมพร ประชาดี','ชุมพล น้อยพิทักษ์','','',''],
<td>
{{item.apsapprove1.fname}} {{item.apsapprove1.lname}}
</td>
['กรวิภา ชัยสวัสดิ์','อุทุมพร ประชาดี','ชุมพล น้อยพิทักษ์','','',''],
<td>
{{item.apsapprove2.fname}} {{item.apsapprove2.lname}}
</td>
['กสินธร สีปัญญา','อุทุมพร ประชาดี','ชุมพล น้อยพิทักษ์','','','']];let i = index"
>
<td>
{{item.apsapprove3.fname}} {{item.apsapprove3.lname}}
</td>
<td
style=
"font-size: 12px; width: 15%;"
>
{{item[0]}}
</td>
<td>
{{item.apsapprove4.fname}} {{item.apsapprove4.lname}}
</td>
<td
style=
"font-size: 12px; width: 150px;"
>
{{item[1]}}
</td>
<td>
{{item.apsapprove5.fname}} {{item.apsapprove5.lname}}
</td>
<td
style=
"font-size: 12px; width: 150px;"
>
{{item[2]}}
</td>
<td
class=
"flex justify-center"
>
<td
style=
"font-size: 12px; width: 150px;"
>
{{item[3]}}
</td>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
<td
style=
"font-size: 12px; width: 150px;"
>
{{item[4]}}
</td>
(
click
)="
currentModel=
'edit'
;
selectGroupapprove
(
item
)"
<td
style=
"font-size: 12px; width: 150px;"
>
{{item[5]}}
</td>
data-hs-overlay=
"#assigning-approvers-modal"
></i>
<td
class=
"flex justify-center"
>
</td>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#assigning-approvers-modal-edit"
></i>
</tr>
</td>
</tbody>
</tr>
</table>
</tbody>
</table>
</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=
"ti-pagination"
>
<ul
class=
"nav-tabs"
>
<li>
<div
class=
"px-1 py-1 bg-white rounded-2 shadow justify-content-center align-items-center"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
<div
class=
"box-body"
>
(
click
)="
currentPage =
(currentPage-1
||
1
)"
>
<nav
class=
"pagination-style-3 overflow-auto"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
<ul
class=
"ti-pagination"
>
</a>
<li>
</li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
>
<li
*
ngFor=
"let item of page;let f = first;let l = last"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
<ng-container
*
ngIf=
"item==3&¤tPage!=1&¤tPage!=2&¤tPage!=3"
>
</a>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
</li>
</a>
<li><a
class=
"page-link active"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a></li>
</ng-container>
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
2
</a></li>
<ng-container
*
ngIf=
"(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)"
>
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
3
</a></li>
<a
class=
"page-link"
href=
"javascript:void(0);"
[
class
.
active
]="
item=
=currentPage"
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
4
</a></li>
(
click
)="
currentPage=
item"
>
{{item}}
<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
<li>
*
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);"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</a>
</a>
</ng-container>
</li>
</li>
</ul>
<li>
</nav>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
</div>
(
click
)="
currentPage =
(currentPage
>
page.length-1 ? currentPage: currentPage+1 )">
</div>
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</ul>
</a>
<ul
class=
"nav-tabs mt-1"
>
</li>
<p>
Show 1 to 10 of 50 items
</p>
</ul>
</ul>
</nav>
</div>
</div>
</div>
<div
id=
"assigning-approvers-modal
-edit
"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"assigning-approvers-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=
"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"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
...
@@ -127,7 +126,7 @@
...
@@ -127,7 +126,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=
"#assigning-approvers-modal
-edit
"
>
data-hs-overlay=
"#assigning-approvers-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>
...
@@ -136,7 +135,7 @@
...
@@ -136,7 +135,7 @@
<div
class=
"ti-modal-center"
>
<div
class=
"ti-modal-center"
>
<div
class=
"flex justify-end"
style=
"padding-right: 1rem;"
>
<div
class=
"flex justify-end"
style=
"padding-right: 1rem;"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
(
click
)="
clear
()"
>
<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)"
>
...
@@ -161,77 +160,126 @@
...
@@ -161,77 +160,126 @@
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-body mt-1"
>
<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=
"พนักงานระดับ 01-02"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-1/2 bg-input-readonly"
readonly
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 1
</label>
[
value
]="
groupapprove
.
apsassessy
.
fname
+
'
'
+
groupapprove
.
apsassessy
.
lname
"
>
<div
class=
"flex"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ระดับพนักงาน
</label>
<div
class=
"relative flex rounded-md w-2/3"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-1/2 bg-input-readonly"
readonly
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 2.5rem;"
value=
""
>
[
value
]="
groupapprove
.
personalLevel
.
tdesc
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 1
</label>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
<div
class=
"flex"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<div
class=
"relative flex rounded-md w-2/3"
>
</button>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
</div>
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
style=
"padding-right: 2.5rem;"
[
value
]="
groupapprove
.
apsapprove1
.
fname
+'
'+
groupapprove
.
apsapprove1
.
lname
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
1;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
(
click
)="
empnumber =
1"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 2
</label>
</div>
<div
class=
"flex"
>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 2
</label>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"flex"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 2.5rem;"
value=
""
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
style=
"padding-right: 2.5rem;"
</button>
[
value
]="
groupapprove
.
apsapprove2
.
fname
+'
'+
groupapprove
.
apsapprove2
.
lname
"
>
</div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
2;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
(
click
)="
empnumber =
2"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 3
</label>
</div>
<div
class=
"flex"
>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 3
</label>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"flex"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 2.5rem;"
value=
""
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
style=
"padding-right: 2.5rem;"
</button>
[
value
]="
groupapprove
.
apsapprove3
.
fname
+'
'+
groupapprove
.
apsapprove3
.
lname
"
>
</div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
3;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
(
click
)="
empnumber =
3"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 4
</label>
</div>
<div
class=
"flex"
>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 4
</label>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"flex"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 2.5rem;"
value=
""
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
style=
"padding-right: 2.5rem;"
</button>
[
value
]="
groupapprove
.
apsapprove4
.
fname
+'
'+
groupapprove
.
apsapprove4
.
lname
"
>
</div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
4;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
(
click
)="
empnumber =
4"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 5
</label>
</div>
<div
class=
"flex"
>
<label
class=
"ti-form-label mt-2rem"
>
ผู้ประเมินลำดับที่ 5
</label>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"flex"
>
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 2.5rem;"
value=
""
>
<div
class=
"relative flex rounded-md w-2/3"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<input
type=
"text"
name=
"hs-leading-button-add-on-with-icon-and-button"
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
>
class=
"ti-form-input rounded-md ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
readonly
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
style=
"padding-right: 2.5rem;"
</button>
[
value
]="
groupapprove
.
apsapprove5
.
fname
+'
'+
groupapprove
.
apsapprove5
.
lname
"
>
</div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
empnumber =
5;selectEMP()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#assigning-approvers-table-modal-edit"
(
click
)="
empnumber =
5"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex justify-end mt-3rem mb-1rem space-x-4"
>
<div
class=
"flex justify-end mt-3rem mb-1rem space-x-4"
>
<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=
"#assigning-approvers-modal
-edit
"
>
data-hs-overlay=
"#assigning-approvers-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=
"#assigning-approvers-alert-edi
t-modal"
>
data-hs-overlay=
"#assigning-approvers-aler
t-modal"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"assigning-approvers-table-modal-edit"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"assigning-approvers-table-modal-edit"
class=
"hs-overlay hidden ti-modal"
>
...
@@ -242,9 +290,8 @@
...
@@ -242,9 +290,8 @@
รายชื่อพนักงาน
รายชื่อพนักงาน
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<button
type=
"button"
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#assigning-approvers-modal"
>
data-hs-overlay=
"#assigning-approvers-modal-edit"
>
<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>
...
@@ -256,7 +303,8 @@
...
@@ -256,7 +303,8 @@
<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
)]="
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>
...
@@ -276,128 +324,165 @@
...
@@ -276,128 +324,165 @@
<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 ['รหัส','ชื่อ','นามสกุล','ตำเเหน่ง','หน่วยงาน','การจัดการ
']; 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
"
>
<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=
"!f && i==1"
>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"30"
*
ngIf=
"!f && i==1"
>
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
<path
width=
"30"
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
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
</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"
>
</svg>
</path>
</div>
</svg>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!f && i==2"
>
</div>
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"30"
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
*
ngIf=
"!f && i==2"
>
<path
<svg
class=
"head-table-icon"
xmlns=
"http://www.w3.org/2000/svg"
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"
>
width=
"30"
height=
"13"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
</path>
<path
</svg>
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"
>
</div>
</path>
</svg>
</div>
</th>
</th>
</ng-container>
</ng-container>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody
*
ngIf=
"!employee_listFilter().length"
>
<tr
*
ngFor=
"let item of[
<tr>
['10001', 'สามารถ','พยัคร้าย','Human Resource Development Officer','BU5'],
<td
class=
"text-center"
colspan=
"100%"
>
['10002', 'สมหวัง','ฟันหลุด','Human Resource Development Officer','BU5'],
ไม่พบข้อมูล
['10003', 'สามารถ','พยัคร้าย','Human Resource Development Officer','BU5'],
['10004', 'สมหวัง','ฟันหลุด','Human Resource Development Officer','BU5'],
['10005', 'สามารถ','พยัคร้าย','Human Resource Development Officer','BU5'],
['10006', 'สมจิต','ฟันหลอ','Human Resource Development Officer','BU5'],];let i = index"
>
<td
class=
"flex justify-center"
style=
"font-size: 12px;"
>
{{item[0]}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item[1]}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item[2]}}
</td>
<td
style=
"font-size: 12px; width: 20%; word-break: break-word; white-space: normal;"
>
{{item[3]}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item[4]}}
</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=
"#assigning-approvers-modal-edit"
>
<i
class=
"ri-add-line"
></i>
Select
</button>
</div>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
<tbody
*
ngIf=
"employee_listFilter().length"
>
<ng-container
*
ngIf=
"currentModel=='edit'"
>
<tr
*
ngFor=
"let item of employee_listFilter() | slice:((employeeModal.currentPage-1) * 10) : (((employeeModal.currentPage-1) * 10) + 10);let i = index"
class=
"cursor-pointer"
>
<td
style=
"font-size: 12px;"
>
{{item.employeeId}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.fname}}
</td>
<td
style=
"font-size: 12px; width: 20%;"
>
{{item.lname}}
</td>
<td
style=
"font-size: 12px; width: 20%; word-break: break-word; white-space: normal;"
>
{{item.position.tdesc}}
</td>
<td
style=
"font-size: 12px; width: 10%;"
>
{{item.bu1.bu1id}}
</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"
(
click
)="
selectEMP
(
item
)"
data-hs-overlay=
"#assigning-approvers-modal"
>
<i
class=
"ri-add-line"
></i>
Select
</button>
</div>
</td>
</tr>
</ng-container>
</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=
"employeeModal.page.length"
>
<ul
class=
"nav-tabs"
>
<ul
class=
"ti-pagination"
>
<div
class=
"px-1 bg-white rounded-2 shadow justify-content-center align-items-center"
>
<li>
<div
class=
"box-body"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
<nav
class=
"pagination-style-3 overflow-auto"
>
(
click
)="
employeeModal
.
currentPage =
(employeeModal.currentPage-1
||
1
)"
>
<ul
class=
"ti-pagination"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
<li>
</a>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
>
</li>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
<li
*
ngFor=
"let item of employeeModal.page"
>
</a>
<a
class=
"page-link"
href=
"javascript:void(0);"
</li>
[
class
.
active
]="
item=
=employeeModal.currentPage"
<li><a
class=
"page-link active"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a></li>
(
click
)="
employeeModal
.
currentPage=
item"
>
{{item}}
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
2
</a></li>
</a>
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
3
</a></li>
</li>
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
4
</a></li>
<li>
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
5
</a></li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
...
</a></li>
(
click
)="
employeeModal
.
currentPage =
(employeeModal.currentPage
>
employeeModal.page.length-1 ? employeeModal.currentPage: employeeModal.currentPage+1 )">
<li><a
class=
"page-link"
href=
"javascript:void(0);"
>
31
</a></li>
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
<li>
</a>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
>
</li>
<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>
</ul>
</
di
v>
</
na
v>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"assigning-approvers-alert-
edit-
modal"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"assigning-approvers-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"
>
<h3
class=
"text-xxl font-bold text-primary"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แจ้งเตือน
แจ้งเตือน
</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=
"#assigning-approvers-alert-edit
-modal"
>
data-hs-overlay=
"#assigning-approvers
-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"
>
ยืนยันการเเก้ไขข้อมูลหรือไม่
ยืนยันการเเก้ไขข้อมูลหรือไม่
</p>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<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=
"#assigning-approvers-modal-edit
"
>
data-hs-overlay=
"#assigning-approvers-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=
"#assigning-approvers-alert-edit-modal"
(
click
)="
addUser
();
showSuccessEdit
()"
>
data-hs-overlay=
"#assigning-approvers-alert-modal"
(
click
)="
addgroupapprove
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"assigning-approvers-upload-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out rounded-md"
>
<div
class=
"ti-modal-header bg-primary !rounded-none !rounded-t-sm"
>
<h5
class=
"text-xxl font-bold text-white"
>
นำเข้าผู้ประเมิน
</h5>
</div>
<div
class=
"ti-modal-body max-h-full overflow-hidden ti-modal-content !rounded-t-none !rounded-b-sm"
>
<h1
class=
"mt-2"
style=
"text-align: center;"
>
ไฟล์
</h1>
<div
class=
"mt-2 p-2"
>
<div
class=
"flex rounded-md"
>
<input
#
fileInput
id=
"fileInput"
type=
"file"
(
change
)="
onFileSelected
($
event
)"
hidden
>
<input
type=
"text"
[
value
]="
selectedFileName
"
readonly
(
click
)="
fileInput
.
click
()"
class=
"ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10 cursor-pointer"
>
<button
type=
"button"
(
click
)="
fileInput
.
click
()"
class=
"inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-secondary text-white hover:bg-secondary focus:z-10 focus:outline-none focus:ring-0 focus:ring-secondary transition-all text-sm"
>
<i
class=
"ti ti-upload"
></i>
</button>
</div>
<div
class=
"flex justify-center mt-2rem "
>
<h1
class=
"cursor-pointer justify-center -mb-px inline-flex items-center gap-2 font-weight-500 font-size-12px
text-center text-secondary border-secondary border-b-2 align-items-end"
(
click
)="
downloadFile
()"
>
ดาวน์โหลดตัวอย่างไฟล์
</h1>
</div>
<div
class=
"flex justify-center mt-2rem mb-1rem space-x-4"
>
<button
type=
"submit"
data-hs-overlay=
"#assigning-approvers-upload-modal"
class=
"ti-btn ti-btn-secondary"
[
class
.
ti-btn-disabled
]="!
selectedFile
"
(
click
)="
uploadFile
()"
[
disabled
]="!
selectedFile
"
>
อัปโหลด
</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/components/performance-management-evaluation/assessment-management/assigning-approvers/assigning-approvers.component.ts
View file @
a19d8b26
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
C
hangeDetectorRef
,
C
omponent
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
EmployeeModel
,
MyEmployeeModel
}
from
'src/app/shared/model/employee.model'
;
import
{
GroupApproveModel
,
MyGroupApproveModel
}
from
'src/app/shared/model/group-approve.model'
;
import
{
EmployeeService
}
from
'src/app/shared/services/employee.service'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
PmsGroupApproveService
}
from
'src/app/shared/services/pms-group-approve.service'
;
interface
table
{
currentPage
:
number
,
page
:
number
[],
search
:
string
}
@
Component
({
@
Component
({
selector
:
'app-assigning-approvers'
,
selector
:
'app-assigning-approvers'
,
templateUrl
:
'./assigning-approvers.component.html'
,
templateUrl
:
'./assigning-approvers.component.html'
,
styleUrls
:
[
'./assigning-approvers.component.scss'
]
styleUrls
:
[
'./assigning-approvers.component.scss'
]
})
})
export
class
AssigningApproversComponent
{
export
class
AssigningApproversComponent
{
@
Input
()
pathTitle
=
[
'การประเมินจัดการประสิทธิภาพ'
,
'การจัดการประเมิน'
,
'จัดกลุ่มประเมิน'
];
@
Output
()
sendPathTitle
:
EventEmitter
<
string
[]
>
=
new
EventEmitter
<
string
[]
>
();
@
Output
()
sendGroupShow
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
activeTab
:
string
=
'tab1'
;
// กำหนด tab เริ่มต้น
onEdit
(){
currentPage
=
1
this
.
sendGroupShow
.
emit
(
'2'
);
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
}
groupapprove_list
:
GroupApproveModel
[]
=
[]
groupapprove_listLoading
=
false
groupapprove
:
GroupApproveModel
=
new
MyGroupApproveModel
()
search
=
""
// ฟังก์ชันในการเปลี่ยนแท็บ
employee_list
:
EmployeeModel
[]
=
[]
changeTab
(
tab
:
{
id
:
string
,
text
:
string
})
{
employee_listLoading
=
false
this
.
sendPathTitle
.
emit
([
'การประเมินจัดการประสิทธิภาพ'
,
'การจัดการประเมิน'
,
tab
.
text
]);
employee
:
EmployeeModel
=
new
MyEmployeeModel
({})
this
.
activeTab
=
tab
.
id
;
employeeModal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
}
empnumber
=
0
// การจัดการการเปิดปิด modal
currentModel
:
'add'
|
'edit'
|
'delete'
=
"add"
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'
;
}
closeModal
(
name
:
string
)
{
selectedFile
:
File
|
null
=
null
;
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
if
(
!
this
.
isAnyModalOpen
())
{
constructor
(
private
pmsGroupapproveService
:
PmsGroupApproveService
,
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
employeeService
:
EmployeeService
,
private
fileService
:
FileService
)
{
}
ngOnInit
():
void
{
this
.
getGroupapprove_list
()
this
.
getEemployeeList
()
}
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
selectedFileName
=
this
.
selectedFile
?.
name
||
"กรุณาเลือกไฟล์"
}
uploadFile
()
{
if
(
!
this
.
selectedFile
)
{
alert
(
'กรุณาเลือกไฟล์ก่อนอัปโหลด'
)
return
}
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
groupapprove_listLoading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
''
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
}
downloadFile
()
{
isAnyModalOpen
():
boolean
{
const
fileName
=
'.xlsx'
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// ตรวจสอบว่า modal อื่นยังเปิดอยู่หรือไม่
this
.
fileService
.
downloadTemplate
(
fileName
).
subscribe
({
next
:
response
=>
{
const
url
=
window
.
URL
.
createObjectURL
(
response
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
url
;
a
.
download
=
fileName
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
window
.
URL
.
revokeObjectURL
(
url
);
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
}
})
}
}
// ฟังก์ชัน toggle checkbox
getEemployeeList
()
{
isChecked
:
boolean
=
false
;
// ใช้สำหรับตรวจสอบสถานะของ checkbox
this
.
employee_listLoading
=
true
this
.
employeeService
.
getList
().
subscribe
({
toggleCheckbox
()
{
next
:
response
=>
{
this
.
isChecked
=
!
this
.
isChecked
;
// สลับสถานะ
this
.
employee_list
=
response
.
map
(
x
=>
{
return
new
MyEmployeeModel
(
x
)
})
this
.
employee_listLoading
=
false
this
.
searchEMP
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
employee_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
}
employee_listFilter
()
{
// ฟังก์ชันสำหรับการเพิ่ม ลบ หรือแก้ไข ข้อมูล
return
this
.
employee_list
.
filter
(
x
=>
x
.
fname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
addUser
()
{
x
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
()))
console
.
log
(
'เพิ่มผู้ใช้งาน'
);
}
}
searchEMP
()
{
deleteUser
()
{
this
.
employeeModal
.
currentPage
=
1
console
.
log
(
'ลบผู้ใช้งาน'
);
this
.
employeeModal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
employee_listFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
}
empChange
()
{
editUser
()
{
const
employee
=
this
.
employee_list
.
find
(
x
=>
x
.
employeeId
==
this
.
employee
.
employeeId
)
console
.
log
(
'แก้ไขผู้ใช้งาน'
);
this
.
selectEMP
(
employee
||
new
MyEmployeeModel
({
employeeId
:
this
.
employee
.
employeeId
}))
}
}
selectEMP
(
employee
?:
EmployeeModel
)
{
currentModal
=
""
;
const
data
=
new
MyEmployeeModel
(
employee
||
{});
if
(
this
.
empnumber
==
1
)
{
constructor
(
private
toastr
:
ToastrService
)
{
}
this
.
groupapprove
.
apsapprove1
=
data
}
else
if
(
this
.
empnumber
==
2
)
{
this
.
groupapprove
.
apsapprove2
=
data
}
else
if
(
this
.
empnumber
==
3
)
{
this
.
groupapprove
.
apsapprove3
=
data
}
else
if
(
this
.
empnumber
==
4
)
{
this
.
groupapprove
.
apsapprove4
=
data
}
else
if
(
this
.
empnumber
==
5
)
{
this
.
groupapprove
.
apsapprove5
=
data
}
showSuccess
()
{
}
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
getGroupapprove_list
()
{
timeOut
:
3000
,
this
.
groupapprove_listLoading
=
true
positionClass
:
'toast-top-right'
,
this
.
pmsGroupapproveService
.
getList
().
subscribe
({
});
next
:
response
=>
{
this
.
groupapprove_list
=
response
.
map
(
x
=>
new
MyGroupApproveModel
(
x
))
this
.
groupapprove_listLoading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
groupapprove_listFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
groupapprove_listFilter
()
{
return
this
.
groupapprove_list
.
filter
(
x
=>
x
.
apsapprove1
.
employeeId
||
x
.
apsapprove2
.
employeeId
||
x
.
apsapprove3
.
employeeId
||
x
.
apsapprove4
.
employeeId
||
x
.
apsapprove5
.
employeeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove1
.
fname
||
x
.
apsapprove1
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove2
.
fname
||
x
.
apsapprove2
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove3
.
fname
||
x
.
apsapprove3
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove4
.
fname
||
x
.
apsapprove4
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
apsapprove5
.
fname
||
x
.
apsapprove5
.
lname
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
()))
}
}
showSuccessEdit
()
{
selectGroupapprove
(
groupapprove
?:
GroupApproveModel
)
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
this
.
groupapprove
=
new
MyGroupApproveModel
(
groupapprove
)
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
}
show
SuccessDelete
(
)
{
show
Alert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเ
จ้งเตือน'
,
{
this
.
toastr
[
type
](
text
,
'แ
จ้งเตือน'
,
{
timeOut
:
3000
,
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
positionClass
:
'toast-top-right'
,
})
;
})
}
}
}
addgroupapprove
()
{
this
.
groupapprove_listLoading
=
true
this
.
pmsGroupapproveService
.
post
(
this
.
groupapprove
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
deletegroupapprove
()
{
this
.
groupapprove_listLoading
=
true
this
.
pmsGroupapproveService
.
delete
(
this
.
groupapprove
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getGroupapprove_list
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
groupapprove_listLoading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
clear
()
{
const
data
=
new
MyEmployeeModel
({});
this
.
groupapprove
.
apsapprove1
=
data
this
.
groupapprove
.
apsapprove2
=
data
this
.
groupapprove
.
apsapprove3
=
data
this
.
groupapprove
.
apsapprove4
=
data
this
.
groupapprove
.
apsapprove5
=
data
}
}
\ No newline at end of file
src/app/shared/services/pms-group-approve.service.ts
0 → 100644
View file @
a19d8b26
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs'
;
import
{
environment
}
from
'src/environments/environment'
;
import
{
GroupApproveModel
}
from
'../model/group-approve.model'
;
import
{
AlertModel
}
from
'../model/alert.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
PmsGroupApproveService
{
api
=
"/pms-group-approve"
urlApi
=
environment
.
baseUrl
+
this
.
api
constructor
(
private
http
:
HttpClient
)
{
}
getByPersonalLevel
(
plId
:
string
):
Observable
<
GroupApproveModel
>
{
return
this
.
http
.
get
<
GroupApproveModel
>
(
this
.
urlApi
+
"/"
+
plId
);
}
getList
():
Observable
<
GroupApproveModel
[]
>
{
return
this
.
http
.
get
<
GroupApproveModel
[]
>
(
this
.
urlApi
+
"/lists"
)
}
post
(
body
:
GroupApproveModel
):
Observable
<
AlertModel
>
{
return
this
.
http
.
post
<
AlertModel
>
(
this
.
urlApi
,
body
)
}
delete
(
body
:
GroupApproveModel
):
Observable
<
AlertModel
>
{
const
options
=
{
headers
:
new
HttpHeaders
({
"Content-Type"
:
"application/json"
,
}),
body
:
body
};
return
this
.
http
.
delete
<
AlertModel
>
(
this
.
urlApi
,
options
)
}
}
\ 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