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
c4e3afee
Commit
c4e3afee
authored
Dec 10, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
pl issue See merge request
!789
parents
148c59cf
e744d5d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
133 additions
and
50 deletions
+133
-50
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+133
-50
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
c4e3afee
...
...
@@ -76,7 +76,8 @@ export default class ProfitLossMR extends Component {
// valueThreshold: 0,
minValue
:
0
,
maxValue
:
0
,
updateBy
:
'-'
updateBy
:
'-'
,
bebeas
:
false
}
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
}
...
...
@@ -488,6 +489,30 @@ export default class ProfitLossMR extends Component {
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
const
handleCalculate
=
()
=>
{
let
error
=
false
let
messageError
=
""
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
item
[
19
]
==
""
&&
Number
(
item
[
14
])
<=
this
.
state
.
minValue
||
Number
(
item
[
14
])
>=
this
.
state
.
maxValue
)
{
error
=
true
messageError
=
"MTD Explanation vs Prev. Month is Reqiured"
}
if
(
item
[
20
]
==
""
&&
Number
(
item
[
16
])
<=
this
.
state
.
minValue
||
Number
(
item
[
16
])
>=
this
.
state
.
maxValue
)
{
error
=
true
messageError
=
"MTD Explanation vs MB is Reqiured"
}
if
(
item
[
21
]
==
""
&&
Number
(
item
[
18
])
<=
this
.
state
.
minValue
||
Number
(
item
[
18
])
>=
this
.
state
.
maxValue
)
{
error
=
true
messageError
=
"MTD Explanation vs RB is Reqiured"
}
})
if
(
error
===
true
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
messageError
,
tipeAlert
:
'error'
,
loading
:
false
,
bebas
:
true
})
}
}
const
handleText
=
(
value
,
tableMeta
,
type
)
=>
{
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
+
type
]
=
value
// console.log(dataTable2[tableMeta.rowIndex]);
...
...
@@ -1503,21 +1528,39 @@ export default class ProfitLossMR extends Component {
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
Number
(
tableMeta
.
rowData
[
14
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>=
this
.
state
.
maxValue
?
false
:
true
}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
tableMeta
.
rowData
[
19
]
==
""
&&
Number
(
tableMeta
.
rowData
[
14
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>=
this
.
state
.
maxValue
?
<
LightTooltip
title
=
{
"MTD Explanation vs Prev. Month is Reqiured"
}
arrow
>
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[14]) <= this.state.minValue || Number(tableMeta.rowData[14]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
<
/LightTooltip>
:
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[14]) <= this.state.minValue || Number(tableMeta.rowData[14]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
19
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
}
/>
}
<
/div
>
...
...
@@ -1531,21 +1574,39 @@ export default class ProfitLossMR extends Component {
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
Number
(
tableMeta
.
rowData
[
16
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
16
])
>=
this
.
state
.
maxValue
?
false
:
true
}
defaultValue
=
{
tableMeta
.
rowData
[
20
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
/
>
tableMeta
.
rowData
[
20
]
==
""
&&
Number
(
tableMeta
.
rowData
[
16
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
16
])
>=
this
.
state
.
maxValue
?
<
LightTooltip
title
=
{
"MTD Explanation vs MB is Reqiured"
}
arrow
>
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[16]) <= this.state.minValue || Number(tableMeta.rowData[16]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
20
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
/
>
<
/LightTooltip>
:
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[16]) <= this.state.minValue || Number(tableMeta.rowData[16]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
20
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
1
)
}}
/
>
}
/>
}
<
/div
>
...
...
@@ -1559,21 +1620,39 @@ export default class ProfitLossMR extends Component {
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
Number
(
tableMeta
.
rowData
[
18
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
18
])
>=
this
.
state
.
maxValue
?
false
:
true
}
defaultValue
=
{
tableMeta
.
rowData
[
21
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
tableMeta
.
rowData
[
21
]
==
""
&&
Number
(
tableMeta
.
rowData
[
18
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
18
])
>=
this
.
state
.
maxValue
?
<
LightTooltip
title
=
{
"MTD Explanation vs Prev. Month is Reqiured"
}
arrow
>
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[18]) <= this.state.minValue || Number(tableMeta.rowData[18]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
21
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
<
/LightTooltip>
:
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
// disabled={Number(tableMeta.rowData[18]) <= this.state.minValue || Number(tableMeta.rowData[18]) >= this.state.maxValue ? false : true}
defaultValue
=
{
tableMeta
.
rowData
[
21
]}
inputProps
=
{{
style
:
{
color
:
"#5198ea"
,
textAlign
:
'right'
}}}
onBlur
=
{(
event
)
=>
{
handleText
(
event
.
target
.
value
,
tableMeta
,
0
)
}}
/
>
}
/>
}
<
/div
>
...
...
@@ -1768,8 +1847,10 @@ export default class ProfitLossMR extends Component {
marginRight
:
20
}}
onClick
=
{()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
,
bebas
:
false
},
()
=>
{
setTimeout
(()
=>
{
handleCalculate
()
this
.
setState
({
loading
:
false
})
// this.handleValidate()
},
100
);
...
...
@@ -1785,14 +1866,15 @@ export default class ProfitLossMR extends Component {
type
=
"button"
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
saveDraft
!==
true
?
'pointer'
:
'default'
,
cursor
:
this
.
state
.
bebas
?
'default'
:
this
.
state
.
saveDraft
!==
true
?
'pointer'
:
'default'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
marginRight
:
20
}}
onClick
=
{()
=>
this
.
state
.
saveDraft
===
true
?
null
:
null
:
this
.
state
.
bebas
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
this
.
backToMonthlyReport
(
'draft'
)
...
...
@@ -1807,6 +1889,7 @@ export default class ProfitLossMR extends Component {
type
=
"button"
// disabled={this.state.buttonError}
onClick
=
{()
=>
this
.
state
.
bebas
?
null
:
this
.
state
.
buttonError
?
this
.
setState
({
alert
:
true
,
messageAlert
:
'Data is not complete !'
,
tipeAlert
:
'warning'
})
:
...
...
@@ -1816,7 +1899,7 @@ export default class ProfitLossMR extends Component {
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
this
.
state
.
bebas
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
...
...
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