Commit 08fda832 by DESKTOP-HF0LVOG\myhr

Update หน้าจองเบิก

parent 513f6499
import { CategoryModel } from "./ItemDetail.model"; import { CategoryModel } from "./itemDetail.model";
export class Equirment { export class Equirment {
eqId: number; eqId: number;
......
...@@ -17,7 +17,8 @@ export class RoomDetail { ...@@ -17,7 +17,8 @@ export class RoomDetail {
second: number; second: number;
}; };
rStatus: string; rStatus: string;
rTelephone: number; rTelephone: string;
email: undefined;
Remark: string; Remark: string;
constructor(init?: RoomDetail) { constructor(init?: RoomDetail) {
Object.assign(this, init); Object.assign(this, init);
...@@ -28,6 +29,7 @@ export class RoomDetail { ...@@ -28,6 +29,7 @@ export class RoomDetail {
this.eDate = ''; this.eDate = '';
this.rStatus = ''; this.rStatus = '';
this.rTelephone = undefined; this.rTelephone = undefined;
this.email = undefined;
this.Remark = ''; this.Remark = '';
} }
} }
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { Equirment } from 'src/app/models/equirment.model'; import { Equirment } from 'src/app/models/equirment.model';
import { ItemDetail } from 'src/app/models/ItemDetail.model'; import { ItemDetail } from 'src/app/models/itemDetail.model';
import { RoomDetail } from 'src/app/models/RoomDetail.model'; import { RoomDetail } from 'src/app/models/RoomDetail.model';
import { MyRoom, Room } from 'src/app/models/rooms.model'; import { MyRoom, Room } from 'src/app/models/rooms.model';
import { EquirmentService } from 'src/app/service/equirment.service'; import { EquirmentService } from 'src/app/service/equirment.service';
......
...@@ -7,6 +7,7 @@ import { ItemDetailService } from 'src/app/service/item-detail.service'; ...@@ -7,6 +7,7 @@ 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';
@Component({ @Component({
selector: 'app-admin-pending', selector: 'app-admin-pending',
...@@ -62,6 +63,9 @@ export class AdminPendingComponent implements OnInit { ...@@ -62,6 +63,9 @@ 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])
...@@ -70,6 +74,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -70,6 +74,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) {
this.fromDate = calendar.getToday(); this.fromDate = calendar.getToday();
this.toDate = calendar.getNext(calendar.getToday(), 'd', 10); this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<h5 class=" title">Add Equirment</h5> <h5 class=" title">Add Equirment</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">
...@@ -146,8 +146,8 @@ ...@@ -146,8 +146,8 @@
<div class=" form-group"> <div class=" form-group">
<label> หมวดหมู่ </label> <label> หมวดหมู่ </label>
<br> <br>
<select class="form-select" <select class="form-select" aria-label="Default select example"
aria-label="Default select example" [(ngModel)]="modelEquirment.eqType"> [(ngModel)]="modelEquirment.eqType">
<option selected>เลือกหมวดหมู่</option> <option selected>เลือกหมวดหมู่</option>
<option value="4">IT</option> <option value="4">IT</option>
<option value="5">Company</option> <option value="5">Company</option>
...@@ -159,20 +159,19 @@ ...@@ -159,20 +159,19 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> รายละเอียด</label> <label> รายละเอียด</label>
<textarea class="form-control" <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelEquirment.eqDesc"></textarea> placeholder="......" [(ngModel)]="modelEquirment.eqDesc"></textarea>
</div> </div>
</div> </div>
</div> </div>
<label for="exampleFormControlFile">แนบไฟล์รูปภาพ</label> <label for="exampleFormControlFile">แนบไฟล์รูปภาพ</label>
<input type="file" class="form-control-file" <input type="file" class="form-control-file" id="exampleFormControlFile">
id="exampleFormControlFile">
</form>
</div> </div>
<div class=" card-footer"> <div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveEquirment()">Save</button> <button class=" btn btn-fill btn-danger" type="submit" (click)="saveEquirment()">Save</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">Cancel</button> <button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">Cancel</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -185,7 +184,6 @@ ...@@ -185,7 +184,6 @@
<h5 class=" title">Add Equirment</h5> <h5 class=" title">Add Equirment</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">
...@@ -199,7 +197,8 @@ ...@@ -199,7 +197,8 @@
<div class=" form-group"> <div class=" form-group">
<label> ประเภท </label> <label> ประเภท </label>
<br> <br>
<select class="form-select" aria-label="Default select example" [(ngModel)]="modelRoom.rType"> <select class="form-select" aria-label="Default select example"
[(ngModel)]="modelRoom.rType">
<option selected>เลือกประเภท</option> <option selected>เลือกประเภท</option>
<option value="1">ห้อง</option> <option value="1">ห้อง</option>
<option value="2">รถ</option> <option value="2">รถ</option>
...@@ -218,11 +217,11 @@ ...@@ -218,11 +217,11 @@
</div> </div>
<label for="exampleFormControlFile">แนบไฟล์รูปภาพ</label> <label for="exampleFormControlFile">แนบไฟล์รูปภาพ</label>
<input type="file" class="form-control-file" id="exampleFormControlFile"> <input type="file" class="form-control-file" id="exampleFormControlFile">
</form>
</div> </div>
<div class=" card-footer"> <div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveRoom()">Save</button> <button class=" btn btn-fill btn-danger" type="submit" (click)="saveRoom()">Save</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">Cancel</button> <button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">Cancel</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -235,12 +234,28 @@ ...@@ -235,12 +234,28 @@
<h5 class=" title">การจอง</h5> <h5 class=" title">การจอง</h5>
</div> </div>
<div class=" card-body"> <div class=" card-body">
<form> <form [formGroup]="myFormRoom" class="needs-validation">
<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 class=" form-control" placeholder="" type="text" value="" [(ngModel)]="modelRoomDetail.userName"/> <input class=" form-control" placeholder="" type="text"
formControlName="userNameForm" />
<div style="color: red;" *ngIf="myFormRoom.controls.userNameForm.status=='INVALID'">
Invalid
Username.</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)]="modelRoomDetail.email" formControlName="email" />
<div style="color: red;" *ngIf="myFormRoom.controls.email.status=='INVALID'">Valid
Email.
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -248,40 +263,61 @@ ...@@ -248,40 +263,61 @@
<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="" [(ngModel)]="modelRoomDetail.rTelephone" /> <input class=" form-control" placeholder="" type="text" value=""
[(ngModel)]="modelRoomDetail.rTelephone" formControlName="rTelephone" />
<div style="color: red;" *ngIf="myFormRoom.controls.rTelephone.status=='INVALID'">Valid
Telephone.</div>
</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 readonly class="form-control" type="text" [value]="modelRoomDetail.room.rName"> <input readonly class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rName"
formControlName="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 readonly class="form-control" type="text" [value]="modelRoomDetail.room.rDesc"> <input readonly class="form-control" type="text" [(ngModel)]="modelRoomDetail.room.rDesc"
formControlName="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" value="" [(ngModel)]="modelRoomDetail.sDate"> <input type="date" class="form-control" value="" [(ngModel)]="modelRoomDetail.sDate"
formControlName="sDate">
<div style="color: red;" *ngIf="myFormRoom.controls.sDate.status=='INVALID'">Valid Start
Date.
</div>
</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" value="" [(ngModel)]="modelRoomDetail.eDate"> <input type="date" class="form-control" value="" [(ngModel)]="modelRoomDetail.eDate"
formControlName="eDate">
<div style="color: red;" *ngIf="myFormRoom.controls.eDate.status=='INVALID'">Valid End Date.
</div>
</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>
<ngb-timepicker [(ngModel)]="modelRoomDetail.sTime"></ngb-timepicker> <ngb-timepicker [(ngModel)]="modelRoomDetail.sTime" formControlName="sTime">
</ngb-timepicker>
<div style="color: red;" *ngIf="myFormRoom.controls.sTime.status=='INVALID'">Valid Start
Time.
</div>
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<ngb-timepicker [(ngModel)]="modelRoomDetail.etime"></ngb-timepicker> <ngb-timepicker [(ngModel)]="modelRoomDetail.etime" formControlName="eTime">
</ngb-timepicker>
<div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'">Valid End Time.
</div>
</div> </div>
</div> </div>
<div class=" row"> <div class=" row">
...@@ -289,14 +325,15 @@ ...@@ -289,14 +325,15 @@
<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="......" [(ngModel)]="modelRoomDetail.Remark"></textarea> placeholder="......" [(ngModel)]="modelRoomDetail.Remark"
formControlName="Remark"></textarea>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class=" card-footer"> <div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveBook()">Save</button> <button class=" btn btn-fill btn-danger" [disabled]="" type="button" (click)="validate()">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button> <button class=" btn btn-fill btn-danger" type="close">Cancel</button>
</div> </div>
</div> </div>
...@@ -310,12 +347,16 @@ ...@@ -310,12 +347,16 @@
<h5 class=" title">เบิกอุปกรณ์</h5> <h5 class=" title">เบิกอุปกรณ์</h5>
</div> </div>
<div class=" card-body"> <div class=" card-body">
<form> <form [formGroup]="myFormEquir" class="needs-validation">
<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 class=" form-control" placeholder="" type="text" value="" [(ngModel)]="modelItemDetail.userName"/> <input class=" form-control" placeholder="" type="text" value=""
[(ngModel)]="modelItemDetail.userName" formControlName="userNameForm" />
<div style="color: red;" *ngIf="myFormEquir.controls.userNameForm.status=='INVALID'">
Valid End Time.
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -323,47 +364,73 @@ ...@@ -323,47 +364,73 @@
<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="" [(ngModel)]="modelItemDetail.eTelephone"/> <input class=" form-control" placeholder="" type="text" value=""
[(ngModel)]="modelItemDetail.eTelephone" formControlName="eTelephone" />
<div style="color: red;" *ngIf="myFormEquir.controls.eTelephone.status=='INVALID'">Valid
End Time.
</div>
</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 readonly class="form-control" type="text" [value]="modelItemDetail.equirment.eqName" > <input readonly class="form-control" type="text" [value]="modelItemDetail.equirment.eqName"
formControlName="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 readonly class="form-control" type="text" [value]="modelItemDetail.equirment.eqDesc"> <input readonly class="form-control" type="text" [value]="modelItemDetail.equirment.eqDesc"
formControlName="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" value="" [(ngModel)]="modelItemDetail.sDate"> <input type="date" class="form-control" value="" [(ngModel)]="modelItemDetail.sDate"
formControlName="sDate">
<div style="color: red;" *ngIf="myFormEquir.controls.sDate.status=='INVALID'">Valid End
Time.
</div>
</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" value="" [(ngModel)]="modelItemDetail.eDate"> <input type="date" class="form-control" value="" [(ngModel)]="modelItemDetail.eDate"
formControlName="eDate">
<div style="color: red;" *ngIf="myFormEquir.controls.eDate.status=='INVALID'">Valid End
Time.
</div>
</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>
<ngb-timepicker [(ngModel)]="modelItemDetail.sTime"></ngb-timepicker> <ngb-timepicker [(ngModel)]="modelItemDetail.sTime" formControlName="sTime">
</ngb-timepicker>
<div style="color: red;" *ngIf="myFormEquir.controls.sTime.status=='INVALID'">Valid End
Time.
</div>
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<ngb-timepicker [(ngModel)]="modelItemDetail.eTime"></ngb-timepicker> <ngb-timepicker [(ngModel)]="modelItemDetail.eTime" formControlName="eTime">
</ngb-timepicker>
<div style="color: red;" *ngIf="myFormEquir.controls.eTime.status=='INVALID'">Valid End
Time.
</div>
</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"
[(ngModel)]="modelItemDetail.Quantity" /> [(ngModel)]="modelItemDetail.Quantity" formControlName="Quantity" />
<div style="color: red;" *ngIf="myFormEquir.controls.Quantity.status=='INVALID'">Valid End
Time.
</div>
</div> </div>
</div> </div>
<div class=" row"> <div class=" row">
...@@ -371,14 +438,15 @@ ...@@ -371,14 +438,15 @@
<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="......" [(ngModel)]="modelItemDetail.Remark"></textarea> placeholder="......" [(ngModel)]="modelItemDetail.Remark"
formControlName="Remark"></textarea>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class=" card-footer"> <div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveLend()">Save</button> <button class=" btn btn-fill btn-danger" type="submit" (click)="validate()">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button> <button class=" btn btn-fill btn-danger" type="close">Cancel</button>
</div> </div>
</div> </div>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { Equirment } from 'src/app/models/equirment.model'; import { Equirment } from 'src/app/models/equirment.model';
import { ItemDetail } from 'src/app/models/ItemDetail.model'; import { ItemDetail } from 'src/app/models/itemDetail.model';
import { RoomDetail } from 'src/app/models/RoomDetail.model'; import { RoomDetail } from 'src/app/models/RoomDetail.model';
import { MyRoom, Room } from 'src/app/models/rooms.model'; import { MyRoom, Room } from 'src/app/models/rooms.model';
import { EquirmentService } from 'src/app/service/equirment.service'; import { EquirmentService } from 'src/app/service/equirment.service';
import { ItemDetailService } from 'src/app/service/item-detail.service'; import { ItemDetailService } from 'src/app/service/item-detail.service';
import { RoomService } from 'src/app/service/room.service'; import { RoomService } from 'src/app/service/room.service';
import { RoomDetailService } from 'src/app/service/room-detail.service'; import { RoomDetailService } from 'src/app/service/room-detail.service';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
@Component({ @Component({
...@@ -31,13 +32,54 @@ export class EquipmentComponent implements OnInit { ...@@ -31,13 +32,54 @@ export class EquipmentComponent implements OnInit {
modelItemDetail = new ItemDetail(); modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail(); modelRoomDetail = new RoomDetail();
constructor(private modalService: NgbModal, private equirmentService: EquirmentService, private roomService: RoomService, private ItemDetailService : ItemDetailService, private RoomDetailService : RoomDetailService) { myFormRoom: FormGroup;
myFormEquir: FormGroup;
constructor(private modalService: NgbModal, private equirmentService: EquirmentService, private roomService: RoomService, private ItemDetailService : ItemDetailService, private RoomDetailService : RoomDetailService
,private fb: FormBuilder) {
} }
validate(){
console.log(this.myFormRoom.controls.userNameForm.status)
console.log(this.myFormRoom)
// var form = document.getElementsByClassName('needs-validation')[0] as HTMLFormElement;
// if (form.checkValidity() === false) {
// event.preventDefault();
// event.stopPropagation();
// }
// form.classList.add('was-validated');
}
ngOnInit() { ngOnInit() {
this.listEquirmentModel = this.equirmentService.getListEquirment(); this.listEquirmentModel = this.equirmentService.getListEquirment();
this.listRoomModel = this.roomService.getListRoom(); this.listRoomModel = this.roomService.getListRoom();
this.myFormRoom = new FormGroup({
userNameForm : new FormControl('',[Validators.required]),
rTelephone : new FormControl('',[Validators.required]),
email : new FormControl('',[Validators.required, Validators.email]),
rName : new FormControl(),
rDesc : new FormControl(),
sDate : new FormControl('',[Validators.required]),
eDate : new FormControl('',[Validators.required]),
sTime : new FormControl('',[Validators.required]),
eTime : new FormControl('',[Validators.required]),
Remark : new FormControl()
});
this.myFormEquir = new FormGroup({
userNameForm : new FormControl('',[Validators.required]),
eTelephone : new FormControl('',[Validators.required]),
email : new FormControl('',[Validators.required, Validators.email]),
eqName : new FormControl('',[Validators.required]),
eqDesc : new FormControl('',[Validators.required]),
sDate : new FormControl('',[Validators.required]),
eDate : new FormControl('',[Validators.required]),
sTime : new FormControl('',[Validators.required]),
eTime : new FormControl('',[Validators.required]),
Quantity : new FormControl('',[Validators.required]),
Remark : new FormControl('',[Validators.required]),
})
} }
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ItemDetail } from 'src/app/models/ItemDetail.model'; import { ItemDetail } from 'src/app/models/itemDetail.model';
@Component({ @Component({
selector: 'app-lend-page', selector: 'app-lend-page',
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap'; import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { ItemDetail } from 'src/app/models/ItemDetail.model'; import { ItemDetail } from 'src/app/models/itemDetail.model';
import { ItemDetailService } from 'src/app/service/item-detail.service'; 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 { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ItemDetail, SearchItemDetailModel } from '../models/ItemDetail.model'; import { ItemDetail, SearchItemDetailModel } from '../models/itemDetail.model';
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class ItemDetailService { export class ItemDetailService {
......
...@@ -33,6 +33,7 @@ export class RoomDetailService { ...@@ -33,6 +33,7 @@ export class RoomDetailService {
}, },
rStatus: 'รอการอนุมัติ', rStatus: 'รอการอนุมัติ',
rTelephone: undefined, rTelephone: undefined,
email: undefined,
Remark: 'test', Remark: 'test',
}, },
{ {
...@@ -60,6 +61,7 @@ export class RoomDetailService { ...@@ -60,6 +61,7 @@ export class RoomDetailService {
}, },
rStatus: 'รอการอนุมัติ', rStatus: 'รอการอนุมัติ',
rTelephone: undefined, rTelephone: 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