Commit 0d0c4672 by DESKTOP-E0VCCBD\zedan

update

parent 501292e2
...@@ -173,6 +173,11 @@ ...@@ -173,6 +173,11 @@
<input type="text" class="form-control" id="deal-name" placeholder="S/N" <input type="text" class="form-control" id="deal-name" placeholder="S/N"
[(ngModel)]="selectModel.serialNumber"> [(ngModel)]="selectModel.serialNumber">
</div> </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)]="selectModel.quantity">
</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> <label for="deal-name" class="form-label">จำนวน</label>
<input type="number" class="form-control" id="deal-name" placeholder="จำนวน" <input type="number" class="form-control" id="deal-name" placeholder="จำนวน"
......
...@@ -165,6 +165,7 @@ export class AdminManageComponent { ...@@ -165,6 +165,7 @@ export class AdminManageComponent {
new() { new() {
this.isEdit = false this.isEdit = false
this.selectModel = new EquipmentModel() this.selectModel = new EquipmentModel()
} }
view(item: EquipmentModel) { view(item: EquipmentModel) {
......
...@@ -29,12 +29,15 @@ export const admin: Routes = [ ...@@ -29,12 +29,15 @@ export const admin: Routes = [
loadComponent: () => loadComponent: () =>
import('./admin-manage/admin-manage.component').then((m) => m.AdminManageComponent), import('./admin-manage/admin-manage.component').then((m) => m.AdminManageComponent),
}, },
//////////////emp///////////////// //////////////emp/////////////////
{ {
path: 'borrow-management', path: 'borrow-management',
loadComponent: () => loadComponent: () =>
import('./borrow-management/borrow-management.component').then((m) => m.BorrowManagementComponent), import('./borrow-management/borrow-management.component').then((m) => m.BorrowManagementComponent),
} }
] ]
} }
]; ];
......
...@@ -97,8 +97,15 @@ ...@@ -97,8 +97,15 @@
<div class="font-semibold mb-1">ติดต่อ :</div> <div class="font-semibold mb-1">ติดต่อ :</div>
<span class="badge bg-success/10 text-success">{{item.contact}}</span> <span class="badge bg-success/10 text-success">{{item.contact}}</span>
</div> </div>
<div>
<button data-hs-overlay="#modal-stock" type="button" aria-label="button" title="View" routerLink="/company/home/{{item.projectId}}"
class="ti-btn ti-btn-sm ti-btn-light me-[0.375rem]">
<i class="fe fe-eye"></i>
</button>
</div> </div>
</div> </div>
</div>
<!-- <div class="box-footer flex items-center justify-between"> <!-- <div class="box-footer flex items-center justify-between">
<div> <div>
<span class="text-[#8c9097] dark:text-white/50 text-[0.6875rem] block">ผู้รับผิดชอบ :</span> <span class="text-[#8c9097] dark:text-white/50 text-[0.6875rem] block">ผู้รับผิดชอบ :</span>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
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>{{ 'Create' |
translate}} translate}}
</a> </a>
<a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-success-full me-2" *ngIf="someSelected" <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' | (click)="adjustSelect(1)"><i class="ri-user-follow-line font-semibold align-middle"></i>{{ 'Active' |
translate}} translate}}
...@@ -215,7 +214,7 @@ ...@@ -215,7 +214,7 @@
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-title" class="form-label">{{'Username' | translate}}</label> <label for="deal-title" class="form-label">{{'Username' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectModel.username"> <input type="text" class="form-control" id="deal-title" placeholder="กรอก{{'Username' | translate}}" [(ngModel)]="selectModel.username">
<div class="text-danger" *ngIf="!selectModel.username"> <div class="text-danger" *ngIf="!selectModel.username">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
</div> </div>
...@@ -223,7 +222,7 @@ ...@@ -223,7 +222,7 @@
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-title" class="form-label">{{'Password' | translate}}</label> <label for="deal-title" class="form-label">{{'Password' | translate}}</label>
<input type="password" class="form-control" id="deal-title" placeholder="" <input type="password" class="form-control" id="deal-title" placeholder="กรอก{{'Password' | translate}}"
[(ngModel)]="selectModel.password"> [(ngModel)]="selectModel.password">
<div class="text-danger" *ngIf="!selectModel.password"> <div class="text-danger" *ngIf="!selectModel.password">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
...@@ -232,7 +231,7 @@ ...@@ -232,7 +231,7 @@
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-title" class="form-label">{{'Confirm Password' | translate}}</label> <label for="deal-title" class="form-label">{{'Confirm Password' | translate}}</label>
<input type="password" class="form-control" id="deal-title" placeholder="" [(ngModel)]="confirmPassword"> <input type="password" class="form-control" id="deal-title" placeholder="{{'Confirm Password' | translate}}" [(ngModel)]="confirmPassword">
<div class="text-danger" *ngIf="!confirmPassword"> <div class="text-danger" *ngIf="!confirmPassword">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
</div> </div>
...@@ -243,7 +242,7 @@ ...@@ -243,7 +242,7 @@
<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-title" class="form-label">{{'ชื่อ' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectModel.firstName"> <input type="text" class="form-control" id="deal-title" placeholder="กรอก{{'ชื่อ' | translate}}" [(ngModel)]="selectModel.firstName">
<div class="text-danger" *ngIf="!selectModel.firstName"> <div class="text-danger" *ngIf="!selectModel.firstName">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
</div> </div>
...@@ -251,7 +250,7 @@ ...@@ -251,7 +250,7 @@
<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-title" class="form-label">{{'นามสกุล' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectModel.lastName"> <input type="text" class="form-control" id="deal-title" placeholder="กรอก{{'นามสกุล' | translate}}" [(ngModel)]="selectModel.lastName">
<div class="text-danger" *ngIf="!selectModel.lastName"> <div class="text-danger" *ngIf="!selectModel.lastName">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
</div> </div>
...@@ -259,7 +258,7 @@ ...@@ -259,7 +258,7 @@
<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-title" class="form-label">{{'อีเมล' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" [(ngModel)]="selectModel.email"> <input type="text" class="form-control" id="deal-title" placeholder="กรอก{{'อีเมล' | translate}}" [(ngModel)]="selectModel.email">
<div class="text-danger" *ngIf="!selectModel.email"> <div class="text-danger" *ngIf="!selectModel.email">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
</div> </div>
...@@ -268,7 +267,7 @@ ...@@ -268,7 +267,7 @@
<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-title" class="form-label">{{'เบอร์ติดต่อ' | translate}}</label>
<input type="text" class="form-control" id="deal-title" placeholder="" <input type="text" class="form-control" id="deal-title" placeholder="กรอก{{'เบอร์ติดต่อ' | translate}}"
[(ngModel)]="selectModel.phoneNumber"> [(ngModel)]="selectModel.phoneNumber">
<div class="text-danger" *ngIf="!selectModel.phoneNumber"> <div class="text-danger" *ngIf="!selectModel.phoneNumber">
{{'Please fill in information' | translate}} {{'Please fill in information' | translate}}
...@@ -278,7 +277,7 @@ ...@@ -278,7 +277,7 @@
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="form-label">{{'User Role' | translate}}</label> <label class="form-label">{{'User Role' | translate}}</label>
<ng-select name="choices-multiple-remove-button1" id="choices-multiple-remove-button1" placeholder="" <ng-select name="choices-multiple-remove-button1" id="choices-multiple-remove-button1" placeholder="เลือก"
[(ngModel)]="selectModel.role"> [(ngModel)]="selectModel.role">
<ng-option [value]="0">{{'ผู้ใช้งานทั่วไป' | translate}}</ng-option> <ng-option [value]="0">{{'ผู้ใช้งานทั่วไป' | translate}}</ng-option>
<ng-option [value]="1">{{'ผู้ดูแลบริษัท' | translate}}</ng-option> <ng-option [value]="1">{{'ผู้ดูแลบริษัท' | translate}}</ng-option>
...@@ -286,7 +285,7 @@ ...@@ -286,7 +285,7 @@
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label class="form-label">{{'Status' | translate}}</label> <label class="form-label">{{'Status' | translate}}</label>
<ng-select name="choices-multiple-remove-button2" id="choices-multiple-remove-button2" placeholder="" <ng-select name="choices-multiple-remove-button2" id="choices-multiple-remove-button2" placeholder="เลือก"
[(ngModel)]="selectModel.status"> [(ngModel)]="selectModel.status">
<ng-option [value]="0">{{'Unactive' | translate}}</ng-option> <ng-option [value]="0">{{'Unactive' | translate}}</ng-option>
<ng-option [value]="1">{{'Active' | translate}}</ng-option> <ng-option [value]="1">{{'Active' | translate}}</ng-option>
......
...@@ -162,6 +162,7 @@ export class UserSettingComponent { ...@@ -162,6 +162,7 @@ export class UserSettingComponent {
this.selectModel = new UserProfileModel() this.selectModel = new UserProfileModel()
} }
view(item: UserProfileModel) { view(item: UserProfileModel) {
this.action = 'edit' this.action = 'edit'
this.confirmPassword = '' this.confirmPassword = ''
......
<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-x-6">
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<div class="box mt-6"> <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 }}
class="badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle">{{itemsList.length}}</span> <span
class="badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle"
>{{ itemsList.length }}</span
>
</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" <a
data-hs-overlay="#modal-detail"><i class="ri-add-line font-semibold align-middle"></i>{{ 'เพิ่ม' | href="javascript:void(0);"
translate}} class="hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
data-hs-overlay="#modal-detail"
><i class="ri-add-line font-semibold align-middle"></i
>{{ "เพิ่ม" | translate }}
</a> </a>
<div> <div>
<input [(ngModel)]='searchTerm' class="form-control form-control" type="text" <input
placeholder="{{ 'ค้นหาอุปกรณ์' | translate}}" aria-label=".form-control-sm example"> [(ngModel)]="searchTerm"
class="form-control form-control"
type="text"
placeholder="{{ 'ค้นหาอุปกรณ์' | translate }}"
aria-label=".form-control-sm example"
/>
</div> </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>
...@@ -33,26 +48,41 @@ ...@@ -33,26 +48,41 @@
</div> </div>
</div> </div>
@for(item of filterList;track filterList){ @for(item of filterList;track filterList){
<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="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"> <div class="box custom-box">
<img [src]="item.equipment.getPicture()" class="!rounded-t-md" alt="..." <img
style="width: 100%;height: 200px;object-fit: cover;"> [src]="item.equipment.getPicture()"
<div class="flex items-center justify-between nft-like-section w-full px-4"> class="!rounded-t-md"
</div> alt="..."
style="width: 100%; height: 200px; object-fit: cover"
/>
<div
class="flex items-center justify-between nft-like-section w-full px-4"
></div>
<div class="box-body"> <div class="box-body">
<div class="flex items-center mb-4"> <div class="flex items-center mb-4">
<div> <div>
<p class="text-[.9375rem] font-semibold mb-2"><a <p class="text-[.9375rem] font-semibold mb-2">
href="javascript:void(0);">{{item.equipment.equipmentName}}</a></p> <a href="javascript:void(0);">{{
<p class="text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0">S/N# {{item.equipment.serialNumber}}</p> item.equipment.equipmentName
<p class="text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0">STOCK# {{item.peId}}</p> }}</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> </div>
</div> </div>
<div class="flex flex-wrap align-itesm-center justify-between"> <div class="flex flex-wrap align-itesm-center justify-between">
<div class="font-semibold mb-1">รายละเอียด :</div> <div class="font-semibold mb-1">รายละเอียด :</div>
<p class="text-[#8c9097] dark:text-white/50 mb-3">{{item.equipment.description}}</p> <p class="text-[#8c9097] dark:text-white/50 mb-3">
{{ item.equipment.description }}
</p>
<!-- <div class="flex flex-wrap items-center leading-none"> <!-- <div class="flex flex-wrap items-center leading-none">
<span class="avatar avatar-xs me-1"> <span class="avatar avatar-xs me-1">
<img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt=""> <img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt="">
...@@ -61,21 +91,37 @@ ...@@ -61,21 +91,37 @@
</div> </div>
<div class="flex flex-wrap align-itesm-center justify-between mb-2"> <div class="flex flex-wrap align-itesm-center justify-between mb-2">
<div class="font-semibold mb-1">จำนวน :</div> <div class="font-semibold mb-1">จำนวน :</div>
<h3 class="text-[#8c9097] dark:text-white/50">{{item.quantity_in_project}}</h3> <h3 class="text-[#8c9097] dark:text-white/50">
{{ item.quantity_in_project }}
</h3>
</div> </div>
<!-- <div class="grid"> <!-- <div class="grid">
<button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button> <button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button>
</div> --> </div> -->
</div> </div>
<div class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"> <div
class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"
>
<div class="btn-list"> <div class="btn-list">
<div class="btn-list"> <div class="btn-list">
<button data-hs-overlay="#modal-stock" type="button" aria-label="button" (click)="viewStock(item);" <button
class="ti-btn ti-btn-sm ti-btn-warning me-[0.375rem]"> 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-store-line"></i> <i class="ri-store-line"></i>
</button> </button>
<button data-hs-overlay="#modal-stock-his" (click)="viewHisStock(item);" type="button" aria-label="button" <button
class="ti-btn ti-btn-sm ti-btn-danger me-0"><i class="ri-time-line"></i></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>
</div> </div>
</div> </div>
...@@ -84,17 +130,24 @@ ...@@ -84,17 +130,24 @@
} }
</div> </div>
<!-- Start:: New Deal --> <!-- Start:: New Deal -->
<div id="modal-detail" class="hs-overlay hidden ti-modal"> <div id="modal-detail" class="hs-overlay hidden ti-modal">
<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="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-content">
<div class="ti-modal-header"> <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> </h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor" <button
data-hs-overlay="#modal-detail"> type="button"
class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay="#modal-detail"
>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
<i class="ri-close-line"></i> <i class="ri-close-line"></i>
</button> </button>
...@@ -119,48 +172,73 @@ ...@@ -119,48 +172,73 @@
</div> </div>
</div> --> </div> -->
@for(item of filterListAll;track filterListAll){ @for(item of filterListAll;track filterListAll){
<div class="xxl:col-span-3 xl:col-span-3 lg:col-span-3 md:col-span-3 sm:col-span-6 col-span-12"> <div
class="xxl:col-span-3 xl:col-span-3 lg:col-span-3 md:col-span-3 sm:col-span-6 col-span-12"
>
<div class="box custom-box"> <div class="box custom-box">
<img [src]="item.getPicture()" class="!rounded-t-md" alt="..." <img
style="width: 100%;height: 200px;object-fit: cover;"> [src]="item.getPicture()"
<div class="flex items-center justify-between nft-like-section w-full px-4"> class="!rounded-t-md"
</div> alt="..."
style="width: 100%; height: 200px; object-fit: cover"
/>
<div
class="flex items-center justify-between nft-like-section w-full px-4"
></div>
<div class="box-body"> <div class="box-body">
<div class="flex items-center mb-4"> <div class="flex items-center mb-4">
<div> <div>
<p class="text-[.9375rem] font-semibold mb-2"><a <p class="text-[.9375rem] font-semibold mb-2">
href="javascript:void(0);">{{item.equipmentName}}</a></p> <a href="javascript:void(0);">{{ item.equipmentName }}</a>
<p class="text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0">S/N# {{item.serialNumber}}</p> </p>
<p
class="text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0"
>
S/N# {{ item.serialNumber }}
</p>
</div> </div>
</div> </div>
<div class="flex flex-wrap align-itesm-center justify-between"> <div class="flex flex-wrap align-itesm-center justify-between">
<div class="font-semibold mb-1">รายละเอียด :</div> <div class="font-semibold mb-1">รายละเอียด :</div>
<p class="text-[#8c9097] dark:text-white/50 mb-3">{{item.description}}</p> <p class="text-[#8c9097] dark:text-white/50 mb-3">
{{ item.description }}
</p>
<!-- <div class="flex flex-wrap items-center leading-none"> <!-- <div class="flex flex-wrap items-center leading-none">
<span class="avatar avatar-xs me-1"> <span class="avatar avatar-xs me-1">
<img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt=""> <img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt="">
</span>0.24ETH </span>0.24ETH
</div> --> </div> -->
</div> </div>
<div class="flex flex-wrap align-itesm-center justify-between mb-2"> <div
class="flex flex-wrap align-itesm-center justify-between mb-2"
>
<div class="font-semibold mb-1">จำนวน :</div> <div class="font-semibold mb-1">จำนวน :</div>
<!-- <h3 class="text-[#8c9097] dark:text-white/50">{{item.quantity}}</h3> --> <!-- <h3 class="text-[#8c9097] dark:text-white/50">{{item.quantity}}</h3> -->
<input type="number" class="form-control" id="deal-name" placeholder="จำนวน" <input
[(ngModel)]="item.quantity"> type="number"
class="form-control"
id="deal-name"
placeholder="จำนวน"
[(ngModel)]="item.quantity"
/>
</div> </div>
<!-- <div class="grid"> <!-- <div class="grid">
<button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button> <button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button>
</div> --> </div> -->
</div> </div>
<div class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"> <div
class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center"
>
<div class="btn-list"> <div class="btn-list">
<div class="btn-list"> <div class="btn-list">
<a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-primary-full me-2" <a
(click)="stock(item)"><i class="ri-add-line font-semibold align-middle"></i>{{ 'นำเข้า' | href="javascript:void(0);"
translate}} class="hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(click)="stock(item)"
><i class="ri-add-line font-semibold align-middle"></i
>{{ "นำเข้า" | translate }}
</a> </a>
</div> </div>
</div> </div>
...@@ -171,8 +249,12 @@ ...@@ -171,8 +249,12 @@
</div> </div>
</div> </div>
<div class="ti-modal-footer"> <div class="ti-modal-footer">
<button #closeModal type="button" class="hs-dropdown-toggle ti-btn ti-btn-light align-middle" <button
data-hs-overlay="#modal-detail"> #closeModal
type="button"
class="hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay="#modal-detail"
>
ยกเลิก ยกเลิก
</button> </button>
<!-- <button type="button" class="ti-btn bg-primary text-white !font-medium" (click)="save()">บันทึก</button> --> <!-- <button type="button" class="ti-btn bg-primary text-white !font-medium" (click)="save()">บันทึก</button> -->
...@@ -181,18 +263,22 @@ ...@@ -181,18 +263,22 @@
</div> </div>
</div> </div>
<!-- Start:: New Deal --> <!-- Start:: New Deal -->
<div id="modal-stock" class="hs-overlay hidden ti-modal" *ngIf="selectModel"> <div id="modal-stock" class="hs-overlay hidden ti-modal" *ngIf="selectModel">
<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"> <h6
class="modal-title text-[1rem] font-semibold text-defaulttextcolor"
id="mail-ComposeLabel"
>
การยืม/ข้อมูลอุปกรณ์ การยืม/ข้อมูลอุปกรณ์
</h6> </h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor" <button
data-hs-overlay="#modal-stock"> type="button"
class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay="#modal-stock"
>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
<i class="ri-close-line"></i> <i class="ri-close-line"></i>
</button> </button>
...@@ -200,36 +286,67 @@ ...@@ -200,36 +286,67 @@
<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">
<img [src]="selectModel.equipment.getPicture()" class="!rounded-t-md" alt="..." <img
style="width: 100%;height: auto;object-fit: cover;"> [src]="selectModel.equipment.getPicture()"
class="!rounded-t-md"
alt="..."
style="width: 100%; height: auto; object-fit: cover"
/>
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-name" class="form-label">ชื่ออุปกรณ์</label> <label for="deal-name" class="form-label">ชื่ออุปกรณ์</label>
<input readonly type="text" class="form-control" id="deal-name" placeholder="ชื่ออุปกรณ์" <input
[(ngModel)]="selectModel.equipment.equipmentName"> readonly
type="text"
class="form-control"
id="deal-name"
placeholder="ชื่ออุปกรณ์"
[(ngModel)]="selectModel.equipment.equipmentName"
/>
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-name" class="form-label">S/N</label> <label for="deal-name" class="form-label">S/N</label>
<input readonly type="text" class="form-control" id="deal-name" placeholder="S/N" <input
[(ngModel)]="selectModel.equipment.serialNumber"> readonly
type="text"
class="form-control"
id="deal-name"
placeholder="S/N"
[(ngModel)]="selectModel.equipment.serialNumber"
/>
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="deal-name" class="form-label">จำนวนยืม</label> <label for="deal-name" class="form-label">จำนวนยืม</label>
<input type="number" class="form-control" id="deal-name" placeholder="จำนวนยืม" <input
[(ngModel)]="borrowSelect.quantity_borrowed"> type="number"
class="form-control"
id="deal-name"
placeholder="จำนวนยืม"
[(ngModel)]="borrowSelect.quantity_borrowed"
/>
</div> </div>
<div class="xl:col-span-12 col-span-12"> <div class="xl:col-span-12 col-span-12">
<label for="input-label" class="form-label">{{ "พนักงานที่ยืม" | translate}}</label> <label for="input-label" class="form-label">{{
"พนักงานที่ยืม" | translate
}}</label>
<!-- <ng-select [items]="customerList" bindLabel="companyThName" [(ngModel)]="projectModel.customer"> <!-- <ng-select [items]="customerList" bindLabel="companyThName" [(ngModel)]="projectModel.customer">
</ng-select> --> </ng-select> -->
<ng-select #selectCustomer [items]="empList" bindLabel="member.firstName" bindValue="memberId" <ng-select
[(ngModel)]="borrowSelect.memberId"> #selectCustomer
[items]="empList"
bindLabel="member.firstName"
bindValue="memberId"
[(ngModel)]="borrowSelect.memberId"
>
<ng-template ng-header-tmp> <ng-template ng-header-tmp>
<input style="width: 100%; line-height: 24px" type="text" <input
(input)="selectCustomer.filter($any($event.target).value)" /> style="width: 100%; line-height: 24px"
type="text"
(input)="selectCustomer.filter($any($event.target).value)"
/>
</ng-template> </ng-template>
</ng-select> </ng-select>
<!-- <select class="mb-4 sm:mb-0 form-select !py-3" id="inlineFormSelectPref" <!-- <select class="mb-4 sm:mb-0 form-select !py-3" id="inlineFormSelectPref"
...@@ -238,32 +355,51 @@ ...@@ -238,32 +355,51 @@
<option *ngFor="let item of customerList" [ngValue]="item">{{item.getCompanyName()}}</option> <option *ngFor="let item of customerList" [ngValue]="item">{{item.getCompanyName()}}</option>
</select> --> </select> -->
</div> </div>
</div> </div>
</div> </div>
<div class="ti-modal-footer"> <div class="ti-modal-footer">
<button #closeModalStock type="button" class="hs-dropdown-toggle ti-btn ti-btn-light align-middle" <button
data-hs-overlay="#modal-stock"> #closeModalStock
type="button"
class="hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay="#modal-stock"
>
ยกเลิก ยกเลิก
</button> </button>
<button type="button" class="ti-btn bg-primary text-white !font-medium" (click)="saveBorrow()">บันทึก</button> <button
type="button"
class="ti-btn bg-primary text-white !font-medium"
(click)="saveBorrow()"
>
บันทึก
</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Start:: New Deal --> <!-- Start:: New Deal -->
<div id="modal-stock-his" class="hs-overlay hidden ti-modal" *ngIf="selectModel"> <div
<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"> 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-content">
<div class="ti-modal-header"> <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> </h6>
<button type="button" class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor" <button
data-hs-overlay="#modal-stock-his"> type="button"
class="hs-dropdown-toggle !text-[1rem] !font-semibold !text-defaulttextcolor"
data-hs-overlay="#modal-stock-his"
>
<span class="sr-only">Close</span> <span class="sr-only">Close</span>
<i class="ri-close-line"></i> <i class="ri-close-line"></i>
</button> </button>
...@@ -285,24 +421,23 @@ ...@@ -285,24 +421,23 @@
<tbody> <tbody>
@for(product of hisList;track product.peId){ @for(product of hisList;track product.peId){
<tr class="product-list"> <tr class="product-list">
<td> <td>
<div class="flex items-center"> <div class="flex items-center">
<div class="me-2"> <div class="me-2">
<span class="avatar avatar-md avatar-rounded"> <span class="avatar avatar-md avatar-rounded">
<img src={{product.member.getPicture()}} alt=""> <img src="{{ product.member.getPicture() }}" alt="" />
</span> </span>
</div> </div>
<div class="font-semibold"> <div class="font-semibold">
{{product.member.getFullname()}} {{ product.member.getFullname() }}
</div> </div>
</div> </div>
</td> </td>
<td>{{product.quantity_borrowed}}</td> <td>{{ product.quantity_borrowed }}</td>
<td>{{product.created_at}}</td> <td>{{ product.created_at }}</td>
<td>{{product.returned_date}}</td> <td>{{ product.returned_date }}</td>
<td> {{product.status}}</td> <td>{{ product.status }}</td>
<td> {{product.approved_by_member.getFullname()}}</td> <td>{{ product.approved_by_member.getFullname() }}</td>
<!-- <td> <!-- <td>
<span class="badge bg-light text-default"> {{product.category}}</span> <span class="badge bg-light text-default"> {{product.category}}</span>
</td> </td>
...@@ -312,6 +447,13 @@ ...@@ -312,6 +447,13 @@
<td>{{product.seller}}</td> <td>{{product.seller}}</td>
<td> {{product.published}}</td> --> <td> {{product.published}}</td> -->
<td> <td>
<a *ngIf="product.status=='requested'"
aria-label="anchor"
href="javascript:void(0);"
(click)="approve(product)"
class="ti-btn ti-btn-wave product-btn !gap-0 !m-0 !h-[1.75rem] !w-[1.75rem] text-[0.8rem] bg-green/10 text-green hover:bg-green hover:text-white hover:border-green"
><i class="bi bi-check-circle-fill text-success text-base"></i
></a>
<!-- <div class="flex flex-row items-center !gap-2 text-[0.9375rem]"> <!-- <div class="flex flex-row items-center !gap-2 text-[0.9375rem]">
<a aria-label="anchor" routerLink="/pages/ecommerce/editproducts" <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="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
...@@ -323,14 +465,17 @@ ...@@ -323,14 +465,17 @@
</td> </td>
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="ti-modal-footer"> <div class="ti-modal-footer">
<button #closeModalStock type="button" class="hs-dropdown-toggle ti-btn ti-btn-light align-middle" <button
data-hs-overlay="#modal-stock-his"> #closeModalStock
type="button"
class="hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay="#modal-stock-his"
>
ปิด ปิด
</button> </button>
</div> </div>
......
...@@ -219,6 +219,36 @@ export class AdminProjectEquirementComponent { ...@@ -219,6 +219,36 @@ export class AdminProjectEquirementComponent {
// this.filterList = this.itemsList.slice(startIndex, endIndex); // this.filterList = this.itemsList.slice(startIndex, endIndex);
this.filterListAll = this.itemsListAll this.filterListAll = this.itemsListAll
} }
approve(item : BorrowTransactionsModel){
// console.log(this.selectStock)
swal({
title: "Are you sure?",
text: "คุณต้องการบันทึกหรือไม่",
icon: "warning",
dangerMode: false,
buttons: ["Cancel", "Confirm"],
})
.then((willDelete: any) => {
if (willDelete) {
let body = {
"quantity_borrowed": item.quantity_borrowed,
"memberId" : item.memberId,
"status": "approved",
"approved_by": this.tokenService.getUser().member.memberId
}
this.borrowTransactionsService.update(item.borrowId , body).subscribe(result => {
swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
this.ngOnInit()
}, (error: any) => {
swal("Fail!!", error.error.detail, "info");
})
}
});
}
saveBorrow() { saveBorrow() {
// console.log(this.selectStock) // console.log(this.selectStock)
......
...@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { InstallManagementComponent } from './company-management.component'; import { InstallManagementComponent } from './company-management.component';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { LoadingSpinnerComponent } from '@ks89/angular-modal-gallery/lib/components/current-image/loading-spinner/loading-spinner.component';
export const companyRoutes: Routes = [ export const companyRoutes: Routes = [
...@@ -75,6 +76,26 @@ export const companyRoutes: Routes = [ ...@@ -75,6 +76,26 @@ export const companyRoutes: Routes = [
loadComponent: () => loadComponent: () =>
import('./admin-borrow-manage/admin-borrow-manage.component').then((m) => m.AdminBorrowManageComponent), import('./admin-borrow-manage/admin-borrow-manage.component').then((m) => m.AdminBorrowManageComponent),
}, },
{
path:'company/emp-borrow',
loadComponent: () =>
import('./emp-borrow-manage/emp-borrow-manage.component').then((m) => m.EmpBorrowManageComponent)
},
{
path:'company/emp-transaction',
loadComponent: () =>
import('./emp-borrow-transaction/emp-borrow-transaction.component').then((m) =>m.EmpBorrowTransactionComponent)
},
{
path:'company/emp-borrow-return-status',
loadComponent: () =>
import('./emp-borrow-return-status/emp-borrow-return-status.component').then((m) =>m.EmpBorrowReturnStatusComponent)
},
{
path:'company/emp-borrow-status',
loadComponent: () =>
import('./emp-borrow-status/emp-borrow-status.component').then((m) =>m.EmpBorrowStatusComponent)
}
......
<p>emp-borrow-manage works!</p> <app-page-header [title]="'การเบิกอุปกรณ์'" [activeTitle]="'ผู้ดูแลระบบ'" [title1]="'การเบิกอุปกรณ์'"></app-page-header>
<div class="grid grid-cols-12 gap-x-6">
<div class="xl:col-span-12 col-span-12">
<div class="box mt-6">
<div class="box-header justify-between">
<div class="box-title">
{{ 'All List' | translate}} <span
class="badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle">{{itemsList.length}}</span>
</div>
<div class="flex flex-wrap gap-2">
<div>
<input [(ngModel)]='searchTerm' class="form-control form-control" type="text"
placeholder="{{ 'ค้นหาอุปกรณ์' | translate}}" aria-label=".form-control-sm example">
</div>
<!-- <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>
</a>
<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);">Oldest</a></li>
</ul> -->
</div>
</div>
</div>
</div>
@for(item of filterList;track filterList){
<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.equipment.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>
<div class="box-body">
<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-[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>
</div>
<div class="flex flex-wrap align-itesm-center justify-between">
<div class="font-semibold mb-1">รายละเอียด :</div>
<p class="text-[#8c9097] dark:text-white/50 mb-3">{{item.equipment.description}}</p>
<!-- <div class="flex flex-wrap items-center leading-none">
<span class="avatar avatar-xs me-1">
<img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt="">
</span>0.24ETH
</div> -->
</div>
<div class="flex flex-wrap align-itesm-center justify-between mb-2">
<div class="font-semibold mb-1">จำนวน :</div>
<h3 class="text-[#8c9097] dark:text-white/50">{{item.quantity_in_project}}</h3>
</div>
<!-- <div class="grid">
<button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button>
</div> -->
</div>
<div class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center">
<div class="btn-list">
<div class="btn-list">
<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-store-line"></i>
</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>
</div>
</div>
</div>
}
</div>
<!-- Start:: New Deal -->
<div id="modal-detail" class="hs-overlay hidden ti-modal">
<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-detail">
<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-x-6">
<!-- <div class="xl:col-span-12 col-span-12">
<div class="box mt-6">
<div class="box-header justify-between">
<div class="box-title">
{{ 'All List' | translate}} <span
class="badge bg-light text-default rounded-full ms-1 text-[0.75rem] align-middle">{{itemsList.length}}</span>
</div>
<div class="flex flex-wrap gap-2">
<div>
<input [(ngModel)]='searchTerm' class="form-control form-control" type="text"
placeholder="{{ 'ค้นหาอุปกรณ์' | translate}}" aria-label=".form-control-sm example">
</div>
</div>
</div>
</div>
</div> -->
@for(item of filterListAll;track filterListAll){
<div class="xxl:col-span-3 xl:col-span-3 lg:col-span-3 md:col-span-3 sm:col-span-6 col-span-12">
<div class="box custom-box">
<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>
<div class="box-body">
<div class="flex items-center mb-4">
<div>
<p class="text-[.9375rem] font-semibold mb-2"><a
href="javascript:void(0);">{{item.equipmentName}}</a></p>
<p class="text-[0.75rem] text-[#8c9097] dark:text-white/50 mb-0">S/N# {{item.serialNumber}}</p>
</div>
</div>
<div class="flex flex-wrap align-itesm-center justify-between">
<div class="font-semibold mb-1">รายละเอียด :</div>
<p class="text-[#8c9097] dark:text-white/50 mb-3">{{item.description}}</p>
<!-- <div class="flex flex-wrap items-center leading-none">
<span class="avatar avatar-xs me-1">
<img src="./assets/images/crypto-currencies/square-color/Ethereum.svg" alt="">
</span>0.24ETH
</div> -->
</div>
<div class="flex flex-wrap align-itesm-center justify-between mb-2">
<div class="font-semibold mb-1">จำนวน :</div>
<!-- <h3 class="text-[#8c9097] dark:text-white/50">{{item.quantity}}</h3> -->
<input type="number" class="form-control" id="deal-name" placeholder="จำนวน"
[(ngModel)]="item.quantity">
</div>
<!-- <div class="grid">
<button type="button" class="ti-btn ti-btn-primary btn-wave waves-effect waves-light">Place Bid</button>
</div> -->
</div>
<div class="box-footer border-block-start-dashed dark:border-defaultborder/10 text-center">
<div class="btn-list">
<div class="btn-list">
<a href="javascript:void(0);" class="hs-dropdown-toggle ti-btn ti-btn-primary-full me-2"
(click)="stock(item)"><i class="ri-add-line font-semibold align-middle"></i>{{ 'นำเข้า' |
translate}}
</a>
</div>
</div>
</div>
</div>
</div>
}
</div>
</div>
<div class="ti-modal-footer">
<button #closeModal type="button" class="hs-dropdown-toggle ti-btn ti-btn-light align-middle"
data-hs-overlay="#modal-detail">
ยกเลิก
</button>
<!-- <button type="button" class="ti-btn bg-primary text-white !font-medium" (click)="save()">บันทึก</button> -->
</div>
</div>
</div>
</div>
<!-- Start:: New Deal -->
<div id="modal-stock" class="hs-overlay hidden ti-modal" *ngIf="selectModel">
<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.equipment.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.equipment.equipmentName">
</div>
<div class="xl:col-span-12 col-span-12">
<label for="deal-name" class="form-label">S/N</label>
<input readonly type="text" class="form-control" id="deal-name" placeholder="S/N"
[(ngModel)]="selectModel.equipment.serialNumber">
</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)]="borrowSelect.quantity_borrowed">
</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)="saveBorrow()">บันทึก</button>
</div>
</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.member.getPicture()}} alt="">
</span>
</div>
<div class="font-semibold">
{{product.member.getFullname()}}
</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>
import { Component } from '@angular/core'; import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { FileUploader, FileUploadModule } from 'ng2-file-upload';
import { TokenService } from '../../../shared/services/token.service';
import { BorrowTransactionsModel } from '../../models/borrow-transactions';
import { EquipmentModel, EquipmentStockModel } from '../../models/equipments.model';
import { ProjectEquipmentModel } from '../../models/project-equipments';
import { ProjectMemberModel } from '../../models/project-members';
import { BorrowTransactionsService } from '../../services/borrow-transactions.service';
import { EquipmentService } from '../../services/equirement.service';
import { ProjectEquipmentService } from '../../services/project-equipments.service';
import { ProjectMemberService } from '../../services/project-members.service';
import { CommonModule } from '@angular/common';
import { SharedModule } from '../../../shared/shared.module';
import { NgSelectModule } from '@ng-select/ng-select';
import { FormsModule } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import swal from 'sweetalert';
@Component({ @Component({
selector: 'app-emp-borrow-manage', selector: 'app-emp-borrow-manage',
standalone: true, standalone: true,
imports: [], imports: [CommonModule,
SharedModule,
TranslateModule,
NgSelectModule,
FormsModule,
MatPaginator,
FileUploadModule],
templateUrl: './emp-borrow-manage.component.html', templateUrl: './emp-borrow-manage.component.html',
styleUrl: './emp-borrow-manage.component.scss' styleUrl: './emp-borrow-manage.component.scss'
}) })
export class EmpBorrowManageComponent { export class EmpBorrowManageComponent {
@ViewChild('closeModal') public childModal?: ElementRef;
@ViewChild('closeModalStock') public closeModalStock?: ElementRef;
@ViewChild('modalDetail') public modalDetail?: ElementRef;
allSelected = false;
someSelected = false;
uploaderProfile: FileUploader | undefined;
uploadErrorMsg: string = "";
itemsList: ProjectEquipmentModel[] = []
filterList: ProjectEquipmentModel[] = []
itemsListAll: EquipmentModel[] = []
filterListAll: EquipmentModel[] = []
selectModel: ProjectEquipmentModel = new ProjectEquipmentModel()
selectStock?: EquipmentStockModel
selectedItems = new Map<string, boolean>();
borrowSelect: BorrowTransactionsModel = new BorrowTransactionsModel()
pageIndex = 0;
get searchTerm(): string {
return this._searchTerm;
}
set searchTerm(val: string) {
this.pageIndex = 0;
this.allSelected = false
this._searchTerm = val;
if (val != '') {
this.filterList = this.filter(val);
} else {
this.updatePagedItems()
}
}
projectId = ""
_searchTerm = "";
isEdit = false;
empList: ProjectMemberModel[] = []
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!;
}
@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
ngOnInit(): void {
this.getCompanyEquirment()
this.getProjectEquirment()
this.getUserProject()
}
getUserProject() {
this.projectMemberService.getLists(this.projectId).subscribe(result => {
this.empList = result
})
}
getCompanyEquirment() {
this.eqService.getLists().subscribe(result => {
this.itemsListAll = result.filter(e => e.quantity > 0)
this.updatePagedItemsAll()
})
}
getProjectEquirment() {
this.projectEquipmentService.getLists(this.projectId).subscribe(result => {
this.itemsList = result
this.updatePagedItems()
})
}
filter(v: string) {
this.pageIndex = 0;
return this.itemsList?.filter(
(x) =>
x.equipment.equipmentName.toLowerCase().indexOf(v.toLowerCase()) !== -1 ||
x.equipment.description?.toLowerCase().indexOf(v.toLowerCase()) !== -1
);
}
delete(item: EquipmentModel) {
swal({
title: "Are you sure?",
text: "You won't be able to revert this!",
icon: "warning",
dangerMode: true,
buttons: ["Cancel", "Yes,Delete it!"],
})
.then((willDelete: any) => {
if (willDelete) {
this.eqService.delete(item).subscribe(result => {
swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
this.ngOnInit()
})
}
});
}
// new() {
// this.isEdit = false
// this.selectModel = new EquipmentModel()
// }
// view(item: EquipmentModel) {
// console.log(item)
// this.isEdit = true;
// this.selectModel = item
// }
viewStock(item: ProjectEquipmentModel) {
this.selectModel = new ProjectEquipmentModel(item)
this.borrowSelect = new BorrowTransactionsModel()
// this.selectStock = new EquipmentStockModel()
// this.selectStock.equipmentId = this.selectModel.equipmentId
// this.selectStock.created_by = this.tokenService.getUser().member.memberId
// this.selectStock.action = "INBOUND"
}
viewHisStock(item: ProjectEquipmentModel) {
this.borrowTransactionsService.search({ "peId": item.peId , "member_id" :this.tokenService.getUser().member.memberId }).subscribe(result => {
this.hisList = result
})
}
// save() {
// console.log(this.selectModel)
// swal({
// title: "Are you sure?",
// text: "คุณต้องการบันทึกหรือไม่",
// icon: "warning",
// dangerMode: false,
// buttons: ["Cancel", "Confirm"],
// })
// .then((willDelete: any) => {
// if (willDelete) {
// if (!this.isEdit) {
// this.eqService.save(this.selectModel).subscribe(result => {
// swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
// this.ngOnInit()
// this.childModal?.nativeElement.click()
// })
// } else {
// this.eqService.update(this.selectModel).subscribe(result => {
// swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
// this.ngOnInit()
// this.childModal?.nativeElement.click()
// })
// }
// // this.selectModel.member.role = 0
// }
// });
// }
// filterEmp(empId: string) {
// 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
}
updatePagedItemsAll() {
const startIndex = this.pageIndex * 10;
const endIndex = startIndex + 10;
// this.filterList = this.itemsList.slice(startIndex, endIndex);
this.filterListAll = this.itemsListAll
}
saveBorrow() {
// console.log(this.selectStock)
swal({
title: "Are you sure?",
text: "คุณต้องการบันทึกหรือไม่",
icon: "warning",
dangerMode: false,
buttons: ["Cancel", "Confirm"],
})
.then((willDelete: any) => {
if (willDelete) {
this.borrowTransactionsService.save({
"peId": this.selectModel.peId,
"quantity_borrowed": this.borrowSelect.quantity_borrowed,
"status": "requested",
"memberId": this.tokenService.getUser().member.memberId,
}).subscribe(result => {
swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
this.ngOnInit()
this.closeModalStock?.nativeElement.click()
}, (error: any) => {
swal("Fail!!", error.error.detail, "info");
})
}
});
}
stock(item: EquipmentModel) {
if (item.quantity > 0) {
swal({
title: "Are you sure?",
text: "คุณต้องการบันทึกหรือไม่",
icon: "warning",
dangerMode: false,
buttons: ["Cancel", "Confirm"],
})
.then((willDelete: any) => {
if (willDelete) {
this.projectEquipmentService.save({
"quantity_in_project": item.quantity,
"projectId": this.projectId,
"equipmentId": item.equipmentId
}).subscribe(result => {
this.selectStock = new EquipmentStockModel()
this.selectStock.quantity = item.quantity
this.selectStock.equipmentId = item.equipmentId
this.selectStock.created_by = this.tokenService.getUser().member.memberId
this.selectStock.action = "OUTBOUND",
this.selectStock.remark = "ย้ายเข้าสู่โครงการ " + this.tokenService.getSelectCompany().projectId + " (" + this.tokenService.getSelectCompany().project_code + ")"
this.eqService.stock(this.selectStock!).subscribe(result => {
swal("Save Success!!", "บันทึกข้อมูลสำเร็จ", "success");
this.getProjectEquirment()
this.getCompanyEquirment()
this.childModal?.nativeElement.click()
})
})
}
});
}
}
} }
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-emp-borrow-return-status',
templateUrl: './emp-borrow-return-status.component.html',
styleUrls: ['./emp-borrow-return-status.component.scss']
})
export class EmpBorrowReturnStatusComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-emp-borrow-status',
templateUrl: './emp-borrow-status.component.html',
styleUrls: ['./emp-borrow-status.component.scss']
})
export class EmpBorrowStatusComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-emp-borrow-transaction',
standalone: true,
imports: [],
templateUrl: './emp-borrow-transaction.component.html',
styleUrls: ['./emp-borrow-transaction.component.scss']
})
export class EmpBorrowTransactionComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -33,11 +33,8 @@ export class BorrowTransactionsService { ...@@ -33,11 +33,8 @@ export class BorrowTransactionsService {
return this.http.post<BorrowTransactionsModel>(this.apiBaseUrl, body); return this.http.post<BorrowTransactionsModel>(this.apiBaseUrl, body);
} }
update(body: BorrowTransactionsModel) { update(borrowId : string ,body: any) {
return this.http.put<{ return this.http.put<BorrowTransactionsModel>(this.apiBaseUrl + "/" + borrowId, body);
"message": string,
"user": BorrowTransactionsModel
}>(this.apiBaseUrl + "/" + body.borrowId, new BorrowTransactionsModel(body));
} }
delete(body: BorrowTransactionsModel) { delete(body: BorrowTransactionsModel) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="my-[2.5rem] flex justify-center"> <div class="my-[2.5rem] flex justify-center">
<a> <a>
<p class="h3 mb-2 text-center">ระบบจัดการทรัพสินบริษัท</p> <p class="h3 mb-2 text-center">ระบบจัดการทรัพย์สินบริษัท</p>
<!-- <img src="./assets/images/brand-logos/logo.png" alt="logo" class="desktop-logo"> <!-- <img src="./assets/images/brand-logos/logo.png" alt="logo" class="desktop-logo">
<img src="./assets/images/brand-logos/logo.png" alt="logo" class="desktop-dark"> --> <img src="./assets/images/brand-logos/logo.png" alt="logo" class="desktop-dark"> -->
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<a class="header-logo"> <a class="header-logo">
<!-- <img src="./assets/images/brand-logos/logo.png" alt="logo" width="100%">test --> <!-- <img src="./assets/images/brand-logos/logo.png" alt="logo" width="100%">test -->
ระบบจัดการทรัพสินบริษัท ระบบจัดการทรัพย์สินบริษัท
</a> </a>
......
...@@ -161,12 +161,11 @@ export class NavService implements OnDestroy { ...@@ -161,12 +161,11 @@ export class NavService implements OnDestroy {
}, },
// { headTitle: 'User Management' }, // { headTitle: 'User Management' },
{ {
title: 'จัดการข้อมูลโครงการ',
icon: 'buildings', icon: 'buildings',
title: 'จัดการข้อมูลโครงการ',
type: 'sub', type: 'sub',
badgeClass: 'warning',
badgeText: 'warning',
active: false, active: false,
Menusub: true,
children: [ children: [
{ path: '/company/equirement-emp', title: 'สินทรัพย์', type: 'link' }, { path: '/company/equirement-emp', title: 'สินทรัพย์', type: 'link' },
{ path: '/company/project-emp', title: 'พนักงาน', type: 'link' } { path: '/company/project-emp', title: 'พนักงาน', type: 'link' }
...@@ -174,12 +173,15 @@ export class NavService implements OnDestroy { ...@@ -174,12 +173,15 @@ export class NavService implements OnDestroy {
}, },
{ {
icon: 'store', icon: 'store',
path: '/company/admin-borrow',
title: 'จัดการการเบิก-คืน', title: 'จัดการการเบิก-คืน',
type: 'link', type: 'sub',
selected: false, selected: false,
Menusub: true,
active: false, active: false,
Menusub: true,
children: [
{ path: '/company/emp-borrow-status', title: 'เบิก', type: 'link' },
{ path: '/company/emp-borrow-return-status', title: 'คืน', type: 'link' }
],
}, },
]; ];
} }
...@@ -190,16 +192,15 @@ export class NavService implements OnDestroy { ...@@ -190,16 +192,15 @@ export class NavService implements OnDestroy {
{ headTitle: 'จัดการบริษัท' }, { headTitle: 'จัดการบริษัท' },
// { headTitle: 'User Management' } // { headTitle: 'User Management' }
{ {
title: 'จัดการข้อมูลการลงเวลา', title: 'หน้าทำรายการ',
icon: 'time', icon: 'time',
type: 'sub', type: 'sub',
badgeClass: 'warning', badgeClass: 'warning',
badgeText: 'warning', badgeText: 'warning',
active: false, active: false,
children: [ children: [
{ path: '/company/company-location', title: 'สถานที่การลงเวลา', type: 'link' }, { path: '/company/emp-borrow', title: 'ขอเบิกอุปกรณ์', type: 'link' },
{ path: '/company/timestamp-log', title: 'ข้อมูลการลงเวลา', type: 'link' }, { path: '/company/emp-transaction', title: 'ประวัติการเบิก', type: 'link' },
// { path: '/company/warning-timestamp-log', title: 'อนุมัติการลงเวลา', type: 'link' },
], ],
} }
]; ];
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
"Section": "ส่วน", "Section": "ส่วน",
"Position": "ตำแหน่ง", "Position": "ตำแหน่ง",
"Employee Management": "จัดการพนักงาน", "Employee Management": "จัดการพนักงาน",
"Please fill in information": "กรุณากรอกข้อมูล", "Please fill in information": "*",
"Employee ID": "รหัสพนักงาน", "Employee ID": "รหัสพนักงาน",
"Supervisor": "หัวหน้างาน", "Supervisor": "หัวหน้างาน",
"Email": "อีเมล", "Email": "อีเมล",
...@@ -73,5 +73,6 @@ ...@@ -73,5 +73,6 @@
"Browser" : "เบราว์เซอร์", "Browser" : "เบราว์เซอร์",
"Success" : "สำเร็จ", "Success" : "สำเร็จ",
"Fail" : "ผิดพลาด", "Fail" : "ผิดพลาด",
"Mobile" : "เบอร์ติดต่อ" "Mobile" : "เบอร์ติดต่อ",
"Update" :"แก้ไข"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment