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
f3407a40
Commit
f3407a40
authored
Apr 28, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPDATE เปลี่ยน modal ข้อมูลลักษณะงาน
parent
4ba38092
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
11 deletions
+102
-11
employee-group-unit.component.html
...on/employee-group-unit/employee-group-unit.component.html
+0
-0
employee-group-unit.component.ts
...tion/employee-group-unit/employee-group-unit.component.ts
+50
-5
position-unit.component.html
...nts/job-description/position/position-unit.component.html
+0
-0
position-unit.component.ts
...nents/job-description/position/position-unit.component.ts
+52
-6
No files found.
src/app/components/company-components/job-description/employee-group-unit/employee-group-unit.component.html
View file @
f3407a40
This diff is collapsed.
Click to expand it.
src/app/components/company-components/job-description/employee-group-unit/employee-group-unit.component.ts
View file @
f3407a40
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
EmpGroupModel
,
MyEmpGroupModel
}
from
'src/app/shared/model/emp-group.model'
;
import
{
EmpGroupService
}
from
'src/app/shared/services/emp-group.service'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
Swal
from
'sweetalert2'
;
export
interface
DataModel
{
groupId
:
string
tdesc
:
string
...
...
@@ -46,16 +48,28 @@ export class EmployeeGroupUnit implements OnInit {
};
search
=
''
selectedItems
:
{
key
:
string
,
count
:
number
,
data
:
Map
<
string
,
boolean
>
}
=
{
key
:
''
,
count
:
0
,
data
:
new
Map
<
string
,
boolean
>
()
};
@
ViewChild
(
"employeeGroupUnitModal"
)
employeeGroupUnitModal
:
any
;
dialogRef
:
any
constructor
(
private
empGroupService
:
EmpGroupService
,
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
fileService
:
FileService
private
fileService
:
FileService
,
private
dialog
:
MatDialog
)
{
}
ngOnInit
():
void
{
this
.
getEmpGroupList
()
}
openDialog
()
{
this
.
dialogRef
=
this
.
dialog
.
open
(
this
.
employeeGroupUnitModal
,
{
width
:
'500px'
,
height
:
'500px'
})
}
closeDialog
()
{
this
.
dialogRef
.
close
()
}
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
this
.
selectedFileName
=
this
.
selectedFile
?.
name
||
"กรุณาเลือกไฟล์"
...
...
@@ -135,25 +149,51 @@ export class EmployeeGroupUnit implements OnInit {
}
addEmp_group
()
{
Swal
.
fire
({
icon
:
'question'
,
title
:
'แจ้งเตือน'
,
text
:
'ยืนยันการบันทึกข้อมูลหรือไม่'
,
showCancelButton
:
true
,
confirmButtonText
:
'ยืนยัน'
,
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
this
.
emp_group
.
loading
=
true
this
.
empGroupService
.
post
(
this
.
emp_group
.
select
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getEmpGroupList
()
this
.
closeDialog
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
emp_group
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
closeDialog
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
emp_group
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
closeDialog
()
}
})
}
})
}
deleteEmp_group
()
{
if
(
this
.
numSelectItem
()
==
0
)
{
this
.
showAlert
(
'กรุณาเลือกข้อมูลที่จะลบ'
,
'error'
)
return
}
Swal
.
fire
({
icon
:
'question'
,
title
:
'แจ้งเตือน'
,
text
:
'ยืนยันการลบข้อมูลหรือไม่'
,
showCancelButton
:
true
,
confirmButtonText
:
'ลบข้อมูล'
,
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
this
.
emp_group
.
loading
=
true
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
body
=
this
.
emp_group
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
groupId
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
groupId
)).
map
(
x
=>
new
MyEmpGroupModel
(
x
))
...
...
@@ -175,11 +215,16 @@ export class EmployeeGroupUnit implements OnInit {
}
});
}
});
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
[
type
](
text
,
'แจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
Swal
.
fire
({
icon
:
type
,
title
:
'แจ้งเตือน'
,
text
:
text
,
showCancelButton
:
false
,
confirmButtonText
:
'ยืนยัน'
,
})
}
...
...
src/app/components/company-components/job-description/position/position-unit.component.html
View file @
f3407a40
This diff is collapsed.
Click to expand it.
src/app/components/company-components/job-description/position/position-unit.component.ts
View file @
f3407a40
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
MatDialog
}
from
'@angular/material/dialog'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
MyPositionModel
,
PositionModel
}
from
'src/app/shared/model/position.model'
;
import
{
FileService
}
from
'src/app/shared/services/file.service'
;
import
{
PositionService
}
from
'src/app/shared/services/position.service'
;
import
Swal
from
'sweetalert2'
;
@
Component
({
selector
:
'app-position-unit'
,
templateUrl
:
'./position-unit.component.html'
,
...
...
@@ -38,14 +40,27 @@ export class PositionUnitComponent implements OnInit {
};
search
=
''
selectedItems
:
{
key
:
string
,
count
:
number
,
data
:
Map
<
string
,
boolean
>
}
=
{
key
:
''
,
count
:
0
,
data
:
new
Map
<
string
,
boolean
>
()
};
@
ViewChild
(
"positionUnitModal"
)
positionUnitModal
:
any
;
dialogRef
:
any
constructor
(
private
positionService
:
PositionService
,
private
toastr
:
ToastrService
,
private
cdr
:
ChangeDetectorRef
,
private
fileService
:
FileService
private
fileService
:
FileService
,
private
dialog
:
MatDialog
)
{
}
ngOnInit
():
void
{
this
.
getPositionList
()
}
openDialog
()
{
this
.
dialogRef
=
this
.
dialog
.
open
(
this
.
positionUnitModal
,
{
width
:
'500px'
,
height
:
'500px'
})
}
closeDialog
()
{
this
.
dialogRef
.
close
()
}
onFileSelected
(
event
:
any
)
{
this
.
selectedFile
=
event
.
target
.
files
.
length
>
0
?
event
.
target
.
files
[
0
]
:
null
;
...
...
@@ -128,25 +143,51 @@ export class PositionUnitComponent implements OnInit {
}
addPosition
()
{
Swal
.
fire
({
icon
:
'question'
,
title
:
'แจ้งเตือน'
,
text
:
'ยืนยันการบันทึกข้อมูลหรือไม่'
,
showCancelButton
:
true
,
confirmButtonText
:
'ยืนยัน'
,
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
this
.
position
.
loading
=
true
this
.
positionService
.
post
(
this
.
position
.
select
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getPositionList
()
this
.
closeDialog
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
position
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
closeDialog
()
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
position
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
closeDialog
()
}
})
}
})
}
deletePosition
()
{
if
(
this
.
numSelectItem
()
==
0
)
{
this
.
showAlert
(
'กรุณาเลือกข้อมูลที่จะลบ'
,
'error'
)
return
}
Swal
.
fire
({
icon
:
'question'
,
title
:
'แจ้งเตือน'
,
text
:
'ยืนยันการลบข้อมูลหรือไม่'
,
showCancelButton
:
true
,
confirmButtonText
:
'ลบข้อมูล'
,
}).
then
((
result
)
=>
{
if
(
result
.
isConfirmed
)
{
this
.
position
.
loading
=
true
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
body
=
this
.
position
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
positionId
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
positionId
)).
map
(
x
=>
new
MyPositionModel
(
x
))
...
...
@@ -167,11 +208,16 @@ export class PositionUnitComponent implements OnInit {
}
})
}
})
}
showAlert
(
text
:
string
,
type
:
'success'
|
'error'
)
{
this
.
toastr
[
type
](
text
,
'แจ้งเตือน'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
Swal
.
fire
({
icon
:
type
,
title
:
'แจ้งเตือน'
,
text
:
text
,
showCancelButton
:
false
,
confirmButtonText
:
'ยืนยัน'
,
})
}
...
...
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