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
937f7353
Commit
937f7353
authored
Dec 09, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update หน้าต่างแก้ไขรายละเอียด เพิ่มเบอร์โทร
parent
2886356c
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
570 additions
and
304 deletions
+570
-304
app.module.ts
src/app/app.module.ts
+2
-1
equirment.model.ts
src/app/models/equirment.model.ts
+1
-1
itemDetail.model.ts
src/app/models/itemDetail.model.ts
+7
-5
roomDetail.model.ts
src/app/models/roomDetail.model.ts
+10
-8
rooms.model.ts
src/app/models/rooms.model.ts
+15
-6
admin-equirment.component.html
src/app/pages/admin-equirment/admin-equirment.component.html
+67
-80
admin-equirment.component.ts
src/app/pages/admin-equirment/admin-equirment.component.ts
+137
-27
admin-pending.component.html
src/app/pages/admin-pending/admin-pending.component.html
+20
-20
admin-pending.component.ts
src/app/pages/admin-pending/admin-pending.component.ts
+22
-22
equipment.component.html
src/app/pages/equipment/equipment.component.html
+31
-31
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+18
-18
lend-page.component.ts
src/app/pages/lend-page/lend-page.component.ts
+2
-2
pending.component.html
src/app/pages/pending/pending.component.html
+19
-19
pending.component.ts
src/app/pages/pending/pending.component.ts
+22
-22
item-detail.service.ts
src/app/service/item-detail.service.ts
+21
-19
room-detail.service.ts
src/app/service/room-detail.service.ts
+24
-22
room.service.ts
src/app/service/room.service.ts
+152
-1
No files found.
src/app/app.module.ts
View file @
937f7353
import
{
BrowserAnimationsModule
}
from
"@angular/platform-browser/animations"
;
import
{
NgModule
}
from
"@angular/core"
;
import
{
FormsModule
}
from
"@angular/forms"
;
import
{
FormsModule
,
ReactiveFormsModule
}
from
"@angular/forms"
;
import
{
HttpClientModule
}
from
"@angular/common/http"
;
import
{
RouterModule
}
from
"@angular/router"
;
import
{
ToastrModule
}
from
'ngx-toastr'
;
...
...
@@ -39,6 +39,7 @@ FullCalendarModule.registerPlugins([ // register FullCalendar plugins
AppRoutingModule
,
ToastrModule
.
forRoot
(),
FullCalendarModule
,
ReactiveFormsModule
],
declarations
:
[
AppComponent
,
AdminLayoutComponent
,
AuthLayoutComponent
,
HomePageComponent
,
EquipmentComponent
,
CalenRoomComponent
,
AdminPendingComponent
,
PendingComponent
,
AdminEquirmentComponent
],
providers
:
[],
...
...
src/app/models/equirment.model.ts
View file @
937f7353
import
{
CategoryModel
}
from
"./
i
temDetail.model"
;
import
{
CategoryModel
}
from
"./
I
temDetail.model"
;
export
class
Equirment
{
eqId
:
number
;
...
...
src/app/models/itemDetail.model.ts
View file @
937f7353
import
{
Equirment
}
from
"./equirment.model"
;
export
class
i
temDetail
{
export
class
I
temDetail
{
Id
?:
number
;
equirment
:
Equirment
;
userName
:
string
;
...
...
@@ -18,8 +18,9 @@ export class itemDetail {
};
eStatus
:
string
;
Quantity
:
string
;
eTelephone
:
number
;
Remark
:
string
;
constructor
(
init
?:
i
temDetail
)
{
constructor
(
init
?:
I
temDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
Id
=
1
;
this
.
equirment
=
this
.
equirment
;
...
...
@@ -28,19 +29,20 @@ export class itemDetail {
this
.
eDate
=
''
;
this
.
eStatus
=
''
;
this
.
Quantity
=
''
;
this
.
eTelephone
=
undefined
;
this
.
Remark
=
''
;
}
}
export
interface
Search
i
temDetailModel
{
export
interface
Search
I
temDetailModel
{
sDate
:
string
;
eDate
:
string
;
sTime
:
string
;
eTime
:
string
;
}
export
class
Search
i
temDetailModel
{
constructor
(
init
?:
Search
i
temDetailModel
)
{
export
class
Search
I
temDetailModel
{
constructor
(
init
?:
Search
I
temDetailModel
)
{
Object
.
assign
(
this
,
init
);
this
.
sDate
=
''
,
this
.
eDate
=
''
,
...
...
src/app/models/roomDetail.model.ts
View file @
937f7353
import
{
Room
}
from
"./rooms.model"
;
export
class
r
oomDetail
{
export
class
R
oomDetail
{
Id
?:
number
;
room
:
Room
;
room
:
Room
;
userName
:
string
;
sDate
:
string
;
eDate
:
string
;
...
...
@@ -16,29 +16,31 @@ export class roomDetail {
minute
:
number
;
second
:
number
;
};
eStatus
:
string
;
rStatus
:
string
;
rTelephone
:
number
;
Remark
:
string
;
constructor
(
init
?:
r
oomDetail
)
{
constructor
(
init
?:
R
oomDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
Id
=
1
;
this
.
room
=
this
.
room
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
this
.
eDate
=
''
;
this
.
eStatus
=
''
;
this
.
rStatus
=
''
;
this
.
rTelephone
=
undefined
;
this
.
Remark
=
''
;
}
}
export
interface
Search
r
oomDetailModel
{
export
interface
Search
R
oomDetailModel
{
sDate
:
string
;
eDate
:
string
;
sTime
:
string
;
eTime
:
string
;
}
export
class
Search
r
oomDetailModel
{
constructor
(
init
?:
Search
r
oomDetailModel
)
{
export
class
Search
R
oomDetailModel
{
constructor
(
init
?:
Search
R
oomDetailModel
)
{
Object
.
assign
(
this
,
init
);
this
.
sDate
=
''
,
this
.
eDate
=
''
,
...
...
src/app/models/rooms.model.ts
View file @
937f7353
import
{
roomDetail
}
from
"./roomDetail.model"
export
class
Room
{
import
{
RoomDetail
}
from
"./RoomDetail.model"
export
interface
Room
{
rId
:
number
;
rName
:
string
;
rType
:
string
;
rPic
:
string
;
roomLimit
:
number
;
rDesc
:
string
;
}
export
class
MyRoom
implements
Room
{
rId
:
number
;
rName
:
string
;
rType
:
string
;
rPic
:
string
;
roomLimit
:
number
;
rDesc
:
string
;
static
rName
:
any
;
constructor
(
init
?:
Room
)
{
Object
.
assign
(
this
,
init
);
this
.
rId
=
0
;
this
.
rName
=
''
;
//
Object.assign(this, init);
this
.
rId
=
init
?.
rId
!
;
this
.
rName
=
init
?.
rName
!
;
this
.
rPic
=
''
;
this
.
roomLimit
=
0
;
this
.
rDesc
=
''
;
console
.
log
(
"sssssssssssss"
,
init
)
}
}
...
...
src/app/pages/admin-equirment/admin-equirment.component.html
View file @
937f7353
...
...
@@ -20,10 +20,11 @@
<div
class=
"card-body"
>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
Ropen
(
contentroom
)"
>
เพิ่มรายการ
</button>
(
click
)="
addroom
(
contentroom
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listRoomModel"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listRoomModel|slice: (pageListRoom-1) * pageSizeListRoom :(pageListRoom-1) * pageSizeListRoom + pageSizeListRoom ;let i = index"
>
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
...
...
@@ -38,8 +39,9 @@
<div
class=
"text-center"
>
<div
class=
"d-grid gap-2 a-md-flex justify-content-md-end "
>
<button
class=
"btn btn-sm btn-outline-primary"
(
click
)="
bookRoom
(
editroom
,
item
)"
>
แก้ไข
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
(
click
)="
modal
.
close
()"
>
ลบ
</button>
(
click
)="
Ropen
(
editroom
,((
pageListRoom-1
)
*
pageSizeListRoom
)+
i
)"
>
แก้ไข
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
(
click
)="
modal
.
close
()"
>
ลบ
</button>
</div>
</div>
</div>
...
...
@@ -48,12 +50,14 @@
</div>
<div
class=
"d-flex justify-content-between p-2"
>
<ngb-pagination
[
collectionSize
]="
collectionSize
"
[(
page
)]="
page
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
refreshCountries
()"
>
<ngb-pagination
[
collectionSize
]="
collectionSizeListRoom
"
[(
page
)]="
pageListRoom
"
[
pageSize
]="
pageSizeListRoom
"
>
<ng-template
ngbPaginationPrevious
>
Previous
</ng-template>
<ng-template
ngbPaginationNext
>
Next
</ng-template>
</ngb-pagination>
<select
class=
"custom-select"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
refreshCountries
()
"
>
<select
class=
"custom-select"
style=
"width: auto"
[(
ngModel
)]="
pageSize
ListRoom
"
(
ngModelChange
)="
pageListRoom=
1
"
>
<option
[
ngValue
]="
10
"
>
10 items per page
</option>
<option
[
ngValue
]="
50
"
>
50 items per page
</option>
<option
[
ngValue
]="
100
"
>
100 items per page
</option>
...
...
@@ -74,10 +78,11 @@
<div
class=
""
>
<div
class=
"card-body"
>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
Eopen
(
contentequirment
)"
>
เพิ่มรายการ
</button>
(
click
)="
addequirment
(
contentequirment
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listEquirmentModel"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listEquirmentModel|slice: (page-1) * pageSize :(page-1) * pageSize + pageSize ;let i = index"
>
<div
class=
"card"
style=
"
padding: 10px;"
>
<div
class=
"card-body"
>
...
...
@@ -93,8 +98,9 @@
<div
class=
"text-center"
>
<div
class=
"d-grid gap-2 a-md-flex justify-content-md-end"
>
<button
class=
"btn btn-sm btn-outline-primary"
(
click
)="
bookEquir
(
editLend
,
item
)"
>
แก้ไข
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
>
ลบ
</button>
(
click
)="
Eopen
(
editLend
,((
page-1
)
*
pageSize
)+
i
)"
>
แก้ไข
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
>
ลบ
</button>
</div>
</div>
</div>
...
...
@@ -103,12 +109,13 @@
</div>
<div
class=
"d-flex justify-content-between p-2"
>
<ngb-pagination
[
collectionSize
]="
collectionSize
"
[(
page
)]="
page
"
[
pageSize
]="
pageSize
"
(
pageChange
)="
refreshCountries
()"
>
<ngb-pagination
[
collectionSize
]="
collectionSize
"
[(
page
)]="
page
"
[
pageSize
]="
pageSize
"
>
<ng-template
ngbPaginationPrevious
>
Previous
</ng-template>
<ng-template
ngbPaginationNext
>
Next
</ng-template>
</ngb-pagination>
<select
class=
"custom-select"
style=
"width: auto"
[(
ngModel
)]="
pageSize
"
(
ngModelChange
)="
refreshCountries
()
"
>
(
ngModelChange
)="
page=
1
"
>
<option
[
ngValue
]="
10
"
>
10 items per page
</option>
<option
[
ngValue
]="
50
"
>
50 items per page
</option>
<option
[
ngValue
]="
100
"
>
100 items per page
</option>
...
...
@@ -124,10 +131,10 @@
<div
[
ngbNavOutlet
]="
nav
"
></div>
</div>
<ng-template
#
contentroom
let-modal
>
<ng-template
#
contentroom
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
"
card-header"
>
<div
class=
"card-header"
>
<h5
class=
" title"
>
Add Equirment
</h5>
</div>
<div
class=
" card-body"
>
...
...
@@ -145,7 +152,8 @@
<div
class=
" form-group"
>
<label>
ประเภท
</label>
<br>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelRoom
.
rType
"
>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelRoom
.
rType
"
>
<option
selected
>
เลือกประเภท
</option>
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"2"
>
รถ
</option>
...
...
@@ -168,13 +176,14 @@
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
saveRoom
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
</div>
</div>
</div>
</ng-template>
<ng-template
#
contentequirment
let-modal
>
<ng-template
#
contentequirment
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
...
...
@@ -186,8 +195,8 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelEquirment
.
eqName
"
value=
""
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelEquirment
.
eqName
"
value=
""
/>
</div>
</div>
</div>
...
...
@@ -196,8 +205,8 @@
<div
class=
" form-group"
>
<label>
หมวดหมู่
</label>
<br>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelEquirment
.
eqType
"
>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelEquirment
.
eqType
"
>
<option
selected
>
เลือกหมวดหมู่
</option>
<option
value=
"4"
>
IT
</option>
<option
value=
"5"
>
Company
</option>
...
...
@@ -209,113 +218,91 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
></textarea>
</div>
</div>
</div>
<label
for=
"exampleFormControlFile"
>
แนบไฟล์รูปภาพ
</label>
<input
type=
"file"
class=
"form-control-file"
id=
"exampleFormControlFile"
>
<input
type=
"file"
class=
"form-control-file"
id=
"exampleFormControlFile"
>
</form>
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
saveEquirment
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
</div>
</div>
</div>
</ng-template>
<ng-template
#
editroom
let-modal
>
<ng-template
#
editroom
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
แก้ไขข้อมูล
</h5>
</div>
<div
class=
" card-body"
>
<form>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
modelroomDetail
.
room
.
rName
"
>
</div>
<label>
ชื่อ
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listRoomModelEdit
.
rName
"
>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ประเภท
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
modelroomDetail
.
room
.
rType
"
>
</div>
</div>
<label>
ประเภท
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listRoomModelEdit
.
rType
"
>
</div>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
[
value
]="
modelroomDetail
.
room
.
rDesc
"
></textarea>
</div>
<label>
รายละเอียด
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listRoomModelEdit
.
rDesc
"
>
</div>
</div>
</form>
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
editRoom
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"update"
(
click
)="
updateRoomProfile
();
modal
.
dismiss
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
()"
>
Cancel
</button>
</div>
</div>
</div>
</ng-template>
<ng-template
#
editLend
let-modal
>
<ng-template
#
editLend
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
แก้ไขข้อมูล
</h5>
</div>
<div
class=
" card-body"
>
<form>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
modelitemDetail
.
equirment
.
eqName
"
>
</div>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-md-6 mb-2"
>
<div
class=
" form-group"
>
<label>
ประเภท
</label>
<br>
<input
class=
" form-control"
type=
"text"
[
value
]="
modelitemDetail
.
equirment
.
eqType
"
>
<label>
ชื่ออุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqName
"
>
</div>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
[
value
]="
modelitemDetail
.
equirment
.
eqDesc
"
></textarea>
<label>
ประเภทอุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqType
"
>
</div>
<div
class=
" col-md-12"
>
<label>
รายละเอียดอุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqDesc
"
>
</div>
</div>
</form>
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
saveEquirment
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
('
Cross
click
')"
>
Cancel
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"update"
(
click
)="
updateItemProfile
();
modal
.
dismiss
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"cancel"
(
click
)="
modal
.
dismiss
()"
>
Cancel
</button>
</div>
</div>
</div>
</ng-template>
<ng-template
#
Room
let-modal
>
<
!-- <
ng-template #Room let-modal >
<div class=" col-md-12" style="padding: 0; ">
<div class="card" style="margin: 0; ">
<div class=" card-header">
...
...
@@ -388,9 +375,9 @@
</div>
</div>
</div>
</ng-template>
</ng-template>
-->
<ng-template
#
Lend
let-modal
>
<
!-- <
ng-template #Lend let-modal>
<div class=" col-md-12" style="padding: 0; ">
<div class="card" style="margin: 0; ">
<div class=" card-header">
...
...
@@ -470,4 +457,4 @@
</div>
</div>
</div>
</ng-template>
\ No newline at end of file
</ng-template> -->
\ No newline at end of file
src/app/pages/admin-equirment/admin-equirment.component.ts
View file @
937f7353
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
itemDetail
}
from
'src/app/models/i
temDetail.model'
;
import
{
roomDetail
}
from
'src/app/models/r
oomDetail.model'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
ItemDetail
}
from
'src/app/models/I
temDetail.model'
;
import
{
RoomDetail
}
from
'src/app/models/R
oomDetail.model'
;
import
{
MyRoom
,
Room
}
from
'src/app/models/rooms.model'
;
import
{
EquirmentService
}
from
'src/app/service/equirment.service'
;
import
{
RoomService
}
from
'src/app/service/room.service'
;
import
{
roomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
RoomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
FormBuilder
,
FormControl
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
@
Component
({
selector
:
'app-admin-equirment'
,
...
...
@@ -14,39 +15,66 @@ import { roomDetailService } from 'src/app/service/room-detail.service';
styleUrls
:
[
'./admin-equirment.component.scss'
]
})
export
class
AdminEquirmentComponent
implements
OnInit
{
myForm
:
FormGroup
;
time
=
{
hour
:
13
,
minute
:
30
};
page
=
1
;
pageSize
=
10
;
closeResult
=
''
;
listEquirmentModel
:
Equirment
[]
=
[];
listRoomModel
:
Room
[]
=
[];
list
itemDetail
:
i
temDetail
[]
=
[];
list
roomDetail
:
r
oomDetail
[]
=
[];
list
ItemDetail
:
I
temDetail
[]
=
[];
list
RoomDetail
:
R
oomDetail
[]
=
[];
collectionSize
=
this
.
listEquirmentModel
.
length
;
listEquirmentModelEdit
:
Equirment
|
undefined
;
listRoomModelEdit
:
Room
|
undefined
;
page
=
1
;
pageSize
=
10
;
collectionSize
=
0
;
pageListRoom
=
1
;
pageSizeListRoom
=
10
;
collectionSizeListRoom
=
0
;
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
model
itemDetail
=
new
i
temDetail
();
model
roomDetail
=
new
r
oomDetail
();
modelRoom
:
Room
model
ItemDetail
=
new
I
temDetail
();
model
RoomDetail
=
new
R
oomDetail
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
roomDetailService
:
roomDetailService
)
{
RoomForm
=
new
FormGroup
({
rId
:
new
FormControl
(
''
),
rName
:
new
FormControl
(
''
),
rType
:
new
FormControl
(
''
),
rPic
:
new
FormControl
(
''
),
roomLimit
:
new
FormControl
(
''
),
rDesc
:
new
FormControl
(
''
)
});
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
RoomDetailService
:
RoomDetailService
,
private
fb
:
FormBuilder
)
{
console
.
log
()
this
.
RoomForm
=
this
.
fb
.
group
({
rName
:
[
""
,],
rType
:
[
""
,],
rDesc
:
[
""
,]
});
this
.
RoomForm
.
valueChanges
.
subscribe
(
console
.
log
);
}
ngOnInit
()
{
this
.
listEquirmentModel
=
this
.
equirmentService
.
getListEquirment
();
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
this
.
collectionSizeListRoom
=
this
.
listRoomModel
.
length
console
.
log
(
"listRoom"
,
this
.
listRoomModel
)
}
bookEquir
(
editLend
,
item
:
Equirment
)
{
this
.
model
itemDetail
=
new
i
temDetail
();
this
.
model
i
temDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
model
i
temDetail
);
this
.
model
ItemDetail
=
new
I
temDetail
();
this
.
model
I
temDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
model
I
temDetail
);
this
.
modalService
.
open
(
editLend
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -57,28 +85,82 @@ export class AdminEquirmentComponent implements OnInit {
bookRoom
(
editroom
,
item
:
Room
)
{
this
.
modelroomDetail
=
new
roomDetail
();
this
.
modelroomDetail
.
room
=
item
;
console
.
log
(
"room"
,
this
.
modelroomDetail
);
// this.modelRoom = new MyRoom({
// "rId": 2,
// "rName": "ห้องคู่",
// "rType": "ห้อง",
// "rPic": "assets/img/room.jpg",
// "roomLimit": 50,
// "rDesc": "จำนวนคน 50 คน"
// });
// this.modelRoom = new MyRoom(item);
console
.
log
(
"room"
,
this
.
modelRoom
);
this
.
modalService
.
open
(
editroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
console
.
log
(
"RESUT"
,
result
)
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
console
.
log
(
"reason"
,
reason
)
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
addroom
(
contentroom
,
item
:
Room
)
{
this
.
modelRoom
=
new
MyRoom
;
this
.
modelRoom
=
item
;
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
console
.
log
(
"RESUT"
,
result
)
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
console
.
log
(
"reason"
,
reason
)
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
addequirment
(
contentequirment
,
item
:
Equirment
)
{
this
.
modelEquirment
=
new
Equirment
;
this
.
modelEquirment
=
item
;
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
console
.
log
(
"RESUT"
,
result
)
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
console
.
log
(
"reason"
,
reason
)
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
Eopen
(
contentequirment
)
{
this
.
modelEquirment
=
new
Equirment
();
Eopen
(
contentequirment
,
index
?:
number
)
{
this
.
index
=
index
;
let
temp
=
{
eqName
:
this
.
listEquirmentModel
[
this
.
index
].
eqName
,
eqType
:
this
.
listEquirmentModel
[
this
.
index
].
eqType
,
eqDesc
:
this
.
listEquirmentModel
[
this
.
index
].
eqDesc
,
eqId
:
this
.
listEquirmentModel
[
this
.
index
].
eqId
,
eqPic
:
this
.
listEquirmentModel
[
this
.
index
].
eqPic
,
}
this
.
listEquirmentModelEdit
=
temp
// this.modelEquirment = new Equirment();
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
index
=
-
1
;
Ropen
(
contentroom
,
index
?:
number
)
{
this
.
index
=
index
;
let
temp
=
{
rName
:
this
.
listRoomModel
[
this
.
index
].
rName
,
rType
:
this
.
listRoomModel
[
this
.
index
].
rType
,
rDesc
:
this
.
listRoomModel
[
this
.
index
].
rDesc
,
rId
:
this
.
listRoomModel
[
this
.
index
].
rId
,
rPic
:
this
.
listRoomModel
[
this
.
index
].
rPic
,
roomLimit
:
this
.
listRoomModel
[
this
.
index
].
roomLimit
,
}
this
.
listRoomModelEdit
=
temp
Ropen
(
contentroom
)
{
this
.
modelRoom
=
new
Room
();
// this.modelRoom = new MyRoom();
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
...
...
@@ -86,8 +168,8 @@ export class AdminEquirmentComponent implements OnInit {
});
}
openItemDetail
(
content
:
string
,
item
:
i
temDetail
)
{
this
.
model
i
temDetail
=
item
;
openItemDetail
(
content
:
string
,
item
:
I
temDetail
)
{
this
.
model
I
temDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -96,8 +178,8 @@ export class AdminEquirmentComponent implements OnInit {
});
}
openRoomDetail
(
content
:
string
,
item
:
r
oomDetail
)
{
this
.
model
r
oomDetail
=
item
;
openRoomDetail
(
content
:
string
,
item
:
R
oomDetail
)
{
this
.
model
R
oomDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -148,4 +230,32 @@ export class AdminEquirmentComponent implements OnInit {
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
onSubmit
()
{
// TODO: Use EventEmitter with form value
console
.
warn
(
this
.
RoomForm
.
value
);
}
updateRoomProfile
()
{
let
temp
=
{
rName
:
this
.
listRoomModelEdit
.
rName
,
rType
:
this
.
listRoomModelEdit
.
rType
,
rDesc
:
this
.
listRoomModelEdit
.
rDesc
,
rId
:
this
.
listRoomModelEdit
.
rId
,
rPic
:
this
.
listRoomModelEdit
.
rPic
,
roomLimit
:
this
.
listRoomModelEdit
.
roomLimit
,
}
this
.
listRoomModel
[
this
.
index
]
=
temp
}
updateItemProfile
()
{
let
temp
=
{
eqName
:
this
.
listEquirmentModelEdit
.
eqName
,
eqType
:
this
.
listEquirmentModelEdit
.
eqType
,
eqDesc
:
this
.
listEquirmentModelEdit
.
eqDesc
,
eqId
:
this
.
listEquirmentModelEdit
.
eqId
,
eqPic
:
this
.
listEquirmentModelEdit
.
eqPic
,
}
this
.
listEquirmentModel
[
this
.
index
]
=
temp
}
}
src/app/pages/admin-pending/admin-pending.component.html
View file @
937f7353
...
...
@@ -85,12 +85,12 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of list
r
oomDetail"
>
<tr
*
ngFor=
"let item of list
R
oomDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.room.rName }}
</td>
<td>
{{ item.room.rDesc }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.sDate
| date:'dd-MM-yyyy'
}} {{ item.sTime.hour }}:{{
<td>
{{ item.sDate}} {{ item.sTime.hour }}:{{
item.sTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{
item.eTime.minute }}
</td>
...
...
@@ -144,7 +144,7 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of list
i
temDetail"
>
<tr
*
ngFor=
"let item of list
I
temDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.equirment.eqType }}
</td>
<td>
{{ item.equirment.eqName }}
</td>
...
...
@@ -199,7 +199,7 @@
<div
class=
" form-group"
>
<label>
ชื่อผู้จอง
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
r
oomDetail.userName}}"
/>
value=
"{{model
R
oomDetail.userName}}"
/>
</div>
</div>
</div>
...
...
@@ -214,37 +214,37 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่อห้อง
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
r
oomDetail.room.rName}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
R
oomDetail.room.rName}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
r
oomDetail.room.rDesc}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
R
oomDetail.room.rDesc}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
r
oomDetail.sDate | date:'dd-MM-yyyy'}}"
>
value=
"{{model
R
oomDetail.sDate | date:'dd-MM-yyyy'}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
r
oomDetail.eDate | date:'dd-MM-yyyy'}}"
>
value=
"{{model
R
oomDetail.eDate | date:'dd-MM-yyyy'}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
roomDetail.sTime.hour}} {{modelr
oomDetail.sTime.minute}}"
>
value=
"{{model
RoomDetail.sTime.hour}} {{modelR
oomDetail.sTime.minute}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
[
readonly
]
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
roomDetail.eTime.hour}} {{modelr
oomDetail.eTime.minute}}"
>
value=
"{{model
RoomDetail.eTime.hour}} {{modelR
oomDetail.eTime.minute}}"
>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -252,7 +252,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
readonly
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
value=
"{{model
r
oomDetail.Remark}}"
></textarea>
placeholder=
"......"
value=
"{{model
R
oomDetail.Remark}}"
></textarea>
</div>
</div>
</div>
...
...
@@ -279,7 +279,7 @@
<div
class=
" form-group"
>
<label>
ชื่อผู้จอง
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
i
temDetail.userName}}"
/>
value=
"{{model
I
temDetail.userName}}"
/>
</div>
</div>
</div>
...
...
@@ -295,45 +295,45 @@
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่ออุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
i
temDetail.equirment.eqName}}"
>
value=
"{{model
I
temDetail.equirment.eqName}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียดอุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
i
temDetail.equirment.eqDesc}}"
>
value=
"{{model
I
temDetail.equirment.eqDesc}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
i
temDetail.sDate | date:'dd-MM-yyyy'}}"
>
value=
"{{model
I
temDetail.sDate | date:'dd-MM-yyyy'}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
i
temDetail.eDate | date:'dd-MM-yyyy'}}"
>
value=
"{{model
I
temDetail.eDate | date:'dd-MM-yyyy'}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
itemDetail.sTime.hour}} {{modeli
temDetail.sTime.minute}}"
>
value=
"{{model
ItemDetail.sTime.hour}} {{modelI
temDetail.sTime.minute}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
itemDetail.eTime.hour}} {{modeli
temDetail.eTime.minute}}"
>
value=
"{{model
ItemDetail.eTime.hour}} {{modelI
temDetail.eTime.minute}}"
>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-sm-6 mb-1"
>
<label
for=
"changequantity"
>
จำนวน
</label>
<input
readonly
id=
"changequantity"
type=
"number"
class=
"form-control form-control-sm"
value=
"{{model
i
temDetail.Quantity}}"
/>
value=
"{{model
I
temDetail.Quantity}}"
/>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -341,7 +341,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
readonly
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
value=
"{{model
i
temDetail.Remark}}"
></textarea>
placeholder=
"......"
value=
"{{model
I
temDetail.Remark}}"
></textarea>
</div>
</div>
</div>
...
...
src/app/pages/admin-pending/admin-pending.component.ts
View file @
937f7353
...
...
@@ -2,11 +2,11 @@ import { Component, OnInit } from '@angular/core';
import
{
NgbDate
,
NgbCalendar
,
NgbDateParserFormatter
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
itemDetail
}
from
'src/app/models/i
temDetail.model'
;
import
{
i
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
roomDetail
}
from
'src/app/models/r
oomDetail.model'
;
import
{
r
oomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
ItemDetail
}
from
'src/app/models/I
temDetail.model'
;
import
{
I
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
RoomDetail
}
from
'src/app/models/R
oomDetail.model'
;
import
{
R
oomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
MyRoom
,
Room
}
from
'src/app/models/rooms.model'
;
@
Component
({
selector
:
'app-admin-pending'
,
...
...
@@ -46,28 +46,28 @@ export class AdminPendingComponent implements OnInit {
closeResult
=
''
;
list
itemDetail
:
i
temDetail
[]
=
[];
list
roomDetail
:
r
oomDetail
[]
=
[];
list
ItemDetail
:
I
temDetail
[]
=
[];
list
RoomDetail
:
R
oomDetail
[]
=
[];
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
model
itemDetail
=
new
i
temDetail
();
model
roomDetail
=
new
r
oomDetail
();
modelRoom
=
new
My
Room
();
model
ItemDetail
=
new
I
temDetail
();
model
RoomDetail
=
new
R
oomDetail
();
collectionSize
=
this
.
list
i
temDetail
.
length
;
collectionSize
=
this
.
list
I
temDetail
.
length
;
hoveredDate
:
NgbDate
|
null
=
null
;
fromDate
:
NgbDate
|
null
;
toDate
:
NgbDate
|
null
;
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
itemDetailService
:
itemDetailService
,
private
roomDetailService
:
r
oomDetailService
)
{
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
ItemDetailService
:
ItemDetailService
,
private
RoomDetailService
:
R
oomDetailService
)
{
this
.
fromDate
=
calendar
.
getToday
();
this
.
toDate
=
calendar
.
getNext
(
calendar
.
getToday
(),
'd'
,
10
);
this
.
refresh
i
temDetail
();
this
.
refresh
I
temDetail
();
}
refresh
i
temDetail
()
{
this
.
list
itemDetail
=
this
.
listi
temDetail
refresh
I
temDetail
()
{
this
.
list
ItemDetail
=
this
.
listI
temDetail
.
map
((
country
,
i
)
=>
({
id
:
i
+
1
,
...
country
}))
.
slice
((
this
.
page
-
1
)
*
this
.
pageSize
,
(
this
.
page
-
1
)
*
this
.
pageSize
+
this
.
pageSize
);
}
...
...
@@ -91,8 +91,8 @@ export class AdminPendingComponent implements OnInit {
});
}
openItemDetail
(
content
:
string
,
item
:
i
temDetail
)
{
this
.
model
i
temDetail
=
item
;
openItemDetail
(
content
:
string
,
item
:
I
temDetail
)
{
this
.
model
I
temDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -101,8 +101,8 @@ export class AdminPendingComponent implements OnInit {
});
}
openRoomDetail
(
content
:
string
,
item
:
r
oomDetail
)
{
this
.
model
r
oomDetail
=
item
;
openRoomDetail
(
content
:
string
,
item
:
R
oomDetail
)
{
this
.
model
R
oomDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -139,9 +139,9 @@ export class AdminPendingComponent implements OnInit {
}
ngOnInit
():
void
{
this
.
list
itemDetail
=
this
.
itemDetailService
.
getListi
temDetail
();
this
.
list
roomDetail
=
this
.
roomDetailService
.
getListr
oomDetail
();
console
.
log
(
this
.
list
i
temDetail
);
this
.
list
ItemDetail
=
this
.
ItemDetailService
.
getListI
temDetail
();
this
.
list
RoomDetail
=
this
.
RoomDetailService
.
getListR
oomDetail
();
console
.
log
(
this
.
list
I
temDetail
);
}
...
...
src/app/pages/equipment/equipment.component.html
View file @
937f7353
...
...
@@ -124,9 +124,9 @@
<ng-template
#
contentequirment
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<ng-template
#
contentequirment
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Add Equirment
</h5>
</div>
...
...
@@ -178,9 +178,9 @@
</div>
</ng-template>
<ng-template
#
contentroom
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<ng-template
#
contentroom
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Add Equirment
</h5>
</div>
...
...
@@ -228,9 +228,9 @@
</div>
</ng-template>
<ng-template
#
Room
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<ng-template
#
Room
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
การจอง
</h5>
</div>
...
...
@@ -240,7 +240,7 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้จอง
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
model
r
oomDetail
.
userName
"
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
model
R
oomDetail
.
userName
"
/>
</div>
</div>
</div>
...
...
@@ -248,40 +248,40 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
เบอร์โทร
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
modelRoomDetail
.
rTelephone
"
/>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่อห้อง
</label>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
r
oomDetail
.
room
.
rName
"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
R
oomDetail
.
room
.
rName
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียด
</label>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
r
oomDetail
.
room
.
rDesc
"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
R
oomDetail
.
room
.
rDesc
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
r
oomDetail
.
sDate
"
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
R
oomDetail
.
sDate
"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
r
oomDetail
.
eDate
"
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
R
oomDetail
.
eDate
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<ngb-timepicker
[(
ngModel
)]="
model
r
oomDetail
.
sTime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
model
R
oomDetail
.
sTime
"
></ngb-timepicker>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<ngb-timepicker
[(
ngModel
)]="
model
r
oomDetail
.
etime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
model
R
oomDetail
.
etime
"
></ngb-timepicker>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -289,7 +289,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
[(
ngModel
)]="
model
r
oomDetail
.
Remark
"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
model
R
oomDetail
.
Remark
"
></textarea>
</div>
</div>
</div>
...
...
@@ -303,9 +303,9 @@
</div>
</ng-template>
<ng-template
#
Lend
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<ng-template
#
Lend
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
เบิกอุปกรณ์
</h5>
</div>
...
...
@@ -315,7 +315,7 @@
<div
class=
" col-sm-12 mb-1"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้เบิก
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
model
i
temDetail
.
userName
"
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
model
I
temDetail
.
userName
"
/>
</div>
</div>
</div>
...
...
@@ -323,47 +323,47 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
เบอร์โทร
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
modelItemDetail
.
eTelephone
"
/>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่ออุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
i
temDetail
.
equirment
.
eqName
"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
I
temDetail
.
equirment
.
eqName
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียดอุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
i
temDetail
.
equirment
.
eqDesc
"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
model
I
temDetail
.
equirment
.
eqDesc
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
i
temDetail
.
sDate
"
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
I
temDetail
.
sDate
"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
i
temDetail
.
eDate
"
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
model
I
temDetail
.
eDate
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<ngb-timepicker
[(
ngModel
)]="
model
i
temDetail
.
sTime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
model
I
temDetail
.
sTime
"
></ngb-timepicker>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<ngb-timepicker
[(
ngModel
)]="
model
i
temDetail
.
eTime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
model
I
temDetail
.
eTime
"
></ngb-timepicker>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-sm-6 mb-1"
>
<label
for=
"changequantity"
>
จำนวน
</label>
<input
id=
"changequantity"
type=
"number"
class=
"form-control form-control-sm"
[(
ngModel
)]="
model
i
temDetail
.
Quantity
"
/>
[(
ngModel
)]="
model
I
temDetail
.
Quantity
"
/>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -371,7 +371,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
[(
ngModel
)]="
model
i
temDetail
.
Remark
"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
model
I
temDetail
.
Remark
"
></textarea>
</div>
</div>
</div>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
937f7353
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
itemDetail
}
from
'src/app/models/i
temDetail.model'
;
import
{
roomDetail
}
from
'src/app/models/r
oomDetail.model'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
ItemDetail
}
from
'src/app/models/I
temDetail.model'
;
import
{
RoomDetail
}
from
'src/app/models/R
oomDetail.model'
;
import
{
MyRoom
,
Room
}
from
'src/app/models/rooms.model'
;
import
{
EquirmentService
}
from
'src/app/service/equirment.service'
;
import
{
i
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
I
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
RoomService
}
from
'src/app/service/room.service'
;
import
{
r
oomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
R
oomDetailService
}
from
'src/app/service/room-detail.service'
;
@
Component
({
...
...
@@ -27,11 +27,11 @@ export class EquipmentComponent implements OnInit {
collectionSize
=
this
.
listEquirmentModel
.
length
;
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
model
itemDetail
=
new
i
temDetail
();
model
roomDetail
=
new
r
oomDetail
();
modelRoom
=
new
My
Room
();
model
ItemDetail
=
new
I
temDetail
();
model
RoomDetail
=
new
R
oomDetail
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
itemDetailService
:
itemDetailService
,
private
roomDetailService
:
r
oomDetailService
)
{
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
ItemDetailService
:
ItemDetailService
,
private
RoomDetailService
:
R
oomDetailService
)
{
}
...
...
@@ -53,9 +53,9 @@ export class EquipmentComponent implements OnInit {
bookEquir
(
Lend
,
item
:
Equirment
)
{
this
.
model
itemDetail
=
new
i
temDetail
();
this
.
model
i
temDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
model
i
temDetail
);
this
.
model
ItemDetail
=
new
I
temDetail
();
this
.
model
I
temDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
model
I
temDetail
);
this
.
modalService
.
open
(
Lend
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -66,9 +66,9 @@ export class EquipmentComponent implements OnInit {
bookRoom
(
Room
,
item
:
Room
)
{
this
.
model
roomDetail
=
new
r
oomDetail
();
this
.
model
r
oomDetail
.
room
=
item
;
console
.
log
(
"room"
,
this
.
model
r
oomDetail
);
this
.
model
RoomDetail
=
new
R
oomDetail
();
this
.
model
R
oomDetail
.
room
=
item
;
console
.
log
(
"room"
,
this
.
model
R
oomDetail
);
this
.
modalService
.
open
(
Room
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -78,7 +78,7 @@ export class EquipmentComponent implements OnInit {
}
Ropen
(
contentroom
)
{
this
.
modelRoom
=
new
Room
();
this
.
modelRoom
=
new
My
Room
();
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
...
...
@@ -124,13 +124,13 @@ export class EquipmentComponent implements OnInit {
}
saveLend
()
{
this
.
itemDetailService
.
additemDetail
(
this
.
modeli
temDetail
);
this
.
ItemDetailService
.
addItemDetail
(
this
.
modelI
temDetail
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
saveBook
()
{
this
.
roomDetailService
.
addroomDetail
(
this
.
modelr
oomDetail
);
this
.
RoomDetailService
.
addRoomDetail
(
this
.
modelR
oomDetail
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
...
...
src/app/pages/lend-page/lend-page.component.ts
View file @
937f7353
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
itemDetail
}
from
'src/app/models/i
temDetail.model'
;
import
{
ItemDetail
}
from
'src/app/models/I
temDetail.model'
;
@
Component
({
selector
:
'app-lend-page'
,
...
...
@@ -8,7 +8,7 @@ import { itemDetail } from 'src/app/models/itemDetail.model';
})
export
class
LendPageComponent
implements
OnInit
{
item
:
i
temDetail
[]
=
[];
item
:
I
temDetail
[]
=
[];
collectionSize
=
this
.
item
.
length
;
constructor
()
{
}
...
...
src/app/pages/pending/pending.component.html
View file @
937f7353
...
...
@@ -85,7 +85,7 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of list
r
oomDetail"
>
<tr
*
ngFor=
"let item of list
R
oomDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.room.rName }}
</td>
<td>
{{ item.room.rDesc }}
</td>
...
...
@@ -142,7 +142,7 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of list
i
temDetail"
>
<tr
*
ngFor=
"let item of list
I
temDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.equirment.eqType }}
</td>
<td>
{{ item.equirment.eqName }}
</td>
...
...
@@ -194,7 +194,7 @@
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้จอง
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
r
oomDetail.userName}}"
/>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
R
oomDetail.userName}}"
/>
</div>
</div>
</div>
...
...
@@ -209,33 +209,33 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่อห้อง
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
r
oomDetail.room.rName}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
R
oomDetail.room.rName}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
r
oomDetail.room.rDesc}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
R
oomDetail.room.rDesc}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
r
oomDetail.sDate | date:'dd-MM-yyyy'}}"
>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
R
oomDetail.sDate | date:'dd-MM-yyyy'}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
r
oomDetail.eDate | date:'dd-MM-yyyy'}}"
>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
R
oomDetail.eDate | date:'dd-MM-yyyy'}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
roomDetail.sTime.hour}} {{modelr
oomDetail.sTime.minute}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
RoomDetail.sTime.hour}} {{modelR
oomDetail.sTime.minute}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
[
readonly
]
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
roomDetail.eTime.hour}} {{modelr
oomDetail.eTime.minute}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
RoomDetail.eTime.hour}} {{modelR
oomDetail.eTime.minute}}"
>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -243,7 +243,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
readonly
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
value=
"{{model
r
oomDetail.Remark}}"
></textarea>
placeholder=
"......"
value=
"{{model
R
oomDetail.Remark}}"
></textarea>
</div>
</div>
</div>
...
...
@@ -265,7 +265,7 @@
<div
class=
" col-sm-12 mb-1"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้จอง
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
i
temDetail.userName}}"
/>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
value=
"{{model
I
temDetail.userName}}"
/>
</div>
</div>
</div>
...
...
@@ -280,39 +280,39 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่ออุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
i
temDetail.equirment.eqName}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
I
temDetail.equirment.eqName}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียดอุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
i
temDetail.equirment.eqDesc}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
I
temDetail.equirment.eqDesc}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
i
temDetail.sDate | date:'dd-MM-yyyy'}}"
>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
I
temDetail.sDate | date:'dd-MM-yyyy'}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
i
temDetail.eDate | date:'dd-MM-yyyy'}}"
>
<input
readonly
type=
"text"
class=
"form-control"
value=
"{{model
I
temDetail.eDate | date:'dd-MM-yyyy'}}"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
itemDetail.sTime.hour}} {{modeli
temDetail.sTime.minute}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
ItemDetail.sTime.hour}} {{modelI
temDetail.sTime.minute}}"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
itemDetail.eTime.hour}} {{modeli
temDetail.eTime.minute}}"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{model
ItemDetail.eTime.hour}} {{modelI
temDetail.eTime.minute}}"
>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-sm-6 mb-1"
>
<label
for=
"changequantity"
>
จำนวน
</label>
<input
readonly
id=
"changequantity"
type=
"number"
class=
"form-control form-control-sm"
value=
"{{model
i
temDetail.Quantity}}"
/>
<input
readonly
id=
"changequantity"
type=
"number"
class=
"form-control form-control-sm"
value=
"{{model
I
temDetail.Quantity}}"
/>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -320,7 +320,7 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
readonly
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
value=
"{{model
i
temDetail.Remark}}"
></textarea>
placeholder=
"......"
value=
"{{model
I
temDetail.Remark}}"
></textarea>
</div>
</div>
</div>
...
...
src/app/pages/pending/pending.component.ts
View file @
937f7353
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NgbDate
,
NgbCalendar
,
NgbDateParserFormatter
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
NgbModal
,
ModalDismissReasons
}
from
'@ng-bootstrap/ng-bootstrap'
;
import
{
itemDetail
}
from
'src/app/models/i
temDetail.model'
;
import
{
i
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
roomDetail
}
from
'src/app/models/r
oomDetail.model'
;
import
{
r
oomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
ItemDetail
}
from
'src/app/models/I
temDetail.model'
;
import
{
I
temDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
RoomDetail
}
from
'src/app/models/R
oomDetail.model'
;
import
{
R
oomDetailService
}
from
'src/app/service/room-detail.service'
;
import
{
Equirment
}
from
'src/app/models/equirment.model'
;
import
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
MyRoom
,
Room
}
from
'src/app/models/rooms.model'
;
@
Component
({
selector
:
'app-pending'
,
...
...
@@ -45,28 +45,28 @@ export class PendingComponent implements OnInit {
closeResult
=
''
;
list
itemDetail
:
i
temDetail
[]
=
[];
list
roomDetail
:
r
oomDetail
[]
=
[];
list
ItemDetail
:
I
temDetail
[]
=
[];
list
RoomDetail
:
R
oomDetail
[]
=
[];
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
model
itemDetail
=
new
i
temDetail
();
model
roomDetail
=
new
r
oomDetail
();
modelRoom
=
new
My
Room
();
model
ItemDetail
=
new
I
temDetail
();
model
RoomDetail
=
new
R
oomDetail
();
collectionSize
=
this
.
list
i
temDetail
.
length
;
collectionSize
=
this
.
list
I
temDetail
.
length
;
hoveredDate
:
NgbDate
|
null
=
null
;
fromDate
:
NgbDate
|
null
;
toDate
:
NgbDate
|
null
;
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
itemDetailService
:
itemDetailService
,
private
roomDetailService
:
r
oomDetailService
)
{
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
ItemDetailService
:
ItemDetailService
,
private
RoomDetailService
:
R
oomDetailService
)
{
this
.
fromDate
=
calendar
.
getToday
();
this
.
toDate
=
calendar
.
getNext
(
calendar
.
getToday
(),
'd'
,
10
);
this
.
refresh
i
temDetail
();
this
.
refresh
I
temDetail
();
}
refresh
i
temDetail
()
{
this
.
list
itemDetail
=
this
.
listi
temDetail
refresh
I
temDetail
()
{
this
.
list
ItemDetail
=
this
.
listI
temDetail
.
map
((
item
,
i
)
=>
({
id
:
i
+
1
,
...
item
}))
.
slice
((
this
.
page
-
1
)
*
this
.
pageSize
,
(
this
.
page
-
1
)
*
this
.
pageSize
+
this
.
pageSize
);
}
...
...
@@ -90,8 +90,8 @@ export class PendingComponent implements OnInit {
});
}
openItemDetail
(
content
:
string
,
item
:
i
temDetail
)
{
this
.
model
i
temDetail
=
item
;
openItemDetail
(
content
:
string
,
item
:
I
temDetail
)
{
this
.
model
I
temDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -100,8 +100,8 @@ export class PendingComponent implements OnInit {
});
}
openRoomDetail
(
content
:
string
,
item
:
r
oomDetail
)
{
this
.
model
r
oomDetail
=
item
;
openRoomDetail
(
content
:
string
,
item
:
R
oomDetail
)
{
this
.
model
R
oomDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
...
...
@@ -139,9 +139,9 @@ export class PendingComponent implements OnInit {
}
ngOnInit
()
{
this
.
list
itemDetail
=
this
.
itemDetailService
.
getListi
temDetail
();
this
.
list
roomDetail
=
this
.
roomDetailService
.
getListr
oomDetail
();
console
.
log
(
this
.
list
i
temDetail
);
this
.
list
ItemDetail
=
this
.
ItemDetailService
.
getListI
temDetail
();
this
.
list
RoomDetail
=
this
.
RoomDetailService
.
getListR
oomDetail
();
console
.
log
(
this
.
list
I
temDetail
);
}
}
...
...
src/app/service/item-detail.service.ts
View file @
937f7353
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
itemDetail
,
SearchitemDetailModel
}
from
'../models/i
temDetail.model'
;
import
{
ItemDetail
,
SearchItemDetailModel
}
from
'../models/I
temDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
i
temDetailService
{
export
class
I
temDetailService
{
constructor
(
private
http
:
HttpClient
)
{
}
url
:
string
;
list
itemDetail
:
i
temDetail
[]
=
[
list
ItemDetail
:
I
temDetail
[]
=
[
{
Id
:
1
,
equirment
:
{
...
...
@@ -32,6 +32,7 @@ export class itemDetailService {
},
eStatus
:
'รอการอนุมัติ'
,
Quantity
:
'1'
,
eTelephone
:
undefined
,
Remark
:
'test'
,
},
{
...
...
@@ -58,35 +59,36 @@ export class itemDetailService {
},
eStatus
:
'รอการอนุมัติ'
,
Quantity
:
'1'
,
eTelephone
:
undefined
,
Remark
:
'test'
,
},
]
add
itemDetail
(
model
:
i
temDetail
)
{
console
.
log
(
this
.
list
i
temDetail
);
this
.
list
i
temDetail
.
push
(
model
);
add
ItemDetail
(
model
:
I
temDetail
)
{
console
.
log
(
this
.
list
I
temDetail
);
this
.
list
I
temDetail
.
push
(
model
);
this
.
listItemDetail
.
reverse
}
getList
i
temDetail
()
{
return
this
.
list
i
temDetail
;
getList
I
temDetail
()
{
return
this
.
list
I
temDetail
;
}
// getList
i
temDetail() {
// getList
I
temDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.list
i
temDetail = response.content;
// this.list
I
temDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchList
itemDetail
(
searchModel
:
Searchi
temDetailModel
)
{
searchList
ItemDetail
(
searchModel
:
SearchI
temDetailModel
)
{
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
.
list
i
temDetail
=
response
;
this
.
list
I
temDetail
=
response
;
},
error
=>
{
console
.
log
(
error
)
alert
(
"ไม่สามารถค้นหาอุปกรณ์ที่ว่างได้ เนื่องจาก :
\
n"
+
error
.
message
)
...
...
@@ -101,22 +103,22 @@ export class itemDetailService {
// }
delete
itemDetail
(
itemDetailModel
:
i
temDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
i
temDetailModel
.
Id
).
subscribe
(
response
=>
{
delete
ItemDetail
(
ItemDetailModel
:
I
temDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
I
temDetailModel
.
Id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getList
i
temDetail
()
this
.
getList
I
temDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
update
itemDetail
(
itemDetailModel
:
i
temDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
itemDetailModel
.
Id
,
i
temDetailModel
).
subscribe
(
response
=>
{
update
ItemDetail
(
ItemDetailModel
:
I
temDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
ItemDetailModel
.
Id
,
I
temDetailModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
i
temDetailModel
(
eqId
:
string
)
{
I
temDetailModel
(
eqId
:
string
)
{
}
...
...
src/app/service/room-detail.service.ts
View file @
937f7353
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
roomDetail
,
SearchroomDetailModel
}
from
'../models/r
oomDetail.model'
;
import
{
RoomDetail
,
SearchRoomDetailModel
}
from
'../models/R
oomDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
r
oomDetailService
{
export
class
R
oomDetailService
{
constructor
(
private
http
:
HttpClient
)
{
}
url
:
string
;
list
roomDetail
:
r
oomDetail
[]
=
[
list
RoomDetail
:
R
oomDetail
[]
=
[
{
Id
:
1
,
room
:
{
...
...
@@ -31,7 +31,8 @@ export class roomDetailService {
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
rStatus
:
'รอการอนุมัติ'
,
rTelephone
:
undefined
,
Remark
:
'test'
,
},
{
...
...
@@ -57,40 +58,41 @@ export class roomDetailService {
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
rStatus
:
'รอการอนุมัติ'
,
rTelephone
:
undefined
,
Remark
:
'test'
,
},
]
edit
roomDetail
(
model
:
r
oomDetail
)
{
this
.
list
r
oomDetail
.
push
(
model
)
edit
RoomDetail
(
model
:
R
oomDetail
)
{
this
.
list
R
oomDetail
.
push
(
model
)
}
add
roomDetail
(
model
:
r
oomDetail
)
{
console
.
log
(
this
.
list
r
oomDetail
);
this
.
list
r
oomDetail
.
push
(
model
);
add
RoomDetail
(
model
:
R
oomDetail
)
{
console
.
log
(
this
.
list
R
oomDetail
);
this
.
list
R
oomDetail
.
push
(
model
);
}
getList
r
oomDetail
()
{
return
this
.
list
r
oomDetail
;
getList
R
oomDetail
()
{
return
this
.
list
R
oomDetail
;
}
// getList
r
oomDetail() {
// getList
R
oomDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.list
r
oomDetail = response.content;
// this.list
R
oomDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchList
roomDetail
(
searchModel
:
Searchr
oomDetailModel
)
{
searchList
RoomDetail
(
searchModel
:
SearchR
oomDetailModel
)
{
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
.
list
r
oomDetail
=
response
;
this
.
list
R
oomDetail
=
response
;
},
error
=>
{
console
.
log
(
error
)
alert
(
"ไม่สามารถค้นหาอุปกรณ์ที่ว่างได้ เนื่องจาก :
\
n"
+
error
.
message
)
...
...
@@ -105,22 +107,22 @@ export class roomDetailService {
// }
delete
roomDetail
(
roomDetailModel
:
r
oomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
r
oomDetailModel
.
Id
).
subscribe
(
response
=>
{
delete
RoomDetail
(
RoomDetailModel
:
R
oomDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
R
oomDetailModel
.
Id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getList
r
oomDetail
()
this
.
getList
R
oomDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
update
roomDetail
(
roomDetailModel
:
r
oomDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
roomDetailModel
.
Id
,
r
oomDetailModel
).
subscribe
(
response
=>
{
update
RoomDetail
(
RoomDetailModel
:
R
oomDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
RoomDetailModel
.
Id
,
R
oomDetailModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
r
oomDetailModel
(
rId
:
string
)
{
R
oomDetailModel
(
rId
:
string
)
{
}
...
...
src/app/service/room.service.ts
View file @
937f7353
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Room
,
SearchRoomModel
}
from
'../models/rooms.model'
;
import
{
roomDetail
}
from
'../models/r
oomDetail.model'
;
import
{
RoomDetail
}
from
'../models/R
oomDetail.model'
;
...
...
@@ -43,6 +43,157 @@ export class RoomService {
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
5
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
6
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
7
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
8
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
9
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
10
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
11
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
12
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
13
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
14
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
15
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
16
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
17
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
18
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
19
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
,
{
rId
:
2
,
rName
:
"ห้องคู่"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
50
,
rDesc
:
"จำนวนคน 50 คน"
,
},
{
rId
:
20
,
rName
:
"ห้องรวม"
,
rType
:
"ห้อง"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
},
{
rId
:
21
,
rName
:
"รถ"
,
rType
:
"รถ"
,
rPic
:
"assets/img/car.jpg"
,
roomLimit
:
0
,
rDesc
:
"รถ"
,
}
]
listRoomSearch
:
Room
[]
=
[];
...
...
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