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
352a8acf
Commit
352a8acf
authored
Dec 17, 2021
by
Chanachai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update บันทึกclickได้
parent
f90b9067
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
contact-admin.component.html
src/app/pages/contact-admin/contact-admin.component.html
+10
-10
contact-admin.component.ts
src/app/pages/contact-admin/contact-admin.component.ts
+16
-13
contact.service.ts
src/app/service/contact.service.ts
+4
-0
No files found.
src/app/pages/contact-admin/contact-admin.component.html
View file @
352a8acf
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
</div>
</div>
<div
class=
"card-footer"
>
<div
class=
"card-footer"
>
<div
class=
"d-grid gap-2 d-md-flex justify-content-md-center"
>
<div
class=
"d-grid gap-2 d-md-flex justify-content-md-center"
>
<button
type=
"button"
class=
"btn btn-primary btn-sm
"
(
click
)="
saveContact
()"
>
บันทึก
</button>
<button
class=
"btn btn-primary btn-sm"
type=
"submit"
[
disabled
]="
"
(
click
)="
saveContact
()"
>
บันทึก
</button>
<button
type=
"button"
class=
"btn btn-primary btn-sm
"
>
ยกเลิก
</button>
<button
class=
"btn btn-primary btn-sm"
type=
"cancel"
(
click
)="
model
.
dismiss
('
Cross
click
')
"
>
ยกเลิก
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -85,8 +85,9 @@
...
@@ -85,8 +85,9 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ng-template
#
Alllist
let-modal
>
<ng-template
#
Alllist
let-modal
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
" col-md-12"
style=
"padding: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
"card"
style=
"margin: 0; "
>
<div
class=
" card-header"
>
<div
class=
" card-header"
>
...
@@ -98,7 +99,7 @@
...
@@ -98,7 +99,7 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
ชื่อหัวข้อ
</label>
<label>
ชื่อหัวข้อ
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelContatc
.
ctHead
"
/>
[(
ngModel
)]="
modelContact
.
ctHead
"
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -107,7 +108,7 @@
...
@@ -107,7 +108,7 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
หน้าต่างที่มี BUG
</label>
<label>
หน้าต่างที่มี BUG
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelContatc
.
ctTab
"
/>
[(
ngModel
)]="
modelContact
.
ctTab
"
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -116,18 +117,17 @@
...
@@ -116,18 +117,17 @@
<div
class=
" form-group"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้แจ้ง
</label>
<label>
ชื่อผู้แจ้ง
</label>
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
<input
readonly
class=
" form-control"
placeholder=
""
type=
"text"
[(
ngModel
)]="
modelContatc
.
ctName
"
/>
[(
ngModel
)]="
modelContact
.
ctName
"
/>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<label
for=
"exampleFormControlSelect1"
>
วันที่แจ้ง
</label>
<input
readonly
type=
"date"
class=
"form-control"
[(
ngModel
)]="
sDate
"
>
<input
readonly
type=
"date"
class=
"form-control"
[(
ngModel
)]="
sDate
"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</ng-template>
</div>
\ No newline at end of file
\ No newline at end of file
src/app/pages/contact-admin/contact-admin.component.ts
View file @
352a8acf
...
@@ -10,7 +10,7 @@ const pages = ['หน้าหลัก','รายการอุปกรณ
...
@@ -10,7 +10,7 @@ const pages = ['หน้าหลัก','รายการอุปกรณ
@
Component
({
@
Component
({
selector
:
'app-contact-admin'
,
selector
:
'app-contact-admin'
,
templateUrl
:
'./contact-admin.component.html'
,
templateUrl
:
'./contact-admin.component.html'
,
styleUrls
:
[
'./contact-admin.component.scss'
]
styleUrls
:
[
'./contact-admin.component.scss'
]
})
})
export
class
ContactAdminComponent
implements
OnInit
{
export
class
ContactAdminComponent
implements
OnInit
{
...
@@ -28,7 +28,7 @@ export class ContactAdminComponent implements OnInit {
...
@@ -28,7 +28,7 @@ export class ContactAdminComponent implements OnInit {
listContact
:
Contact
[]
=
[];
listContact
:
Contact
[]
=
[];
model
c
ontact
=
new
Contact
();
model
C
ontact
=
new
Contact
();
myFromContact
:
FormGroup
;
myFromContact
:
FormGroup
;
...
@@ -43,6 +43,7 @@ export class ContactAdminComponent implements OnInit {
...
@@ -43,6 +43,7 @@ export class ContactAdminComponent implements OnInit {
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
listContact
=
this
.
ContactService
.
getListContact
();
this
.
listContact
=
this
.
ContactService
.
getListContact
();
this
.
collectionSizeListRoom
=
this
.
listContact
.
length
;
this
.
collectionSizeListRoom
=
this
.
listContact
.
length
;
this
.
collectionSize
=
this
.
listContact
.
length
}
}
search
:
OperatorFunction
<
string
,
readonly
string
[]
>
=
(
text$
:
Observable
<
string
>
)
=>
{
search
:
OperatorFunction
<
string
,
readonly
string
[]
>
=
(
text$
:
Observable
<
string
>
)
=>
{
...
@@ -67,30 +68,32 @@ export class ContactAdminComponent implements OnInit {
...
@@ -67,30 +68,32 @@ export class ContactAdminComponent implements OnInit {
}
}
openContact
(
content
:
string
,
item
:
Contact
)
{
openContact
(
content
:
string
,
item
:
Contact
)
{
this
.
model
c
ontact
=
item
;
this
.
model
C
ontact
=
item
;
let
sDate
=
this
.
model
c
ontact
.
sDate
.
split
(
'/'
)
let
sDate
=
this
.
model
C
ontact
.
sDate
.
split
(
'/'
)
this
.
sDate
=
sDate
[
0
]
+
"-"
+
sDate
[
1
]
+
"-"
+
sDate
[
2
]
this
.
sDate
=
sDate
[
0
]
+
"-"
+
sDate
[
1
]
+
"-"
+
sDate
[
2
]
this
.
myFromContact
=
new
FormGroup
({
this
.
myFromContact
=
new
FormGroup
({
ctName
:
new
FormControl
(
this
.
model
c
ontact
.
ctName
,
[
Validators
.
required
]),
ctName
:
new
FormControl
(
this
.
model
C
ontact
.
ctName
,
[
Validators
.
required
]),
ctDesc
:
new
FormControl
(
this
.
model
c
ontact
.
ctDesc
,
[
Validators
.
required
]),
ctDesc
:
new
FormControl
(
this
.
model
C
ontact
.
ctDesc
,
[
Validators
.
required
]),
ctTab
:
new
FormControl
(
this
.
model
c
ontact
.
ctTab
,
[
Validators
.
required
]),
ctTab
:
new
FormControl
(
this
.
model
C
ontact
.
ctTab
,
[
Validators
.
required
]),
ctHead
:
new
FormControl
(
this
.
model
c
ontact
.
ctHead
,
[
Validators
.
required
]),
ctHead
:
new
FormControl
(
this
.
model
C
ontact
.
ctHead
,
[
Validators
.
required
]),
sDate
:
new
FormControl
(
this
.
model
c
ontact
.
sDate
,
[
Validators
.
required
]),
sDate
:
new
FormControl
(
this
.
model
C
ontact
.
sDate
,
[
Validators
.
required
]),
ctStatus
:
new
FormControl
(
this
.
model
c
ontact
.
ctStatus
)
ctStatus
:
new
FormControl
(
this
.
model
C
ontact
.
ctStatus
)
});
});
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
modalService
.
open
(
content
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
this
.
closeResult
=
`Closed with:
${
result
}
`
;
this
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
});
console
.
log
(
"date"
,
this
.
modelContact
)
}
}
saveContact
()
{
saveContact
()
{
this
.
modelcontact
.
ctStatus
=
0
;
this
.
modelContact
.
sDate
=
this
.
modelContact
.
sDate
.
split
(
"-"
)[
0
]
+
"/"
+
this
.
modelContact
.
sDate
.
split
(
"-"
)[
1
]
+
"/"
+
this
.
modelContact
.
sDate
.
split
(
"-"
)[
2
];
console
.
log
(
"save"
,
this
.
modelcontact
)
this
.
modelContact
.
ctStatus
=
0
;
this
.
ContactService
.
addContact
(
this
.
modelcontact
);
console
.
log
(
"save"
,
this
.
modelContact
)
this
.
ContactService
.
addContact
(
this
.
modelContact
);
this
.
modalService
.
dismissAll
();
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
this
.
ngOnInit
();
}
}
...
...
src/app/service/contact.service.ts
View file @
352a8acf
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Contact
}
from
"../models/contact.model"
;
import
{
Contact
}
from
"../models/contact.model"
;
@
Injectable
({
providedIn
:
'root'
})
@
Injectable
({
providedIn
:
'root'
})
export
class
ContactService
{
export
class
ContactService
{
constructor
(
private
http
:
HttpClient
)
{
}
url
:
string
;
listContact
:
Contact
[]
=
[
listContact
:
Contact
[]
=
[
{
{
id
:
1
,
id
:
1
,
...
...
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