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
318d51ac
Commit
318d51ac
authored
Mar 15, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin
parent
eceb34fc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
146 additions
and
21 deletions
+146
-21
equipment_controller.cpython-312.pyc
...trollers/__pycache__/equipment_controller.cpython-312.pyc
+0
-0
equipment_controller.py
API-Fast/src/controllers/equipment_controller.py
+4
-1
equipment_schema.cpython-312.pyc
.../src/schemas/__pycache__/equipment_schema.cpython-312.pyc
+0
-0
equipment_schema.py
API-Fast/src/schemas/equipment_schema.py
+1
-0
77acbca3-362b-45c1-a0d7-86259de64219.png
.../uploaded_images/77acbca3-362b-45c1-a0d7-86259de64219.png
+0
-0
7bea0172-778a-4643-8186-4e450a4352c1.png
.../uploaded_images/7bea0172-778a-4643-8186-4e450a4352c1.png
+0
-0
bc569b25-d79d-4244-ae05-fb2eed098f5a.jpg
.../uploaded_images/bc569b25-d79d-4244-ae05-fb2eed098f5a.jpg
+0
-0
admin-manage.component.html
...c/app/DPU/common/admin-manage/admin-manage.component.html
+77
-17
admin-manage.component.ts
...src/app/DPU/common/admin-manage/admin-manage.component.ts
+35
-2
equipments.model.ts
Web-Manage/src/app/DPU/models/equipments.model.ts
+10
-0
equirement.service.ts
Web-Manage/src/app/DPU/services/equirement.service.ts
+19
-1
No files found.
API-Fast/src/controllers/__pycache__/equipment_controller.cpython-312.pyc
View file @
318d51ac
No preview for this file type
API-Fast/src/controllers/equipment_controller.py
View file @
318d51ac
...
...
@@ -23,7 +23,8 @@ async def create_equipment(equipment_data: EquipmentCreate, db: AsyncSession):
equipmentName
=
equipment_data
.
equipmentName
,
description
=
equipment_data
.
description
,
quantity
=
equipment_data
.
quantity
,
is_returnable
=
equipment_data
.
is_returnable
is_returnable
=
equipment_data
.
is_returnable
,
picture
=
equipment_data
.
picture
)
db
.
add
(
new_equipment
)
try
:
...
...
@@ -45,6 +46,8 @@ async def update_equipment(equipment_id: UUID, equipment_data: EquipmentUpdate,
eq_db
.
description
=
equipment_data
.
description
if
equipment_data
.
is_returnable
is
not
None
:
eq_db
.
is_returnable
=
equipment_data
.
is_returnable
if
equipment_data
.
picture
is
not
None
:
eq_db
.
picture
=
equipment_data
.
picture
try
:
await
db
.
commit
()
...
...
API-Fast/src/schemas/__pycache__/equipment_schema.cpython-312.pyc
View file @
318d51ac
No preview for this file type
API-Fast/src/schemas/equipment_schema.py
View file @
318d51ac
...
...
@@ -7,6 +7,7 @@ from datetime import datetime
class
EquipmentBase
(
BaseModel
):
equipmentName
:
str
description
:
Optional
[
str
]
=
None
picture
:
Optional
[
str
]
=
None
quantity
:
int
=
0
is_returnable
:
bool
=
True
...
...
API-Fast/uploaded_images/77acbca3-362b-45c1-a0d7-86259de64219.png
0 → 100644
View file @
318d51ac
520 KB
API-Fast/uploaded_images/7bea0172-778a-4643-8186-4e450a4352c1.png
0 → 100644
View file @
318d51ac
520 KB
API-Fast/uploaded_images/bc569b25-d79d-4244-ae05-fb2eed098f5a.jpg
0 → 100644
View file @
318d51ac
37.7 KB
Web-Manage/src/app/DPU/common/admin-manage/admin-manage.component.html
View file @
318d51ac
...
...
@@ -67,7 +67,8 @@
</div> -->
<div
class=
"xxl:col-span-2 xl:col-span-3 lg:col-span-4 md:col-span-4 sm:col-span-6 col-span-12"
>
<div
class=
"box custom-box"
>
<img
[
src
]="
item
.
getPicture
()"
class=
"!rounded-t-md"
alt=
"..."
>
<img
[
src
]="
item
.
getPicture
()"
class=
"!rounded-t-md"
alt=
"..."
style=
"width: 100%;height: 200px;object-fit: cover;"
>
<div
class=
"flex items-center justify-between nft-like-section w-full px-4"
>
<!-- <div class="flex-grow">
<button type="button" aria-label="button"
...
...
@@ -106,19 +107,14 @@
<div
class=
"box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"
>
<div
class=
"btn-list"
>
<div
class=
"btn-list"
>
<button
type=
"button"
aria-label=
"button"
data-hs-overlay=
"#modal-detail"
<button
type=
"button"
aria-label=
"button"
data-hs-overlay=
"#modal-detail"
(
click
)="
view
(
item
)"
class=
"ti-btn ti-btn-sm ti-btn-primary me-[0.375rem]"
><i
class=
"ri-edit-line"
></i></button>
<button
routerLinkActive=
"active"
type=
"button"
aria-label=
"button"
class=
"ti-btn ti-btn-sm ti-btn-secondary !me-[0.375rem]"
>
<i
class=
"ri-time-line"
></i>
</button>
<button
data-hs-overlay=
"#modal-face"
type=
"button"
aria-label=
"button"
<button
data-hs-overlay=
"#modal-stock"
type=
"button"
aria-label=
"button"
(
click
)="
viewStock
(
item
);"
class=
"ti-btn ti-btn-sm ti-btn-warning me-[0.375rem]"
>
<i
class=
"ri-
account-circl
e-line"
></i>
<i
class=
"ri-
stor
e-line"
></i>
</button>
<button
type=
"button"
aria-label=
"button"
class=
"ti-btn ti-btn-sm ti-btn-danger me-0"
><i
class=
"ri-delete-bin-line"
></i></button>
<button
(
click
)="
delete
(
item
)"
type=
"button"
aria-label=
"button"
class=
"ti-btn ti-btn-sm ti-btn-danger me-0"
><i
class=
"ri-delete-bin-line"
></i></button>
</div>
</div>
</div>
...
...
@@ -141,7 +137,7 @@
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
ข้อมูล
พนักงาน
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
ข้อมูล
อุปกรณ์
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-detail"
>
...
...
@@ -163,16 +159,16 @@
</span>
</div>
</div>
<div
class=
"xl:col-span-
6
col-span-12"
>
<div
class=
"xl:col-span-
12
col-span-12"
>
<label
for=
"deal-name"
class=
"form-label"
>
ชื่ออุปกรณ์
</label>
<input
type=
"text"
class=
"form-control"
id=
"deal-name"
placeholder=
"ชื่ออุปกรณ์"
[(
ngModel
)]="
selectModel
.
equipmentName
"
>
</div>
<div
class=
"xl:col-span-6 col-span-12"
>
<
!-- <
div class="xl:col-span-6 col-span-12">
<label for="deal-name" class="form-label">จำนวน</label>
<input
type=
"
text
"
class=
"form-control"
id=
"deal-name"
placeholder=
"จำนวน"
<input type="
number
" class="form-control" id="deal-name" placeholder="จำนวน"
[(ngModel)]="selectModel.quantity">
</div>
</div>
-->
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-lead-score"
class=
"form-label"
>
รายละเอียด
</label>
<!-- <input type="text" class="form-control" id="deal-lead-score" placeholder="รายละเอียด"
...
...
@@ -182,7 +178,7 @@
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"form-check form-check-lg flex items-center"
>
<input
class=
"form-check-input"
type=
"checkbox"
value=
""
id=
"checkebox-lg"
[(
checked
)]="
selectModel
.
is_returnable
"
>
<input
class=
"form-check-input"
type=
"checkbox"
id=
"checkebox-lg"
[(
ngModel
)]="
selectModel
.
is_returnable
"
>
<label
class=
"form-check-label"
for=
"checkebox-lg"
>
ตรวจสอบการคืน
</label>
...
...
@@ -202,3 +198,67 @@
</div>
</div>
</div>
<!-- Start:: New Deal -->
<div
id=
"modal-stock"
class=
"hs-overlay hidden ti-modal"
*
ngIf=
"selectStock"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out"
>
<div
class=
"ti-modal-content"
>
<div
class=
"ti-modal-header"
>
<h6
class=
"modal-title text-[1rem] font-semibold text-defaulttextcolor"
id=
"mail-ComposeLabel"
>
ข้อมูลอุปกรณ์
</h6>
<button
type=
"button"
class=
"hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay=
"#modal-stock"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ri-close-line"
></i>
</button>
</div>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"grid grid-cols-12 gap-4"
>
<div
class=
"xl:col-span-12 col-span-12"
>
<img
[
src
]="
selectModel
.
getPicture
()"
class=
"!rounded-t-md"
alt=
"..."
style=
"width: 100%;height: auto;object-fit: cover;"
>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-name"
class=
"form-label"
>
ชื่ออุปกรณ์
</label>
<input
readonly
type=
"text"
class=
"form-control"
id=
"deal-name"
placeholder=
"ชื่ออุปกรณ์"
[(
ngModel
)]="
selectModel
.
equipmentName
"
>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-name"
class=
"form-label"
>
จำนวน
</label>
<input
type=
"number"
class=
"form-control"
id=
"deal-name"
placeholder=
"จำนวน"
[(
ngModel
)]="
selectStock
.
quantity
"
>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<div
class=
"form-check form-check-lg flex items-center"
>
<label
for=
"product-availability"
class=
"form-label"
>
ประเภท
</label>
<select
class=
"form-control"
data-trigger
name=
"product-availability"
id=
"product-availability"
[(
ngModel
)]="
selectStock
.
action
"
placeholder=
"Select"
>
<option
value=
"INBOUND"
selected
>
In Stock
</option>
<option
value=
"OUTBOUND"
>
Out Of Stock
</option>
<!-- <option value="OUTBOUND">Out Of Stock</option> -->
</select>
</div>
</div>
<div
class=
"xl:col-span-12 col-span-12"
>
<label
for=
"deal-lead-score"
class=
"form-label"
>
หมายเหตุ
</label>
<!-- <input type="text" class="form-control" id="deal-lead-score" placeholder="รายละเอียด"
[(ngModel)]="selectModel.description"> -->
<textarea
class=
"form-control"
id=
"job-description"
[(
ngModel
)]="
selectStock
.
remark
"
rows=
"4"
></textarea>
</div>
</div>
</div>
<div
class=
"ti-modal-footer"
>
<button
#
closeModalStock
type=
"button"
class=
"hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay=
"#modal-stock"
>
ยกเลิก
</button>
<button
type=
"button"
class=
"ti-btn bg-primary text-white !font-medium"
(
click
)="
saveStock
()"
>
บันทึก
</button>
</div>
</div>
</div>
</div>
Web-Manage/src/app/DPU/common/admin-manage/admin-manage.component.ts
View file @
318d51ac
...
...
@@ -12,7 +12,7 @@ import { TokenService } from "../../../shared/services/token.service";
import
{
FileUploadModule
}
from
'ng2-file-upload'
;
import
{
FileItem
,
FileUploader
,
ParsedResponseHeaders
}
from
"ng2-file-upload"
;
import
{
environment
}
from
"../../../../environments/environment"
;
import
{
EquipmentModel
}
from
"../../models/equipments.model"
;
import
{
EquipmentModel
,
EquipmentStockModel
}
from
"../../models/equipments.model"
;
import
{
EquipmentService
}
from
"../../services/equirement.service"
;
import
{
HttpClient
}
from
"@angular/common/http"
;
...
...
@@ -33,7 +33,7 @@ import { HttpClient } from "@angular/common/http";
})
export
class
AdminManageComponent
{
@
ViewChild
(
'closeModal'
)
public
childModal
?:
ElementRef
;
@
ViewChild
(
'closeModal
Face'
)
public
childModalFace
?:
ElementRef
;
@
ViewChild
(
'closeModal
Stock'
)
public
closeModalStock
?:
ElementRef
;
@
ViewChild
(
'modalDetail'
)
public
modalDetail
?:
ElementRef
;
allSelected
=
false
;
someSelected
=
false
;
...
...
@@ -42,6 +42,7 @@ export class AdminManageComponent {
itemsList
:
EquipmentModel
[]
=
[]
filterList
:
EquipmentModel
[]
=
[]
selectModel
:
EquipmentModel
=
new
EquipmentModel
()
selectStock
?:
EquipmentStockModel
selectedItems
=
new
Map
<
string
,
boolean
>
();
pageIndex
=
0
;
get
searchTerm
():
string
{
...
...
@@ -172,7 +173,16 @@ export class AdminManageComponent {
this
.
selectModel
=
item
}
viewStock
(
item
:
EquipmentModel
)
{
this
.
selectModel
=
item
this
.
selectStock
=
new
EquipmentStockModel
()
this
.
selectStock
.
equipmentId
=
this
.
selectModel
.
equipmentId
this
.
selectStock
.
created_by
=
this
.
tokenService
.
getUser
().
member
.
memberId
this
.
selectStock
.
action
=
"INBOUND"
}
save
()
{
console
.
log
(
this
.
selectModel
)
swal
({
title
:
"Are you sure?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
...
...
@@ -238,4 +248,27 @@ export class AdminManageComponent {
this
.
filterList
=
this
.
itemsList
}
saveStock
()
{
console
.
log
(
this
.
selectStock
)
swal
({
title
:
"Are you sure?"
,
text
:
"คุณต้องการบันทึกหรือไม่"
,
icon
:
"warning"
,
dangerMode
:
false
,
buttons
:
[
"Cancel"
,
"Confirm"
],
})
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
eqService
.
stock
(
this
.
selectStock
!
).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
closeModalStock
?.
nativeElement
.
click
()
})
}
});
}
}
Web-Manage/src/app/DPU/models/equipments.model.ts
View file @
318d51ac
...
...
@@ -28,3 +28,13 @@ export class EquipmentModel extends BaseModel {
return
this
.
picture
?
environment
.
baseUrl
+
'/images/'
+
this
.
picture
:
'./assets/images/faces/111.jpg'
}
}
export
class
EquipmentStockModel
{
equipmentId
:
string
;
quantity
:
number
;
action
:
string
;
remark
:
string
;
created_by
:
string
;
lotId
:
string
;
created_at
:
string
;
}
Web-Manage/src/app/DPU/services/equirement.service.ts
View file @
318d51ac
...
...
@@ -9,7 +9,7 @@ import { map, tap, switchMap, filter, reduce } from "rxjs/operators";
export
class
EquipmentService
{
apiBaseUrl
=
"/equipments"
;
apiBaseUrl
=
"/equipments"
;
constructor
(
private
http
:
HttpClient
)
{
}
...
...
@@ -49,5 +49,23 @@ export class EquipmentService {
}
>
(
this
.
apiBaseUrl
+
"/"
+
body
.
equipmentId
);
}
stock
(
body
:
{
equipmentId
:
string
;
quantity
:
number
;
action
:
string
;
remark
:
string
;
created_by
:
string
;
})
{
return
this
.
http
.
post
<
{
equipmentId
:
string
;
quantity
:
number
;
action
:
string
;
remark
:
string
;
created_by
:
string
;
lotId
:
string
;
created_at
:
string
;
}
>
(
"/inventory-lots"
,
body
);
}
}
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