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
52de3b63
Commit
52de3b63
authored
Jan 14, 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
91bee0d8
434983ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
65 deletions
+5
-65
CorporateAnnualTargetMR.js
src/container/MonthlyReport/CorporateAnnualTargetMR.js
+5
-65
No files found.
src/container/MonthlyReport/CorporateAnnualTargetMR.js
View file @
52de3b63
...
@@ -416,6 +416,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -416,6 +416,7 @@ export default class CorporateAnnualTargetMR extends Component {
})
})
console
.
log
(
dataTable
)
console
.
log
(
dataTable
)
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
},
()
=>
{
this
.
handleCalculate
(
dataTable
)
this
.
state
.
dataTable
.
map
(
item
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
16
].
length
>
0
)
{
if
(
item
[
16
].
length
>
0
)
{
console
.
log
(
'masuk'
)
console
.
log
(
'masuk'
)
...
@@ -630,73 +631,12 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -630,73 +631,12 @@ export default class CorporateAnnualTargetMR extends Component {
this
.
setState
({
alert
:
false
})
this
.
setState
({
alert
:
false
})
}
}
handleCalculate
(
datatable2
,
someXXX
)
{
handleCalculate
(
datatable2
)
{
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
let
total
=
0
let
total
=
0
let
perfomanceScore
=
''
let
perfomanceScore
=
''
// console.log(datatable2)
// console.log(datatable2[datatable2.length-1][15])
// console.log(datatable2[datatable2.length-6][11])
// const handleAchiement = (kpi, actualData, targetData) => {
// // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100
// return Number(total) * 100
// }
// const handleScore = (kpi, maxAch, ach) => {
// let listParameter = this.state.parameterScore
// let parameterKpi = kpi
// let parameterAch = String(maxAch).includes('%') ? `MAX${String(maxAch).substr(0, String(maxAch).length - 1)}` : String(maxAch)
// let parameterMix = `${parameterKpi}_${parameterAch}`
// 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 = maxAch == '100%' ? Number(ach) / 100 > 1 ? 1 : Number(ach) / 100 : Number(ach) / 100
// 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)
// }
// })
// } else {
// listParameterFilterCompany.map((item, index) => {
// if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
// totalScore = Number(item.value)
// }
// })
// }
// // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0)
// return Number(totalScore).toFixed(0)
// }
// const handleTotal = (weight, target, score) => {
// let total = 0
// let handlePercent = ''
// // if (tableMeta.rowData[5] == 'Trading profit (NPBT buah luar & plasma)') {
// // console.log(dataTable2[tableMeta.rowIndex])
// // }
// if (String(weight).includes('%')) {
// // handlePercent = String(weight)
// handlePercent = String(weight).substr(0, String(weight).length - 1)
// } else {
// handlePercent = String(weight)
// }
// // console.log(handlePercent)
// if (target == '' || String(target) == '0' || String(target) == '0.0') {
// total = 0
// } else {
// total = Number(score) * Number(handlePercent) / 100
// // console.log(total)
// }
// // dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(2)
// return total
// }
let
datatable3
=
datatable2
.
map
((
item
,
index
)
=>
{
let
datatable3
=
datatable2
.
map
((
item
,
index
)
=>
{
//ach
//ach
let
totalAch
=
0
let
totalAch
=
0
if
(
item
[
8
]
==
'HIB'
)
{
if
(
item
[
8
]
==
'HIB'
)
{
...
@@ -713,6 +653,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -713,6 +653,7 @@ export default class CorporateAnnualTargetMR extends Component {
// if (item[5] == "People Benchstrength") {
// if (item[5] == "People Benchstrength") {
// console.log(totalAch)
// console.log(totalAch)
// }
// }
//score
//score
let
listParameter
=
this
.
state
.
parameterScore
let
listParameter
=
this
.
state
.
parameterScore
let
parameterKpi
=
item
[
8
]
let
parameterKpi
=
item
[
8
]
...
@@ -801,8 +742,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -801,8 +742,7 @@ export default class CorporateAnnualTargetMR extends Component {
perfomanceScore
=
'IST'
perfomanceScore
=
'IST'
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
setState
({
totalScore
:
total
,
perfomanceScore
,
loading
:
false
})
this
.
setState
({
totalScore
:
total
,
perfomanceScore
,
loading
:
false
})
// console.log(total)
},
500
);
},
500
);
})
})
...
@@ -1959,7 +1899,7 @@ export default class CorporateAnnualTargetMR extends Component {
...
@@ -1959,7 +1899,7 @@ export default class CorporateAnnualTargetMR extends Component {
this
.
setState
({
loading
:
true
,
dataTable
:
dataTable2
,
saveDraft
:
false
,
buttonError
:
false
},
()
=>
{
this
.
setState
({
loading
:
true
,
dataTable
:
dataTable2
,
saveDraft
:
false
,
buttonError
:
false
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
// this.handleValidate()
// this.handleValidate()
this
.
handleCalculate
(
dataTable2
,
someXXX
)
this
.
handleCalculate
(
dataTable2
)
},
100
);
},
100
);
})
})
}}
}}
...
...
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