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
0612093e
Commit
0612093e
authored
Apr 16, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
การจัดการรายละเอียดงาน
parent
b4ff8dbf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
253 deletions
+133
-253
sub-job-competency.component.html
...ency/sub-job-competency/sub-job-competency.component.html
+9
-69
sub-job-competency.component.ts
...etency/sub-job-competency/sub-job-competency.component.ts
+35
-13
sub-job-position-indicators.component.html
...ion-indicators/sub-job-position-indicators.component.html
+9
-71
sub-job-position-indicators.component.ts
...ition-indicators/sub-job-position-indicators.component.ts
+35
-15
sub-job-qualifications.component.html
...-job-qualifications/sub-job-qualifications.component.html
+9
-71
sub-job-qualifications.component.ts
...ub-job-qualifications/sub-job-qualifications.component.ts
+36
-14
No files found.
src/app/components/job-detail-components/job-competency/sub-job-competency/sub-job-competency.component.html
View file @
0612093e
...
...
@@ -4,7 +4,7 @@
<div
class=
"relative shadow-md"
>
<input
type=
"text"
id=
"hs-leading-icon"
name=
"hs-leading-icon"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
[(
ngModel
)]="
search
"
>
<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"
>
...
...
@@ -20,74 +20,14 @@
import
</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="#sub-command-structure-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">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div> -->
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสงาน','ชื่อลักษณะงาน (ไทย)','ชื่อลักษณะงาน (อังกฤษ)','การจัดการ']; let f = first; let l = last; let i = index"
>
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"loading"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"ti-spinner w-8 h-8 text-secondary mx-1"
role=
"status"
aria-label=
"loading"
>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&!jobcodeFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&jobcodeFilter().length"
>
<tr
*
ngFor=
"let item of jobcodeFilter() |slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index"
>
<td
class=
"text-center"
>
{{((currentPage-1) * pageSize)+(i+1)}}
</td>
<td
class=
"text-center"
>
{{item.jobcodeId}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
modalStatus=
'edit'
;
edit
(
item
)"
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
></i>
</td>
</tr>
</tbody>
</table>
</div>
<app-pagination
[
totalItems
]="
jobcodeFilter
().
length
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
currentPage =
$event"
(
pageSizeChange
)="
pageSize =
$event;currentPage
=
1
"
></app-pagination>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
jobCodeList
"
[
checkBoxSetting
]='
false
'
[
columns
]="
columns
"
modalName=
"#sub-job-competency-component-modal-edit"
(
sendSelectData
)="
currentModal=
'edit'
;
edit
($
event
)"
>
</app-datagrid-syncfution>
</div>
...
...
@@ -182,16 +122,16 @@
</div>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
ยืนยันการบันทึกข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
@@ -202,7 +142,7 @@
บันทึกข้อมูล
</a>
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
src/app/components/job-detail-components/job-competency/sub-job-competency/sub-job-competency.component.ts
View file @
0612093e
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
...
...
@@ -13,16 +14,37 @@ import { JobCodeService } from 'src/app/shared/services/job-code.service';
export
class
SubJobCompetencyComponent
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
pageSize
=
10
pageSize
=
10
search
=
""
jobCodeList
:
JobCodeModel
[]
=
[]
jobCodeList
:
JobCodeModel
[]
=
[]
loading
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
modalStatus
=
''
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
columns
:
ColumnModel
[]
=
[{
field
:
"jobcodeId"
,
headerText
:
"ชื่อล็อกอิน"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"ชื่อลักษณะงาน (ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"ชื่อลักษณะงาน (อังกฤษ)"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'jobcodeId'
,
'tdesc'
,
'edesc'
],
operator
:
'contains'
,
ignoreCase
:
false
}
constructor
(
private
toastr
:
ToastrService
,
private
fileService
:
FileService
,
...
...
@@ -32,7 +54,7 @@ export class SubJobCompetencyComponent {
ngOnInit
():
void
{
this
.
getListJob
();
}
getListJob
()
{
getListJob
()
{
this
.
loading
=
false
this
.
jobcodeService
.
getList
().
subscribe
({
next
:
response
=>
{
...
...
@@ -52,15 +74,15 @@ export class SubJobCompetencyComponent {
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
jobcodeFilter
().
length
/
this
.
pageSize
)
},
(
_
,
i
)
=>
i
+
1
);
}
edit
(
item
:
JobCodeModel
)
{
edit
(
item
:
JobCodeModel
)
{
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
selectJob
=
new
MyJobCodeModel
(
item
)
}
clearValue
()
{
clearValue
()
{
this
.
selectJob
.
competencyWorkText
=
''
}
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -71,8 +93,8 @@ export class SubJobCompetencyComponent {
this
.
cdr
.
detectChanges
()
})
}
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -148,5 +170,5 @@ export class SubJobCompetencyComponent {
}
}
src/app/components/job-detail-components/job-position-indicators/sub-job-position-indicators/sub-job-position-indicators.component.html
View file @
0612093e
...
...
@@ -4,7 +4,7 @@
<div
class=
"relative shadow-md"
>
<input
type=
"text"
id=
"hs-leading-icon"
name=
"hs-leading-icon"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
[(
ngModel
)]="
search
"
>
<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"
>
...
...
@@ -20,76 +20,14 @@
import
</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="#sub-command-structure-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">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div> -->
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสงาน','ชื่อลักษณะงาน (ไทย)','ชื่อลักษณะงาน (อังกฤษ)','การจัดการ']; let f = first; let l = last; let i = index"
>
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"loading"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"ti-spinner w-8 h-8 text-secondary mx-1"
role=
"status"
aria-label=
"loading"
>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&!jobcodeFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&jobcodeFilter().length"
>
<tr
*
ngFor=
"let item of jobcodeFilter() |slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index"
>
<td
class=
"text-center"
>
{{((currentPage-1) * pageSize)+(i+1)}}
</td>
<td
class=
"text-center"
>
{{item.jobcodeId}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
modalStatus=
'edit'
;
edit
(
item
)"
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
></i>
<!-- <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';edit(item)"
data-hs-overlay="#company-registration-page-alert-modal"></i> -->
</td>
</tr>
</tbody>
</table>
</div>
<app-pagination
[
totalItems
]="
jobcodeFilter
().
length
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
currentPage =
$event"
(
pageSizeChange
)="
pageSize =
$event;currentPage
=
1
"
></app-pagination>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
jobCodeList
"
[
checkBoxSetting
]='
false
'
[
columns
]="
columns
"
modalName=
"#sub-job-competency-component-modal-edit"
(
sendSelectData
)="
currentModal=
'edit'
;
edit
($
event
)"
>
</app-datagrid-syncfution>
</div>
...
...
@@ -185,16 +123,16 @@
</div>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
ยืนยันการบันทึกข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
@@ -205,7 +143,7 @@
บันทึกข้อมูล
</a>
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
src/app/components/job-detail-components/job-position-indicators/sub-job-position-indicators/sub-job-position-indicators.component.ts
View file @
0612093e
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
...
...
@@ -12,16 +13,37 @@ import { JobCodeService } from 'src/app/shared/services/job-code.service';
export
class
SubJobPositionIndicatorsComponent
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
pageSize
=
10
pageSize
=
10
search
=
""
jobCodeList
:
JobCodeModel
[]
=
[]
jobCodeList
:
JobCodeModel
[]
=
[]
loading
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
modalStatus
=
''
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
columns
:
ColumnModel
[]
=
[{
field
:
"jobcodeId"
,
headerText
:
"ชื่อล็อกอิน"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"ชื่อลักษณะงาน (ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"ชื่อลักษณะงาน (อังกฤษ)"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'jobcodeId'
,
'tdesc'
,
'edesc'
],
operator
:
'contains'
,
ignoreCase
:
false
}
constructor
(
private
toastr
:
ToastrService
,
private
fileService
:
FileService
,
...
...
@@ -31,7 +53,7 @@ export class SubJobPositionIndicatorsComponent {
ngOnInit
():
void
{
this
.
getListJob
();
}
getListJob
()
{
getListJob
()
{
this
.
loading
=
false
this
.
jobcodeService
.
getList
().
subscribe
({
next
:
response
=>
{
...
...
@@ -51,15 +73,15 @@ export class SubJobPositionIndicatorsComponent {
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
jobcodeFilter
().
length
/
this
.
pageSize
)
},
(
_
,
i
)
=>
i
+
1
);
}
edit
(
item
:
JobCodeModel
)
{
edit
(
item
:
JobCodeModel
)
{
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
selectJob
=
new
MyJobCodeModel
(
item
)
}
clearValue
()
{
clearValue
()
{
this
.
selectJob
.
kpiWorkText
=
''
}
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -70,8 +92,8 @@ export class SubJobPositionIndicatorsComponent {
this
.
cdr
.
detectChanges
()
})
}
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -145,5 +167,4 @@ export class SubJobPositionIndicatorsComponent {
})
}
}
\ No newline at end of file
}
src/app/components/job-detail-components/job-qualifications/sub-job-qualifications/sub-job-qualifications.component.html
View file @
0612093e
...
...
@@ -4,7 +4,7 @@
<div
class=
"relative shadow-md"
>
<input
type=
"text"
id=
"hs-leading-icon"
name=
"hs-leading-icon"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
[(
ngModel
)]="
search
"
>
<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"
>
...
...
@@ -21,76 +21,14 @@
import
</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="#sub-command-structure-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">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div> -->
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสงาน','ชื่อลักษณะงาน (ไทย)','ชื่อลักษณะงาน (อังกฤษ)','การจัดการ']; let f = first; let l = last; let i = index"
>
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"loading"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
<div
*
ngFor=
"let item of [1,2,3]"
class=
"ti-spinner w-8 h-8 text-secondary mx-1"
role=
"status"
aria-label=
"loading"
>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&!jobcodeFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!loading&&jobcodeFilter().length"
>
<tr
*
ngFor=
"let item of jobcodeFilter() |slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize);let i = index"
>
<td
class=
"text-center"
>
{{((currentPage-1) * pageSize)+(i+1)}}
</td>
<td
class=
"text-center"
>
{{item.jobcodeId}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
modalStatus=
'edit'
;
edit
(
item
)"
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
></i>
<!-- <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="modalStatus='delete';edit(item)"
data-hs-overlay="#company-registration-page-alert-modal"></i> -->
</td>
</tr>
</tbody>
</table>
</div>
<app-pagination
[
totalItems
]="
jobcodeFilter
().
length
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
currentPage =
$event"
(
pageSizeChange
)="
pageSize =
$event;currentPage
=
1
"
></app-pagination>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
jobCodeList
"
[
checkBoxSetting
]='
false
'
[
columns
]="
columns
"
modalName=
"#sub-job-competency-component-modal-edit"
(
sendSelectData
)="
currentModal=
'edit'
;
edit
($
event
)"
>
</app-datagrid-syncfution>
</div>
...
...
@@ -196,16 +134,16 @@
</div>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
ยืนยันการบันทึกข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<ng-container
*
ngIf=
"
modalStatus=='add'||modalStatus
=='edit'"
>
<ng-container
*
ngIf=
"
currentModal=='add'||currentModal
=='edit'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
@@ -216,7 +154,7 @@
บันทึกข้อมูล
</a>
</ng-container>
<ng-container
*
ngIf=
"
modalStatus=='delete'||modalStatus=='deleteGroup
'"
>
<ng-container
*
ngIf=
"
currentModal=='delete
'"
>
<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=
"#company-registration-page-alert-modal"
>
...
...
src/app/components/job-detail-components/job-qualifications/sub-job-qualifications/sub-job-qualifications.component.ts
View file @
0612093e
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
...
...
@@ -13,16 +14,38 @@ import { JobCodeService } from 'src/app/shared/services/job-code.service';
export
class
SubJobQualificationsComponent
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
pageSize
=
10
pageSize
=
10
search
=
""
jobCodeList
:
JobCodeModel
[]
=
[]
jobCodeList
:
JobCodeModel
[]
=
[]
loading
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
modalStatus
=
''
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
columns
:
ColumnModel
[]
=
[{
field
:
"jobcodeId"
,
headerText
:
"ชื่อล็อกอิน"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"ชื่อลักษณะงาน (ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"ชื่อลักษณะงาน (อังกฤษ)"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'jobcodeId'
,
'tdesc'
,
'edesc'
],
operator
:
'contains'
,
ignoreCase
:
false
}
constructor
(
private
toastr
:
ToastrService
,
private
fileService
:
FileService
,
...
...
@@ -32,12 +55,11 @@ export class SubJobQualificationsComponent {
ngOnInit
():
void
{
this
.
getListJob
();
}
getListJob
()
{
getListJob
()
{
this
.
loading
=
false
this
.
jobcodeService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
jobCodeList
=
response
.
map
((
x
:
any
)
=>
new
MyJobCodeModel
(
x
))
this
.
jobCodeList
=
this
.
jobCodeList
.
sort
((
a
,
b
)
=>
a
.
jobcodeId
.
localeCompare
(
b
.
jobcodeId
))
this
.
loading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -52,18 +74,18 @@ export class SubJobQualificationsComponent {
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
jobcodeFilter
().
length
/
this
.
pageSize
)
},
(
_
,
i
)
=>
i
+
1
);
}
edit
(
item
:
JobCodeModel
)
{
edit
(
item
:
JobCodeModel
)
{
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
selectJob
=
new
MyJobCodeModel
(
item
)
}
clearValue
()
{
clearValue
()
{
this
.
selectJob
.
educationExperienceText
=
''
this
.
selectJob
.
cerLicensedText
=
''
this
.
selectJob
.
especiallyTrainingText
=
''
this
.
selectJob
.
otherAbilitiesText
=
''
}
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -74,8 +96,8 @@ export class SubJobQualificationsComponent {
this
.
cdr
.
detectChanges
()
})
}
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
...
...
@@ -150,5 +172,5 @@ export class SubJobQualificationsComponent {
}
}
}
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