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
e8a9c2d9
Commit
e8a9c2d9
authored
Dec 10, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
masih issue
parent
0d141d94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
51 deletions
+116
-51
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+116
-51
No files found.
src/container/MonthlyReport/ProfitLossMR.js
View file @
e8a9c2d9
...
...
@@ -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]);
...
...
@@ -1504,7 +1529,7 @@ export default class ProfitLossMR extends Component {
// value={value}
control
=
{
tableMeta
.
rowData
[
19
]
==
""
&&
Number
(
tableMeta
.
rowData
[
14
])
<=
this
.
state
.
minValue
||
Number
(
tableMeta
.
rowData
[
14
])
>=
this
.
state
.
maxValue
?
<
LightTooltip
title
=
{
"
Requi
red"
}
arrow
>
<
LightTooltip
title
=
{
"
MTD Explanation vs Prev. Month is Reqiu
red"
}
arrow
>
<
Input
disableUnderline
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
...
...
@@ -1549,6 +1574,24 @@ export default class ProfitLossMR extends Component {
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
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'
}}
...
...
@@ -1577,6 +1620,24 @@ export default class ProfitLossMR extends Component {
style
=
{{
margin
:
0
}}
// value={value}
control
=
{
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'
}}
...
...
@@ -1786,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
);
...
...
@@ -1803,7 +1866,7 @@ 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
...
...
@@ -1811,6 +1874,7 @@ export default class ProfitLossMR extends Component {
onClick
=
{()
=>
this
.
state
.
saveDraft
===
true
?
null
:
this
.
state
.
bebas
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
,
loading
:
true
},
()
=>
{
this
.
backToMonthlyReport
(
'draft'
)
...
...
@@ -1825,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'
})
:
...
...
@@ -1834,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