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
501292e2
Commit
501292e2
authored
Mar 18, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
borrow emp
parent
58c98b56
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
10 deletions
+117
-10
admin-project-emp-manage.component.html
...roject-emp-manage/admin-project-emp-manage.component.html
+92
-2
admin-project-emp-manage.component.ts
...-project-emp-manage/admin-project-emp-manage.component.ts
+11
-1
admin-project-equirement.component.ts
...-project-equirement/admin-project-equirement.component.ts
+1
-1
borrow-transactions.ts
Web-Manage/src/app/DPU/models/borrow-transactions.ts
+3
-2
borrow-transactions.service.ts
...anage/src/app/DPU/services/borrow-transactions.service.ts
+10
-4
No files found.
Web-Manage/src/app/DPU/company-management/admin-project-emp-manage/admin-project-emp-manage.component.html
View file @
501292e2
...
...
@@ -104,6 +104,13 @@
<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>
<a
data-hs-overlay=
"#modal-stock-his"
aria-label=
"anchor"
href=
"javascript:void(0);"
(
click
)="
viewHisStock
(
item
.
member
)"
class=
"ti-btn ti-btn-wave product-btn !gap-0 !m-0 bg-success/10 text-success hover:bg-success hover:text-white hover:border-success"
><i
class=
"ri-time-line"
></i></a>
<!-- <button data-hs-overlay="#modal-stock-his" (click)="viewHisStock(item.member);" type="button"
aria-label="button" class="ti-btn ti-btn-sm ti-btn-danger me-0"><i
class="ri-time-line"></i></button> -->
</div>
</td>
</tr>
...
...
@@ -210,8 +217,8 @@
class="ri-delete-bin-line"></i></a>
</div> -->
<a
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(
click
)="
selectMember
(
item
)"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{
'เลือก' |
(
click
)="
selectMember
(
item
)"
><i
class=
"ri-add-line font-semibold align-middle"
></i>
{{
'เลือก' |
translate}}
</a>
</td>
...
...
@@ -315,3 +322,86 @@
</div>
</div>
<!-- End:: Create Contact -->
<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"
>
<img
[
src
]="
product
.
project_equipment
.
equipment
.
getPicture
()"
class=
"!rounded-t-md"
alt=
"..."
>
</div>
<div
class=
"font-semibold"
>
{{product.project_equipment.equipment.equipmentName}}
</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_member.getFullname()}}
</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-emp-manage/admin-project-emp-manage.component.ts
View file @
501292e2
...
...
@@ -15,6 +15,9 @@ import { ProjectMemberService } from "../../services/project-members.service";
import
{
ProjectMemberModel
}
from
"../../models/project-members"
;
import
{
UserService
}
from
"../../services/user.service"
;
import
{
UserProfileModel
}
from
"../../models/user.model"
;
import
{
ProjectEquipmentModel
}
from
"../../models/project-equipments"
;
import
{
BorrowTransactionsService
}
from
"../../services/borrow-transactions.service"
;
import
{
BorrowTransactionsModel
}
from
"../../models/borrow-transactions"
;
@
Component
({
selector
:
'app-admin-project-emp-manage'
,
standalone
:
true
,
...
...
@@ -62,7 +65,8 @@ export class AdminProjectEmpManageComponent {
}
projectId
=
""
_searchTerm
=
""
;
constructor
(
private
projectMemberService
:
ProjectMemberService
,
private
userService
:
UserService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
)
{
hisList
:
BorrowTransactionsModel
[]
=
[]
constructor
(
private
projectMemberService
:
ProjectMemberService
,
private
userService
:
UserService
,
public
translate
:
TranslateService
,
private
tokenService
:
TokenService
,
private
borrowTransactionsService
:
BorrowTransactionsService
)
{
this
.
projectId
=
this
.
tokenService
.
getSelectCompany
().
projectId
!
;
this
.
getUserProject
()
this
.
getMemberAll
()
...
...
@@ -134,6 +138,12 @@ export class AdminProjectEmpManageComponent {
// })
}
viewHisStock
(
item
:
UserProfileModel
)
{
this
.
borrowTransactionsService
.
search
({
"member_id"
:
item
.
memberId
}).
subscribe
(
result
=>
{
this
.
hisList
=
result
})
}
getUserProject
()
{
this
.
projectMemberService
.
getLists
(
this
.
projectId
).
subscribe
(
result
=>
{
this
.
itemsList
=
result
...
...
Web-Manage/src/app/DPU/company-management/admin-project-equirement/admin-project-equirement.component.ts
View file @
501292e2
...
...
@@ -162,7 +162,7 @@ export class AdminProjectEquirementComponent {
}
viewHisStock
(
item
:
ProjectEquipmentModel
)
{
this
.
borrowTransactionsService
.
search
(
item
.
peId
).
subscribe
(
result
=>
{
this
.
borrowTransactionsService
.
search
(
{
"peId"
:
item
.
peId
}
).
subscribe
(
result
=>
{
this
.
hisList
=
result
})
}
...
...
Web-Manage/src/app/DPU/models/borrow-transactions.ts
View file @
501292e2
...
...
@@ -2,6 +2,7 @@ import { TranslateService } from "@ngx-translate/core";
import
{
BaseModel
}
from
"./base.model"
;
import
{
UserProfileModel
}
from
"./user.model"
;
import
{
EquipmentModel
}
from
"./equipments.model"
;
import
{
ProjectEquipmentModel
}
from
"./project-equipments"
;
export
class
BorrowTransactionsModel
extends
BaseModel
{
peId
:
string
;
...
...
@@ -13,7 +14,7 @@ export class BorrowTransactionsModel extends BaseModel {
borrowId
:
string
;
created_at
:
string
;
member
:
UserProfileModel
;
project_equipment
:
EquipmentModel
;
project_equipment
:
Project
EquipmentModel
;
approved_by_member
:
UserProfileModel
;
constructor
(
data
?:
Partial
<
BorrowTransactionsModel
>
,
translateService
?:
TranslateService
)
{
...
...
@@ -27,6 +28,6 @@ export class BorrowTransactionsModel extends BaseModel {
this
.
approved_by
=
data
?.
approved_by
??
''
this
.
member
=
data
?.
member
?
new
UserProfileModel
(
data
.
member
)
:
new
UserProfileModel
();
this
.
approved_by_member
=
data
?.
approved_by_member
?
new
UserProfileModel
(
data
.
approved_by_member
)
:
new
UserProfileModel
();
this
.
project_equipment
=
data
?.
project_equipment
?
new
EquipmentModel
(
data
.
project_equipment
)
:
new
EquipmentModel
();
this
.
project_equipment
=
data
?.
project_equipment
?
new
ProjectEquipmentModel
(
data
.
project_equipment
)
:
new
Project
EquipmentModel
();
}
}
Web-Manage/src/app/DPU/services/borrow-transactions.service.ts
View file @
501292e2
...
...
@@ -47,10 +47,16 @@ export class BorrowTransactionsService {
}
>
(
this
.
apiBaseUrl
+
"/"
+
body
.
borrowId
);
}
search
(
peId
:
string
,
memberId
?:
string
)
{
const
params
=
new
HttpParams
()
.
set
(
'peId'
,
peId
)
.
set
(
'memberId'
,
memberId
!
)
search
(
params
:
any
)
{
// const params = new HttpParams()
// if(peId){
// params.set('peId', peId!)
// }
// if(memberId){
// params.set('member_Id', memberId!)
// }
// .set('peId', peId!)
// .set('member_Id', memberId!)
return
this
.
http
.
get
<
BorrowTransactionsModel
[]
>
(
`
${
this
.
apiBaseUrl
}
/search/borrow`
,
{
params
})
.
pipe
(
...
...
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