Commit 5c827416 authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents e31f32c3 bd259167
This diff is collapsed.
......@@ -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
}
......@@ -1709,7 +1690,9 @@ export default class CorporateAnnualTargetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>TOTAL SCORE</Typography>
</div>
<div style={{ border: '1px solid black', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end' }}>
{!this.state.loading && (
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.state.totalScore}</Typography>
)}
</div>
</div>
</div>
......@@ -1722,7 +1705,9 @@ export default class CorporateAnnualTargetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>PERFOMANCE</Typography>
</div>
<div style={{ borderStyle: 'solid', backgroundColor: this.handleBackgroundPerf(this.state.totalScore), 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>
......
......@@ -167,7 +167,7 @@ export default class ListOfCreditFacilities extends Component {
checkStatus = false
}
// this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
}
getItemHierarki() {
......
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