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
8cbf148f
Commit
8cbf148f
authored
Feb 14, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่วนย่อย4
parent
39c6ff1f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
217 additions
and
197 deletions
+217
-197
department-list.component.ts
...usiness-unit/department-list/department-list.component.ts
+2
-2
department-register.component.ts
...unit/department-register/department-register.component.ts
+1
-1
section-registration.component.ts
...it/section-registration/section-registration.component.ts
+2
-2
sub-department-four.component.html
...it/sub-department-four/sub-department-four.component.html
+156
-145
sub-department-four.component.ts
...unit/sub-department-four/sub-department-four.component.ts
+20
-11
sub-department-one.component.ts
...s-unit/sub-department-one/sub-department-one.component.ts
+2
-2
sub-department-three.component.ts
...it/sub-department-three/sub-department-three.component.ts
+26
-26
sub-department-two.component.ts
...s-unit/sub-department-two/sub-department-two.component.ts
+2
-2
bu7.model.ts
src/app/shared/model/bu7.model.ts
+6
-6
No files found.
src/app/components/company-components/company-registration/branch-business-unit/department-list/department-list.component.ts
View file @
8cbf148f
...
...
@@ -104,7 +104,7 @@ export class DepartmentListComponent implements OnInit {
this
.
bu2ListLoading
=
true
this
.
bu2Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu2List
=
response
this
.
bu2List
=
response
.
map
(
x
=>
new
MyBu2Model
(
x
))
this
.
bu2ListLoading
=
false
this
.
onBu2TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -150,7 +150,7 @@ export class DepartmentListComponent implements OnInit {
getBu1List
()
{
this
.
bu1Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu1List
=
response
this
.
bu1List
=
response
.
map
(
x
=>
new
MyBu1Model
(
x
))
this
.
onBu1ModalSearchChange
()
})
}
...
...
src/app/components/company-components/company-registration/branch-business-unit/department-register/department-register.component.ts
View file @
8cbf148f
...
...
@@ -82,7 +82,7 @@ export class DepartmentRegisterComponent implements OnInit {
this
.
bu1ListLoading
=
true
this
.
bu1Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu1List
=
response
this
.
bu1List
=
response
.
map
(
x
=>
new
MyBu1Model
(
x
))
this
.
bu1ListLoading
=
false
this
.
searchChange
()
this
.
cdr
.
detectChanges
()
...
...
src/app/components/company-components/company-registration/branch-business-unit/section-registration/section-registration.component.ts
View file @
8cbf148f
...
...
@@ -105,7 +105,7 @@ export class SectionRegistrationComponent implements OnInit {
this
.
bu3ListLoading
=
true
this
.
bu3Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu3List
=
response
this
.
bu3List
=
response
.
map
(
x
=>
new
MyBu3Model
(
x
))
this
.
bu3ListLoading
=
false
this
.
onBu3TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -184,7 +184,7 @@ export class SectionRegistrationComponent implements OnInit {
getBu2List
()
{
this
.
bu2Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu2List
=
response
this
.
bu2List
=
response
.
map
(
x
=>
new
MyBu2Model
(
x
))
this
.
onBu2ModalSearchChange
()
})
}
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.html
View file @
8cbf148f
...
...
@@ -3,7 +3,8 @@
<div
class=
"flex pr-2"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
data-hs-overlay=
"#sub-department-four-upload-modal"
>
data-hs-overlay=
"#sub-department-four-upload-modal"
(
click
)="
fileInput
.
value =
''
;
selectedFile=
null;selectedFileName
=
'กรุณาเลือกไฟล์'"
>
<i
class=
"ri-add-line"
></i>
นำเข้าข้อมูล
</button>
...
...
@@ -13,22 +14,23 @@
</a>
</div>
</div>
<div
class=
"flex justify-end"
>
<div
class=
"px-1"
>
<div
class=
"flex justify-end"
>
<div
class=
"px-1"
>
<div
class=
"relative shadow-md"
>
<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"
[(
ngModel
)]="
bu7Table
.
search
"
(
ngModelChange
)="
onBu7TableSearchChange
()"
>
<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"
>
<i
class=
"ri-search-line text-gray"
></i>
</div>
</div>
</div>
<div
class=
"px-1"
>
</div>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
(
click
)="
currentModal=
'add'
;
selectBu6
();
selectBu7
()"
data-hs-overlay=
"#sub-department-four-modal-add"
>
(
click
)="
currentModal=
'add'
;
selectBu6
();
selectBu7
()"
data-hs-overlay=
"#sub-department-four-modal-add"
>
<i
class=
"ri-add-line"
></i>
Add
</button>
...
...
@@ -45,95 +47,97 @@
Help
</button>
</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"
>
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสส่วนย่อย4','รายละเอียดส่วนย่อย4 (ไทย)','รายละเอียดส่วนย่อย4 (อังกฤษ)','การจัดการ']; let f = first; let l = last"
>
<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>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"bu7ListLoading"
>
<tr>
<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>
<thead>
<tr>
<ng-container
*
ngFor=
"let item of ['ลำดับ','รหัสส่วนย่อย4','รายละเอียดส่วนย่อย4 (ไทย)','รายละเอียดส่วนย่อย4 (อังกฤษ)','การจัดการ']; let f = first; let l = last"
>
<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>
<div
class=
"absolute top-1/2 transform -translate-y-1/2 right-0"
*
ngIf=
"!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!bu7ListLoading&&!filterBu7Table().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!bu7ListLoading&&filterBu7Table().length"
>
<tr
*
ngFor=
"let item of filterBu7Table() | slice:((bu7Table.currentPage-1) * 10) : (((bu7Table.currentPage-1) * 10) + 10);let i = index"
>
<td
class=
"text-center"
>
{{((bu7Table.currentPage-1) * 10)+(i+1)}}
</td>
<td
class=
"text-center"
>
{{item.bu7id}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
);
currentModal=
'edit'
"
data-hs-overlay=
"#sub-department-four-modal-edit"
></i>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
)"
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"bu7ListLoading"
>
<tr>
<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>
</tr>
</tbody>
<tbody
*
ngIf=
"!bu7ListLoading&&!filterBu7Table().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!bu7ListLoading&&filterBu7Table().length"
>
<tr
*
ngFor=
"let item of filterBu7Table() | slice:((bu7Table.currentPage-1) * 10) : (((bu7Table.currentPage-1) * 10) + 10);let i = index"
>
<td
class=
"text-center"
>
{{((bu7Table.currentPage-1) * 10)+(i+1)}}
</td>
<td
class=
"text-center"
>
{{item.bu7id}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
);
currentModal=
'edit'
"
data-hs-overlay=
"#sub-department-four-modal-edit"
></i>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
)"
data-hs-overlay=
"#sub-department-four-alert-delete-modal"
></i>
</td>
</tr>
</tbody>
</table>
</div>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"bu7Table.page.length"
>
<ul
class=
"ti-pagination"
>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
bu7Table
.
currentPage =
(bu7Table.currentPage-1
||
1
)"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
</td>
</tr>
</tbody>
</table>
</div>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"bu7Table.page.length"
>
<ul
class=
"ti-pagination"
>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
bu7Table
.
currentPage =
(bu7Table.currentPage-1
||
1
)"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
<li
*
ngFor=
"let item of bu7Table.page;let f = first;let l = last"
>
<ng-container
*
ngIf=
"item==3&&bu7Table.currentPage!=1&&bu7Table.currentPage!=2&&bu7Table.currentPage!=3"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
</a>
</li>
<li
*
ngFor=
"let item of bu7Table.page;let f = first;let l = last"
>
<ng-container
*
ngIf=
"item==3&&bu7Table.currentPage!=1&&bu7Table.currentPage!=2&&bu7Table.currentPage!=3"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
</a>
</ng-container>
<ng-container
*
ngIf=
"(f||l)||(item==bu7Table.currentPage-1||item==bu7Table.currentPage||item==bu7Table.currentPage+1)"
>
<a
class=
"page-link"
href=
"javascript:void(0);"
[
class
.
active
]="
item=
=bu7Table.currentPage"
(
click
)="
bu7Table
.
currentPage=
item"
>
{{item}}
</a>
</ng-container>
<ng-container
*
ngIf=
"item==bu7Table.page.length-2&&bu7Table.currentPage!=bu7Table.page.length&&bu7Table.currentPage!=bu7Table.page.length-1&&bu7Table.currentPage!=bu7Table.page.length-2"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
</a>
</ng-container>
</li>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
bu7Table
.
currentPage =
(bu7Table.currentPage
>
bu7Table.page.length-1 ? bu7Table.currentPage: bu7Table.currentPage+1 )">
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</ng-container>
<ng-container
*
ngIf=
"(f||l)||(item==bu7Table.currentPage-1||item==bu7Table.currentPage||item==bu7Table.currentPage+1)"
>
<a
class=
"page-link"
href=
"javascript:void(0);"
[
class
.
active
]="
item=
=bu7Table.currentPage"
(
click
)="
bu7Table
.
currentPage=
item"
>
{{item}}
</a>
</ng-container>
<ng-container
*
ngIf=
"item==bu7Table.page.length-2&&bu7Table.currentPage!=bu7Table.page.length&&bu7Table.currentPage!=bu7Table.page.length-1&&bu7Table.currentPage!=bu7Table.page.length-2"
>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
><i
class=
"ri-more-line"
></i>
</a>
</li>
</ul>
</nav>
</ng-container>
</li>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
bu7Table
.
currentPage =
(bu7Table.currentPage
>
bu7Table.page.length-1 ? bu7Table.currentPage: bu7Table.currentPage+1 )">
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
</ul>
</nav>
</div>
...
...
@@ -181,16 +185,20 @@
</div>
</div>
<div
class=
"ti-modal-body"
>
<label
class=
"ti-form-label "
>
อยู่ภายใต้หน่วยงาน
</label>
<label
class=
"ti-form-label "
>
อยู่ภายใต้หน่วยงาน
*
</label>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md"
>
<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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu6
.
bu6id
"
(
ngModelChange
)="
bu6idChange
()"
>
<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"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu6
()"
>
<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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu6
.
bu6id
"
(
ngModelChange
)="
bu6idChange
()"
>
<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"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu6
()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#sub-department-four-bu6-table-modal"
>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#sub-department-four-bu6-table-modal"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
...
...
@@ -200,20 +208,25 @@
readonly
[
value
]="
bu6
.
tdesc
"
>
</div>
</div>
<label
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<label
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
*
</label>
<div
class=
"relative flex rounded-md w-1/2"
>
<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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu7
.
bu7id
"
(
ngModelChange
)="
bu7idChange
()"
>
<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"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu7
()"
>
<input
type=
"text"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
bu7id
"
>
<!-- <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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style="padding-right: 3.5rem;" [(ngModel)]="bu7.bu7id" (ngModelChange)="bu7idChange()">
<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">
<button type="button" class="flex items-center text-red-500" (click)="selectBu7()">
<i class="ti ti-circle-x cursor-pointer"></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#sub-department-four-bu7-table-modal"
>
<button type="button" class="flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay="#sub-department-four-bu7-table-modal">
<i class="ri-search-line cursor-pointer text-gray"></i>
</button>
</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>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
tdesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
edesc
"
>
...
...
@@ -223,10 +236,12 @@
data-hs-overlay=
"#sub-department-four-modal-add"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-add-modal"
>
<button
type=
"button"
class=
"ti-btn ti-btn-success"
data-hs-overlay=
"#sub-department-four-alert-add-modal"
[
class
.
ti-btn-disabled
]="!
bu6
.
bu6id
||!
bu7
.
bu7id
||!
bu7
.
tdesc
"
[
disabled
]="!
bu6
.
bu6id
||!
bu7
.
bu7id
||!
bu7
.
tdesc
"
>
บันทึกข้อมูล
</
a
>
</
button
>
</div>
</div>
</div>
...
...
@@ -252,7 +267,7 @@
<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"
(
click
)="
selectBu6
();
bu7
.
tdesc=
''
;
bu7
.
edesc=
''
"
>
(
click
)="
selectBu6
();
bu7
.
tdesc=
''
;
bu7
.
edesc=
''
"
>
<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)"
>
...
...
@@ -277,34 +292,37 @@
</div>
</div>
<div
class=
"ti-modal-body"
>
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md"
>
<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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu6
.
bu6id
"
(
ngModelChange
)="
bu6idChange
()"
>
<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"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu6
()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#sub-department-four-bu6-table-modal"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
[
value
]="
bu6
.
tdesc
"
>
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label"
>
อยู่ภายใต้หน่วยงาน*
</label>
<div
class=
"flex"
>
<div
class=
"relative flex rounded-md"
>
<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-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu6
.
bu6id
"
(
ngModelChange
)="
bu6idChange
()"
>
<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"
>
<button
type=
"button"
class=
"flex items-center text-red-500"
(
click
)="
selectBu6
()"
>
<i
class=
"ti ti-circle-x cursor-pointer"
></i>
</button>
<button
type=
"button"
class=
"flex items-center text-gray-500 dark:text-white/70"
data-hs-overlay=
"#sub-department-four-bu6-table-modal"
>
<i
class=
"ri-search-line cursor-pointer text-gray"
></i>
</button>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<div
class=
"flex rounded-md w-1/2 pl-1rem"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
[
value
]="
bu6
.
tdesc
"
>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4*
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 bg-input-readonly"
readonly
[
value
]="
bu7
.
bu7id
"
>
</div>
</div>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
*
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
tdesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
edesc
"
>
...
...
@@ -314,10 +332,12 @@
data-hs-overlay=
"#sub-department-four-modal-edit"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-edit-modal"
>
<button
type=
"button"
class=
"ti-btn ti-btn-success"
data-hs-overlay=
"#sub-department-four-alert-edit-modal"
[
class
.
ti-btn-disabled
]="!
bu6
.
bu6id
||!
bu7
.
bu7id
||!
bu7
.
tdesc
"
[
disabled
]="!
bu6
.
bu6id
||!
bu7
.
bu7id
||!
bu7
.
tdesc
"
>
บันทึกข้อมูล
</
a
>
</
button
>
</div>
</div>
</div>
...
...
@@ -563,7 +583,7 @@
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-four-
alert-add-modal
"
>
data-hs-overlay=
"#sub-department-four-
modal-add
"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
...
...
@@ -575,16 +595,11 @@
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<button
type=
"button"
*
ngIf=
"currentModal=='add'"
<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=
"#sub-department-four-modal-add"
>
ย้อนกลับ
</button>
<button
type=
"button"
*
ngIf=
"currentModal=='edit'"
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=
"#sub-department-four-modal-edit"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-add-modal"
(
click
)="
addBu7
();"
>
บันทึกข้อมูล
...
...
@@ -604,7 +619,7 @@
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-four-
alert-edit-modal
"
>
data-hs-overlay=
"#sub-department-four-
modal-edit
"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
...
...
@@ -616,12 +631,7 @@
</p>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<button
type=
"button"
*
ngIf=
"currentModal=='add'"
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=
"#sub-department-four-modal-add"
>
ย้อนกลับ
</button>
<button
type=
"button"
*
ngIf=
"currentModal=='edit'"
<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=
"#sub-department-four-modal-edit"
>
ย้อนกลับ
...
...
@@ -683,7 +693,7 @@
<h1
class=
"mt-2"
style=
"text-align: center;"
>
ไฟล์
</h1>
<div
class=
"mt-2 p-2"
>
<div
class=
"flex rounded-md"
>
<input
#
fileInput
type=
"file"
(
change
)="
onFileSelected
($
event
)"
hidden
>
<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
()"
...
...
@@ -693,6 +703,7 @@
</div>
<div
class=
"flex justify-center mt-2rem mb-1rem space-x-4"
>
<button
type=
"submit"
class=
"ti-btn ti-btn-secondary"
(
click
)="
uploadFile
()"
data-hs-overlay=
"#sub-department-four-upload-modal"
[
class
.
ti-btn-disabled
]="!
selectedFile
"
[
disabled
]="!
selectedFile
"
>
อัปโหลด
</button>
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.ts
View file @
8cbf148f
...
...
@@ -19,7 +19,7 @@ interface table {
export
class
SubDepartmentFourComponent
implements
OnInit
{
bu7List
:
Bu7Model
[]
=
[]
bu7ListLoading
=
false
bu7
:
Bu7Model
=
new
MyBu7Model
(
{}
)
bu7
:
Bu7Model
=
new
MyBu7Model
()
bu7Table
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
...
...
@@ -35,13 +35,13 @@ export class SubDepartmentFourComponent implements OnInit {
search
:
""
}
bu6List
:
Bu6Model
[]
=
[]
bu6
:
Bu6Model
=
new
MyBu6Model
(
{}
)
bu6
:
Bu6Model
=
new
MyBu6Model
()
bu6Modal
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
}
currentModal
=
"
"
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add
"
constructor
(
private
bu7Service
:
Bu7Service
,
private
bu6Service
:
Bu6Service
,
private
toastr
:
ToastrService
,
...
...
@@ -65,6 +65,7 @@ export class SubDepartmentFourComponent implements OnInit {
}
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
bu7ListLoading
=
true
this
.
fileService
.
upload
(
formData
,
'mbu7'
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
...
...
@@ -72,9 +73,11 @@ export class SubDepartmentFourComponent implements OnInit {
this
.
getBu7List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
})
}
...
...
@@ -102,7 +105,7 @@ export class SubDepartmentFourComponent implements OnInit {
this
.
bu7ListLoading
=
true
this
.
bu7Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu7List
=
response
this
.
bu7List
=
response
.
map
(
x
=>
new
MyBu7Model
(
x
))
this
.
bu7ListLoading
=
false
this
.
onBu7TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -118,8 +121,8 @@ export class SubDepartmentFourComponent implements OnInit {
}
filterBu7Table
()
{
return
this
.
bu7List
.
filter
(
x
=>
x
.
bu7id
.
toLowerCase
().
includes
(
this
.
bu7Table
.
search
.
toLowerCase
())
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu7Table
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu7Table
.
search
.
toLowerCase
()))
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu7Table
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu7Table
.
search
.
toLowerCase
()))
}
selectBu7
(
bu7
?:
Bu7Model
)
{
this
.
bu7
=
new
MyBu7Model
(
bu7
||
{})
...
...
@@ -141,10 +144,11 @@ export class SubDepartmentFourComponent implements OnInit {
}
filterBu7Modal
()
{
return
this
.
bu7List
.
filter
(
x
=>
x
.
bu7id
.
toLowerCase
().
includes
(
this
.
bu7Modal
.
search
.
toLowerCase
())
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu7Modal
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu7Modal
.
search
.
toLowerCase
()))
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu7Modal
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu7Modal
.
search
.
toLowerCase
()))
}
addBu7
()
{
this
.
bu7ListLoading
=
true
this
.
bu7Service
.
post
({
...
this
.
bu7
,
parent
:
this
.
bu6
.
bu6id
}).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
...
...
@@ -152,13 +156,16 @@ export class SubDepartmentFourComponent implements OnInit {
this
.
getBu7List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
})
}
deleteBu7
()
{
this
.
bu7ListLoading
=
true
this
.
bu7Service
.
delete
(
this
.
bu7
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
...
...
@@ -166,16 +173,18 @@ export class SubDepartmentFourComponent implements OnInit {
this
.
getBu7List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu7ListLoading
=
false
}
})
}
getBu6List
()
{
this
.
bu6Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu6List
=
response
this
.
bu6List
=
response
.
map
(
x
=>
new
MyBu6Model
(
x
))
this
.
onBu6ModalSearchChange
()
})
}
...
...
@@ -189,8 +198,8 @@ export class SubDepartmentFourComponent implements OnInit {
}
filterBu6Modal
()
{
return
this
.
bu6List
.
filter
(
x
=>
x
.
bu6id
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
())
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
()))
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
())
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
()))
}
selectBu6
(
bu6
?:
Bu6Model
)
{
this
.
bu6
=
new
MyBu6Model
(
bu6
||
{})
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.ts
View file @
8cbf148f
...
...
@@ -104,7 +104,7 @@ export class SubDepartmentOneComponent implements OnInit {
this
.
bu4ListLoading
=
true
this
.
bu4Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu4List
=
response
this
.
bu4List
=
response
.
map
(
x
=>
new
MyBu4Model
(
x
))
this
.
bu4ListLoading
=
false
this
.
onBu4TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -183,7 +183,7 @@ export class SubDepartmentOneComponent implements OnInit {
getBu3List
()
{
this
.
bu3Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu3List
=
response
this
.
bu3List
=
response
.
map
(
x
=>
new
MyBu3Model
(
x
))
this
.
onBu3ModalSearchChange
()
})
}
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.ts
View file @
8cbf148f
...
...
@@ -105,7 +105,7 @@ export class SubDepartmentThreeComponent implements OnInit {
this
.
bu6ListLoading
=
true
this
.
bu6Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu6List
=
response
this
.
bu6List
=
response
.
map
(
x
=>
new
MyBu6Model
(
x
))
this
.
bu6ListLoading
=
false
this
.
onBu6TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -148,43 +148,43 @@ export class SubDepartmentThreeComponent implements OnInit {
x
.
edesc
.
toLowerCase
().
includes
(
this
.
bu6Modal
.
search
.
toLowerCase
()))
}
addBu6
()
{
this
.
bu6ListLoading
=
true
this
.
bu6Service
.
post
({
...
this
.
bu6
,
parent
:
this
.
bu5
.
bu5id
}).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu6List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu6ListLoading
=
true
this
.
bu6Service
.
post
({
...
this
.
bu6
,
parent
:
this
.
bu5
.
bu5id
}).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu6List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
})
}
deleteBu6
()
{
this
.
bu6ListLoading
=
true
this
.
bu6Service
.
delete
(
this
.
bu6
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu6List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu6ListLoading
=
true
this
.
bu6Service
.
delete
(
this
.
bu6
).
subscribe
({
next
:
response
=>
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu6List
()
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu6ListLoading
=
false
}
})
}
getBu5List
()
{
this
.
bu5Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu5List
=
response
this
.
bu5List
=
response
.
map
(
x
=>
new
MyBu5Model
(
x
))
this
.
onBu5ModalSearchChange
()
})
}
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.ts
View file @
8cbf148f
...
...
@@ -104,7 +104,7 @@ export class SubDepartmentTwoComponent implements OnInit {
this
.
bu5ListLoading
=
true
this
.
bu5Service
.
getList
().
subscribe
({
next
:
response
=>
{
this
.
bu5List
=
response
this
.
bu5List
=
response
.
map
(
x
=>
new
MyBu5Model
(
x
))
this
.
bu5ListLoading
=
false
this
.
onBu5TableSearchChange
()
this
.
cdr
.
detectChanges
()
...
...
@@ -183,7 +183,7 @@ export class SubDepartmentTwoComponent implements OnInit {
getBu4List
()
{
this
.
bu4Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu4List
=
response
this
.
bu4List
=
response
.
map
(
x
=>
new
MyBu4Model
(
x
))
this
.
onBu4ModalSearchChange
()
})
}
...
...
src/app/shared/model/bu7.model.ts
View file @
8cbf148f
...
...
@@ -13,12 +13,12 @@ export class MyBu7Model implements Bu7Model {
edesc
:
string
;
parent
:
string
;
companyId
:
string
;
constructor
(
data
:
Partial
<
Bu7Model
>
)
{
this
.
bu7id
=
data
.
bu7id
||
""
this
.
tdesc
=
data
.
tdesc
||
""
this
.
edesc
=
data
.
edesc
||
""
this
.
parent
=
data
.
parent
||
""
this
.
companyId
=
data
.
companyId
||
""
constructor
(
data
?
:
Partial
<
Bu7Model
>
)
{
this
.
bu7id
=
data
?
.
bu7id
||
""
this
.
tdesc
=
data
?
.
tdesc
||
""
this
.
edesc
=
data
?
.
edesc
||
""
this
.
parent
=
data
?
.
parent
||
""
this
.
companyId
=
data
?
.
companyId
||
""
}
}
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