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