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
ecaaa3cf
Commit
ecaaa3cf
authored
Feb 18, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE การจัดการรายละเอียดงาน > ข้อมูลทั่วไป
parent
fe3d7fa2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
584 additions
and
202 deletions
+584
-202
sub-job-competency.component.html
...ency/sub-job-competency/sub-job-competency.component.html
+2
-2
sub-job-competency.component.ts
...etency/sub-job-competency/sub-job-competency.component.ts
+1
-23
import-data.component.html
...-detail-management/import-data/import-data.component.html
+162
-149
import-data.component.ts
...ob-detail-management/import-data/import-data.component.ts
+415
-28
job-code.model.ts
src/app/shared/model/job-code.model.ts
+4
-0
IMPORT_MJOB.xlsx
src/assets/template/IMPORT_MJOB.xlsx
+0
-0
No files found.
src/app/components/job-detail-components/job-competency/sub-job-competency/sub-job-competency.component.html
View file @
ecaaa3cf
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เเก้ไขข้อมูลค
ุณสมบัติที่จำเป็นต่อการปฏิบัติหน้าที่
เเก้ไขข้อมูลค
วามสามารถในตำเเหน่งงาน
</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"
...
@@ -241,7 +241,7 @@
...
@@ -241,7 +241,7 @@
<ng-container
*
ngIf=
"modalStatus=='add'||modalStatus=='edit'"
>
<ng-container
*
ngIf=
"modalStatus=='add'||modalStatus=='edit'"
>
<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=
"#company-registration-page-modal"
>
data-hs-overlay=
"#company-registration-page-
alert-
modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
...
...
src/app/components/job-detail-components/job-competency/sub-job-competency/sub-job-competency.component.ts
View file @
ecaaa3cf
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
JobModel
,
MyJobModel
}
from
'src/app/shared/model/job.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
JobCodeService
}
from
'src/app/shared/services/job-code.service'
;
import
{
JobCodeService
}
from
'src/app/shared/services/job-code.service'
;
...
@@ -148,27 +147,6 @@ export class SubJobCompetencyComponent {
...
@@ -148,27 +147,6 @@ export class SubJobCompetencyComponent {
}
}
showSuccessAdd
()
{
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
showSuccessEdit
()
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
showSuccessDelete
()
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
}
}
src/app/components/job-detail-components/job-detail-management/import-data/import-data.component.html
View file @
ecaaa3cf
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
<div
class=
"flex pr-2"
>
<div
class=
"flex pr-2"
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay=
"#
company-registration-page-upload-modal
"
>
data-hs-overlay=
"#
supjob-upload-modal"
(
click
)="
fileInput
.
value =
''
;
selectedFile=
null;selectedFileName
=
'กรุณาเลือกไฟล์'
"
>
<i
class=
"ri-add-line"
></i>
<i
class=
"ri-add-line"
></i>
นำเข้าข้อมูล
นำเข้าข้อมูล
</button>
</button>
<a
class=
"mx-2 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"
<a
class=
"mx-2 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"
href=
"javascript:void(0);"
>
href=
"javascript:void(0);"
(
click
)="
downloadFile
()"
>
ดาวน์โหลดตัวอย่างไฟล์
ดาวน์โหลดตัวอย่างไฟล์
</a>
</a>
</div>
</div>
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
<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"
>
...
@@ -28,17 +28,18 @@
...
@@ -28,17 +28,18 @@
</div>
</div>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
data-hs-overlay=
"#department-register-modal-add
"
>
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
(
click
)="
add
();
modalStatus=
'add'
;
"
>
<i
class=
"ri-add-line"
></i>
<i
class=
"ri-add-line"
></i>
Add
Add
</button>
</button>
</div>
</div>
<div
class=
"px-1"
>
<!-- <div class="px-1">
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-info h-45px m-0 shadow-md"
>
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-45px m-0 shadow-md"
<i
class=
"ri-printer-line"
></i>
data-hs-overlay="#sub-command-structure-alert-delete-modal">
Print
<i class="ri-delete-bin-6-line"></i>
Delete
</button>
</button>
</div
>
</div> --
>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-warning h-45px m-0 shadow-md"
>
<button
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-warning h-45px m-0 shadow-md"
>
<i
class=
"ti ti-book fs-l"
></i>
<i
class=
"ti ti-book fs-l"
></i>
...
@@ -47,14 +48,15 @@
...
@@ -47,14 +48,15 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<thead>
<thead>
<tr>
<tr>
<ng-container
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสงาน','ชื่อลักษณะงาน (ไทย) *','ชื่อลักษณะงาน (อังกฤษ)','การจัดการ']; let f = first; let l = last
"
>
*
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"
>
<th
scope=
"col"
class=
"relative px-10px py-10px bg-soft-secondary text-primary !text-center"
>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<span
class=
"font-size-12px font-weight-700"
>
{{ item }}
</span>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
...
@@ -64,50 +66,40 @@
...
@@ -64,50 +66,40 @@
</ng-container>
</ng-container>
</tr>
</tr>
</thead>
</thead>
<!-- <tbody *ngIf="!jobListFilter().length
">
<tbody
*
ngIf=
"loading
"
>
<tr>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
<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>
</td>
</tr>
</tr>
</tbody> -->
</tbody>
<tbody>
<tbody
*
ngIf=
"!loading&&!jobcodeFilter().length"
>
<tr
*
ngFor=
"let item of[
<tr>
['01','001', 'Department Manager 1','Department Manager 1'],
<td
class=
"text-center"
colspan=
"100%"
>
['02','002', 'Department Manager 2','Department Manager 2'],
ไม่พบข้อมูล
['03','003', 'Department 1-HRD','Department 1-HRD'],
['04','004', 'Department Manager 3','Department Manager 3'],
['05','005', 'Department Manager 4','Department Manager 4']];let i = index"
>
<td
class=
"text-center"
>
{{i+1}}
</td>
<td
class=
"text-center"
>
{{item[1]}}
</td>
<td>
{{item[2]}}
</td>
<td>
{{item[3]}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#sub-command-structure-modal-edit"
></i>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#sub-command-structure-alert-delete-modal"
></i>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
<!-- <tbody *ngIf="jobList
Filter().length">
<tbody
*
ngIf=
"!loading&&jobcode
Filter().length"
>
<tr
<tr
*ngFor="let item of jobListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10
);let i = index">
*
ngFor=
"let item of jobcodeFilter() |slice:((currentPage-1) * pageSize) : (((currentPage-1) * pageSize) + pageSize
);let i = index"
>
<td
class=
"text-center"
>
<td
class=
"text-center"
>
{{((currentPage-1) * 10
)+(i+1)}}
{{((currentPage-1) * pageSize
)+(i+1)}}
</td>
</td>
<td class="text-center">{{item.jobi
d}}</td>
<td
class=
"text-center"
>
{{item.jobcodeI
d}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<td
class=
"flex justify-center"
>
<i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="selectJob(item)"
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
modalStatus=
'edit'
;
edit
(
item
)"
data-hs-overlay="#department-register-modal-edit"></i>
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
></i>
<i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="deleteJob(item)"></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>
</td>
</tr>
</tr>
</tbody> --
>
</tbody
>
</table>
</table>
</div>
</div>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"page.length"
>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"page.length"
>
...
@@ -140,21 +132,35 @@
...
@@ -140,21 +132,35 @@
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</a>
</a>
</li>
</li>
<li>
<select
class=
"ti-form-select"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
searchChange
()"
>
<option
[
value
]="
10
"
>
10
</option>
<option
[
value
]="
20
"
>
20
</option>
<option
[
value
]="
50
"
>
50
</option>
<option
[
value
]="
100
"
>
100
</option>
</select>
</li>
</ul>
<ul
class=
"nav-tabs mt-3"
>
<span>
Show {{((currentPage-1) * pageSize)+1}} to {{(jobcodeFilter().length
<
pageSize
)
?
jobcodeFilter
().
length:
(
currentPage=
=page.length
?
((
currentPage
*
pageSize
)
-
((
currentPage
*
pageSize
)
-
jobcodeFilter
().
length
)
)
:
(
currentPage
*
pageSize
)
)
}}
of
{{
jobcodeFilter
().
length
}}
items
</
span
>
</ul>
</ul>
</nav>
</nav>
</div>
</div>
<div
id=
"department-register-modal-add
"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"sub-job-competency-component-modal-edit
"
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"
>
<h3
class=
"text-xxl font-bold text-primary"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เพิ่มข้อมูลทะเบียนฝ่าย
{{modalStatus== "add"?'เพิ่มมข้อมูลทั่วไป':'เเก้ไขข้อมูลทั่วไป'}}
</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=
"#department-register-modal-add
"
>
data-hs-overlay=
"#sub-job-competency-component-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>
...
@@ -163,7 +169,7 @@
...
@@ -163,7 +169,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
)="
clearValue
()
"
>
<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)"
>
...
@@ -187,124 +193,81 @@
...
@@ -187,124 +193,81 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-body "
>
<div
class=
"ti-modal-body"
style=
"padding-top: 0px;"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
รหัสงาน
</label>
<label
for=
"input-label"
class=
"ti-form-label mt-1rem"
>
รหัสงาน
</label>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-1/2 bg-input-readonly"
readonly
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input {{modalStatus == 'edit' ? 'bg-input-readonly' : ''}}"
[
attr
.
readonly
]="
modalStatus =
=
'
edit
'
?
true
:
null
"
[(
ngModel
)]="
selectJob
.
jobcodeId
"
(
ngModelChange
)="
checkJodid
()"
>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
ชื่อลักษณะงาน (ไทย)
</label>
<span
*
ngIf=
"checkJobCodeId&&modalStatus=='add'"
class=
"text-danger"
>
รหัสงานซ้ำ
</span>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input w-1/2"
>
<label
for=
"detail_th"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (ไทย)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ชื่อลักษณะงาน (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input {{modalStatus == 'edit' ? 'bg-input-readonly' : ''}}"
[
attr
.
readonly
]="
modalStatus =
=
'
edit
'
?
true
:
null
"
[(
ngModel
)]="
selectJob
.
tdesc
"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input {{modalStatus == 'edit' ? 'bg-input-readonly' : ''}}"
[
attr
.
readonly
]="
modalStatus =
=
'
edit
'
?
true
:
null
"
[(
ngModel
)]="
selectJob
.
edesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ตำแหน่ง
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ตำแหน่ง
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-position"
id=
"choices-single-position"
[(
ngModel
)]="
positionId
"
(
ngModelChange
)="
changPosition
()"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ระดับงาน
</label>
<ng-option
*
ngFor=
"let item of positionList"
[
value
]="
item
.
positionId
"
>
{{item.tdesc}}
</ng-option>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ฝ่าย
</label>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu1"
id=
"choices-single-bu1"
[(
ngModel
)]="
bu1Id
"
(
ngModelChange
)="
changBu1
()"
>
<ng-option
*
ngFor=
"let item of bu1List"
[
value
]="
item
.
bu1id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
แผนก
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
แผนก
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu2"
id=
"choices-single-bu2"
[(
ngModel
)]="
bu2Id
"
(
ngModelChange
)="
changBu2
()"
>
<ng-option
*
ngFor=
"let item of bu2List"
[
value
]="
item
.
bu2id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วน
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วน
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu3"
id=
"choices-single-bu3"
[(
ngModel
)]="
bu3Id
"
(
ngModelChange
)="
changBu3
()"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ฝ่าย
</label>
<ng-option
*
ngFor=
"let item of bu3List"
[
value
]="
item
.
bu3id
"
>
{{item.tdesc}}
</ng-option>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย1
</label>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu4"
id=
"choices-single-bu4"
[(
ngModel
)]="
bu4Id
"
(
ngModelChange
)="
changBu4
()"
>
<ng-option
*
ngFor=
"let item of bu4List"
[
value
]="
item
.
bu4id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย2
</label>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu5"
id=
"choices-single-bu5"
[(
ngModel
)]="
bu5Id
"
(
ngModelChange
)="
changBu5
()"
>
<ng-option
*
ngFor=
"let item of bu5List"
[
value
]="
item
.
bu5id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu6"
id=
"choices-single-bu6"
[(
ngModel
)]="
bu6Id
"
(
ngModelChange
)="
changBu6
()"
>
<ng-option
*
ngFor=
"let item of bu6List"
[
value
]="
item
.
bu6id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-bu7"
id=
"choices-single-bu7"
[(
ngModel
)]="
bu7Id
"
(
ngModelChange
)="
changBu7
()"
>
<ng-option
*
ngFor=
"let item of bu7List"
[
value
]="
item
.
bu7id
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ตำแหน่งผู้บังคับบัญชา
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ตำแหน่งผู้บังคับบัญชา
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
>
<ng-select
class=
"ti-form-select"
data-trigger
name=
"choices-single-position"
id=
"choices-single-position"
[(
ngModel
)]="
supervisorPositionId
"
(
ngModelChange
)="
changSupervisorPosition
()"
>
<ng-option
*
ngFor=
"let item of positionList"
[
value
]="
item
.
positionId
"
>
{{item.tdesc}}
</ng-option>
</ng-select>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
วัตถุประสงค์ของตำแหน่งงาน (Objective)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
วัตถุประสงค์ของตำแหน่งงาน (Objective)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
selectJob
.
jobObjective
"
>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay=
"#department-register-modal-add"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#department-register-alert-modal"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div
id=
"department-register-modal-edit"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แก้ไขข้อมูลทะเบียนฝ่าย
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#department-register-modal-edit"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</div>
</div>
<div
class=
"ti-modal-center"
>
<div
class=
"flex justify-end"
style=
"padding-right: 1rem;"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
>
<svg
class=
"svg-indigo"
width=
"16"
height=
"16"
viewBox=
"0 0 64.00 64.00"
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
stroke=
"#595BEA"
stroke-width=
"3.84"
transform=
"rotate(45)matrix(-1, 0, 0, 1, 0, 0)"
>
<g
id=
"SVGRepo_bgCarrier"
stroke-width=
"0"
></g>
<g
id=
"SVGRepo_tracerCarrier"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></g>
<g
id=
"SVGRepo_iconCarrier"
>
<path
d=
"M15 49A24 24 0 0 1 32 8"
></path>
<path
d=
"M49 15a24 24 0 0 1-17 41"
></path>
<polyline
points=
"15.03 40 15.03 48.97 8 48.97"
></polyline>
<polyline
points=
"48.97 24 48.97 15.03 56 15.03"
></polyline>
</g>
</svg>
Clear
</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=
"ti-modal-body "
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
รหัสงาน
</label>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-1/2 bg-input-readonly"
readonly
>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
ชื่อลักษณะงาน (ไทย)
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input w-1/2"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ชื่อลักษณะงาน (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input w-1/2"
>
<label
for=
"p_eng"
class=
"ti-form-label mt-2rem"
>
ตำแหน่ง
</label>
<input
type=
"text"
id=
"p_eng"
class=
"ti-form-input w-1/2"
>
<label
for=
"bu1"
class=
"ti-form-label mt-2rem"
>
ระดับงาน
</label>
<input
type=
"text"
id=
"bu1"
class=
"ti-form-input w-1/2"
>
<label
for=
"bu2"
class=
"ti-form-label mt-2rem"
>
แผนก
</label>
<input
type=
"text"
id=
"bu2"
class=
"ti-form-input w-1/2"
>
<label
for=
"bu3"
class=
"ti-form-label mt-2rem"
>
ส่วน
</label>
<input
type=
"text"
id=
"bu3"
class=
"ti-form-input w-1/2"
>
<label
for=
"bu4"
class=
"ti-form-label mt-2rem"
>
ฝ่าย
</label>
<input
type=
"text"
id=
"bu4"
class=
"ti-form-input w-1/2"
>
<label
for=
"bu5"
class=
"ti-form-label mt-2rem"
>
ตำแหน่งผู้บังคับบัญชา
</label>
<input
type=
"text"
id=
"bu5"
class=
"ti-form-input w-1/2"
>
<label
for=
"obj"
class=
"ti-form-label mt-2rem"
>
วัตถุประสงค์ของตำแหน่งงาน (Objective)
</label>
<input
type=
"text"
id=
"bu5"
class=
"ti-form-input w-1/2"
>
<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=
"#department-register-modal-edit"
data-hs-overlay-close
>
data-hs-overlay=
"#sub-job-competency-component-modal-edit"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);
"
<button
class=
"ti-btn ti-btn-success {{checkJobCodeId&&modalStatus=='add'||!selectJob.jobcodeId ? 'ti-btn-disabled' : ''}}"
[
disabled
]="
checkJobCodeId
&&
modalStatus=
='add'||!selectJob.jobcodeId
"
data-hs-overlay=
"#department-register-alert-modal"
data-hs-overlay-close
>
data-hs-overlay=
"#company-registration-page-alert-modal"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a
>
</button
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"department-register
-alert-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"company-registration-page
-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"
>
...
@@ -312,7 +275,7 @@
...
@@ -312,7 +275,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=
"#department-register
-alert-modal"
>
data-hs-overlay=
"#company-registration-page
-alert-modal"
>
<span
class=
"sr-only"
>
Close
</span>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</button>
...
@@ -320,21 +283,71 @@
...
@@ -320,21 +283,71 @@
</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"
>
<ng-container
*
ngIf=
"modalStatus=='add'||modalStatus=='edit'"
>
ยืนยันการบันทึกข้อมูลหรือไม่
ยืนยันการบันทึกข้อมูลหรือไม่
</ng-container>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</p>
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<ng-container
*
ngIf=
"modalStatus=='add'||modalStatus=='edit'"
>
<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=
"#department-register
-alert-modal"
>
data-hs-overlay=
"#company-registration-page
-alert-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#department-register-alert-modal"
(
click
)="
addBu1
()"
>
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
save
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</ng-container>
<ng-container
*
ngIf=
"modalStatus=='delete'||modalStatus=='deleteGroup'"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
data-hs-overlay=
"#company-registration-page-alert-modal"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
data-hs-overlay=
"#company-registration-page-alert-modal"
(
click
)="
deleteJob
()"
>
ลบข้อมูล
</a>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
id=
"supjob-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>
<div
class=
"flex justify-center mt-2rem mb-1rem space-x-4"
>
<button
type=
"submit"
class=
"ti-btn ti-btn-secondary"
data-hs-overlay=
"#section-registration-upload-modal"
(
click
)="
uploadFile
()"
[
class
.
ti-btn-disabled
]="!
selectedFile
"
[
disabled
]="!
selectedFile
"
>
อัปโหลด
</button>
</div>
</div>
</div>
</div>
</div>
src/app/components/job-detail-components/job-detail-management/import-data/import-data.component.ts
View file @
ecaaa3cf
import
{
Component
}
from
'@angular/core'
;
import
{
C
hangeDetectorRef
,
C
omponent
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobModel
,
MyJobModel
}
from
'src/app/shared/model/job.model'
;
import
{
Bu1Model
,
MyBu1Model
}
from
'src/app/shared/model/bu1.model'
;
import
{
Bu2Model
,
MyBu2Model
}
from
'src/app/shared/model/bu2.model'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu6Model
,
MyBu6Model
}
from
'src/app/shared/model/bu6.model'
;
import
{
Bu7Model
,
MyBu7Model
}
from
'src/app/shared/model/bu7.model'
;
import
{
EmployeeModel
,
MyEmployeeModel
}
from
'src/app/shared/model/employee.model'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
MyPositionModel
,
PositionModel
}
from
'src/app/shared/model/position.model'
;
import
{
Bu1Service
}
from
'src/app/shared/services/bu1.service'
;
import
{
Bu2Service
}
from
'src/app/shared/services/bu2.service'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
import
{
Bu7Service
}
from
'src/app/shared/services/bu7.service'
;
import
{
EmployeeService
}
from
'src/app/shared/services/employee.service'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
JobCodeService
}
from
'src/app/shared/services/job-code.service'
;
import
{
PositionService
}
from
'src/app/shared/services/position.service'
;
@
Component
({
@
Component
({
selector
:
'app-import-data'
,
selector
:
'app-import-data'
,
...
@@ -10,48 +30,415 @@ import { JobModel, MyJobModel } from 'src/app/shared/model/job.model';
...
@@ -10,48 +30,415 @@ import { JobModel, MyJobModel } from 'src/app/shared/model/job.model';
export
class
ImportDataComponent
{
export
class
ImportDataComponent
{
currentPage
=
1
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
jobList
:
JobModel
[]
=
[]
pageSize
=
10
job
:
JobModel
=
new
MyJobModel
({})
search
=
""
search
=
""
jobCodeList
:
JobCodeModel
[]
=
[]
loading
=
false
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectJob
:
JobCodeModel
=
new
MyJobCodeModel
({})
modalStatus
=
''
positionList
:
PositionModel
[]
=
[]
positionId
=
''
bu1List
:
Bu1Model
[]
=
[]
bu1Id
=
''
bu2List
:
Bu2Model
[]
=
[]
bu2Id
=
''
bu3List
:
Bu3Model
[]
=
[]
bu3Id
=
''
bu4List
:
Bu4Model
[]
=
[]
bu4Id
=
''
bu5List
:
Bu5Model
[]
=
[]
bu5Id
=
''
bu6List
:
Bu6Model
[]
=
[]
bu6Id
=
''
bu7List
:
Bu7Model
[]
=
[]
bu7Id
=
''
supervisorPositionId
=
''
employeeList
:
EmployeeModel
[]
=
[]
checkJobCodeId
=
false
constructor
(
constructor
(
private
toastr
:
ToastrService
private
toastr
:
ToastrService
,
private
fileService
:
FileService
,
private
jobcodeService
:
JobCodeService
,
private
cdr
:
ChangeDetectorRef
,
private
positionService
:
PositionService
,
private
bu1Service
:
Bu1Service
,
private
bu2Service
:
Bu2Service
,
private
bu3Service
:
Bu3Service
,
private
bu4Service
:
Bu4Service
,
private
bu5Service
:
Bu5Service
,
private
bu6Service
:
Bu6Service
,
private
bu7Service
:
Bu7Service
,
private
employeeService
:
EmployeeService
)
{
}
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
getListJob
();
this
.
getPositionList
();
this
.
getBu1List
();
this
.
getBu2List
();
this
.
getBu3List
();
this
.
getBu4List
();
this
.
getBu5List
();
this
.
getBu6List
();
this
.
getBu7List
();
// this.getEmployeeList();
}
getEmployeeList
()
{
this
.
employeeService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
employeeList
=
response
.
map
((
x
:
any
)
=>
new
MyEmployeeModel
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
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
()
},
error
:
error
=>
{
this
.
loading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
checkJodid
(){
let
check
=
this
.
jobCodeList
.
some
(
x
=>
x
.
jobcodeId
==
this
.
selectJob
.
jobcodeId
)
this
.
checkJobCodeId
=
check
}
edit
(
item
:
JobCodeModel
)
{
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
selectJob
=
new
MyJobCodeModel
(
item
)
this
.
positionId
=
item
.
position
.
positionId
this
.
supervisorPositionId
=
item
.
supervisorPosition
.
positionId
this
.
bu1Id
=
item
.
bu1
.
bu1id
this
.
bu2Id
=
item
.
bu2
.
bu2id
this
.
bu3Id
=
item
.
bu3
.
bu3id
this
.
bu4Id
=
item
.
bu4
.
bu4id
this
.
bu5Id
=
item
.
bu5
.
bu5id
this
.
bu6Id
=
item
.
bu6
.
bu6id
this
.
bu7Id
=
item
.
bu7
.
bu7id
console
.
log
(
"🚀 ~ ImportDataComponent ~ edit ~ this.selectJob:"
,
this
.
selectJob
)
}
add
(){
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
checkJobCodeId
=
false
this
.
positionId
=
''
this
.
supervisorPositionId
=
''
this
.
bu1Id
=
''
this
.
bu2Id
=
''
this
.
bu3Id
=
''
this
.
bu4Id
=
''
this
.
bu5Id
=
''
this
.
bu6Id
=
''
this
.
bu7Id
=
''
}
}
searchChange
()
{
searchChange
()
{
this
.
currentPage
=
1
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
jobListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
jobcodeFilter
().
length
/
this
.
pageSize
)
},
(
_
,
i
)
=>
i
+
1
);
}
clearValue
()
{
this
.
selectJob
.
jobObjective
=
''
this
.
selectJob
.
supervisorPosition
=
new
MyPositionModel
({})
this
.
supervisorPositionId
=
''
this
.
selectJob
.
position
=
new
MyPositionModel
({})
this
.
positionId
=
''
this
.
selectJob
.
bu1
=
new
MyBu1Model
({})
this
.
bu1Id
=
''
this
.
selectJob
.
bu2
=
new
MyBu2Model
({})
this
.
bu2Id
=
''
this
.
selectJob
.
bu3
=
new
MyBu3Model
({})
this
.
bu3Id
=
''
this
.
selectJob
.
bu4
=
new
MyBu4Model
({})
this
.
bu4Id
=
''
this
.
selectJob
.
bu5
=
new
MyBu5Model
({})
this
.
bu5Id
=
''
this
.
selectJob
.
bu6
=
new
MyBu6Model
({})
this
.
bu6Id
=
''
this
.
selectJob
.
bu7
=
new
MyBu7Model
({})
this
.
bu7Id
=
''
}
save
()
{
this
.
jobcodeService
.
post
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
getListJob
();
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
}
this
.
cdr
.
detectChanges
()
})
}
deleteJob
()
{
this
.
jobcodeService
.
delete
(
this
.
selectJob
).
subscribe
((
response
:
any
)
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
getListJob
();
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
}
this
.
cdr
.
detectChanges
()
})
}
jobcodeFilter
()
{
return
this
.
jobCodeList
.
filter
(
x
=>
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
jobcodeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
)
}
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
.
loading
=
true
this
.
fileService
.
upload
(
formData
,
'MJOBCODE_COMPETENCY'
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getListJob
();
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
loading
=
false
}
}
jobListFilter
()
{
},
error
:
error
=>
{
return
this
.
jobList
.
filter
(
x
=>
x
.
jobid
.
includes
(
this
.
search
)
||
this
.
showAlert
(
error
.
message
,
'error'
)
x
.
tdesc
.
includes
(
this
.
search
)
||
this
.
loading
=
false
x
.
edesc
.
includes
(
this
.
search
))
}
}
selectJob
(
job
:
JobModel
)
{
})
// this.showSuccess()
this
.
job
=
new
MyJobModel
(
job
)
}
}
showSuccess
()
{
this
.
toastr
.
success
(
'This is an example of tip'
,
'TIP'
,
{
downloadFile
()
{
const
fileName
=
'IMPORT_MJOB.xlsx'
this
.
fileService
.
download
(
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'
)
}
})
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
[
type
](
text
,
'แจ้งเตือน'
,
{
timeOut
:
3000
,
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
positionClass
:
'toast-top-right'
,
});
})
}
getPositionList
()
{
this
.
positionService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
positionList
=
response
.
map
(
x
=>
new
MyPositionModel
(
x
))
this
.
cdr
.
detectChanges
();
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changPosition
()
{
let
value
=
this
.
positionList
.
find
(
x
=>
x
.
positionId
==
this
.
positionId
);
if
(
value
)
{
this
.
selectJob
.
position
=
value
}
else
{
this
.
selectJob
.
position
=
new
MyPositionModel
({})
}
}
changSupervisorPosition
()
{
let
value
=
this
.
positionList
.
find
(
x
=>
x
.
positionId
==
this
.
supervisorPositionId
);
if
(
value
)
{
this
.
selectJob
.
supervisorPosition
=
value
}
else
{
this
.
selectJob
.
supervisorPosition
=
new
MyPositionModel
({})
}
}
}
addBu1
()
{
// this.bu1Service.post(this.bu1).subscribe((response:any) => {
getBu1List
()
{
// if (response.success) {
this
.
bu1Service
.
getList
().
subscribe
({
// this.getBu1List()
next
:
response
=>
{
// }
this
.
bu1List
=
response
.
map
(
x
=>
new
MyBu1Model
(
x
))
// })
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu1
()
{
let
value
=
this
.
bu1List
.
find
(
x
=>
x
.
bu1id
==
this
.
bu1Id
);
if
(
value
)
{
this
.
selectJob
.
bu1
=
value
}
else
{
this
.
selectJob
.
bu1
=
new
MyBu1Model
({})
}
}
deleteJob
(
job
:
JobModel
)
{
// this.bu1Service.delete(new MyBu1Model(bu1)).subscribe((response:any) => {
// if (response.success) {
// this.getBu1List()
// }
// })
}
}
getBu2List
()
{
this
.
bu2Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu2List
=
response
.
map
(
x
=>
new
MyBu2Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu2
()
{
let
value
=
this
.
bu2List
.
find
(
x
=>
x
.
bu2id
==
this
.
bu2Id
);
if
(
value
)
{
this
.
selectJob
.
bu2
=
value
}
else
{
this
.
selectJob
.
bu2
=
new
MyBu2Model
({})
}
}
getBu3List
()
{
this
.
bu3Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu3List
=
response
.
map
(
x
=>
new
MyBu3Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu3
()
{
let
value
=
this
.
bu3List
.
find
(
x
=>
x
.
bu3id
==
this
.
bu3Id
);
if
(
value
)
{
this
.
selectJob
.
bu3
=
value
}
else
{
this
.
selectJob
.
bu3
=
new
MyBu3Model
({})
}
}
getBu4List
()
{
this
.
bu4Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu4List
=
response
.
map
(
x
=>
new
MyBu4Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu4
()
{
let
value
=
this
.
bu4List
.
find
(
x
=>
x
.
bu4id
==
this
.
bu4Id
);
if
(
value
)
{
this
.
selectJob
.
bu4
=
value
}
else
{
this
.
selectJob
.
bu4
=
new
MyBu4Model
({})
}
}
getBu5List
()
{
this
.
bu5Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu5List
=
response
.
map
(
x
=>
new
MyBu5Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu5
()
{
let
value
=
this
.
bu5List
.
find
(
x
=>
x
.
bu5id
==
this
.
bu5Id
);
if
(
value
)
{
this
.
selectJob
.
bu5
=
value
}
else
{
this
.
selectJob
.
bu5
=
new
MyBu5Model
({})
}
}
getBu6List
()
{
this
.
bu6Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu6List
=
response
.
map
(
x
=>
new
MyBu6Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu6
()
{
let
value
=
this
.
bu6List
.
find
(
x
=>
x
.
bu6id
==
this
.
bu6Id
);
if
(
value
)
{
this
.
selectJob
.
bu6
=
value
}
else
{
this
.
selectJob
.
bu6
=
new
MyBu6Model
({})
}
}
getBu7List
()
{
this
.
bu7Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu7List
=
response
.
map
(
x
=>
new
MyBu7Model
(
x
))
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
cdr
.
detectChanges
()
}
})
}
changBu7
()
{
let
value
=
this
.
bu7List
.
find
(
x
=>
x
.
bu7id
==
this
.
bu7Id
);
if
(
value
)
{
this
.
selectJob
.
bu7
=
value
}
else
{
this
.
selectJob
.
bu7
=
new
MyBu7Model
({})
}
}
closeModal
()
{
const
modal
=
document
.
getElementById
(
"company-registration-page-alert-modal"
);
if
(
modal
)
{
modal
.
classList
.
add
(
"hidden"
);
// ซ่อน Modal
}
}
}
}
src/app/shared/model/job-code.model.ts
View file @
ecaaa3cf
...
@@ -33,6 +33,7 @@ export interface JobCodeModel {
...
@@ -33,6 +33,7 @@ export interface JobCodeModel {
jobObjective
:
string
jobObjective
:
string
supervisor
:
string
supervisor
:
string
competencyWorkText
:
string
competencyWorkText
:
string
supervisorPosition
:
PositionModel
}
}
export
class
MyJobCodeModel
implements
JobCodeModel
{
export
class
MyJobCodeModel
implements
JobCodeModel
{
...
@@ -60,6 +61,7 @@ export class MyJobCodeModel implements JobCodeModel {
...
@@ -60,6 +61,7 @@ export class MyJobCodeModel implements JobCodeModel {
jobObjective
:
string
jobObjective
:
string
supervisor
:
string
supervisor
:
string
competencyWorkText
:
string
competencyWorkText
:
string
supervisorPosition
:
PositionModel
constructor
(
data
:
Partial
<
JobCodeModel
>
)
{
constructor
(
data
:
Partial
<
JobCodeModel
>
)
{
this
.
jobcodeId
=
data
.
jobcodeId
||
""
this
.
jobcodeId
=
data
.
jobcodeId
||
""
this
.
tdesc
=
data
.
tdesc
||
""
this
.
tdesc
=
data
.
tdesc
||
""
...
@@ -85,6 +87,8 @@ export class MyJobCodeModel implements JobCodeModel {
...
@@ -85,6 +87,8 @@ export class MyJobCodeModel implements JobCodeModel {
this
.
jobObjective
=
data
.
jobObjective
||
""
this
.
jobObjective
=
data
.
jobObjective
||
""
this
.
supervisor
=
data
.
supervisor
||
""
this
.
supervisor
=
data
.
supervisor
||
""
this
.
competencyWorkText
=
data
.
competencyWorkText
||
""
this
.
competencyWorkText
=
data
.
competencyWorkText
||
""
this
.
supervisorPosition
=
new
MyPositionModel
(
data
.
supervisorPosition
||
{})
}
}
}
}
src/assets/template/IMPORT_MJOB.xlsx
0 → 100644
View file @
ecaaa3cf
File added
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