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
16d9fa3e
Commit
16d9fa3e
authored
Dec 02, 2021
by
DESKTOP-HF0LVOG\myhr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update หน้าต่างการเบิกอุปกรณ์และตารางรายการแสดงสถานะ
parent
3b3c8056
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
274 additions
and
164 deletions
+274
-164
equirment.model.ts
src/app/models/equirment.model.ts
+10
-8
itemDetail.model.ts
src/app/models/itemDetail.model.ts
+50
-14
admin-pending.component.ts
src/app/pages/admin-pending/admin-pending.component.ts
+2
-28
equipment.component.html
src/app/pages/equipment/equipment.component.html
+18
-20
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+28
-1
lend-page.component.ts
src/app/pages/lend-page/lend-page.component.ts
+2
-30
pending.component.html
src/app/pages/pending/pending.component.html
+28
-29
pending.component.ts
src/app/pages/pending/pending.component.ts
+10
-32
equirment.service.ts
src/app/service/equirment.service.ts
+1
-1
item-detail.service.ts
src/app/service/item-detail.service.ts
+124
-0
room-detail.service.ts
src/app/service/room-detail.service.ts
+0
-0
room.service.ts
src/app/service/room.service.ts
+1
-1
No files found.
src/app/models/equirment.model.ts
View file @
16d9fa3e
import
{
CategoryModel
}
from
"./itemDetail.model"
;
export
class
Equirment
{
eqId
:
number
;
eqName
:
string
;
...
...
@@ -15,19 +17,19 @@ export class Equirment {
}
export
interface
SearchEquirmentModel
{
s
d
ate
:
string
;
e
d
ate
:
string
;
s
t
ime
:
string
;
e
t
ime
:
string
;
s
D
ate
:
string
;
e
D
ate
:
string
;
s
T
ime
:
string
;
e
T
ime
:
string
;
}
export
class
SearchEquirmentModel
{
constructor
(
init
?:
SearchEquirmentModel
)
{
Object
.
assign
(
this
,
init
);
this
.
s
d
ate
=
''
,
this
.
e
d
ate
=
''
,
this
.
s
t
ime
=
''
,
this
.
e
t
ime
=
''
;
this
.
s
D
ate
=
''
,
this
.
e
D
ate
=
''
,
this
.
s
T
ime
=
''
,
this
.
e
T
ime
=
''
;
}
}
...
...
src/app/models/itemDetail.model.ts
View file @
16d9fa3e
interface
itemDetail
{
id
?:
number
;
catagory
:
string
;
type
:
string
;
detail
:
string
;
name
:
string
;
sdate
:
string
;
edate
:
string
;
stime
:
string
;
etime
:
string
;
status
:
string
;
quantity
:
string
;
remark
:
string
;
import
{
Equirment
}
from
"./equirment.model"
;
export
class
itemDetail
{
Id
?:
number
;
equirment
:
Equirment
;
userName
:
string
;
sDate
:
string
;
eDate
:
string
;
sTime
:
{
hour
:
number
;
minute
:
number
;
second
:
number
;
};
eTime
:
{
hour
:
number
;
minute
:
number
;
second
:
number
;
};
eStatus
:
string
;
Quantity
:
string
;
Remark
:
string
;
constructor
(
init
?:
itemDetail
)
{
Object
.
assign
(
this
,
init
);
this
.
Id
=
1
;
this
.
equirment
=
this
.
equirment
;
this
.
userName
=
''
;
this
.
sDate
=
''
;
this
.
eDate
=
''
;
this
.
eStatus
=
''
;
this
.
Quantity
=
''
;
this
.
Remark
=
''
;
}
}
export
interface
SearchitemDetailModel
{
sDate
:
string
;
eDate
:
string
;
sTime
:
string
;
eTime
:
string
;
}
export
class
SearchitemDetailModel
{
constructor
(
init
?:
SearchitemDetailModel
)
{
Object
.
assign
(
this
,
init
);
this
.
sDate
=
''
,
this
.
eDate
=
''
,
this
.
sTime
=
''
,
this
.
eTime
=
''
;
}
}
interface
CategoryModel
{
export
class
CategoryModel
{
id
:
number
;
name
:
string
;
}
...
...
src/app/pages/admin-pending/admin-pending.component.ts
View file @
16d9fa3e
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/itemDetail.model'
;
@
Component
({
selector
:
'app-admin-pending'
,
...
...
@@ -40,34 +41,7 @@ export class AdminPendingComponent implements OnInit {
closeResult
=
''
;
item
:
itemDetail
[]
=
[
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Moniter'
,
name
:
'a'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
},
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Mouse'
,
name
:
'b'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
}
];
item
:
itemDetail
[]
=
[];
collectionSize
=
this
.
item
.
length
;
hoveredDate
:
NgbDate
|
null
=
null
;
...
...
src/app/pages/equipment/equipment.component.html
View file @
16d9fa3e
...
...
@@ -20,7 +20,7 @@
<div
class=
"card-body"
>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
open
(
contentroom
)"
>
เพิ่มรายการ
</button>
(
click
)="
R
open
(
contentroom
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listRoomModel"
>
...
...
@@ -38,8 +38,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
)="
open
(
Room
)"
>
จอง
</button>
<button
class=
"btn btn-sm btn-primary"
type=
"button"
>
ยกเลิก
</button>
(
click
)="
Ropen
(
Room
)"
>
จอง
</button>
</div>
</div>
</div>
...
...
@@ -128,7 +127,7 @@
</ng-template>
<button
class=
"btn btn-lg btn-outline-primary"
(
click
)="
open
(
contentequirment
)"
>
เพิ่มรายการ
</button>
(
click
)="
E
open
(
contentequirment
)"
>
เพิ่มรายการ
</button>
<div
class=
"row"
>
<div
class=
"col-sm-3"
*
ngFor=
"let item of listEquirmentModel"
>
...
...
@@ -147,8 +146,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
)="
open
(
lend
)"
>
เบิก
</button>
<button
class=
"btn btn-sm btn-primary"
type=
"button"
>
ยกเลิก
</button>
(
click
)="
bookEquir
(
lend
,
item
)"
>
เบิก
</button>
</div>
</div>
</div>
...
...
@@ -255,13 +253,13 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่อห้อง
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rName}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rDecs}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
...
...
@@ -307,15 +305,15 @@
<div
class=
" col-md-12"
>
<div
class=
"card"
>
<div
class=
" card-header"
>
<h5
class=
" title"
>
Lend Equirment
</h5>
<h5
class=
" title"
>
เบิกอุปกรณ์
</h5>
</div>
<div
class=
" card-body"
>
<form>
<div
class=
" row"
>
<div
class=
" col-sm-12 mb-1"
>
<div
class=
" form-group"
>
<label>
ชื่อผู้
จอง
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
/>
<label>
ชื่อผู้
เบิก
</label>
<input
class=
" form-control"
placeholder=
""
type=
"text"
value=
""
[(
ngModel
)]="
modelitemDetail
.
userName
"
/>
</div>
</div>
</div>
...
...
@@ -330,40 +328,40 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่ออุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"{{item.rName}}"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
modelitemDetail
.
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=
"{{item.rDecs}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
[
value
]="
modelitemDetail
.
equirment
.
eqDesc
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่เริ่มต้น
</label>
<input
type=
"date"
class=
"form-control"
value=
""
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
modelitemDetail
.
sDate
"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
วันที่สิ้นสุด
</label>
<input
type=
"date"
class=
"form-control"
value=
""
>
<input
type=
"date"
class=
"form-control"
value=
""
[(
ngModel
)]="
modelitemDetail
.
eDate
"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<ngb-timepicker
[(
ngModel
)]="
st
ime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
modelitemDetail
.
sT
ime
"
></ngb-timepicker>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<ngb-timepicker
[(
ngModel
)]="
et
ime
"
></ngb-timepicker>
<ngb-timepicker
[(
ngModel
)]="
modelitemDetail
.
eT
ime
"
></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
)]="
q
uantity
"
/>
[(
ngModel
)]="
modelitemDetail
.
Q
uantity
"
/>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -371,14 +369,14 @@
<div
class=
" form-group"
>
<label>
หมายเหตุ
</label>
<textarea
class=
"form-control"
id=
"exampleFormControlTextarea1"
rows=
"3"
placeholder=
"......"
></textarea>
placeholder=
"......"
[(
ngModel
)]="
modelitemDetail
.
Remark
"
></textarea>
</div>
</div>
</div>
</form>
</div>
<div
class=
" card-footer"
>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"submit"
(
click
)="
saveLend
()"
>
Save
</button>
<button
class=
" btn btn-fill btn-danger"
type=
"close"
>
Cancel
</button>
</div>
</div>
...
...
src/app/pages/equipment/equipment.component.ts
View file @
16d9fa3e
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
{
Room
}
from
'src/app/models/rooms.model'
;
import
{
EquirmentService
}
from
'src/app/service/equirment.service'
;
import
{
itemDetailService
}
from
'src/app/service/item-detail.service'
;
import
{
RoomService
}
from
'src/app/service/room.service'
;
...
...
@@ -21,9 +23,12 @@ export class EquipmentComponent implements OnInit {
listEquirmentModel
:
Equirment
[]
=
[];
listRoomModel
:
Room
[]
=
[];
collectionSize
=
this
.
listEquirmentModel
.
length
;
modelEquirment
=
new
Equirment
();
modelRoom
=
new
Room
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
)
{
modelitemDetail
=
new
itemDetail
();
constructor
(
private
modalService
:
NgbModal
,
private
equirmentService
:
EquirmentService
,
private
roomService
:
RoomService
,
private
itemDetailService
:
itemDetailService
)
{
}
...
...
@@ -32,6 +37,7 @@ export class EquipmentComponent implements OnInit {
this
.
listRoomModel
=
this
.
roomService
.
getListRoom
();
}
Eopen
(
contentequirment
)
{
this
.
modelEquirment
=
new
Equirment
();
this
.
modalService
.
open
(
contentequirment
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -41,6 +47,20 @@ export class EquipmentComponent implements OnInit {
});
}
book
(
contentequirment
,
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
.
closeResult
=
`Closed with:
${
result
}
`
;
},
(
reason
)
=>
{
this
.
closeResult
=
`Dismissed
${
this
.
getDismissReason
(
reason
)}
`
;
});
}
Ropen
(
contentroom
)
{
this
.
modelRoom
=
new
Room
();
this
.
modalService
.
open
(
contentroom
,
{
ariaLabelledBy
:
'modal-basic-title'
}).
result
.
then
((
result
)
=>
{
...
...
@@ -86,5 +106,12 @@ export class EquipmentComponent implements OnInit {
this
.
ngOnInit
();
}
saveLend
()
{
this
.
itemDetailService
.
additemDetail
(
this
.
modelitemDetail
);
this
.
modalService
.
dismissAll
();
this
.
ngOnInit
();
console
.
log
(
this
.
itemDetailService
);
}
}
src/app/pages/lend-page/lend-page.component.ts
View file @
16d9fa3e
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
itemDetail
}
from
'src/app/models/itemDetail.model'
;
@
Component
({
selector
:
'app-lend-page'
,
...
...
@@ -7,36 +8,7 @@ import { Component, OnInit } from '@angular/core';
})
export
class
LendPageComponent
implements
OnInit
{
item
:
itemDetail
[]
=
[
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Moniter'
,
name
:
'a'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
},
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Mouse'
,
name
:
'b'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
}
];
item
:
itemDetail
[]
=
[];
collectionSize
=
this
.
item
.
length
;
constructor
()
{
}
...
...
src/app/pages/pending/pending.component.html
View file @
16d9fa3e
...
...
@@ -77,24 +77,24 @@
<tr>
<th
scope=
"col"
>
#
</th>
<th
scope=
"col"
>
หมวดหมู่
</th>
<th
scope=
"col"
>
ประเภท
</th>
<th
scope=
"col"
>
ชื่ออุปกรณ์
</th>
<th
scope=
"col"
>
รายละเอียด
</th>
<th
scope=
"col"
>
ชื่อ
</th>
<th
scope=
"col"
>
ชื่อ
ผู้เบิก
</th>
<th
scope=
"col"
>
วันที่เริ่มต้น
</th>
<th
scope=
"col"
>
วันที่สิ้นสุด
</th>
<th
scope=
"col"
>
สถานะ
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let
country of countries
"
>
<th
scope=
"row"
>
{{
country.i
d }}
</th>
<td>
{{
country.catagory
}}
</td>
<td>
{{
country.typ
e }}
</td>
<td>
{{
country.detail
}}
</td>
<td>
{{
country.n
ame }}
</td>
<td>
{{
country.sdate | date:'dd-MM-yyyy' }} {{ country.stim
e }}
</td>
<td>
{{
country.edate | date:'dd-MM-yyyy' }} {{ country.etim
e }}
</td>
<td>
{{
country.s
tatus }}
</td>
<tr
*
ngFor=
"let
item of listitemDetail
"
>
<th
scope=
"row"
>
{{
item.I
d }}
</th>
<td>
{{
item.equirment.eqType
}}
</td>
<td>
{{
item.equirment.eqNam
e }}
</td>
<td>
{{
item.equirment.eqDesc
}}
</td>
<td>
{{
item.userN
ame }}
</td>
<td>
{{
item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minut
e }}
</td>
<td>
{{
item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minut
e }}
</td>
<td>
{{
item.eS
tatus }}
</td>
<div
class=
"col-auto align-self-sm-center"
>
<button
type=
"button"
class=
"btn btn-info btn-sm btn-circle "
style=
"line-height: 0px"
(
click
)="
open
(
Room
)"
><i
class=
"fa fa-search"
></i>
</button>
...
...
@@ -144,16 +144,15 @@
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let country of countries"
>
<th
scope=
"row"
>
{{ country.id }}
</th>
<td>
{{ country.catagory }}
</td>
<td>
{{ country.type }}
</td>
<td>
{{ country.detail }}
</td>
<td>
{{ country.name }}
</td>
<td>
{{ country.sdate | date:'dd-MM-yyyy' }} {{ country.stime }}
</td>
<td>
{{ country.edate | date:'dd-MM-yyyy' }} {{ country.etime }}
</td>
<td>
{{ country.quantity }}
</td>
<td>
{{ country.status }}
</td>
<tr
*
ngFor=
"let item of listitemDetail"
>
<th
scope=
"row"
>
{{ item.Id }}
</th>
<td>
{{ item.Catagory }}
</td>
<td>
{{ item.Type }}
</td>
<td>
{{ item.Detail }}
</td>
<td>
{{ item.userName }}
</td>
<td>
{{ item.sDate | date:'dd-MM-yyyy' }} {{ item.sTime.hour }}:{{ item.sTime.minute }}
</td>
<td>
{{ item.eDate | date:'dd-MM-yyyy' }} {{ item.eTime.hour }}:{{ item.eTime.minute }}
</td>
<td>
{{ item.eStatus }}
</td>
<div
class=
"col-auto align-self-sm-center"
>
<button
type=
"button"
class=
"btn btn-info btn-sm btn-circle "
style=
"line-height: 0px"
(
click
)="
open
(
lend
)"
><i
class=
"fa fa-search"
></i>
</button>
...
...
@@ -211,13 +210,13 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่อห้อง
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rname}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rdecs}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
...
...
@@ -233,11 +232,11 @@
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{country.stime}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
<div
class=
"col-6 mb-1"
>
<label
[
readonly
]
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{country.etime}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
" row"
>
...
...
@@ -282,13 +281,13 @@
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
ชื่ออุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rname}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-12 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
รายละเอียดอุปกรณ์
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{item.rdecs}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"row"
>
...
...
@@ -304,11 +303,11 @@
<div
class=
"row"
>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{country.stime}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
<div
class=
"col-6 mb-1"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<input
readonly
class=
"form-control"
type=
"text"
value=
"
{{country.etime}}
"
>
<input
readonly
class=
"form-control"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
" row"
>
...
...
src/app/pages/pending/pending.component.ts
View file @
16d9fa3e
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/itemDetail.model'
;
import
{
itemDetailService
}
from
'src/app/service/item-detail.service'
;
@
Component
({
selector
:
'app-pending'
,
...
...
@@ -39,48 +41,22 @@ export class PendingComponent implements OnInit {
closeResult
=
''
;
item
:
itemDetail
[]
=
[
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Moniter'
,
name
:
'a'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
},
{
catagory
:
'string'
,
type
:
'string'
,
detail
:
'Mouse'
,
name
:
'b'
,
sdate
:
'2021-11-25'
,
edate
:
'2021-11-25'
,
stime
:
'12.00'
,
etime
:
'12.00'
,
status
:
'waiting'
,
quantity
:
'1'
,
remark
:
''
,
}
];
collectionSize
=
this
.
item
.
length
;
listitemDetail
:
itemDetail
[]
=
[];
collectionSize
=
this
.
listitemDetail
.
length
;
hoveredDate
:
NgbDate
|
null
=
null
;
fromDate
:
NgbDate
|
null
;
toDate
:
NgbDate
|
null
;
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
)
{
constructor
(
private
calendar
:
NgbCalendar
,
public
formatter
:
NgbDateParserFormatter
,
private
modalService
:
NgbModal
,
private
itemDetailService
:
itemDetailService
)
{
this
.
fromDate
=
calendar
.
getToday
();
this
.
toDate
=
calendar
.
getNext
(
calendar
.
getToday
(),
'd'
,
10
);
this
.
refreshitemDetail
();
}
refreshitemDetail
()
{
this
.
item
=
this
.
item
this
.
listitemDetail
=
this
.
listitemDetail
.
map
((
item
,
i
)
=>
({
id
:
i
+
1
,
...
item
}))
.
slice
((
this
.
page
-
1
)
*
this
.
pageSize
,
(
this
.
page
-
1
)
*
this
.
pageSize
+
this
.
pageSize
);
}
...
...
@@ -131,7 +107,9 @@ export class PendingComponent implements OnInit {
return
parsed
&&
this
.
calendar
.
isValid
(
NgbDate
.
from
(
parsed
))
?
NgbDate
.
from
(
parsed
)
:
currentValue
;
}
ngOnInit
():
void
{
ngOnInit
()
{
this
.
listitemDetail
=
this
.
itemDetailService
.
getListitemDetail
();
console
.
log
(
this
.
listitemDetail
);
}
}
...
...
src/app/service/equirment.service.ts
View file @
16d9fa3e
...
...
@@ -58,7 +58,7 @@ export class EquirmentService {
}
searchListEquirment
(
searchModel
:
SearchEquirmentModel
)
{
this
.
http
.
get
(
this
.
url
+
'&startDate='
+
searchModel
.
s
date
.
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
.
et
ime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
this
.
http
.
get
(
this
.
url
+
'&startDate='
+
searchModel
.
s
Date
.
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
.
eT
ime
+
':00'
).
subscribe
((
response
:
any
)
=>
{
console
.
log
(
response
);
this
.
listEquirment
=
response
;
},
error
=>
{
...
...
src/app/service/item-detail.service.ts
0 → 100644
View file @
16d9fa3e
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
itemDetail
,
SearchitemDetailModel
}
from
'../models/itemDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
itemDetailService
{
constructor
(
private
http
:
HttpClient
)
{
}
url
:
string
;
listitemDetail
:
itemDetail
[]
=
[
{
Id
:
1
,
equirment
:
{
eqId
:
2
,
eqName
:
"เมาส์"
,
eqDesc
:
"..."
,
eqType
:
"it"
,
eqPic
:
"assets/img/mou.jpg"
},
userName
:
'เกม'
,
sDate
:
'10/12/2560'
,
eDate
:
'10/11/2561'
,
sTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
Quantity
:
'1'
,
Remark
:
'test'
,
},
{
Id
:
2
,
equirment
:
{
eqId
:
3
,
eqName
:
"โน๊ตบุ๊ค"
,
eqDesc
:
"หน้าจอขนาด 20 นิ้ว"
,
eqType
:
"it"
,
eqPic
:
"assets/img/notebook.jpg"
},
userName
:
'แป๊ะ'
,
sDate
:
''
,
eDate
:
''
,
sTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eTime
:
{
hour
:
22
,
minute
:
30
,
second
:
0
},
eStatus
:
'รอการอนุมัติ'
,
Quantity
:
'1'
,
Remark
:
'test'
,
},
]
additemDetail
(
model
:
itemDetail
)
{
console
.
log
(
this
.
listitemDetail
);
this
.
listitemDetail
.
push
(
model
);
}
getListitemDetail
()
{
return
this
.
listitemDetail
;
}
// getListitemDetail() {
// this.http.get(this.url).subscribe((response: any) => {
// console.log(response);
// this.listitemDetail = response.content;
// }, error => {
// console.log(error)
// // alert("ไม่สามารถดึงข้อมูลห้องประชุมได้ เนื่องจาก :\n" + error.message)
// })
// }
searchListitemDetail
(
searchModel
:
SearchitemDetailModel
)
{
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
.
listitemDetail
=
response
;
},
error
=>
{
console
.
log
(
error
)
alert
(
"ไม่สามารถค้นหาอุปกรณ์ที่ว่างได้ เนื่องจาก :
\
n"
+
error
.
message
)
})
}
// addEquirment(EquirmentModel: Equirment) {
// this.http.post(this.url, EquirmentModel).subscribe(response => {
// console.log(response);
// })
// }
deleteitemDetail
(
itemDetailModel
:
itemDetail
)
{
this
.
http
.
delete
(
this
.
url
+
"/"
+
itemDetailModel
.
Id
).
subscribe
(
response
=>
{
console
.
log
(
response
);
this
.
getListitemDetail
()
alert
(
"ลบข้อมูลอุปกรณ์สำเร็จ"
)
})
}
updateitemDetail
(
itemDetailModel
:
itemDetail
)
{
this
.
http
.
put
(
this
.
url
+
"/"
+
itemDetailModel
.
Id
,
itemDetailModel
).
subscribe
(
response
=>
{
console
.
log
(
response
);
alert
(
"อัพเดทข้อมูลอุปกรณ์สำเร็จ"
)
})
}
itemDetailModel
(
eqId
:
string
)
{
}
}
\ No newline at end of file
src/app/service/room-detail.service.ts
0 → 100644
View file @
16d9fa3e
src/app/service/room.service.ts
View file @
16d9fa3e
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpHeaders
}
from
'@angular/common/http'
;
import
{
Room
,
SearchRoomModel
}
from
'../models/rooms.model'
;
import
{
itemDetail
}
from
'../models/itemDetail.model'
;
@
Injectable
({
providedIn
:
'root'
})
...
...
@@ -46,7 +47,6 @@ export class RoomService {
addRoom
(
model
:
Room
)
{
this
.
listRoomModel
.
push
(
model
);
}
getListRoom
()
{
...
...
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