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
02949518
Commit
02949518
authored
Mar 07, 2021
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'GGMAC' into 'master'
update last See merge request
!1260
parents
33eba9b5
ed4d3356
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
73 deletions
+82
-73
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+82
-73
No files found.
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
02949518
...
...
@@ -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
,
...
...
@@ -705,9 +705,9 @@ export default class CorporateAnnualTargetMR extends Component {
let
target
=
item
[
12
]
==
""
?
0
:
Number
(
item
[
12
])
if
(
target
<
0
)
{
if
(
actual
>=
target
)
{
totalAch
=
((
target
-
actual
)
/
target
)
+
1
totalAch
=
((
target
-
actual
)
/
target
)
+
1
}
else
{
totalAch
=
(
target
-
actual
)
/
target
totalAch
=
(
target
-
actual
)
/
target
}
}
else
if
(
target
==
0
)
{
if
(
target
<=
actual
)
{
...
...
@@ -734,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
=
''
...
...
@@ -835,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) {
...
...
@@ -851,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
);
...
...
@@ -1288,9 +1297,9 @@ export default class CorporateAnnualTargetMR extends Component {
let
target
=
tableMeta
.
rowData
[
12
]
==
""
?
0
:
Number
(
tableMeta
.
rowData
[
12
])
if
(
target
<
0
)
{
if
(
actual
>=
target
)
{
total
=
((
target
-
actual
)
/
target
)
+
1
total
=
((
target
-
actual
)
/
target
)
+
1
}
else
{
total
=
(
target
-
actual
)
/
target
total
=
(
target
-
actual
)
/
target
}
}
else
if
(
target
==
0
)
{
if
(
target
<=
actual
)
{
...
...
@@ -1333,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
)
}
}
...
...
@@ -1351,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
)
}
...
...
@@ -1789,9 +1798,9 @@ 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
?
tableMeta
.
rowData
[
0
]
===
4
?
handleTotal
(
tableMeta
)
:
this
.
state
.
get_for
==
'view'
?
...
...
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