Commit 0a2da74a by DESKTOP-HF0LVOG\myhr

Update หน้าเบิกให้สามารถเบิกได้ ติด การจอง

parent 05949bf0
......@@ -16,7 +16,7 @@ export class ItemDetail {
minute: number;
second: number;
};
eStatus: string;
eStatus: number;
Quantity: string;
eTelephone: string;
email: string;
......@@ -28,7 +28,7 @@ export class ItemDetail {
this.userName = '';
this.sDate = '';
this.eDate = '';
this.eStatus = '';
this.eStatus = 0;
this.Quantity = '';
this.eTelephone = '';
this.email = '';
......
import { Room } from "./rooms.model";
export class RoomDetail {
Id?: number;
room: Room;
......@@ -16,7 +18,7 @@ export class RoomDetail {
minute: number;
second: number;
};
rStatus: string;
rStatus: number;
rTelephone: string;
email: string;
Remark: string;
......@@ -27,7 +29,7 @@ export class RoomDetail {
this.userName = '';
this.sDate = '';
this.eDate = '';
this.rStatus = '';
this.rStatus = 0;
this.rTelephone = '';
this.email = '';
this.Remark = '';
......
......@@ -257,7 +257,7 @@
<div class=" form-group">
<label> ชื่อผู้จอง </label>
<input class=" form-control" placeholder="" type="text"
formControlName="userNameForm" />
[(ngModel)]="modelRoomDetail.userName" formControlName="userNameForm" />
<div style="color: red;" *ngIf="myFormRoom.controls.userNameForm.status=='INVALID'">
กรุณากรอกชื่อผู้จอง.</div>
</div>
......@@ -330,7 +330,7 @@
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<ngb-timepicker [(ngModel)]="modelRoomDetail.etime" formControlName="eTime">
<ngb-timepicker [(ngModel)]="modelRoomDetail.eTime" formControlName="eTime">
</ngb-timepicker>
<div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการจอง.
......@@ -380,6 +380,18 @@
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> อีเมลผู้เบิก </label>
<input class=" form-control" placeholder="" type="text" value=""
[(ngModel)]="modelItemDetail.email" formControlName="email" />
<div style="color: red;" *ngIf="myFormEquir.controls.email.status=='INVALID'">
กรุณากรอกอีเมล.
</div>
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text" value=""
[(ngModel)]="modelItemDetail.eTelephone" formControlName="eTelephone" />
......
......@@ -176,9 +176,15 @@ export class EquipmentComponent implements OnInit {
}
saveBook() {
this.modelRoomDetail.sDate = this.modelRoomDetail.sDate.split("-")[2]+"/"+this.modelRoomDetail.sDate.split("-")[1]+"/"+this.modelRoomDetail.sDate.split("-")[0];
this.modelRoomDetail.eDate = this.modelRoomDetail.eDate.split("-")[2]+"/"+this.modelRoomDetail.eDate.split("-")[1]+"/"+this.modelRoomDetail.eDate.split("-")[0];
this.modelRoomDetail.rStatus = 0 ;
this.RoomDetailService.addRoomDetail(this.modelRoomDetail);
this.modalService.dismissAll();
this.ngOnInit();
}
}
......@@ -90,11 +90,11 @@
<td>{{ item.room.rName }}</td>
<td>{{ item.room.rDesc }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{
<td>{{ item.sDate | date : 'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{
item.sTime.minute }}</td>
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{
<td>{{ item.eDate | date : 'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{
item.eTime.minute }}</td>
<td>{{ item.rStatus }}</td>
<td>{{ item.rStatus==0 ? "รอดำเนินการ" : "อนุมัติ" }}</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
......@@ -110,7 +110,7 @@
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option>
......@@ -153,12 +153,12 @@
<td>{{ item.equirment.eqName }}</td>
<td>{{ item.equirment.eqDesc }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.sDate.replaceAll("/","-") }} {{ item.sTime.hour }}:{{
<td>{{ item.sDate | date : 'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{
item.sTime.minute }}</td>
<td>{{ item.eDate.replaceAll("/","-") }} {{ item.eTime.hour }}:{{
<td>{{ item.eDate | date : 'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{
item.eTime.minute }}</td>
<td>{{ item.Quantity }}</td>
<td>{{ item.eStatus }}</td>
<td>{{ item.eStatus==0 ? "รอดำเนินการ" : "อนุมัติ" }}</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
......@@ -174,7 +174,7 @@
<ng-template ngbPaginationPrevious>Previous</ng-template>
<ng-template ngbPaginationNext>Next</ng-template>
</ngb-pagination>
<select class="custom-select" style="width: auto" [(ngModel)]="pageSizeListRoom"
(ngModelChange)="pageListRoom=1">
<option [ngValue]="10">10 items per page</option>
......
......@@ -114,6 +114,7 @@ export class PendingComponent implements OnInit {
this.modelItemDetail = item ;
this.thStime= this.modelItemDetail.sTime.hour + ':' + this.modelItemDetail.sTime.minute
this.thEtime= this.modelItemDetail.eTime.hour + ':' + this.modelItemDetail.eTime.minute
let SDate = this.modelItemDetail.sDate.split('/')
this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0]
let EDate = this.modelItemDetail.eDate.split('/')
......@@ -139,6 +140,7 @@ export class PendingComponent implements OnInit {
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
console.log("date",this.sDate)
}
rDate(item: string, item2: string){
......@@ -151,7 +153,6 @@ export class PendingComponent implements OnInit {
if(item2=="edate"){
this.modelItemDetail.eDate = dates
}
console.log(this.sDate)
}
......@@ -186,7 +187,7 @@ export class PendingComponent implements OnInit {
this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.collectionSizeListRoom = this.listRoomDetail.length;
console.log(this.listItemDetail);
console.log(this.listRoomDetail);
}
}
......
......@@ -18,8 +18,8 @@ export class ItemDetailService {
eqPic: "assets/img/mou.jpg"
},
userName: 'เกม',
sDate: '10/12/2560',
eDate: '10/11/2561',
sDate: '09/12/2021',
eDate: '09/12/2021',
sTime: {
hour: 22,
minute: 30,
......@@ -30,7 +30,7 @@ export class ItemDetailService {
minute: 30,
second: 0
},
eStatus: 'รอการอนุมัติ',
eStatus: 0,
Quantity: '1',
eTelephone: '0123456789',
email: 'qwerty@qwerty',
......@@ -46,8 +46,8 @@ export class ItemDetailService {
eqPic: "assets/img/notebook.jpg"
},
userName: 'แป๊ะ',
sDate: '13/12/2560',
eDate: '13/12/2561',
sDate: '09/12/2021',
eDate: '09/12/2021',
sTime: {
hour: 22,
minute: 30,
......@@ -58,7 +58,7 @@ export class ItemDetailService {
minute: 30,
second: 0
},
eStatus: 'รอการอนุมัติ',
eStatus: 1,
Quantity: '1',
eTelephone: '0123456789',
email: 'qwerty@qwerty',
......
......@@ -19,8 +19,8 @@ export class RoomDetailService {
rDesc: "จำนวนคน 25 คน",
},
userName: 'เกม',
sDate: '10/12/2560',
eDate: '10/11/2561',
sDate: '2021/12/09',
eDate: '2021/12/09',
sTime: {
hour: 22,
minute: 30,
......@@ -31,7 +31,7 @@ export class RoomDetailService {
minute: 30,
second: 0
},
rStatus: 'รอการอนุมัติ',
rStatus: 1,
rTelephone: '0123456789',
email: 'qwerty@qwerty',
Remark: 'test',
......@@ -47,8 +47,8 @@ export class RoomDetailService {
rDesc: "จำนวนคน 50 คน",
},
userName: 'เกม',
sDate: '10/12/2560',
eDate: '10/11/2561',
sDate: '2021/12/09',
eDate: '2021/12/09',
sTime: {
hour: 22,
minute: 30,
......@@ -59,7 +59,7 @@ export class RoomDetailService {
minute: 30,
second: 0
},
rStatus: 'รอการอนุมัติ',
rStatus: 1,
rTelephone: '0123456789',
email: 'qwerty@qwerty',
Remark: 'test',
......@@ -72,9 +72,9 @@ export class RoomDetailService {
}
addRoomDetail(model: RoomDetail) {
console.log(this.listRoomDetail);
this.listRoomDetail.push(model);
console.log(this.listRoomDetail);
}
getListRoomDetail() {
......
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