Commit 2626058b authored by d.arizona's avatar d.arizona

apdet

parent 311df875
......@@ -630,13 +630,18 @@ export default class CorporateAnnualTargetMR extends Component {
perfomanceScore = 'IST'
}
this.setState({ totalScore: total, perfomanceScore })
this.setState({ totalScore: total, perfomanceScore }, () => {
setTimeout(() => {
console.log(total)
this.setState({ totalScore: total })
}, 1000);
})
})
}
handleBackgroundPerf(total) {
console.log(total)
// console.log(total)
let color = 'white'
if (total >= 1.00 && total <= 2.00) {
color = 'red'
......@@ -1071,7 +1076,14 @@ export default class CorporateAnnualTargetMR extends Component {
// if (tableMeta.rowData[5] == 'Trading profit (NPBT buah luar & plasma)') {
// console.log(dataTable2[tableMeta.rowIndex])
// }
let handlePercent = String(dataTable2[tableMeta.rowIndex][6]).substr(0, String(dataTable2[tableMeta.rowIndex][6]).length - 1)
let handlePercent = ''
if (String(dataTable2[tableMeta.rowIndex][6]).includes('%')) {
// handlePercent = String(dataTable2[tableMeta.rowIndex][6])
handlePercent = String(dataTable2[tableMeta.rowIndex][6]).substr(0, String(dataTable2[tableMeta.rowIndex][6]).length - 1)
} else {
handlePercent = String(dataTable2[tableMeta.rowIndex][6])
}
// console.log(handlePercent)
if (dataTable2[tableMeta.rowIndex][12] == '' || String(dataTable2[tableMeta.rowIndex][12]) == '0' || String(dataTable2[tableMeta.rowIndex][12]) == '0.0') {
total = 0
} else {
......@@ -1079,37 +1091,6 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(total)
}
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(2)
if (tableMeta.rowIndex == dataTable2.length - 1) {
let totals = 0
let perfomanceScoreX = ''
dataTable2.map((item, index) => {
let value = String(item[15]) == 'NaN' || String(item[15]) == '' ? 0 : Number(item[15])
totals += value
})
totals = Number(totals).toFixed(2)
if (totals >= 1.00 && totals <= 2.00) {
perfomanceScoreX = 'K'
} else if (totals >= 2.01 && totals <= 2.75) {
perfomanceScoreX = 'C'
} else if (totals >= 2.76 && totals <= 3.00) {
perfomanceScoreX = 'B-'
} else if (totals >= 3.01 && totals <= 3.75) {
perfomanceScoreX = 'B'
} else if (totals >= 3.76 && totals <= 4.00) {
perfomanceScoreX = 'B+'
} else if (totals >= 4.01 && totals <= 4.75) {
perfomanceScoreX = 'BS'
} else if (totals >= 4.76 && totals <= 5.00) {
perfomanceScoreX = 'IST'
}
// totalScoreXXX = totals
// perfomanceScore = perfomanceScoreX
// setTimeout(() => {
// console.log(totalScoreXXX)
// console.log(perfomanceScore)
// }, 300);
}
return total
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment