Commit 591bb041 by DESKTOP-HF0LVOG\myhr

Merge branch 'master' of https://mygit.myhr.co.th/chanachai.pmg.eng/BookingMyHrManagement

# Conflicts:
#	src/app/models/roomDetail.model.ts
#	src/app/pages/admin-pending/admin-pending.component.ts
parents 08fda832 cc22bb61
...@@ -18,7 +18,8 @@ export class ItemDetail { ...@@ -18,7 +18,8 @@ export class ItemDetail {
}; };
eStatus: string; eStatus: string;
Quantity: string; Quantity: string;
eTelephone: number; eTelephone: string;
email: string;
Remark: string; Remark: string;
constructor(init?: ItemDetail) { constructor(init?: ItemDetail) {
Object.assign(this, init); Object.assign(this, init);
...@@ -30,6 +31,7 @@ export class ItemDetail { ...@@ -30,6 +31,7 @@ export class ItemDetail {
this.eStatus = ''; this.eStatus = '';
this.Quantity = ''; this.Quantity = '';
this.eTelephone = undefined; this.eTelephone = undefined;
this.email = undefined;
this.Remark = ''; this.Remark = '';
} }
} }
......
...@@ -18,7 +18,7 @@ export class RoomDetail { ...@@ -18,7 +18,7 @@ export class RoomDetail {
}; };
rStatus: string; rStatus: string;
rTelephone: string; rTelephone: string;
email: undefined; email: string;
Remark: string; Remark: string;
constructor(init?: RoomDetail) { constructor(init?: RoomDetail) {
Object.assign(this, init); Object.assign(this, init);
......
...@@ -103,14 +103,15 @@ ...@@ -103,14 +103,15 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="d-flex justify-content-between p-2"> <div class="d-flex justify-content-between p-2">
<ngb-pagination [collectionSize]="collectionSize" [(page)]="page" <ngb-pagination [collectionSize]="collectionSizeListRoom" [(page)]="pageListRoom"
[pageSize]="pageSize" (pageChange)="refreshCountries()"> [pageSize]="pageSizeListRoom">
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination> </ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSize" <select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="refreshCountries()"> (ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option> <option [ngValue]="10">10 items per page</option>
<option [ngValue]="50">50 items per page</option> <option [ngValue]="50">50 items per page</option>
<option [ngValue]="100">100 items per page</option> <option [ngValue]="100">100 items per page</option>
...@@ -165,14 +166,15 @@ ...@@ -165,14 +166,15 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="d-flex justify-content-between p-2"> <div class="d-flex justify-content-between p-2">
<ngb-pagination [collectionSize]="collectionSize" [(page)]="page" <ngb-pagination [collectionSize]="collectionSizeListRoom" [(page)]="pageListRoom"
[pageSize]="pageSize" (pageChange)="refreshCountries()"> [pageSize]="pageSizeListRoom">
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination> </ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSize" <select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="refreshCountries()"> (ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option> <option [ngValue]="10">10 items per page</option>
<option [ngValue]="50">50 items per page</option> <option [ngValue]="50">50 items per page</option>
<option [ngValue]="100">100 items per page</option> <option [ngValue]="100">100 items per page</option>
...@@ -199,8 +201,15 @@ ...@@ -199,8 +201,15 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> ชื่อผู้จอง </label> <label> ชื่อผู้จอง </label>
<input class=" form-control" placeholder="" type="text" <input class=" form-control" placeholder="" type="text" [(ngModel)]="modelRoomDetail.userName" />
[(ngModel)]="modelroomDetail.userName" /> </div>
</div>
</div>
<div class=" row">
<div class=" col-sm-12 mb-1">
<div class=" form-group">
<label> อีเมล </label>
<input class=" form-control" placeholder="" type="text" [(ngModel)]="modelRoomDetail.email" />
</div> </div>
</div> </div>
</div> </div>
...@@ -208,42 +217,42 @@ ...@@ -208,42 +217,42 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> เบอร์โทร </label> <label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text" value="" /> <input class=" form-control" placeholder="" type="text" [(ngModel)]="modelRoomDetail.room.rTelephone" />
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 mb-1"> <div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่อห้อง</label> <label for="exampleFormControlSelect1">ชื่อห้อง</label>
<input class="form-control" type="text" [(ngModel)]="modelroomDetail.room.rName"> <input class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rName"/>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 mb-1"> <div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">รายละเอียด</label> <label for="exampleFormControlSelect1">รายละเอียด</label>
<input class="form-control" type="text" [(ngModel)]="modelroomDetail.room.rDesc"> <input class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rDesc" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label> <label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" [(ngModel)]="sDate" (ngModelChange)="rDate(sDate,'sdate')"> <input type="date" class="form-control" [(ngModel)]="sDate" (ngModelChange)="rDate(sDate,'sdate')" />
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label> <label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" [(ngModel)]="eDate" (ngModelChange)="rDate(eDate,'edate')"> <input type="date" class="form-control" [(ngModel)]="eDate" (ngModelChange)="rDate(eDate,'edate')" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time" <input class="form-control" type="time"
[(ngModel)]="thStime" (ngModelChange)="thtimeChange(thStime,modelroomDetail.sTime)"> [(ngModel)]="thStime" (ngModelChange)="thtimeChange(thStime,modelRoomDetail.sTime)" />
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time" <input class="form-control" type="time"
[(ngModel)]="thEtime" (ngModelChange)="thtimeChange(thEtime,modelroomDetail.eTime)"> [(ngModel)]="thEtime" (ngModelChange)="thtimeChange(thEtime,modelRoomDetail.eTime)" />
</div> </div>
</div> </div>
<div class=" row"> <div class=" row">
...@@ -251,12 +260,12 @@ ...@@ -251,12 +260,12 @@
<div class=" form-group"> <div class=" form-group">
<label> หมายเหตุ </label> <label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" value="{{modelroomDetail.Remark}}"></textarea> placeholder="......" [(ngModel)]="modelRoomDetail.Remark"></textarea>
</div> </div>
</div> </div>
</div> </div>
<div class=" card-footer"> <div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveEquirment()">อนุมัติ</button> <button class=" btn btn-fill btn-danger" type="submit" (click)="saveRoom()">อนุมัติ</button>
<button class=" btn btn-fill btn-danger" type="cancel" <button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">ยกเลิก</button> (click)="modal.dismiss('Cross click')">ยกเลิก</button>
<div ngbDropdown class="d-inline-block"> <div ngbDropdown class="d-inline-block">
...@@ -279,7 +288,7 @@ ...@@ -279,7 +288,7 @@
<div class=" col-md-12" style="padding: 0; "> <div class=" col-md-12" style="padding: 0; ">
<div class="card" style="margin: 0; "> <div class="card" style="margin: 0; ">
<div class=" card-header"> <div class=" card-header">
<h5 class=" title">Lend Equirment</h5> <h5 class=" title">การเบิก</h5>
</div> </div>
<div class=" card-body"> <div class=" card-body">
<div class=" row"> <div class=" row">
...@@ -287,7 +296,15 @@ ...@@ -287,7 +296,15 @@
<div class=" form-group"> <div class=" form-group">
<label> ชื่อผู้จอง </label> <label> ชื่อผู้จอง </label>
<input class=" form-control" placeholder="" type="text" <input class=" form-control" placeholder="" type="text"
[(ngModel)]="modelitemDetail.userName"> [(ngModel)]="modelItemDetail.userName" />
</div>
</div>
</div>
<div class=" row">
<div class=" col-sm-12 mb-1">
<div class=" form-group">
<label> อีเมล </label>
<input class=" form-control" placeholder="" type="text" [(ngModel)]="modelItemDetail.email" />
</div> </div>
</div> </div>
</div> </div>
...@@ -295,49 +312,49 @@ ...@@ -295,49 +312,49 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> เบอร์โทร </label> <label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text" value="" /> <input class=" form-control" placeholder="" type="text" [(ngModel)]="modelItemDetail.equirment.eTelephone" />
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 mb-1"> <div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label> <label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label>
<input class="form-control" type="text" [(ngModel)]="modelitemDetail.equirment.eqName"> <input class="form-control" type="text" [(ngModel)]="modelItemDetail.equirment.eqName" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 mb-1"> <div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label> <label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label>
<input class="form-control" type="text" [(ngModel)]="modelitemDetail.equirment.eqDesc"> <input class="form-control" type="text" [(ngModel)]="modelItemDetail.equirment.eqDesc" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label> <label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" [(ngModel)]="sDate" (ngModelChange)="rDate(sDate,'sdate')"> <input type="date" class="form-control" [(ngModel)]="sDate" (ngModelChange)="rDate(sDate,'sdate')" />
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label> <label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input type="date" class="form-control" [(ngModel)]="eDate" (ngModelChange)="rDate(eDate,'edate')"> <input type="date" class="form-control" [(ngModel)]="eDate" (ngModelChange)="rDate(eDate,'edate')" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time" <input class="form-control" type="time"
[(ngModel)]="thStime" (ngModelChange)="thtimeChange(thStime,modelitemDetail.sTime)"> [(ngModel)]="thStime" (ngModelChange)="thtimeChange(thStime,modelItemDetail.sTime)" />
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="text" <input class="form-control" type="text"
[(ngModel)]="thEtime" (ngModelChange)="thtimeChange(thStime,modelitemDetail.eTime)"> [(ngModel)]="thEtime" (ngModelChange)="thtimeChange(thStime,modelItemDetail.eTime)" />
</div> </div>
</div> </div>
<div class=" row"> <div class=" row">
<div class=" col-sm-6 mb-1"> <div class=" col-sm-6 mb-1">
<label for="changequantity">จำนวน</label> <label for="changequantity">จำนวน</label>
<input id="changequantity" type="number" class="form-control form-control-sm" <input id="changequantity" type="number" class="form-control form-control-sm"
value="{{modelitemDetail.Quantity}}" /> [(ngModel)]="modelItemDetail.Quantity" />
</div> </div>
</div> </div>
<div class=" row"> <div class=" row">
...@@ -345,7 +362,22 @@ ...@@ -345,7 +362,22 @@
<div class=" form-group"> <div class=" form-group">
<label> หมายเหตุ </label> <label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" value="{{modelitemDetail.Remark}}"></textarea> placeholder="......" [(ngModel)]="modelItemDetail.Remark"></textarea>
</div>
</div>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveEquirment()">อนุมัติ</button>
<button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">ยกเลิก</button>
<div ngbDropdown class="d-inline-block">
<button class="btn btn-sm btn-outline-primary" id="dropdownBasic1"
ngbDropdownToggle>สถานะ</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<button ngbDropdownItem>รอดำเนินการ</button>
<button ngbDropdownItem>อนุมัติ</button>
<button ngbDropdownItem>ยกเลิก</button>
<button ngbDropdownItem>สำเร็จแล้ว</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -7,7 +7,8 @@ import { ItemDetailService } from 'src/app/service/item-detail.service'; ...@@ -7,7 +7,8 @@ import { ItemDetailService } from 'src/app/service/item-detail.service';
import { RoomDetail } from 'src/app/models/roomDetail.model'; import { RoomDetail } from 'src/app/models/roomDetail.model';
import { RoomDetailService } from 'src/app/service/room-detail.service'; import { RoomDetailService } from 'src/app/service/room-detail.service';
import { MyRoom, Room } from 'src/app/models/rooms.model'; import { MyRoom, Room } from 'src/app/models/rooms.model';
import { FormControl, Validators } from '@angular/forms'; import { EquirmentService } from 'src/app/service/equirment.service';
import { RoomService } from 'src/app/service/room.service';
@Component({ @Component({
selector: 'app-admin-pending', selector: 'app-admin-pending',
...@@ -42,8 +43,15 @@ import { FormControl, Validators } from '@angular/forms'; ...@@ -42,8 +43,15 @@ import { FormControl, Validators } from '@angular/forms';
}) })
export class AdminPendingComponent implements OnInit { export class AdminPendingComponent implements OnInit {
time = { hour: 13, minute: 30 };
page = 1; page = 1;
pageSize = 10; pageSize = 10;
collectionSize = 0;
pageListRoom = 1;
pageSizeListRoom = 10;
collectionSizeListRoom = 0;
closeResult = ''; closeResult = '';
...@@ -55,7 +63,6 @@ export class AdminPendingComponent implements OnInit { ...@@ -55,7 +63,6 @@ export class AdminPendingComponent implements OnInit {
modelItemDetail = new ItemDetail(); modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail(); modelRoomDetail = new RoomDetail();
collectionSize = this.listitemDetail.length;
hoveredDate: NgbDate | null = null; hoveredDate: NgbDate | null = null;
fromDate: NgbDate | null; fromDate: NgbDate | null;
...@@ -63,9 +70,6 @@ export class AdminPendingComponent implements OnInit { ...@@ -63,9 +70,6 @@ export class AdminPendingComponent implements OnInit {
thStime: string; thStime: string;
thEtime: string; thEtime: string;
thtimeChange (time:string,item:any){ thtimeChange (time:string,item:any){
let timeSplit = time.split(":") let timeSplit = time.split(":")
item.hour = parseInt(timeSplit[0]) item.hour = parseInt(timeSplit[0])
...@@ -74,9 +78,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -74,9 +78,8 @@ export class AdminPendingComponent implements OnInit {
} }
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter, private modalService: NgbModal, private ItemDetailService: ItemDetailService, private RoomDetailService: RoomDetailService
, private equirmentService: EquirmentService, private roomService: RoomService) {
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter, private modalService: NgbModal, private ItemDetailService: ItemDetailService, private RoomDetailService: RoomDetailService) {
this.fromDate = calendar.getToday(); this.fromDate = calendar.getToday();
this.toDate = calendar.getNext(calendar.getToday(), 'd', 10); this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
this.refreshitemDetail(); this.refreshitemDetail();
...@@ -185,10 +188,21 @@ export class AdminPendingComponent implements OnInit { ...@@ -185,10 +188,21 @@ export class AdminPendingComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.listitemDetail = this.ItemDetailService.getListItemDetail(); this.listitemDetail = this.ItemDetailService.getListItemDetail();
this.listroomDetail = this.RoomDetailService.getListRoomDetail(); this.listroomDetail = this.RoomDetailService.getListRoomDetail();
this.collectionSizeListRoom = this.listitemDetail.length;
console.log(this.listitemDetail); console.log(this.listitemDetail);
} }
saveEquirment() {
this.equirmentService.addEquirment(this.modelEquirment);
this.modalService.dismissAll();
this.ngOnInit();
}
saveRoom() {
this.roomService.addRoom(this.modelRoom);
this.modalService.dismissAll();
this.ngOnInit();
}
} }
export class NgbdDropdownBasic { export class NgbdDropdownBasic {
......
...@@ -90,24 +90,29 @@ ...@@ -90,24 +90,29 @@
<td>{{ item.room.rName }}</td> <td>{{ item.room.rName }}</td>
<td>{{ item.room.rDesc }}</td> <td>{{ item.room.rDesc }}</td>
<td>{{ item.userName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{ item.sTime.minute }}</td> <td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{ item.eTime.minute }}</td> item.sTime.minute }}</td>
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{
item.eTime.minute }}</td>
<td>{{ item.rStatus }}</td> <td>{{ item.rStatus }}</td>
<div class="col-auto align-self-sm-center"> <div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle " <button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="openRoomDetail(Room,item)"><i class="fa fa-search"></i> </button> style="line-height: 0px" (click)="openRoomDetail(Room,item)"><i
class="fa fa-search"></i> </button>
</div> </div>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="d-flex justify-content-between p-2"> <div class="d-flex justify-content-between p-2">
<ngb-pagination [collectionSize]="collectionSize" [(page)]="page" <ngb-pagination [collectionSize]="collectionSizeListRoom" [(page)]="pageListRoom"
[pageSize]="pageSize" (pageChange)="refreshCountries()"> [pageSize]="pageSizeListRoom">
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination> </ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSize" <select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="refreshCountries()"> (ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option> <option [ngValue]="10">10 items per page</option>
<option [ngValue]="50">50 items per page</option> <option [ngValue]="50">50 items per page</option>
<option [ngValue]="100">100 items per page</option> <option [ngValue]="100">100 items per page</option>
...@@ -148,25 +153,30 @@ ...@@ -148,25 +153,30 @@
<td>{{ item.equirment.eqName }}</td> <td>{{ item.equirment.eqName }}</td>
<td>{{ item.equirment.eqDesc }}</td> <td>{{ item.equirment.eqDesc }}</td>
<td>{{ item.userName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{ item.sTime.minute }}</td> <td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{ item.eTime.minute }}</td> item.sTime.minute }}</td>
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{
item.eTime.minute }}</td>
<td>{{ item.Quantity }}</td> <td>{{ item.Quantity }}</td>
<td>{{ item.eStatus }}</td> <td>{{ item.eStatus }}</td>
<div class="col-auto align-self-sm-center"> <div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle " <button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="openItemDetail(lend,item)"><i class="fa fa-search"></i> </button> style="line-height: 0px" (click)="openItemDetail(lend,item)"><i
class="fa fa-search"></i> </button>
</div> </div>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="d-flex justify-content-between p-2"> <div class="d-flex justify-content-between p-2">
<ngb-pagination [collectionSize]="collectionSize" [(page)]="page" <ngb-pagination [collectionSize]="collectionSizeListRoom" [(page)]="pageListRoom"
[pageSize]="pageSize" (pageChange)="refreshCountries()"> [pageSize]="pageSizeListRoom">
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination> </ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSize" <select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="refreshCountries()"> (ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option> <option [ngValue]="10">10 items per page</option>
<option [ngValue]="50">50 items per page</option> <option [ngValue]="50">50 items per page</option>
<option [ngValue]="100">100 items per page</option> <option [ngValue]="100">100 items per page</option>
...@@ -189,65 +199,78 @@ ...@@ -189,65 +199,78 @@
<h5 class=" title">การจอง</h5> <h5 class=" title">การจอง</h5>
</div> </div>
<div class=" card-body"> <div class=" card-body">
<form> <div class=" row">
<div class=" row"> <div class=" col-md-12">
<div class=" col-md-12"> <div class=" form-group">
<div class=" form-group"> <label> ชื่อผู้จอง </label>
<label> ชื่อผู้จอง </label> <input readonly class=" form-control" placeholder="" type="text"
<input readonly class=" form-control" placeholder="" type="text" value="{{modelRoomDetail.userName}}" /> [(ngModel)]="modelRoomDetail.userName" />
</div>
</div> </div>
</div> </div>
<div class=" row"> </div>
<div class=" col-md-12"> <div class=" row">
<div class=" form-group"> <div class=" col-md-12">
<label> เบอร์โทร </label> <div class=" form-group">
<input readonly class=" form-control" placeholder="" type="text" value="" /> <label> อีเมล </label>
</div> <input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelRoomDetail.email" />
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="col-sm-12 mb-1"> <div class=" row">
<label for="exampleFormControlSelect1">ชื่อห้อง</label> <div class=" col-md-12">
<input readonly class="form-control" type="text" value="{{modelRoomDetail.room.rName}}"> <div class=" form-group">
<label> เบอร์โทร </label>
<input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelRoomDetail.rTelephone" />
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="col-sm-12 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">รายละเอียด</label> <div class="col-sm-12 mb-1">
<input readonly class="form-control" type="text" value="{{modelRoomDetail.room.rDesc}}"> <label for="exampleFormControlSelect1">ชื่อห้อง</label>
</div> <input readonly class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rName">
</div> </div>
<div class="row"> </div>
<div class="col-6 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label> <div class="col-sm-12 mb-1">
<input readonly type="text" class="form-control" value="{{modelRoomDetail.sDate | date:'dd-MM-yyyy'}}"> <label for="exampleFormControlSelect1">รายละเอียด</label>
</div> <input readonly class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rDesc">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input readonly type="text" class="form-control" value="{{modelRoomDetail.eDate | date:'dd-MM-yyyy'}}">
</div>
</div> </div>
<div class="row"> </div>
<div class="col-6 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <div class="col-6 mb-1">
<input readonly class="form-control" type="text" value="{{modelRoomDetail.sTime.hour}} {{modelRoomDetail.sTime.minute}}"> <label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
</div> <input readonly type="date" class="form-control" [(ngModel)]="sDate"
<div class="col-6 mb-1"> (ngModelChange)="rDate(sDate,'sdate')">
<label [readonly] for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="text" value="{{modelRoomDetail.eTime.hour}} {{modelRoomDetail.eTime.minute}}">
</div>
</div> </div>
<div class=" row"> <div class="col-6 mb-1">
<div class=" col-md-12"> <label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<div class=" form-group"> <input readonly type="date" class="form-control" [(ngModel)]="eDate"
<label> หมายเหตุ </label> (ngModelChange)="rDate(eDate,'edate')">
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3" </div>
placeholder="......" value="{{modelRoomDetail.Remark}}"></textarea> </div>
</div> <div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input readonly class="form-control" type="time" [(ngModel)]="thStime"
(ngModelChange)="thtimeChange(thStime,modelroomDetail.sTime)">
</div>
<div class="col-6 mb-1">
<label [readonly] for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="time" [(ngModel)]="thEtime"
(ngModelChange)="thtimeChange(thEtime,modelroomDetail.eTime)">
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelRoomDetail.Remark"></textarea>
</div> </div>
</div> </div>
</form> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -257,76 +280,89 @@ ...@@ -257,76 +280,89 @@
<div class=" col-md-12" style="padding: 0; "> <div class=" col-md-12" style="padding: 0; ">
<div class="card" style="margin: 0; "> <div class="card" style="margin: 0; ">
<div class=" card-header"> <div class=" card-header">
<h5 class=" title">Lend Equirment</h5> <h5 class=" title">การเบิก</h5>
</div> </div>
<div class=" card-body"> <div class=" card-body">
<form> <div class=" row">
<div class=" row"> <div class=" col-sm-12 mb-1">
<div class=" col-sm-12 mb-1"> <div class=" form-group">
<div class=" form-group"> <label> ชื่อผู้จอง </label>
<label> ชื่อผู้จอง </label> <input readonly class=" form-control" placeholder="" type="text"
<input readonly class=" form-control" placeholder="" type="text" value="{{modelItemDetail.userName}}" /> [(ngModel)]="modelItemDetail.userName" />
</div>
</div> </div>
</div> </div>
<div class=" row"> </div>
<div class=" col-md-12"> <div class=" row">
<div class=" form-group"> <div class=" col-sm-12 mb-1">
<label> เบอร์โทร </label> <div class=" form-group">
<input readonly class=" form-control" placeholder="" type="text" value="" /> <label> อีเมล </label>
</div> <input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelItemDetail.email" />
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="col-sm-12 mb-1"> <div class=" row">
<label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label> <div class=" col-md-12">
<input readonly class="form-control" type="text" value="{{modelItemDetail.equirment.eqName}}"> <div class=" form-group">
<label> เบอร์โทร </label>
<input readonly class=" form-control" placeholder="" type="text"
[(ngModel)]="modelItemDetail.rTelephone" />
</div> </div>
</div> </div>
<div class="row"> </div>
<div class="col-sm-12 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label> <div class="col-sm-12 mb-1">
<input readonly class="form-control" type="text" value="{{modelItemDetail.equirment.eqDesc}}"> <label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label>
</div> <input readonly class="form-control" type="text" [(ngModel)]="modelItemDetail.equirment.eqName">
</div> </div>
<div class="row"> </div>
<div class="col-6 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label> <div class="col-sm-12 mb-1">
<input readonly type="text" class="form-control" value="{{modelItemDetail.sDate | date:'dd-MM-yyyy'}}"> <label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label>
</div> <input readonly class="form-control" type="text" [(ngModel)]="modelItemDetail.equirment.eqDesc">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input readonly type="text" class="form-control" value="{{modelItemDetail.eDate | date:'dd-MM-yyyy'}}">
</div>
</div> </div>
<div class="row"> </div>
<div class="col-6 mb-1"> <div class="row">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <div class="col-6 mb-1">
<input readonly class="form-control" type="text" value="{{modelItemDetail.sTime.hour}} {{modelItemDetail.sTime.minute}}"> <label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
</div> <input readonly type="date" class="form-control" [(ngModel)]="sDate"
<div class="col-6 mb-1"> (ngModelChange)="rDate(sDate,'sdate')">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="text" value="{{modelItemDetail.eTime.hour}} {{modelItemDetail.eTime.minute}}">
</div>
</div> </div>
<div class=" row"> <div class="col-6 mb-1">
<div class=" col-sm-6 mb-1"> <label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<label for="changequantity">จำนวน</label> <input readonly type="date" class="form-control" [(ngModel)]="eDate"
<input readonly id="changequantity" type="number" class="form-control form-control-sm" value="{{modelItemDetail.Quantity}}" /> (ngModelChange)="rDate(eDate,'edate')">
</div>
</div> </div>
<div class=" row"> </div>
<div class=" col-md-12"> <div class="row">
<div class=" form-group"> <div class="col-6 mb-1">
<label> หมายเหตุ </label> <label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3" <input readonly class="form-control" type="time" [(ngModel)]="thStime"
placeholder="......" value="{{modelItemDetail.Remark}}" ></textarea> (ngModelChange)="thtimeChange(thStime,modelItemDetail.sTime)">
</div> </div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="time" [(ngModel)]="thEtime"
(ngModelChange)="thtimeChange(thEtime,modelItemDetail.eTime)">
</div>
</div>
<div class=" row">
<div class=" col-sm-6 mb-1">
<label for="changequantity">จำนวน</label>
<input readonly id="changequantity" type="number" class="form-control form-control-sm"
[(ngModel)]="modelItemDetail.Quantity" />
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelItemDetail.Remark"></textarea>
</div> </div>
</div> </div>
</form> </div>
</div> </div>
</div> </div>
</div> </div>
</ng-template> </ng-template>
\ No newline at end of file
...@@ -40,20 +40,26 @@ import { MyRoom, Room } from 'src/app/models/rooms.model'; ...@@ -40,20 +40,26 @@ import { MyRoom, Room } from 'src/app/models/rooms.model';
}) })
export class PendingComponent implements OnInit { export class PendingComponent implements OnInit {
page = 1; time = { hour: 13, minute: 30 };
pageSize = 10;
closeResult = ''; closeResult = '';
listItemDetail : ItemDetail[] = []; listItemDetail : ItemDetail[] = [];
listRoomDetail : RoomDetail[] = []; listRoomDetail : RoomDetail[] = [];
page = 1;
pageSize = 10;
collectionSize = 0;
pageListRoom = 1;
pageSizeListRoom = 10;
collectionSizeListRoom = 0;
modelEquirment = new Equirment(); modelEquirment = new Equirment();
modelRoom = new MyRoom(); modelRoom = new MyRoom();
modelItemDetail = new ItemDetail(); modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail(); modelRoomDetail = new RoomDetail();
collectionSize = this.listItemDetail.length;
hoveredDate: NgbDate | null = null; hoveredDate: NgbDate | null = null;
fromDate: NgbDate | null; fromDate: NgbDate | null;
...@@ -98,7 +104,12 @@ export class PendingComponent implements OnInit { ...@@ -98,7 +104,12 @@ export class PendingComponent implements OnInit {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`; this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
}); });
} }
date='10-12-2561'
show(a:string){
console.log(a)
}
sDate = ""
eDate = ""
openItemDetail(content : string ,item : ItemDetail) { openItemDetail(content : string ,item : ItemDetail) {
this.modelItemDetail = item ; this.modelItemDetail = item ;
this.thStime= this.modelItemDetail.sTime.hour + ':' + this.modelItemDetail.sTime.minute this.thStime= this.modelItemDetail.sTime.hour + ':' + this.modelItemDetail.sTime.minute
...@@ -106,6 +117,7 @@ export class PendingComponent implements OnInit { ...@@ -106,6 +117,7 @@ export class PendingComponent implements OnInit {
let SDate = this.modelItemDetail.sDate.split('/') let SDate = this.modelItemDetail.sDate.split('/')
this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0] this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0]
let EDate = this.modelItemDetail.eDate.split('/') let EDate = this.modelItemDetail.eDate.split('/')
this.eDate = EDate[2]+"-"+EDate[1]+"-"+EDate[0]
console.log(item); console.log(item);
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`; this.closeResult = `Closed with: ${result}`;
...@@ -113,13 +125,7 @@ export class PendingComponent implements OnInit { ...@@ -113,13 +125,7 @@ export class PendingComponent implements OnInit {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`; this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
}); });
} }
date='10-12-2561'
show(a:string){
console.log(a)
}
sDate = ""
eDate = ""
openRoomDetail(content : string ,item : RoomDetail) { openRoomDetail(content : string ,item : RoomDetail) {
this.modelRoomDetail = item ; this.modelRoomDetail = item ;
this.thStime= this.modelRoomDetail.sTime.hour + ':' + this.modelRoomDetail.sTime.minute this.thStime= this.modelRoomDetail.sTime.hour + ':' + this.modelRoomDetail.sTime.minute
...@@ -127,6 +133,7 @@ export class PendingComponent implements OnInit { ...@@ -127,6 +133,7 @@ export class PendingComponent implements OnInit {
let SDate = this.modelRoomDetail.sDate.split('/') let SDate = this.modelRoomDetail.sDate.split('/')
this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0] this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0]
let EDate = this.modelRoomDetail.eDate.split('/') let EDate = this.modelRoomDetail.eDate.split('/')
this.eDate = EDate[2]+"-"+EDate[1]+"-"+EDate[0]
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`; this.closeResult = `Closed with: ${result}`;
}, (reason) => { }, (reason) => {
...@@ -178,6 +185,7 @@ export class PendingComponent implements OnInit { ...@@ -178,6 +185,7 @@ export class PendingComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.listItemDetail = this.ItemDetailService.getListItemDetail(); this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail(); this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.collectionSizeListRoom = this.listRoomDetail.length;
console.log(this.listItemDetail); console.log(this.listItemDetail);
} }
......
...@@ -33,6 +33,7 @@ export class ItemDetailService { ...@@ -33,6 +33,7 @@ export class ItemDetailService {
eStatus: 'รอการอนุมัติ', eStatus: 'รอการอนุมัติ',
Quantity: '1', Quantity: '1',
eTelephone: undefined, eTelephone: undefined,
email: undefined,
Remark: 'test', Remark: 'test',
}, },
{ {
...@@ -60,6 +61,7 @@ export class ItemDetailService { ...@@ -60,6 +61,7 @@ export class ItemDetailService {
eStatus: 'รอการอนุมัติ', eStatus: 'รอการอนุมัติ',
Quantity: '1', Quantity: '1',
eTelephone: undefined, eTelephone: undefined,
email: undefined,
Remark: 'test', Remark: 'test',
}, },
......
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