Commit fd1c77a4 authored by d.arizona's avatar d.arizona

depskuy

parent 9191d782
...@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -238,7 +238,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.order item.order
]) ])
// let index = dataTable.findIndex((val) => val[5] == item.description) // let index = dataTable.findIndex((val) => val[5] == item.description)
console.log(index, length - 1) // console.log(index, length - 1)
if (index == length - 1 && item.parent_name == "LEARNING & GROWTH PERSPECTIVE") { if (index == length - 1 && item.parent_name == "LEARNING & GROWTH PERSPECTIVE") {
dataTable.push([ dataTable.push([
4, 4,
...@@ -677,6 +677,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -677,6 +677,7 @@ export default class CorporateAnnualTargetMR extends Component {
let total = 0 let total = 0
let perfomanceScore = '' let perfomanceScore = ''
let totalWeight = 0 let totalWeight = 0
// console.log(datatable2)
let datatable3 = datatable2.map((item, index) => { let datatable3 = datatable2.map((item, index) => {
// console.log(item[6]) // console.log(item[6])
//total weight //total weight
...@@ -746,7 +747,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -746,7 +747,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
} }
totalAch = String(totalAch) == 'NaN' || String(totalAch) == 'Infinity' || String(totalAch) == '-Infinity' ? 0 : totalAch totalAch = String(totalAch) == 'NaN' || String(totalAch) == 'Infinity' || String(totalAch) == '-Infinity' ? 0 : totalAch
totalAch = Number(totalAch) * 100 totalAch = this.props.lastStatus == 'APPROVED'? item[13] : Number(totalAch) * 100
//score //score
let listParameter = this.state.parameterScore let listParameter = this.state.parameterScore
...@@ -756,7 +757,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -756,7 +757,7 @@ export default class CorporateAnnualTargetMR extends Component {
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase()) 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 listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0 let totalScore = 0
let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100 : Number(totalAch) / 100 let achx100 = item[9] == '100%' && (item[8] == 'HIB' || item[8] == 'HIG') ? (Number(totalAch) / 100 > 1 ? 1 : Number(totalAch) / 100) : Number(totalAch) / 100
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(listParameterFilter) // console.log(listParameterFilter)
// console.log(listParameterFilterCompany) // console.log(listParameterFilterCompany)
...@@ -776,7 +777,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -776,7 +777,7 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
} }
let totalScorez = Number(totalScore).toFixed(0) let totalScorez = this.props.lastStatus == 'APPROVED'? item[14] : Number(totalScore).toFixed(0)
// if (item[5] == "Max Quality drop from Bor-Barge") { // if (item[5] == "Max Quality drop from Bor-Barge") {
// console.log(totalScorez) // console.log(totalScorez)
// } // }
...@@ -793,7 +794,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -793,7 +794,7 @@ export default class CorporateAnnualTargetMR extends Component {
} else { } else {
totalSW = (Number(totalScorez) * Number(handlePercent) / 100) totalSW = (Number(totalScorez) * Number(handlePercent) / 100)
} }
totalSW = Number(totalSW).toFixed(2) totalSW = this.props.lastStatus == 'APPROVED'? item[15] : Number(totalSW).toFixed(2)
if (item[0] !== 1 && item[0] !== 4) { if (item[0] !== 1 && item[0] !== 4) {
total += Number(totalSW) total += Number(totalSW)
} }
...@@ -804,6 +805,8 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -804,6 +805,8 @@ export default class CorporateAnnualTargetMR extends Component {
// console.log(listParameterFilterCompany); // console.log(listParameterFilterCompany);
// console.log(totalScorez) // console.log(totalScorez)
// console.log(totalSW) // console.log(totalSW)
// console.log(item[12])
// console.log(item[5])
// console.log(total) // console.log(total)
return [ return [
item[0], item[0],
...@@ -1373,7 +1376,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1373,7 +1376,7 @@ export default class CorporateAnnualTargetMR extends Component {
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default") let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase() && String(val.company_name).toLocaleLowerCase() === "default")
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id) let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0 let totalScore = 0
let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100 : Number(tableMeta.rowData[13]) / 100 let achx100 = tableMeta.rowData[9] == '100%' && (tableMeta.rowData[8] == 'HIB' || tableMeta.rowData[8] == 'HIG') ? (Number(tableMeta.rowData[13]) / 100 > 1 ? 1 : Number(tableMeta.rowData[13]) / 100) : Number(tableMeta.rowData[13]) / 100
if (listParameterFilterCompany.length == 0) { if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((item, index) => { listParameterFilter.map((item, index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) { if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
......
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