Commit 591bb041 by DESKTOP-HF0LVOG\myhr

Merge branch 'master' of https://mygit.myhr.co.th/chanachai.pmg.eng/BookingMyHrManagement

# Conflicts:
#	src/app/models/roomDetail.model.ts
#	src/app/pages/admin-pending/admin-pending.component.ts
parents 08fda832 cc22bb61
...@@ -18,7 +18,8 @@ export class ItemDetail { ...@@ -18,7 +18,8 @@ export class ItemDetail {
}; };
eStatus: string; eStatus: string;
Quantity: string; Quantity: string;
eTelephone: number; eTelephone: string;
email: string;
Remark: string; Remark: string;
constructor(init?: ItemDetail) { constructor(init?: ItemDetail) {
Object.assign(this, init); Object.assign(this, init);
...@@ -30,6 +31,7 @@ export class ItemDetail { ...@@ -30,6 +31,7 @@ export class ItemDetail {
this.eStatus = ''; this.eStatus = '';
this.Quantity = ''; this.Quantity = '';
this.eTelephone = undefined; this.eTelephone = undefined;
this.email = undefined;
this.Remark = ''; this.Remark = '';
} }
} }
......
...@@ -18,7 +18,7 @@ export class RoomDetail { ...@@ -18,7 +18,7 @@ export class RoomDetail {
}; };
rStatus: string; rStatus: string;
rTelephone: string; rTelephone: string;
email: undefined; email: string;
Remark: string; Remark: string;
constructor(init?: RoomDetail) { constructor(init?: RoomDetail) {
Object.assign(this, init); Object.assign(this, init);
......
...@@ -7,7 +7,8 @@ import { ItemDetailService } from 'src/app/service/item-detail.service'; ...@@ -7,7 +7,8 @@ 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'; import { EquirmentService } from 'src/app/service/equirment.service';
import { RoomService } from 'src/app/service/room.service';
@Component({ @Component({
selector: 'app-admin-pending', selector: 'app-admin-pending',
...@@ -42,8 +43,15 @@ import { FormControl, Validators } from '@angular/forms'; ...@@ -42,8 +43,15 @@ import { FormControl, Validators } from '@angular/forms';
}) })
export class AdminPendingComponent implements OnInit { export class AdminPendingComponent implements OnInit {
time = { hour: 13, minute: 30 };
page = 1; page = 1;
pageSize = 10; pageSize = 10;
collectionSize = 0;
pageListRoom = 1;
pageSizeListRoom = 10;
collectionSizeListRoom = 0;
closeResult = ''; closeResult = '';
...@@ -55,7 +63,6 @@ export class AdminPendingComponent implements OnInit { ...@@ -55,7 +63,6 @@ export class AdminPendingComponent implements OnInit {
modelItemDetail = new ItemDetail(); modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail(); modelRoomDetail = new RoomDetail();
collectionSize = this.listitemDetail.length;
hoveredDate: NgbDate | null = null; hoveredDate: NgbDate | null = null;
fromDate: NgbDate | null; fromDate: NgbDate | null;
...@@ -63,9 +70,6 @@ export class AdminPendingComponent implements OnInit { ...@@ -63,9 +70,6 @@ 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])
...@@ -74,9 +78,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -74,9 +78,8 @@ export class AdminPendingComponent implements OnInit {
} }
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter, private modalService: NgbModal, private ItemDetailService: ItemDetailService, private RoomDetailService: RoomDetailService
, private equirmentService: EquirmentService, private roomService: RoomService) {
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);
this.refreshitemDetail(); this.refreshitemDetail();
...@@ -185,10 +188,21 @@ export class AdminPendingComponent implements OnInit { ...@@ -185,10 +188,21 @@ export class AdminPendingComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.listitemDetail = this.ItemDetailService.getListItemDetail(); this.listitemDetail = this.ItemDetailService.getListItemDetail();
this.listroomDetail = this.RoomDetailService.getListRoomDetail(); this.listroomDetail = this.RoomDetailService.getListRoomDetail();
this.collectionSizeListRoom = this.listitemDetail.length;
console.log(this.listitemDetail); console.log(this.listitemDetail);
} }
saveEquirment() {
this.equirmentService.addEquirment(this.modelEquirment);
this.modalService.dismissAll();
this.ngOnInit();
}
saveRoom() {
this.roomService.addRoom(this.modelRoom);
this.modalService.dismissAll();
this.ngOnInit();
}
} }
export class NgbdDropdownBasic { export class NgbdDropdownBasic {
......
...@@ -40,20 +40,26 @@ import { MyRoom, Room } from 'src/app/models/rooms.model'; ...@@ -40,20 +40,26 @@ import { MyRoom, Room } from 'src/app/models/rooms.model';
}) })
export class PendingComponent implements OnInit { export class PendingComponent implements OnInit {
page = 1; time = { hour: 13, minute: 30 };
pageSize = 10;
closeResult = ''; closeResult = '';
listItemDetail : ItemDetail[] = []; listItemDetail : ItemDetail[] = [];
listRoomDetail : RoomDetail[] = []; listRoomDetail : RoomDetail[] = [];
page = 1;
pageSize = 10;
collectionSize = 0;
pageListRoom = 1;
pageSizeListRoom = 10;
collectionSizeListRoom = 0;
modelEquirment = new Equirment(); modelEquirment = new Equirment();
modelRoom = new MyRoom(); modelRoom = new MyRoom();
modelItemDetail = new ItemDetail(); modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail(); modelRoomDetail = new RoomDetail();
collectionSize = this.listItemDetail.length;
hoveredDate: NgbDate | null = null; hoveredDate: NgbDate | null = null;
fromDate: NgbDate | null; fromDate: NgbDate | null;
...@@ -98,7 +104,12 @@ export class PendingComponent implements OnInit { ...@@ -98,7 +104,12 @@ export class PendingComponent implements OnInit {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`; this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
}); });
} }
date='10-12-2561'
show(a:string){
console.log(a)
}
sDate = ""
eDate = ""
openItemDetail(content : string ,item : ItemDetail) { openItemDetail(content : string ,item : ItemDetail) {
this.modelItemDetail = item ; this.modelItemDetail = item ;
this.thStime= this.modelItemDetail.sTime.hour + ':' + this.modelItemDetail.sTime.minute this.thStime= this.modelItemDetail.sTime.hour + ':' + this.modelItemDetail.sTime.minute
...@@ -106,6 +117,7 @@ export class PendingComponent implements OnInit { ...@@ -106,6 +117,7 @@ export class PendingComponent implements OnInit {
let SDate = this.modelItemDetail.sDate.split('/') let SDate = this.modelItemDetail.sDate.split('/')
this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0] this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0]
let EDate = this.modelItemDetail.eDate.split('/') let EDate = this.modelItemDetail.eDate.split('/')
this.eDate = EDate[2]+"-"+EDate[1]+"-"+EDate[0]
console.log(item); console.log(item);
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}`;
...@@ -113,13 +125,7 @@ export class PendingComponent implements OnInit { ...@@ -113,13 +125,7 @@ export class PendingComponent implements OnInit {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`; this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
}); });
} }
date='10-12-2561'
show(a:string){
console.log(a)
}
sDate = ""
eDate = ""
openRoomDetail(content : string ,item : RoomDetail) { openRoomDetail(content : string ,item : RoomDetail) {
this.modelRoomDetail = item ; this.modelRoomDetail = item ;
this.thStime= this.modelRoomDetail.sTime.hour + ':' + this.modelRoomDetail.sTime.minute this.thStime= this.modelRoomDetail.sTime.hour + ':' + this.modelRoomDetail.sTime.minute
...@@ -127,6 +133,7 @@ export class PendingComponent implements OnInit { ...@@ -127,6 +133,7 @@ export class PendingComponent implements OnInit {
let SDate = this.modelRoomDetail.sDate.split('/') let SDate = this.modelRoomDetail.sDate.split('/')
this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0] this.sDate = SDate[2]+"-"+SDate[1]+"-"+SDate[0]
let EDate = this.modelRoomDetail.eDate.split('/') let EDate = this.modelRoomDetail.eDate.split('/')
this.eDate = EDate[2]+"-"+EDate[1]+"-"+EDate[0]
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}`;
}, (reason) => { }, (reason) => {
...@@ -178,6 +185,7 @@ export class PendingComponent implements OnInit { ...@@ -178,6 +185,7 @@ export class PendingComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.listItemDetail = this.ItemDetailService.getListItemDetail(); this.listItemDetail = this.ItemDetailService.getListItemDetail();
this.listRoomDetail = this.RoomDetailService.getListRoomDetail(); this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
this.collectionSizeListRoom = this.listRoomDetail.length;
console.log(this.listItemDetail); console.log(this.listItemDetail);
} }
......
...@@ -33,6 +33,7 @@ export class ItemDetailService { ...@@ -33,6 +33,7 @@ export class ItemDetailService {
eStatus: 'รอการอนุมัติ', eStatus: 'รอการอนุมัติ',
Quantity: '1', Quantity: '1',
eTelephone: undefined, eTelephone: undefined,
email: undefined,
Remark: 'test', Remark: 'test',
}, },
{ {
...@@ -60,6 +61,7 @@ export class ItemDetailService { ...@@ -60,6 +61,7 @@ export class ItemDetailService {
eStatus: 'รอการอนุมัติ', eStatus: 'รอการอนุมัติ',
Quantity: '1', Quantity: '1',
eTelephone: undefined, eTelephone: 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