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
01d92d69
Commit
01d92d69
authored
Nov 27, 2024
by
Natthaphat Pankiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reapply "bu6,bu7"
This reverts commit
bcfd375f
.
parent
bcfd375f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
375 additions
and
185 deletions
+375
-185
section-registration.component.html
.../section-registration/section-registration.component.html
+1
-1
sub-department-four.component.html
...it/sub-department-four/sub-department-four.component.html
+119
-39
sub-department-four.component.ts
...unit/sub-department-four/sub-department-four.component.ts
+52
-37
sub-department-one.component.html
...unit/sub-department-one/sub-department-one.component.html
+3
-3
sub-department-three.component.html
.../sub-department-three/sub-department-three.component.html
+142
-62
sub-department-three.component.ts
...it/sub-department-three/sub-department-three.component.ts
+52
-37
sub-department-two.component.html
...unit/sub-department-two/sub-department-two.component.html
+6
-6
No files found.
src/app/components/company-registration/branch-business-unit/section-registration/section-registration.component.html
View file @
01d92d69
...
@@ -257,7 +257,7 @@
...
@@ -257,7 +257,7 @@
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<div>
<div>
<div
class=
"relative flex rounded-md"
>
<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-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
value=
"01"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu2
.
bu2id
"
>
<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;"
[(
ngModel
)]="
bu2
.
bu2id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.html
View file @
01d92d69
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<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
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
<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>
...
@@ -60,27 +61,55 @@
...
@@ -60,27 +61,55 @@
</ng-container>
</ng-container>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody
*
ngIf=
"!bu7ListFilter().length"
>
<tr
*
ngFor=
"let item of[
<tr>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
<td
class=
"text-center"
colspan=
"100%"
>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
ไม่พบข้อมูล
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
</td>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
</tr>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance']];let i = index"
>
</tbody>
<td
class=
"flex justify-center"
style=
"font-size: 12px;"
>
{{0+""+(i+1)}}
</td>
<tbody
*
ngIf=
"bu7ListFilter().length"
>
<td
style=
"font-size: 12px;"
>
{{item[0]}}
</td>
<tr
<td
style=
"font-size: 12px;"
>
{{item[1]}}
</td>
*
ngFor=
"let item of bu7ListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<td
style=
"font-size: 12px;"
>
{{item[2]}}
</td>
<td
class=
"flex justify-center"
>
{{((currentPage-1) * 10)+(i+1)}}
</td>
<td>
{{item.bu7id}}
</td>
<td>
{{item.tdesc}}
</td>
<td>
{{item.edesc}}
</td>
<td
class=
"flex justify-center"
>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#sub-department-four-modal-edit"
></i>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
)"
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
></i>
data-hs-overlay=
"#sub-department-four-modal-edit"
></i>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
(
click
)="
deleteBu7
(
item
)"
></i>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"page.length"
>
<ul
class=
"ti-pagination"
>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
currentPage =
(currentPage-1
||
1
)"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
<li
*
ngFor=
"let item of page"
>
<a
class=
"page-link"
href=
"javascript:void(0);"
[
class
.
active
]="
item=
=currentPage"
(
click
)="
currentPage=
item"
>
{{item}}
</a>
<!-- <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a> -->
</li>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
currentPage =
(currentPage
>
page.length-1 ? currentPage: currentPage+1 )">
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
...
@@ -128,12 +157,16 @@
...
@@ -128,12 +157,16 @@
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<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;"
>
<div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"relative flex rounded-md"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<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;"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
</svg>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -145,12 +178,16 @@
...
@@ -145,12 +178,16 @@
</div>
</div>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<div
class=
"relative w-1/2"
>
<div
class=
"relative 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-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
>
<div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"relative flex rounded-md"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<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;"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
</svg>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -165,7 +202,8 @@
...
@@ -165,7 +202,8 @@
data-hs-overlay=
"#sub-department-four-modal-add"
>
data-hs-overlay=
"#sub-department-four-modal-add"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-modal"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
@@ -218,36 +256,78 @@
...
@@ -218,36 +256,78 @@
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<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;"
value=
"01"
>
<div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"relative flex rounded-md"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<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;"
[(
ngModel
)]="
bu6
.
bu6id
"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
</svg>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"part2"
class=
"ti-form-input w-full"
placeholder=
""
style=
"background-color: #B3B3B3; margin-left: 10px;"
disabled
value=
"ส่วนย่อย 3"
>
<input
type=
"text"
id=
"part2"
class=
"ti-form-input w-full"
placeholder=
""
style=
"background-color: #B3B3B3; margin-left: 10px;"
[(
ngModel
)]="
bu6
.
tdesc
"
readonly
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<input
type=
"text"
id=
"part"
class=
"ti-form-input w-1/2 pr-10"
placeholder=
""
style=
"background-color: #B3B3B3;"
disabled
value=
"01"
>
<input
type=
"text"
id=
"part"
class=
"ti-form-input w-1/2 pr-10"
style=
"background-color: #B3B3B3;"
[(
ngModel
)]="
bu7
.
bu7id
"
readonly
>
<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"
placeholder=
""
value=
"ส่วนย่อย 4"
>
<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>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
placeholder=
"
"
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu7
.
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-four-modal-add"
>
data-hs-overlay=
"#sub-department-four-modal-add"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-modal"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div
id=
"sub-department-four-alert-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-four-alert-modal"
>
<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"
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-alert-modal"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-four-alert-modal"
(
click
)="
addBu7
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.ts
View file @
01d92d69
import
{
Component
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Bu6Model
,
MyBu6Model
}
from
'src/app/shared/model/bu6.model'
;
import
{
Bu7Model
,
MyBu7Model
}
from
'src/app/shared/model/bu7.model'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
import
{
Bu7Service
}
from
'src/app/shared/services/bu7.service'
;
@
Component
({
@
Component
({
selector
:
'app-sub-department-four'
,
selector
:
'app-sub-department-four'
,
templateUrl
:
'./sub-department-four.component.html'
,
templateUrl
:
'./sub-department-four.component.html'
,
styleUrls
:
[
'./sub-department-four.component.scss'
]
styleUrls
:
[
'./sub-department-four.component.scss'
]
})
})
export
class
SubDepartmentFourComponent
{
export
class
SubDepartmentFourComponent
implements
OnInit
{
modalOptions
:
{
currentPage
=
1
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
isModalOpen
:
boolean
;
// เปิด/ปิด
bu7List
:
Bu7Model
[]
=
[]
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
bu7
:
Bu7Model
=
new
MyBu7Model
({})
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
bu6
:
Bu6Model
=
new
MyBu6Model
({})
}
search
=
""
}
=
{
constructor
(
private
bu7Service
:
Bu7Service
,
"add"
:
{
private
bu6Service
:
Bu6Service
isModalOpen
:
false
,
)
{
}
modalSize
:
'm'
,
ngOnInit
():
void
{
backdropClose
:
true
,
this
.
getBu7List
()
},
"edit"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
}
}
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
this
.
modalOptions
[
name
].
isModalOpen
=
true
;
document
.
body
.
style
.
overflow
=
'hidden'
;
// ล็อก Scroll
}
}
getBu7List
()
{
closeModal
(
name
:
string
)
{
this
.
bu7Service
.
getList
().
subscribe
(
response
=>
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
this
.
bu7List
=
response
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
this
.
searchChange
()
if
(
!
this
.
isAnyModalOpen
())
{
})
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
}
searchChange
()
{
isAnyModalOpen
():
boolean
{
this
.
currentPage
=
1
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu7ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
}
bu7ListFilter
()
{
return
this
.
bu7List
.
filter
(
x
=>
x
.
bu7id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu7
(
bu7
:
Bu7Model
)
{
this
.
bu6Service
.
getById
(
bu7
.
parent
).
subscribe
(
response
=>
{
this
.
bu6
=
new
MyBu6Model
(
response
)
})
this
.
bu7
=
new
MyBu7Model
(
bu7
)
console
.
log
(
"5"
,
this
.
bu6
)
console
.
log
(
this
.
bu7
)
}
addBu7
()
{
// this.bu7Service.post(this.bu7).subscribe((response:any) => {
// if (response.success) {
// this.getBu7List()
// }
// })
}
deleteBu7
(
bu7
:
Bu7Model
)
{
// this.bu7Service.delete(new MyBu1Model(bu7)).subscribe((response:any) => {
// if (response.success) {
// this.getBu7List()
// }
// })
}
}
}
}
src/app/components/company-registration/branch-business-unit/sub-department-one/sub-department-one.component.html
View file @
01d92d69
...
@@ -218,7 +218,7 @@
...
@@ -218,7 +218,7 @@
<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
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
<div
class=
"button-clear"
>
...
@@ -259,7 +259,7 @@
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<div>
<div>
<div
class=
"relative flex rounded-md"
>
<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-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu3
.
bu3id
"
readonly
>
<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;"
[(
ngModel
)]="
bu3
.
bu3id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
@@ -270,7 +270,7 @@
...
@@ -270,7 +270,7 @@
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
value=
"ฝ่าย"
[(
ngModel
)]="
bu3
.
tdesc
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
[(
ngModel
)]="
bu3
.
tdesc
"
readonly
>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.html
View file @
01d92d69
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<div
class=
"px-1"
>
<div
class=
"px-1"
>
<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
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
<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>
...
@@ -60,27 +61,55 @@
...
@@ -60,27 +61,55 @@
</ng-container>
</ng-container>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody
*
ngIf=
"!bu6ListFilter().length"
>
<tr
*
ngFor=
"let item of[
<tr>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
<td
class=
"text-center"
colspan=
"100%"
>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
ไม่พบข้อมูล
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
</td>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
</tr>
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance']];let i = index"
>
</tbody>
<td
class=
"flex justify-center"
style=
"font-size: 12px;"
>
{{0+""+(i+1)}}
</td>
<tbody
*
ngIf=
"bu6ListFilter().length"
>
<td
style=
"font-size: 12px;"
>
{{item[0]}}
</td>
<tr
<td
style=
"font-size: 12px;"
>
{{item[1]}}
</td>
*
ngFor=
"let item of bu6ListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<td
style=
"font-size: 12px;"
>
{{item[2]}}
</td>
<td
class=
"flex justify-center"
>
<td
class=
"flex justify-center"
>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
data-hs-overlay=
"#sub-department-three-modal-edit"
></i>
{{((currentPage-1) * 10)+(i+1)}}
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
></i>
</td>
<td>
{{item.bu6id}}
</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
)="
selectBu6
(
item
)"
data-hs-overlay=
"#sub-department-three-modal-edit"
></i>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
(
click
)="
deleteBu6
(
item
)"
></i>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<nav
class=
"pagination-style-3 overflow-auto my-5"
*
ngIf=
"page.length"
>
<ul
class=
"ti-pagination"
>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
currentPage =
(currentPage-1
||
1
)"
>
<i
class=
"ri-arrow-left-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
<li
*
ngFor=
"let item of page"
>
<a
class=
"page-link"
href=
"javascript:void(0);"
[
class
.
active
]="
item=
=currentPage"
(
click
)="
currentPage=
item"
>
{{item}}
</a>
<!-- <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
</a> -->
</li>
<li>
<a
aria-label=
"anchor"
class=
"page-link"
href=
"javascript:void(0);"
(
click
)="
currentPage =
(currentPage
>
page.length-1 ? currentPage: currentPage+1 )">
<i
class=
"ri-arrow-right-s-line align-middle rtl:rotate-180"
></i>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
...
@@ -89,7 +118,7 @@
...
@@ -89,7 +118,7 @@
<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"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย
ที่
3
เพิ่มข้อมูลทะเบียนส่วนย่อย 3
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
<div
class=
"button-clear"
>
...
@@ -123,39 +152,48 @@
...
@@ -123,39 +152,48 @@
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-body"
style=
"margin-top: 40px;"
>
<div
class=
"ti-modal-body"
style=
"margin-top: 40px;"
>
<label
for=
"
input-label
"
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<label
for=
"
part
"
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"relative"
>
<div
class=
"relative"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<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;"
>
<div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"relative flex rounded-md"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<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;"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
</svg>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"part2"
class=
"ti-form-input w-full"
placeholder=
""
style=
"background-color: #B3B3B3; margin-left: 10px;"
disabled
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-1/2"
>
<div
class=
"relative w-full"
>
<div>
<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;"
>
<div
class=
"relative flex rounded-md"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-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-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</svg>
</div>
</div>
</div>
</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>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
placeholder=
""
>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
placeholder=
""
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
placeholder=
""
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
placeholder=
""
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
<div
class=
"flex justify-end mt-2rem mb-1rem space-x-4"
>
...
@@ -164,7 +202,8 @@
...
@@ -164,7 +202,8 @@
data-hs-overlay=
"#sub-department-three-modal-add"
>
data-hs-overlay=
"#sub-department-three-modal-add"
>
ย้อนกลับ
ย้อนกลับ
</button>
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-three-alert-modal"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
@@ -189,7 +228,7 @@
...
@@ -189,7 +228,7 @@
<g
id=
"SVGRepo_bgCarrier"
stroke-width=
"0"
></g>
<g
id=
"SVGRepo_bgCarrier"
stroke-width=
"0"
></g>
<g
id=
"SVGRepo_tracerCarrier"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></g>
<g
id=
"SVGRepo_tracerCarrier"
stroke-linecap=
"round"
stroke-linejoin=
"round"
></g>
<g
id=
"SVGRepo_iconCarrier"
>
<g
id=
"SVGRepo_iconCarrier"
>
<path
d=
"M15 49A24 24 0 0 1 32 8"
></path>
W
<path
d=
"M15 49A24 24 0 0 1 32 8"
></path>
<path
d=
"M49 15a24 24 0 0 1-17 41"
></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=
"15.03 40 15.03 48.97 8 48.97"
></polyline>
<polyline
points=
"48.97 24 48.97 15.03 56 15.03"
></polyline>
<polyline
points=
"48.97 24 48.97 15.03 56 15.03"
></polyline>
...
@@ -211,43 +250,84 @@
...
@@ -211,43 +250,84 @@
</button>
</button>
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-body "
style=
"margin-top: 40px;"
>
<div
class=
"ti-modal-body"
style=
"margin-top: 40px;"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
เเก้ไขข้อมูลทะเบียนส่วนย่อย 3
</label>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"relative"
>
<div
class=
"relative"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<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;"
value=
"01"
>
<div>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"relative flex rounded-md"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer"
></i>
<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;"
[(
ngModel
)]="
bu5
.
bu5id
"
>
<svg
class=
"h-3.5 w-3.5 text-gray-300 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"10"
height=
"10"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<path
d=
"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
/>
</svg>
</svg>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
value=
"ส่วนย่อย 2"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย 3
</label>
<input
type=
"text"
id=
"part2"
class=
"ti-form-input w-full"
placeholder=
""
style=
"background-color: #B3B3B3; margin-left: 10px;"
[(
ngModel
)]="
bu5
.
tdesc
"
readonly
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
</div>
<div
class=
"relative w-full"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 "
style=
"background-color: #B3B3B3;"
value=
"01"
>
</div>
</div>
</div>
</div>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
</div>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
placeholder=
""
value=
"ส่วนย่อย 3"
>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"part"
class=
"ti-form-input w-1/2 pr-10"
style=
"background-color: #B3B3B3;"
[(
ngModel
)]="
bu6
.
bu6id
"
readonly
>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
placeholder=
""
>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
[(
ngModel
)]="
bu6
.
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
)]="
bu6
.
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-three-modal-edit"
>
data-hs-overlay=
"#sub-department-three-modal-add"
>
ย้อนกลับ
</button>
<a
class=
"ti-btn ti-btn-success"
href=
"javascript:void(0);"
data-hs-overlay=
"#sub-department-three-alert-modal"
>
บันทึกข้อมูล
</a>
</div>
</div>
</div>
</div>
</div>
<div
id=
"sub-department-three-alert-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-three-alert-modal"
>
<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"
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-three-alert-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);"
data-hs-overlay=
"#sub-department-three-alert-modal"
(
click
)="
addBu6
()"
>
บันทึกข้อมูล
บันทึกข้อมูล
</a>
</a>
</div>
</div>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.ts
View file @
01d92d69
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
Bu5Model
,
MyBu5Model
}
from
'src/app/shared/model/bu5.model'
;
import
{
Bu6Model
,
MyBu6Model
}
from
'src/app/shared/model/bu6.model'
;
import
{
Bu5Service
}
from
'src/app/shared/services/bu5.service'
;
import
{
Bu6Service
}
from
'src/app/shared/services/bu6.service'
;
@
Component
({
@
Component
({
selector
:
'app-sub-department-three'
,
selector
:
'app-sub-department-three'
,
templateUrl
:
'./sub-department-three.component.html'
,
templateUrl
:
'./sub-department-three.component.html'
,
styleUrls
:
[
'./sub-department-three.component.scss'
]
styleUrls
:
[
'./sub-department-three.component.scss'
]
})
})
export
class
SubDepartmentThreeComponent
{
export
class
SubDepartmentThreeComponent
implements
OnInit
{
modalOptions
:
{
currentPage
=
1
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
isModalOpen
:
boolean
;
// เปิด/ปิด
bu6List
:
Bu6Model
[]
=
[]
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
bu6
:
Bu6Model
=
new
MyBu6Model
({})
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
bu5
:
Bu5Model
=
new
MyBu5Model
({})
}
search
=
""
}
=
{
constructor
(
private
bu6Service
:
Bu6Service
,
"add"
:
{
private
bu5Service
:
Bu5Service
isModalOpen
:
false
,
)
{
}
modalSize
:
'm'
,
ngOnInit
():
void
{
backdropClose
:
true
,
this
.
getBu6List
()
},
"edit"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
}
}
openModal
(
name
:
string
,
size
:
string
,
closeOnBackdrop
?:
boolean
)
{
this
.
modalOptions
[
name
].
modalSize
=
size
;
this
.
modalOptions
[
name
].
backdropClose
=
closeOnBackdrop
||
false
;
this
.
modalOptions
[
name
].
isModalOpen
=
true
;
document
.
body
.
style
.
overflow
=
'hidden'
;
// ล็อก Scroll
}
}
getBu6List
()
{
closeModal
(
name
:
string
)
{
this
.
bu6Service
.
getList
().
subscribe
(
response
=>
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
this
.
bu6List
=
response
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
this
.
searchChange
()
if
(
!
this
.
isAnyModalOpen
())
{
})
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
}
}
searchChange
()
{
isAnyModalOpen
():
boolean
{
this
.
currentPage
=
1
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu6ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
}
bu6ListFilter
()
{
return
this
.
bu6List
.
filter
(
x
=>
x
.
bu6id
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
tdesc
.
toLowerCase
().
includes
(
this
.
search
)
||
x
.
edesc
.
toLowerCase
().
includes
(
this
.
search
))
}
selectBu6
(
bu6
:
Bu6Model
)
{
this
.
bu5Service
.
getById
(
bu6
.
parent
).
subscribe
(
response
=>
{
this
.
bu5
=
new
MyBu5Model
(
response
)
})
this
.
bu6
=
new
MyBu6Model
(
bu6
)
console
.
log
(
"5"
,
this
.
bu5
)
console
.
log
(
this
.
bu6
)
}
addBu6
()
{
// this.bu6Service.post(this.bu6).subscribe((response:any) => {
// if (response.success) {
// this.getBu6List()
// }
// })
}
deleteBu6
(
bu6
:
Bu6Model
)
{
// this.bu6Service.delete(new MyBu1Model(bu6)).subscribe((response:any) => {
// if (response.success) {
// this.getBu6List()
// }
// })
}
}
}
}
src/app/components/company-registration/branch-business-unit/sub-department-two/sub-department-two.component.html
View file @
01d92d69
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
<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
เพิ่มข้อมูลทะเบียนส่วนย่อย
2
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
<div
class=
"button-clear"
>
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
1
</label>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
2
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<div>
<div>
...
@@ -218,7 +218,7 @@
...
@@ -218,7 +218,7 @@
<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"
>
แก้ไขข้อมูลทะเบียน
เเผนก
แก้ไขข้อมูลทะเบียน
ส่วนย่อย 2
</h3>
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
<div
class=
"button-clear"
>
...
@@ -259,7 +259,7 @@
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<div>
<div>
<div
class=
"relative flex rounded-md"
>
<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-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10"
style=
"padding-right: 3.5rem;"
[(
ngModel
)]="
bu4
.
bu4id
"
readonly
>
<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;"
[(
ngModel
)]="
bu4
.
bu4id
"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none z-20 ltr:pr-4 rtl:pl-4 space-x-2"
>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<i
class=
"ti ti-circle-x text-red-500 cursor-pointer right-10"
></i>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
<svg
class=
"h-3.5 w-3.5 text-gray-500 dark:text-white/70"
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
viewBox=
"0 0 16 16"
>
...
@@ -270,12 +270,12 @@
...
@@ -270,12 +270,12 @@
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col-6"
>
<div
class=
"flex flex-col-6"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
disabled
value=
"ฝ่าย"
[(
ngModel
)]="
bu4
.
tdesc
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full"
style=
"background-color: #B3B3B3; margin-left:10px;"
[(
ngModel
)]="
bu4
.
tdesc
"
readonly
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
1
</label>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย
2
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div
class=
"relative w-full"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 "
style=
"background-color: #B3B3B3;"
[
value
]="
bu5
.
bu5id
"
>
<input
type=
"text"
id=
"input-label"
class=
"ti-form-input w-full pr-10 "
style=
"background-color: #B3B3B3;"
[
value
]="
bu5
.
bu5id
"
>
...
...
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