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 @@
<div
class=
"relative w-full"
>
<div>
<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"
>
<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"
>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-four/sub-department-four.component.html
View file @
01d92d69
...
...
@@ -2,7 +2,8 @@
<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"
>
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
<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>
...
...
@@ -60,27 +61,55 @@
</ng-container>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of[
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance']];let i = index"
>
<td
class=
"flex justify-center"
style=
"font-size: 12px;"
>
{{0+""+(i+1)}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[0]}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[1]}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[2]}}
</td>
<tbody
*
ngIf=
"!bu7ListFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"bu7ListFilter().length"
>
<tr
*
ngFor=
"let item of bu7ListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<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"
>
<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-trash cursor-pointer i-gray fs-l px-1"
></i>
<i
class=
"ti ti-edit cursor-pointer i-gray fs-l px-1"
(
click
)="
selectBu7
(
item
)"
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>
</tr>
</tbody>
</table>
</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>
...
...
@@ -128,12 +157,16 @@
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<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
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"
></i>
<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"
>
<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
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;"
>
<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>
<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>
...
...
@@ -145,12 +178,16 @@
</div>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย4
</label>
<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
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"
></i>
<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"
>
<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
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;"
>
<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>
<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>
...
...
@@ -165,7 +202,8 @@
data-hs-overlay=
"#sub-department-four-modal-add"
>
ย้อนกลับ
</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>
...
...
@@ -218,36 +256,78 @@
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<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
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"
></i>
<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"
>
<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
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
)]="
bu6
.
bu6id
"
>
<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>
<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
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>
<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>
<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>
<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"
>
<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>
<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>
</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
({
selector
:
'app-sub-department-four'
,
templateUrl
:
'./sub-department-four.component.html'
,
styleUrls
:
[
'./sub-department-four.component.scss'
]
})
export
class
SubDepartmentFourComponent
{
modalOptions
:
{
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
isModalOpen
:
boolean
;
// เปิด/ปิด
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
}
}
=
{
"add"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
},
"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
export
class
SubDepartmentFourComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu7List
:
Bu7Model
[]
=
[]
bu7
:
Bu7Model
=
new
MyBu7Model
({})
bu6
:
Bu6Model
=
new
MyBu6Model
({})
search
=
""
constructor
(
private
bu7Service
:
Bu7Service
,
private
bu6Service
:
Bu6Service
)
{
}
ngOnInit
():
void
{
this
.
getBu7List
()
}
closeModal
(
name
:
string
)
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
if
(
!
this
.
isAnyModalOpen
())
{
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
getBu7List
()
{
this
.
bu7Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu7List
=
response
this
.
searchChange
()
})
}
isAnyModalOpen
():
boolean
{
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu7ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
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 @@
<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"
>
<div
class=
"button-clear"
>
...
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div>
<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"
>
<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"
>
...
...
@@ -270,7 +270,7 @@
</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=
"ฝ่าย"
[(
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>
...
...
src/app/components/company-registration/branch-business-unit/sub-department-three/sub-department-three.component.html
View file @
01d92d69
...
...
@@ -2,7 +2,8 @@
<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"
>
class=
"ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
placeholder=
"Search by No. or Name"
[(
ngModel
)]="
search
"
(
ngModelChange
)="
searchChange
()"
>
<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>
...
...
@@ -60,27 +61,55 @@
</ng-container>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of[
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance'],
['ACC', 'งานบัญชีเเละการเงิน', 'Accounting and Finance']];let i = index"
>
<td
class=
"flex justify-center"
style=
"font-size: 12px;"
>
{{0+""+(i+1)}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[0]}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[1]}}
</td>
<td
style=
"font-size: 12px;"
>
{{item[2]}}
</td>
<tbody
*
ngIf=
"!bu6ListFilter().length"
>
<tr>
<td
class=
"text-center"
colspan=
"100%"
>
ไม่พบข้อมูล
</td>
</tr>
</tbody>
<tbody
*
ngIf=
"bu6ListFilter().length"
>
<tr
*
ngFor=
"let item of bu6ListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index"
>
<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>
<i
class=
"ti ti-trash cursor-pointer i-gray fs-l px-1"
></i>
{{((currentPage-1) * 10)+(i+1)}}
</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>
</tr>
</tbody>
</table>
</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>
...
...
@@ -89,7 +118,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย
ที่
3
เพิ่มข้อมูลทะเบียนส่วนย่อย 3
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -123,39 +152,48 @@
</div>
</div>
<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 rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<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
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"
></i>
<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"
>
<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
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;"
>
<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>
<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
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>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<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
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"
></i>
<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"
>
<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"
/>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<div
class=
"relative w-1/2"
>
<div>
<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;"
>
<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>
<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>
<label
for=
"detail_th"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (ไทย)
</label>
<input
type=
"text"
id=
"detail_th"
class=
"ti-form-input h-16"
placeholder=
""
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<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"
>
...
...
@@ -164,7 +202,8 @@
data-hs-overlay=
"#sub-department-three-modal-add"
>
ย้อนกลับ
</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>
</div>
...
...
@@ -189,7 +228,7 @@
<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>
W
<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>
...
...
@@ -211,43 +250,84 @@
</button>
</div>
</div>
<div
class=
"ti-modal-body "
style=
"margin-top: 40px;"
>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
เเก้ไขข้อมูลทะเบียนส่วนย่อย 3
</label>
<div
class=
"relative"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<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
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"
></i>
<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"
>
<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"
/>
<div
class=
"ti-modal-body"
style=
"margin-top: 40px;"
>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
อยู่ภายใต้หน่วยงาน
</label>
<div
class=
"relative"
>
<div
class=
"relative rounded-xl overflow-auto"
>
<div
class=
"sm:grid grid-cols-2 gap-1"
>
<div
class=
"relative w-full"
>
<div>
<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
)]="
bu5
.
bu5id
"
>
<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>
<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
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>
<label
for=
"input-label"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย 3
</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 "
style=
"background-color: #B3B3B3;"
value=
"01"
>
<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;"
[(
ngModel
)]="
bu5
.
tdesc
"
readonly
>
</div>
</div>
</div>
<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=
"ส่วนย่อย 3"
>
<label
for=
"detail_eng"
class=
"ti-form-label mt-2rem"
>
รายละเอียด (อังกฤษ)
</label>
<input
type=
"text"
id=
"detail_eng"
class=
"ti-form-input h-16"
placeholder=
""
>
</div>
<label
for=
"part"
class=
"ti-form-label mt-2rem"
>
ส่วนย่อย3
</label>
<input
type=
"text"
id=
"part"
class=
"ti-form-input w-1/2 pr-10"
style=
"background-color: #B3B3B3;"
[(
ngModel
)]="
bu6
.
bu6id
"
readonly
>
<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"
>
<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-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>
<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>
</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
({
selector
:
'app-sub-department-three'
,
templateUrl
:
'./sub-department-three.component.html'
,
styleUrls
:
[
'./sub-department-three.component.scss'
]
})
export
class
SubDepartmentThreeComponent
{
modalOptions
:
{
[
nameModal
:
string
]:
{
// ชื่อตรวจสอบการเปิดปิด
isModalOpen
:
boolean
;
// เปิด/ปิด
modalSize
:
string
;
// ขนาดของ Modal (s,m,l,vw10-vw100 )
backdropClose
:
boolean
;
// (คลิก Backdrop แล้ว true ปิด false ไม่ปิด )
}
}
=
{
"add"
:
{
isModalOpen
:
false
,
modalSize
:
'm'
,
backdropClose
:
true
,
},
"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
export
class
SubDepartmentThreeComponent
implements
OnInit
{
currentPage
=
1
page
=
Array
.
from
({
length
:
1
},
(
_
,
i
)
=>
i
+
1
);
bu6List
:
Bu6Model
[]
=
[]
bu6
:
Bu6Model
=
new
MyBu6Model
({})
bu5
:
Bu5Model
=
new
MyBu5Model
({})
search
=
""
constructor
(
private
bu6Service
:
Bu6Service
,
private
bu5Service
:
Bu5Service
)
{
}
ngOnInit
():
void
{
this
.
getBu6List
()
}
closeModal
(
name
:
string
)
{
this
.
modalOptions
[
name
].
isModalOpen
=
false
;
// ตรวจสอบว่ามี Modal อื่นเปิดอยู่หรือไม่
if
(
!
this
.
isAnyModalOpen
())
{
document
.
body
.
style
.
overflow
=
''
;
// คืนค่าการ Scroll เฉพาะเมื่อ Modal ทั้งหมดปิดแล้ว
}
getBu6List
()
{
this
.
bu6Service
.
getList
().
subscribe
(
response
=>
{
this
.
bu6List
=
response
this
.
searchChange
()
})
}
isAnyModalOpen
():
boolean
{
// Logic ตรวจสอบว่า Modal อื่นยังเปิดอยู่หรือไม่
return
Object
.
values
(
this
.
modalOptions
).
some
(
modal
=>
modal
.
isModalOpen
);
// หากไม่มี Modal อื่นเปิด
searchChange
()
{
this
.
currentPage
=
1
this
.
page
=
Array
.
from
({
length
:
Math
.
ceil
(
this
.
bu6ListFilter
().
length
/
10
)
},
(
_
,
i
)
=>
i
+
1
);
}
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 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
เพิ่มข้อมูลทะเบียนส่วนย่อย
1
เพิ่มข้อมูลทะเบียนส่วนย่อย
2
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -177,7 +177,7 @@
</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=
"relative w-full"
>
<div>
...
...
@@ -218,7 +218,7 @@
<div
class=
"max-h-full overflow-hidden ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h3
class=
"text-xxl font-bold text-primary"
>
แก้ไขข้อมูลทะเบียน
เเผนก
แก้ไขข้อมูลทะเบียน
ส่วนย่อย 2
</h3>
<div
class=
"flex justify-end"
>
<div
class=
"button-clear"
>
...
...
@@ -259,7 +259,7 @@
<div
class=
"relative w-full"
>
<div>
<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"
>
<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"
>
...
...
@@ -270,12 +270,12 @@
</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=
"ฝ่าย"
[(
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>
<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=
"relative w-full"
>
<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