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);
......
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