Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Dida Adams Arizona
Tia-dev
Commits
5f095c76
Commit
5f095c76
authored
Aug 17, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
update login & create report items See merge request
!98
parents
e4f23628
e6b8cb2c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
588 additions
and
349 deletions
+588
-349
index.js
src/api/index.js
+12
-0
EmailVerification.js
src/container/EmailVerification.js
+1
-1
ForgotPassword.js
src/container/ForgotPassword.js
+1
-1
Login.js
src/container/Login.js
+1
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+226
-50
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+346
-295
ResetPassword.js
src/container/ResetPassword.js
+1
-1
No files found.
src/api/index.js
View file @
5f095c76
...
...
@@ -114,6 +114,13 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
checkUploadUser
=
(
body
)
=>
api
.
post
(
'/user/check_import'
,
body
)
const
uploadUser
=
(
body
)
=>
api
.
post
(
'/user/import_user'
,
body
)
//Report Items
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_report/get_all_type_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
const
createReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/create_item_report'
,
body
)
//PARAMETER
const
getAllParameter
=
()
=>
api
.
get
(
'/setting/get_all_setting'
)
const
getDetailParameter
=
(
id
)
=>
api
.
get
(
`setting/get_setting_by_id/
${
id
}
`
)
...
...
@@ -177,6 +184,11 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getPerusahaanHierarki
,
checkUploadUser
,
uploadUser
,
getReportItems
,
searchReportItems
,
createReportItems
,
getInputType
,
getReportType
,
getAllParameter
,
getAllGroup
,
getParameterByGroup
,
...
...
src/container/EmailVerification.js
View file @
5f095c76
...
...
@@ -18,7 +18,7 @@ class EmailVerification extends Component {
}
render
()
{
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
51c6ea
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
152d40
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
paddingTop
:
20
,
paddingRight
:
24
,
paddingLeft
:
24
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
378
,
height
:
300
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
img
src
=
{
Images
.
berhasil
}
/
>
...
...
src/container/ForgotPassword.js
View file @
5f095c76
...
...
@@ -56,7 +56,7 @@ class ForgotPassword extends Component {
render
()
{
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
51c6ea
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
152d40
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
padding
:
60
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
378
,
height
:
351
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
...
...
src/container/Login.js
View file @
5f095c76
...
...
@@ -115,7 +115,7 @@ class Login extends Component {
<
img
src
=
{
Images
.
tia
}
/
>
<
img
src
=
{
Images
.
imageLogin
}
style
=
{{
marginTop
:
30
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#
51c6ea
'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#
152d40
'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
div
style
=
{{
paddingTop
:
56
,
paddingLeft
:
54
,
paddingRight
:
54
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
388
,
height
:
(
this
.
state
.
msgEmail
.
length
>
45
?
466
:
441
),
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
...
...
src/container/MasterData/ReportItems.js
View file @
5f095c76
import
React
,
{
Component
}
from
"react"
;
import
{
Container
,
Row
,
Col
}
from
"react-bootstrap"
;
import
{
makeStyles
,
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
SearchIcon
from
'@material-ui/icons/Search'
;
import
{
createMuiTheme
,
MuiThemeProvider
}
from
'@material-ui/core/styles'
;
import
Images
from
"../../assets/Images"
;
import
MUIDataTable
from
"mui-datatables"
;
import
{
TextField
,
InputBase
}
from
"@material-ui/core"
;
import
{
InputBase
}
from
"@material-ui/core"
;
import
{
ExcelRenderer
}
from
'react-excel-renderer'
;
import
UploadFile
from
"../../library/Upload"
;
import
CreateReportItems
from
"./formReportItems/CreateReportItems"
;
import
EditReportItems
from
"./formReportItems/EditReportItems"
;
import
VisualReportItems
from
"./formReportItems/VisualReportItems"
;
import
api
from
"../../api"
;
var
ct
=
require
(
"../../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
...
@@ -40,17 +39,10 @@ export default class ReportItems extends Component {
let
fileObj
=
event
ExcelRenderer
(
fileObj
,
(
err
,
resp
)
=>
{
if
(
err
)
{
// console.log(err);
}
else
{
let
judul
=
resp
.
rows
[
0
]
let
isi
=
resp
.
rows
.
slice
(
1
)
// let body = isi.map((item) => {
// return {
// item
// ]
// })
// console.log(JSON.stringify(isi));
this
.
setState
({
dataLoaded
:
true
,
cols
:
judul
,
...
...
@@ -60,12 +52,78 @@ export default class ReportItems extends Component {
});
}
c
loseEdi
t
()
{
this
.
setState
({
edit
:
false
}
)
c
omponentDidMoun
t
()
{
this
.
getData
(
)
}
closeAdd
()
{
this
.
setState
({
add
:
false
})
getData
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_report_name
,
item
.
status
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
openPopUp
(
index
,
type
)
{
if
(
type
===
'edit'
)
{
this
.
setState
({
selectIndex
:
index
,
edit
:
true
})
}
else
{
this
.
setState
({
data
:
this
.
state
.
listData
[
index
],
add
:
true
})
}
}
handleInputChange
(
e
)
{
this
.
setState
({
search
:
e
})
let
body
=
{
"keyword"
:
e
}
api
.
create
().
searchReportItems
(
body
).
then
(
response
=>
{
// console.log(response.data);
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
item_report_id
,
item
.
report_name
,
item
.
company_name
,
item
.
order
,
item
.
description
,
item
.
parent
,
item
.
uom
,
item
.
weight
,
item
.
type_report_name
,
item
.
status
]
})
this
.
setState
({
dataTable
:
listData
,
listData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
createReportItems
=
(
payload
)
=>
{
this
.
setState
({
add
:
false
})
api
.
create
().
createReportItems
(
payload
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
updateReportItems
=
(
payload
)
=>
{
this
.
setState
({
edit
:
false
})
api
.
create
().
updateReportItems
(
payload
).
then
(
response
=>
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
getData
()
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
render
()
{
...
...
@@ -81,6 +139,7 @@ export default class ReportItems extends Component {
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
openPopUp
(
tableMeta
.
rowIndex
,
'edit'
)}
>
<
img
src
=
{
Images
.
editCopy
}
/
>
...
...
@@ -89,7 +148,128 @@ export default class ReportItems extends Component {
);
}
}
},
"ID"
,
"Jenis Laporan"
,
"Perusahaan"
,
"Order"
,
"Deskripsi"
,
"Parent ID"
,
"UOM"
,
"Weight"
,
"Tipe Data"
,
"Status"
]
},
{
name
:
"ID"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Jenis Laporan"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Perusahaan"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Order"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Deskripsi"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Parent ID"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"UOM"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Weight"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Tipe Data"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"Status"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
10
]
===
"Aktif"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
}
}
]
const
data
=
[
[
""
,
"1"
,
"KPI"
,
"TIA"
,
"1"
,
"Financial Perspective"
,
"0"
,
"-"
,
"35%"
,
"Formula"
,
"Aktif"
],
[
""
,
"2"
,
"KPI"
,
"TIA"
,
"2"
,
"Trading Profit"
,
"1"
,
"Rp Bio"
,
"35%"
,
"Formula"
,
"Aktif"
],
...
...
@@ -97,17 +277,6 @@ export default class ReportItems extends Component {
[
""
,
"4"
,
"KPI"
,
"TIA"
,
"4"
,
"EBITDA"
,
"1"
,
"Rp Bio"
,
"0%"
,
"Formula"
,
"Non Aktif"
],
[
""
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
],
]
const
options
=
{
filter
:
false
,
sort
:
false
,
responsive
:
"scroll"
,
print
:
false
,
download
:
false
,
selectableRows
:
false
,
viewColumns
:
false
,
rowsPerPage
:
5
,
search
:
false
}
return
(
<
div
>
...
...
@@ -116,24 +285,25 @@ export default class ReportItems extends Component {
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
}}
>
Master
Data
-
Item
Report
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
}}
>
<
label
style
=
{{
width
:
'20%'
,
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
paddingTop
:
8
}}
>
Master
Data
-
Item
Report
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
style
=
{{
width
:
'100%'
}}
placeholder
=
"Search"
value
=
{
""
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
)}
value
=
{
this
.
state
.
search
}
onChange
=
{(
e
)
=>
this
.
handleInputChange
(
e
.
target
.
value
)}
inputProps
=
{{
'aria-label'
:
'naked'
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'
20%'
,
justifyContent
:
'space-around'
,
display
:
'flex
'
}}
>
<
div
style
=
{{
width
:
'
30%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
,
flexFlow
:
'wrap
'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
padding
:
0
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
...
...
@@ -143,7 +313,8 @@ export default class ReportItems extends Component {
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
...
...
@@ -153,7 +324,8 @@ export default class ReportItems extends Component {
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
...
...
@@ -163,7 +335,8 @@ export default class ReportItems extends Component {
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
,
margin
:
5
}}
onClick
=
{()
=>
null
}
>
...
...
@@ -173,7 +346,8 @@ export default class ReportItems extends Component {
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
borderColor
:
'transparent'
,
margin
:
5
}}
>
<
img
src
=
{
Images
.
add
}
onClick
=
{()
=>
this
.
setState
({
add
:
true
})}
/
>
...
...
@@ -184,7 +358,7 @@ export default class ReportItems extends Component {
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
theme
=
{
getMuiTheme
()}
data
=
{
data
}
data
=
{
this
.
state
.
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
...
...
@@ -238,14 +412,16 @@ export default class ReportItems extends Component {
}
{
this
.
state
.
add
&&
(
<
CreateReportItems
onClickClose
=
{
this
.
closeAdd
.
bind
(
this
)}
data
=
{
this
.
state
.
indexData
}
onClickClose
=
{()
=>
this
.
setState
({
add
:
false
})}
data
=
{
this
.
state
.
listData
}
createReportItems
=
{
this
.
createReportItems
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
edit
&&
(
<
EditReportItems
onClickClose
=
{
this
.
closeEdit
.
bind
(
this
)}
data
=
{
this
.
state
.
indexData
}
onClickClose
=
{()
=>
this
.
setState
({
edit
:
false
})}
data
=
{
this
.
state
.
listData
[
this
.
state
.
selectIndex
]}
updateReportItems
=
{
this
.
updateReportItems
.
bind
(
this
)}
/
>
)}
{
this
.
state
.
visibleUpload
&&
(
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
5f095c76
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
*
as
R
from
'ramda'
;
import
api
from
'../../../api'
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
{
titleCase
}
from
'../../../library/Utils'
;
import
format
from
"date-fns/format"
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
const
companies
=
[
{
value
:
''
,
label
:
''
,
},
{
value
:
'1'
,
label
:
'TIA'
,
},
{
value
:
'2'
,
label
:
'TIA'
,
},
];
const
dataTypes
=
[
{
value
:
''
,
label
:
''
,
},
{
value
:
'1'
,
label
:
'Formula'
,
},
{
value
:
'2'
,
label
:
'Formula'
,
},
];
const
reportTypes
=
[
{
value
:
''
,
label
:
''
,
},
{
value
:
'1'
,
label
:
'KPI'
,
},
{
value
:
'2'
,
label
:
'KPI'
,
},
];
const
parents
=
[
{
value
:
'-'
,
label
:
'-'
,
},
{
value
:
'1'
,
label
:
'1'
,
},
{
value
:
'2'
,
label
:
'2'
,
},
];
export
default
class
CreateReportItems
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
startDate
:
new
Date
(),
endDate
:
new
Date
(),
InputType
:
null
,
company
:
null
,
parent
:
null
,
reportType
:
null
,
startDate
:
null
,
endDate
:
null
,
order
:
''
,
description
:
''
,
uom
:
''
,
weight
:
''
,
formula
:
''
,
realVal
:
''
,
condition
:
''
,
date
:
new
Date
(),
listInputType
:
null
,
listCompany
:
null
,
listReportType
:
null
,
listParent
:
null
,
errorOrder
:
false
,
errorDesc
:
false
,
errorFormula
:
false
,
errorRV
:
false
,
errorCF
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorDesc
:
''
,
msgErrorFormula
:
''
,
masgErrorRV
:
''
,
msgErrorCF
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
}
}
componentDidMount
()
{
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getParent
()
}
handleChange
(
e
,
type
)
{
let
data
=
this
.
state
let
isDate
=
type
!==
''
?
true
:
false
if
(
isDate
&&
type
===
'start_date'
)
{
this
.
setState
({...
data
,
startDate
:
format
(
e
,
'yyyy-MM-dd'
),
endDate
:
null
,
errorOrder
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
else
if
(
isDate
&&
type
===
'end_date'
)
{
this
.
setState
({...
data
,
endDate
:
format
(
e
,
'yyyy-MM-dd'
),
errorOrder
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
else
{
this
.
setState
({...
data
,
[
e
.
target
.
name
]:
e
.
target
.
value
,
errorOrder
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
}
validasi
()
{
// alert('coba ya')
if
(
R
.
isEmpty
(
this
.
state
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order Harus Diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorSD
:
'Start Date tidak boleh kosong'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
}
else
{
this
.
addReportItems
()
}
handleStartDate
=
(
date
)
=>
{
this
.
setState
({
startDate
:
date
});
}
addReportItems
()
{
alert
(
"test"
)
// let payload = {
// "role_name": this.state.roleName,
// "start_date": this.state.startDate,
// "end_date": this.state.endDate,
// "privileges": this.state.privileges
// }
// // console.log(payload)
// api.create().addRole(payload).then((response) => {
// console.log(response)
// if (response.data.status === 'success') {
// this.props.refresh()
// this.props.onClickClose()
// } else {
// alert(response.data.message)
// }
// })
}
getInputType
()
{
api
.
create
().
getInputType
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
inputData
=
data
.
map
((
item
)
=>
{
return
{
type_report_id
:
item
.
type_report_id
,
type_report_name
:
item
.
type_report_name
}
})
let
defaultProps
=
{
options
:
inputData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
type_report_name
),
};
this
.
setState
({
listInputType
:
defaultProps
,
inputData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
handleEndDate
=
(
date
)
=>
{
this
.
setState
({
endDate
:
date
});
getPerusahaan
()
{
api
.
create
().
getPerusahaanActive
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
companyData
=
data
.
map
((
item
)
=>
{
return
{
company_id
:
item
.
company_id
,
company_name
:
item
.
company_name
}
})
let
defaultProps
=
{
options
:
companyData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
company_name
),
};
this
.
setState
({
listCompany
:
defaultProps
,
companyData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
);
getReportType
()
{
api
.
create
().
getReportType
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
reportTypeData
=
data
.
map
((
item
)
=>
{
return
{
report_id
:
item
.
report_id
,
report_name
:
item
.
report_name
,
}
})
let
defaultProps
=
{
options
:
reportTypeData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
this
.
setState
({
listReportType
:
defaultProps
,
reportTypeData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
getParent
()
{
api
.
create
().
getReportItems
().
then
((
response
)
=>
{
// console.log(response)
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
parentData
=
data
.
map
((
item
)
=>
{
return
{
item_report_id
:
item
.
item_report_id
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
item_report_id
),
};
this
.
setState
({
listParent
:
defaultProps
,
parentData
:
response
.
data
.
data
})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
render
()
{
...
...
@@ -114,7 +234,7 @@ export default class CreateReportItems extends Component {
<
div
className
=
"border-bottom grid grid-2x grid-mobile-none gap-15px"
style
=
{{
padding
:
20
}}
>
<
div
className
=
"column-1"
>
<
div
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
style
=
{{
width
:
'100%'
}}
value
=
{
1
}
...
...
@@ -126,7 +246,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -135,46 +254,31 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
style
=
{{
width
:
'100%'
}}
select
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Perusahaan"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
color
:
'#7e8085'
}
}}
>
{
companies
.
map
((
option
)
=>
(
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/option
>
))}
<
/TextField
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
company
}
/
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
...
...
@@ -187,7 +291,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -196,7 +299,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
>
...
...
@@ -213,7 +315,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -222,47 +323,32 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
>
<
/TextField
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
id
=
"dataType"
style
=
{{
width
:
'100%'
}}
select
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
Autocomplete
{...
this
.
state
.
listInputType
}
id
=
"inputType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Tipe Data"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
color
:
'#7e8085'
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
>
{
dataTypes
.
map
((
option
)
=>
(
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/option
>
))}
<
/TextField
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
InputType
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
...
...
@@ -278,7 +364,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -287,7 +372,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
/
>
...
...
@@ -296,10 +380,12 @@ export default class CreateReportItems extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
value
=
{
startDate
}
onChange
=
{
this
.
handleStartDate
}
label
=
"Berlaku Mulai"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
startDate
}
error
=
{
this
.
state
.
errorStartDate
}
helperText
=
{
this
.
state
.
msgErrorSD
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
}}
...
...
@@ -308,7 +394,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -317,11 +402,10 @@ export default class CreateReportItems extends Component {
color
:
'#7e8085'
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
...
...
@@ -336,7 +420,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -345,7 +428,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
/
>
...
...
@@ -364,54 +446,43 @@ export default class CreateReportItems extends Component {
<
/div
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
Autocomplete
{...
this
.
state
.
listReportType
}
id
=
"reportType"
style
=
{{
width
:
'100%'
}}
select
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Jenis Laporan"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
color
:
'#7e8085'
}
}}
>
{
reportTypes
.
map
((
option
)
=>
(
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/option
>
))}
<
/TextField
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
reportType
}
/
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
style
=
{{
width
:
'100%'
}}
id
=
"order"
id
=
"orders"
name
=
"order"
label
=
"Order"
// value=""
value
=
{
this
.
state
.
order
}
error
=
{
this
.
state
.
errorOrder
}
helperText
=
{
this
.
state
.
msgErrorOrder
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -420,47 +491,32 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
>
<
/TextField
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
id
=
"parent"
style
=
{{
width
:
'100%'
}}
select
label
=
"Parent"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
<
div
style
=
{{
padding
:
10
}}
>
<
Autocomplete
{...
this
.
state
.
listParent
}
id
=
"parentId"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Parent ID"
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
color
:
'#7e8085'
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
>
{
parents
.
map
((
option
)
=>
(
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/option
>
))}
<
/TextField
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
value
=
{
this
.
state
.
parent
}
/
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
...
...
@@ -473,7 +529,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -482,7 +537,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
>
...
...
@@ -499,7 +553,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -508,7 +561,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
>
...
...
@@ -526,7 +578,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -535,7 +586,6 @@ export default class CreateReportItems extends Component {
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
paddingLeft
:
10
}
}}
/
>
...
...
@@ -544,10 +594,13 @@ export default class CreateReportItems extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
value
=
{
endDate
}
onChange
=
{
this
.
handleEndDate
}
label
=
"Berlaku Hingga"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
}
error
=
{
this
.
state
.
errorEndDate
}
helperText
=
{
this
.
state
.
msgErrorED
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
minDate
=
{
this
.
state
.
startDate
}
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
}}
...
...
@@ -556,7 +609,6 @@ export default class CreateReportItems extends Component {
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
InputLabelProps
=
{{
...
...
@@ -565,11 +617,10 @@ export default class CreateReportItems extends Component {
color
:
'#7e8085'
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
<
/div
>
<
/div
>
...
...
@@ -587,8 +638,8 @@ export default class CreateReportItems extends Component {
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
div
onClick
=
{()
=>
this
.
validasi
()}
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
<
/div
>
<
/div
>
...
...
src/container/ResetPassword.js
View file @
5f095c76
...
...
@@ -104,7 +104,7 @@ class ResetPassword extends Component {
render
()
{
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
51c6ea
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#
152d40
'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
padding
:
56
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
378
,
height
:
415
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
...
...
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