Commit bcdb8048 by Your Name

Update Validator หน้า equirment

parent a7c3cead
......@@ -48,8 +48,6 @@ export class ContactAdminComponent implements OnInit {
this.collectionSizeListRoom = this.listContact.length;
this.collectionSize = this.listContact.length
this.myFormAddContact = new FormGroup({
ctName: new FormControl('', [Validators.required]),
ctDesc: new FormControl(''),
......
......@@ -172,9 +172,9 @@
</div>
<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()">บันทึก</button>
<button class=" btn btn-fill btn-danger" type="cancel"
(click)="modal.dismiss('Cross click')">Cancel</button>
(click)="modal.dismiss('Cross click')">ยกเลิก</button>
</div>
</div>
</div>
......@@ -339,7 +339,6 @@
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time" [(ngModel)]="modelRoomDetail.eTime"
formControlName="eTime" />
<div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการจอง.
</div>
......@@ -350,16 +349,16 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelRoomDetail.Remark"
formControlName="Remark"></textarea>
placeholder="......" [(ngModel)]="modelRoomDetail.remark"
formControlName="remark"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" [disabled]="" type="button" (click)="saveBook()">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" [disabled]="myFormRoom.invalid" type="button" (click)="saveBook()">บันทึก</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">ยกเลิก</button>
</div>
</div>
</div>
......@@ -448,15 +447,15 @@
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......" [(ngModel)]="modelItemDetail.Remark"
formControlName="Remark"></textarea>
placeholder="......" [(ngModel)]="modelItemDetail.remark"
formControlName="remark"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit" (click)="saveLend()">Save</button>
<button class=" btn btn-fill btn-danger" [disabled]="myFormEquir.invalid" type="submit" (click)="saveLend()">Save</button>
<button class=" btn btn-fill btn-danger" type="cancel" (click)="modal.dismiss('Cross click')">Cancel</button>
</div>
</div>
......
......@@ -79,23 +79,22 @@ export class EquipmentComponent implements OnInit {
eDate : new FormControl('',[Validators.required]),
sTime : new FormControl('',[Validators.required]),
eTime : new FormControl('',[Validators.required]),
Remark : new FormControl(),
allDay: new FormControl()
remark : new FormControl(''),
allDay: 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]),
eqType : new FormControl('',[Validators.required]),
eqPic : new FormControl('',[Validators.required]),
sDate : new FormControl('',[Validators.required]),
eDate : new FormControl('',[Validators.required]),
sTime : new FormControl('',[Validators.required]),
eTime : new FormControl('',[Validators.required]),
eDate : new FormControl(''),
sTime : new FormControl(''),
eTime : new FormControl(''),
Quantity : new FormControl('',[Validators.required]),
Remark : new FormControl('',[Validators.required]),
remark : new FormControl(''),
})
}
......@@ -114,6 +113,21 @@ export class EquipmentComponent implements OnInit {
this.modelItemDetail = new ItemDetail();
this.modelItemDetail.equirment = item ;
this.myFormEquir = new FormGroup({
userNameForm : new FormControl(this.modelItemDetail.userName,[Validators.required]),
eTelephone : new FormControl(this.modelItemDetail.eTelephone,[Validators.required]),
email : new FormControl(this.modelItemDetail.email,[Validators.required, Validators.email]),
eqName : new FormControl(this.modelItemDetail.equirment.eqName,[Validators.required]),
eqDesc : new FormControl(this.modelItemDetail.equirment.eqDesc,[Validators.required]),
sDate : new FormControl(this.modelItemDetail.sDate,[Validators.required]),
eDate : new FormControl(''),
sTime : new FormControl(''),
eTime : new FormControl(''),
Quantity : new FormControl('',[Validators.required]),
remark : new FormControl(''),
})
console.log("item",this.modelItemDetail);
this.modalService.open(Lend, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
......@@ -127,6 +141,22 @@ export class EquipmentComponent implements OnInit {
this.modelRoomDetail = new RoomDetail();
this.modelRoomDetail.room = item ;
this.myFormRoom = new FormGroup({
userNameForm : new FormControl(this.modelRoomDetail.userName,[Validators.required]),
rTelephone : new FormControl(this.modelRoomDetail.rTelephone,[Validators.required]),
email : new FormControl(this.modelRoomDetail.email,[Validators.required, Validators.email]),
rName : new FormControl(this.modelRoomDetail.room.rName,[Validators.required]),
rDesc : new FormControl(this.modelRoomDetail.room.rDesc,[Validators.required]),
rType : new FormControl(this.modelRoomDetail.room.rType,[Validators.required]),
sDate : new FormControl(this.modelRoomDetail.sDate,[Validators.required]),
eDate : new FormControl(this.modelRoomDetail.eDate,[Validators.required]),
sTime : new FormControl(this.modelRoomDetail.sTime,[Validators.required]),
eTime : new FormControl(this.modelRoomDetail.eTime,[Validators.required]),
remark : new FormControl(''),
allDay: new FormControl('')
});
console.log("room",this.modelRoomDetail);
this.modalService.open(Room, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
......
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