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
4d1f4a91
Commit
4d1f4a91
authored
Mar 18, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
history
parent
73acfaa5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
8 deletions
+116
-8
admin-project-equirement.component.html
...roject-equirement/admin-project-equirement.component.html
+90
-3
admin-project-equirement.component.ts
...-project-equirement/admin-project-equirement.component.ts
+11
-4
borrow-transactions.ts
Web-Manage/src/app/DPU/models/borrow-transactions.ts
+3
-0
borrow-transactions.service.ts
...anage/src/app/DPU/services/borrow-transactions.service.ts
+12
-1
No files found.
Web-Manage/src/app/DPU/company-management/admin-project-equirement/admin-project-equirement.component.html
View file @
4d1f4a91
...
...
@@ -43,7 +43,8 @@
<div
class=
"flex items-center mb-4"
>
<div>
<p
class=
"text-[.9375rem] font-semibold mb-2"
><a
href=
"javascript:void(0);"
>
{{item.equipment.equipmentName}}
</a></p>
<p
class=
"text-[.9375rem] font-semibold mb-2"
><a
href=
"javascript:void(0);"
>
{{item.equipment.equipmentName}}
</a></p>
<p
class=
"text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0"
>
S/N# {{item.equipment.serialNumber}}
</p>
<p
class=
"text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0"
>
STOCK# {{item.peId}}
</p>
</div>
...
...
@@ -73,7 +74,7 @@
class=
"ti-btn ti-btn-sm ti-btn-warning me-[0.375rem]"
>
<i
class=
"ri-store-line"
></i>
</button>
<button
type=
"button"
aria-label=
"button"
<button
data-hs-overlay=
"#modal-stock-his"
(
click
)="
viewHisStock
(
item
);"
type=
"button"
aria-label=
"button"
class=
"ti-btn ti-btn-sm ti-btn-danger me-0"
><i
class=
"ri-time-line"
></i></button>
</div>
</div>
...
...
@@ -187,7 +188,8 @@
<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-stock"
>
...
...
@@ -250,3 +252,88 @@
</div>
</div>
</div>
<!-- Start:: New Deal -->
<div
id=
"modal-stock-his"
class=
"hs-overlay hidden ti-modal"
*
ngIf=
"selectModel"
>
<div
class=
"hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto"
>
<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-his"
>
<span
class=
"sr-only"
>
Close
</span>
<i
class=
"ri-close-line"
></i>
</button>
</div>
<div
class=
"ti-modal-body px-4"
>
<div
class=
"table-responsive mb-4"
>
<table
class=
"table whitespace-nowrap table-bordered min-w-full"
>
<thead>
<tr>
<th
scope=
"col"
class=
"text-start"
>
พนักงาน
</th>
<th
scope=
"col"
class=
"text-start"
>
จำนวน
</th>
<th
scope=
"col"
class=
"text-start"
>
วันที่ยืม
</th>
<th
scope=
"col"
class=
"text-start"
>
วันที่คืน
</th>
<th
scope=
"col"
class=
"text-start"
>
สถานะ
</th>
<th
scope=
"col"
class=
"text-start"
>
ผู้อนุมัติ
</th>
<th
scope=
"col"
class=
"text-start"
></th>
</tr>
</thead>
<tbody>
@for(product of hisList;track product.peId){
<tr
class=
"product-list"
>
<td>
<div
class=
"flex items-center"
>
<div
class=
"me-2"
>
<!-- <span class="avatar avatar-md avatar-rounded">
<img src={{product.img}} alt="">
</span> -->
</div>
<div
class=
"font-semibold"
>
{{product.memberId}}
</div>
</div>
</td>
<td>
{{product.quantity_borrowed}}
</td>
<td>
{{product.created_at}}
</td>
<td>
{{product.returned_date}}
</td>
<td>
{{product.status}}
</td>
<td>
{{product.approved_by}}
</td>
<!-- <td>
<span class="badge bg-light text-default"> {{product.category}}</span>
</td>
<td>{{product.price}}</td>
<td>{{product.stock}}</td>
<td>{{product.gender}}</td>
<td>{{product.seller}}</td>
<td> {{product.published}}</td> -->
<td>
<!-- <div class="flex flex-row items-center !gap-2 text-[0.9375rem]">
<a aria-label="anchor" routerLink="/pages/ecommerce/editproducts"
class="ti-btn ti-btn-wave !gap-0 !m-0 !h-[1.75rem] !w-[1.75rem] text-[0.8rem] 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)="click(product.id)"
class="ti-btn ti-btn-wave product-btn !gap-0 !m-0 !h-[1.75rem] !w-[1.75rem] text-[0.8rem] bg-danger/10 text-danger hover:bg-danger hover:text-white hover:border-danger"><i
class="ri-delete-bin-line"></i></a>
</div> -->
</td>
</tr>
}
</tbody>
</table>
</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-his"
>
ปิด
</button>
</div>
</div>
</div>
</div>
Web-Manage/src/app/DPU/company-management/admin-project-equirement/admin-project-equirement.component.ts
View file @
4d1f4a91
...
...
@@ -72,7 +72,8 @@ export class AdminProjectEquirementComponent {
_searchTerm
=
""
;
isEdit
=
false
;
empList
:
ProjectMemberModel
[]
=
[]
constructor
(
private
http
:
HttpClient
,
private
eqService
:
EquipmentService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
projectEquipmentService
:
ProjectEquipmentService
,
private
borrowTransactionsService
:
BorrowTransactionsService
,
private
projectMemberService
:
ProjectMemberService
)
{
hisList
:
BorrowTransactionsModel
[]
=
[]
constructor
(
private
http
:
HttpClient
,
private
eqService
:
EquipmentService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
projectEquipmentService
:
ProjectEquipmentService
,
private
borrowTransactionsService
:
BorrowTransactionsService
,
private
projectMemberService
:
ProjectMemberService
)
{
this
.
projectId
=
this
.
tokenService
.
getSelectCompany
().
projectId
!
;
}
...
...
@@ -160,6 +161,12 @@ export class AdminProjectEquirementComponent {
// this.selectStock.action = "INBOUND"
}
viewHisStock
(
item
:
ProjectEquipmentModel
)
{
this
.
borrowTransactionsService
.
search
(
item
.
peId
).
subscribe
(
result
=>
{
this
.
hisList
=
result
})
}
// save() {
// console.log(this.selectModel)
// swal({
...
...
@@ -225,16 +232,16 @@ export class AdminProjectEquirementComponent {
.
then
((
willDelete
:
any
)
=>
{
if
(
willDelete
)
{
this
.
borrowTransactionsService
.
save
({
"peId"
:
this
.
selectModel
.
peId
,
"peId"
:
this
.
selectModel
.
peId
,
"quantity_borrowed"
:
this
.
borrowSelect
.
quantity_borrowed
,
"status"
:
"approved"
,
"memberId"
:
this
.
borrowSelect
.
memberId
,
"approved_by"
:
this
.
tokenService
.
getUser
().
member
.
memberId
"approved_by"
:
this
.
tokenService
.
getUser
().
member
.
memberId
}).
subscribe
(
result
=>
{
swal
(
"Save Success!!"
,
"บันทึกข้อมูลสำเร็จ"
,
"success"
);
this
.
ngOnInit
()
this
.
closeModalStock
?.
nativeElement
.
click
()
},
(
error
:
any
)
=>
{
},
(
error
:
any
)
=>
{
swal
(
"Fail!!"
,
error
.
error
.
detail
,
"info"
);
})
}
...
...
Web-Manage/src/app/DPU/models/borrow-transactions.ts
View file @
4d1f4a91
...
...
@@ -9,6 +9,7 @@ export class BorrowTransactionsModel extends BaseModel {
created_at
:
string
;
peId
:
string
;
memberId
:
string
;
approved_by
:
string
;
constructor
(
data
?:
Partial
<
BorrowTransactionsModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
);
...
...
@@ -17,5 +18,7 @@ export class BorrowTransactionsModel extends BaseModel {
this
.
quantity_borrowed
=
data
?.
quantity_borrowed
??
0
;
this
.
status
=
data
?.
status
??
''
;
this
.
returned_date
=
data
?.
returned_date
??
''
this
.
memberId
=
data
?.
memberId
??
''
this
.
approved_by
=
data
?.
approved_by
??
''
}
}
Web-Manage/src/app/DPU/services/borrow-transactions.service.ts
View file @
4d1f4a91
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
HttpClient
,
HttpParams
}
from
'@angular/common/http'
;
import
{
map
,
tap
,
switchMap
,
filter
,
reduce
}
from
"rxjs/operators"
;
import
{
BorrowTransactionsModel
}
from
'../models/borrow-transactions'
;
import
{
environment
}
from
'../../../environments/environment'
;
...
...
@@ -47,6 +47,17 @@ export class BorrowTransactionsService {
}
>
(
this
.
apiBaseUrl
+
"/"
+
body
.
borrowId
);
}
search
(
peId
:
string
,
memberId
?:
string
)
{
const
params
=
new
HttpParams
()
.
set
(
'peId'
,
peId
)
.
set
(
'memberId'
,
memberId
!
)
return
this
.
http
.
get
<
BorrowTransactionsModel
[]
>
(
`
${
this
.
apiBaseUrl
}
/search/borrow`
,
{
params
})
.
pipe
(
map
((
e
)
=>
e
.
map
((
e
)
=>
new
BorrowTransactionsModel
(
e
)))
);
}
}
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