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
d1f8736f
Commit
d1f8736f
authored
Aug 17, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
update See merge request
!107
parents
83cb8d8a
2cc73dd6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
522 additions
and
416 deletions
+522
-416
index.js
src/api/index.js
+4
-0
ReportItems.js
src/container/MasterData/ReportItems.js
+80
-82
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+0
-2
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+438
-332
No files found.
src/api/index.js
View file @
d1f8736f
...
@@ -119,8 +119,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -119,8 +119,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getReportItems
=
()
=>
api
.
get
(
'item_report/get_all_item_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_report/get_all_type_report'
)
const
getInputType
=
()
=>
api
.
get
(
'type_report/get_all_type_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getReportType
=
()
=>
api
.
get
(
'report/get_all_report'
)
const
getDetailReportItems
=
(
userId
)
=>
api
.
get
(
`item_report/get_item_report_by_id/
${
userId
}
`
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
const
searchReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/search_item_report'
,
body
)
const
createReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/create_item_report'
,
body
)
const
createReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/create_item_report'
,
body
)
const
updateReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/update_item_report'
,
body
)
const
checkUploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/check_import'
,
body
)
const
checkUploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/check_import'
,
body
)
const
uploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/import_item_report'
,
body
)
const
uploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/import_item_report'
,
body
)
const
getItemReportHierarki
=
()
=>
api
.
get
(
'item_report/get_item_report_hierarki'
)
const
getItemReportHierarki
=
()
=>
api
.
get
(
'item_report/get_item_report_hierarki'
)
...
@@ -193,6 +195,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
...
@@ -193,6 +195,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getReportItems
,
getReportItems
,
searchReportItems
,
searchReportItems
,
createReportItems
,
createReportItems
,
updateReportItems
,
getDetailReportItems
,
getInputType
,
getInputType
,
getReportType
,
getReportType
,
checkUploadReportItems
,
checkUploadReportItems
,
...
...
src/container/MasterData/ReportItems.js
View file @
d1f8736f
...
@@ -708,13 +708,13 @@ export default class ReportItems extends Component {
...
@@ -708,13 +708,13 @@ export default class ReportItems extends Component {
]
]
return
(
return
(
<
div
>
{
this
.
state
.
itemReport
===
true
?
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
{
this
.
state
.
itemReport
===
true
?
<
div
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
150
}}
>
<
label
style
=
{{
width
:
'20%'
,
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
paddingTop
:
8
}}
>
Master
Data
-
Item
Report
<
/label
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
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'
}}
>
<
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
}}
/
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
<
InputBase
...
@@ -731,7 +731,6 @@ export default class ReportItems extends Component {
...
@@ -731,7 +731,6 @@ export default class ReportItems extends Component {
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
borderColor
:
'transparent'
,
padding
:
0
,
margin
:
5
margin
:
5
}}
}}
onClick
=
{()
=>
this
.
downloadFile
()}
onClick
=
{()
=>
this
.
downloadFile
()}
...
@@ -794,7 +793,6 @@ export default class ReportItems extends Component {
...
@@ -794,7 +793,6 @@ export default class ReportItems extends Component {
<
/MuiThemeProvider
>
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
:
:
this
.
state
.
visualisasi
==
true
?
this
.
state
.
visualisasi
==
true
?
<
VisualReportItems
<
VisualReportItems
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
d1f8736f
...
@@ -24,7 +24,6 @@ export default class CreateReportItems extends Component {
...
@@ -24,7 +24,6 @@ export default class CreateReportItems extends Component {
formula
:
''
,
formula
:
''
,
realVal
:
''
,
realVal
:
''
,
condition
:
null
,
condition
:
null
,
inputValue
:
''
,
date
:
new
Date
(),
date
:
new
Date
(),
listInputType
:
null
,
listInputType
:
null
,
listCompany
:
null
,
listCompany
:
null
,
...
@@ -137,7 +136,6 @@ export default class CreateReportItems extends Component {
...
@@ -137,7 +136,6 @@ export default class CreateReportItems extends Component {
else
{
else
{
this
.
addReportItems
()
this
.
addReportItems
()
}
}
}
}
addReportItems
()
{
addReportItems
()
{
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
d1f8736f
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
format
from
"date-fns/format"
;
const
companies
=
[
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
{
import
api
from
'../../../api'
;
value
:
''
,
import
*
as
R
from
'ramda'
label
:
''
,
import
{
titleCase
}
from
'../../../library/Utils'
;
},
{
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
EditReportItems
extends
Component
{
export
default
class
EditReportItems
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
startDate
:
new
Date
(),
endDate
:
new
Date
(),
tempData
:
null
,
InputType
:
null
,
company
:
null
,
parent
:
null
,
reportType
:
null
,
startDate
:
null
,
endDate
:
null
,
order
:
null
,
description
:
''
,
uom
:
''
,
weight
:
null
,
formula
:
''
,
realVal
:
''
,
condition
:
null
,
date
:
new
Date
(),
listInputType
:
null
,
listCompany
:
null
,
listReportType
:
null
,
listParent
:
null
,
errorOrder
:
false
,
errorDesc
:
false
,
errorFormula
:
false
,
errorRV
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorDesc
:
''
,
msgErrorFormula
:
''
,
msgErrorRV
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
options
:
[
'WARNING'
,
'STOPPER'
]
}
}
}
}
handleStartDate
=
(
date
)
=>
{
componentDidMount
()
{
// console.log(this.props.data);
this
.
getDetailReportItems
();
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
,
tempData
:
{
...
this
.
state
.
tempData
,
start_date
:
format
(
e
,
'yyyy-MM-dd'
),
end_date
:
null
},
errorOrder
:
false
,
errorDesc
:
false
,
errorFormula
:
false
,
errorRV
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorDesc
:
''
,
msgErrorFormula
:
''
,
msgErrorRV
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
else
if
(
isDate
&&
type
===
'end_date'
)
{
this
.
setState
({
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
end_date
:
format
(
e
,
'yyyy-MM-dd'
)
},
errorOrder
:
false
,
errorDesc
:
false
,
errorFormula
:
false
,
errorRV
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorDesc
:
''
,
msgErrorFormula
:
''
,
msgErrorRV
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
else
{
this
.
setState
({
this
.
setState
({
startDate
:
date
...
data
,
tempData
:
{
...
this
.
state
.
tempData
,
[
e
.
target
.
name
]:
e
.
target
.
value
},
});
errorOrder
:
false
,
errorDesc
:
false
,
errorFormula
:
false
,
errorRV
:
false
,
errorStartDate
:
false
,
errorEndDate
:
false
,
msgErrorOrder
:
''
,
msgErrorDesc
:
''
,
msgErrorFormula
:
''
,
msgErrorRV
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
})
}
}
validasi
()
{
// alert('coba ya')
if
(
R
.
isNil
(
this
.
state
.
reportType
))
return
alert
(
"Jenis Laporan is Required."
);
if
(
R
.
isNil
(
this
.
state
.
company
))
return
alert
(
"Perusahaan is Required."
);
else
if
(
R
.
isNil
(
this
.
state
.
order
))
{
this
.
setState
({
errorOrder
:
true
,
msgErrorOrder
:
'Order Harus Diisi'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
description
))
{
this
.
setState
({
errorDesc
:
true
,
msgErrorDesc
:
'Deskripsi Harus Diisi'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
parent
))
return
alert
(
"Parent ID is Required."
)
else
if
(
R
.
isNil
(
this
.
state
.
InputType
))
return
alert
(
"Tipe Data is Required."
);
else
if
(
this
.
state
.
disabledFormula
===
false
&&
R
.
isEmpty
(
this
.
state
.
formula
))
{
this
.
setState
({
errorFormula
:
true
,
msgErrorFormula
:
'Formula Harus Diisi'
})
}
else
if
(
this
.
state
.
disabledValue
===
false
&&
R
.
isEmpty
(
this
.
state
.
realVal
))
{
this
.
setState
({
errorRV
:
true
,
msgErrorRV
:
'Nilai Seharusnya Harus Diisi'
})
}
else
if
(
this
.
state
.
disabledCondt
===
false
&&
R
.
isEmpty
(
this
.
state
.
condition
))
return
alert
(
"Kondisi Jika Salah is Required."
)
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
()
}
}
getDetailReportItems
()
{
api
.
create
().
getDetailReportItems
(
this
.
props
.
data
.
item_report_id
).
then
((
response
)
=>
{
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getParent
()
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
tempData
:
response
.
data
.
data
})
console
.
log
(
response
.
data
.
data
)
}
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
),
};
};
handleEndDate
=
(
date
)
=>
{
let
index
=
inputData
.
findIndex
((
val
)
=>
val
.
type_report_id
===
this
.
state
.
tempData
.
type_report_id
)
this
.
setState
({
this
.
setState
({
listInputType
:
defaultProps
,
InputType
:
index
===
-
1
?
inputData
[
0
]
:
inputData
[
index
]})
endDate
:
date
}
else
{
});
alert
(
response
.
data
.
message
)
}
})
}
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
),
};
};
componentDidMount
()
{
let
index
=
companyData
.
findIndex
((
val
)
=>
val
.
company_id
===
this
.
state
.
tempData
.
company_id
)
console
.
log
(
this
.
props
.
data
);
this
.
setState
({
listCompany
:
defaultProps
,
company
:
index
===
-
1
?
companyData
[
0
]
:
companyData
[
index
]})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
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
),
};
let
index
=
reportTypeData
.
findIndex
((
val
)
=>
val
.
report_id
===
this
.
state
.
tempData
.
report_id
)
this
.
setState
({
listReportType
:
defaultProps
,
reportType
:
index
===
-
1
?
reportTypeData
[
0
]
:
reportTypeData
[
index
]})
}
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
,
report_name
:
item
.
report_name
}
})
let
defaultProps
=
{
options
:
parentData
,
getOptionLabel
:
(
option
)
=>
titleCase
(
option
.
report_name
),
};
let
index
=
parentData
.
findIndex
((
val
)
=>
val
.
item_report_id
===
this
.
state
.
tempData
.
item_report_id
)
this
.
setState
({
listParent
:
defaultProps
,
parent
:
index
===
-
1
?
parentData
[
0
]
:
parentData
[
index
]})
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
}
render
()
{
render
()
{
...
@@ -117,16 +285,17 @@ export default class EditReportItems extends Component {
...
@@ -117,16 +285,17 @@ export default class EditReportItems extends Component {
<
div
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
value
=
{
1
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
item_report_id
}
id
=
"ID"
id
=
"ID"
label
=
"ID"
label
=
"ID"
disabled
disabled
variant
=
"filled"
onChange
=
{(
e
)
=>
null
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -134,60 +303,45 @@ export default class EditReportItems extends Component {
...
@@ -134,60 +303,45 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
TextField
<
Autocomplete
{...
this
.
state
.
listCompany
}
id
=
"company"
id
=
"company"
style
=
{{
width
:
'100%'
}}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
company
:
newInputValue
})}
select
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Perusahaan"
label
=
"Perusahaan"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
{
companies
.
map
((
option
)
=>
(
/>
}
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
value
=
{
this
.
state
.
company
}
{
option
.
label
}
/
>
<
/option
>
))}
<
/TextField
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"description"
id
=
"description"
label
=
"Deskripsi"
label
=
"Deskripsi"
// value={this.props.data.business_unit_name}
onChange
=
{(
e
)
=>
null
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
description
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -195,8 +349,7 @@ export default class EditReportItems extends Component {
...
@@ -195,8 +349,7 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
>
>
...
@@ -207,13 +360,13 @@ export default class EditReportItems extends Component {
...
@@ -207,13 +360,13 @@ export default class EditReportItems extends Component {
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"uom"
id
=
"uom"
label
=
"UOM"
label
=
"UOM"
// value={this.props.data.business_unit_name}
onChange
=
{(
e
)
=>
null
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
uom
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -221,64 +374,52 @@ export default class EditReportItems extends Component {
...
@@ -221,64 +374,52 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
TextField
<
Autocomplete
id
=
"dataType"
{...
this
.
state
.
listInputType
}
style
=
{{
width
:
'100%'
}}
id
=
"inputType"
select
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'FORMULA'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'VALIDATION'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
false
,
disabledValue
:
false
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
)}
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Tipe Data"
label
=
"Tipe Data"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
{
dataTypes
.
map
((
option
)
=>
(
/>
}
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
value
=
{
this
.
state
.
InputType
}
{
option
.
label
}
/
>
<
/option
>
))}
<
/TextField
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
// value={this.props.data.status}
id
=
"realValue"
id
=
"realValue"
label
=
"Nilai Seharusnya"
label
=
"Nilai Seharusnya"
value
=
"-"
disabled
=
{
this
.
state
.
disabledValue
}
disabled
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
condition_it_should_be
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -286,8 +427,7 @@ export default class EditReportItems extends Component {
...
@@ -286,8 +427,7 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
/
>
/
>
...
@@ -296,10 +436,12 @@ export default class EditReportItems extends Component {
...
@@ -296,10 +436,12 @@ export default class EditReportItems extends Component {
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"startDate"
id
=
"startDate"
value
=
{
startDate
}
onChange
=
{
this
.
handleStartDate
}
label
=
"Berlaku Mulai"
label
=
"Berlaku Mulai"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
start_date
}
error
=
{
this
.
state
.
errorStartDate
}
helperText
=
{
this
.
state
.
msgErrorSD
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
KeyboardButtonProps
=
{{
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
'aria-label'
:
'change date'
,
}}
}}
...
@@ -308,7 +450,6 @@ export default class EditReportItems extends Component {
...
@@ -308,7 +450,6 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -317,17 +458,16 @@ export default class EditReportItems extends Component {
...
@@ -317,17 +458,16 @@ export default class EditReportItems extends Component {
color
:
'#7e8085'
,
color
:
'#7e8085'
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
value
=
"Aktif"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
status
}
id
=
"status"
id
=
"status"
label
=
"Status"
label
=
"Status"
disabled
disabled
...
@@ -335,8 +475,7 @@ export default class EditReportItems extends Component {
...
@@ -335,8 +475,7 @@ export default class EditReportItems extends Component {
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -344,8 +483,7 @@ export default class EditReportItems extends Component {
...
@@ -344,8 +483,7 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
/
>
/
>
...
@@ -364,48 +502,34 @@ export default class EditReportItems extends Component {
...
@@ -364,48 +502,34 @@ export default class EditReportItems extends Component {
<
/div
>
<
/div
>
<
div
className
=
"column-2"
>
<
div
className
=
"column-2"
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
TextField
<
Autocomplete
{...
this
.
state
.
listReportType
}
id
=
"reportType"
id
=
"reportType"
style
=
{{
width
:
'100%'
}}
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
reportType
:
newInputValue
})}
select
debug
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Jenis Laporan"
label
=
"Jenis Laporan"
// onChange={handleChange}
helperText
=
""
SelectProps
=
{{
native
:
true
,
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
{
reportTypes
.
map
((
option
)
=>
(
/>
}
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
value
=
{
this
.
state
.
reportType
}
{
option
.
label
}
/
>
<
/option
>
))}
<
/TextField
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"order"
id
=
"order"
label
=
"Order"
label
=
"Order"
value
=
"1"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
order
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
...
@@ -426,54 +550,39 @@ export default class EditReportItems extends Component {
...
@@ -426,54 +550,39 @@ export default class EditReportItems extends Component {
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
}}
>
<
TextField
<
Autocomplete
id
=
"parent"
{...
this
.
state
.
listParent
}
style
=
{{
width
:
'100%'
}}
id
=
"parentId"
select
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
parent
:
newInputValue
})}
label
=
"Parent"
debug
// onChange={handleChange}
renderInput
=
{(
params
)
=>
helperText
=
""
<
TextField
{...
params
}
SelectProps
=
{{
label
=
"Parent ID"
native
:
true
,
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
>
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
{
parents
.
map
((
option
)
=>
(
/>
}
<
option
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
value
=
{
this
.
state
.
parent
}
{
option
.
label
}
/
>
<
/option
>
))}
<
/TextField
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
TextField
<
TextField
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"weight"
id
=
"weight"
label
=
"Weight"
label
=
"Weight"
value
=
"1"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
weight
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -481,8 +590,7 @@ export default class EditReportItems extends Component {
...
@@ -481,8 +590,7 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
>
>
...
@@ -493,13 +601,13 @@ export default class EditReportItems extends Component {
...
@@ -493,13 +601,13 @@ export default class EditReportItems extends Component {
style
=
{{
width
:
'100%'
}}
style
=
{{
width
:
'100%'
}}
id
=
"formula"
id
=
"formula"
label
=
"Formula"
label
=
"Formula"
value
=
"1"
disabled
=
{
this
.
state
.
disabledFormula
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
formula
}
inputProps
=
{{
inputProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -507,47 +615,47 @@ export default class EditReportItems extends Component {
...
@@ -507,47 +615,47 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
>
>
<
/TextField
>
<
/TextField
>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
backgroundColor
:
'#e8e8e8'
,
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
}}
>
<
TextField
<
Autocomplete
style
=
{{
width
:
'100%'
}}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
condition
}
value
=
"-"
id
=
"isWrongCondition"
id
=
"isWrongCondition"
label
=
"Kondisi Jika Salah"
disabled
=
{
this
.
state
.
disabledCondt
}
disabled
onChange
=
{(
event
,
newValue
)
=>
{
inputProps
=
{{
this
.
setState
({
condition
:
newValue
});
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}}
}}
options
=
{
this
.
state
.
options
}
renderInput
=
{(
params
)
=>
<
TextField
{...
params
}
label
=
"Kondisi Jika Salah"
InputLabelProps
=
{{
InputLabelProps
=
{{
style
:
{
style
:
{
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
color
:
'#7e8085'
,
color
:
'#7e8085'
paddingLeft
:
10
}
}
}}
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
}
}}
/>
}
/>
/>
<
/div
>
<
/div
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
div
className
=
"margin-top-10px"
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
<
DatePicker
<
DatePicker
margin
=
"normal"
margin
=
"normal"
id
=
"endDate"
id
=
"endDate"
value
=
{
endDate
}
onChange
=
{
this
.
handleEndDate
}
label
=
"Berlaku Hingga"
label
=
"Berlaku Hingga"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
end_date
}
error
=
{
this
.
state
.
errorEndDate
}
helperText
=
{
this
.
state
.
msgErrorED
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
minDate
=
{
this
.
state
.
startDate
}
KeyboardButtonProps
=
{{
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
'aria-label'
:
'change date'
,
}}
}}
...
@@ -556,7 +664,6 @@ export default class EditReportItems extends Component {
...
@@ -556,7 +664,6 @@ export default class EditReportItems extends Component {
fontSize
:
11
,
fontSize
:
11
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
InputLabelProps
=
{{
InputLabelProps
=
{{
...
@@ -565,11 +672,10 @@ export default class EditReportItems extends Component {
...
@@ -565,11 +672,10 @@ export default class EditReportItems extends Component {
color
:
'#7e8085'
,
color
:
'#7e8085'
,
fontWeight
:
600
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
fontFamily
:
'Nunito Sans, sans-serif'
,
paddingLeft
:
10
}
}
}}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
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