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
6d169133
Commit
6d169133
authored
Dec 03, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update เพิ่มปุ่มแก้ไข หน้า admin
parent
c709d9e1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
63 deletions
+136
-63
admin-equirment.component.html
src/app/pages/admin-equirment/admin-equirment.component.html
+0
-0
admin-equirment.component.ts
src/app/pages/admin-equirment/admin-equirment.component.ts
+67
-4
equipment.component.html
src/app/pages/equipment/equipment.component.html
+58
-56
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+2
-2
room-detail.service.ts
src/app/service/room-detail.service.ts
+4
-0
room.service.ts
src/app/service/room.service.ts
+5
-1
No files found.
src/app/pages/admin-equirment/admin-equirment.component.html
View file @
6d169133
This diff is collapsed.
Click to expand it.
src/app/pages/admin-equirment/admin-equirment.component.ts
View file @
6d169133
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/itemDetail.model'
;
import
{
roomDetail
}
from
'src/app/models/roomDetail.model'
;
import
{
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'
;
@
Component
({
selector
:
'app-admin-equirment'
,
...
...
@@ -19,10 +22,18 @@ export class AdminEquirmentComponent implements OnInit {
listEquirmentModel
:
Equirment
[]
=
[];
listRoomModel
:
Room
[]
=
[];
listitemDetail
:
itemDetail
[]
=
[];
listroomDetail
:
roomDetail
[]
=
[];
collectionSize
=
this
.
listEquirmentModel
.
length
;
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
)
{
modelitemDetail
=
new
itemDetail
();
modelroomDetail
=
new
roomDetail
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
roomDetailService
:
roomDetailService
)
{
}
...
...
@@ -31,6 +42,32 @@ export class AdminEquirmentComponent implements OnInit {
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
}
bookEquir
(
editLend
,
item
:
Equirment
)
{
this
.
modelitemDetail
=
new
itemDetail
();
this
.
modelitemDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
modelitemDetail
);
this
.
modalService
.
open
(
editLend
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
bookRoom
(
editroom
,
item
:
Room
)
{
this
.
modelroomDetail
=
new
roomDetail
();
this
.
modelroomDetail
.
room
=
item
;
console
.
log
(
"room"
,
this
.
modelroomDetail
);
this
.
modalService
.
open
(
editroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
Eopen
(
contentequirment
)
{
this
.
modelEquirment
=
new
Equirment
();
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -49,6 +86,26 @@ export class AdminEquirmentComponent implements OnInit {
});
}
openItemDetail
(
content
:
string
,
item
:
itemDetail
)
{
this
.
modelitemDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
openRoomDetail
(
content
:
string
,
item
:
roomDetail
)
{
this
.
modelroomDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
private
getDismissReason
(
reason
:
any
):
string
{
if
(
reason
===
ModalDismissReasons
.
ESC
)
{
...
...
@@ -80,9 +137,15 @@ export class AdminEquirmentComponent implements OnInit {
saveRoom
()
{
this
.
roomService
.
addRoom
(
this
.
modelRoom
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
this
.
roomService
.
addRoom
(
this
.
modelRoom
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
editRoom
()
{
this
.
roomService
.
editroom
(
this
.
modelRoom
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
}
src/app/pages/equipment/equipment.component.html
View file @
6d169133
...
...
@@ -72,60 +72,6 @@
<div
class=
"col-sm-12"
>
<div
class=
""
>
<div
class=
"card-body"
>
<ng-template
#
contentequirment
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Add Equirment
</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"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelEquirment
.
eqName
"
value=
""
/>
</div>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-md-6 mb-2"
>
<div
class=
" form-group"
>
<label>
หมวดหมู่
</label>
<br>
<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>
</select>
</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"
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
></textarea>
</div>
</div>
</div>
<label
for=
"exampleFormControlFile"
>
แนบไฟล์รูปภาพ
</label>
<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>
</div>
</div>
</div>
</ng-template>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
Eopen
(
contentequirment
)"
>
เพิ่มรายการ
</button>
...
...
@@ -146,7 +92,7 @@
<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
(
l
end
,
item
)"
>
เบิก
</button>
(
click
)="
bookEquir
(
L
end
,
item
)"
>
เบิก
</button>
</div>
</div>
</div>
...
...
@@ -176,6 +122,62 @@
<div
[
ngbNavOutlet
]="
nav
"
></div>
</div>
<ng-template
#
contentequirment
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Add Equirment
</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"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelEquirment
.
eqName
"
value=
""
/>
</div>
</div>
</div>
<div
class=
" row"
>
<div
class=
" col-md-6 mb-2"
>
<div
class=
" form-group"
>
<label>
หมวดหมู่
</label>
<br>
<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>
</select>
</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"
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
></textarea>
</div>
</div>
</div>
<label
for=
"exampleFormControlFile"
>
แนบไฟล์รูปภาพ
</label>
<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>
</div>
</div>
</div>
</ng-template>
<ng-template
#
contentroom
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
...
...
@@ -301,7 +303,7 @@
</div>
</ng-template>
<ng-template
#
l
end
let-modal
style=
"padding: 0; "
>
<ng-template
#
L
end
let-modal
style=
"padding: 0; "
>
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
6d169133
...
...
@@ -51,13 +51,13 @@ export class EquipmentComponent implements OnInit {
}
bookEquir
(
contentequirment
,
item
:
Equirment
)
{
bookEquir
(
Lend
,
item
:
Equirment
)
{
this
.
modelitemDetail
=
new
itemDetail
();
this
.
modelitemDetail
.
equirment
=
item
;
console
.
log
(
"item"
,
this
.
modelitemDetail
);
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
modalService
.
open
(
Lend
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
...
...
src/app/service/room-detail.service.ts
View file @
6d169133
...
...
@@ -61,6 +61,10 @@ export class roomDetailService {
]
editroomDetail
(
model
:
roomDetail
)
{
this
.
listroomDetail
.
push
(
model
)
}
addroomDetail
(
model
:
roomDetail
)
{
console
.
log
(
this
.
listroomDetail
);
this
.
listroomDetail
.
push
(
model
);
...
...
src/app/service/room.service.ts
View file @
6d169133
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Room
,
SearchRoomModel
}
from
'../models/rooms.model'
;
import
{
roomDetail
}
from
'../models/roomDetail.model'
;
...
...
@@ -28,7 +29,6 @@ export class RoomService {
{
rId
:
3
,
rName
:
"ห้องรวม"
,
rPic
:
"assets/img/room.jpg"
,
roomLimit
:
100
,
rDesc
:
"จำนวนคน 100 คน"
,
...
...
@@ -43,6 +43,10 @@ export class RoomService {
]
listRoomSearch
:
Room
[]
=
[];
editroom
(
model
:
Room
)
{
this
.
listRoomModel
.
push
(
model
);
}
addRoom
(
model
:
Room
)
{
this
.
listRoomModel
.
push
(
model
);
}
...
...
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