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 = ''
......
...@@ -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)
}
......
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