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
71de4600
Commit
71de4600
authored
Mar 25, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
c816f14d
64f43b0c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
723 additions
and
359 deletions
+723
-359
BudgetTahunan.js
src/container/BudgetTahunan.js
+1
-1
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+686
-341
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+36
-17
No files found.
src/container/BudgetTahunan.js
View file @
71de4600
...
...
@@ -296,7 +296,7 @@ export default class BudgetTahunan extends Component {
item
.
revision
,
this
.
state
.
lastStatus
===
'APPROVED'
?
'CLOSED'
:
this
.
state
.
isSubmit
===
false
?
"CLOSED"
:
status_approv
,
item
.
report_id
,
Number
(
item
.
revision
)
>
0
?
(
item
.
current_status
==
"not-yet"
?
false
:
item
.
is_can_upload
)
:
item
.
is_can_upload
,
item
.
report_name
===
"Cash Flow"
?
item
.
is_can_upload
:
(
Number
(
item
.
revision
)
>
0
?
(
item
.
current_status
==
"not-yet"
?
false
:
item
.
is_can_upload
)
:
item
.
is_can_upload
)
,
item
.
revision
]
})
...
...
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
71de4600
...
...
@@ -115,7 +115,7 @@ export default class CorporateAnnualTarget extends Component {
let
dataInternalBsn
=
[]
let
dataFin
=
[]
let
dataLearn
=
[]
//
console.log(response)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
...
...
@@ -1076,7 +1076,6 @@ export default class CorporateAnnualTarget extends Component {
}
else
{
}
anjay
.
push
(
String
(
total
))
}
else
if
(
item
.
includes
(
'[CM]AVG'
))
{
if
(
forecast
==
undefined
)
{
...
...
@@ -1085,7 +1084,7 @@ export default class CorporateAnnualTarget extends Component {
}
}
else
if
(
item
.
includes
(
'X'
))
{
let
indexX
=
String
(
item
).
indexOf
(
'X'
)
console
.
log
(
item
)
//
console.log(item)
if
(
indexX
==
0
)
{
anjay
.
push
(
String
(
item
).
substr
(
1
,
String
(
item
).
length
))
}
else
{
...
...
@@ -1097,13 +1096,9 @@ export default class CorporateAnnualTarget extends Component {
let
convertID
=
-
1
if
(
tableMeta
.
rowData
[
11
].
value
==
'FORMULA'
)
{
let
indexIDReport
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
formulaAwal
)
console
.
log
(
indexX
)
console
.
log
(
formulaAwal
)
console
.
log
(
indexIDReport
)
console
.
log
(
dataTable2
[
indexIDReport
][
31
])
convertID
=
dataTable2
[
indexIDReport
][
31
]
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
31
]
==
convertID
==
-
1
?
item
:
convertID
)
let
valuezz
=
dataTable2
[
indexID
][
column
].
value
==
undefined
?
dataTable2
[
indexID
][
column
]
:
dataTable2
[
indexID
][
column
].
value
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
31
]
==
(
convertID
==
-
1
?
item
:
convertID
)
)
let
valuezz
=
dataTable2
[
indexID
][
tableMeta
.
columnIndex
].
value
==
undefined
?
dataTable2
[
indexID
][
tableMeta
.
columnIndex
]
:
dataTable2
[
indexID
][
tableMeta
.
columnIndex
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
else
{
let
indexID
=
value
.
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
formulaAwal
}
`
)
&&
val
.
periode
==
Number
(
this
.
props
.
periode
))
...
...
@@ -1144,9 +1139,9 @@ export default class CorporateAnnualTarget extends Component {
let
indexIDReport
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
)
convertID
=
dataTable2
[
indexIDReport
][
31
]
}
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
31
]
==
convertID
==
-
1
?
item
:
convertID
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
31
]
==
(
convertID
==
-
1
?
item
:
convertID
)
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
dataTable2
[
indexID
][
column
].
value
==
undefined
?
dataTable2
[
indexID
][
column
]
:
dataTable2
[
indexID
][
column
].
value
let
valuezz
=
dataTable2
[
indexID
][
tableMeta
.
columnIndex
].
value
==
undefined
?
dataTable2
[
indexID
][
tableMeta
.
columnIndex
]
:
dataTable2
[
indexID
][
tableMeta
.
columnIndex
].
value
if
(
item
==
dataTable2
[
tableMeta
.
rowIndex
][
31
])
{
anjay
.
push
(
0
)
}
else
{
...
...
@@ -1160,6 +1155,11 @@ export default class CorporateAnnualTarget extends Component {
}
}
})
// if (tableMeta.rowData[11].value == 'FORMULA') {
// console.log(anjay)
// console.log(column)
// }
let
anjay2
=
[]
let
kurung
=
false
...
...
@@ -1871,6 +1871,29 @@ export default class CorporateAnnualTarget extends Component {
null
:
<
div
style
=
{{
flex
:
1
}}
>
{(
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
)
&&
tableMeta
.
rowData
[
11
].
value
==
'FORMULA'
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
0
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -1890,7 +1913,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
}
<
/div
>
...
...
@@ -1966,7 +1989,7 @@ export default class CorporateAnnualTarget extends Component {
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"#5198ea"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
1
)).
toFixed
(
1
)}
...
...
@@ -2068,6 +2091,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2087,7 +2133,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div>
)
}
<
/div
>
...
...
@@ -2154,6 +2200,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
3
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2173,7 +2242,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2241,6 +2310,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
4
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2260,7 +2352,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2328,6 +2420,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
5
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2347,7 +2462,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2415,6 +2530,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
6
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2434,7 +2572,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2502,6 +2640,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
7
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2521,7 +2682,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2589,6 +2750,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
8
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2608,7 +2792,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2676,6 +2860,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
9
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2695,7 +2902,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2763,6 +2970,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
10
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2782,7 +3012,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2850,6 +3080,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
11
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2869,7 +3122,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2937,6 +3190,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -2956,7 +3232,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -2976,7 +3252,31 @@ export default class CorporateAnnualTarget extends Component {
return
(
<
div
style
=
{{
width
:
96
}}
>
{
tableMeta
.
rowData
[
6
]
===
'ROIC'
?
// tableMeta.rowData[6] === 'ROIC' ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// control={
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// value={Number(handleTotal(tableMeta, 'roic')).toFixed(1)}
// disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // // // console.log(tableMeta.rowData[0])
// }}
// />
// }
// />
// </div> :
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
(
handleReturnFormula
(
tableMeta
.
rowData
[
2
],
tableMeta
)
?
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
...
...
@@ -2987,8 +3287,9 @@ export default class CorporateAnnualTarget extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleTotal
(
tableMeta
,
'roic'
)).
toFixed
(
1
)}
value
=
{
Number
(
handleValueForecast
(
value
,
tableMeta
,
this
.
props
.
periode
)).
toFixed
(
1
)}
disabled
=
{
true
}
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
...
...
@@ -2997,11 +3298,11 @@ export default class CorporateAnnualTarget extends Component {
/
>
}
/
>
<
/div>
:
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
||
tableMeta
.
rowData
[
0
]
===
4
?
null
:
(
handleReturnFormula
(
tableMeta
.
rowData
[
2
],
tableMeta
)
?
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -3011,8 +3312,8 @@ export default class CorporateAnnualTarget extends Component {
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFor
ecast
(
value
,
tableMeta
,
this
.
props
.
periode
)).
toFixed
(
1
)}
disabled
=
{
true
}
value
=
{
Number
(
handleValueFor
mula
(
value
,
tableMeta
,
13
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
...
...
@@ -3022,9 +3323,7 @@ export default class CorporateAnnualTarget extends Component {
/
>
}
/
>
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -3044,7 +3343,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -3112,6 +3411,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
14
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -3131,7 +3453,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
@@ -3199,6 +3521,29 @@ export default class CorporateAnnualTarget extends Component {
<
/div
>
:
<
div
style
=
{{
flex
:
1
}}
>
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
||
tableMeta
.
rowData
[
0
]
===
7
?
// null
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
control
=
{
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
handleValueFormula
(
value
,
tableMeta
,
16
)).
toFixed
(
1
)}
disabled
decimalScale
=
{
1
}
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// // // // console.log(tableMeta.rowData[0])
}}
/
>
}
/
>
:
<
FormControlLabel
style
=
{{
margin
:
0
}}
value
=
{
value
}
...
...
@@ -3218,7 +3563,7 @@ export default class CorporateAnnualTarget extends Component {
}}
/
>
}
/
>
/>
}
<
/div
>
)
}
...
...
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
71de4600
...
...
@@ -129,6 +129,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
// this.setState({ viewOnly: true })
}
getParameterGroup
()
{
...
...
@@ -978,11 +979,20 @@ export default class CorporateAnnualTargetMR extends Component {
if
(
forecast
==
undefined
)
{
// console.log(formulaAwal)
// console.log(tableMeta.rowData[17])
let
convertID
=
-
1
if
(
tableMeta
.
rowData
[
10
]
==
'FORMULA'
)
{
let
indexIDReport
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
formulaAwal
)
convertID
=
dataTable2
[
indexIDReport
][
18
]
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
18
]
==
(
convertID
==
-
1
?
item
:
convertID
))
let
valuezz
=
dataTable2
[
indexID
][
column
].
value
==
undefined
?
dataTable2
[
indexID
][
column
]
:
dataTable2
[
indexID
][
column
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
else
{
let
indexID
=
tableMeta
.
rowData
[
17
].
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
formulaAwal
}
`
)
&&
val
.
periode
==
Number
(
this
.
props
.
periode
))
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
.
rowData
[
17
][
indexID
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
else
{
// // // console.log(dataTable2[tableMeta.rowIndex][30])
let
array
=
dataTable2
[
tableMeta
.
rowIndex
][
18
].
filter
((
val
)
=>
val
.
periode
==
Number
(
column
))
...
...
@@ -1010,7 +1020,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
else
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
18
]
==
item
)
let
convertID
=
-
1
if
(
tableMeta
.
rowData
[
10
]
==
'FORMULA'
)
{
let
indexIDReport
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
)
convertID
=
dataTable2
[
indexIDReport
][
18
]
}
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
18
]
==
(
convertID
==
-
1
?
item
:
convertID
))
if
(
indexID
!==
-
1
)
{
let
valuezz
=
dataTable2
[
indexID
][
column
].
value
==
undefined
?
dataTable2
[
indexID
][
column
]
:
dataTable2
[
indexID
][
column
].
value
if
(
item
==
dataTable2
[
tableMeta
.
rowIndex
][
18
])
{
...
...
@@ -1027,8 +1042,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
// if (tableMeta.rowData[10] == 'FORMULA') {
// // let indexIDReport = dataTable2.findIndex((val) => val[1] == item)
// // convertID = dataTable2[indexIDReport][18]
// console.log(baru)
// console.log(anjay)
// }
let
anjay2
=
[]
let
kurung
=
false
...
...
@@ -1148,12 +1167,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
total
=
dataTable2
[
tableMeta
.
rowIndex
][
5
]
==
"ROIC"
?
"0"
:
R
.
equals
(
total
,
NaN
)
?
"0.0"
:
total
if
(
dataTable2
[
tableMeta
.
rowIndex
][
5
]
==
"ROIC"
)
{
dataTable2
[
tableMeta
.
rowIndex
][
column
]
=
0
}
else
{
total
=
R
.
equals
(
total
,
NaN
)
?
"0.0"
:
total
//
if (dataTable2[tableMeta.rowIndex][5] == "ROIC") {
//
dataTable2[tableMeta.rowIndex][column] = 0
//
} else {
dataTable2
[
tableMeta
.
rowIndex
][
column
]
=
Number
(
total
).
toFixed
(
1
)
}
//
}
return
Number
(
total
).
toFixed
(
1
)
}
...
...
@@ -1644,7 +1663,7 @@ export default class CorporateAnnualTargetMR extends Component {
style
=
{{
color
:
this
.
state
.
get_for
==
'view'
?
"black"
:
handleAction
(
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
0
],
tableMeta
)
?
"#5198ea"
:
'black'
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
tableMeta
.
rowData
[
5
]
===
"ROIC"
?
Number
(
value
).
toFixed
(
1
)
:
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
?
Number
(
handleValueFormula
(
value
,
tableMeta
,
tableMeta
.
columnIndex
)).
toFixed
(
1
)
:
Number
(
value
).
toFixed
(
1
)}
value
=
{
tableMeta
.
rowData
[
0
]
===
5
||
tableMeta
.
rowData
[
0
]
===
6
?
Number
(
handleValueFormula
(
value
,
tableMeta
,
tableMeta
.
columnIndex
)).
toFixed
(
1
)
:
Number
(
value
).
toFixed
(
1
)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled
=
{
this
.
state
.
get_for
==
'view'
?
true
:
!
handleAction
(
tableMeta
.
rowData
[
2
],
tableMeta
.
rowData
[
0
],
tableMeta
)}
decimalScale
=
{
1
}
...
...
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