Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
1bc6ca85
Commit
1bc6ca85
authored
Dec 16, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update calendar show การจอง การเบิก
parent
de605352
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
72 deletions
+108
-72
itemDetail.model.ts
src/app/models/itemDetail.model.ts
+4
-4
roomDetail.model.ts
src/app/models/roomDetail.model.ts
+4
-4
admin-pending.component.ts
src/app/pages/admin-pending/admin-pending.component.ts
+4
-4
home-page.component.html
src/app/pages/home-page/home-page.component.html
+2
-2
home-page.component.scss
src/app/pages/home-page/home-page.component.scss
+14
-0
home-page.component.ts
src/app/pages/home-page/home-page.component.ts
+61
-38
pending.component.ts
src/app/pages/pending/pending.component.ts
+2
-2
item-detail.service.ts
src/app/service/item-detail.service.ts
+7
-7
room-detail.service.ts
src/app/service/room-detail.service.ts
+10
-11
No files found.
src/app/models/itemDetail.model.ts
View file @
1bc6ca85
import
{
Equirment
}
from
"./equirment.model"
;
export
class
ItemDetail
{
I
d
?:
number
;
i
d
?:
number
;
equirment
:
Equirment
;
userName
:
string
;
sDate
:
string
;
...
...
@@ -12,10 +12,10 @@ export class ItemDetail {
Quantity
:
string
;
eTelephone
:
string
;
email
:
string
;
R
emark
:
string
;
r
emark
:
string
;
constructor
(
init
?:
ItemDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
I
d
=
1
;
this
.
i
d
=
1
;
this
.
equirment
=
this
.
equirment
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
...
...
@@ -24,7 +24,7 @@ export class ItemDetail {
this
.
Quantity
=
''
;
this
.
eTelephone
=
''
;
this
.
email
=
''
;
this
.
R
emark
=
''
;
this
.
r
emark
=
''
;
}
}
...
...
src/app/models/roomDetail.model.ts
View file @
1bc6ca85
import
{
Room
}
from
"./rooms.model"
;
export
class
RoomDetail
{
I
d
?:
number
;
i
d
?:
number
;
room
:
Room
;
userName
:
string
;
sDate
:
string
;
...
...
@@ -11,10 +11,10 @@ export class RoomDetail {
rStatus
:
number
;
rTelephone
:
string
;
email
:
string
;
R
emark
:
string
;
r
emark
:
string
;
constructor
(
init
?:
RoomDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
I
d
=
1
;
this
.
i
d
=
1
;
this
.
room
=
this
.
room
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
...
...
@@ -22,7 +22,7 @@ export class RoomDetail {
this
.
rStatus
=
0
;
this
.
rTelephone
=
''
;
this
.
email
=
''
;
this
.
R
emark
=
''
;
this
.
r
emark
=
''
;
}
}
...
...
src/app/pages/admin-pending/admin-pending.component.ts
View file @
1bc6ca85
...
...
@@ -124,7 +124,7 @@ export class AdminPendingComponent implements OnInit {
sTime
:
new
FormControl
(
this
.
modelItemDetail
.
sTime
,
[
Validators
.
required
]),
eTime
:
new
FormControl
(
this
.
modelItemDetail
.
eTime
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
Quantity
,
[
Validators
.
required
]),
Remark
:
new
FormControl
(
this
.
modelItemDetail
.
R
emark
),
Remark
:
new
FormControl
(
this
.
modelItemDetail
.
r
emark
),
eStatus
:
new
FormControl
(
this
.
modelItemDetail
.
eStatus
)
})
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -166,7 +166,7 @@ export class AdminPendingComponent implements OnInit {
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
(
this
.
modelRoomDetail
.
R
emark
),
remark
:
new
FormControl
(
this
.
modelRoomDetail
.
r
emark
),
rStatus
:
new
FormControl
(
this
.
modelRoomDetail
.
rStatus
)
});
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -239,7 +239,7 @@ export class AdminPendingComponent implements OnInit {
this
.
modelRoomDetail
.
eDate
=
this
.
myFormRoom
.
value
.
eDate
this
.
modelRoomDetail
.
sTime
=
this
.
myFormRoom
.
value
.
sTime
this
.
modelRoomDetail
.
eTime
=
this
.
myFormRoom
.
value
.
eTime
this
.
modelRoomDetail
.
Remark
=
this
.
myFormRoom
.
value
.
R
emark
this
.
modelRoomDetail
.
remark
=
this
.
myFormRoom
.
value
.
r
emark
this
.
modelRoomDetail
.
rStatus
=
this
.
myFormRoom
.
value
.
rStatus
console
.
log
(
"this.modelRoomDetail"
,
this
.
modelRoomDetail
)
this
.
RoomDetailService
.
updateRoomDetail
(
this
.
modelRoomDetail
)
...
...
@@ -261,7 +261,7 @@ export class AdminPendingComponent implements OnInit {
this
.
modelItemDetail
.
eDate
=
this
.
myFormEquir
.
value
.
eDate
this
.
modelItemDetail
.
sTime
=
this
.
myFormEquir
.
value
.
sTime
this
.
modelItemDetail
.
eTime
=
this
.
myFormEquir
.
value
.
eTime
this
.
modelItemDetail
.
Remark
=
this
.
myFormEquir
.
value
.
R
emark
this
.
modelItemDetail
.
remark
=
this
.
myFormEquir
.
value
.
r
emark
this
.
modelItemDetail
.
eStatus
=
this
.
myFormEquir
.
value
.
eStatus
console
.
log
(
"this.modelItemDetail"
,
this
.
modelItemDetail
)
this
.
ItemDetailService
.
updateItemDetail
(
this
.
modelItemDetail
)
...
...
src/app/pages/home-page/home-page.component.html
View file @
1bc6ca85
...
...
@@ -71,13 +71,13 @@
<li
[
ngbNavItem
]="
1
"
>
<a
ngbNavLink
>
ปฏิทินการจองห้อง
</a>
<ng-template
ngbNavContent
>
<full-calendar
#
calendarBook
[
options
]="
calendar
Options
"
></full-calendar>
<full-calendar
#
calendarBook
[
options
]="
calendar
Room
"
></full-calendar>
</ng-template>
</li>
<li
[
ngbNavItem
]="
2
"
>
<a
ngbNavLink
>
ปฏิทินการยืมรถ
</a>
<ng-template
ngbNavContent
>
<full-calendar
#
calendar
[
options
]="
calendar
Options
"
></full-calendar>
<full-calendar
#
calendar
[
options
]="
calendar
Equirment
"
></full-calendar>
</ng-template>
</li>
</ul>
...
...
src/app/pages/home-page/home-page.component.scss
View file @
1bc6ca85
::ng-deep
.fc-direction-ltr
.fc-daygrid-event
.fc-event-time
{
margin-right
:
3px
;
color
:
white
;
}
::ng-deep
.fc-event-title
{
color
:
white
;
}
::ng-deep
.fc-direction-ltr
.fc-daygrid-event.fc-event-end
,
.fc-direction-rtl
.fc-daygrid-event.fc-event-start
{
margin-right
:
2px
;
background-color
:
blueviolet
;
}
\ No newline at end of file
src/app/pages/home-page/home-page.component.ts
View file @
1bc6ca85
...
...
@@ -63,46 +63,24 @@ export class HomePageComponent implements OnInit {
toDate
:
NgbDate
|
null
;
showBook
=
false
;
eventRoom
=
[];
eventEquirment
=
[];
calendarRoom
:
CalendarOptions
=
{
initialView
:
'dayGridMonth'
,
dateClick
:
this
.
handleDateClick
.
bind
(
this
),
// bind is important!
locale
:
"th"
,
events
:
this
.
eventRoom
};
calendar
Options
:
CalendarOptions
=
{
calendar
Equirment
:
CalendarOptions
=
{
initialView
:
'dayGridMonth'
,
dateClick
:
this
.
handleDateClick
.
bind
(
this
),
// bind is important!
locale
:
"th"
,
events
:
[
{
id
:
'1'
,
title
:
'ห้องเดียว'
,
start
:
'2021-12-16T10:30:00'
,
end
:
'2021-12-16T11:30:00'
,
extendedProps
:
{
Id
:
1
,
room
:
{
rId
:
1
,
rName
:
"ห้องเดียว"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
25
,
rDesc
:
"จำนวนคน 25 คน"
,
},
userName
:
'เกม'
,
sDate
:
'2021/12/15'
,
eDate
:
'2021/12/15'
,
sTime
:
'22:30'
,
eTime
:
'22:30'
,
rStatus
:
0
,
rTelephone
:
'0123456789'
,
email
:
'qwerty@qwerty'
,
Remark
:
'test'
,
},
description
:
'เกมส์ (0123456789)'
,
color
:
'rgb(900,0,0)'
,
}
]
events
:
this
.
eventEquirment
};
handleDateClick
(
arg
)
{
alert
(
'date click! '
+
arg
.
dateStr
)
}
...
...
@@ -112,7 +90,7 @@ export class HomePageComponent implements OnInit {
}
toggleWeekends
()
{
this
.
calendar
Options
.
weekends
=
!
this
.
calendarOptions
.
weekends
// toggle the boolean!
this
.
calendar
Room
.
weekends
=
!
this
.
calendarRoom
.
weekends
// toggle the boolean!
}
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
ItemDetailService
:
ItemDetailService
,
private
RoomDetailService
:
RoomDetailService
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
)
{
...
...
@@ -156,6 +134,55 @@ export class HomePageComponent implements OnInit {
},
1
)
this
.
listItemDetail
=
this
.
ItemDetailService
.
getListItemDetail
();
this
.
listRoomDetail
=
this
.
RoomDetailService
.
getListRoomDetail
();
for
(
let
i
=
0
;
i
<
this
.
listRoomDetail
.
length
;
i
++
)
{
if
(
this
.
listRoomDetail
[
i
].
rStatus
==
0
)
{
this
.
eventRoom
.
push
({
id
:
this
.
listRoomDetail
[
i
].
id
,
title
:
this
.
listRoomDetail
[
i
].
room
.
rName
+
" ("
+
this
.
listRoomDetail
[
i
].
userName
+
")"
,
start
:
'2021-12-16T10:30:00'
,
end
:
'2021-12-16T11:30:00'
,
extendedProps
:
this
.
listRoomDetail
[
i
],
description
:
this
.
listRoomDetail
[
i
].
remark
,
color
:
'rgb(250,250,250)'
,
textColor
:
'white'
}
)
}
}
for
(
let
i
=
0
;
i
<
this
.
listItemDetail
.
length
;
i
++
)
{
if
(
this
.
listItemDetail
[
i
].
eStatus
==
0
)
{
this
.
eventEquirment
.
push
({
id
:
this
.
listItemDetail
[
i
].
id
,
title
:
this
.
listItemDetail
[
i
].
equirment
.
eqName
+
" ("
+
this
.
listItemDetail
[
i
].
userName
+
")"
,
start
:
'2021-12-16T10:30:00'
,
end
:
'2021-12-16T11:30:00'
,
extendedProps
:
this
.
listItemDetail
[
i
],
description
:
this
.
listItemDetail
[
i
].
remark
,
color
:
'rgb(250,250,250)'
,
textColor
:
'white'
}
)
}
}
this
.
calendarRoom
=
{
initialView
:
'dayGridMonth'
,
themeSystem
:
'bootstrap'
,
dateClick
:
this
.
handleDateClick
.
bind
(
this
),
// bind is important!
locale
:
"th"
,
events
:
this
.
eventRoom
};
this
.
calendarEquirment
=
{
initialView
:
'dayGridMonth'
,
themeSystem
:
'bootstrap'
,
dateClick
:
this
.
handleDateClick
.
bind
(
this
),
// bind is important!
locale
:
"th"
,
events
:
this
.
eventEquirment
};
}
...
...
@@ -169,6 +196,3 @@ export class HomePageComponent implements OnInit {
}
export
class
NgbdDropdownBasic
{
}
\ No newline at end of file
src/app/pages/pending/pending.component.ts
View file @
1bc6ca85
...
...
@@ -127,7 +127,7 @@ export class PendingComponent implements OnInit {
sTime
:
new
FormControl
(
this
.
modelItemDetail
.
sTime
,
[
Validators
.
required
]),
eTime
:
new
FormControl
(
this
.
modelItemDetail
.
eTime
,
[
Validators
.
required
]),
Quantity
:
new
FormControl
(
this
.
modelItemDetail
.
Quantity
,
[
Validators
.
required
]),
Remark
:
new
FormControl
(
this
.
modelItemDetail
.
R
emark
),
remark
:
new
FormControl
(
this
.
modelItemDetail
.
r
emark
),
eStatus
:
new
FormControl
(
this
.
modelItemDetail
.
eStatus
)
})
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -156,7 +156,7 @@ export class PendingComponent implements OnInit {
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
(
this
.
modelRoomDetail
.
R
emark
),
remark
:
new
FormControl
(
this
.
modelRoomDetail
.
r
emark
),
rStatus
:
new
FormControl
(
this
.
modelRoomDetail
.
rStatus
)
});
...
...
src/app/service/item-detail.service.ts
View file @
1bc6ca85
...
...
@@ -9,7 +9,7 @@ export class ItemDetailService {
url
:
string
;
listItemDetail
:
ItemDetail
[]
=
[
{
I
d
:
1
,
i
d
:
1
,
equirment
:
{
eqId
:
2
,
eqName
:
"เมาส์"
,
...
...
@@ -26,10 +26,10 @@ export class ItemDetailService {
Quantity
:
'1'
,
eTelephone
:
'0123456789'
,
email
:
'qwerty@qwerty'
,
R
emark
:
'test'
,
r
emark
:
'test'
,
},
{
I
d
:
2
,
i
d
:
2
,
equirment
:
{
eqId
:
3
,
eqName
:
"โน๊ตบุ๊ค"
,
...
...
@@ -46,7 +46,7 @@ export class ItemDetailService {
Quantity
:
'1'
,
eTelephone
:
'0123456789'
,
email
:
'qwerty@qwerty'
,
R
emark
:
'test'
,
r
emark
:
'test'
,
},
]
...
...
@@ -92,7 +92,7 @@ export class ItemDetailService {
// }
deleteItemDetail
(
ItemDetailModel
:
ItemDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
ItemDetailModel
.
I
d
).
subscribe
(
response
=>
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
ItemDetailModel
.
i
d
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListItemDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
...
...
@@ -100,7 +100,7 @@ export class ItemDetailService {
}
// updateItemDetail(ItemDetailModel: ItemDetail) {
// this.http.put(this.url + "/" +ItemDetailModel.
I
d, ItemDetailModel).subscribe(response => {
// this.http.put(this.url + "/" +ItemDetailModel.
i
d, ItemDetailModel).subscribe(response => {
// console.log(response);
// alert("อัพเดทข้อมูลอุปกรณ์สำเร็จ")
// })
...
...
@@ -108,7 +108,7 @@ export class ItemDetailService {
updateItemDetail
(
row_obj
:
ItemDetail
)
{
this
.
listItemDetail
=
this
.
listItemDetail
.
filter
((
value
,
key
)
=>
{
if
(
value
.
Id
===
row_obj
.
I
d
)
{
if
(
value
.
id
===
row_obj
.
i
d
)
{
value
=
row_obj
;
}
return
true
;
...
...
src/app/service/room-detail.service.ts
View file @
1bc6ca85
...
...
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
RoomDetail
,
SearchRoomDetailModel
}
from
'../models/RoomDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
RoomDetailService
{
...
...
@@ -9,7 +10,7 @@ export class RoomDetailService {
url
:
string
;
listRoomDetail
:
RoomDetail
[]
=
[
{
I
d
:
1
,
i
d
:
1
,
room
:
{
rId
:
1
,
rName
:
"ห้องเดียว"
,
...
...
@@ -26,10 +27,10 @@ export class RoomDetailService {
rStatus
:
0
,
rTelephone
:
'0123456789'
,
email
:
'qwerty@qwerty'
,
R
emark
:
'test'
,
r
emark
:
'test'
,
},
{
I
d
:
2
,
i
d
:
2
,
room
:
{
rId
:
2
,
rName
:
"ห้องคู่"
,
...
...
@@ -46,7 +47,7 @@ export class RoomDetailService {
rStatus
:
1
,
rTelephone
:
'0123456789'
,
email
:
'qwerty@qwerty'
,
R
emark
:
'test'
,
r
emark
:
'test'
,
},
]
...
...
@@ -68,7 +69,7 @@ export class RoomDetailService {
updateRoomDetail
(
row_obj
:
RoomDetail
)
{
this
.
listRoomDetail
=
this
.
listRoomDetail
.
filter
((
value
,
key
)
=>
{
if
(
value
.
Id
===
row_obj
.
I
d
)
{
if
(
value
.
id
===
row_obj
.
i
d
)
{
value
=
row_obj
;
}
return
true
;
...
...
@@ -80,6 +81,9 @@ export class RoomDetailService {
return
this
.
listRoomDetail
;
}
// getListRoomDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
...
...
@@ -109,7 +113,7 @@ export class RoomDetailService {
// }
deleteRoomDetail
(
RoomDetailModel
:
RoomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
RoomDetailModel
.
I
d
).
subscribe
(
response
=>
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
RoomDetailModel
.
i
d
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListRoomDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
...
...
@@ -123,8 +127,4 @@ export class RoomDetailService {
// })
// }
RoomDetailModel
(
rId
:
string
)
{
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment