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
3531f4d8
Commit
3531f4d8
authored
Mar 18, 2021
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apdet
parent
5d67852a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
83 deletions
+136
-83
HomePage.js
src/container/HomePage.js
+46
-5
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+7
-2
ProfitLossRO.js
src/container/RollingOutlook/ProfitLossRO.js
+83
-76
No files found.
src/container/HomePage.js
View file @
3531f4d8
...
@@ -47,7 +47,8 @@ class HomePage extends Component {
...
@@ -47,7 +47,8 @@ class HomePage extends Component {
company
:
[],
company
:
[],
dataDashboardCAT
:
[],
dataDashboardCAT
:
[],
loading2
:
false
,
loading2
:
false
,
loading3
:
false
loading3
:
false
,
parameterPerfom
:
[]
}
}
}
}
...
@@ -114,9 +115,7 @@ class HomePage extends Component {
...
@@ -114,9 +115,7 @@ class HomePage extends Component {
let
indexMonthMR
=
MR
.
findIndex
((
val
)
=>
val
.
value
==
yearNow
)
let
indexMonthMR
=
MR
.
findIndex
((
val
)
=>
val
.
value
==
yearNow
)
this
.
setState
({
listPeriodeMB
:
defaultPropsMB
,
periodeMB
:
MB
[
MB
.
length
-
1
],
listPeriodeMR
:
defaultPropsMR
,
periodeMR
:
MR
[
indexMonthMR
],
listPeriodeCAT
:
defaultPropsMB
,
periodeCAT
:
MB
[
indexMonthMR
]
},
()
=>
{
this
.
setState
({
listPeriodeMB
:
defaultPropsMB
,
periodeMB
:
MB
[
MB
.
length
-
1
],
listPeriodeMR
:
defaultPropsMR
,
periodeMR
:
MR
[
indexMonthMR
],
listPeriodeCAT
:
defaultPropsMB
,
periodeCAT
:
MB
[
indexMonthMR
]
},
()
=>
{
this
.
getListUserSubcoMB
()
this
.
getParameterGroupPerfom
()
this
.
getListUserSubcoMR
()
this
.
getDetailUser
()
})
})
}
}
...
@@ -130,7 +129,28 @@ class HomePage extends Component {
...
@@ -130,7 +129,28 @@ class HomePage extends Component {
let
arrayChild
=
[]
let
arrayChild
=
[]
item
.
category
.
map
((
items
,
indexs
)
=>
{
item
.
category
.
map
((
items
,
indexs
)
=>
{
if
(
this
.
state
.
company
.
includes
(
items
.
company_id
))
{
if
(
this
.
state
.
company
.
includes
(
items
.
company_id
))
{
arrayChild
.
push
({
...
items
,
current_value
:
Number
(
items
.
current_value
).
toFixed
(
2
),
performanceColor
:
this
.
handleBackgroundPerform
(
Number
(
items
.
current_value
))
})
let
indexPerform
=
this
.
state
.
parameterPerfom
.
findIndex
((
val
)
=>
val
.
company_id
==
items
.
company_id
)
let
listPerfomanceDefault
=
[]
if
(
indexPerform
==
-
1
)
{
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
String
(
val
.
company_name
).
toLocaleLowerCase
()
==
"default"
)
}
else
{
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
val
.
company_id
==
items
.
company_id
)
}
let
performanceScore
=
''
let
perfomanceScoreColor
=
'#fff'
if
(
listPerfomanceDefault
.
length
>
0
)
{
listPerfomanceDefault
.
map
((
item
,
index
)
=>
{
// console.log(Number(lastTotal))
// console.log(Number(item.min_value))
// console.log(Number(item.max_value))
if
(
Number
(
items
.
current_value
).
toFixed
(
2
)
>=
Number
(
item
.
min_value
)
&&
Number
(
items
.
current_value
).
toFixed
(
2
)
<=
Number
(
item
.
max_value
))
{
// console.log('masuk')
performanceScore
=
item
.
description
perfomanceScoreColor
=
item
.
value
}
})
}
arrayChild
.
push
({
...
items
,
current_value
:
Number
(
items
.
current_value
).
toFixed
(
2
),
performanceColor
:
perfomanceScoreColor
})
}
}
})
})
if
(
arrayChild
.
length
>
0
&&
String
(
item
.
item_business
).
toLocaleLowerCase
()
!=
'holding'
)
{
if
(
arrayChild
.
length
>
0
&&
String
(
item
.
item_business
).
toLocaleLowerCase
()
!=
'holding'
)
{
...
@@ -484,6 +504,27 @@ class HomePage extends Component {
...
@@ -484,6 +504,27 @@ class HomePage extends Component {
return
color
return
color
}
}
getParameterGroupPerfom
()
{
api
.
create
().
getParameterByGroupName
({
"group_name"
:
"PERFORMANCE_KPI"
}).
then
((
response
)
=>
{
console
.
log
(
response
.
data
)
if
(
response
.
data
)
{
this
.
setState
({
parameterPerfom
:
response
.
data
.
data
}
,
()
=>
{
this
.
getListUserSubcoMB
()
this
.
getListUserSubcoMR
()
this
.
getDetailUser
()
})
}
else
{
this
.
setState
({
parameterPerfom
:
[]
}
,
()
=>
{
this
.
getListUserSubcoMB
()
this
.
getListUserSubcoMR
()
this
.
getDetailUser
()
})
}
})
}
render
()
{
render
()
{
const
getDataMonth
=
(
item
)
=>
{
const
getDataMonth
=
(
item
)
=>
{
let
months
=
item
.
months
let
months
=
item
.
months
...
...
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
3531f4d8
...
@@ -822,8 +822,13 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -822,8 +822,13 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
console
.
log
(
Number
(
Number
(
total
).
toFixed
(
2
)
/
Number
(
totalWeightz
)).
toFixed
(
2
))
console
.
log
(
Number
(
Number
(
total
).
toFixed
(
2
)
/
Number
(
totalWeightz
)).
toFixed
(
2
))
let
indexPerform
=
this
.
state
.
parameterPerfom
.
findIndex
((
val
)
=>
val
.
company_id
==
this
.
props
.
company
.
company_id
)
let
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
String
(
val
.
company_name
).
toLocaleLowerCase
()
==
"default"
)
let
listPerfomanceDefault
=
[]
if
(
indexPerform
==
-
1
)
{
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
String
(
val
.
company_name
).
toLocaleLowerCase
()
==
"default"
)
}
else
{
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
val
.
company_id
==
this
.
props
.
company
.
company_id
)
}
let
performanceScore
=
''
let
performanceScore
=
''
let
perfomanceScoreColor
=
'#fff'
let
perfomanceScoreColor
=
'#fff'
if
(
listPerfomanceDefault
.
length
>
0
)
{
if
(
listPerfomanceDefault
.
length
>
0
)
{
...
...
src/container/RollingOutlook/ProfitLossRO.js
View file @
3531f4d8
This diff is collapsed.
Click to expand it.
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