Commit 74c076f9 by Your Name

update cal detail

parent 5b5cd234
...@@ -13,6 +13,7 @@ export class RoomDetail { ...@@ -13,6 +13,7 @@ export class RoomDetail {
email: string; email: string;
remark: string; remark: string;
allDay: boolean; allDay: boolean;
constructor(init?: RoomDetail) { constructor(init?: RoomDetail) {
Object.assign(this, init); Object.assign(this, init);
this.id = 0; this.id = 0;
......
...@@ -195,10 +195,6 @@ export class EquipmentComponent implements OnInit { ...@@ -195,10 +195,6 @@ export class EquipmentComponent implements OnInit {
.slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize); .slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize);
} }
NgbdTimepickerBasic() {
}
saveEquirment() { saveEquirment() {
this.equirmentService.addEquirment(this.modelEquirment); this.equirmentService.addEquirment(this.modelEquirment);
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
</button> </button>
</div> </div>
<div class=" modal-body"> <div class=" modal-body">
<img style="object-fit: cover;" [src]="roomSelect.room.rPic" width="150px" height="150px"
class="nav justify-content-center" ><br>
<div class=" row"> <div class=" row">
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
</button> </button>
</div> </div>
<div class=" modal-body"> <div class=" modal-body">
<img style="object-fit: cover;" [src]="itemSelect.equirments.eqPic" width="150px" height="150px" text-align = "center"
class="nav justify-content-center" ><br>
<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 readonly class=" form-control" type="text" value={{name}} style="color: aliceblue;" /> <input readonly class=" form-control" type="text" [value]="itemSelect.userName" style="color: aliceblue;" />
</div> </div>
</div> </div>
</div> </div>
...@@ -17,20 +19,20 @@ ...@@ -17,20 +19,20 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> เบอร์โทร </label> <label> เบอร์โทร </label>
<input readonly class=" form-control" type="text" value={{telephone}} style="color: aliceblue;" /> <input readonly class=" form-control" type="text" [value]="itemSelect.eTelephone" style="color: aliceblue;" />
</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={{eqName}} style="color: aliceblue;"> <input readonly class="form-control" type="text" [value]="itemSelect.equirments.eqName" style="color: aliceblue;">
</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={{quantity}} style="color: aliceblue;"> <input readonly class="form-control" type="text" [value]="itemSelect.quantity" style="color: aliceblue;">
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -69,17 +69,17 @@ ...@@ -69,17 +69,17 @@
<div class="card-body"> <div class="card-body">
<ul ngbNav #nav="ngbNav" [(activeId)]="active" (navChange)="onNavChange($event)" class="nav-tabs"> <ul ngbNav #nav="ngbNav" [(activeId)]="active" (navChange)="onNavChange($event)" class="nav-tabs">
<li [ngbNavItem]="1"> <li [ngbNavItem]="1">
<a ngbNavLink>ปฏิทินการจองห้อง</a> <a ngbNavLink>ปฏิทินการจอง</a>
<ng-template ngbNavContent> <ng-template ngbNavContent>
<full-calendar #calendarBook [options]="calendarRoom" style=" <full-calendar #calendarBook [options]="calendarRoom" style="
margin-top: 20px;"></full-calendar> margin-top: 20px;" *ngIf="listRoomDetail.length > 0"></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" style=" <full-calendar #calendar [options]="calendarEquirment" style="
margin-top: 20px;"></full-calendar> margin-top: 20px;" *ngIf="listRoomDetail.length > 0"></full-calendar>
</ng-template> </ng-template>
</li> </li>
</ul> </ul>
......
...@@ -18,6 +18,7 @@ import { RoomDetail } from 'src/app/models/RoomDetail.model'; ...@@ -18,6 +18,7 @@ import { RoomDetail } from 'src/app/models/RoomDetail.model';
export class NgbdModalContent { export class NgbdModalContent {
@Input() roomSelect: RoomDetail; @Input() roomSelect: RoomDetail;
telephone; telephone;
rPic;
rName; rName;
sTime; sTime;
eTime; eTime;
...@@ -44,14 +45,15 @@ export class NgbdModalContent { ...@@ -44,14 +45,15 @@ export class NgbdModalContent {
}) })
export class NgbdModalLendContent { export class NgbdModalLendContent {
@Input() name; @Input() itemSelect: ItemDetail;
telephone; telephone;
eqPic;
eqName; eqName;
quantity; quantity;
sDate; sDate;
constructor(public activeModal: NgbActiveModal) { constructor(public activeModal: NgbActiveModal) {
console.log("name", this.itemSelect)
} }
} }
...@@ -204,72 +206,71 @@ export class HomePageComponent implements OnInit { ...@@ -204,72 +206,71 @@ export class HomePageComponent implements OnInit {
setTimeout(function () { setTimeout(function () {
window.dispatchEvent(new Event('resize')) window.dispatchEvent(new Event('resize'))
}, 1) }, 1)
this.ItemDetailService.getListItemDetail().subscribe( result => { this.ItemDetailService.getListItemDetail().subscribe(result => {
this.listItemDetail = result; this.listItemDetail = result;
}); console.log("2", this.listItemDetail)
this.RoomDetailService.getListRoomDetail().subscribe( result => { for (let i = 0; i < this.listItemDetail.length; i++) {
this.listRoomDetail = result; if (this.listItemDetail[i].eStatus == 0) {
}); this.eventEquirment.push({
for (let i = 0; i < this.listRoomDetail.length; i++) { id: this.listItemDetail[i].id,
if (this.listRoomDetail[i].rStatus == 0) { title: this.listItemDetail[i].equirments.eqName + " (" + this.listItemDetail[i].userName + ")",
this.eventRoom.push({ start: '2021-12-16T10:30:00',
id: this.listRoomDetail[i].id, end: '2021-12-16T11:30:00',
title: this.listRoomDetail[i].room.rName + " (" + this.listRoomDetail[i].userName + ")", extendedProps: this.listItemDetail[i],
start: '2021-12-16T10:30:00', description: this.listItemDetail[i].remark,
end: '2021-12-16T11:30:00', color: 'rgb(250,250,250)',
extendedProps: this.listRoomDetail[i], textColor: 'white'
description: this.listRoomDetail[i].remark, }
allDay: this.listRoomDetail[i].allDay )
} }
)
} }
this.calendarEquirment = {
initialView: 'dayGridMonth',
themeSystem: 'bootstrap',
dayMaxEventRows: true,
locale: "th",
events: this.eventEquirment,
eventClick: this.handleLendClick.bind(this),
};
}
for (let i = 0; i < this.listItemDetail.length; i++) { });
if (this.listItemDetail[i].eStatus == 0) { this.RoomDetailService.getListRoomDetail().subscribe(result => {
this.eventEquirment.push({ this.listRoomDetail = result;
id: this.listItemDetail[i].id, console.log("1", this.listRoomDetail)
title: this.listItemDetail[i].equirments.eqName + " (" + this.listItemDetail[i].userName + ")", for (let i = 0; i < this.listRoomDetail.length; i++) {
start: '2021-12-16T10:30:00', if (this.listRoomDetail[i].rStatus == 0) {
end: '2021-12-16T11:30:00', this.eventRoom.push({
extendedProps: this.listItemDetail[i], id: this.listRoomDetail[i].id,
description: this.listItemDetail[i].remark, title: this.listRoomDetail[i].room.rName + " (" + this.listRoomDetail[i].userName + ")",
color: 'rgb(250,250,250)', start: '2021-12-16T10:30:00',
textColor: 'white' end: '2021-12-16T11:30:00',
extendedProps: this.listRoomDetail[i],
description: this.listRoomDetail[i].remark,
allDay: this.listRoomDetail[i].allDay
}
)
} }
)
} }
} this.calendarRoom = {
initialView: 'dayGridMonth',
themeSystem: 'bootstrap',
dayMaxEventRows: true,
locale: "th",
events: this.eventRoom,
eventClick: this.handleDateClick.bind(this),
};
});
this.calendarRoom = {
initialView: 'dayGridMonth',
themeSystem: 'bootstrap',
dayMaxEventRows: true,
locale: "th",
events: this.eventRoom,
eventClick: this.handleDateClick.bind(this),
// this.selectedRoomDetail = info.event.extendedProps;
// console.log(this.selectedRoomDetail)
// this.test();
// // alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
// // alert('View: ' + info.view.type);
// // // change the border color just for fun
// // info.el.style.borderColor = 'red';
// }
};
this.calendarEquirment = {
initialView: 'dayGridMonth',
themeSystem: 'bootstrap',
dayMaxEventRows: true,
locale: "th",
events: this.eventEquirment,
eventClick: this.handleLendClick.bind(this),
};
} }
test() { test() {
...@@ -297,10 +298,11 @@ export class HomePageComponent implements OnInit { ...@@ -297,10 +298,11 @@ export class HomePageComponent implements OnInit {
eventLendShow() { eventLendShow() {
const modalRef = this.modalService.open(NgbdModalLendContent); const modalRef = this.modalService.open(NgbdModalLendContent);
modalRef.componentInstance.name = this.selectedItemDetail.userName; modalRef.componentInstance.itemSelect = this.selectedItemDetail;
modalRef.componentInstance.telephone = this.selectedItemDetail.eTelephone; // modalRef.componentInstance.name = this.selectedItemDetail.userName;
modalRef.componentInstance.eqName = this.selectedItemDetail.equirments.eqName; // modalRef.componentInstance.telephone = this.selectedItemDetail.eTelephone;
modalRef.componentInstance.quantity = this.selectedItemDetail.quantity; // modalRef.componentInstance.eqName = this.selectedItemDetail.equirments.eqName;
modalRef.componentInstance.sDate = this.selectedRoomDetail.sDate; // modalRef.componentInstance.quantity = this.selectedItemDetail.quantity;
// modalRef.componentInstance.sDate = this.selectedRoomDetail.sDate;
} }
} }
\ No newline at end of file
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