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
13b192f3
Commit
13b192f3
authored
Feb 19, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE การจัดการรายละเอียดงาน > ตัวชี้วัดของตำแหน่งงาน
parent
5ba477dd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
44 deletions
+123
-44
sub-job-competency.component.html
...ency/sub-job-competency/sub-job-competency.component.html
+3
-3
sub-job-position-indicators.component.html
...ion-indicators/sub-job-position-indicators.component.html
+0
-0
sub-job-position-indicators.component.ts
...ition-indicators/sub-job-position-indicators.component.ts
+117
-41
job-code.model.ts
src/app/shared/model/job-code.model.ts
+3
-0
No files found.
src/app/components/job-detail-components/job-competency/sub-job-competency/sub-job-competency.component.html
View file @
13b192f3
...
@@ -188,11 +188,11 @@
...
@@ -188,11 +188,11 @@
</div>
</div>
<div
class=
"ti-modal-body"
style=
"padding-top: 0px;"
>
<div
class=
"ti-modal-body"
style=
"padding-top: 0px;"
>
<label
for=
"input-label"
class=
"ti-form-label mt-1rem"
>
รหัสงาน
</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
[(
ngModel
)]="
selectJob
.
jobcodeId
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input bg-input-readonly"
readonly
[(
ngModel
)]="
selectJob
.
jobcodeId
"
>
<label
for=
"detail_th"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (ไทย)
</label>
<label
for=
"detail_th"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (ไทย)
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input
w-2/3
bg-input-readonly"
readonly
[(
ngModel
)]="
selectJob
.
tdesc
"
>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input bg-input-readonly"
readonly
[(
ngModel
)]="
selectJob
.
tdesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (อังกฤษ)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-1rem"
>
ชื่อลักษณะงาน (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input
w-2/3
bg-input-readonly"
readonly
[(
ngModel
)]="
selectJob
.
edesc
"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input bg-input-readonly"
readonly
[(
ngModel
)]="
selectJob
.
edesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ความรู้ ทักษะ ความสามารถในตำเเหน่งงาน ( Job Competency)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
ความรู้ ทักษะ ความสามารถในตำเเหน่งงาน ( Job Competency)
</label>
<textarea
type=
"text"
id=
"detail_eng"
class=
"ti-form-input font-bold"
rows=
"5"
cols=
"50"
[(
ngModel
)]="
selectJob
.
competencyWorkText
"
></textarea>
<textarea
type=
"text"
id=
"detail_eng"
class=
"ti-form-input font-bold"
rows=
"5"
cols=
"50"
[(
ngModel
)]="
selectJob
.
competencyWorkText
"
></textarea>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
...
...
src/app/components/job-detail-components/job-position-indicators/sub-job-position-indicators/sub-job-position-indicators.component.html
View file @
13b192f3
This diff is collapsed.
Click to expand it.
src/app/components/job-detail-components/job-position-indicators/sub-job-position-indicators/sub-job-position-indicators.component.ts
View file @
13b192f3
import
{
C
omponent
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
C
hangeDetectorRef
,
Component
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
JobModel
,
MyJobModel
}
from
'src/app/shared/model/job.model'
;
import
{
JobCodeModel
,
MyJobCodeModel
}
from
'src/app/shared/model/job-code.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
JobCodeService
}
from
'src/app/shared/services/job-code.service'
;
@
Component
({
@
Component
({
selector
:
'app-sub-job-position-indicators'
,
selector
:
'app-sub-job-position-indicators'
,
...
@@ -11,62 +12,137 @@ import { JobModel, MyJobModel } from 'src/app/shared/model/job.model';
...
@@ -11,62 +12,137 @@ import { JobModel, MyJobModel } from 'src/app/shared/model/job.model';
export
class
SubJobPositionIndicatorsComponent
{
export
class
SubJobPositionIndicatorsComponent
{
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
=
''
constructor
(
constructor
(
private
toastr
:
ToastrService
private
toastr
:
ToastrService
,
private
fileService
:
FileService
,
private
jobcodeService
:
JobCodeService
,
private
cdr
:
ChangeDetectorRef
,
)
{
}
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
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
()
},
error
:
error
=>
{
this
.
loading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
}
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
);
}
edit
(
item
:
JobCodeModel
){
this
.
selectJob
=
new
MyJobCodeModel
({})
this
.
selectJob
=
new
MyJobCodeModel
(
item
)
}
clearValue
(){
this
.
selectJob
.
competencyWorkText
=
''
}
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
()
})
}
}
jobListFilter
()
{
jobcodeFilter
()
{
return
this
.
jobList
.
filter
(
x
=>
x
.
jobid
.
includes
(
this
.
search
)
||
return
this
.
jobCodeList
.
filter
(
x
=>
x
.
tdesc
.
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
edesc
.
includes
(
this
.
search
))
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
||
x
.
jobcodeId
.
toLowerCase
().
includes
(
this
.
search
.
toLowerCase
())
)
}
}
selectJob
(
job
:
JobModel
)
{
onFileSelected
(
event
:
any
)
{
// this.showSuccess()
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
job
=
new
MyJobModel
(
job
)
this
.
selectedFileName
=
this
.
selectedFile
?.
name
||
"กรุณาเลือกไฟล์"
}
}
showSuccessAdd
()
{
uploadFile
()
{
this
.
toastr
.
success
(
'บันทึกข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
if
(
!
this
.
selectedFile
)
{
timeOut
:
3000
,
alert
(
'กรุณาเลือกไฟล์ก่อนอัปโหลด'
)
positionClass
:
'toast-top-right'
,
return
});
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
loading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
'IMPORT_KPI'
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getListJob
();
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
loading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
loading
=
false
}
})
}
}
showSuccessEdit
()
{
this
.
toastr
.
success
(
'เเก้ไขข้อมูลสำเร็จ'
,
'เเจ้งเตือน'
,
{
downloadFile
()
{
timeOut
:
3000
,
const
fileName
=
'IMPORT_MJOBCODEV2.xlsx'
positionClass
:
'toast-top-right'
,
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'
)
}
})
}
}
showSuccessDelete
(
)
{
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
.
success
(
'ลบข้อมูลสำเร็จ'
,
'เเ
จ้งเตือน'
,
{
this
.
toastr
[
type
](
text
,
'แ
จ้งเตือน'
,
{
timeOut
:
3000
,
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
positionClass
:
'toast-top-right'
,
});
})
}
addBu1
()
{
// this.bu1Service.post(this.bu1).subscribe((response:any) => {
// if (response.success) {
// this.getBu1List()
// }
// })
}
deleteJob
(
job
:
JobModel
)
{
// this.bu1Service.delete(new MyBu1Model(bu1)).subscribe((response:any) => {
// if (response.success) {
// this.getBu1List()
// }
// })
}
}
}
}
src/app/shared/model/job-code.model.ts
View file @
13b192f3
...
@@ -44,6 +44,7 @@ export interface JobCodeModel {
...
@@ -44,6 +44,7 @@ export interface JobCodeModel {
allPositionWorkPercent
:
number
allPositionWorkPercent
:
number
otherWorkText
:
string
otherWorkText
:
string
otherWorkPercent
:
number
otherWorkPercent
:
number
kpiWorkText
:
string
}
}
export
class
MyJobCodeModel
implements
JobCodeModel
{
export
class
MyJobCodeModel
implements
JobCodeModel
{
...
@@ -82,6 +83,7 @@ export class MyJobCodeModel implements JobCodeModel {
...
@@ -82,6 +83,7 @@ export class MyJobCodeModel implements JobCodeModel {
allPositionWorkPercent
:
number
allPositionWorkPercent
:
number
otherWorkText
:
string
otherWorkText
:
string
otherWorkPercent
:
number
otherWorkPercent
:
number
kpiWorkText
:
string
constructor
(
data
:
Partial
<
JobCodeModel
>
)
{
constructor
(
data
:
Partial
<
JobCodeModel
>
)
{
this
.
jobcodeId
=
data
.
jobcodeId
||
""
this
.
jobcodeId
=
data
.
jobcodeId
||
""
this
.
tdesc
=
data
.
tdesc
||
""
this
.
tdesc
=
data
.
tdesc
||
""
...
@@ -118,6 +120,7 @@ export class MyJobCodeModel implements JobCodeModel {
...
@@ -118,6 +120,7 @@ export class MyJobCodeModel implements JobCodeModel {
this
.
allPositionWorkPercent
=
data
.
allPositionWorkPercent
??
0
this
.
allPositionWorkPercent
=
data
.
allPositionWorkPercent
??
0
this
.
otherWorkText
=
data
.
otherWorkText
||
""
this
.
otherWorkText
=
data
.
otherWorkText
||
""
this
.
otherWorkPercent
=
data
.
otherWorkPercent
??
0
this
.
otherWorkPercent
=
data
.
otherWorkPercent
??
0
this
.
kpiWorkText
=
data
.
kpiWorkText
||
""
}
}
}
}
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