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
ad8b6bd1
Commit
ad8b6bd1
authored
Aug 17, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
781f2df9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
205 additions
and
98 deletions
+205
-98
index.js
src/api/index.js
+2
-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
+123
-14
No files found.
src/api/index.js
View file @
ad8b6bd1
...
...
@@ -121,6 +121,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
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
)
const
updateReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/update_item_report'
,
body
)
const
checkUploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/check_import'
,
body
)
const
uploadReportItems
=
(
body
)
=>
api
.
post
(
'/item_report/import_item_report'
,
body
)
const
getItemReportHierarki
=
()
=>
api
.
get
(
'item_report/get_item_report_hierarki'
)
...
...
@@ -193,6 +194,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getReportItems
,
searchReportItems
,
createReportItems
,
updateReportItems
,
getInputType
,
getReportType
,
checkUploadReportItems
,
...
...
src/container/MasterData/ReportItems.js
View file @
ad8b6bd1
...
...
@@ -708,13 +708,13 @@ export default class ReportItems extends Component {
]
return
(
<
div
>
{
this
.
state
.
itemReport
===
true
?
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
199
,
width
:
'100%'
}}
/
>
{
this
.
state
.
itemReport
===
true
?
<
div
>
<
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'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
<
InputBase
...
...
@@ -731,7 +731,6 @@ export default class ReportItems extends Component {
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
padding
:
0
,
margin
:
5
}}
onClick
=
{()
=>
this
.
downloadFile
()}
...
...
@@ -794,7 +793,6 @@ export default class ReportItems extends Component {
<
/MuiThemeProvider
>
<
/div
>
<
/div
>
<
/div
>
:
this
.
state
.
visualisasi
==
true
?
<
VisualReportItems
...
...
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
ad8b6bd1
...
...
@@ -24,7 +24,6 @@ export default class CreateReportItems extends Component {
formula
:
''
,
realVal
:
''
,
condition
:
null
,
inputValue
:
''
,
date
:
new
Date
(),
listInputType
:
null
,
listCompany
:
null
,
...
...
@@ -137,7 +136,6 @@ export default class CreateReportItems extends Component {
else
{
this
.
addReportItems
()
}
}
addReportItems
()
{
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
ad8b6bd1
import
React
,
{
Component
}
from
'react'
;
import
{
TextField
,
Typography
}
from
'@material-ui/core'
;
import
{
DatePicker
}
from
'@material-ui/pickers'
;
import
format
from
"date-fns/format"
;
import
Autocomplete
from
'@material-ui/lab/Autocomplete'
;
import
*
as
R
from
'ramda'
const
companies
=
[
{
...
...
@@ -66,26 +69,132 @@ export default class EditReportItems extends Component {
constructor
(
props
)
{
super
(
props
)
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
)
=>
{
this
.
setState
({
startDate
:
date
});
};
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
);
}
handleEndDate
=
(
date
)
=>
{
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
({
endDate
:
date
});
};
...
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
({
...
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
()
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
);
}
render
()
{
...
...
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