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
1f207c41
Commit
1f207c41
authored
Nov 19, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handleChange
parent
3838bdb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
4 deletions
+73
-4
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+73
-4
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
1f207c41
...
...
@@ -4,6 +4,7 @@ import React, { Component } from 'react'
import
ReactTooltip
from
'react-tooltip'
;
import
Images
from
'../../assets/Images'
;
import
api
from
'../../api'
;
import
NumberFormat
from
'react-number-format'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
...
...
@@ -164,6 +165,19 @@ export default class ProfitLossMR extends Component {
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
value
console
.
log
(
dataTable2
[
tableMeta
.
rowIndex
]);
}
const
handleChange
=
(
value
,
tableMeta
,
indexChilds
)
=>
{
console
.
log
(
dataTable2
)
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
if
(
indexChilds
==
0
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
mb
=
Number
(
val
)
}
else
if
(
indexChilds
==
1
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
rb
=
Number
(
val
)
}
else
if
(
indexChilds
==
2
)
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
actual
=
Number
(
val
)
}
}
let
columns
=
[
{
name
:
""
,
...
...
@@ -327,7 +341,7 @@ export default class ProfitLossMR extends Component {
paddingRight
:
0
}
}),
customBodyRender
:
(
val
,
tableMeta
,
updateValue
)
=>
{
customBodyRender
:
(
val
ue
,
tableMeta
,
updateValue
)
=>
{
// console.log(tableMeta);
return
(
<
div
>
...
...
@@ -336,7 +350,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
mb
val
ue
.
mb
}
<
/div
>
<
/div
>
...
...
@@ -344,7 +358,7 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
rb
val
ue
.
rb
}
<
/div
>
<
/div
>
...
...
@@ -352,7 +366,62 @@ export default class ProfitLossMR extends Component {
<
div
style
=
{{
textAlign
:
'right'
,
width
:
90
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
?
null
:
val
.
actual
tableMeta
.
rowData
[
0
]
===
2
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
6
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
1
?
null
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
.
actual
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
"input"
value
=
{
Number
(
value
.
actual
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
handleChange
(
event
.
target
.
value
,
tableMeta
,
2
)
// console.log(dataTable2)
}}
/
>
}
/
>
<
/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