Commit 1c5ae3b3 by DESKTOP-HF0LVOG\myhr

Update จองทั้งวัน เหลือเบิก

parent 37815da0
...@@ -13,6 +13,7 @@ export class ItemDetail { ...@@ -13,6 +13,7 @@ export class ItemDetail {
eTelephone: string; eTelephone: string;
email: string; email: string;
remark: string; remark: string;
allDay: boolean;
constructor(init?: ItemDetail) { constructor(init?: ItemDetail) {
Object.assign(this, init); Object.assign(this, init);
this.id = 1; this.id = 1;
...@@ -25,6 +26,7 @@ export class ItemDetail { ...@@ -25,6 +26,7 @@ export class ItemDetail {
this.eTelephone = ''; this.eTelephone = '';
this.email = ''; this.email = '';
this.remark = ''; this.remark = '';
this.allDay = true;
} }
} }
......
...@@ -12,6 +12,7 @@ export class RoomDetail { ...@@ -12,6 +12,7 @@ export class RoomDetail {
rTelephone: string; rTelephone: string;
email: string; email: string;
remark: string; remark: string;
allDay: boolean;
constructor(init?: RoomDetail) { constructor(init?: RoomDetail) {
Object.assign(this, init); Object.assign(this, init);
this.id = 1; this.id = 1;
...@@ -23,6 +24,7 @@ export class RoomDetail { ...@@ -23,6 +24,7 @@ export class RoomDetail {
this.rTelephone = ''; this.rTelephone = '';
this.email = ''; this.email = '';
this.remark = ''; this.remark = '';
this.allDay = true;
} }
} }
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of listItemDetail"> <tr *ngFor="let item of listItemDetail">
<th scope="row">{{ item.Id }}</th> <th scope="row">{{ item.id }}</th>
<td>{{ item.equirment.eqType }}</td> <td>{{ item.equirment.eqType }}</td>
<td>{{ item.equirment.eqName }}</td> <td>{{ item.equirment.eqName }}</td>
<td>{{ item.equirment.eqDesc }}</td> <td>{{ item.equirment.eqDesc }}</td>
...@@ -249,6 +249,18 @@ ...@@ -249,6 +249,18 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 mb-1">
<div class=" form-check">
<label class=" form-check-label">
<input class=" form-check" type="checkbox" [(ngModel)]="modelRoomDetail.allDay" formControlName="allDay" />
<span class=" form-check-sign">
<span class="check">ทั้งวัน</span>
</span>
</label>
</div>
</div>
</div>
<div class="row" *ngIf="!modelRoomDetail.allDay">
<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" [(ngModel)]="sDate" <input type="date" class="form-control" [(ngModel)]="sDate"
...@@ -431,7 +443,7 @@ ...@@ -431,7 +443,7 @@
<option value="0" style="color: black;">รอดำเนินการ</option> <option value="0" style="color: black;">รอดำเนินการ</option>
<option value="1" style="color: black;">อนุมัติ</option> <option value="1" style="color: black;">อนุมัติ</option>
<option value="2" style="color: black;">ยกเลิก</option> <option value="2" style="color: black;">ยกเลิก</option>
<option value="3" style="color: black;">สำเร็จแล้ว</option> <option value="3" style="color: black;">คืนแล้ว</option>
</select> </select>
</div> </div>
</div> </div>
......
...@@ -125,7 +125,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -125,7 +125,8 @@ export class AdminPendingComponent implements OnInit {
eTime: new FormControl(this.modelItemDetail.eTime, [Validators.required]), eTime: new FormControl(this.modelItemDetail.eTime, [Validators.required]),
Quantity: new FormControl(this.modelItemDetail.Quantity, [Validators.required]), Quantity: new FormControl(this.modelItemDetail.Quantity, [Validators.required]),
Remark: new FormControl(this.modelItemDetail.remark), Remark: new FormControl(this.modelItemDetail.remark),
eStatus: new FormControl(this.modelItemDetail.eStatus) eStatus: new FormControl(this.modelItemDetail.eStatus),
allDay: new FormControl(this.modelItemDetail.allDay)
}) })
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`; this.closeResult = `Closed with: ${result}`;
...@@ -167,7 +168,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -167,7 +168,8 @@ export class AdminPendingComponent implements OnInit {
sTime: new FormControl(this.modelRoomDetail.sTime, [Validators.required]), sTime: new FormControl(this.modelRoomDetail.sTime, [Validators.required]),
eTime: new FormControl(this.modelRoomDetail.eTime, [Validators.required]), eTime: new FormControl(this.modelRoomDetail.eTime, [Validators.required]),
remark: new FormControl(this.modelRoomDetail.remark), remark: new FormControl(this.modelRoomDetail.remark),
rStatus: new FormControl(this.modelRoomDetail.rStatus) rStatus: new FormControl(this.modelRoomDetail.rStatus),
allDay: new FormControl(this.modelRoomDetail.allDay)
}); });
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`; this.closeResult = `Closed with: ${result}`;
...@@ -241,6 +243,7 @@ export class AdminPendingComponent implements OnInit { ...@@ -241,6 +243,7 @@ export class AdminPendingComponent implements OnInit {
this.modelRoomDetail.eTime = this.myFormRoom.value.eTime this.modelRoomDetail.eTime = this.myFormRoom.value.eTime
this.modelRoomDetail.remark = this.myFormRoom.value.remark this.modelRoomDetail.remark = this.myFormRoom.value.remark
this.modelRoomDetail.rStatus = this.myFormRoom.value.rStatus this.modelRoomDetail.rStatus = this.myFormRoom.value.rStatus
this.modelRoomDetail.allDay = this.myFormRoom.value.allDay
console.log("this.modelRoomDetail", this.modelRoomDetail) console.log("this.modelRoomDetail", this.modelRoomDetail)
this.RoomDetailService.updateRoomDetail(this.modelRoomDetail) this.RoomDetailService.updateRoomDetail(this.modelRoomDetail)
this.modalService.dismissAll(); this.modalService.dismissAll();
...@@ -263,6 +266,7 @@ export class AdminPendingComponent implements OnInit { ...@@ -263,6 +266,7 @@ export class AdminPendingComponent implements OnInit {
this.modelItemDetail.eTime = this.myFormEquir.value.eTime this.modelItemDetail.eTime = this.myFormEquir.value.eTime
this.modelItemDetail.remark = this.myFormEquir.value.remark this.modelItemDetail.remark = this.myFormEquir.value.remark
this.modelItemDetail.eStatus = this.myFormEquir.value.eStatus this.modelItemDetail.eStatus = this.myFormEquir.value.eStatus
this.modelItemDetail.allDay = this.myFormEquir.value.allDay
console.log("this.modelItemDetail", this.modelItemDetail) console.log("this.modelItemDetail", this.modelItemDetail)
this.ItemDetailService.updateItemDetail(this.modelItemDetail) this.ItemDetailService.updateItemDetail(this.modelItemDetail)
this.modalService.dismissAll(); this.modalService.dismissAll();
......
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
<div class="col-12 mb-1"> <div class="col-12 mb-1">
<div class=" form-check"> <div class=" form-check">
<label class=" form-check-label"> <label class=" form-check-label">
<input class=" form-check{{readonly ? 'danger' : 'success'}}" type="checkbox" value="" (click)="readonly = !readonly" /> <input class=" form-check" type="checkbox" [(ngModel)]="modelRoomDetail.allDay" formControlName="allDay" />
<span class=" form-check-sign"> <span class=" form-check-sign">
<span class="check">ทั้งวัน</span> <span class="check">ทั้งวัน</span>
</span> </span>
...@@ -325,12 +325,11 @@ ...@@ -325,12 +325,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row" *ngIf="!modelRoomDetail.allDay">
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input class="form-control" type="time" [(ngModel)]="modelRoomDetail.sTime" <input class="form-control" type="time" [(ngModel)]="modelRoomDetail.sTime"
formControlName="sTime" [readonly]="readonly"/> formControlName="sTime"/>
<div style="color: red;" *ngIf="myFormRoom.controls.sTime.status=='INVALID'"> <div style="color: red;" *ngIf="myFormRoom.controls.sTime.status=='INVALID'">
กรุณากรอกเวลาที่เริ่มต้นการจอง. กรุณากรอกเวลาที่เริ่มต้นการจอง.
</div> </div>
...@@ -339,7 +338,7 @@ ...@@ -339,7 +338,7 @@
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input class="form-control" type="time" [(ngModel)]="modelRoomDetail.eTime" <input class="form-control" type="time" [(ngModel)]="modelRoomDetail.eTime"
formControlName="eTime" [readonly]="readonly"/> formControlName="eTime" />
<div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'"> <div style="color: red;" *ngIf="myFormRoom.controls.eTime.status=='INVALID'">
กรุณากรอกเวลาที่สิ้นสุดการจอง. กรุณากรอกเวลาที่สิ้นสุดการจอง.
......
...@@ -79,7 +79,8 @@ export class EquipmentComponent implements OnInit { ...@@ -79,7 +79,8 @@ export class EquipmentComponent implements OnInit {
eDate : new FormControl('',[Validators.required]), eDate : new FormControl('',[Validators.required]),
sTime : new FormControl('',[Validators.required]), sTime : new FormControl('',[Validators.required]),
eTime : new FormControl('',[Validators.required]), eTime : new FormControl('',[Validators.required]),
Remark : new FormControl() Remark : new FormControl(),
allDay: new FormControl()
}); });
this.myFormEquir = new FormGroup({ this.myFormEquir = new FormGroup({
userNameForm : new FormControl('',[Validators.required]), userNameForm : new FormControl('',[Validators.required]),
......
...@@ -71,13 +71,15 @@ ...@@ -71,13 +71,15 @@
<li [ngbNavItem]="1"> <li [ngbNavItem]="1">
<a ngbNavLink>ปฏิทินการจองห้อง</a> <a ngbNavLink>ปฏิทินการจองห้อง</a>
<ng-template ngbNavContent> <ng-template ngbNavContent>
<full-calendar #calendarBook [options]="calendarRoom"></full-calendar> <full-calendar #calendarBook [options]="calendarRoom" style="
margin-top: 20px;"></full-calendar>
</ng-template> </ng-template>
</li> </li>
<li [ngbNavItem]="2"> <li [ngbNavItem]="2">
<a ngbNavLink>ปฏิทินการยืมรถ</a> <a ngbNavLink>ปฏิทินการยืมรถ</a>
<ng-template ngbNavContent> <ng-template ngbNavContent>
<full-calendar #calendar [options]="calendarEquirment"></full-calendar> <full-calendar #calendar [options]="calendarEquirment" style="
margin-top: 20px;"></full-calendar>
</ng-template> </ng-template>
</li> </li>
</ul> </ul>
......
...@@ -143,8 +143,7 @@ export class HomePageComponent implements OnInit { ...@@ -143,8 +143,7 @@ export class HomePageComponent implements OnInit {
end: '2021-12-16T11:30:00', end: '2021-12-16T11:30:00',
extendedProps: this.listRoomDetail[i], extendedProps: this.listRoomDetail[i],
description: this.listRoomDetail[i].remark, description: this.listRoomDetail[i].remark,
color: 'rgb(250,250,250)', allDay : this.listRoomDetail[i].allDay
textColor: 'white'
} }
) )
} }
...@@ -171,6 +170,7 @@ export class HomePageComponent implements OnInit { ...@@ -171,6 +170,7 @@ export class HomePageComponent implements OnInit {
this.calendarRoom = { this.calendarRoom = {
initialView: 'dayGridMonth', initialView: 'dayGridMonth',
themeSystem: 'bootstrap', themeSystem: 'bootstrap',
dayMaxEventRows: true,
dateClick: this.handleDateClick.bind(this), // bind is important! dateClick: this.handleDateClick.bind(this), // bind is important!
locale: "th", locale: "th",
events: this.eventRoom events: this.eventRoom
...@@ -179,6 +179,7 @@ export class HomePageComponent implements OnInit { ...@@ -179,6 +179,7 @@ export class HomePageComponent implements OnInit {
this.calendarEquirment = { this.calendarEquirment = {
initialView: 'dayGridMonth', initialView: 'dayGridMonth',
themeSystem: 'bootstrap', themeSystem: 'bootstrap',
dayMaxEventRows: true,
dateClick: this.handleDateClick.bind(this), // bind is important! dateClick: this.handleDateClick.bind(this), // bind is important!
locale: "th", locale: "th",
events: this.eventEquirment events: this.eventEquirment
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let item of listItemDetail"> <tr *ngFor="let item of listItemDetail">
<th scope="row">{{ item.Id }}</th> <th scope="row">{{ item.id }}</th>
<td>{{ item.equirment.eqType }}</td> <td>{{ item.equirment.eqType }}</td>
<td>{{ item.equirment.eqName }}</td> <td>{{ item.equirment.eqName }}</td>
<td>{{ item.equirment.eqDesc }}</td> <td>{{ item.equirment.eqDesc }}</td>
......
...@@ -27,6 +27,7 @@ export class ItemDetailService { ...@@ -27,6 +27,7 @@ export class ItemDetailService {
eTelephone: '0123456789', eTelephone: '0123456789',
email: 'qwerty@qwerty', email: 'qwerty@qwerty',
remark: 'test', remark: 'test',
allDay: false
}, },
{ {
id : 2, id : 2,
...@@ -47,6 +48,7 @@ export class ItemDetailService { ...@@ -47,6 +48,7 @@ export class ItemDetailService {
eTelephone: '0123456789', eTelephone: '0123456789',
email: 'qwerty@qwerty', email: 'qwerty@qwerty',
remark: 'test', remark: 'test',
allDay: false
}, },
] ]
......
...@@ -28,6 +28,7 @@ export class RoomDetailService { ...@@ -28,6 +28,7 @@ export class RoomDetailService {
rTelephone: '0123456789', rTelephone: '0123456789',
email: 'qwerty@qwerty', email: 'qwerty@qwerty',
remark: 'test', remark: 'test',
allDay: false
}, },
{ {
id: 2, id: 2,
...@@ -48,6 +49,7 @@ export class RoomDetailService { ...@@ -48,6 +49,7 @@ export class RoomDetailService {
rTelephone: '0123456789', rTelephone: '0123456789',
email: 'qwerty@qwerty', email: 'qwerty@qwerty',
remark: 'test', remark: 'test',
allDay: true
}, },
] ]
......
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