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
1e0fa993
Commit
1e0fa993
authored
Dec 02, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ตารางรายการจอง
parent
16d9fa3e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
187 additions
and
17 deletions
+187
-17
roomDetail.model.ts
src/app/models/roomDetail.model.ts
+49
-0
rooms.model.ts
src/app/models/rooms.model.ts
+0
-2
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+1
-1
pending.component.html
src/app/pages/pending/pending.component.html
+7
-8
pending.component.ts
src/app/pages/pending/pending.component.ts
+5
-1
room-detail.service.ts
src/app/service/room-detail.service.ts
+122
-0
room.service.ts
src/app/service/room.service.ts
+3
-5
No files found.
src/app/models/roomDetail.model.ts
0 → 100644
View file @
1e0fa993
import
{
Room
}
from
"./rooms.model"
;
export
class
roomDetail
{
Id
?:
number
;
room
:
Room
;
userName
:
string
;
sDate
:
string
;
eDate
:
string
;
sTime
:
{
hour
:
number
;
minute
:
number
;
second
:
number
;
};
eTime
:
{
hour
:
number
;
minute
:
number
;
second
:
number
;
};
eStatus
:
string
;
Remark
:
string
;
constructor
(
init
?:
roomDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
Id
=
1
;
this
.
room
=
this
.
room
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
this
.
eDate
=
''
;
this
.
eStatus
=
''
;
this
.
Remark
=
''
;
}
}
export
interface
SearchroomDetailModel
{
sDate
:
string
;
eDate
:
string
;
sTime
:
string
;
eTime
:
string
;
}
export
class
SearchroomDetailModel
{
constructor
(
init
?:
SearchroomDetailModel
)
{
Object
.
assign
(
this
,
init
);
this
.
sDate
=
''
,
this
.
eDate
=
''
,
this
.
sTime
=
''
,
this
.
eTime
=
''
;
}
}
\ No newline at end of file
src/app/models/rooms.model.ts
View file @
1e0fa993
...
@@ -2,14 +2,12 @@ export class Room {
...
@@ -2,14 +2,12 @@ export class Room {
rId
:
number
;
rId
:
number
;
rName
:
string
;
rName
:
string
;
rPic
:
string
;
rPic
:
string
;
rType
:
string
;
roomLimit
:
number
;
roomLimit
:
number
;
rDesc
:
string
;
rDesc
:
string
;
constructor
(
init
?:
Room
)
{
constructor
(
init
?:
Room
)
{
Object
.
assign
(
this
,
init
);
Object
.
assign
(
this
,
init
);
this
.
rId
=
0
;
this
.
rId
=
0
;
this
.
rName
=
''
;
this
.
rName
=
''
;
this
.
rType
=
''
;
this
.
rPic
=
''
;
this
.
rPic
=
''
;
this
.
roomLimit
=
0
;
this
.
roomLimit
=
0
;
this
.
rDesc
=
''
;
this
.
rDesc
=
''
;
...
...
src/app/pages/equipment/equipment.component.ts
View file @
1e0fa993
...
@@ -48,7 +48,7 @@ export class EquipmentComponent implements OnInit {
...
@@ -48,7 +48,7 @@ export class EquipmentComponent implements OnInit {
}
}
book
(
contentequirment
,
item
:
Equirment
)
{
book
Equir
(
contentequirment
,
item
:
Equirment
)
{
this
.
modelitemDetail
=
new
itemDetail
();
this
.
modelitemDetail
=
new
itemDetail
();
this
.
modelitemDetail
.
equirment
=
item
;
this
.
modelitemDetail
.
equirment
=
item
;
...
...
src/app/pages/pending/pending.component.html
View file @
1e0fa993
...
@@ -76,7 +76,6 @@
...
@@ -76,7 +76,6 @@
<thead>
<thead>
<tr>
<tr>
<th
scope=
"col"
>
#
</th>
<th
scope=
"col"
>
#
</th>
<th
scope=
"col"
>
หมวดหมู่
</th>
<th
scope=
"col"
>
ชื่ออุปกรณ์
</th>
<th
scope=
"col"
>
ชื่ออุปกรณ์
</th>
<th
scope=
"col"
>
รายละเอียด
</th>
<th
scope=
"col"
>
รายละเอียด
</th>
<th
scope=
"col"
>
ชื่อผู้เบิก
</th>
<th
scope=
"col"
>
ชื่อผู้เบิก
</th>
...
@@ -86,11 +85,10 @@
...
@@ -86,11 +85,10 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*
ngFor=
"let item of list
ite
mDetail"
>
<tr
*
ngFor=
"let item of list
roo
mDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.equirment.eqType }}
</td>
<td>
{{ item.room.rName }}
</td>
<td>
{{ item.equirment.eqName }}
</td>
<td>
{{ item.room.rDesc }}
</td>
<td>
{{ item.equirment.eqDesc }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minute }}
</td>
<td>
{{ item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minute }}
</td>
...
@@ -146,12 +144,13 @@
...
@@ -146,12 +144,13 @@
<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.
Catagory
}}
</td>
<td>
{{ item.
equirment.eqType
}}
</td>
<td>
{{ item.
Typ
e }}
</td>
<td>
{{ item.
equirment.eqNam
e }}
</td>
<td>
{{ item.
Detail
}}
</td>
<td>
{{ item.
equirment.eqDesc
}}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minute }}
</td>
<td>
{{ item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minute }}
</td>
<td>
{{ item.Quantity }}
</td>
<td>
{{ item.eStatus }}
</td>
<td>
{{ item.eStatus }}
</td>
<div
class=
"col-auto align-self-sm-center"
>
<div
class=
"col-auto align-self-sm-center"
>
<button
type=
"button"
class=
"btn btn-info btn-sm btn-circle "
<button
type=
"button"
class=
"btn btn-info btn-sm btn-circle "
...
...
src/app/pages/pending/pending.component.ts
View file @
1e0fa993
...
@@ -3,6 +3,8 @@ import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-b
...
@@ -3,6 +3,8 @@ import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-b
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
{
roomDetailService
}
from
'src/app/service/room-detail.service'
;
@
Component
({
@
Component
({
selector
:
'app-pending'
,
selector
:
'app-pending'
,
...
@@ -42,6 +44,7 @@ export class PendingComponent implements OnInit {
...
@@ -42,6 +44,7 @@ export class PendingComponent implements OnInit {
closeResult
=
''
;
closeResult
=
''
;
listitemDetail
:
itemDetail
[]
=
[];
listitemDetail
:
itemDetail
[]
=
[];
listroomDetail
:
roomDetail
[]
=
[];
collectionSize
=
this
.
listitemDetail
.
length
;
collectionSize
=
this
.
listitemDetail
.
length
;
hoveredDate
:
NgbDate
|
null
=
null
;
hoveredDate
:
NgbDate
|
null
=
null
;
...
@@ -49,7 +52,7 @@ export class PendingComponent implements OnInit {
...
@@ -49,7 +52,7 @@ export class PendingComponent implements OnInit {
fromDate
:
NgbDate
|
null
;
fromDate
:
NgbDate
|
null
;
toDate
:
NgbDate
|
null
;
toDate
:
NgbDate
|
null
;
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
itemDetailService
:
itemDetailService
)
{
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
();
...
@@ -109,6 +112,7 @@ export class PendingComponent implements OnInit {
...
@@ -109,6 +112,7 @@ export class PendingComponent implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
this
.
listitemDetail
=
this
.
itemDetailService
.
getListitemDetail
();
this
.
listitemDetail
=
this
.
itemDetailService
.
getListitemDetail
();
this
.
listroomDetail
=
this
.
roomDetailService
.
getListroomDetail
();
console
.
log
(
this
.
listitemDetail
);
console
.
log
(
this
.
listitemDetail
);
}
}
...
...
src/app/service/room-detail.service.ts
View file @
1e0fa993
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
{
constructor
(
private
http
:
HttpClient
)
{
}
url
:
string
;
listroomDetail
:
roomDetail
[]
=
[
{
Id
:
1
,
room
:
{
rId
:
1
,
rName
:
"ห้องเดียว"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
25
,
rDesc
:
"จำนวนคน 25 คน"
,
},
userName
:
'เกม'
,
sDate
:
'10/12/2560'
,
eDate
:
'10/11/2561'
,
sTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
Remark
:
'test'
,
},
{
Id
:
2
,
room
:
{
rId
:
2
,
rName
:
"ห้องคู่"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
userName
:
'เกม'
,
sDate
:
'10/12/2560'
,
eDate
:
'10/11/2561'
,
sTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
Remark
:
'test'
,
},
]
addroomDetail
(
model
:
roomDetail
)
{
console
.
log
(
this
.
listroomDetail
);
this
.
listroomDetail
.
push
(
model
);
}
getListroomDetail
()
{
return
this
.
listroomDetail
;
}
// getListroomDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.listroomDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchListroomDetail
(
searchModel
:
SearchroomDetailModel
)
{
this
.
http
.
get
(
this
.
url
+
'&startDate='
+
searchModel
.
sDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
sDate
.
split
(
"-"
)[
0
]
+
'&endDate='
+
searchModel
.
eDate
.
split
(
"-"
)[
2
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
1
]
+
'-'
+
searchModel
.
eDate
.
split
(
"-"
)[
0
]
+
'&startTime='
+
searchModel
.
sTime
+
':00'
+
'&endTime='
+
searchModel
.
eTime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
console
.
log
(
response
);
this
.
listroomDetail
=
response
;
},
error
=>
{
console
.
log
(
error
)
alert
(
"ไม่สามารถค้นหาอุปกรณ์ที่ว่างได้ เนื่องจาก :
\
n"
+
error
.
message
)
})
}
// addEquirment(EquirmentModel: Equirment) {
// this.http.post(this.url, EquirmentModel).subscribe(response => {
// console.log(response);
// })
// }
deleteroomDetail
(
roomDetailModel
:
roomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
roomDetailModel
.
Id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListroomDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
updateroomDetail
(
roomDetailModel
:
roomDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
roomDetailModel
.
Id
,
roomDetailModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
roomDetailModel
(
rId
:
string
)
{
}
}
\ No newline at end of file
src/app/service/room.service.ts
View file @
1e0fa993
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
{
Room
,
SearchRoomModel
}
from
'../models/rooms.model'
;
import
{
Room
,
SearchRoomModel
}
from
'../models/rooms.model'
;
import
{
itemDetail
}
from
'../models/itemDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
@
Injectable
({
providedIn
:
'root'
})
...
@@ -13,7 +13,6 @@ export class RoomService {
...
@@ -13,7 +13,6 @@ export class RoomService {
{
{
rId
:
1
,
rId
:
1
,
rName
:
"ห้องเดียว"
,
rName
:
"ห้องเดียว"
,
rType
:
''
,
rPic
:
"assets/img/room.jpg"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
25
,
roomLimit
:
25
,
rDesc
:
"จำนวนคน 25 คน"
,
rDesc
:
"จำนวนคน 25 คน"
,
...
@@ -21,7 +20,7 @@ export class RoomService {
...
@@ -21,7 +20,7 @@ export class RoomService {
{
{
rId
:
2
,
rId
:
2
,
rName
:
"ห้องคู่"
,
rName
:
"ห้องคู่"
,
rType
:
''
,
rPic
:
"assets/img/room.jpg"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
rDesc
:
"จำนวนคน 50 คน"
,
...
@@ -29,7 +28,7 @@ export class RoomService {
...
@@ -29,7 +28,7 @@ export class RoomService {
{
{
rId
:
3
,
rId
:
3
,
rName
:
"ห้องรวม"
,
rName
:
"ห้องรวม"
,
rType
:
''
,
rPic
:
"assets/img/room.jpg"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
rDesc
:
"จำนวนคน 100 คน"
,
...
@@ -37,7 +36,6 @@ export class RoomService {
...
@@ -37,7 +36,6 @@ export class RoomService {
{
{
rId
:
4
,
rId
:
4
,
rName
:
"รถ"
,
rName
:
"รถ"
,
rType
:
''
,
rPic
:
"assets/img/car.jpg"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
rDesc
:
"รถ"
,
...
...
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