Commit 80ac45e3 authored by d.arizona's avatar d.arizona

update

parent f2bb63cb
......@@ -416,6 +416,7 @@ export default class CorporateAnnualTargetMR extends Component {
})
console.log(dataTable)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.handleCalculate(dataTable)
this.state.dataTable.map(item => {
if (item[16].length > 0) {
console.log('masuk')
......@@ -634,66 +635,6 @@ export default class CorporateAnnualTargetMR extends Component {
this.setState({ loading: true }, () => {
let total = 0
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) => {
......
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