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
79747d8b
Commit
79747d8b
authored
Mar 08, 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
d37baa6d
4752199b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
269 additions
and
156 deletions
+269
-156
HomePage.js
src/container/HomePage.js
+55
-47
SubHolding.js
src/container/Laporan/SubHolding.js
+7
-0
MonthlyReport.js
src/container/MonthlyReport.js
+1
-2
CashFlowMR.js
src/container/MonthlyReport/CashFlowMR.js
+35
-33
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+171
-74
No files found.
src/container/HomePage.js
View file @
79747d8b
...
...
@@ -640,54 +640,62 @@ class HomePage extends Component {
<
div
style
=
{{
display
:
'flex'
,
overflowX
:
'scroll'
,
width
:
this
.
props
.
width
*
0.9
}}
>
{
items
.
category
.
map
((
item
,
index
)
=>
{
return
(
<
div
style
=
{{
padding
:
10
,
backgroundColor
:
'#fff'
,
borderRadius
:
6
,
paddingBottom
:
20
,
margin
:
10
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
,
width
:
250
,
marginRight
:
index
==
items
.
category
.
length
-
1
?
25
:
0
,
marginLeft
:
index
==
0
?
5
:
25
}}
>
{
/* <span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085', maxWidth: 100 }}>{item.category_name}</span> */
}
<
div
style
=
{{
fontSize
:
'17px'
,
width
:
'100%'
}}
>
<
Typography
style
=
{{
textAlign
:
'left'
,
color
:
'#4b4b4b'
}}
>
{
titleCase
(
String
(
item
.
category_name
).
toLocaleLowerCase
())}
<
/Typography
>
<
/div
>
{
item
.
total_kpi
!=
null
&&
<
div
style
=
{{
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
String
(
item
.
category_name
).
toLocaleLowerCase
().
includes
(
'internal'
)
?
0
:
25
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
'18px'
,
color
:
"#fff"
}}
>
{
item
.
total_kpi
}
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: '11px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>KPIs</span> */
}
<
/div>
}
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
item
.
total_kpi
==
null
?
50
:
0
}}
>
<
div
style
=
{{
backgroundColor
:
item
.
performanceColor
,
textAlign
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
width
:
40
,
height
:
21
}}
>
<
Typography
style
=
{{
textAlign
:
'center'
,
color
:
'#4b4b4b'
}}
>
{
item
.
performance
}
<
/Typography
>
<
Link
to
=
{{
pathname
:
`/home/cat-dashboard/`
,
state
:
{
userType
:
'user'
,
rawData
:
{
month
:
this
.
state
.
monthCAT
.
month_id
,
periode
:
this
.
state
.
periodeCAT
.
value
,
companyId
:
item
.
company_id
}
}
}}
>
<
div
style
=
{{
padding
:
10
,
backgroundColor
:
'#fff'
,
height
:
350
,
borderRadius
:
6
,
paddingBottom
:
20
,
margin
:
10
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
,
width
:
250
,
marginRight
:
index
==
items
.
category
.
length
-
1
?
25
:
0
,
marginLeft
:
index
==
0
?
5
:
25
}}
>
{
/* <span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085', maxWidth: 100 }}>{item.category_name}</span> */
}
<
div
style
=
{{
fontSize
:
'17px'
,
width
:
'100%'
,
height
:
25
}}
>
<
Typography
style
=
{{
textAlign
:
'left'
,
color
:
'#4b4b4b'
}}
>
{
item
.
category_name
}
<
/Typography
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
ReactSpeedometer
maxSegmentLabels
=
{
0
}
segmentColors
=
{[
item
.
performanceColor
,
"#d8d8d8"
]}
needleColor
=
{
"#4b4b4b"
}
value
=
{
Number
(
item
.
current_value
).
toFixed
(
2
)}
valueFormat
=
{
'.2f'
}
minValue
=
{
Number
(
item
.
low
)}
maxValue
=
{
Number
(
item
.
high
)}
customSegmentStops
=
{[
0
,
Number
(
item
.
current_value
),
5
]}
width
=
{
200
}
height
=
{
140
}
ringWidth
=
{
25
}
textColor
=
{
'#4b4b4b'
}
/
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'transparent'
,
display
:
'flex'
,
marginTop
:
20
,
placeContent
:
'center'
}}
>
{
item
.
is_higher
==
'-'
?
<
div
style
=
{{
textAlign
:
'-webkit-center'
}}
>
<
Typography
style
=
{{
fontSize
:
16
,
color
:
'#4b4b4b'
}}
>
-
<
/Typography
>
{
item
.
total_kpi
!=
null
&&
<
div
style
=
{{
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
10
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
'18px'
,
color
:
"#fff"
}}
>
{
item
.
total_kpi
}
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: '11px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>KPIs</span> */
}
<
/div>
}
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
,
marginTop
:
item
.
total_kpi
==
null
?
50
:
0
}}
>
<
div
style
=
{{
backgroundColor
:
item
.
performanceColor
,
textAlign
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
,
width
:
40
,
height
:
21
}}
>
<
Typography
style
=
{{
textAlign
:
'center'
,
color
:
'#4b4b4b'
}}
>
{
item
.
performance
}
<
/Typography
>
<
/div
>
:
<
div
style
=
{{
textAlign
:
'-webkit-center'
}}
>
{
item
.
is_higher
==
'true'
?
<
img
src
=
{
Images
.
up
}
/> : <img src={Images.down} /
>
}
<
Typography
style
=
{{
fontSize
:
16
,
color
:
'#4b4b4b'
}}
>
vs
Last
Month
<
/Typography
>
<
/div
>
}
<
/div
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
ReactSpeedometer
maxSegmentLabels
=
{
0
}
segmentColors
=
{[
item
.
performanceColor
,
"#d8d8d8"
]}
needleColor
=
{
"#4b4b4b"
}
value
=
{
Number
(
item
.
current_value
).
toFixed
(
2
)}
valueFormat
=
{
'.2f'
}
minValue
=
{
Number
(
item
.
low
)}
maxValue
=
{
Number
(
item
.
high
)}
customSegmentStops
=
{[
0
,
Number
(
item
.
current_value
),
5
]}
width
=
{
200
}
height
=
{
140
}
ringWidth
=
{
25
}
textColor
=
{
'#4b4b4b'
}
/
>
<
/div
>
<
div
style
=
{{
backgroundColor
:
'transparent'
,
display
:
'flex'
,
marginTop
:
20
,
placeContent
:
'center'
}}
>
{
item
.
is_higher
==
'-'
?
<
div
style
=
{{
textAlign
:
'-webkit-center'
}}
>
<
Typography
style
=
{{
fontSize
:
16
,
color
:
'#4b4b4b'
}}
>
-
<
/Typography
>
<
/div
>
:
<
div
style
=
{{
textAlign
:
'-webkit-center'
}}
>
{
item
.
is_higher
==
'true'
?
<
img
src
=
{
Images
.
up
}
/> : <img src={Images.down} /
>
}
<
Typography
style
=
{{
fontSize
:
16
,
color
:
'#4b4b4b'
}}
>
vs
Last
Month
<
/Typography
>
<
/div
>
}
<
/div
>
<
/div
>
<
/
div
>
<
/
Link
>
)
})}
<
/div
>
...
...
@@ -910,12 +918,12 @@ class HomePage extends Component {
pathname
:
`/home/cat-dashboard/`
,
state
:
{
userType
:
'user'
,
rawData
:
{
month
:
this
.
state
.
monthCAT
.
month_id
,
periode
:
this
.
state
.
periodeCAT
.
value
,
companyId
:
item
.
company_id
}
rawData
:
{
month
:
this
.
state
.
monthCAT
.
month_id
,
periode
:
this
.
state
.
periodeCAT
.
value
,
companyId
:
item
.
company_id
}
}
}}
>
<
div
style
=
{{
padding
:
10
,
backgroundColor
:
'#fff'
,
height
:
350
,
borderRadius
:
6
,
paddingBottom
:
20
,
margin
:
10
,
boxShadow
:
'0 1px 4px 0 rgba(0, 0, 0, 0.25)'
,
width
:
250
,
marginRight
:
index
==
items
.
category
.
length
-
1
?
25
:
0
,
marginLeft
:
index
==
0
?
5
:
25
}}
>
{
/* <span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085', maxWidth: 100 }}>{item.category_name}</span> */
}
<
div
style
=
{{
fontSize
:
'17px'
,
width
:
'100%'
,
height
:
25
}}
>
<
div
style
=
{{
fontSize
:
'17px'
,
width
:
'100%'
,
height
:
25
}}
>
<
Typography
style
=
{{
textAlign
:
'left'
,
color
:
'#4b4b4b'
}}
>
{
item
.
category_name
}
<
/Typography
>
<
/div
>
{
item
.
total_kpi
!=
null
&&
...
...
src/container/Laporan/SubHolding.js
View file @
79747d8b
...
...
@@ -3062,10 +3062,17 @@ export default class SubHolding extends Component {
a
.
click
();
}
}
else
if
(
this
.
state
.
report
.
value
===
8
)
{
<<<<<<<
HEAD
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
console
.
log
(
url
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
=======
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report_summary?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
console
.
log
(
url
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report_summary?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
>>>>>>>
4752199
b2929e79f17c72bc4f983e9058f435870
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
...
...
src/container/MonthlyReport.js
View file @
79747d8b
...
...
@@ -625,10 +625,8 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus);
this
.
historyApproval
()
this
.
getLatestPeriodSubmit
()
// this.getCashFlow(type)
// this.getPL(type)
if
(
type
!=
undefined
)
{
// this.getCashFlow(type)
this
.
getPL
(
type
)
}
else
{
this
.
setState
({
loading
:
false
})
...
...
@@ -722,6 +720,7 @@ export default class MonthlyReport extends Component {
visibleBS
:
false
,
visiblePL
:
false
,
visibleCAT
:
false
,
visibleCF
:
false
,
visibleFAM
:
false
,
visibleTP
:
false
,
visibleLOCF
:
false
,
...
...
src/container/MonthlyReport/CashFlowMR.js
View file @
79747d8b
...
...
@@ -63,19 +63,19 @@ export default class CashFlowMR extends Component {
}
else
{
checkApprover
=
false
}
if
(
this
.
props
.
lastStatus
==
'SUBMIT'
||
this
.
props
.
lastStatus
==
'REVISION'
)
{
checkLastStatus
=
true
}
else
{
checkLastStatus
=
false
}
}
if
(
this
.
props
.
prevRevision
)
{
checkPrevRev
=
true
}
else
{
checkPrevRev
=
false
}
if
(
this
.
props
.
status
===
'revision'
||
this
.
props
.
status
===
'not-yet'
||
this
.
props
.
status
===
'drat'
||
this
.
props
.
status
===
'submitted'
)
{
checkStatus
=
true
}
else
{
...
...
@@ -85,7 +85,7 @@ export default class CashFlowMR extends Component {
// console.log(checkLastStatus)
// console.log(checkApprover)
// console.log(checkPrevRev)
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
}
componentDidMount
()
{
...
...
@@ -214,10 +214,10 @@ export default class CashFlowMR extends Component {
dataTable2
.
map
((
item
,
index
)
=>
{
// if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
// item[6].value = this.handleValueFormula(item, index)
listCF
.
push
({
"item_report_id"
:
item
[
1
],
"actual"
:
item
[
0
]
==
1
?
""
:
Number
(
item
[
6
].
value
).
toFixed
(
1
)
})
listCF
.
push
({
"item_report_id"
:
item
[
1
],
"actual"
:
item
[
0
]
==
1
?
""
:
Number
(
item
[
6
].
value
).
toFixed
(
1
)
})
// } else {
// listCF.push({
// "item_report_id": item[1],
...
...
@@ -717,30 +717,32 @@ export default class CashFlowMR extends Component {
<
/div
>
<
/button
>
<
/div
>
{
this
.
state
.
viewOnly
&&
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
type
=
"button"
// disabled={this.state.buttonError}
onClick
=
{()
=>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
payloadCF
(
dataTable2
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/button
>
<
/div>
}
{
this
.
state
.
viewOnly
&&
<
div
className
=
"col-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
maxWidth
:
'100%'
}}
>
<
button
type
=
"button"
// disabled={this.state.buttonError}
onClick
=
{()
=>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
payloadCF
(
dataTable2
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
this
.
state
.
buttonError
===
true
?
'default'
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
&
Complete
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
}
<
/div
>
<
/div
>
<
/Paper
>
...
...
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
79747d8b
...
...
@@ -128,7 +128,7 @@ export default class CorporateAnnualTargetMR extends Component {
checkStatus
=
false
}
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
this
.
setState
({
viewOnly
:
!
checkApprover
&&
checkLastStatus
&&
checkStatus
&&
checkPrevRev
})
}
getParameterGroup
()
{
...
...
@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component {
])
// let index = dataTable.findIndex((val) => val[5] == item.description)
console
.
log
(
index
,
length
-
1
)
if
(
index
==
length
-
1
&&
item
.
parent_name
==
"LEARNING & GROWTH PERSPECTIVE"
)
{
if
(
index
==
length
-
1
&&
item
.
parent_name
==
"LEARNING & GROWTH PERSPECTIVE"
)
{
dataTable
.
push
([
4
,
0
,
...
...
@@ -671,17 +671,60 @@ export default class CorporateAnnualTargetMR extends Component {
if
(
item
[
8
]
==
'HIB'
)
{
let
actual
=
item
[
11
]
==
""
?
0
:
Number
(
item
[
11
])
let
target
=
item
[
12
]
==
""
?
0
:
Number
(
item
[
12
])
totalAch
=
2
-
(
actual
/
target
)
// if (item[5] == "Striping Ratio (SR) YTD") {
// console.log(actual)
// console.log(target)
// console.log(actual/target)
// }
if
(
target
<
0
)
{
if
(
actual
>
target
)
{
totalAch
=
(
actual
/
target
)
-
1
}
else
{
totalAch
=
(
actual
/
target
)
}
}
else
if
(
target
==
0
)
{
if
(
target
>=
actual
)
{
totalAch
=
1.25
}
else
{
totalAch
=
0
}
}
else
{
if
(
actual
==
target
)
{
totalAch
=
(
actual
/
target
)
}
else
{
totalAch
=
2
-
(
actual
/
target
)
}
}
// if (item[5] == "Striping Ratio (SR) YTD") {
// console.log(actual)
// console.log(target)
// console.log(actual/target)
// }
}
else
{
let
actual
=
item
[
11
]
==
""
?
0
:
Number
(
item
[
11
])
let
target
=
item
[
12
]
==
""
?
0
:
Number
(
item
[
12
])
totalAch
=
actual
/
target
if
(
target
<
0
)
{
if
(
actual
>=
target
)
{
totalAch
=
((
target
-
actual
)
/
target
)
+
1
}
else
{
totalAch
=
(
target
-
actual
)
/
target
}
}
else
if
(
target
==
0
)
{
if
(
target
<=
actual
)
{
totalAch
=
1.25
}
else
{
totalAch
=
0
}
}
else
{
// if (actual <= target) {
totalAch
=
(
actual
/
target
)
// } else {
// totalAch = 1 - (actual / target)
// }
}
}
totalAch
=
String
(
totalAch
)
==
'NaN'
||
String
(
totalAch
)
==
'Infinity'
||
String
(
totalAch
)
==
'-Infinity'
?
0
:
totalAch
totalAch
=
Number
(
totalAch
)
*
100
// if (item[5] == "People Benchstrength") {
// console.log(totalAch)
// }
//score
let
listParameter
=
this
.
state
.
parameterScore
...
...
@@ -691,22 +734,30 @@ export default class CorporateAnnualTargetMR extends Component {
let
listParameterFilter
=
listParameter
.
filter
((
val
)
=>
val
.
setting_type
==
String
(
parameterMix
).
toLocaleUpperCase
())
let
listParameterFilterCompany
=
listParameterFilter
.
filter
((
val
)
=>
val
.
company_id
==
this
.
props
.
company
.
company_id
)
let
totalScore
=
0
let
achx100
=
item
[
9
]
==
'100%'
&&
(
item
[
8
]
==
'HIB'
||
item
[
8
]
==
'HIG'
)?
Number
(
totalAch
)
/
100
>
1
?
1
:
Number
(
totalAch
)
/
100
:
Number
(
totalAch
)
/
100
let
achx100
=
item
[
9
]
==
'100%'
&&
(
item
[
8
]
==
'HIB'
||
item
[
8
]
==
'HIG'
)
?
Number
(
totalAch
)
/
100
>
1
?
1
:
Number
(
totalAch
)
/
100
:
Number
(
totalAch
)
/
100
// if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(listParameterFilter)
// console.log(listParameterFilterCompany)
// // console.log(Number(item.min_value))
// console.log(Number(item.max_value))
// }
if
(
listParameterFilterCompany
.
length
==
0
)
{
listParameterFilter
.
map
((
item
,
index
)
=>
{
if
(
Number
(
achx100
)
>=
Number
(
item
.
min_value
)
&&
Number
(
achx100
)
<=
Number
(
item
.
max_value
))
{
totalScore
=
Number
(
item
.
value
)
listParameterFilter
.
map
((
item
s
,
index
)
=>
{
if
(
Number
(
achx100
)
>=
Number
(
item
s
.
min_value
)
&&
Number
(
achx100
)
<=
Number
(
items
.
max_value
))
{
totalScore
=
Number
(
item
s
.
value
)
}
})
}
else
{
listParameterFilterCompany
.
map
((
item
,
index
)
=>
{
if
(
Number
(
achx100
)
>=
Number
(
item
.
min_value
)
&&
Number
(
achx100
)
<=
Number
(
item
.
max_value
))
{
totalScore
=
Number
(
item
.
value
)
listParameterFilterCompany
.
map
((
item
s
,
index
)
=>
{
if
(
Number
(
achx100
)
>=
Number
(
item
s
.
min_value
)
&&
Number
(
achx100
)
<=
Number
(
items
.
max_value
))
{
totalScore
=
Number
(
item
s
.
value
)
}
})
}
let
totalScorez
=
Number
(
totalScore
).
toFixed
(
0
)
// if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(totalScorez)
// }
//Score X Weight
let
totalSW
=
0
let
handlePercent
=
''
...
...
@@ -733,25 +784,25 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(totalSW)
// console.log(total)
return
[
item
[
0
],
item
[
1
],
item
[
2
],
item
[
3
],
item
[
4
],
item
[
5
],
item
[
6
],
item
[
7
],
item
[
8
],
item
[
9
],
item
[
10
],
item
[
11
],
item
[
12
],
totalAch
,
totalScorez
,
totalSW
,
item
[
16
],
item
[
17
],
item
[
18
],
item
[
0
],
item
[
1
],
item
[
2
],
item
[
3
],
item
[
4
],
item
[
5
],
item
[
6
],
item
[
7
],
item
[
8
],
item
[
9
],
item
[
10
],
item
[
11
],
item
[
12
],
totalAch
,
totalScorez
,
totalSW
,
item
[
16
],
item
[
17
],
item
[
18
],
// item[19],
// ]
]
...
...
@@ -759,7 +810,7 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(totalWeight)
// console.log(total)
// console.log(datatable3);
let
totalWeightz
=
Number
(
totalWeight
)
/
100
let
totalWeightz
=
Number
(
totalWeight
)
/
100
let
totalz
=
Number
(
Number
(
total
).
toFixed
(
2
)
/
Number
(
totalWeightz
)).
toFixed
(
2
)
console
.
log
(
totalz
)
let
lastTotal
=
R
.
equals
(
totalz
,
NaN
)
?
0.0
:
totalz
...
...
@@ -769,7 +820,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
else
{
lastTotal
=
totalz
}
console
.
log
(
Number
(
Number
(
total
).
toFixed
(
2
)
/
Number
(
totalWeightz
)).
toFixed
(
2
))
let
listPerfomanceDefault
=
this
.
state
.
parameterPerfom
.
filter
((
val
)
=>
String
(
val
.
company_name
).
toLocaleLowerCase
()
==
"default"
)
...
...
@@ -792,6 +843,7 @@ export default class CorporateAnnualTargetMR extends Component {
console
.
log
(
listPerfomanceDefault
)
console
.
log
(
perfomanceScore
)
console
.
log
(
perfomanceScoreColor
)
console
.
log
(
datatable3
)
// if (lastTotal >= 1.00 && lastTotal <= 2.00) {
// perfomanceScore = 'K'
// } else if (lastTotal >= 2.01 && lastTotal <= 2.75) {
...
...
@@ -808,10 +860,10 @@ export default class CorporateAnnualTargetMR extends Component {
// perfomanceScore = 'IST'
// }
setTimeout
(()
=>
{
this
.
setState
({
totalScore
:
lastTotal
,
perfomanceScore
,
loading
:
false
,
perfomanceScoreColor
},
()
=>
{
this
.
setState
({
loading
:
true
})
this
.
setState
({
totalScore
:
lastTotal
,
perfomanceScore
,
loading
:
false
,
perfomanceScoreColor
},
()
=>
{
this
.
setState
({
loading
:
true
})
setTimeout
(()
=>
{
this
.
setState
({
loading
:
false
})
this
.
setState
({
loading
:
false
})
},
500
);
})
},
500
);
...
...
@@ -1209,14 +1261,59 @@ export default class CorporateAnnualTargetMR extends Component {
const
handleAchiement
=
(
tableMeta
)
=>
{
let
total
=
0
// if (tableMeta.rowData[8] == 'HIB') {
// let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
// let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
// total = 2 - (actual / target)
// } else {
// let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
// let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
// total = actual / target
// }
if
(
tableMeta
.
rowData
[
8
]
==
'HIB'
)
{
let
actual
=
tableMeta
.
rowData
[
11
]
==
""
?
0
:
Number
(
tableMeta
.
rowData
[
11
])
let
target
=
tableMeta
.
rowData
[
12
]
==
""
?
0
:
Number
(
tableMeta
.
rowData
[
12
])
total
=
2
-
(
actual
/
target
)
if
(
target
<
0
)
{
if
(
actual
>
target
)
{
total
=
(
actual
/
target
)
-
1
}
else
{
total
=
(
actual
/
target
)
}
}
else
if
(
target
==
0
)
{
if
(
target
>=
actual
)
{
total
=
1.25
}
else
{
total
=
0
}
}
else
{
if
(
actual
==
target
)
{
total
=
(
actual
/
target
)
}
else
{
total
=
2
-
(
actual
/
target
)
}
}
}
else
{
let
actual
=
tableMeta
.
rowData
[
11
]
==
""
?
0
:
Number
(
tableMeta
.
rowData
[
11
])
let
target
=
tableMeta
.
rowData
[
12
]
==
""
?
0
:
Number
(
tableMeta
.
rowData
[
12
])
total
=
actual
/
target
if
(
target
<
0
)
{
if
(
actual
>=
target
)
{
total
=
((
target
-
actual
)
/
target
)
+
1
}
else
{
total
=
(
target
-
actual
)
/
target
}
}
else
if
(
target
==
0
)
{
if
(
target
<=
actual
)
{
total
=
1.25
}
else
{
total
=
0
}
}
else
{
// if (actual <= target) {
total
=
(
actual
/
target
)
// } else {
// total = 1 - (actual / target)
// }
}
}
total
=
String
(
total
)
==
'NaN'
||
String
(
total
)
==
'Infinity'
||
String
(
total
)
==
'-Infinity'
?
0
:
total
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
*
100
...
...
@@ -1245,12 +1342,12 @@ export default class CorporateAnnualTargetMR extends Component {
}
})
}
if
(
Number
(
tableMeta
.
rowData
[
12
])
>
Number
(
0
)){
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
totalScore
).
toFixed
(
0
)
return
Number
(
totalScore
).
toFixed
(
0
)
}
else
{
if
(
Number
(
tableMeta
.
rowData
[
12
])
==
Number
(
0
))
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
0
).
toFixed
(
0
)
return
Number
(
0
).
toFixed
(
0
)
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
totalScore
).
toFixed
(
0
)
return
Number
(
totalScore
).
toFixed
(
0
)
}
}
...
...
@@ -1263,13 +1360,13 @@ export default class CorporateAnnualTargetMR extends Component {
// }
if
(
tableMeta
.
rowData
[
0
]
==
4
)
{
let
totalScore
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!==
4
&&
item
[
0
]
!==
1
)
{
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
item
[
0
]
!==
4
&&
item
[
0
]
!==
1
)
{
totalScore
+=
Number
(
item
[
15
])
}
})
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
totalScore
).
toFixed
(
2
)
if
(
tableMeta
.
rowIndex
==
dataTable2
.
length
-
1
)
{
if
(
tableMeta
.
rowIndex
==
dataTable2
.
length
-
1
)
{
someXXX
=
Number
(
totalScore
).
toFixed
(
2
)
console
.
log
(
someXXX
)
}
...
...
@@ -1291,7 +1388,7 @@ export default class CorporateAnnualTargetMR extends Component {
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
).
toFixed
(
2
)
return
total
}
}
let
columns
=
[
...
...
@@ -1701,32 +1798,32 @@ export default class CorporateAnnualTargetMR extends Component {
customBodyRender
:
(
value
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
width
:
75
}}
>
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
?
{
tableMeta
.
rowData
[
0
]
===
1
||
tableMeta
.
rowData
[
0
]
===
2
?
null
:
tableMeta
.
rowData
[
0
]
===
4
?
handleTotal
(
tableMeta
)
:
this
.
state
.
get_for
==
'view'
?
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"black"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
value
).
toFixed
(
2
)}
// 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
=
{
true
}
decimalScale
=
{
2
}
/
>
tableMeta
.
rowData
[
0
]
===
4
?
handleTotal
(
tableMeta
)
:
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"black"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
handleTotal
(
tableMeta
).
toFixed
(
2
)}
decimalScale
=
{
2
}
disabled
=
{
true
}
/
>
this
.
state
.
get_for
==
'view'
?
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"black"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
Number
(
value
).
toFixed
(
2
)}
// 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
=
{
true
}
decimalScale
=
{
2
}
/
>
:
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
color
:
"black"
,
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
value
=
{
handleTotal
(
tableMeta
).
toFixed
(
2
)}
decimalScale
=
{
2
}
disabled
=
{
true
}
/
>
}
<
/div
>
)
...
...
@@ -1910,7 +2007,7 @@ export default class CorporateAnnualTargetMR extends Component {
<
div
style
=
{{
borderStyle
:
'solid'
,
backgroundColor
:
this
.
state
.
perfomanceScoreColor
,
borderWidth
:
'0px 1px 1px 1px'
,
padding
:
5
,
minWidth
:
200
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
{
!
this
.
state
.
loading
&&
(
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'black'
,
fontWeight
:
'bold'
}}
>
{
this
.
state
.
perfomanceScore
}
<
/Typography
>
)}
)}
<
/div
>
<
/div
>
<
/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