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
73ba4332
Commit
73ba4332
authored
Feb 28, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push dulu
parent
0ce1f436
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
678 additions
and
289 deletions
+678
-289
index.js
src/api/index.js
+1
-1
BudgetTahunan.js
src/container/BudgetTahunan.js
+333
-212
CashFlow.js
src/container/BudgetTahunan/CashFlow.js
+159
-12
DashboardCAT.js
src/container/Laporan/DashboardCAT.js
+10
-6
ExceutiveScoreboard.js
src/container/Laporan/ExceutiveScoreboard.js
+126
-18
StrategiMap.js
src/container/Laporan/StrategiMap.js
+49
-40
No files found.
src/api/index.js
View file @
73ba4332
...
...
@@ -281,7 +281,7 @@ const create = (type = "") => {
const
getReportFRMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ratio/monthly_report/get_report_hierarki'
,
body
)
const
getReportFRLastMR
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ratio/monthly_report_last_year/get_report_hierarki'
,
body
)
const
getReportBSSuma
=
(
body
)
=>
api
.
post
(
'/transaction/summary_balance_sheet/summary/get_report_hierarki'
,
body
)
const
getDashboardCAT
=
(
body
)
=>
api
.
post
(
'/
dashboard/
cat'
,
body
)
const
getDashboardCAT
=
(
body
)
=>
api
.
post
(
'/
transaction/dashboard/get_dashboard_
cat'
,
body
)
const
getHierarkiReportYtd
=
(
body
)
=>
api
.
post
(
'/transaction/summary_ytd/summary/get_report_hierarki'
,
body
)
const
getHierarkiReportHistorical
=
(
body
)
=>
api
.
post
(
'/transaction/summary_historical/summary/get_report_hierarki'
,
body
)
const
getHierarkiReportMTD
=
(
body
)
=>
api
.
post
(
'/transaction/summary_mtd/summary/get_report_hierarki'
,
body
)
...
...
src/container/BudgetTahunan.js
View file @
73ba4332
...
...
@@ -172,10 +172,9 @@ export default class BudgetTahunan extends Component {
if
(
response
.
data
.
status
===
"success"
)
{
// // // console.log(response);
if
(
response
.
data
.
data
.
is_approver
===
true
)
{
this
.
setState
({
isApprover
:
true
,
permissionhandle
:
true
,
checkApprover
:
true
},
()
=>
{
this
.
getPeriode
()
})
this
.
setState
({
isApprover
:
true
,
permissionhandle
:
true
,
checkApprover
:
true
},
()
=>
{
this
.
getPeriode
()
})
}
else
{
this
.
setState
({
isApprover
:
false
,
permissionhandle
:
false
,
checkApprover
:
false
},
()
=>
this
.
getDetailUser
())
...
...
@@ -214,7 +213,7 @@ export default class BudgetTahunan extends Component {
})
if
(
companyData
.
length
>
0
)
{
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
companyData
=
companyData
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
let
defaultProps
=
{
...
...
@@ -287,7 +286,7 @@ export default class BudgetTahunan extends Component {
let
indexC
=
String
(
item
.
current_status
).
toLocaleUpperCase
().
indexOf
(
'C'
)
let
status_approv
=
''
if
(
String
(
item
.
current_status
).
toLocaleUpperCase
().
includes
(
'CC'
))
{
status_approv
=
`
${
String
(
item
.
current_status
).
substr
(
0
,
indexC
)}${
String
(
item
.
current_status
).
substr
(
indexC
+
1
,
String
(
item
.
current_status
).
length
)}
`
status_approv
=
`
${
String
(
item
.
current_status
).
substr
(
0
,
indexC
)}${
String
(
item
.
current_status
).
substr
(
indexC
+
1
,
String
(
item
.
current_status
).
length
)}
`
}
else
{
status_approv
=
String
(
item
.
current_status
)
}
...
...
@@ -382,7 +381,7 @@ export default class BudgetTahunan extends Component {
})
if
(
arrayBaru
.
length
>
0
)
{
arrayBaru
=
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
arrayBaru
=
arrayBaru
.
sort
((
a
,
b
)
=>
a
.
company_name
.
localeCompare
(
b
.
company_name
))
}
let
defaultProps
=
{
...
...
@@ -413,7 +412,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
getLastPeriod
(
this
.
state
.
company
.
company_id
).
then
(
response
=>
{
// // console.log(response);
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
lastPeriod
:
this
.
state
.
userType
!==
''
?
this
.
state
.
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
setState
({
lastPeriod
:
this
.
state
.
userType
!==
''
?
this
.
state
.
lastPeriod
:
response
.
data
.
data
.
last_periode
,
latestPeriode
:
response
.
data
.
data
.
latest_periode
},
()
=>
{
this
.
getPeriode
()
})
}
...
...
@@ -514,7 +513,7 @@ export default class BudgetTahunan extends Component {
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"periode"
:
this
.
state
.
periode
.
periode
,
"is_approver"
:
this
.
state
.
permissionhandle
?
this
.
state
.
permissionhandle
:
this
.
state
.
isApprover
"is_approver"
:
this
.
state
.
permissionhandle
?
this
.
state
.
permissionhandle
:
this
.
state
.
isApprover
}
console
.
log
(
payload
)
api
.
create
().
getSubmission
(
payload
).
then
(
response
=>
{
...
...
@@ -538,7 +537,7 @@ export default class BudgetTahunan extends Component {
this
.
getCashFlow
(
type
)
this
.
getPL
(
type
)
}
else
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
}
// this.getFR(type)
api
.
create
().
checkApprover
().
then
(
response
=>
{
...
...
@@ -673,7 +672,7 @@ export default class BudgetTahunan extends Component {
})
console
.
log
(
dataTable
)
this
.
setState
({
dbCF
:
dataTable
},
()
=>
{
this
.
olahDataCashFlow
(
this
.
state
.
dbCF
,
type
)
this
.
olahDataCashFlow
(
this
.
state
.
dbCF
,
type
)
})
}
})
...
...
@@ -689,7 +688,7 @@ export default class BudgetTahunan extends Component {
let
items
=
String
(
item
).
substr
(
Number
(
String
(
item
).
length
)
-
1
,
1
)
let
subForm
=
String
(
item
).
substr
(
0
,
Number
(
String
(
item
).
length
)
-
1
)
let
re
=
/^
[
a-zA-Z0-9_
]
+$/
;
if
(
item
!==
""
)
{
if
(
item
!==
""
&&
item
!==
'@'
)
{
if
(
!
re
.
test
(
items
))
{
baru
.
push
(
subForm
)
baru
.
push
(
items
)
...
...
@@ -707,15 +706,37 @@ export default class BudgetTahunan extends Component {
if
(
String
(
item
).
includes
(
'[M-1]'
))
{
if
(
forecast
!==
undefined
)
{
let
forecastt
=
0
if
(
column
==
19
)
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
data
=
18
let
period
=
this
.
state
.
periode
.
periode
-
1
let
indexID
=
tableMeta
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
[
data
].
formula
[
indexID
].
value
if
(
tableMeta
[
5
]
==
"Cash at the beginning period"
)
{
// console.log(dataTable2[tableMeta.rowIndex+1])
// console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let
valuezzz
=
dataTable2
[
indexDBCF
+
1
][
data
].
value
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
if
(
column
==
20
)
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
data
=
18
let
period
=
this
.
state
.
periode
.
periode
let
indexID
=
tableMeta
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
[
data
].
formula
[
indexID
].
value
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
[
5
]
==
"Cash at the beginning period"
)
{
let
valuezzz
=
dataTable2
[
indexDBCF
+
1
][
19
]
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
...
...
@@ -725,7 +746,12 @@ export default class BudgetTahunan extends Component {
let
indexID
=
forecast
.
findIndex
((
val
)
=>
String
(
val
.
item_formula
).
replace
(
'forecast_'
,
''
)
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
forecast
[
indexID
].
value
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
[
5
]
==
"Cash at the beginning period"
)
{
let
valuezzz
=
dataTable2
[
indexDBCF
+
1
][
20
]
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
...
...
@@ -738,7 +764,12 @@ export default class BudgetTahunan extends Component {
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
[
data
].
formula
[
indexID
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
[
5
]
==
"Cash at the beginning period"
&&
column
!=
7
)
{
let
valuezzz
=
dataTable2
[
indexDBCF
+
1
][
data
].
value
anjay
.
push
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
}
else
{
...
...
@@ -929,6 +960,14 @@ export default class BudgetTahunan extends Component {
}
})
// if(tableMeta[5] == '2.1 Additional fixed assets and CIP' && column == 7) {
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// }
total
=
R
.
equals
(
total
,
NaN
)
?
"0.0"
:
Number
(
total
).
toFixed
(
1
)
return
total
}
...
...
@@ -938,97 +977,179 @@ export default class BudgetTahunan extends Component {
let
dataTable2
=
this
.
state
.
dbCF
// let indexID = dataTable2.findIndex((val) => tableMeta[1] == val[1])
// if (indexID != -1) {
total
=
this
.
handleValueFormula
(
index
,
dataTable2
[
index
][
column
],
tableMeta
,
column
,
periode
,
dataTable2
[
index
][
25
])
total
=
this
.
handleValueFormula
(
index
,
dataTable2
[
index
][
column
],
tableMeta
,
column
,
periode
,
dataTable2
[
index
][
25
])
// }
return
total
}
olahDataCashFlow
(
dbCF
,
type
)
{
dbCF
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
dbCF
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
item
[
19
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)}
`
,
19
)
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
}
})
// console.log(dbCF)
this
.
setState
({
dbCF
},
()
=>
{
this
.
setState
({
dbCF
},
()
=>
{
this
.
payloadCF
(
type
)
})
}
payloadCF
(
type
)
{
let
listCF
=
[]
this
.
state
.
dbCF
.
map
((
item
,
index
)
=>
{
this
.
state
.
dbCF
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
item
[
19
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)}
`
,
19
)
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
}
listCF
.
push
(
item
)
})
this
.
payloadCFOneMore
(
listCF
,
type
)
}
payloadCFOneMore
(
list
,
type
)
{
let
listCF
=
[]
list
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
item
[
19
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)}
`
,
19
)
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
}
listCF
.
push
(
item
)
})
this
.
payloadCFOneMoreAgain
(
listCF
,
type
)
}
payloadCFOneMoreAgain
(
list
,
type
)
{
let
listCF
=
[]
list
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
item
[
19
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)}
`
,
19
)
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
}
listCF
.
push
(
item
)
})
this
.
olahDataCashFlowOneMore
(
listCF
,
type
)
}
olahDataCashFlowOneMore
(
list
,
type
)
{
console
.
log
(
list
)
let
listCF
=
[]
list
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
// if (item[7].value == "" || item[7].value == 0 || item[7].value == "0.0") {
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
item
[
7
].
value
=
this
.
handleValueFormula
(
index
,
item
[
7
],
item
,
7
)
// }
// if (item[8].value == "" || item[8].value == 0 || item[8].value == "0.0") {
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
item
[
8
].
value
=
this
.
handleValueFormula
(
index
,
item
[
8
],
item
,
8
)
// }
// if (item[9].value == "" || item[9].value == 0 || item[9].value == "0.0") {
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
item
[
9
].
value
=
this
.
handleValueFormula
(
index
,
item
[
9
],
item
,
9
)
// }
// if (item[10].value == "" || item[10].value == 0 || item[10].value == "0.0") {
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
item
[
10
].
value
=
this
.
handleValueFormula
(
index
,
item
[
10
],
item
,
10
)
// }
// if (item[11].value == "" || item[11].value == 0 || item[11].value == "0.0") {
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
item
[
11
].
value
=
this
.
handleValueFormula
(
index
,
item
[
11
],
item
,
11
)
// }
// if (item[12].value == "" || item[12].value == 0 || item[12].value == "0.0") {
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
item
[
12
].
value
=
this
.
handleValueFormula
(
index
,
item
[
12
],
item
,
12
)
// }
// if (item[13].value == "" || item[13].value == 0 || item[13].value == "0.0") {
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
item
[
13
].
value
=
this
.
handleValueFormula
(
index
,
item
[
13
],
item
,
13
)
// }
// if (item[14].value == "" || item[14].value == 0 || item[14].value == "0.0") {
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
item
[
14
].
value
=
this
.
handleValueFormula
(
index
,
item
[
14
],
item
,
14
)
// }
// if (item[15].value == "" || item[15].value == 0 || item[15].value == "0.0") {
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
item
[
15
].
value
=
this
.
handleValueFormula
(
index
,
item
[
15
],
item
,
15
)
// }
// if (item[16].value == "" || item[16].value == 0 || item[16].value == "0.0") {
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
item
[
16
].
value
=
this
.
handleValueFormula
(
index
,
item
[
16
],
item
,
16
)
// }
// if (item[17].value == "" || item[17].value == 0 || item[17].value == "0.0") {
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
item
[
17
].
value
=
this
.
handleValueFormula
(
index
,
item
[
17
],
item
,
17
)
// }
// if (item[18].value == "" || item[18].value == 0 || item[18].value == "0.0") {
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
item
[
18
].
value
=
this
.
handleValueFormula
(
index
,
item
[
18
],
item
,
18
)
// }
item
[
19
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)}
`
,
19
)
// if (item[20] == "" || item[20] == 0 || item[20] == "0.0") {
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
20
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
// }
// if (item[21] == "" || item[21] == 0 || item[21] == "0.0") {
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
item
[
21
]
=
this
.
handleForecast
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
// }
}
listCF
.
push
(
{
...
...
@@ -1036,21 +1157,21 @@ export default class BudgetTahunan extends Component {
"parent"
:
item
[
2
],
"formula"
:
String
(
item
[
3
]),
"item_name"
:
item
[
5
],
"january"
:
String
(
item
[
7
].
value
==
undefined
?
item
[
7
]
:
Number
(
item
[
7
].
value
).
toFixed
(
1
)),
"february"
:
String
(
item
[
8
].
value
==
undefined
?
item
[
8
]
:
Number
(
item
[
8
].
value
).
toFixed
(
1
)),
"march"
:
String
(
item
[
9
].
value
==
undefined
?
item
[
9
]
:
Number
(
item
[
9
].
value
).
toFixed
(
1
)),
"april"
:
String
(
item
[
10
].
value
==
undefined
?
item
[
10
]
:
Number
(
item
[
10
].
value
).
toFixed
(
1
)),
"may"
:
String
(
item
[
11
].
value
==
undefined
?
item
[
11
]
:
Number
(
item
[
11
].
value
).
toFixed
(
1
)),
"june"
:
String
(
item
[
12
].
value
==
undefined
?
item
[
12
]
:
Number
(
item
[
12
].
value
).
toFixed
(
1
)),
"july"
:
String
(
item
[
13
].
value
==
undefined
?
item
[
13
]
:
Number
(
item
[
13
].
value
).
toFixed
(
1
)),
"august"
:
String
(
item
[
14
].
value
==
undefined
?
item
[
14
]
:
Number
(
item
[
14
].
value
).
toFixed
(
1
)),
"september"
:
String
(
item
[
15
].
value
==
undefined
?
item
[
15
]
:
Number
(
item
[
15
].
value
).
toFixed
(
1
)),
"october"
:
String
(
item
[
16
].
value
==
undefined
?
item
[
16
]
:
Number
(
item
[
16
].
value
).
toFixed
(
1
)),
"november"
:
String
(
item
[
17
].
value
==
undefined
?
item
[
17
]
:
Number
(
item
[
17
].
value
).
toFixed
(
1
)),
"december"
:
String
(
item
[
18
].
value
==
undefined
?
item
[
18
]
:
Number
(
item
[
18
].
value
).
toFixed
(
1
)),
"total_current_year"
:
String
(
item
[
19
]),
"total_next_year"
:
String
(
item
[
20
]
!=
''
?
Number
(
item
[
20
]).
toFixed
(
1
)
:
item
[
20
]),
"total_more_year"
:
String
(
item
[
21
]
!=
''
?
Number
(
item
[
21
]).
toFixed
(
1
)
:
item
[
21
]),
"january"
:
String
(
item
[
7
].
value
==
undefined
?
item
[
7
]
:
Number
(
item
[
7
].
value
).
toFixed
(
1
)),
"february"
:
String
(
item
[
8
].
value
==
undefined
?
item
[
8
]
:
Number
(
item
[
8
].
value
).
toFixed
(
1
)),
"march"
:
String
(
item
[
9
].
value
==
undefined
?
item
[
9
]
:
Number
(
item
[
9
].
value
).
toFixed
(
1
)),
"april"
:
String
(
item
[
10
].
value
==
undefined
?
item
[
10
]
:
Number
(
item
[
10
].
value
).
toFixed
(
1
)),
"may"
:
String
(
item
[
11
].
value
==
undefined
?
item
[
11
]
:
Number
(
item
[
11
].
value
).
toFixed
(
1
)),
"june"
:
String
(
item
[
12
].
value
==
undefined
?
item
[
12
]
:
Number
(
item
[
12
].
value
).
toFixed
(
1
)),
"july"
:
String
(
item
[
13
].
value
==
undefined
?
item
[
13
]
:
Number
(
item
[
13
].
value
).
toFixed
(
1
)),
"august"
:
String
(
item
[
14
].
value
==
undefined
?
item
[
14
]
:
Number
(
item
[
14
].
value
).
toFixed
(
1
)),
"september"
:
String
(
item
[
15
].
value
==
undefined
?
item
[
15
]
:
Number
(
item
[
15
].
value
).
toFixed
(
1
)),
"october"
:
String
(
item
[
16
].
value
==
undefined
?
item
[
16
]
:
Number
(
item
[
16
].
value
).
toFixed
(
1
)),
"november"
:
String
(
item
[
17
].
value
==
undefined
?
item
[
17
]
:
Number
(
item
[
17
].
value
).
toFixed
(
1
)),
"december"
:
String
(
item
[
18
].
value
==
undefined
?
item
[
18
]
:
Number
(
item
[
18
].
value
).
toFixed
(
1
)),
"total_current_year"
:
String
(
item
[
19
]
!=
''
?
Number
(
item
[
19
]).
toFixed
(
1
)
:
item
[
19
]
),
"total_next_year"
:
String
(
item
[
20
]
!=
''
?
Number
(
item
[
20
]).
toFixed
(
1
)
:
item
[
20
]),
"total_more_year"
:
String
(
item
[
21
]
!=
''
?
Number
(
item
[
21
]).
toFixed
(
1
)
:
item
[
21
]),
"kpi_type"
:
""
,
"max_ach"
:
""
,
"pic"
:
""
,
...
...
@@ -1058,13 +1179,13 @@ export default class BudgetTahunan extends Component {
"total_actual_before"
:
""
,
"uom"
:
""
,
"weight"
:
""
}
}
)
})
//
console.log(listCF)
this
.
setState
({
dbCF
:
listCF
}
,
()
=>
{
console
.
log
(
listCF
)
this
.
setState
({
dbCF
:
listCF
}
,
()
=>
{
// if (this.state.submissionID != null) {
// this.createCashFlow()
// }
...
...
@@ -1089,7 +1210,7 @@ export default class BudgetTahunan extends Component {
console
.
log
(
this
.
state
.
dbCF
)
console
.
log
(
JSON
.
stringify
(
payload
))
api
.
create
().
createReportCF
(
payload
).
then
((
res
)
=>
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
console
.
log
(
res
)
// if (response.data) {
// if (response.data.status === "success") {
...
...
@@ -1118,7 +1239,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
getPLID
(
payloadID
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
)
{
PLID
=
response
.
data
.
data
==
null
?
null
:
response
.
data
.
data
.
profit_loss_id
PLID
=
response
.
data
.
data
==
null
?
null
:
response
.
data
.
data
.
profit_loss_id
}
else
{
PLID
=
null
}
...
...
@@ -1169,7 +1290,7 @@ export default class BudgetTahunan extends Component {
item
.
profit_detail
.
forecast_formula
==
null
?
[]
:
item
.
profit_detail
.
forecast_formula
,
item
.
profit_detail
.
notes
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
...
...
@@ -1218,18 +1339,18 @@ export default class BudgetTahunan extends Component {
})
console
.
log
(
dataTable
)
this
.
setState
({
dbPL
:
dataTable
},
()
=>
{
this
.
olahDataPL
(
this
.
state
.
dbPL
,
type
)
this
.
olahDataPL
(
this
.
state
.
dbPL
,
type
)
})
}
else
{
this
.
setState
({
dbPL
:
[],
previewTable
:
false
,
previewDownload
:
false
})
}
})
})
})
}
handleValueFormulaDBPL
=
(
indexDBCF
,
value
,
tableMeta
,
column
,
periode
,
forecast
)
=>
{
...
...
@@ -1275,11 +1396,11 @@ export default class BudgetTahunan extends Component {
if
(
String
(
item
).
includes
(
'[M-1]'
))
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
data
=
column
==
7
?
18
:
column
-
1
let
period
=
data
==
18
?
Number
(
this
.
props
.
periode
)
-
1
:
this
.
props
.
periode
let
indexID
=
tableMeta
.
rowData
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
let
period
=
data
==
18
?
Number
(
this
.
state
.
periode
.
periode
)
-
1
:
this
.
state
.
periode
.
periode
let
indexID
=
tableMeta
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
.
rowData
[
data
].
formula
[
indexID
].
value
let
valuezz
=
tableMeta
[
data
].
formula
[
indexID
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
else
{
...
...
@@ -1333,7 +1454,7 @@ export default class BudgetTahunan extends Component {
}
}
})
let
total
=
0
let
opt
=
""
let
totalPrio
=
0
...
...
@@ -1364,7 +1485,7 @@ export default class BudgetTahunan extends Component {
totalPrio
+=
Number
(
items
)
}
}
})
})
if
(
index
==
anjay2
.
length
-
1
)
{
if
(
opt
==
"tambah"
)
{
...
...
@@ -1451,25 +1572,25 @@ export default class BudgetTahunan extends Component {
}
olahDataPL
(
dbPL
,
type
)
{
dbPL
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
18
],
item
,
18
)
dbPL
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
item
[
7
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
7
],
item
,
7
)
item
[
8
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
8
],
item
,
8
)
item
[
9
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
9
],
item
,
9
)
item
[
10
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
10
],
item
,
10
)
item
[
11
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
11
],
item
,
11
)
item
[
12
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
12
],
item
,
12
)
item
[
13
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
13
],
item
,
13
)
item
[
14
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
14
],
item
,
14
)
item
[
15
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
15
],
item
,
15
)
item
[
16
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
16
],
item
,
16
)
item
[
17
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
17
],
item
,
17
)
item
[
18
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
18
],
item
,
18
)
item
[
20
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
21
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
}
})
this
.
setState
({
dbPL
},
()
=>
{
this
.
setState
({
dbPL
},
()
=>
{
this
.
payloadPL
(
type
)
})
}
...
...
@@ -1477,92 +1598,92 @@ export default class BudgetTahunan extends Component {
payloadPL
(
type
)
{
let
listPL
=
[]
// console.log(this.state.dbPL)
this
.
state
.
dbPL
.
map
((
item
,
index
)
=>
{
this
.
state
.
dbPL
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
==
5
||
item
[
0
]
==
6
||
item
[
0
]
==
7
)
{
// if (item[7].value == "" || item[7].value == 0 || item[7].value == "0.0") {
item
[
7
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
7
],
item
,
7
)
item
[
7
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
7
],
item
,
7
)
// }
// if (item[8].value == "" || item[8].value == 0 || item[8].value == "0.0") {
item
[
8
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
8
],
item
,
8
)
item
[
8
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
8
],
item
,
8
)
// }
// if (item[9].value == "" || item[9].value == 0 || item[9].value == "0.0") {
item
[
9
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
9
],
item
,
9
)
item
[
9
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
9
],
item
,
9
)
// }
// if (item[10].value == "" || item[10].value == 0 || item[10].value == "0.0") {
item
[
10
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
10
],
item
,
10
)
item
[
10
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
10
],
item
,
10
)
// }
// if (item[11].value == "" || item[11].value == 0 || item[11].value == "0.0") {
item
[
11
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
11
],
item
,
11
)
item
[
11
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
11
],
item
,
11
)
// }
// if (item[12].value == "" || item[12].value == 0 || item[12].value == "0.0") {
item
[
12
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
12
],
item
,
12
)
item
[
12
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
12
],
item
,
12
)
// }
// if (item[13].value == "" || item[13].value == 0 || item[13].value == "0.0") {
item
[
13
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
13
],
item
,
13
)
item
[
13
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
13
],
item
,
13
)
// }
// if (item[14].value == "" || item[14].value == 0 || item[14].value == "0.0") {
item
[
14
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
14
],
item
,
14
)
item
[
14
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
14
],
item
,
14
)
// }
// if (item[15].value == "" || item[15].value == 0 || item[15].value == "0.0") {
item
[
15
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
15
],
item
,
15
)
item
[
15
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
15
],
item
,
15
)
// }
// if (item[16].value == "" || item[16].value == 0 || item[16].value == "0.0") {
item
[
16
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
16
],
item
,
16
)
item
[
16
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
16
],
item
,
16
)
// }
// if (item[17].value == "" || item[17].value == 0 || item[17].value == "0.0") {
item
[
17
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
17
],
item
,
17
)
item
[
17
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
17
],
item
,
17
)
// }
// if (item[18].value == "" || item[18].value == 0 || item[18].value == "0.0") {
item
[
18
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
18
],
item
,
18
)
item
[
18
].
value
=
this
.
handleValueFormulaDBPL
(
index
,
item
[
18
],
item
,
18
)
// }
// if (item[20] == "" || item[20] == 0 || item[20] == "0.0") {
item
[
20
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
item
[
20
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
1
}
`
,
20
)
// }
// if (item[21] == "" || item[21] == 0 || item[21] == "0.0") {
item
[
21
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
item
[
21
]
=
this
.
handleForecastDBPL
(
index
,
item
,
`
${
Number
(
this
.
state
.
periode
.
periode
)
+
2
}
`
,
21
)
// }
}
listPL
.
push
(
{
"item_report_id"
:
item
[
1
],
"january"
:
String
(
item
[
7
].
value
==
undefined
?
item
[
7
]
:
Number
(
item
[
7
].
value
).
toFixed
(
1
)),
"february"
:
String
(
item
[
8
].
value
==
undefined
?
item
[
8
]
:
Number
(
item
[
8
].
value
).
toFixed
(
1
)),
"march"
:
String
(
item
[
9
].
value
==
undefined
?
item
[
9
]
:
Number
(
item
[
9
].
value
).
toFixed
(
1
)),
"april"
:
String
(
item
[
10
].
value
==
undefined
?
item
[
10
]
:
Number
(
item
[
10
].
value
).
toFixed
(
1
)),
"may"
:
String
(
item
[
11
].
value
==
undefined
?
item
[
11
]
:
Number
(
item
[
11
].
value
).
toFixed
(
1
)),
"june"
:
String
(
item
[
12
].
value
==
undefined
?
item
[
12
]
:
Number
(
item
[
12
].
value
).
toFixed
(
1
)),
"july"
:
String
(
item
[
13
].
value
==
undefined
?
item
[
13
]
:
Number
(
item
[
13
].
value
).
toFixed
(
1
)),
"august"
:
String
(
item
[
14
].
value
==
undefined
?
item
[
14
]
:
Number
(
item
[
14
].
value
).
toFixed
(
1
)),
"september"
:
String
(
item
[
15
].
value
==
undefined
?
item
[
15
]
:
Number
(
item
[
15
].
value
).
toFixed
(
1
)),
"october"
:
String
(
item
[
16
].
value
==
undefined
?
item
[
16
]
:
Number
(
item
[
16
].
value
).
toFixed
(
1
)),
"november"
:
String
(
item
[
17
].
value
==
undefined
?
item
[
17
]
:
Number
(
item
[
17
].
value
).
toFixed
(
1
)),
"december"
:
String
(
item
[
18
].
value
==
undefined
?
item
[
18
]
:
Number
(
item
[
18
].
value
).
toFixed
(
1
)),
"january"
:
String
(
item
[
7
].
value
==
undefined
?
item
[
7
]
:
Number
(
item
[
7
].
value
).
toFixed
(
1
)),
"february"
:
String
(
item
[
8
].
value
==
undefined
?
item
[
8
]
:
Number
(
item
[
8
].
value
).
toFixed
(
1
)),
"march"
:
String
(
item
[
9
].
value
==
undefined
?
item
[
9
]
:
Number
(
item
[
9
].
value
).
toFixed
(
1
)),
"april"
:
String
(
item
[
10
].
value
==
undefined
?
item
[
10
]
:
Number
(
item
[
10
].
value
).
toFixed
(
1
)),
"may"
:
String
(
item
[
11
].
value
==
undefined
?
item
[
11
]
:
Number
(
item
[
11
].
value
).
toFixed
(
1
)),
"june"
:
String
(
item
[
12
].
value
==
undefined
?
item
[
12
]
:
Number
(
item
[
12
].
value
).
toFixed
(
1
)),
"july"
:
String
(
item
[
13
].
value
==
undefined
?
item
[
13
]
:
Number
(
item
[
13
].
value
).
toFixed
(
1
)),
"august"
:
String
(
item
[
14
].
value
==
undefined
?
item
[
14
]
:
Number
(
item
[
14
].
value
).
toFixed
(
1
)),
"september"
:
String
(
item
[
15
].
value
==
undefined
?
item
[
15
]
:
Number
(
item
[
15
].
value
).
toFixed
(
1
)),
"october"
:
String
(
item
[
16
].
value
==
undefined
?
item
[
16
]
:
Number
(
item
[
16
].
value
).
toFixed
(
1
)),
"november"
:
String
(
item
[
17
].
value
==
undefined
?
item
[
17
]
:
Number
(
item
[
17
].
value
).
toFixed
(
1
)),
"december"
:
String
(
item
[
18
].
value
==
undefined
?
item
[
18
]
:
Number
(
item
[
18
].
value
).
toFixed
(
1
)),
"total_current_year"
:
String
(
item
[
19
]),
"total_next_year"
:
String
(
item
[
20
]
!=
''
?
Number
(
item
[
20
]).
toFixed
(
1
)
:
item
[
20
]),
"total_more_year"
:
String
(
item
[
21
]
!=
''
?
Number
(
item
[
21
]).
toFixed
(
1
)
:
item
[
21
]),
"total_next_year"
:
String
(
item
[
20
]
!=
''
?
Number
(
item
[
20
]).
toFixed
(
1
)
:
item
[
20
]),
"total_more_year"
:
String
(
item
[
21
]
!=
''
?
Number
(
item
[
21
]).
toFixed
(
1
)
:
item
[
21
]),
"notes"
:
String
(
item
[
26
]),
}
}
)
})
// console.log(listPL)
this
.
setState
({
dbPL
:
listPL
}
,
()
=>
{
this
.
setState
({
dbPL
:
listPL
}
,
()
=>
{
// if (this.state.submissionID != null) {
// this.createDBPL()
// }
...
...
@@ -1590,7 +1711,7 @@ export default class BudgetTahunan extends Component {
console
.
log
(
JSON
.
stringify
(
payload
))
api
.
create
().
createReportPLMB
(
payload
).
then
((
res
)
=>
{
console
.
log
(
res
)
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
// if (response.data) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport()
...
...
@@ -1618,7 +1739,7 @@ export default class BudgetTahunan extends Component {
api
.
create
().
getFRID
(
payloadID
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
)
{
FRID
=
response
.
data
.
data
==
null
?
null
:
response
.
data
.
data
.
ratio_id
FRID
=
response
.
data
.
data
==
null
?
null
:
response
.
data
.
data
.
ratio_id
}
else
{
FRID
=
null
}
...
...
@@ -1666,7 +1787,7 @@ export default class BudgetTahunan extends Component {
Number
(
item
.
ratio
.
total_next_year
).
toFixed
(
2
),
Number
(
item
.
ratio
.
total_more_year
).
toFixed
(
2
),
])
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
...
...
@@ -1711,18 +1832,18 @@ export default class BudgetTahunan extends Component {
})
this
.
setState
({
dbFR
:
dataTable
,
loading
:
false
},
()
=>
{
console
.
log
(
this
.
state
.
dbFR
)
this
.
olahDataFR
(
this
.
state
.
dbFR
,
type
)
this
.
olahDataFR
(
this
.
state
.
dbFR
,
type
)
})
}
else
{
this
.
setState
({
dbFR
:
[],
previewTable
:
false
,
loading
:
false
,
previewDownload
:
false
})
}
})
})
})
}
handleFormulaRatio
=
(
value
,
tableMeta
,
month
)
=>
{
...
...
@@ -1736,7 +1857,7 @@ export default class BudgetTahunan extends Component {
total
+=
Number
(
dataTable2
[
35
][
7
+
index
])
// console.log(index);
}
total
=
total
/
month
total
=
total
/
month
}
let
hasil
=
Number
(
value
)
/
total
// console.log(value)
...
...
@@ -1747,28 +1868,28 @@ export default class BudgetTahunan extends Component {
olahDataFR
(
dbFR
,
type
)
{
// let totalCY = 0
dbFR
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!=
4
||
item
[
0
]
!=
1
)
{
if
(
item
[
5
]
===
"Return on Invested Capital - YTD (ROIC)"
)
{
item
[
7
]
=
this
.
handleFormulaRatio
(
item
[
7
],
item
,
1
)
item
[
8
]
=
this
.
handleFormulaRatio
(
item
[
8
],
item
,
2
)
item
[
9
]
=
this
.
handleFormulaRatio
(
item
[
9
],
item
,
3
)
item
[
10
]
=
this
.
handleFormulaRatio
(
item
[
10
],
item
,
4
)
item
[
11
]
=
this
.
handleFormulaRatio
(
item
[
11
],
item
,
5
)
item
[
12
]
=
this
.
handleFormulaRatio
(
item
[
12
],
item
,
6
)
item
[
13
]
=
this
.
handleFormulaRatio
(
item
[
13
],
item
,
7
)
item
[
14
]
=
this
.
handleFormulaRatio
(
item
[
14
],
item
,
8
)
item
[
15
]
=
this
.
handleFormulaRatio
(
item
[
15
],
item
,
9
)
item
[
16
]
=
this
.
handleFormulaRatio
(
item
[
16
],
item
,
10
)
item
[
17
]
=
this
.
handleFormulaRatio
(
item
[
17
],
item
,
11
)
item
[
18
]
=
this
.
handleFormulaRatio
(
item
[
18
],
item
,
12
)
item
[
19
]
=
this
.
handleFormulaRatio
(
item
[
19
],
item
,
13
)
item
[
20
]
=
this
.
handleFormulaRatio
(
item
[
20
],
item
,
14
)
dbFR
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!=
4
||
item
[
0
]
!=
1
)
{
if
(
item
[
5
]
===
"Return on Invested Capital - YTD (ROIC)"
)
{
item
[
7
]
=
this
.
handleFormulaRatio
(
item
[
7
],
item
,
1
)
item
[
8
]
=
this
.
handleFormulaRatio
(
item
[
8
],
item
,
2
)
item
[
9
]
=
this
.
handleFormulaRatio
(
item
[
9
],
item
,
3
)
item
[
10
]
=
this
.
handleFormulaRatio
(
item
[
10
],
item
,
4
)
item
[
11
]
=
this
.
handleFormulaRatio
(
item
[
11
],
item
,
5
)
item
[
12
]
=
this
.
handleFormulaRatio
(
item
[
12
],
item
,
6
)
item
[
13
]
=
this
.
handleFormulaRatio
(
item
[
13
],
item
,
7
)
item
[
14
]
=
this
.
handleFormulaRatio
(
item
[
14
],
item
,
8
)
item
[
15
]
=
this
.
handleFormulaRatio
(
item
[
15
],
item
,
9
)
item
[
16
]
=
this
.
handleFormulaRatio
(
item
[
16
],
item
,
10
)
item
[
17
]
=
this
.
handleFormulaRatio
(
item
[
17
],
item
,
11
)
item
[
18
]
=
this
.
handleFormulaRatio
(
item
[
18
],
item
,
12
)
item
[
19
]
=
this
.
handleFormulaRatio
(
item
[
19
],
item
,
13
)
item
[
20
]
=
this
.
handleFormulaRatio
(
item
[
20
],
item
,
14
)
// totalCY = Number(item[7]) + Number(item[8]) + Number(item[9]) + Number(item[10]) + Number(item[11]) + Number(item[12]) + Number(item[13]) + Number(item[14]) + Number(item[15]) + Number(item[16]) + Number(item[17]) + Number(item[18])
}
}
}
})
this
.
setState
({
dbFR
},
()
=>
{
this
.
setState
({
dbFR
},
()
=>
{
this
.
payloadFR
(
type
)
})
}
...
...
@@ -1777,9 +1898,9 @@ export default class BudgetTahunan extends Component {
let
listFR
=
[]
// console.log(this.state.dbFR)
let
totalCY
=
0
this
.
state
.
dbFR
.
map
((
item
,
index
)
=>
{
this
.
state
.
dbFR
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!=
4
||
item
[
0
]
!=
1
)
{
if
(
item
[
5
]
===
"Return on Invested Capital - YTD (ROIC)"
)
{
if
(
item
[
5
]
===
"Return on Invested Capital - YTD (ROIC)"
)
{
// item[7] = this.handleFormulaRatio(item[7],item,1)
// item[8] = this.handleFormulaRatio(item[8],item,2)
// item[9] = this.handleFormulaRatio(item[9],item,3)
...
...
@@ -1794,36 +1915,36 @@ export default class BudgetTahunan extends Component {
// item[18] = this.handleFormulaRatio(item[18],item,12)
// item[19] = this.handleFormulaRatio(item[19],item,13)
// item[20] = this.handleFormulaRatio(item[20],item,14)
}
}
totalCY
=
Number
(
item
[
7
])
+
Number
(
item
[
8
])
+
Number
(
item
[
9
])
+
Number
(
item
[
10
])
+
Number
(
item
[
11
])
+
Number
(
item
[
12
])
+
Number
(
item
[
13
])
+
Number
(
item
[
14
])
+
Number
(
item
[
15
])
+
Number
(
item
[
16
])
+
Number
(
item
[
17
])
+
Number
(
item
[
18
])
}
listFR
.
push
(
{
"item_report_id"
:
item
[
1
],
"january"
:
String
(
item
[
7
]
==
undefined
||
item
[
7
]
==
'Infinity'
||
item
[
7
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
7
]).
toFixed
(
2
)),
"february"
:
String
(
item
[
8
]
==
undefined
||
item
[
8
]
==
'Infinity'
||
item
[
8
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
8
]).
toFixed
(
2
)),
"march"
:
String
(
item
[
9
]
==
undefined
||
item
[
9
]
==
'Infinity'
||
item
[
9
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
9
]).
toFixed
(
2
)),
"april"
:
String
(
item
[
10
]
==
undefined
||
item
[
10
]
==
'Infinity'
||
item
[
10
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
10
]).
toFixed
(
2
)),
"may"
:
String
(
item
[
11
]
==
undefined
||
item
[
11
]
==
'Infinity'
||
item
[
11
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
11
]).
toFixed
(
2
)),
"june"
:
String
(
item
[
12
]
==
undefined
||
item
[
12
]
==
'Infinity'
||
item
[
12
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
12
]).
toFixed
(
2
)),
"july"
:
String
(
item
[
13
]
==
undefined
||
item
[
13
]
==
'Infinity'
||
item
[
13
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
13
]).
toFixed
(
2
)),
"august"
:
String
(
item
[
14
]
==
undefined
||
item
[
14
]
==
'Infinity'
||
item
[
14
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
14
]).
toFixed
(
2
)),
"september"
:
String
(
item
[
15
]
==
undefined
||
item
[
15
]
==
'Infinity'
||
item
[
15
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
15
]).
toFixed
(
2
)),
"october"
:
String
(
item
[
16
]
==
undefined
||
item
[
16
]
==
'Infinity'
||
item
[
16
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
16
]).
toFixed
(
2
)),
"november"
:
String
(
item
[
17
]
==
undefined
||
item
[
17
]
==
'Infinity'
||
item
[
17
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
17
]).
toFixed
(
2
)),
"december"
:
String
(
item
[
18
]
==
undefined
||
item
[
18
]
==
'Infinity'
||
item
[
18
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
18
]).
toFixed
(
2
)),
"total_current_year"
:
String
(
totalCY
==
undefined
||
totalCY
==
'Infinity'
||
totalCY
==
'-Infinity'
?
"0.0"
:
Number
(
totalCY
).
toFixed
(
2
)),
"total_next_year"
:
String
(
item
[
19
]
!=
''
||
item
[
19
]
!=
'Infinity'
||
item
[
19
]
!=
'-Infinity'
?
Number
(
item
[
19
]).
toFixed
(
2
)
:
item
[
19
]),
"total_more_year"
:
String
(
item
[
20
]
!=
''
||
item
[
20
]
!=
'Infinity'
||
item
[
20
]
!=
'-Infinity'
?
Number
(
item
[
20
]).
toFixed
(
2
)
:
item
[
20
]),
}
"january"
:
String
(
item
[
7
]
==
undefined
||
item
[
7
]
==
'Infinity'
||
item
[
7
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
7
]).
toFixed
(
2
)),
"february"
:
String
(
item
[
8
]
==
undefined
||
item
[
8
]
==
'Infinity'
||
item
[
8
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
8
]).
toFixed
(
2
)),
"march"
:
String
(
item
[
9
]
==
undefined
||
item
[
9
]
==
'Infinity'
||
item
[
9
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
9
]).
toFixed
(
2
)),
"april"
:
String
(
item
[
10
]
==
undefined
||
item
[
10
]
==
'Infinity'
||
item
[
10
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
10
]).
toFixed
(
2
)),
"may"
:
String
(
item
[
11
]
==
undefined
||
item
[
11
]
==
'Infinity'
||
item
[
11
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
11
]).
toFixed
(
2
)),
"june"
:
String
(
item
[
12
]
==
undefined
||
item
[
12
]
==
'Infinity'
||
item
[
12
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
12
]).
toFixed
(
2
)),
"july"
:
String
(
item
[
13
]
==
undefined
||
item
[
13
]
==
'Infinity'
||
item
[
13
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
13
]).
toFixed
(
2
)),
"august"
:
String
(
item
[
14
]
==
undefined
||
item
[
14
]
==
'Infinity'
||
item
[
14
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
14
]).
toFixed
(
2
)),
"september"
:
String
(
item
[
15
]
==
undefined
||
item
[
15
]
==
'Infinity'
||
item
[
15
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
15
]).
toFixed
(
2
)),
"october"
:
String
(
item
[
16
]
==
undefined
||
item
[
16
]
==
'Infinity'
||
item
[
16
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
16
]).
toFixed
(
2
)),
"november"
:
String
(
item
[
17
]
==
undefined
||
item
[
17
]
==
'Infinity'
||
item
[
17
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
17
]).
toFixed
(
2
)),
"december"
:
String
(
item
[
18
]
==
undefined
||
item
[
18
]
==
'Infinity'
||
item
[
18
]
==
'-Infinity'
?
"0.0"
:
Number
(
item
[
18
]).
toFixed
(
2
)),
"total_current_year"
:
String
(
totalCY
==
undefined
||
totalCY
==
'Infinity'
||
totalCY
==
'-Infinity'
?
"0.0"
:
Number
(
totalCY
).
toFixed
(
2
)),
"total_next_year"
:
String
(
item
[
19
]
!=
''
||
item
[
19
]
!=
'Infinity'
||
item
[
19
]
!=
'-Infinity'
?
Number
(
item
[
19
]).
toFixed
(
2
)
:
item
[
19
]),
"total_more_year"
:
String
(
item
[
20
]
!=
''
||
item
[
20
]
!=
'Infinity'
||
item
[
20
]
!=
'-Infinity'
?
Number
(
item
[
20
]).
toFixed
(
2
)
:
item
[
20
]),
}
)
})
console
.
log
(
listFR
)
console
.
log
(
'subOD'
,
this
.
state
.
submissionID
)
this
.
setState
({
dbFR
:
listFR
}
,
()
=>
{
console
.
log
(
'subOD'
,
this
.
state
.
submissionID
)
this
.
setState
({
dbFR
:
listFR
}
,
()
=>
{
if
(
this
.
state
.
submissionID
!=
null
)
{
this
.
createDBFR
()
}
...
...
@@ -1874,7 +1995,7 @@ export default class BudgetTahunan extends Component {
let
indexC
=
String
(
item
.
status_approval
).
toLocaleUpperCase
().
indexOf
(
'C'
)
let
status_approv
=
''
if
(
String
(
item
.
status_approval
).
toLocaleUpperCase
().
includes
(
'CC'
))
{
status_approv
=
`
${
String
(
item
.
status_approval
).
substr
(
0
,
indexC
)}${
String
(
item
.
status_approval
).
substr
(
indexC
+
1
,
String
(
item
.
status_approval
).
length
)}
`
status_approv
=
`
${
String
(
item
.
status_approval
).
substr
(
0
,
indexC
)}${
String
(
item
.
status_approval
).
substr
(
indexC
+
1
,
String
(
item
.
status_approval
).
length
)}
`
}
else
{
status_approv
=
String
(
item
.
status_approval
)
}
...
...
@@ -1938,7 +2059,7 @@ export default class BudgetTahunan extends Component {
this
.
setState
({
prevRevision
:
false
})
}
}
if
(
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"profit loss"
||
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"balance sheet"
||
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"fixed assets movement"
)
{
if
(
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"profit loss"
||
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"balance sheet"
||
String
(
i
.
report_name
).
toLocaleLowerCase
()
==
"fixed assets movement"
)
{
if
(
String
(
i
.
current_status
).
toLocaleLowerCase
()
==
"submitted"
)
{
PLBSFAMSubmitted
+=
1
}
...
...
@@ -2008,7 +2129,7 @@ export default class BudgetTahunan extends Component {
visibleFAM
:
false
,
visibleTP
:
false
,
visibleCF
:
true
,
PLBSFAMSubmitted
:
PLBSFAMSubmitted
==
3
?
true
:
false
PLBSFAMSubmitted
:
PLBSFAMSubmitted
==
3
?
true
:
false
})
}
})
...
...
@@ -2064,7 +2185,7 @@ export default class BudgetTahunan extends Component {
this
.
setState
({
alert
:
false
})
}
saveToMasterBudget
(
data
,
type
)
{
saveToMasterBudget
(
data
,
type
)
{
this
.
setState
({
loading
:
true
},
()
=>
{
document
.
body
.
style
.
overflow
=
'hidden'
;
})
...
...
@@ -2077,15 +2198,15 @@ export default class BudgetTahunan extends Component {
this
.
getSubmission
(
type
)
}
else
{
// this.setState({ loading: false }, () => {
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
// })
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
loading
:
false
},
()
=>
{
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
})
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
'Error saving data. Please try again'
,
tipeAlert
:
'error'
,
loading
:
false
},
()
=>
{
...
...
src/container/BudgetTahunan/CashFlow.js
View file @
73ba4332
...
...
@@ -47,6 +47,7 @@ export default class CashFlow extends Component {
componentDidMount
()
{
this
.
setState
({
loading
:
true
})
console
.
log
(
this
.
props
.
PLBSFAMSubmitted
)
this
.
getSettingControl
()
}
...
...
@@ -264,7 +265,25 @@ export default class CashFlow extends Component {
}
})
console
.
log
(
dataTable
);
this
.
setState
({
dataTable
,
loading
:
false
,
dataReal
:
res
,
editable
:
true
})
this
.
setState
({
dataTable
,
loading
:
false
,
dataReal
:
res
,
editable
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
},
500
);
})
})
},
500
);
})
})
},
500
);
})
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
...
@@ -345,20 +364,37 @@ export default class CashFlow extends Component {
if
(
String
(
item
).
includes
(
'[M-1]'
))
{
if
(
forecast
!==
undefined
)
{
let
forecastt
=
0
if
(
column
==
19
)
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
data
=
18
let
period
=
this
.
props
.
periode
-
1
let
indexID
=
tableMeta
.
rowData
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
.
rowData
[
data
].
formula
[
indexID
].
value
if
(
tableMeta
.
rowData
[
5
]
==
"Cash at the beginning period"
)
{
// console.log(dataTable2[tableMeta.rowIndex+1])
// console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let
valuezzz
=
dataTable2
[
tableMeta
.
rowIndex
+
1
][
data
].
value
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
if
(
column
==
20
)
{
let
tst
=
String
(
item
).
replace
(
'[M-1]'
,
''
)
let
data
=
18
let
period
=
this
.
props
.
periode
let
indexID
=
tableMeta
.
rowData
[
data
].
formula
.
findIndex
((
val
)
=>
val
.
item_formula
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
tableMeta
.
rowData
[
5
]
==
"Cash at the end of the period"
)
{
console
.
log
(
tableMeta
.
rowData
[
18
]);
console
.
log
(
indexID
);
console
.
log
(
tst
);
console
.
log
(
period
);
}
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
.
rowData
[
data
].
formula
[
indexID
].
value
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
.
rowData
[
5
]
==
"Cash at the beginning period"
)
{
let
valuezzz
=
dataTable2
[
tableMeta
.
rowIndex
+
1
][
19
]
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
...
...
@@ -368,7 +404,12 @@ export default class CashFlow extends Component {
let
indexID
=
forecast
.
findIndex
((
val
)
=>
String
(
val
.
item_formula
).
replace
(
'forecast_'
,
''
)
==
String
(
`@
${
tst
}
`
)
&&
val
.
periode
==
period
)
if
(
indexID
!==
-
1
)
{
let
valuezz
=
forecast
[
indexID
].
value
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
.
rowData
[
5
]
==
"Cash at the beginning period"
)
{
let
valuezzz
=
dataTable2
[
tableMeta
.
rowIndex
+
1
][
20
]
forecastt
+=
Number
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
forecastt
+=
Number
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
...
...
@@ -381,7 +422,18 @@ export default class CashFlow extends Component {
if
(
indexID
!==
-
1
)
{
let
valuezz
=
tableMeta
.
rowData
[
data
].
formula
[
indexID
].
value
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
if
(
tableMeta
.
rowData
[
5
]
==
"Cash at the beginning period"
&&
column
!=
7
)
{
// console.log(data)
// console.log(dataTable2[tableMeta.rowIndex+1][5])
// console.log(dataTable2[tableMeta.rowIndex+1][data])
// console.log(dataTable2[tableMeta.rowIndex-1][data].value)
// console.log(dataTable2[tableMeta.rowIndex][data].value)
// console.log(dataTable2[tableMeta.rowIndex+1][data].value)
let
valuezzz
=
dataTable2
[
tableMeta
.
rowIndex
+
1
][
data
].
value
anjay
.
push
(
valuezzz
==
""
?
0
:
valuezzz
)
}
else
{
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
}
else
{
...
...
@@ -583,6 +635,13 @@ export default class CashFlow extends Component {
// // console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == "1.5 Other non-current assets") {
// if (forecast !== undefined) {
// if (column == 19) {
// console.log(splitFormula)
// console.log(baru)
// console.log(anjay)
// console.log(anjay2)
// console.log(total)
// }
// if (String(tableMeta.rowData[5]).toLocaleUpperCase() == "4.0 CASH FLOW MOVEMENT" && column == 7) {
// console.log(splitFormula)
// console.log(baru)
...
...
@@ -593,6 +652,14 @@ export default class CashFlow extends Component {
// }
// }
if
(
tableMeta
.
rowData
[
5
]
==
'2.1 Additional fixed assets and CIP'
&&
column
==
7
)
{
console
.
log
(
splitFormula
)
console
.
log
(
baru
)
console
.
log
(
anjay
)
console
.
log
(
anjay2
)
console
.
log
(
total
)
}
if
(
dataTable2
[
tableMeta
.
rowIndex
][
column
].
value
==
undefined
)
{
dataTable2
[
tableMeta
.
rowIndex
][
column
]
=
total
}
else
{
...
...
@@ -2724,6 +2791,87 @@ export default class CashFlow extends Component {
options
:
{
display
:
false
}
},
{
name
:
""
,
options
:
{
// display: false,
customHeadRender
:
(
columnMeta
)
=>
(
<
th
style
=
{{
...
style2
,
color
:
'#fff'
,
backgroundColor
:
'#07a7d0'
,
top
:
0
,
zIndex
:
102
,
fontSize
:
13
,
fontWeight
:
1
,
width
:
150
,
borderRight
:
"1px solid rgb(255, 255, 255)"
,
padding
:
0
}}
>
{
/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */
}
<
div
style
=
{{
borderBottom
:
"1px #fff solid"
,
backgroundColor
:
'#1c71b8'
,
textAlign
:
'center'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
padding
:
5
}}
>
{
columnMeta
.
name
}
<
/div
>
<
div
className
=
"grid grid-1x"
style
=
{{
...
style2
,
color
:
'#fff'
,
fontSize
:
12
,
fontWeight
:
'bold'
,
position
:
"sticky"
}}
>
<
div
className
=
"column-1"
style
=
{{
placeSelf
:
'center'
,
textAlign
:
'center'
,
padding
:
5
,
backgroundColor
:
'#07a7d0'
}}
>
<
span
>
{
"ForeCast"
}
<
/span
>
<
/div
>
<
/div
>
<
/th
>
),
setCellProps
:
()
=>
({
style2
}),
customBodyRender
:
(
value
,
tableMeta
,
updateValue
)
=>
{
return
(
<
div
style
=
{{
textAlign
:
'right'
}}
>
{
tableMeta
.
rowData
[
0
]
===
4
||
tableMeta
.
rowData
[
0
]
===
1
?
null
:
tableMeta
.
rowData
[
0
]
===
7
?
(
Number
(
handleForecast
(
tableMeta
,
`
${
Number
(
this
.
props
.
periode
)}
`
,
19
)).
toFixed
(
1
)
>=
Number
(
this
.
state
.
minValue
)
&&
Number
(
handleForecast
(
tableMeta
,
`
${
Number
(
this
.
props
.
periode
)}
`
,
19
)).
toFixed
(
1
)
<=
Number
(
this
.
state
.
maxValue
))
?
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
color
:
'black'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleForecast
(
tableMeta
,
`
${
Number
(
this
.
props
.
periode
)}
`
,
19
)).
toFixed
(
1
)}
/>
:
<
LightTooltip
title
=
{
this
.
state
.
minValue
===
null
?
`Value Should be
${
tableMeta
.
rowData
[
23
]}
`
:
`Value Should be (
${
this
.
state
.
minValue
}
) up to (
${
this
.
state
.
maxValue
}
)`
}
arrow
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
,
color
:
'red'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleForecast
(
tableMeta
,
`
${
Number
(
this
.
props
.
periode
)}
`
,
19
)).
toFixed
(
1
)}
/
>
<
/LightTooltip
>
:
<
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
=
""
disabled
=
{
true
}
value
=
{
Number
(
handleForecast
(
tableMeta
,
`
${
Number
(
this
.
props
.
periode
)}
`
,
19
)).
toFixed
(
1
)}
/
>
}
/
>
<
/div>
}
<
/div
>
)
}
}
},
{
name
:
`
${
Number
(
this
.
props
.
periode
)
+
1
}
`
,
options
:
{
...
...
@@ -2804,8 +2952,7 @@ export default class CashFlow extends Component {
)
}
}
},
{
},
{
name
:
`
${
Number
(
this
.
props
.
periode
)
+
2
}
`
,
options
:
{
customHeadRender
:
(
columnMeta
)
=>
(
...
...
src/container/Laporan/DashboardCAT.js
View file @
73ba4332
...
...
@@ -232,15 +232,19 @@ export default class DashboardCAT extends Component {
getDasboardCAT
()
{
let
payload
=
{
"company_id"
:
this
.
state
.
company
.
company_id
,
"year"
:
this
.
state
.
periode
.
periode
"periode"
:
this
.
state
.
periode
.
periode
,
"months"
:
this
.
state
.
month
.
month_id
}
let
dataDashboard
=
[]
api
.
create
().
getDashboardCAT
(
payload
).
then
((
res
)
=>
{
if
(
res
.
data
.
status
==
'success'
)
{
console
.
log
(
res
)
this
.
setState
({
loading
:
false
,
dataDashboard
:
res
.
data
.
data
})
}
else
{
this
.
setState
({
loading
:
false
})
}
// let resp = res.data.data
this
.
setState
({
loading
:
false
,
dataDashboard
:
res
.
data
.
data
})
}
// else {
// this.setState({loading: false})
// }
// conole.log(JSON.stringify(payload))
})
}
...
...
@@ -332,7 +336,7 @@ export default class DashboardCAT extends Component {
<
/div
>
<
/div
>
{
!
this
.
state
.
loading
&&
this
.
state
.
dataDashboard
.
length
>
0
&&
<
div
className
=
"padding-20px"
style
=
{{
display
:
'flex'
}}
>
{
!
this
.
state
.
loading
&&
<
div
className
=
"padding-20px"
style
=
{{
display
:
'flex'
}}
>
<
Paper
style
=
{{
marginTop
:
10
,
}}
>
<
AppBar
position
=
"static"
style
=
{{
borderTopRightRadius
:
10
,
borderTopLeftRadius
:
10
}}
>
<
Tabs
indicatorColor
=
"primary"
value
=
{
this
.
state
.
tab
}
onChange
=
{
this
.
selectTab
}
aria
-
label
=
"simple tabs example"
style
=
{{
backgroundColor
:
'#354960'
,
borderColor
:
'transparent'
,
borderTopRightRadius
:
10
,
borderTopLeftRadius
:
10
}}
>
...
...
src/container/Laporan/ExceutiveScoreboard.js
View file @
73ba4332
...
...
@@ -3,6 +3,9 @@ import ReactSpeedometer from "react-d3-speedometer"
import
{
GridList
,
Paper
,
Typography
,
GridListTile
}
from
'@material-ui/core'
import
Images
from
'../../assets/Images'
import
LineChart
from
'react-linechart'
;
import
{
titleCase
}
from
'../../library/Utils'
;
import
NumberFormat
from
'react-number-format'
;
import
{
tr
}
from
'date-fns/locale'
;
export
default
class
ExceutiveScoreboard
extends
Component
{
constructor
(
props
)
{
...
...
@@ -15,17 +18,23 @@ export default class ExceutiveScoreboard extends Component {
{
judul
:
"Internal Perspective"
,
kpi
:
5
,
rank
:
'C'
,
value
:
2.61
,
status
:
'down'
},
{
judul
:
"Financial"
,
kpi
:
5
,
rank
:
'B+'
,
value
:
3.52
,
status
:
'up'
},
],
data
:
this
.
props
.
data
,
arraySpeedo
:
[],
data
:
[],
newData
:
[],
dataPayload
:
this
.
props
.
dataPayload
,
selectIndex
:
null
selectIndex
:
null
,
loading
:
false
}
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
)
// console.log(
)
console
.
log
(
this
.
state
.
dataPayload
)
let
arrOverAll
=
[]
let
newData
=
[]
let
totalOverAll
=
0
this
.
setState
({
loading
:
true
})
this
.
olahDataChart
()
if
(
this
.
state
.
data
.
length
>
0
)
{
this
.
state
.
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
parent
==
null
||
item
.
parent
==
'null'
)
{
...
...
@@ -45,7 +54,6 @@ export default class ExceutiveScoreboard extends Component {
this
.
state
.
dataPayload
.
month
.
month_id
==
11
?
Number
(
item
.
month11
==
null
?
0
:
item
.
month11
)
:
Number
(
item
.
month12
==
null
?
0
:
item
.
month12
)
}
})
let
indexFinancial
=
arrOverAll
.
findIndex
((
val
)
=>
String
(
val
.
item_name
).
toLocaleLowerCase
().
includes
(
'financial'
))
...
...
@@ -88,6 +96,106 @@ export default class ExceutiveScoreboard extends Component {
}
olahDataChart
()
{
let
arrayChart
=
[]
this
.
state
.
data
.
map
((
item
,
index
)
=>
{
let
arrayChildChart
=
[]
// if (item.parent != null) {
item
.
month
.
map
((
items
,
indexs
)
=>
{
arrayChildChart
.
push
({
x
:
indexs
,
y
:
items
.
value
==
null
?
indexs
:
items
.
value
})
})
arrayChart
.
push
({
...
item
,
arrayChildChart
:
[{
color
:
"steelblue"
,
points
:
arrayChildChart
}]
})
// } else {
// arrayChart.push(item)
// }
})
console
.
log
(
arrayChart
)
let
arrayDataParent
=
arrayChart
.
filter
((
val
)
=>
val
.
parent
==
null
||
val
.
parent
==
'null'
)
let
arrayDataChild
=
arrayChart
.
filter
((
val
)
=>
val
.
parent
!=
null
||
val
.
parent
!=
'null'
)
let
arraySpeedo
=
[]
this
.
setState
({
newData
:
arrayChart
},
()
=>
{
arrayDataParent
.
map
((
item
,
index
)
=>
{
// console.log(arrayDataChild.filter((val) => val.parent == item.item_report_id))
if
(
index
==
0
)
{
arraySpeedo
.
push
({
company_id
:
item
.
company_id
,
decprev
:
item
.
decprev
,
id
:
99
,
item_name
:
"Overall"
,
item_report_id
:
9999
,
arrayChildChart
:
[],
child
:
arrayDataChild
,
month
:
item
.
month
})
}
arraySpeedo
.
push
({
...
item
,
child
:
arrayDataChild
.
filter
((
val
)
=>
val
.
parent
==
item
.
item_report_id
)
})
})
console
.
log
(
arraySpeedo
)
arraySpeedo
.
map
((
item
,
index
)
=>
{
if
(
item
.
id
!=
99
)
{
let
indexID
=
arraySpeedo
.
findIndex
((
val
)
=>
item
.
item_report_id
==
val
.
item_report_id
)
let
indexMonthIDParent
=
item
.
month
.
findIndex
((
val
)
=>
val
.
name
==
`month
${
this
.
state
.
dataPayload
.
month
.
month_id
}
`
)
let
total
=
0
item
.
child
.
map
((
items
,
indexs
)
=>
{
let
specMonth
=
items
.
month
.
filter
((
val
)
=>
val
.
name
==
`month
${
this
.
state
.
dataPayload
.
month
.
month_id
}
`
)
total
+=
Number
(
specMonth
[
0
].
value
)
})
arraySpeedo
[
indexID
].
month
[
indexMonthIDParent
].
value
=
total
}
})
let
totalOverAll
=
0
// arraySpeedo.map((item,index) => {
// let indexMonthIDParent = item.month.findIndex((val) => val.name == `month${this.state.dataPayload.month.month_id}`)
// if (item.id != 99) {
// totalOverAll += item.month[indexMonthIDParent].value
// }
// })
// let indexOverall = arraySpeedo.findIndex((val) => val.id == 99)
// let indexMonthIDParent = arraySpeedo[indexOverall].month.findIndex((val) => val.name == `month${this.state.dataPayload.month.month_id}`)
// arraySpeedo[indexOverall].month[indexMonthIDParent].value = totalOverAll
console
.
log
(
'skl'
,
totalOverAll
)
console
.
log
(
'part2'
,
arraySpeedo
)
this
.
setState
({
arraySpeedo
,
loading
:
false
})
// arraySpeedo.map((item,index) => {
// if (index == 0) {
// arraySpeedoNew.push(item)
// } else {
// arraySpeedoNew.push(item)
// }
// })
})
}
handleValueChild
(
item
)
{
let
data
=
this
.
state
.
newData
.
filter
((
val
)
=>
val
.
parent
!=
null
)
let
indexID
=
data
.
findIndex
((
val
)
=>
val
.
item_name
==
item
.
item_name
)
let
indexMonthID
=
data
[
indexID
].
month
.
findIndex
((
val
)
=>
val
.
name
==
`month
${
this
.
state
.
dataPayload
.
month
.
month_id
}
`
)
return
data
[
indexID
].
month
[
indexMonthID
].
value
==
null
?
0
:
data
[
indexID
].
month
[
indexMonthID
].
value
}
handleValueSpeedo
(
item
)
{
let
indexMonthID
=
item
.
month
.
findIndex
((
val
)
=>
val
.
name
==
`month
${
this
.
state
.
dataPayload
.
month
.
month_id
}
`
)
return
item
.
month
[
indexMonthID
].
value
}
render
()
{
let
{
selectIndex
}
=
this
.
state
...
...
@@ -109,15 +217,15 @@ export default class ExceutiveScoreboard extends Component {
return
(
<
div
style
=
{{
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
width
:
'100%'
,
justifyContent
:
'space-between'
,
flexFlow
:
'wrap'
}}
>
{
this
.
state
.
listDummy
.
map
((
item
,
index
)
=>
{
{
/* {!this.state.loading && this.state.arraySpeedo
.map((item, index) => {
return (
<
div
style
=
{{
padding
:
10
,
backgroundColor
:
this
.
state
.
selectIndex
===
index
?
'#6885a6'
:
'#fff'
,
borderRadius
:
6
,
paddingBottom
:
20
,
margin
:
10
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
}}
onClick
=
{()
=>
this
.
setState
({
selectIndex
:
index
},
()
=>
console
.
log
(
this
.
state
.
data
))}
>
<
span
style
=
{{
fontSize
:
'17px'
,
color
:
this
.
state
.
selectIndex
===
index
?
'#fff'
:
'#7e8085'
}}
>
{
item
.
judul
}
<
/span
>
<div style={{ padding: 10, backgroundColor: this.state.selectIndex === index ? '#6885a6' : '#fff', borderRadius: 6, paddingBottom: 20, margin: 10, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)' }} onClick={() => this.setState({ selectIndex: index }, () => console.log(
item
))}>
<span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085'
, maxWidth: 100}}>{item.item_name
}</span>
<div style={{ backgroundColor: 'transparent', display: 'flex', marginTop: index === 0 ? 54 : 30, placeContent: 'center' }}>
<div>
{index != 0 ?
<div>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
'24px'
,
color
:
selectIndex
===
index
?
"#fff"
:
'#4b4b4b'
}}
>
{
item
.
kpi
}
<
/span
>
<span style={{ textAlign: 'center', fontSize: '24px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>{item.
child.length
}</span>
<span style={{ textAlign: 'center', fontSize: '11px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>KPIs</span> </div> : null}
<div style={{ backgroundColor: index === 2 ? "#7cd532" : index === 3 ? "#fcff00" : index === 4 ? "#00b440" : "#00b1f7", textAlign: 'center', width: 40, height: 21 }}>
<Typography style={{ textAlign: 'center' }}>{item.rank}</Typography>
...
...
@@ -131,9 +239,9 @@ export default class ExceutiveScoreboard extends Component {
"#d8d8d8"
]}
needleColor={this.state.selectIndex === index ? "#fff" : '#4b4b4b'}
value
=
{
item
.
value
}
value={
this.handleValueSpeedo(item)
}
maxValue={5}
customSegmentStops
=
{[
0
,
item
.
value
,
5
]}
customSegmentStops={[0,
this.handleValueSpeedo(item)
, 5]}
width={200}
height={140}
ringWidth={25}
...
...
@@ -141,29 +249,29 @@ export default class ExceutiveScoreboard extends Component {
/>
<div style={{ backgroundColor: 'transparent', display: 'flex', marginTop: 20, placeContent: 'center' }}>
<div style={{ textAlign: '-webkit-center' }}>
{
item
.
status
===
"up"
?
{item.
id === 99
?
<img src={Images.up} /> : <img src={Images.down} />}
<Typography style={{ fontSize: 16, color: this.state.selectIndex === index ? '#fff' : '#4b4b4b' }}>vs Last Month</Typography>
</div>
</div>
</div>
)
})}
})}
*/
}
<
/div
>
<
div
style
=
{{
padding
:
10
,
marginTop
:
10
,
display
:
'flex'
,
width
:
'100%'
}}
>
<
GridList
cellHeight
=
{
250
}
cols
=
{
3
}
>
{
yuk
.
map
((
tile
)
=>
(
{
/*
<GridList cellHeight={250} cols={3}>
{
this.state.newData.filter((val) => val.parent != null)
.map((tile) => (
<GridListTile key={tile} cols={1} style={{}}>
<div style={{ maxWidth: 566, height: 233, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)', padding: 20, marginLeft: 5, marginTop: 5, marginRight: 5, display: 'inline-grid'}}>
<div>
<
span
style
=
{{
fontSize
:
17
}}
>
YTD
Revenue
<
/span
>
<
Typography
style
=
{{
fontSize
:
24
,
fontWeight
:
'bold'
}}
>
1
,
016
,
489.78
<
/Typography
>
<span style={{ fontSize: 17 }}>
{titleCase(tile.item_name)}
</span>
<Typography style={{ fontSize: 24, fontWeight: 'bold' }}>
<NumberFormat value={this.handleValueChild(tile)} displayType={'text'} thousandSeparator={true} prefix={'Rp. '}/>
</Typography>
<Typography style={{ fontSize: 16, fontWeight: 'bold' }}>In IDR mn</Typography>
</div>
<LineChart
width={400}
height={50}
data
=
{
data
}
data={
tile.arrayChildChart
}
yMin={0}
yMax={10}
hideXAxis={true}
...
...
@@ -174,7 +282,7 @@ export default class ExceutiveScoreboard extends Component {
</div>
</GridListTile>
))}
<
/GridList
>
</GridList>
*/
}
<
/div
>
{
/* <div style={{ width: 566, height: 233, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)', padding: 20, justifyContent: 'space-between', display: 'grid', margin: 10 }}>
...
...
src/container/Laporan/StrategiMap.js
View file @
73ba4332
import
React
,
{
Component
}
from
'react'
import
{
Paper
,
Typography
}
from
'@material-ui/core'
//
import { Paper, Typography } from '@material-ui/core'
import
Images
from
'../../assets/Images'
import
{
GridList
,
Paper
,
Typography
,
GridListTile
}
from
'@material-ui/core'
export
default
class
StrategiMap
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
dataStrategy
:
this
.
props
.
data
.
strategy_map
.
category
}
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
data
.
strategy_map
);
}
render
()
{
return
(
<
div
style
=
{{
padding
:
20
}}
>
<
Paper
style
=
{{
borderRadius
:
10
,
boxShadow
:
'0 0 4px 0 rgba(0, 0, 0, 0.5)'
}}
>
<
Paper
style
=
{{
borderRadius
:
10
,
boxShadow
:
'0 0 4px 0 rgba(0, 0, 0, 0.5)'
,
width
:
'100%'
}}
>
<
div
style
=
{{
height
:
56
,
borderTopLeftRadius
:
10
,
borderTopRightRadius
:
10
,
backgroundColor
:
'#f1f1f1'
,
display
:
'flex'
}}
>
<
div
style
=
{{
width
:
'25%'
,
borderRight
:
'solid 1px #d8d8d8'
,
display
:
'grid'
,
alignContent
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontWeight
:
'bold'
,
fontSize
:
12
}}
>
Category
<
/Typography
>
...
...
@@ -15,49 +28,45 @@ export default class StrategiMap extends Component {
<
Typography
style
=
{{
color
:
'#656565'
,
fontWeight
:
'bold'
,
fontSize
:
12
}}
>
KPI
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
width
:
'25%'
,
borderRight
:
'solid 1px #d8d8d8'
,
display
:
'grid'
,
paddingLeft
:
20
,
paddingTop
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #d8d8d8'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontWeight
:
'bold'
,
fontSize
:
14
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Financial
Perspective
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
width
:
'75%'
,
borderRight
:
'solid 1px #d8d8d8'
,
paddingRight
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignContent
:
'center'
,
padding
:
20
,
borderBottom
:
'solid 1px #d8d8d8'
}}
>
<
div
style
=
{{
display
:
'flex'
,
width
:
220
,
borderRadius
:
6
}}
>
<
div
style
=
{{
display
:
'grid'
,
alignContent
:
'center'
,
backgroundColor
:
'#6885a6'
,
width
:
152
,
borderTopLeftRadius
:
6
,
borderBottomLeftRadius
:
6
}}
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
12
,
justifySelf
:
'center'
}}
>
Revenue
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#cbf4a8'
,
width
:
68
,
borderTopRightRadius
:
6
,
borderBottomRightRadius
:
6
,
textAlign
:
'center'
,
paddingTop
:
10
,
paddingBottom
:
10
}}
>
<
img
src
=
{
Images
.
up
}
/
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'vs'
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'Last Month'
}
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
220
,
borderRadius
:
6
,
marginLeft
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
alignContent
:
'center'
,
backgroundColor
:
'#6885a6'
,
width
:
152
,
borderTopLeftRadius
:
6
,
borderBottomLeftRadius
:
6
}}
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
12
,
justifySelf
:
'center'
}}
>
EDITDA
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#cbf4a8'
,
width
:
68
,
borderTopRightRadius
:
6
,
borderBottomRightRadius
:
6
,
textAlign
:
'center'
,
paddingTop
:
10
,
paddingBottom
:
10
}}
>
<
img
src
=
{
Images
.
up
}
/
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'vs'
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'Last Month'
}
<
/Typography
>
{
this
.
state
.
dataStrategy
.
map
((
item
,
index
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
width
:
'25%'
,
borderRight
:
'solid 1px #d8d8d8'
,
display
:
'grid'
,
paddingLeft
:
20
,
paddingTop
:
20
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #d8d8d8'
}}
>
<
Typography
style
=
{{
color
:
'#656565'
,
fontWeight
:
'bold'
,
fontSize
:
14
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
{
item
.
category_name
}
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
width
:
220
,
borderRadius
:
6
,
marginLeft
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
alignContent
:
'center'
,
backgroundColor
:
'#6885a6'
,
width
:
152
,
borderTopLeftRadius
:
6
,
borderBottomLeftRadius
:
6
}}
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
12
,
justifySelf
:
'center'
}}
>
TPAT
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'#faaaaa'
,
width
:
68
,
borderTopRightRadius
:
6
,
borderBottomRightRadius
:
6
,
textAlign
:
'center'
,
paddingTop
:
10
,
paddingBottom
:
10
}}
>
<
img
src
=
{
Images
.
down
}
/
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'vs'
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'Last Month'
}
<
/Typography
>
<
div
style
=
{{
width
:
'75%'
,
borderRight
:
'solid 1px #d8d8d8'
,
paddingRight
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignContent
:
'center'
,
padding
:
20
,
borderBottom
:
'solid 1px #d8d8d8'
}}
>
<
GridList
cellHeight
=
{
100
}
cols
=
{
3
}
>
{
item
.
nodes
.
length
<
1
?
<
div
style
=
{{
height
:
75
}}
/
>
:
item
.
nodes
.
map
((
items
,
indexs
)
=>
{
return
(
<
GridListTile
key
=
{
items
}
cols
=
{
item
.
nodes
.
length
==
1
?
3
:
item
.
nodes
.
length
==
2
?
2
:
1
}
style
=
{{}}
>
<
div
style
=
{{
display
:
'flex'
,
minWidth
:
5
,
borderRadius
:
6
,
marginLeft
:
10
}}
>
<
div
style
=
{{
display
:
'grid'
,
alignContent
:
'center'
,
backgroundColor
:
'#6885a6'
,
width
:
5
,
borderTopLeftRadius
:
6
,
borderBottomLeftRadius
:
6
,
padding
:
10
}}
>
<
Typography
style
=
{{
color
:
'#fff'
,
fontSize
:
12
,
textAlign
:
'center'
}}
>
{
items
.
item_name
}
<
/Typography
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
items
.
is_higher
?
'#cbf4a8'
:
'#faaaaa'
,
width
:
68
,
borderTopRightRadius
:
6
,
borderBottomRightRadius
:
6
,
textAlign
:
'center'
,
paddingTop
:
10
,
paddingBottom
:
10
}}
>
<
img
src
=
{
items
.
is_higher
?
Images
.
up
:
Images
.
down
}
/
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'vs'
}
<
/Typography
>
<
Typography
style
=
{{
color
:
'#4b4b4b'
,
fontSize
:
10
,
textAlign
:
'center'
}}
>
{
'Last Month'
}
<
/Typography
>
<
/div
>
<
/div
>
<
/GridListTile
>
)
})}
<
/GridList
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
})}
<
div
style
=
{{
display
:
'flex'
}}
>
{
/*
<div style={{ display: 'flex' }}>
<div style={{ width: '25%', borderRight: 'solid 1px #d8d8d8', display: 'grid', paddingLeft: 20, paddingTop: 20 }}>
<div style={{ borderBottom: 'solid 1px #d8d8d8' }}>
<Typography style={{ color: '#656565', fontWeight: 'bold', fontSize: 14, fontFamily: 'Nunito Sans, sans-serif' }}>Customer Perspective</Typography>
...
...
@@ -149,7 +158,7 @@ export default class StrategiMap extends Component {
</div>
</div>
</div>
<
/div
>
</div>
*/
}
<
/Paper
>
<
/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