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
9bc28b4f
Commit
9bc28b4f
authored
Dec 15, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ปุ่ม delete
parent
17e6682c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
14 deletions
+54
-14
admin-equirment.component.html
src/app/pages/admin-equirment/admin-equirment.component.html
+29
-6
admin-equirment.component.ts
src/app/pages/admin-equirment/admin-equirment.component.ts
+19
-8
room.service.ts
src/app/service/room.service.ts
+6
-0
No files found.
src/app/pages/admin-equirment/admin-equirment.component.html
View file @
9bc28b4f
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<button
class=
"btn btn-sm btn-outline-primary"
<button
class=
"btn btn-sm btn-outline-primary"
(
click
)="
Ropen
(
editroom
,((
pageListRoom-1
)
*
pageSizeListRoom
)+
i
)"
>
แก้ไข
</button>
(
click
)="
Ropen
(
editroom
,((
pageListRoom-1
)
*
pageSizeListRoom
)+
i
)"
>
แก้ไข
</button>
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
<button
class=
"btn btn-sm btn-danger"
type=
"button.dispose"
(
click
)="
modal
.
close
(
)"
>
ลบ
</button>
(
click
)="
openDelete
(
deleteRoom
)"
>
ลบ
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -205,7 +205,8 @@
...
@@ -205,7 +205,8 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<label>
ชื่อ
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
formControlName=
"rName"
>
<input
class=
" form-control"
placeholder=
""
type=
"text"
formControlName=
"rName"
>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rName.status=='INVALID'"
>
กรุณากรอกชื่อ.
</div>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rName.status=='INVALID'"
>
กรุณากรอกชื่อ.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -219,7 +220,8 @@
...
@@ -219,7 +220,8 @@
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"2"
>
รถ
</option>
<option
value=
"2"
>
รถ
</option>
</select>
</select>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rType.status=='INVALID'"
>
กรุณากรอกประเภท
</div>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rType.status=='INVALID'"
>
กรุณากรอกประเภท
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -302,19 +304,22 @@
...
@@ -302,19 +304,22 @@
<div
class=
" row"
>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<label>
ชื่ออุปกรณ์
</label>
<label>
ชื่ออุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqName
"
formControlName=
"eqName"
>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqName
"
formControlName=
"eqName"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqName.status=='INVALID'"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqName.status=='INVALID'"
>
กรุณากรอกชื่ออุปกรณ์
</div>
กรุณากรอกชื่ออุปกรณ์
</div>
</div>
</div>
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<label>
ประเภทอุปกรณ์
</label>
<label>
ประเภทอุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqType
"
formControlName=
"eqType"
>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqType
"
formControlName=
"eqType"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqType.status=='INVALID'"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqType.status=='INVALID'"
>
กรุณากรอกประเภทอุปกรณ์
</div>
กรุณากรอกประเภทอุปกรณ์
</div>
</div>
</div>
<div
class=
" col-md-12"
>
<div
class=
" col-md-12"
>
<label>
รายละเอียดอุปกรณ์
</label>
<label>
รายละเอียดอุปกรณ์
</label>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqDesc
"
formControlName=
"eqDesc"
>
<input
class=
" form-control"
type=
"text"
[(
ngModel
)]="
listEquirmentModelEdit
.
eqDesc
"
formControlName=
"eqDesc"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqDesc.status=='INVALID'"
>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqDesc.status=='INVALID'"
>
กรุณากรอกรายละเอียดอุปกรณ์
</div>
กรุณากรอกรายละเอียดอุปกรณ์
</div>
</div>
</div>
...
@@ -329,3 +334,20 @@
...
@@ -329,3 +334,20 @@
</div>
</div>
</div>
</div>
</ng-template>
</ng-template>
<ng-template
#
deleteRoom
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"
>
<h4
class=
"text"
>
คุณต้องการลบข้อมูลจริงหรือไม่
</h4>
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
(
click
)="
deleteRoomProfile
(
item
)"
>
ยืนยัน
</button>
<button
class=
" btn btn-fill btn-danger"
(
click
)="
modal
.
dismiss
()"
>
ยกเลิก
</button>
</div>
</div>
</div>
</ng-template>
\ No newline at end of file
src/app/pages/admin-equirment/admin-equirment.component.ts
View file @
9bc28b4f
...
@@ -266,18 +266,29 @@ export class AdminEquirmentComponent implements OnInit {
...
@@ -266,18 +266,29 @@ export class AdminEquirmentComponent implements OnInit {
this
.
roomService
.
updateRoomProfile
(
this
.
listRoomModel
[
this
.
index
])
this
.
roomService
.
updateRoomProfile
(
this
.
listRoomModel
[
this
.
index
])
this
.
modalService
.
dismissAll
();
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
this
.
ngOnInit
();
console
.
log
(
"this.listRoomModelEdit"
,
this
.
listRoomModel
)
}
}
updateItemProfile
()
{
updateItemProfile
()
{
let
temp
=
{
this
.
listEquirmentModel
[
this
.
index
].
eqName
=
this
.
myFormEquir
.
value
.
eqName
eqName
:
this
.
listEquirmentModelEdit
.
eqName
,
this
.
listEquirmentModel
[
this
.
index
].
eqDesc
=
this
.
myFormEquir
.
value
.
eqDesc
eqType
:
this
.
listEquirmentModelEdit
.
eqType
,
this
.
listEquirmentModel
[
this
.
index
].
eqType
=
this
.
myFormEquir
.
value
.
eqType
eqDesc
:
this
.
listEquirmentModelEdit
.
eqDesc
,
this
.
equirmentService
.
updateEquirProfile
(
this
.
listEquirmentModel
[
this
.
index
])
eqId
:
this
.
listEquirmentModelEdit
.
eqId
,
this
.
modalService
.
dismissAll
();
eqPic
:
this
.
listEquirmentModelEdit
.
eqPic
,
this
.
ngOnInit
();
}
deleteRoomProfile
(
item
:
Room
)
{
this
.
roomService
.
deleteRoomProfile
(
item
)
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
}
}
this
.
listEquirmentModel
[
this
.
index
]
=
temp
openDelete
(
deleteRoomProfile
)
{
this
.
modalService
.
open
(
deleteRoomProfile
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
}
}
}
src/app/service/room.service.ts
View file @
9bc28b4f
...
@@ -256,6 +256,12 @@ export class RoomService {
...
@@ -256,6 +256,12 @@ export class RoomService {
});
});
}
}
deleteRoomProfile
(
row_obj
:
Room
)
{
this
.
listRoomModel
=
this
.
listRoomModel
.
filter
((
value
,
key
)
=>
{
return
value
.
rId
!==
row_obj
.
rId
;
});
}
roomModel
(
rId
:
string
)
{
roomModel
(
rId
:
string
)
{
}
}
...
...
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