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
8115bdd0
Commit
8115bdd0
authored
Aug 17, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
edit See merge request
!111
parents
ed5f9ee6
7d8cd57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
69 deletions
+64
-69
CreateReportItems.js
...container/MasterData/formReportItems/CreateReportItems.js
+2
-2
EditReportItems.js
src/container/MasterData/formReportItems/EditReportItems.js
+62
-67
No files found.
src/container/MasterData/formReportItems/CreateReportItems.js
View file @
8115bdd0
...
@@ -393,8 +393,8 @@ export default class CreateReportItems extends Component {
...
@@ -393,8 +393,8 @@ export default class CreateReportItems extends Component {
id
=
"inputType"
id
=
"inputType"
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
onChange
=
{(
event
,
newInputValue
)
=>
this
.
setState
({
InputType
:
newInputValue
},
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
()
=>
newInputValue
===
null
?
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'F
ORMULA
'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'F
ormula
'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'V
ALIDATION
'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
false
,
disabledValue
:
false
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
newInputValue
.
type_report_name
===
'V
alidation
'
?
this
.
setState
({
disabledFormula
:
false
,
disabledCondt
:
false
,
disabledValue
:
false
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
:
this
.
setState
({
disabledFormula
:
true
,
disabledCondt
:
true
,
disabledValue
:
true
,
formula
:
''
,
condition
:
''
,
realVal
:
''
})
)}
)}
debug
debug
...
...
src/container/MasterData/formReportItems/EditReportItems.js
View file @
8115bdd0
...
@@ -54,10 +54,7 @@ export default class EditReportItems extends Component {
...
@@ -54,10 +54,7 @@ export default class EditReportItems extends Component {
componentDidMount
()
{
componentDidMount
()
{
// console.log(this.props.data);
// console.log(this.props.data);
this
.
getDetailReportItems
();
this
.
getDetailReportItems
();
this
.
getInputType
()
this
.
getPerusahaan
()
this
.
getReportType
()
this
.
getParent
()
}
}
handleChange
(
e
,
type
)
{
handleChange
(
e
,
type
)
{
...
@@ -140,11 +137,40 @@ export default class EditReportItems extends Component {
...
@@ -140,11 +137,40 @@ export default class EditReportItems extends Component {
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorED
:
'End Date tidak boleh kosong'
})
}
}
else
{
else
{
this
.
add
ReportItems
()
this
.
update
ReportItems
()
}
}
}
}
updateReportItems
()
{
// alert('test')
let
payload
=
{
"item_report_id"
:
this
.
state
.
parent
.
item_report_id
,
"report_id"
:
this
.
state
.
reportType
.
report_id
,
"company_id"
:
this
.
state
.
company
.
company_id
,
"description"
:
this
.
state
.
tempData
.
description
,
"orders"
:
this
.
state
.
tempData
.
order
,
"parent"
:
this
.
state
.
tempData
.
parent
,
"type_report_id"
:
this
.
state
.
InputType
.
type_report_id
,
"formula"
:
this
.
state
.
tempData
.
formula
,
"uom"
:
this
.
state
.
tempData
.
uom
,
"weight"
:
this
.
state
.
tempData
.
weight
,
"condition_if_wrong"
:
this
.
state
.
tempData
.
condition_if_wrong
,
"condition_it_should_be"
:
this
.
state
.
tempData
.
condition_it_should_be
,
"start_date"
:
this
.
state
.
tempData
.
start_date
,
"end_date"
:
this
.
state
.
tempData
.
end_date
}
console
.
log
(
payload
)
api
.
create
().
updateReportItems
(
payload
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
props
.
onClickClose
()
this
.
props
.
refresh
()
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
getDetailReportItems
()
{
getDetailReportItems
()
{
api
.
create
().
getDetailReportItems
(
this
.
props
.
data
.
item_report_id
).
then
((
response
)
=>
{
api
.
create
().
getDetailReportItems
(
this
.
props
.
data
.
item_report_id
).
then
((
response
)
=>
{
this
.
getInputType
()
this
.
getInputType
()
...
@@ -433,35 +459,18 @@ export default class EditReportItems extends Component {
...
@@ -433,35 +459,18 @@ export default class EditReportItems extends Component {
<
/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
=
"start_date"
id
=
"startDate"
name
=
"start_date"
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
}
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
start_date
}
error
=
{
this
.
state
.
errorStartDate
}
error
=
{
this
.
state
.
errorStartDate
}
helperText
=
{
this
.
state
.
msgErrorSD
}
helperText
=
{
this
.
state
.
msgErrorSD
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'start_date'
)}
KeyboardButtonProps
=
{{
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
'aria-label'
:
'change date'
,
}}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
inputProps
=
{{
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
}
}}
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
}}
>
...
@@ -653,36 +662,20 @@ export default class EditReportItems extends Component {
...
@@ -653,36 +662,20 @@ export default class EditReportItems extends Component {
<
/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
=
"end_date"
id
=
"endDate"
name
=
"end_date"
label
=
"Berlaku Hingga"
label
=
"Berlaku Hingga"
format
=
"dd MMMM yyyy"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
end_date
}
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
end_date
}
error
=
{
this
.
state
.
errorEndDate
}
error
=
{
this
.
state
.
errorEndDate
}
helperText
=
{
this
.
state
.
msgErrorED
}
helperText
=
{
this
.
state
.
msgErrorED
}
minDate
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
start_date
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
'end_date'
)}
minDate
=
{
this
.
state
.
startDate
}
KeyboardButtonProps
=
{{
KeyboardButtonProps
=
{{
'aria-label'
:
'change date'
,
'aria-label'
:
'change date'
,
}}
}}
inputProps
=
{{
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
style
:
{
fontSize
:
11
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
,
fontWeight
:
600
,
fontFamily
:
'Nunito Sans, sans-serif'
,
}
}}
style
=
{{
padding
:
0
,
margin
:
0
,
width
:
'100%'
}}
/
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -701,9 +694,11 @@ export default class EditReportItems extends Component {
...
@@ -701,9 +694,11 @@ export default class EditReportItems extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
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'
}}
>
<
button
onClick
=
{()
=>
this
.
updateReportItems
()}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
/div
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
Simpan
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
<
/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