Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
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
myAppraisal
Commits
ce3ce317
Commit
ce3ce317
authored
Dec 02, 2024
by
kantavee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input add>search edit>search clear ทะเบียนส่วนกับส่วนย่อยที่2
parent
c8c4c04c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
220 additions
and
74 deletions
+220
-74
department-list.component.html
...iness-unit/department-list/department-list.component.html
+30
-34
section-registration.component.html
.../section-registration/section-registration.component.html
+0
-0
section-registration.component.scss
.../section-registration/section-registration.component.scss
+18
-0
section-registration.component.ts
...it/section-registration/section-registration.component.ts
+86
-20
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
+86
-20
No files found.
src/app/components/company-registration/branch-business-unit/department-list/department-list.component.html
View file @
ce3ce317
...
@@ -156,17 +156,16 @@
...
@@ -156,17 +156,16 @@
<div
class=
"ti-modal-body"
>
<div
class=
"ti-modal-body"
>
<label
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<label
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"flex rounded-md w-1/2"
>
<div
class=
"relative flex rounded-md"
>
<input
type=
"text"
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
class=
"ti-form-input rounded-none ltr:rounded-l-md br-transparent focus:z-10 br-transparent ti-form-input-no-border-left border-radius-0.25"
[(
ngModel
)]="
bu1
.
bu1id
"
(
ngModelChange
)="
bu1idChange
()"
>
[(
ngModel
)]="
bu1
.
bu1id
"
(
ngModelChange
)="
bu1idChange
()"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu1
()"
>
class=
"w-auto inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] border focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bx-transparent"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
(
click
)="
selectBu1
()"
></i>
</button>
</div>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#department-list-bu1-table-modal"
>
<div
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
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 focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bl-transparent border-radius-0.25"
>
</button>
<i
class=
"ri-search-line cursor-pointer text-gray"
data-hs-overlay=
"#department-list-bu1-table-modal"
></i>
</div>
</div>
</div>
</div>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
...
@@ -175,17 +174,16 @@
...
@@ -175,17 +174,16 @@
</div>
</div>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
เเผนก
</label>
<label
class=
"ti-form-label mt-2rem"
>
เเผนก
</label>
<div
class=
"flex rounded-md w-1/2"
>
<div
class=
"relative flex rounded-md w-1/2"
>
<input
type=
"text"
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
class=
"ti-form-input rounded-none ltr:rounded-l-md br-transparent focus:z-10 br-transparent ti-form-input-no-border-left border-radius-0.25"
[(
ngModel
)]="
bu2
.
bu2id
"
(
ngModelChange
)="
bu2idChange
()"
>
[(
ngModel
)]="
bu2
.
bu2id
"
(
ngModelChange
)="
bu2idChange
()"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu2
()"
>
class=
"w-auto inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] border focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bx-transparent"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
(
click
)="
selectBu2
()"
></i>
</button>
</div>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#department-list-bu2-table-modal"
>
<div
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
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 focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bl-transparent border-radius-0.25"
>
</button>
<i
class=
"ri-search-line cursor-pointer text-gray"
data-hs-overlay=
"#department-list-bu2-table-modal"
></i>
</div>
</div>
</div>
</div>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
...
@@ -251,18 +249,16 @@
...
@@ -251,18 +249,16 @@
<label
for=
"hs-trailing-button-add-on-with-icon"
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
class=
"flex rounded-md w-1/2"
>
<div
class=
"relative flex rounded-md"
>
<input
type=
"text"
id=
"hs-trailing-button-add-on-with-icon"
<input
type=
"text"
id=
"hs-leading-button-add-on-with-icon-and-button"
name=
"hs-leading-button-add-on-with-icon-and-button"
class=
"ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
name=
"hs-trailing-button-add-on-with-icon"
[(
ngModel
)]="
bu1
.
bu1id
"
(
ngModelChange
)="
bu1idChange
()"
>
class=
"ti-form-input rounded-none ltr:rounded-l-md br-transparent focus:z-10 br-transparent ti-form-input-no-border-left border-radius-0.25"
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
[(
ngModel
)]="
bu1
.
bu1id
"
(
ngModelChange
)="
bu1idChange
()"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu1
()"
>
<div
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
class=
"w-auto inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] border focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bx-transparent"
>
</button>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
(
click
)="
selectBu1
()"
></i>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#department-list-bu1-table-modal"
>
</div>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
<div
</button>
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 focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm bl-transparent border-radius-0.25"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
data-hs-overlay=
"#department-list-bu1-table-modal"
></i>
</div>
</div>
</div>
</div>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
...
...
src/app/components/company-registration/branch-business-unit/section-registration/section-registration.component.html
View file @
ce3ce317
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/section-registration/section-registration.component.scss
View file @
ce3ce317
...
@@ -16,4 +16,21 @@ table.ti-custom-table thead {
...
@@ -16,4 +16,21 @@ table.ti-custom-table thead {
table
.ti-custom-table
thead
th
span
{
table
.ti-custom-table
thead
th
span
{
font-size
:
12px
;
font-size
:
12px
;
font-weight
:
bold
;
font-weight
:
bold
;
}
.ti-modal-content-search
{
width
:
90%
;
/* ความกว้างที่คุณต้องการ */
position
:
absolute
;
/* ทำให้สามารถจัดตำแหน่งได้ */
top
:
50%
;
/* ให้อยู่กลางในแนวตั้ง */
left
:
50%
;
/* ให้อยู่กลางในแนวนอน */
transform
:
translate
(
-50%
,
-50%
);
/* เคลื่อนที่ modal กลับมาให้ตรงกลาง */
background-color
:
#fff
;
overflow-y
:
auto
;
}
.ti-modal-body-search
{
display
:
flex
;
/* ใช้ flexbox เพื่อจัดตำแหน่ง */
justify-content
:
center
;
/* จัดฟอร์มให้อยู่กลางในแนวนอน */
flex-direction
:
column
;
/* ทำให้ฟอร์มแสดงผลในรูปแบบคอลัมน์ */
height
:
calc
(
100%
-
50px
);
/* ให้ความสูงเป็น 100% ลบด้วยระยะห่างข้างบน */
margin-left
:
100px
;
margin-right
:
50px
;
}
}
\ No newline at end of file
src/app/components/company-registration/branch-business-unit/section-registration/section-registration.component.ts
View file @
ce3ce317
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
Bu2Model
,
MyBu2Model
}
from
'src/app/shared/model/bu2.model'
;
import
{
Bu2Model
,
MyBu2Model
}
from
'src/app/shared/model/bu2.model'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu2Service
}
from
'src/app/shared/services/bu2.service'
;
import
{
Bu2Service
}
from
'src/app/shared/services/bu2.service'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
import
{
Bu3Service
}
from
'src/app/shared/services/bu3.service'
;
interface
table
{
currentPage
:
number
,
page
:
number
[],
search
:
string
}
@
Component
({
@
Component
({
selector
:
'app-section-registration'
,
selector
:
'app-section-registration'
,
templateUrl
:
'./section-registration.component.html'
,
templateUrl
:
'./section-registration.component.html'
,
styleUrls
:
[
'./section-registration.component.scss'
]
styleUrls
:
[
'./section-registration.component.scss'
]
})
})
export
class
SectionRegistrationComponent
implements
OnInit
{
export
class
SectionRegistrationComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu3List
:
Bu3Model
[]
=
[]
bu3List
:
Bu3Model
[]
=
[]
bu3
:
Bu3Model
=
new
MyBu3Model
({})
bu3
:
Bu3Model
=
new
MyBu3Model
({})
bu3Table
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
bu3Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
bu2List
:
Bu2Model
[]
=
[]
bu2
:
Bu2Model
=
new
MyBu2Model
({})
bu2
:
Bu2Model
=
new
MyBu2Model
({})
search
=
""
bu2Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
currentModal
=
""
constructor
(
private
bu3Service
:
Bu3Service
,
constructor
(
private
bu3Service
:
Bu3Service
,
private
bu2Service
:
Bu2Service
private
bu2Service
:
Bu2Service
,
private
toastr
:
ToastrService
)
{
}
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
getBu3List
()
this
.
getBu3List
()
this
.
getBu2List
()
}
}
getBu3List
()
{
getBu3List
()
{
this
.
bu3Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu3Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu3List
=
response
this
.
bu3List
=
response
this
.
s
earchChange
()
this
.
onBu3TableS
earchChange
()
})
})
}
}
s
earchChange
()
{
onBu3TableS
earchChange
()
{
this
.
currentPage
=
1
this
.
bu3Table
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu3ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
bu3Table
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu3Table
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
}
bu3ListFilter
()
{
filterBu3Table
()
{
return
this
.
bu3List
.
filter
(
x
=>
x
.
bu3id
.
toLowerCase
().
includes
(
this
.
search
)
||
return
this
.
bu3List
.
filter
(
x
=>
x
.
bu3id
.
toLowerCase
().
includes
(
this
.
bu3Table
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu3Table
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu3Table
.
search
))
}
}
selectBu3
(
bu3
:
Bu3Model
)
{
selectBu3
(
bu3
?:
Bu3Model
)
{
this
.
bu2Service
.
getById
(
bu3
.
parent
).
subscribe
(
response
=>
{
this
.
bu3
=
new
MyBu3Model
(
bu3
||
{})
this
.
bu2
=
response
this
.
selectBu2
()
})
if
(
this
.
bu3
.
parent
)
{
this
.
bu3
=
new
MyBu3Model
(
bu3
)
this
.
bu2Service
.
getById
(
this
.
bu3
.
parent
).
subscribe
(
response
=>
{
this
.
bu2
=
new
MyBu2Model
(
response
)
})
}
}
bu3idChange
()
{
const
bu3
=
this
.
bu3List
.
find
(
x
=>
x
.
bu3id
==
this
.
bu3
.
bu3id
)
this
.
selectBu3
(
bu3
||
new
MyBu3Model
({
bu3id
:
this
.
bu3
.
bu3id
}))
}
onBu3ModalSearchChange
()
{
this
.
bu3Modal
.
currentPage
=
1
this
.
bu3Modal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu3Modal
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
filterBu3Modal
()
{
return
this
.
bu3List
.
filter
(
x
=>
x
.
bu3id
.
toLowerCase
().
includes
(
this
.
bu3Modal
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu3Modal
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu3Modal
.
search
))
}
}
addBu3
()
{
addBu3
()
{
// this.bu3Service.post(this.bu3).subscribe((response:any) => {
// this.bu3Service.post(this.bu3).subscribe((response:any) => {
...
@@ -52,11 +88,41 @@ export class SectionRegistrationComponent implements OnInit {
...
@@ -52,11 +88,41 @@ export class SectionRegistrationComponent implements OnInit {
// })
// })
}
}
deleteBu3
(
bu3
:
Bu3Model
)
{
deleteBu3
(
bu3
:
Bu3Model
)
{
// this.bu3Service.delete(new MyBu
1
Model(bu3)).subscribe((response:any) => {
// this.bu3Service.delete(new MyBu
3
Model(bu3)).subscribe((response:any) => {
// if (response.success) {
// if (response.success) {
// this.getBu3List()
// this.getBu3List()
// }
// }
// })
// })
}
}
getBu2List
()
{
this
.
bu2Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu2List
=
response
this
.
onBu2ModalSearchChange
()
})
}
onBu2ModalSearchChange
()
{
this
.
bu2Modal
.
currentPage
=
1
this
.
bu2Modal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu2Modal
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
bu2idChange
()
{
const
bu2
=
this
.
bu2List
.
find
(
x
=>
x
.
bu2id
==
this
.
bu2
.
bu2id
)
this
.
selectBu2
(
bu2
||
new
MyBu2Model
({
bu2id
:
this
.
bu2
.
bu2id
}))
}
filterBu2Modal
()
{
return
this
.
bu2List
.
filter
(
x
=>
x
.
bu2id
.
toLowerCase
().
includes
(
this
.
bu2Modal
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu2Modal
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu2Modal
.
search
))
}
selectBu2
(
bu2
?:
Bu2Model
)
{
this
.
bu2
=
new
MyBu2Model
(
bu2
||
{})
}
showSuccess
()
{
this
.
toastr
.
success
(
'This is an example of tip'
,
'TIP'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
}
}
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.html
View file @
ce3ce317
This diff is collapsed.
Click to expand it.
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.ts
View file @
ce3ce317
import
{
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
OnInit
,
}
from
'@angular/core'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu4Service
}
from
'src/app/shared/services/bu4.service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
interface
table
{
currentPage
:
number
,
page
:
number
[],
search
:
string
}
@
Component
({
@
Component
({
selector
:
'app-sub-department-two'
,
selector
:
'app-sub-department-two'
,
templateUrl
:
'./sub-department-two.component.html'
,
templateUrl
:
'./sub-department-two.component.html'
,
styleUrls
:
[
'./sub-department-two.component.scss'
]
styleUrls
:
[
'./sub-department-two.component.scss'
]
})
})
export
class
SubDepartmentTwoComponent
implements
OnInit
{
export
class
SubDepartmentTwoComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu5List
:
Bu5Model
[]
=
[]
bu5List
:
Bu5Model
[]
=
[]
bu5
:
Bu5Model
=
new
MyBu5Model
({})
bu5
:
Bu5Model
=
new
MyBu5Model
({})
bu5Table
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
bu5Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
bu4List
:
Bu4Model
[]
=
[]
bu4
:
Bu4Model
=
new
MyBu4Model
({})
bu4
:
Bu4Model
=
new
MyBu4Model
({})
search
=
""
bu4Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
currentModal
=
""
constructor
(
private
bu5Service
:
Bu5Service
,
constructor
(
private
bu5Service
:
Bu5Service
,
private
bu4Service
:
Bu4Service
private
bu4Service
:
Bu4Service
,
private
toastr
:
ToastrService
)
{
}
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
getBu5List
()
this
.
getBu5List
()
this
.
getBu4List
()
}
}
getBu5List
()
{
getBu5List
()
{
this
.
bu5Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu5Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu5List
=
response
this
.
bu5List
=
response
this
.
s
earchChange
()
this
.
onBu5TableS
earchChange
()
})
})
}
}
s
earchChange
()
{
onBu5TableS
earchChange
()
{
this
.
currentPage
=
1
this
.
bu5Table
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu5ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
bu5Table
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu5Table
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
}
bu5ListFilter
()
{
filterBu5Table
()
{
return
this
.
bu5List
.
filter
(
x
=>
x
.
bu5id
.
toLowerCase
().
includes
(
this
.
search
)
||
return
this
.
bu5List
.
filter
(
x
=>
x
.
bu5id
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu5Table
.
search
))
}
}
selectBu5
(
bu5
:
Bu5Model
)
{
selectBu5
(
bu5
?:
Bu5Model
)
{
this
.
bu4Service
.
getById
(
bu5
.
parent
).
subscribe
(
response
=>
{
this
.
bu5
=
new
MyBu5Model
(
bu5
||
{})
this
.
bu4
=
response
this
.
selectBu4
()
})
if
(
this
.
bu5
.
parent
)
{
this
.
bu5
=
new
MyBu5Model
(
bu5
)
this
.
bu4Service
.
getById
(
this
.
bu5
.
parent
).
subscribe
(
response
=>
{
this
.
bu4
=
new
MyBu4Model
(
response
)
})
}
}
bu5idChange
()
{
const
bu5
=
this
.
bu5List
.
find
(
x
=>
x
.
bu5id
==
this
.
bu5
.
bu5id
)
this
.
selectBu5
(
bu5
||
new
MyBu5Model
({
bu5id
:
this
.
bu5
.
bu5id
}))
}
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
=>
x
.
bu5id
.
toLowerCase
().
includes
(
this
.
bu5Modal
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu5Modal
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu5Modal
.
search
))
}
}
addBu5
()
{
addBu5
()
{
// this.bu5Service.post(this.bu5).subscribe((response:any) => {
// this.bu5Service.post(this.bu5).subscribe((response:any) => {
...
@@ -59,4 +95,34 @@ export class SubDepartmentTwoComponent implements OnInit {
...
@@ -59,4 +95,34 @@ export class SubDepartmentTwoComponent implements OnInit {
// })
// })
}
}
getBu4List
()
{
this
.
bu4Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu4List
=
response
this
.
onBu4ModalSearchChange
()
})
}
onBu4ModalSearchChange
()
{
this
.
bu4Modal
.
currentPage
=
1
this
.
bu4Modal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu4Modal
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
bu4idChange
()
{
const
bu4
=
this
.
bu4List
.
find
(
x
=>
x
.
bu4id
==
this
.
bu4
.
bu4id
)
this
.
selectBu4
(
bu4
||
new
MyBu4Model
({
bu4id
:
this
.
bu4
.
bu4id
}))
}
filterBu4Modal
()
{
return
this
.
bu4List
.
filter
(
x
=>
x
.
bu4id
.
toLowerCase
().
includes
(
this
.
bu4Modal
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu4Modal
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu4Modal
.
search
))
}
selectBu4
(
bu4
?:
Bu4Model
)
{
this
.
bu4
=
new
MyBu4Model
(
bu4
||
{})
}
showSuccess
()
{
this
.
toastr
.
success
(
'This is an example of tip'
,
'TIP'
,
{
timeOut
:
3000
,
positionClass
:
'toast-top-right'
,
});
}
}
}
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