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
7c9e1e0e
Commit
7c9e1e0e
authored
Apr 11, 2025
by
Nattana Chaiyamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ส่วนย่อย1
parent
f048227e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
305 deletions
+98
-305
section-registration.component.html
.../section-registration/section-registration.component.html
+1
-1
sub-department-one.component.html
...unit/sub-department-one/sub-department-one.component.html
+31
-236
sub-department-one.component.ts
...s-unit/sub-department-one/sub-department-one.component.ts
+66
-68
No files found.
src/app/components/company-components/company-registration/branch-business-unit/section-registration/section-registration.component.html
View file @
7c9e1e0e
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
</label>
</label>
<div
class=
"relative flex rounded-md w-1/2"
>
<div
class=
"relative flex rounded-md w-1/2"
>
<input
type=
"text"
class=
"ti-form-input"
[
class
.!
bg-input-readonly
]="
currentModal=
='edit'"
<input
type=
"text"
class=
"ti-form-input"
[
class
.!
bg-input-readonly
]="
currentModal=
='edit'"
[
re
quired
]="
currentModal=
='edit'"
[
class
.!
border-red
]="
currentModal=
='add'&&checkPrimary()"
[
re
adonly
]="
currentModal=
='edit'"
[
class
.!
border-red
]="
currentModal=
='add'&&checkPrimary()"
[(
ngModel
)]="
bu3
.
select
.
bu3id
"
>
[(
ngModel
)]="
bu3
.
select
.
bu3id
"
>
</div>
</div>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วน (ไทย)
<span
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วน (ไทย)
<span
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.html
View file @
7c9e1e0e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"relative shadow-md"
>
<div
class=
"relative shadow-md"
>
<input
type=
"text"
id=
"hs-leading-icon"
name=
"hs-leading-icon"
<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"
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
bu4Table
.
search
"
(
ngModelChange
)="
onBu4TableSearchChange
()
"
>
[(
ngModel
)]="
search
"
>
<div
<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"
>
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>
<i
class=
"ri-search-line text-gray"
></i>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</div>
</div>
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
<button
type=
"button"
class=
"ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
(
click
)="
currentModal=
'add'
;
selectBu3
();
selectBu4
()"
data-hs-overlay=
"#sub-department-one-modal
-add
"
>
(
click
)="
currentModal=
'add'
;
selectBu3
();
selectBu4
()"
data-hs-overlay=
"#sub-department-one-modal"
>
<i
class=
"ri-add-line"
></i>
<i
class=
"ri-add-line"
></i>
Add
Add
</button>
</button>
...
@@ -38,77 +38,29 @@
...
@@ -38,77 +38,29 @@
</div>
</div>
<div
class=
"page px-rem"
>
<div
class=
"page px-rem"
>
<div
class=
"overflow-auto shadow-md rounded-t-md"
>
<app-datagrid-syncfution
[
searchSettings
]="
searchSettings
"
[
searchText
]="
search
"
[
dataSource
]="
bu4
.
dataList
"
<table
class=
"ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered"
>
[
columns
]="
columns
"
[
selectedItems
]="
selectedItems
"
modalName=
"#sub-department-one-modal"
<thead>
(
sendSelectData
)="
currentModal=
'edit'
;
selectBu4
($
event
)"
(
sendSelectedItems
)="
onSelectItemChange
($
event
)"
>
<tr>
</app-datagrid-syncfution>
<ng-container
*
ngFor=
"let item of ['','รหัสส่วนย่อย1','รายละเอียดส่วนย่อย1 (ไทย)','รายละเอียดส่วนย่อย1 (อังกฤษ)','การจัดการ']; 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=
"!f&&!l"
>
<i
class=
"ti ti-dots-vertical fs-l"
></i>
</div>
</th>
</ng-container>
</tr>
</thead>
<tbody
*
ngIf=
"bu4ListLoading"
>
<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=
"!bu4ListLoading&&!filterBu4Table().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"!bu4ListLoading&&filterBu4Table().length"
>
<tr
*
ngFor=
"let item of filterBu4Table() | slice:((bu4Table.currentPage-1) * bu4Table.pageSize) : (((bu4Table.currentPage-1) * bu4Table.pageSize) + bu4Table.pageSize);let i = index"
>
<td
class=
"text-center"
>
<input
type=
"checkbox"
class=
"ti-form-checkbox cursor-pointer"
id=
"checkbox-{{item.data.bu4id}}"
[(
ngModel
)]="
item
.
check
"
(
ngModelChange
)="
dataListCheck
()"
>
</td>
<td
class=
"text-center"
>
{{item.data.bu4id}}
</td>
<td>
{{item.data.tdesc}}
</td>
<td>
{{item.data.edesc}}
</td>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu4
(
item
.
data
);
currentModal=
'edit'
"
data-hs-overlay=
"#sub-department-one-modal-edit"
></i>
<!-- <i class="ti ti-trash cursor-pointer i-gray fs-l px-1"
(click)="currentModal='delete';selectBu4(item)"
data-hs-overlay="#sub-department-one-alert-delete-modal"></i> -->
</td>
</tr>
</tbody>
</table>
</div>
<app-pagination
[
totalItems
]="
filterBu4Table
().
length
"
[
pageSize
]="
bu4Table
.
pageSize
"
(
pageChange
)="
bu4Table
.
currentPage =
$event"
(
pageSizeChange
)="
bu4Table
.
pageSize =
$event;bu4Table.currentPage
=
1
"
></app-pagination>
</div>
</div>
<div
id=
"sub-department-one-modal
-add
"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"sub-department-one-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย 1
<ng-container
*
ngIf=
"currentModal=='add'"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย 1
</ng-container>
<ng-container
*
ngIf=
"currentModal=='edit'"
>
แก้ไขข้อมูลทะเบียนส่วนย่อย 1
</ng-container>
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
<span
class=
"sr-only"
>
Close
</span>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</button>
...
@@ -134,12 +86,6 @@
...
@@ -134,12 +86,6 @@
Clear
Clear
</button>
</button>
</div>
</div>
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div> -->
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-body"
>
<div
class=
"ti-modal-body"
>
...
@@ -174,137 +120,26 @@
...
@@ -174,137 +120,26 @@
</span>
</span>
</label>
</label>
<div
class=
"relative flex rounded-md w-1/2"
>
<div
class=
"relative flex rounded-md w-1/2"
>
<input
type=
"text"
class=
"ti-form-input h-16"
<input
type=
"text"
class=
"ti-form-input"
[
class
.!
border-red
]="
currentModal=
='add'&&checkPrimary()"
[(
ngModel
)]="
bu4
.
bu4id
"
>
[
class
.!
border-red
]="
currentModal=
='add'&&checkPrimary()"
<!-- <input type="text" id="hs-leading-button-add-on-with-icon-and-button"
[
class
.!
bg-input-readonly
]="
currentModal=
='edit'"
[
readonly
]="
currentModal=
='edit'"
name="hs-leading-button-add-on-with-icon-and-button"
[(
ngModel
)]="
bu4
.
select
.
bu4id
"
>
class="ti-form-input rounded-sm ltr:rounded-r-sm rtl:rounded-l-sm focus:z-10"
style="padding-right: 3.5rem;" [(ngModel)]="bu4.bu4id" (ngModelChange)="bu4idChange()">
<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)="selectBu4()">
<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-one-bu4-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"
>
รายละเอียดส่วนย่อย1 (ไทย)
<span
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วนย่อย1 (ไทย)
<span
class=
"text-danger"
>
*
</span></label>
class=
"text-danger"
>
*
</span></label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
tdesc
"
>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
select
.
tdesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วนย่อย1 (อังกฤษ)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วนย่อย1 (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
edesc
"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
select
.
edesc
"
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
<button
type=
"button"
<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"
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-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<button
class=
"ti-btn ti-btn-success"
type=
"button"
<button
class=
"ti-btn ti-btn-success"
type=
"button"
data-hs-overlay=
"#sub-department-one-alert-modal"
data-hs-overlay=
"#sub-department-one-alert-modal"
[
class
.
ti-btn-disabled
]="!
bu3
.
bu3id
||!
bu4
.
bu4id
||!
bu4
.
tdesc
||(
currentModal=
='add'&&checkPrimary())"
[
class
.
ti-btn-disabled
]="!
bu3
.
bu3id
||!
bu4
.
select
.
bu4id
||!
bu4
.
select
.
tdesc
||(
currentModal=
='add'&&checkPrimary())"
[
disabled
]="!
bu3
.
bu3id
||!
bu4
.
bu4id
||!
bu4
.
tdesc
||(
currentModal=
='add'&&checkPrimary())"
>
[
disabled
]="!
bu3
.
bu3id
||!
bu4
.
select
.
bu4id
||!
bu4
.
select
.
tdesc
||(
currentModal=
='add'&&checkPrimary())"
>
บันทึกข้อมูล
</button>
</div>
</div>
</div>
</div>
</div>
<div
id=
"sub-department-one-modal-edit"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แก้ไขข้อมูลทะเบียนส่วนย่อย 1
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-one-modal-edit"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</div>
</div>
<div
class=
"ti-modal-center"
>
<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
)="
selectBu3
();
bu4
.
tdesc=
''
;
bu4
.
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)"
>
<g
id=
"SVGRepo_bgCarrier"
stroke-width=
"0"
></g>
<g
id=
"SVGRepo_tracerCarrier"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></g>
<g
id=
"SVGRepo_iconCarrier"
>
<path
d=
"M15 49A24 24 0 0 1 32 8"
></path>
<path
d=
"M49 15a24 24 0 0 1-17 41"
></path>
<polyline
points=
"15.03 40 15.03 48.97 8 48.97"
></polyline>
<polyline
points=
"48.97 24 48.97 15.03 56 15.03"
></polyline>
</g>
</svg>
Clear
</button>
</div>
<!-- <div class="px-1">
<button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
<i class="ti ti-book fs-l"></i>
Help
</button>
</div> -->
</div>
</div>
<div
class=
"ti-modal-body"
>
<label
for=
"hs-trailing-button-add-on-with-icon"
class=
"ti-form-label "
>
อยู่ภายใต้หน่วยงาน
<span
class=
"text-danger"
>
*
</span></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"
readonly
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu3
.
bu3id
"
(
ngModelChange
)="
bu3idChange
()"
>
<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
)="
selectBu3
()"
>
<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-one-bu3-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
]="
bu3
.
tdesc
"
>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย1
<span
class=
"text-danger"
>
*
</span></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
]="
bu4
.
bu4id
"
>
</div>
</div>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วนย่อย1 (ไทย)
<span
class=
"text-danger"
>
*
</span></label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
tdesc
"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียดส่วนย่อย1 (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu4
.
edesc
"
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4 "
>
<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-one-modal-edit"
>
ย้อนกลับ
</button>
<button
class=
"ti-btn ti-btn-success"
type=
"button"
data-hs-overlay=
"#sub-department-one-alert-edit-modal"
[
class
.
ti-btn-disabled
]="!
bu3
.
bu3id
||!
bu4
.
bu4id
||!
bu4
.
tdesc
"
[
disabled
]="!
bu3
.
bu3id
||!
bu4
.
bu4id
||!
bu4
.
tdesc
"
>
บันทึกข้อมูล
บันทึกข้อมูล
</button>
</button>
</div>
</div>
...
@@ -323,7 +158,7 @@
...
@@ -323,7 +158,7 @@
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<button
*
ngIf=
"currentModal=='add'"
type=
"button"
<button
*
ngIf=
"currentModal=='add'"
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
<span
class=
"sr-only"
>
Close
</span>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</button>
...
@@ -377,7 +212,7 @@
...
@@ -377,7 +212,7 @@
<ng-container
*
ngIf=
"currentModal=='add'"
>
<ng-container
*
ngIf=
"currentModal=='add'"
>
<tr
*
ngFor=
"let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * bu3Modal.pageSize) : (((bu3Modal.currentPage-1) * bu3Modal.pageSize) + bu3Modal.pageSize);let i = index"
<tr
*
ngFor=
"let item of filterBu3Modal() | slice:((bu3Modal.currentPage-1) * bu3Modal.pageSize) : (((bu3Modal.currentPage-1) * bu3Modal.pageSize) + bu3Modal.pageSize);let i = index"
class=
"cursor-pointer"
(
click
)="
selectBu3
(
item
)"
class=
"cursor-pointer"
(
click
)="
selectBu3
(
item
)"
data-hs-overlay=
"#sub-department-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
<td
class=
"flex justify-center"
>
<td
class=
"flex justify-center"
>
{{((bu3Modal.currentPage-1) * bu3Modal.pageSize)+(i+1)}}
{{((bu3Modal.currentPage-1) * bu3Modal.pageSize)+(i+1)}}
</td>
</td>
...
@@ -407,7 +242,7 @@
...
@@ -407,7 +242,7 @@
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
<button
type=
"button"
*
ngIf=
"currentModal=='add'"
<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"
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-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<button
type=
"button"
*
ngIf=
"currentModal=='edit'"
<button
type=
"button"
*
ngIf=
"currentModal=='edit'"
...
@@ -431,7 +266,7 @@
...
@@ -431,7 +266,7 @@
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
<span
class=
"sr-only"
>
Close
</span>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</button>
...
@@ -445,7 +280,7 @@
...
@@ -445,7 +280,7 @@
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<div
class=
"flex justify-end mt-2rem mb-1rem"
>
<button
type=
"button"
<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"
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-one-modal
-add
"
>
data-hs-overlay=
"#sub-department-one-modal"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
...
@@ -458,46 +293,6 @@
...
@@ -458,46 +293,6 @@
</div>
</div>
</div>
</div>
<div
id=
"sub-department-one-alert-edit-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center"
>
<div
class=
"max-h-full overflow-hidden ti-modal-content w-full"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แจ้งเตือน
</h3>
<div
class=
"flex justify-end"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-modal-clode-btn text-danger"
data-hs-overlay=
"#sub-department-one-modal-edit"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ti ti-circle-x fs-xxl"
></i>
</button>
</div>
</div>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
ยืนยันการเเก้ไขข้อมูลหรือไม่
</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-one-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-one-modal-edit"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-one-alert-edit-modal"
(
click
)="
addBu4
()"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div
id=
"sub-department-one-alert-delete-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
id=
"sub-department-one-alert-delete-modal"
class=
"hs-overlay hidden ti-modal"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center"
>
...
@@ -516,10 +311,10 @@
...
@@ -516,10 +311,10 @@
</div>
</div>
<div
class=
"ti-modal-body "
>
<div
class=
"ti-modal-body "
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<p
class=
"mt-1 text-gray-800 dark:text-white/70"
>
<ng-container
*
ngIf=
"num
DataListChecked
"
>
<ng-container
*
ngIf=
"num
SelectItem()
"
>
ยืนยันการลบข้อมูลหรือไม่
ยืนยันการลบข้อมูลหรือไม่
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"!num
DataListChecked
"
>
<ng-container
*
ngIf=
"!num
SelectItem()
"
>
เลือกข้อมูลที่ต้องการลบ
เลือกข้อมูลที่ต้องการลบ
</ng-container>
</ng-container>
</p>
</p>
...
@@ -532,7 +327,7 @@
...
@@ -532,7 +327,7 @@
</button>
</button>
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
<a
class=
"ti-btn ti-btn-danger"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-one-alert-delete-modal"
(
click
)="
deleteBu4
();"
data-hs-overlay=
"#sub-department-one-alert-delete-modal"
(
click
)="
deleteBu4
();"
*
ngIf=
"num
DataListChecked
"
>
*
ngIf=
"num
SelectItem()
"
>
ลบข้อมูล
ลบข้อมูล
</a>
</a>
</div>
</div>
...
...
src/app/components/company-components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.ts
View file @
7c9e1e0e
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
ChangeDetectorRef
,
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
ColumnModel
}
from
'@syncfusion/ej2-grids'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
ToastrService
}
from
'ngx-toastr'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu3Model
,
MyBu3Model
}
from
'src/app/shared/model/bu3.model'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
import
{
Bu4Model
,
MyBu4Model
}
from
'src/app/shared/model/bu4.model'
;
...
@@ -17,15 +18,7 @@ interface table {
...
@@ -17,15 +18,7 @@ interface table {
styleUrls
:
[
'./sub-department-one.component.scss'
]
styleUrls
:
[
'./sub-department-one.component.scss'
]
})
})
export
class
SubDepartmentOneComponent
implements
OnInit
{
export
class
SubDepartmentOneComponent
implements
OnInit
{
bu4List
:
{
check
:
boolean
,
data
:
Bu4Model
}[]
=
[]
bu4
:
{
loading
:
boolean
,
select
:
Bu4Model
,
dataList
:
Bu4Model
[]
}
=
{
loading
:
false
,
select
:
new
MyBu4Model
(),
dataList
:
[]
}
bu4ListLoading
=
false
bu4
:
Bu4Model
=
new
MyBu4Model
()
bu4Table
:
table
=
{
currentPage
:
1
,
page
:
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
),
search
:
""
,
pageSize
:
10
}
selectedFile
:
File
|
null
=
null
;
selectedFile
:
File
|
null
=
null
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
selectedFileName
:
string
=
'กรุณาเลือกไฟล์'
;
...
@@ -46,9 +39,30 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -46,9 +39,30 @@ export class SubDepartmentOneComponent implements OnInit {
}
}
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
currentModal
:
'add'
|
'edit'
|
'delete'
=
"add"
numDataListChecked
=
0
isDataListChecked
=
false
columns
:
ColumnModel
[]
=
[{
isDataListCheckedAll
=
false
field
:
"bu4id"
,
headerText
:
"รหัสฝ่าย"
,
type
:
"string"
,
isPrimaryKey
:
true
,
},
{
field
:
"tdesc"
,
headerText
:
"รายละเอียดฝ่าย(ไทย)"
,
type
:
"string"
},
{
field
:
"edesc"
,
headerText
:
"รายละเอียดฝ่าย(อังกฤษ)"
,
type
:
"string"
}]
searchSettings
=
{
fields
:
[
'bu4id'
,
'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
bu4Service
:
Bu4Service
,
constructor
(
private
bu4Service
:
Bu4Service
,
private
bu3Service
:
Bu3Service
,
private
bu3Service
:
Bu3Service
,
private
toastr
:
ToastrService
,
private
toastr
:
ToastrService
,
...
@@ -73,7 +87,7 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -73,7 +87,7 @@ export class SubDepartmentOneComponent implements OnInit {
}
}
const
formData
=
new
FormData
();
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
selectedFile
);
formData
.
append
(
'file'
,
this
.
selectedFile
);
this
.
bu4
ListL
oading
=
true
this
.
bu4
.
l
oading
=
true
this
.
fileService
.
uploadExcel
(
formData
,
'mbu4'
).
subscribe
({
this
.
fileService
.
uploadExcel
(
formData
,
'mbu4'
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
if
(
response
.
success
)
{
if
(
response
.
success
)
{
...
@@ -81,11 +95,11 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -81,11 +95,11 @@ export class SubDepartmentOneComponent implements OnInit {
this
.
getBu4List
()
this
.
getBu4List
()
}
else
{
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
})
})
}
}
...
@@ -109,74 +123,62 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -109,74 +123,62 @@ export class SubDepartmentOneComponent implements OnInit {
}
}
getBu4List
()
{
getBu4List
()
{
this
.
bu4
ListL
oading
=
true
this
.
bu4
.
l
oading
=
true
this
.
bu4Service
.
getList
().
subscribe
({
this
.
bu4Service
.
getList
().
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
this
.
bu4List
=
response
.
map
(
x
=>
({
check
:
false
,
data
:
new
MyBu4Model
(
x
)
}))
this
.
bu4
.
dataList
=
response
.
map
(
x
=>
{
this
.
bu4ListLoading
=
false
this
.
selectedItems
.
data
.
set
(
x
.
bu4id
,
false
)
this
.
onBu4TableSearchChange
()
return
new
MyBu4Model
(
x
)
})
this
.
selectedItems
.
key
=
'bu4id'
this
.
selectedItems
.
count
=
0
this
.
bu4
.
loading
=
false
this
.
cdr
.
detectChanges
()
this
.
cdr
.
detectChanges
()
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
this
.
cdr
.
detectChanges
()
this
.
cdr
.
detectChanges
()
}
}
})
})
}
}
onBu4TableSearchChange
()
{
this
.
bu4Table
.
currentPage
=
1
this
.
bu4Table
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu4Table
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
this
.
dataListCheck
()
}
filterBu4Table
()
{
return
this
.
bu4List
.
filter
(
x
=>
{
const
data
=
x
.
data
return
data
.
bu4id
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
})
}
selectBu4
(
bu4
?:
Bu4Model
)
{
selectBu4
(
bu4
?:
Bu4Model
)
{
this
.
bu4
=
new
MyBu4Model
(
bu4
||
{})
if
(
bu4
)
{
this
.
bu4
.
select
=
new
MyBu4Model
(
bu4
)
}
else
if
(
this
.
currentModal
==
'add'
)
{
this
.
bu4
.
select
=
new
MyBu4Model
()
}
else
if
(
this
.
currentModal
==
'edit'
)
{
this
.
bu4
.
select
=
new
MyBu4Model
({
bu4id
:
this
.
bu4
.
select
.
bu4id
})
}
this
.
selectBu3
()
this
.
selectBu3
()
if
(
this
.
bu4
.
parent
)
{
if
(
this
.
bu4
.
select
.
parent
)
{
this
.
bu3Service
.
getById
(
this
.
bu4
.
parent
).
subscribe
(
response
=>
{
this
.
bu3Service
.
getById
(
this
.
bu4
.
select
.
parent
).
subscribe
(
response
=>
{
this
.
bu3
=
new
MyBu3Model
(
response
)
this
.
bu3
=
new
MyBu3Model
(
response
)
this
.
cdr
.
detectChanges
()
this
.
cdr
.
detectChanges
()
})
})
}
}
}
}
onBu4ModalSearchChange
()
{
this
.
bu4Modal
.
currentPage
=
1
this
.
bu4Modal
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
filterBu4Modal
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
filterBu4Modal
()
{
return
this
.
bu4List
.
filter
(
x
=>
{
const
data
=
x
.
data
return
data
.
bu4id
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
||
data
.
tdesc
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
||
data
.
edesc
.
toLowerCase
().
includes
(
this
.
bu4Table
.
search
.
toLowerCase
())
})
}
addBu4
()
{
addBu4
()
{
this
.
bu4
ListL
oading
=
true
this
.
bu4
.
l
oading
=
true
this
.
bu4Service
.
post
({
...
this
.
bu4
,
parent
:
this
.
bu3
.
bu3id
}).
subscribe
({
this
.
bu4Service
.
post
({
...
this
.
bu4
.
select
,
parent
:
this
.
bu3
.
bu3id
}).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
if
(
response
.
success
)
{
if
(
response
.
success
)
{
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
showAlert
(
response
.
message
,
'success'
)
this
.
getBu4List
()
this
.
getBu4List
()
}
else
{
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
})
})
}
}
deleteBu4
()
{
deleteBu4
()
{
this
.
bu4ListLoading
=
true
this
.
bu4
.
loading
=
true
const
body
=
this
.
bu4List
.
filter
(
x
=>
x
.
check
).
map
(
x
=>
new
MyBu4Model
(
x
.
data
))
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
const
body
=
this
.
bu4
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
bu4id
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
bu4id
)).
map
(
x
=>
new
MyBu4Model
(
x
))
this
.
bu4Service
.
delete
(
body
).
subscribe
({
this
.
bu4Service
.
delete
(
body
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
if
(
response
.
success
)
{
if
(
response
.
success
)
{
...
@@ -184,11 +186,11 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -184,11 +186,11 @@ export class SubDepartmentOneComponent implements OnInit {
this
.
getBu4List
()
this
.
getBu4List
()
}
else
{
}
else
{
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
showAlert
(
response
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
showAlert
(
error
.
message
,
'error'
)
this
.
bu4
ListL
oading
=
false
this
.
bu4
.
l
oading
=
false
}
}
})
})
}
}
...
@@ -224,22 +226,18 @@ export class SubDepartmentOneComponent implements OnInit {
...
@@ -224,22 +226,18 @@ export class SubDepartmentOneComponent implements OnInit {
}
}
dataListCheckAll
()
{
checkPrimary
()
{
const
selectAll
=
this
.
isDataListCheckedAll
;
return
this
.
bu4
.
dataList
.
find
(
x
=>
x
.
bu4id
==
this
.
bu4
.
select
.
bu4id
)
this
.
filterBu4Table
().
forEach
(
x
=>
x
.
check
=
selectAll
);
this
.
dataListCheck
();
}
}
dataListCheck
()
{
numSelectItem
()
{
const
dataCheck
=
this
.
filterBu4Table
();
const
selectedKeys
=
Array
.
from
(
this
.
selectedItems
.
data
.
keys
());
this
.
isDataListCheckedAll
=
dataCheck
.
length
?
dataCheck
.
every
(
x
=>
x
.
check
)
:
false
;
const
num
=
this
.
bu4
.
dataList
.
filter
(
x
=>
selectedKeys
.
includes
(
x
.
bu4id
)
&&
this
.
selectedItems
.
data
.
get
(
x
.
bu4id
)).
length
this
.
numDataListChecked
=
this
.
bu4List
.
filter
(
x
=>
x
.
check
).
length
return
num
this
.
isDataListChecked
=
Boolean
(
this
.
numDataListChecked
)
}
}
onSelectItemChange
(
arg
:
any
)
{
checkPrimary
()
{
this
.
selectedItems
=
arg
return
this
.
bu4List
.
find
(
x
=>
x
.
data
.
bu4id
==
this
.
bu4
.
bu4id
)
}
}
}
}
...
...
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