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
12cd07db
Commit
12cd07db
authored
Dec 09, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Validator หน้าอุปกรณ์ และ admin
parent
591bb041
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
29 deletions
+109
-29
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
+37
-15
admin-pending.component.ts
src/app/pages/admin-pending/admin-pending.component.ts
+32
-0
equipment.component.html
src/app/pages/equipment/equipment.component.html
+35
-12
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+5
-2
No files found.
src/app/pages/admin-equirment/admin-equirment.component.html
View file @
12cd07db
This diff is collapsed.
Click to expand it.
src/app/pages/admin-equirment/admin-equirment.component.ts
View file @
12cd07db
...
...
@@ -52,15 +52,11 @@ export class AdminEquirmentComponent implements OnInit {
rDesc
:
new
FormControl
(
''
)
});
myFormRoom
:
FormGroup
;
myFormEquir
:
FormGroup
;
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
()
{
...
...
@@ -68,6 +64,34 @@ export class AdminEquirmentComponent implements OnInit {
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
this
.
collectionSizeListRoom
=
this
.
listRoomModel
.
length
console
.
log
(
"listRoom"
,
this
.
listRoomModel
)
this
.
myFormRoom
=
new
FormGroup
({
userNameForm
:
new
FormControl
(
''
,[
Validators
.
required
]),
rTelephone
:
new
FormControl
(
''
,[
Validators
.
required
]),
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
rName
:
new
FormControl
(
''
,[
Validators
.
required
]),
rDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
rType
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
Remark
:
new
FormControl
()
});
this
.
myFormEquir
=
new
FormGroup
({
userNameForm
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTelephone
:
new
FormControl
(
''
,[
Validators
.
required
]),
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqType
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqPic
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
Quantity
:
new
FormControl
(
''
,[
Validators
.
required
]),
Remark
:
new
FormControl
(
''
,[
Validators
.
required
]),
})
}
bookEquir
(
editLend
,
item
:
Equirment
)
{
...
...
@@ -168,20 +192,18 @@ 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
)
=>
{
openItemDetail
(
contentequirment
)
{
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
)}
`
;
});
}
openRoomDetail
(
content
:
string
,
item
:
RoomDetail
)
{
this
.
modelRoomDetail
=
item
;
console
.
log
(
item
);
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
openRoomDetail
(
contentroom
)
{
this
.
modelRoom
=
new
MyRoom
();
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
...
...
src/app/pages/admin-pending/admin-pending.component.ts
View file @
12cd07db
...
...
@@ -9,6 +9,7 @@ import { RoomDetailService } from 'src/app/service/room-detail.service';
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
{
FormControl
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
@
Component
({
selector
:
'app-admin-pending'
,
...
...
@@ -185,11 +186,42 @@ export class AdminPendingComponent implements OnInit {
return
parsed
&&
this
.
calendar
.
isValid
(
NgbDate
.
from
(
parsed
))
?
NgbDate
.
from
(
parsed
)
:
currentValue
;
}
myFormRoom
:
FormGroup
;
myFormEquir
:
FormGroup
;
ngOnInit
():
void
{
this
.
listitemDetail
=
this
.
ItemDetailService
.
getListItemDetail
();
this
.
listroomDetail
=
this
.
RoomDetailService
.
getListRoomDetail
();
this
.
collectionSizeListRoom
=
this
.
listitemDetail
.
length
;
console
.
log
(
this
.
listitemDetail
);
this
.
myFormRoom
=
new
FormGroup
({
userNameForm
:
new
FormControl
(
''
,[
Validators
.
required
]),
rTelephone
:
new
FormControl
(
''
,[
Validators
.
required
]),
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
rName
:
new
FormControl
(
''
,[
Validators
.
required
]),
rDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
rType
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
Remark
:
new
FormControl
()
});
this
.
myFormEquir
=
new
FormGroup
({
userNameForm
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTelephone
:
new
FormControl
(
''
,[
Validators
.
required
]),
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqType
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqPic
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
eTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
Quantity
:
new
FormControl
(
''
,[
Validators
.
required
]),
Remark
:
new
FormControl
(
''
,[
Validators
.
required
]),
})
}
saveEquirment
()
{
...
...
src/app/pages/equipment/equipment.component.html
View file @
12cd07db
...
...
@@ -131,13 +131,16 @@
<h5
class=
" title"
>
Add Equirment
</h5>
</div>
<div
class=
" card-body"
>
<form
[
formGroup
]="
myFormEquir
"
class=
"needs-validation"
>
<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=
""
/>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelEquirment
.
eqName
"
value=
""
formControlName=
"eqName"
/>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqName.status=='INVALID'"
>
Invalid
Equirment Name.
</div>
</div>
</div>
</div>
...
...
@@ -147,11 +150,14 @@
<label>
หมวดหมู่
</label>
<br>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelEquirment
.
eqType
"
>
[(
ngModel
)]="
modelEquirment
.
eqType
"
formControlName=
"
eqType"
>
<option
selected
>
เลือกหมวดหมู่
</option>
<option
value=
"4"
>
IT
</option>
<option
value=
"5"
>
Company
</option>
</select>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqType.status=='INVALID'"
>
Invalid
Equirment Type.
</div>
</div>
</div>
</div>
...
...
@@ -160,14 +166,19 @@
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
modelEquirment
.
eqDesc
"
formControlName=
"eqDesc"
></textarea>
<div
style=
"color: red;"
*
ngIf=
"myFormEquir.controls.eqDesc.status=='INVALID'"
>
Invalid
Equirment Desc.
</div>
</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"
formControlName=
"eqPic
"
>
</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"
...
...
@@ -181,14 +192,19 @@
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Add Equirment
</h5>
<h5
class=
" title"
>
เพิ่มรายการ
</h5>
</div>
<div
class=
" card-body"
>
<form
[
formGroup
]="
myFormRoom
"
class=
"needs-validation"
>
<div
class=
" row"
>
<div
class=
" col-md-12"
>
<div
class=
" form-group"
>
<label>
ชื่อ
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelRoom
.
rName
"
>
<input
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelRoom
.
rName
"
formControlName=
"rName"
>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rName.status=='INVALID'"
>
Invalid
Name.
</div>
</div>
</div>
</div>
...
...
@@ -198,11 +214,13 @@
<label>
ประเภท
</label>
<br>
<select
class=
"form-select"
aria-label=
"Default select example"
[(
ngModel
)]="
modelRoom
.
rType
"
>
<option
selected
>
เลือกประเภท
</option>
[(
ngModel
)]="
modelRoom
.
rType
"
formControlName=
"rType"
>
<option
value=
"1"
>
ห้อง
</option>
<option
value=
"2"
>
รถ
</option>
</select>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rType.status=='INVALID'"
>
Invalid
Type.
</div>
</div>
</div>
</div>
...
...
@@ -211,12 +229,17 @@
<div
class=
" form-group"
>
<label>
รายละเอียด
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
[(
ngModel
)]="
modelRoom
.
rDesc
"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
modelRoom
.
rDesc
"
formControlName=
"rDesc"
></textarea>
<div
style=
"color: red;"
*
ngIf=
"myFormRoom.controls.rDesc.status=='INVALID'"
>
Invalid
Desc.
</div>
</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
)="
saveRoom
()"
>
Save
</button>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
12cd07db
...
...
@@ -59,8 +59,9 @@ export class EquipmentComponent implements OnInit {
userNameForm
:
new
FormControl
(
''
,[
Validators
.
required
]),
rTelephone
:
new
FormControl
(
''
,[
Validators
.
required
]),
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
rName
:
new
FormControl
(),
rDesc
:
new
FormControl
(),
rName
:
new
FormControl
(
''
,[
Validators
.
required
]),
rDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
rType
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
...
...
@@ -73,6 +74,8 @@ export class EquipmentComponent implements OnInit {
email
:
new
FormControl
(
''
,[
Validators
.
required
,
Validators
.
email
]),
eqName
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqDesc
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqType
:
new
FormControl
(
''
,[
Validators
.
required
]),
eqPic
:
new
FormControl
(
''
,[
Validators
.
required
]),
sDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
eDate
:
new
FormControl
(
''
,[
Validators
.
required
]),
sTime
:
new
FormControl
(
''
,[
Validators
.
required
]),
...
...
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