Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
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
Chanachai
BookingMyHrManagement
Commits
251b8d1c
Commit
251b8d1c
authored
Mar 15, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin
parent
3c3ffaf1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
215 additions
and
357 deletions
+215
-357
30b5e361-1bcf-4b9d-a275-a0ac70bda0eb.jpg
.../uploaded_images/30b5e361-1bcf-4b9d-a275-a0ac70bda0eb.jpg
+0
-0
admin-manage.component.html
...c/app/DPU/common/admin-manage/admin-manage.component.html
+69
-234
admin-manage.component.ts
...src/app/DPU/common/admin-manage/admin-manage.component.ts
+59
-121
user-setting.component.ts
...on/user-management/user-setting/user-setting.component.ts
+1
-1
equipments.model.ts
Web-Manage/src/app/DPU/models/equipments.model.ts
+32
-0
equirement.service.ts
Web-Manage/src/app/DPU/services/equirement.service.ts
+53
-0
nav.service.ts
Web-Manage/src/app/shared/services/nav.service.ts
+1
-1
No files found.
API-Fast/uploaded_images/30b5e361-1bcf-4b9d-a275-a0ac70bda0eb.jpg
0 → 100644
View file @
251b8d1c
31.4 KB
Web-Manage/src/app/DPU/common/admin-manage/admin-manage.component.html
View file @
251b8d1c
<app-page-header
[
title
]="'จัดการ
สมาชิก'"
[
activeTitle
]="'ผู้ดูแลระบบ'"
[
title1
]="'จัดการสมาชิก
'"
></app-page-header>
<app-page-header
[
title
]="'จัดการ
อุปกรณ์'"
[
activeTitle
]="'ผู้ดูแลระบบ'"
[
title1
]="'จัดการอุปกรณ์
'"
></app-page-header>
<div
class=
"grid grid-cols-12 gap-x-6"
>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"box"
>
<div
class=
"box
mt-6
"
>
<div
class=
"box-header justify-between"
>
<div
class=
"box-header justify-between"
>
<div
class=
"box-title"
>
<div
class=
"box-title"
>
{{ 'All List' | translate}}
<span
{{ 'All List' | translate}}
<span
...
@@ -11,299 +10,135 @@
...
@@ -11,299 +10,135 @@
</div>
</div>
<div
class=
"flex flex-wrap gap-2"
>
<div
class=
"flex flex-wrap gap-2"
>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
new
()"
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
new
()"
data-hs-overlay=
"#modal-detail"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{ 'Create' |
data-hs-overlay=
"#modal-detail"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{ 'เพิ่ม' |
translate}}
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-success-full me-2"
*
ngIf=
"someSelected"
(
click
)="
adjustSelect
(
1
)"
><i
class=
"ri-user-follow-line font-semibold align-middle"
></i>
{{ 'Active' |
translate}}
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-secondary-full me-2"
*
ngIf=
"someSelected"
(
click
)="
adjustSelect
(
0
)"
><i
class=
"ri-user-unfollow-line font-semibold align-middle"
></i>
{{ 'Unactive' |
translate}}
</a>
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-danger-full me-2"
*
ngIf=
"someSelected"
(
click
)="
deleteSelect
()"
><i
class=
"ri-delete-bin-line font-semibold align-middle"
></i>
{{ 'Delete' |
translate}}
translate}}
</a>
</a>
<div>
<div>
<input
class=
"form-control form-control"
type=
"text"
placeholder=
"ค้นหาสมาชิก
"
<input
[(
ngModel
)]='
searchTerm
'
class=
"form-control form-control"
type=
"text
"
aria-label=
".form-control-sm example"
[(
ngModel
)]='
searchTerm
'
>
placeholder=
"{{ 'ค้นหาข้อมูลพนักงาน' | translate}}"
aria-label=
".form-control-sm example"
>
</div>
</div>
<!-- <div>
<input class="form-control form-control" type="text" placeholder="กรองตามบริษัท"
aria-label=".form-control-sm example" [(ngModel)]='searchTerm'>
</div> -->
<!-- <a href="javascript:void(0);" class="ti-btn ti-btn-primary-full !py-1 !px-2" aria-expanded="false">
<!-- <a href="javascript:void(0);" class="ti-btn ti-btn-primary-full !py-1 !px-2" aria-expanded="false">
เรียงตาม<i class="ri-arrow-down-s-line align-middle ms-1 inline-block"></i>
เรียงตาม<i class="ri-arrow-down-s-line align-middle ms-1 inline-block"></i>
</a>
</a>
<ul class="hs-dropdown-menu ti-dropdown-menu hidden" role="menu">
<ul class="hs-dropdown-menu ti-dropdown-menu hidden" role="menu">
<li><a class="ti-dropdown-item" href="javascript:void(0);">Posted Date</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Status</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Department</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Job Type</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Newest</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Newest</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Oldest</a></li>
<li><a class="ti-dropdown-item" href="javascript:void(0);">Oldest</a></li>
</ul> -->
</ul> -->
</div>
</div>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table whitespace-nowrap min-w-full ti-custom-table-hover"
>
<thead>
<tr
class=
"border-b border-defaultborder"
>
<th
scope=
"col"
class=
"!text-start"
>
<input
class=
"form-check-input check-all"
type=
"checkbox"
id=
"all-products"
(
change
)="
toggleAll
($
event
)"
[
checked
]="
allSelected
"
aria-label=
"..."
>
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Username' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Fullname' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Email' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Mobile' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'User Group' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Status' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
>
{{ 'Update Date' | translate}}
</th>
<th
scope=
"col"
class=
"text-start"
></th>
</tr>
</thead>
<tbody>
@for(item of filterList;track filterList){
<tr
class=
"border border-defaultborder dark:border-defaultborder/10"
>
<td
class=
"product-checkbox"
><input
class=
"form-check-input"
type=
"checkbox"
[
checked
]="
selectedItems
.
get
(
item
.
memberId
)"
(
change
)="
onCheckboxChange
(
item
.
memberId
)"
aria-label=
"..."
value=
""
>
</td>
<td>
<div
class=
"flex items-center"
>
<span
class=
"avatar avatar-sm p-1 me-1 bg-light !rounded-full"
>
<img
[
src
]="
item
.
getPicture
()"
alt=
""
id=
"profile-img"
>
</span>
<div
class=
"ms-2"
>
<p
class=
"font-semibold mb-0 flex items-center text-primary"
><a
(
click
)="
view
(
item
)"
>
{{item.username}}
</a></p>
<p
class=
"text-[0.75rem] text-muted mb-0"
>
{{item.memberId}}
</p>
</div>
</div>
</div>
</div>
</td>
@for(item of filterList;track filterList){
<div
class=
"xxl:col-span-4 xl:col-span-6 lg:col-span-6 md:col-span-6 sm:col-span-12 col-span-12"
>
<div
class=
"box team-member-card"
>
<div
class=
"teammember-cover-image mt-1"
>
<span
class=
"avatar avatar-xl avatar-rounded"
>
<img
[
src
]="
item
.
getPicture
()"
alt=
""
>
</span>
<!-- <td>
<div class="flex">
<div class="ms-2">
<p class="font-semibold mb-0 flex items-center text-primary"><a (click)="view(item)"
data-hs-overlay="#modal-detail">
{{item.username}}</a></p>
<p class="text-[0.75rem] text-muted mb-0">{{item.memberId}}</p>
</div>
</div>
<div
class=
"box-body !p-0"
>
<div
class=
"flex flex-wrap align-item-center sm:mt-0 mt-[3rem] justify-between border-b border-dashed dark:border-defaultborder/10 p-4"
>
<div
class=
"team-member-details flex-grow"
>
<p
class=
"mb-0 font-semibold text-[1rem] text-truncate"
>
<a
href=
"javascript:void(0);"
>
{{item.equipment_name}}
</a>
</p>
<p
class=
"mb-0 text-[0.75rem] text-[#8c9097] dark:text-white/50 text-truncate"
>
{{item.description}}
</p>
</div>
</div>
</td> -->
<td>
{{item.firstName}} {{item.lastName}}
</td>
<td>
<div>
<span
class=
"block mb-1"
><i
class=
"ri-mail-line me-2 align-middle text-[.875rem] text-[#8c9097] dark:text-white/50 inline-flex"
></i>
{{item.email}}
</span>
</div>
</td>
<td>
<div>
<span
class=
"block"
><i
class=
"ri-phone-line me-2 align-middle text-[.875rem] text-[#8c9097] dark:text-white/50 inline-flex"
></i>
{{item.phoneNumber}}
</span>
</div>
</td>
<td>
<span
class=
"badge bg-{{ item.role == 1 ? 'primary' : 'info'}} text-white"
>
{{item.getRole()}}
</span>
</td>
<td>
<span
class=
"badge bg-{{ item.status == 1 ? 'primary' : 'danger'}} text-white"
>
{{item.getStatus()}}
</span>
</td>
<td><span
class=
"badge bg-info/10 text-primary"
><i
class=
"bi bi-clock me-1"
></i>
{{item.updatedAt | date : 'medium'}}
</span></td>
<td>
<td>
<div
class=
"flex flex-row items-center !gap-2 "
>
<a
aria-label=
"anchor"
(
click
)="
view
(
item
)"
data-hs-overlay=
"#modal-detail"
class=
"ti-btn ti-btn-wave !gap-0 !m-0 bg-info/10 text-info hover:bg-info hover:text-white hover:border-info"
><i
class=
"ri-pencil-line"
></i></a>
<a
aria-label=
"anchor"
href=
"javascript:void(0);"
(
click
)="
delete
(
item
)"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"
><i
class=
"ri-delete-bin-line"
></i></a>
</div>
</div>
</td>
<!-- <div class="team-member-stats sm:flex items-center justify-evenly">
</tr>
<div class="text-center p-4 w-full">
}
<p class="font-semibold mb-0">รหัสพนักงาน</p>
<span class="text-[#8c9097] dark:text-white/50 text-[0.75rem]">{{item.employeeId}}</span>
</tbody>
</table>
</div>
</div>
<div class="text-center p-4 w-full">
<p class="font-semibold mb-0">แผนก</p>
<span class="text-[#8c9097] dark:text-white/50 text-[0.75rem]">{{item.position.thName}}</span>
</div>
</div>
<div
class=
"box-footer"
>
<div class="text-center p-4 w-full">
<div
class=
"flex items-center flex-wrap overflow-auto"
*
ngIf=
"filterList.length > 0"
>
<p class="font-semibold mb-0">ตำแหน่ง</p>
<div
class=
"mb-2 sm:mb-0"
>
<span class="text-[#8c9097] dark:text-white/50 text-[0.75rem]">{{item.department.thName}}</span>
<div>
{{'Showing' | translate}} {{filterList.length}} {{'entries'
| translate}}
<i
class=
"bi bi-arrow-right ms-2 font-semibold"
></i>
</div>
</div>
</div> -->
</div>
</div>
<div
class=
"ms-auto"
>
<div
class=
"box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"
>
<nav
aria-label=
"Page navigation"
>
<div
class=
"btn-list"
>
<ul
class=
"ti-pagination mb-0"
>
<div
class=
"btn-list"
>
<li
*
ngIf=
"pageIndex>0"
class=
"page-item {{pageIndex==0 ? 'disabled' : ''}}"
><a
<button
type=
"button"
aria-label=
"button"
data-hs-overlay=
"#modal-detail"
(
click
)="
view
(
item
)"
class=
"page-link px-3 py-[0.375rem]"
class=
"ti-btn ti-btn-sm ti-btn-primary me-[0.375rem]"
><i
class=
"ri-edit-line"
></i></button>
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{'Previous' | translate}}
</a></li>
<button
(
click
)="
delete
(
item
)"
type=
"button"
aria-label=
"button"
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-sm ti-btn-danger me-0"
><i
class=
"ri-delete-bin-line"
></i></button>
*
ngIf=
"pageIndex-1>0"
(
click
)="
pageIndex =
pageIndex-2;updatePagedItems()"
>
{{pageIndex-1}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"pageIndex>0 && ((pageIndex-1)*10 < (searchTerm == '' ? itemsList.length : filterList.length))"
(
click
)="
pageIndex =
pageIndex-1;updatePagedItems()"
>
{{pageIndex}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link active px-3 py-[0.375rem]"
href=
"javascript:void(0);"
>
{{pageIndex +1}}
</a>
</li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{pageIndex +2}}
</a></li>
<li
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
href=
"javascript:void(0);"
*
ngIf=
"(pageIndex+2)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
(
click
)="
pageIndex =
pageIndex+2;updatePagedItems()"
>
{{pageIndex +3}}
</a></li>
<li
*
ngIf=
"(pageIndex+1)*10 < (searchTerm == '' ? itemsList.length : filterList.length)"
class=
"page-item"
><a
class=
"page-link px-3 py-[0.375rem]"
(
click
)="
pageIndex =
pageIndex+1;updatePagedItems()"
>
{{'Next' |
translate}}
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
</div>
<!-- <nav aria-label="Page navigation" class="mb-4">
<ul class="ti-pagination !justify-end py-[0.375rem] px-3 text-[1rem] flex flex-row">
<li class="page-item disabled"><a class="page-link py-[0.375rem] px-3" href="javascript:void(0);">Previous</a></li>
<li class="page-item"><a class="page-link py-[0.375rem] px-3" href="javascript:void(0);">1</a></li>
<li class="page-item"><a class="page-link py-[0.375rem] px-3" href="javascript:void(0);">2</a></li>
<li class="page-item"><a class="page-link py-[0.375rem] px-3" href="javascript:void(0);">Next</a></li>
</ul>
</nav> -->
<!-- Start:: New Deal -->
<div
id=
"modal-detail"
class=
"hs-overlay hidden ti-modal"
>
<!-- Start:: Create Contact -->
<div
id=
"modal-detail"
class=
"hs-overlay hidden ti-modal [--overlay-backdrop:static]"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
{{ 'Create' |
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
ข้อมูลพนักงาน
translate }} {{ 'User' | translate }}
</h6>
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-detail"
#
closeModal
>
data-hs-overlay=
"#modal-detail"
>
<span
class=
"sr-only"
>
{{'Close' | translate}}
</span>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ri-close-line"
></i>
<i
class=
"ri-close-line"
></i>
</button>
</button>
</div>
</div>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"mb-0 text-center"
>
<div
class=
"mb-0 text-center"
>
<span
class=
"avatar avatar-xxl avatar-rounded"
>
<span
class=
"avatar avatar-xxl avatar-rounded"
>
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<img
[
src
]="
selectModel
.
getPicture
()"
alt=
""
id=
"profile-img"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<span
class=
"badge rounded-full bg-primary avatar-badge"
>
<input
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
<input
ng2FileSelect
[
uploader
]="
uploaderProfile
"
type=
"file"
name=
"photo"
class=
"absolute w-full h-full opacity-[0]"
id=
"profile-change"
>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
<i
class=
"fe fe-camera text-[.625rem]"
></i>
</span>
</span>
</span>
</span>
</div>
</div>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Username' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
username
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.username"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Password' | translate}}
</label>
<input
type=
"password"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
password
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.password"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'Confirm Password' | translate}}
</label>
<input
type=
"password"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
confirmPassword
"
>
<div
class=
"text-danger"
*
ngIf=
"!confirmPassword"
>
{{'Please fill in information' | translate}}
</div>
<div
class=
"text-danger"
*
ngIf=
"confirmPassword && (confirmPassword != selectModel.password)"
>
{{'Password Not Match' | translate}}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'ชื่อ' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
firstName
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.firstName"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'นามสกุล' | translate}}
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
lastName
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.lastName"
>
{{'Please fill in information' | translate}}
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'อีเมล' | translate}}
</label>
<label
for=
"deal-name"
class=
"form-label"
>
ชื่อ
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
[(
ngModel
)]="
selectModel
.
email
"
>
<input
type=
"text"
class=
"form-control"
id=
"deal-name"
placeholder=
"ชื่อ"
<div
class=
"text-danger"
*
ngIf=
"!selectModel.email"
>
[(
ngModel
)]="
selectModel
.
equipment_name
"
>
{{'Please fill in information' | translate}}
</div>
</div>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<div
class=
"xl:col-span-6 col-span-12"
>
<label
for=
"deal-title"
class=
"form-label"
>
{{'เบอร์ติดต่อ' | translate}}
</label>
<label
for=
"deal-lead-score"
class=
"form-label"
>
รายละเอียด
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-title"
placeholder=
""
<input
type=
"text"
class=
"form-control"
id=
"deal-lead-score"
placeholder=
"นามสกุล"
[(
ngModel
)]="
selectModel
.
phoneNumber
"
>
[(
ngModel
)]="
selectModel
.
description
"
>
<div
class=
"text-danger"
*
ngIf=
"!selectModel.phoneNumber"
>
{{'Please fill in information' | translate}}
</div>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
class=
"form-label"
>
{{'User Role' | translate}}
</label>
<ng-select
name=
"choices-multiple-remove-button1"
id=
"choices-multiple-remove-button1"
placeholder=
""
[(
ngModel
)]="
selectModel
.
role
"
>
<ng-option
[
value
]="
0
"
>
{{'ผู้ใช้งานทั่วไป' | translate}}
</ng-option>
<ng-option
[
value
]="
1
"
>
{{'ผู้ดูแลบริษัท' | translate}}
</ng-option>
</ng-select>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
class=
"form-label"
>
{{'Status' | translate}}
</label>
<ng-select
name=
"choices-multiple-remove-button2"
id=
"choices-multiple-remove-button2"
placeholder=
""
[(
ngModel
)]="
selectModel
.
status
"
>
<ng-option
[
value
]="
0
"
>
{{'Unactive' | translate}}
</ng-option>
<ng-option
[
value
]="
1
"
>
{{'Active' | translate}}
</ng-option>
</ng-select>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ti-modal-footer"
>
<div
class=
"ti-modal-footer"
>
<button
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-light align-middle"
<button
#
closeModal
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay=
"#modal-detail"
>
data-hs-overlay=
"#modal-detail"
>
{{'Cancel' | translate}}
ยกเลิก
</button>
</button>
<button
type=
"button"
(
click
)="
save
()"
class=
"ti-btn bg-primary text-white !font-medium"
>
{{'Save' |
<button
type=
"button"
class=
"ti-btn bg-primary text-white !font-medium"
(
click
)="
save
()"
>
บันทึก
</button>
translate}}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End:: Create Contact -->
Web-Manage/src/app/DPU/common/admin-manage/admin-manage.component.ts
View file @
251b8d1c
...
@@ -12,6 +12,9 @@ import { TokenService } from "../../../shared/services/token.service";
...
@@ -12,6 +12,9 @@ import { TokenService } from "../../../shared/services/token.service";
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
environment
}
from
"../../../../environments/environment"
;
import
{
environment
}
from
"../../../../environments/environment"
;
import
{
EquipmentModel
}
from
"../../models/equipments.model"
;
import
{
EquipmentService
}
from
"../../services/equirement.service"
;
import
{
HttpClient
}
from
"@angular/common/http"
;
@
Component
({
@
Component
({
selector
:
'app-admin-manage'
,
selector
:
'app-admin-manage'
,
...
@@ -30,20 +33,17 @@ import { environment } from "../../../../environments/environment";
...
@@ -30,20 +33,17 @@ import { environment } from "../../../../environments/environment";
})
})
export
class
AdminManageComponent
{
export
class
AdminManageComponent
{
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'closeModalFace'
)
public
childModalFace
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
action
=
"new"
;
allSelected
=
false
;
allSelected
=
false
;
someSelected
=
false
;
someSelected
=
false
;
confirmPassword
=
""
itemsList
:
UserProfileModel
[]
=
[]
filterList
:
UserProfileModel
[]
=
[]
selectedItems
=
new
Map
<
string
,
boolean
>
();
selectModel
:
UserProfileModel
=
new
UserProfileModel
()
empList
:
UserProfileModel
[]
=
[]
descName
=
'engName'
pageIndex
=
0
;
uploaderProfile
:
FileUploader
|
undefined
;
uploaderProfile
:
FileUploader
|
undefined
;
uploadErrorMsg
:
string
=
""
;
uploadErrorMsg
:
string
=
""
;
itemsList
:
EquipmentModel
[]
=
[]
filterList
:
EquipmentModel
[]
=
[]
selectModel
:
EquipmentModel
=
new
EquipmentModel
()
selectedItems
=
new
Map
<
string
,
boolean
>
();
pageIndex
=
0
;
get
searchTerm
():
string
{
get
searchTerm
():
string
{
return
this
.
_searchTerm
;
return
this
.
_searchTerm
;
}
}
...
@@ -57,12 +57,23 @@ export class AdminManageComponent {
...
@@ -57,12 +57,23 @@ export class AdminManageComponent {
this
.
updatePagedItems
()
this
.
updatePagedItems
()
}
}
}
}
companyId
=
""
_searchTerm
=
""
;
_searchTerm
=
""
;
constructor
(
private
userService
:
UserService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
)
{
isEdit
=
false
;
constructor
(
private
http
:
HttpClient
,
private
eqService
:
EquipmentService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
)
{
this
.
uploadConfig
()
this
.
uploadConfig
()
this
.
companyId
=
this
.
tokenService
.
getSelectCompany
().
companyId
;
}
}
@
ViewChild
(
'video'
)
video
:
ElementRef
;
@
ViewChild
(
'canvas'
)
canvas
:
ElementRef
;
capturedImage
:
string
|
null
=
null
;
uploadStatus
:
string
=
''
;
checkMatch
=
false
;
memberId
=
""
isFaceDetected
=
false
;
// Flag to determine if a face is detected
uploadConfig
()
{
uploadConfig
()
{
this
.
uploaderProfile
=
new
FileUploader
({
this
.
uploaderProfile
=
new
FileUploader
({
url
:
environment
.
baseUrl
+
"/api/upload-image"
,
url
:
environment
.
baseUrl
+
"/api/upload-image"
,
...
@@ -114,28 +125,23 @@ export class AdminManageComponent {
...
@@ -114,28 +125,23 @@ export class AdminManageComponent {
};
};
}
}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
user
Service
.
getLists
().
subscribe
(
result
=>
{
this
.
eq
Service
.
getLists
().
subscribe
(
result
=>
{
this
.
itemsList
=
result
.
filter
(
e
=>
e
.
role
==
99
)
this
.
itemsList
=
result
this
.
updatePagedItems
()
this
.
updatePagedItems
()
})
})
}
}
filter
(
v
:
string
)
{
filter
(
v
:
string
)
{
this
.
pageIndex
=
0
;
return
this
.
itemsList
?.
filter
(
return
this
.
itemsList
?.
filter
(
(
x
)
=>
(
x
)
=>
x
.
memberId
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
equipment_name
.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
username
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
description
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
x
.
email
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
phoneNumber
?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
getRole
()?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
getStatus
()?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
||
x
.
getFullname
()?.
toLowerCase
().
indexOf
(
v
.
toLowerCase
())
!==
-
1
);
);
}
}
delete
(
item
:
UserProfile
Model
)
{
delete
(
item
:
Equipment
Model
)
{
swal
({
swal
({
title
:
"Are you sure?"
,
title
:
"Are you sure?"
,
text
:
"You won't be able to revert this!"
,
text
:
"You won't be able to revert this!"
,
...
@@ -146,7 +152,7 @@ export class AdminManageComponent {
...
@@ -146,7 +152,7 @@ export class AdminManageComponent {
})
})
.
then
((
willDelete
:
any
)
=>
{
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
if
(
willDelete
)
{
this
.
user
Service
.
delete
(
item
).
subscribe
(
result
=>
{
this
.
eq
Service
.
delete
(
item
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
ngOnInit
()
})
})
...
@@ -156,16 +162,14 @@ export class AdminManageComponent {
...
@@ -156,16 +162,14 @@ export class AdminManageComponent {
}
}
new
()
{
new
()
{
this
.
action
=
'add'
this
.
isEdit
=
false
this
.
selectModel
=
new
UserProfile
Model
()
this
.
selectModel
=
new
Equipment
Model
()
}
}
view
(
item
:
UserProfileModel
)
{
view
(
item
:
EquipmentModel
)
{
this
.
action
=
'edit'
console
.
log
(
item
)
this
.
confirmPassword
=
''
this
.
isEdit
=
true
;
this
.
selectModel
=
new
UserProfileModel
(
item
)
this
.
selectModel
=
item
console
.
log
(
this
.
selectModel
)
}
}
save
()
{
save
()
{
...
@@ -178,126 +182,60 @@ export class AdminManageComponent {
...
@@ -178,126 +182,60 @@ export class AdminManageComponent {
})
})
.
then
((
willDelete
:
any
)
=>
{
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
if
(
willDelete
)
{
this
.
selectModel
.
role
=
99
if
(
!
this
.
isEdit
)
{
if
(
this
.
action
==
'add'
)
{
this
.
eqService
.
save
(
this
.
selectModel
).
subscribe
(
result
=>
{
this
.
userService
.
save
(
this
.
selectModel
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
console
.
log
(
result
)
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
()
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
this
.
childModal
?.
nativeElement
.
click
()
})
})
}
else
if
(
this
.
action
==
'edit'
)
{
}
else
{
this
.
userService
.
update
(
this
.
selectModel
).
subscribe
(
result
=>
{
this
.
eqService
.
update
(
this
.
selectModel
).
subscribe
(
result
=>
{
console
.
log
(
result
)
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
swal
(
"Update Success!!"
,
"บันทึกข้อมูลสมาชิก"
,
"success"
);
this
.
ngOnInit
()
this
.
ngOnInit
()
this
.
childModal
?.
nativeElement
.
click
()
this
.
childModal
?.
nativeElement
.
click
()
})
})
}
}
}
// this.selectModel.member.role = 0
});
}
updatePagedItems
()
{
const
startIndex
=
this
.
pageIndex
*
10
;
const
endIndex
=
startIndex
+
10
;
this
.
filterList
=
this
.
itemsList
.
slice
(
startIndex
,
endIndex
);
}
}
toggleAll
(
event
:
any
)
{
this
.
allSelected
=
event
.
target
.
checked
;
this
.
selectedItems
.
clear
();
this
.
itemsList
.
forEach
(
item
=>
{
this
.
selectedItems
.
set
(
item
.
memberId
,
this
.
allSelected
);
});
});
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
memberId
));
}
onCheckboxChange
(
memberId
:
string
)
{
const
isSelected
=
this
.
selectedItems
.
get
(
memberId
)
||
false
;
this
.
selectedItems
.
set
(
memberId
,
!
isSelected
);
this
.
allSelected
=
this
.
itemsList
.
every
(
item
=>
this
.
selectedItems
.
get
(
item
.
memberId
));
this
.
someSelected
=
this
.
itemsList
.
some
(
item
=>
this
.
selectedItems
.
get
(
item
.
memberId
));
}
deleteSelect
()
{
let
employeeInfo
=
''
;
this
.
selectedItems
.
forEach
((
isSelected
,
memberId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
memberId
===
memberId
);
if
(
user
)
{
employeeInfo
+=
`
${
this
.
translate
.
instant
(
'Fullname'
)}
:
${
user
.
getFullname
()}
\n`
;
}
}
}
});
updateEmp
()
{
swal
({
swal
({
title
:
"Are you sure?"
,
title
:
"Are you sure?"
,
text
:
employeeInfo
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
true
,
buttons
:
[
"Cancel"
,
"Yes, Delete it!"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
selectedItems
.
forEach
((
isSelected
,
memberId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
memberId
===
memberId
);
if
(
user
)
{
this
.
userService
.
delete
(
user
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
});
}
}
});
}
});
}
adjustSelect
(
status
:
number
)
{
let
title
=
"Are you sure?"
let
employeeInfo
=
''
;
// ตัวแปรสำหรับเก็บข้อมูลพนักงาน
this
.
selectedItems
.
forEach
((
isSelected
,
memberId
)
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
memberId
===
memberId
);
if
(
user
)
{
employeeInfo
+=
`
${
this
.
translate
.
instant
(
'Fullname'
)}
:
${
user
.
getFullname
()}
\n`
;
}
}
});
swal
({
title
:
title
,
text
:
employeeInfo
,
icon
:
"warning"
,
icon
:
"warning"
,
dangerMode
:
false
,
dangerMode
:
false
,
buttons
:
[
"Cancel"
,
"Confirm"
],
buttons
:
[
"Cancel"
,
"Confirm"
],
})
})
.
then
((
willDelete
:
any
)
=>
{
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
if
(
willDelete
)
{
this
.
selectedItems
.
forEach
((
isSelected
,
memberId
)
=>
{
this
.
eqService
.
save
(
this
.
selectModel
).
subscribe
(
result
=>
{
if
(
isSelected
)
{
const
user
=
this
.
itemsList
.
find
(
user
=>
user
.
memberId
===
memberId
);
if
(
user
)
{
user
.
status
=
status
this
.
userService
.
update
(
user
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
();
this
.
ngOnInit
()
});
this
.
childModal
?.
nativeElement
.
click
()
}
})
}
});
}
}
});
});
}
}
filterEmp
(
empId
:
string
)
{
// filterEmp(empId: string) {
this
.
selectModel
=
this
.
empList
.
filter
(
e
=>
e
.
memberId
==
empId
)[
0
]
// this.selectModel.supervisor = this.itemsList.filter(e => e.employeeId == empId)[0]
// }
updatePagedItems
()
{
const
startIndex
=
this
.
pageIndex
*
10
;
const
endIndex
=
startIndex
+
10
;
// this.filterList = this.itemsList.slice(startIndex, endIndex);
this
.
filterList
=
this
.
itemsList
}
}
}
}
Web-Manage/src/app/DPU/common/user-management/user-setting/user-setting.component.ts
View file @
251b8d1c
...
@@ -119,7 +119,7 @@ export class UserSettingComponent {
...
@@ -119,7 +119,7 @@ export class UserSettingComponent {
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
userService
.
getLists
().
subscribe
(
result
=>
{
this
.
userService
.
getLists
().
subscribe
(
result
=>
{
this
.
itemsList
=
result
.
filter
(
e
=>
e
.
role
!=
99
)
this
.
itemsList
=
result
this
.
updatePagedItems
()
this
.
updatePagedItems
()
})
})
}
}
...
...
Web-Manage/src/app/DPU/models/equipments.model.ts
0 → 100644
View file @
251b8d1c
import
{
TranslateService
}
from
"@ngx-translate/core"
;
import
{
BaseModel
}
from
"./base.model"
;
import
{
environment
}
from
"../../../environments/environment"
;
export
class
EquipmentModel
extends
BaseModel
{
equipment_id
:
string
;
picture
:
string
;
equipment_name
:
string
;
description
?:
string
;
quantity_total
:
number
;
is_returnable
:
boolean
;
location
?:
string
;
created_at
:
string
;
updated_at
:
string
;
constructor
(
data
?:
Partial
<
EquipmentModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
);
this
.
picture
=
data
?.
picture
??
''
;
this
.
equipment_id
=
data
?.
equipment_id
??
''
;
this
.
equipment_name
=
data
?.
equipment_name
??
''
;
this
.
description
=
data
?.
description
??
''
;
this
.
quantity_total
=
data
?.
quantity_total
??
0
;
this
.
is_returnable
=
data
?.
is_returnable
??
true
;
this
.
location
=
data
?.
location
??
''
;
this
.
created_at
=
data
?.
created_at
??
new
Date
().
toISOString
();
this
.
updated_at
=
data
?.
updated_at
??
new
Date
().
toISOString
();
}
getPicture
():
string
{
return
this
.
picture
?
environment
.
baseUrl
+
'/images/'
+
this
.
picture
:
'./assets/images/faces/9.jpg'
}
}
Web-Manage/src/app/DPU/services/equirement.service.ts
0 → 100644
View file @
251b8d1c
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
EquipmentModel
}
from
'../models/equipments.model'
;
import
{
map
,
tap
,
switchMap
,
filter
,
reduce
}
from
"rxjs/operators"
;
@
Injectable
({
providedIn
:
'root'
})
export
class
EquipmentService
{
apiBaseUrl
=
"/equipments"
;
constructor
(
private
http
:
HttpClient
)
{
}
getById
(
id
:
string
)
{
return
this
.
http
.
get
<
EquipmentModel
>
(
this
.
apiBaseUrl
+
"/"
+
id
)
.
pipe
(
map
((
e
)
=>
new
EquipmentModel
(
e
)));
}
getLists
()
{
return
this
.
http
.
get
<
EquipmentModel
[]
>
(
this
.
apiBaseUrl
)
.
pipe
(
map
((
e
)
=>
e
.
map
((
e
)
=>
new
EquipmentModel
(
e
)))
);
}
save
(
body
:
EquipmentModel
)
{
return
this
.
http
.
post
<
{
"message"
:
string
,
"user"
:
EquipmentModel
}
>
(
this
.
apiBaseUrl
,
new
EquipmentModel
(
body
));
}
update
(
body
:
EquipmentModel
)
{
return
this
.
http
.
put
<
{
"message"
:
string
,
"user"
:
EquipmentModel
}
>
(
this
.
apiBaseUrl
+
"/"
+
body
.
equipment_id
,
new
EquipmentModel
(
body
));
}
delete
(
body
:
EquipmentModel
)
{
return
this
.
http
.
delete
<
{
"message"
:
string
,
"user"
:
EquipmentModel
}
>
(
this
.
apiBaseUrl
+
"/"
+
body
.
equipment_id
);
}
}
Web-Manage/src/app/shared/services/nav.service.ts
View file @
251b8d1c
...
@@ -127,7 +127,7 @@ export class NavService implements OnDestroy {
...
@@ -127,7 +127,7 @@ export class NavService implements OnDestroy {
active
:
false
,
active
:
false
,
children
:
[
children
:
[
{
path
:
'/admin/member-manage'
,
title
:
'การจัดการสมาชิก'
,
type
:
'link'
},
{
path
:
'/admin/member-manage'
,
title
:
'การจัดการสมาชิก'
,
type
:
'link'
},
{
path
:
'/admin/
product-management
'
,
title
:
'การจัดการอุปกรณ์'
,
type
:
'link'
},
{
path
:
'/admin/
admin-manage
'
,
title
:
'การจัดการอุปกรณ์'
,
type
:
'link'
},
{
{
path
:
'/admin/manage-companys'
,
path
:
'/admin/manage-companys'
,
title
:
'การจัดการโครงการ'
,
title
:
'การจัดการโครงการ'
,
...
...
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