Commit d9a7502e authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !961
parents 5d9c97f1 2626058b
...@@ -630,13 +630,18 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -630,13 +630,18 @@ export default class CorporateAnnualTargetMR extends Component {
perfomanceScore = 'IST' perfomanceScore = 'IST'
} }
this.setState({ totalScore: total, perfomanceScore }) this.setState({ totalScore: total, perfomanceScore }, () => {
setTimeout(() => {
console.log(total)
this.setState({ totalScore: total })
}, 1000);
})
}) })
} }
handleBackgroundPerf(total) { handleBackgroundPerf(total) {
console.log(total) // console.log(total)
let color = 'white' let color = 'white'
if (total >= 1.00 && total <= 2.00) { if (total >= 1.00 && total <= 2.00) {
color = 'red' color = 'red'
...@@ -1071,7 +1076,14 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1071,7 +1076,14 @@ export default class CorporateAnnualTargetMR extends Component {
// if (tableMeta.rowData[5] == 'Trading profit (NPBT buah luar & plasma)') { // if (tableMeta.rowData[5] == 'Trading profit (NPBT buah luar & plasma)') {
// console.log(dataTable2[tableMeta.rowIndex]) // 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') { if (dataTable2[tableMeta.rowIndex][12] == '' || String(dataTable2[tableMeta.rowIndex][12]) == '0' || String(dataTable2[tableMeta.rowIndex][12]) == '0.0') {
total = 0 total = 0
} else { } else {
...@@ -1079,37 +1091,6 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1079,37 +1091,6 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(total) // console.log(total)
} }
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total).toFixed(2) 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 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