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
870242d0
Commit
870242d0
authored
Dec 01, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minmax value
parent
c86e8477
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
7 deletions
+65
-7
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+65
-7
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
870242d0
...
...
@@ -57,7 +57,9 @@ export default class ProfitLossMR extends Component {
dataTable
:
[],
loading
:
true
,
visiblePLMR
:
true
,
valueThreshold
:
0
// valueThreshold: 0,
minValue
:
0
,
maxValue
:
0
}
}
...
...
@@ -78,9 +80,14 @@ export default class ProfitLossMR extends Component {
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
'success'
)
{
this
.
setState
({
valueThreshold
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
value
:
null
// valueThreshold: response.data.data[0] ? response.data.data[0].value : null,
minValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
min_value
:
-
10
,
maxValue
:
response
.
data
.
data
[
0
]
?
response
.
data
.
data
[
0
].
max_value
:
10
,
},
()
=>
{
this
.
getItemHierarki
()
console
.
log
(
response
.
data
.
data
[
0
]);
console
.
log
(
response
.
data
.
data
[
0
].
max_value
);
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
...
...
@@ -391,8 +398,8 @@ export default class ProfitLossMR extends Component {
periode
:
this
.
props
.
periode
,
report_id
:
this
.
props
.
report_id
,
months
:
this
.
props
.
month
.
month_id
,
profit_loss
:
data
,
status
:
type
status
:
type
,
profit_loss
:
data
}
// console.log(data);
api
.
create
(
'UPLOAD'
).
uploadMonthlyReportPL
(
body
).
then
(
response
=>
{
...
...
@@ -1179,6 +1186,23 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
15
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
15
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
'red'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariancePercent
(
tableMeta
,
1
,
1
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1232,6 +1256,23 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
16
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
16
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
'red'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariancePercent
(
tableMeta
,
2
,
3
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1285,6 +1326,23 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
17
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
17
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
val
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
'red'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleVariancePercent
(
tableMeta
,
3
,
5
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1380,7 +1438,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
19
])
.
toFixed
(
1
)
>
Number
(
this
.
state
.
valueThreshold
).
toFixed
(
1
)
?
Number
(
tableMeta
.
rowData
[
19
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
19
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1435,7 +1493,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
20
])
.
toFixed
(
1
)
>
Number
(
this
.
state
.
valueThreshold
).
toFixed
(
1
)
?
Number
(
tableMeta
.
rowData
[
20
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
20
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -1490,7 +1548,7 @@ export default class ProfitLossMR extends Component {
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
Number
(
tableMeta
.
rowData
[
21
])
.
toFixed
(
1
)
>
Number
(
this
.
state
.
valueThreshold
).
toFixed
(
1
)
?
Number
(
tableMeta
.
rowData
[
21
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
21
])
>=
this
.
state
.
maxValue
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
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