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
d64e63f4
Commit
d64e63f4
authored
Apr 11, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่วนย่อย2
parent
6e853dbf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
76 deletions
+71
-76
department-list.component.ts
...usiness-unit/department-list/department-list.component.ts
+1
-0
department-register.component.ts
...unit/department-register/department-register.component.ts
+1
-0
section-registration.component.ts
...it/section-registration/section-registration.component.ts
+1
-0
sub-department-one.component.ts
...s-unit/sub-department-one/sub-department-one.component.ts
+1
-0
sub-department-two.component.html
...unit/sub-department-two/sub-department-two.component.html
+0
-0
sub-department-two.component.ts
...s-unit/sub-department-two/sub-department-two.component.ts
+66
-76
company-registration-page.component.ts
...-registration-page/company-registration-page.component.ts
+1
-0
No files found.
src/app/components/company-components/company-registration/branch-business-unit/department-list/department-list.component.ts
View file @
d64e63f4
...
...
@@ -132,6 +132,7 @@ export class DepartmentListComponent implements OnInit {
getBu2List
()
{
this
.
bu2ListLoading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
bu2Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu2List
=
response
.
map
(
x
=>
{
...
...
src/app/components/company-components/company-registration/branch-business-unit/department-register/department-register.component.ts
View file @
d64e63f4
...
...
@@ -102,6 +102,7 @@ export class DepartmentRegisterComponent implements OnInit {
getBu1List
()
{
this
.
bu1
.
loading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
bu1Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu1
.
dataList
=
response
.
map
(
x
=>
{
...
...
src/app/components/company-components/company-registration/branch-business-unit/section-registration/section-registration.component.ts
View file @
d64e63f4
...
...
@@ -118,6 +118,7 @@ export class SectionRegistrationComponent implements OnInit {
getBu3List
()
{
this
.
bu3
.
loading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
bu3Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu3
.
dataList
=
response
.
map
(
x
=>
{
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.ts
View file @
d64e63f4
...
...
@@ -124,6 +124,7 @@ export class SubDepartmentOneComponent implements OnInit {
}
getBu4List
()
{
this
.
bu4
.
loading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
bu4Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu4
.
dataList
=
response
.
map
(
x
=>
{
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.html
View file @
d64e63f4
This diff is collapsed.
Click to expand it.
src/app/components/company-components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.ts
View file @
d64e63f4
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
,
}
from
'@angular/core'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
...
...
@@ -17,25 +18,11 @@ interface table {
styleUrls
:
[
'./sub-department-two.component.scss'
]
})
export
class
SubDepartmentTwoComponent
implements
OnInit
{
bu5List
:
{
check
:
boolean
,
data
:
Bu5Model
}[]
=
[]
bu5ListLoading
=
false
bu5
:
Bu5Model
=
new
MyBu5Model
()
bu5Table
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
,
pageSize
:
10
}
bu5
:
{
loading
:
boolean
,
select
:
Bu5Model
,
dataList
:
Bu5Model
[]
}
=
{
loading
:
false
,
select
:
new
MyBu5Model
(),
dataList
:
[]
}
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
bu5Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
,
pageSize
:
10
}
bu4List
:
Bu4Model
[]
=
[]
bu4
:
Bu4Model
=
new
MyBu4Model
()
bu4Modal
:
table
=
{
...
...
@@ -46,10 +33,29 @@ export class SubDepartmentTwoComponent implements OnInit {
}
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
numDataListChecked
=
0
isDataListChecked
=
false
isDataListCheckedAll
=
false
columns
:
ColumnModel
[]
=
[{
field
:
"bu5id"
,
headerText
:
"รหัสฝ่าย"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"รายละเอียดฝ่าย(ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"รายละเอียดฝ่าย(อังกฤษ)"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'bu5id'
,
'tdesc'
,
'edesc'
],
operator
:
'contains'
,
ignoreCase
:
false
};
search
=
''
selectedItems
:
{
key
:
string
,
count
:
number
,
data
:
Map
<
string
,
boolean
>
}
=
{
key
:
''
,
count
:
0
,
data
:
new
Map
<
string
,
boolean
>
()
};
constructor
(
private
bu5Service
:
Bu5Service
,
private
bu4Service
:
Bu4Service
,
private
toastr
:
ToastrService
,
...
...
@@ -73,7 +79,7 @@ export class SubDepartmentTwoComponent implements OnInit {
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
bu5
ListL
oading
=
true
this
.
bu5
.
l
oading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
'mbu5'
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
...
...
@@ -81,11 +87,11 @@ export class SubDepartmentTwoComponent implements OnInit {
this
.
getBu5List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
})
}
...
...
@@ -110,76 +116,63 @@ export class SubDepartmentTwoComponent implements OnInit {
}
getBu5List
()
{
this
.
bu5ListLoading
=
true
this
.
bu5
.
loading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
bu5Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu5List
=
response
.
map
(
x
=>
({
check
:
false
,
data
:
new
MyBu5Model
(
x
)
}))
this
.
bu5ListLoading
=
false
this
.
onBu5TableSearchChange
()
this
.
isDataListCheckedAll
=
false
this
.
dataListCheckAll
()
this
.
bu5
.
dataList
=
response
.
map
(
x
=>
{
this
.
selectedItems
.
data
.
set
(
x
.
bu5id
,
false
)
return
new
MyBu5Model
(
x
)
})
this
.
selectedItems
.
key
=
'bu5id'
this
.
selectedItems
.
count
=
0
this
.
bu5
.
loading
=
false
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
this
.
cdr
.
detectChanges
()
}
})
}
onBu5TableSearchChange
()
{
this
.
bu5Table
.
currentPage
=
1
this
.
bu5Table
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu5Table
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
dataListCheck
()
}
filterBu5Table
()
{
return
this
.
bu5List
.
filter
(
x
=>
{
const
data
=
x
.
data
return
data
.
bu5id
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
})
}
selectBu5
(
bu5
?:
Bu5Model
)
{
this
.
bu5
=
new
MyBu5Model
(
bu5
||
{})
if
(
bu5
)
{
this
.
bu5
.
select
=
new
MyBu5Model
(
bu5
)
}
else
if
(
this
.
currentModal
==
'add'
)
{
this
.
bu5
.
select
=
new
MyBu5Model
()
}
else
if
(
this
.
currentModal
==
'edit'
)
{
this
.
bu5
.
select
=
new
MyBu5Model
({
bu5id
:
this
.
bu5
.
select
.
bu5id
})
}
this
.
selectBu4
()
if
(
this
.
bu5
.
parent
)
{
this
.
bu4Service
.
getById
(
this
.
bu5
.
parent
).
subscribe
(
response
=>
{
if
(
this
.
bu5
.
select
.
parent
)
{
this
.
bu4Service
.
getById
(
this
.
bu5
.
select
.
parent
).
subscribe
(
response
=>
{
this
.
bu4
=
new
MyBu4Model
(
response
)
this
.
cdr
.
detectChanges
()
})
}
}
onBu5ModalSearchChange
()
{
this
.
bu5Modal
.
currentPage
=
1
this
.
bu5Modal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu5Modal
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
filterBu5Modal
()
{
return
this
.
bu5List
.
filter
(
x
=>
{
const
data
=
x
.
data
return
data
.
bu5id
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
.
toLowerCase
())
})
}
addBu5
()
{
this
.
bu5
ListL
oading
=
true
this
.
bu5Service
.
post
({
...
this
.
bu5
,
parent
:
this
.
bu4
.
bu4id
}).
subscribe
({
this
.
bu5
.
l
oading
=
true
this
.
bu5Service
.
post
({
...
this
.
bu5
.
select
,
parent
:
this
.
bu4
.
bu4id
}).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu5List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
})
}
deleteBu5
()
{
this
.
bu5ListLoading
=
true
const
body
=
this
.
bu5List
.
filter
(
x
=>
x
.
check
).
map
(
x
=>
new
MyBu5Model
(
x
.
data
))
this
.
bu5
.
loading
=
true
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
body
=
this
.
bu5
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
bu5id
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
bu5id
)).
map
(
x
=>
new
MyBu5Model
(
x
))
this
.
bu5Service
.
delete
(
body
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
...
...
@@ -187,11 +180,11 @@ export class SubDepartmentTwoComponent implements OnInit {
this
.
getBu5List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu5
ListL
oading
=
false
this
.
bu5
.
l
oading
=
false
}
})
}
...
...
@@ -226,21 +219,18 @@ export class SubDepartmentTwoComponent implements OnInit {
})
}
dataListCheckAll
()
{
const
selectAll
=
this
.
isDataListCheckedAll
;
this
.
filterBu5Table
().
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
checkPrimary
()
{
return
this
.
bu5
.
dataList
.
find
(
x
=>
x
.
bu5id
==
this
.
bu5
.
select
.
bu5id
)
}
dataListCheck
()
{
const
dataCheck
=
this
.
filterBu5Table
();
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
every
(
x
=>
x
.
check
)
:
false
;
this
.
numDataListChecked
=
this
.
bu5List
.
filter
(
x
=>
x
.
check
).
length
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
numSelectItem
()
{
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
num
=
this
.
bu5
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
bu5id
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
bu5id
)).
length
return
num
}
checkPrimary
(
)
{
return
this
.
bu5List
.
find
(
x
=>
x
.
data
.
bu5id
==
this
.
bu5
.
bu5id
)
onSelectItemChange
(
arg
:
any
)
{
this
.
selectedItems
=
arg
}
}
src/app/components/company-components/company-registration/company-registration-page/company-registration-page.component.ts
View file @
d64e63f4
...
...
@@ -64,6 +64,7 @@ export class CompanyRegistrationPageComponent {
getCompanyList
()
{
this
.
dataLoading
=
true
this
.
selectedItems
.
data
.
clear
()
this
.
companyService
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
dataList
=
response
.
map
(
x
=>
{
...
...
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