Commit 39218e81 authored by d.arizona's avatar d.arizona

update new req mba sab

parent 1d0c9422
...@@ -640,13 +640,13 @@ class HomePage extends Component { ...@@ -640,13 +640,13 @@ class HomePage extends Component {
<div style={{ display: 'flex', overflowX: 'scroll', width: this.props.width * 0.9 }}> <div style={{ display: 'flex', overflowX: 'scroll', width: this.props.width * 0.9 }}>
{items.category.map((item, index) => { {items.category.map((item, index) => {
return ( return (
<div style={{ padding: 10, backgroundColor: '#fff', borderRadius: 6, paddingBottom: 20, margin: 10, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)', width: 250, marginRight: index == items.category.length - 1 ? 25 : 0, marginLeft: index == 0 ? 5 : 25 }}> <div style={{ padding: 10, backgroundColor: '#fff', height: 350, borderRadius: 6, paddingBottom: 20, margin: 10, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)', width: 250, marginRight: index == items.category.length - 1 ? 25 : 0, marginLeft: index == 0 ? 5 : 25 }}>
{/* <span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085', maxWidth: 100 }}>{item.category_name}</span> */} {/* <span style={{ fontSize: '17px', color: this.state.selectIndex === index ? '#fff' : '#7e8085', maxWidth: 100 }}>{item.category_name}</span> */}
<div style={{ fontSize: '17px', width: '100%' }}> <div style={{ fontSize: '17px', width: '100%', height: 25}}>
<Typography style={{ textAlign: 'left', color: '#4b4b4b' }}>{titleCase(String(item.category_name).toLocaleLowerCase())}</Typography> <Typography style={{ textAlign: 'left', color: '#4b4b4b' }}>{item.category_name}</Typography>
</div> </div>
{item.total_kpi != null && {item.total_kpi != null &&
<div style={{ width: '100%', display: 'flex', justifyContent: 'center', marginTop: String(item.category_name).toLocaleLowerCase().includes('internal') ? 0 : 25 }}> <div style={{ width: '100%', display: 'flex', justifyContent: 'center', marginTop: 10 }}>
<span style={{ textAlign: 'center', fontSize: '18px', color: "#fff" }}>{item.total_kpi}</span> <span style={{ textAlign: 'center', fontSize: '18px', color: "#fff" }}>{item.total_kpi}</span>
{/* <span style={{ textAlign: 'center', fontSize: '11px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>KPIs</span> */} {/* <span style={{ textAlign: 'center', fontSize: '11px', color: selectIndex === index ? "#fff" : '#4b4b4b' }}>KPIs</span> */}
</div>} </div>}
......
...@@ -671,17 +671,60 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -671,17 +671,60 @@ export default class CorporateAnnualTargetMR extends Component {
if (item[8] == 'HIB') { if (item[8] == 'HIB') {
let actual = item[11] == "" ? 0 : Number(item[11]) let actual = item[11] == "" ? 0 : Number(item[11])
let target = item[12] == "" ? 0 : Number(item[12]) let target = item[12] == "" ? 0 : Number(item[12])
totalAch = 2 - (actual / target) // if (item[5] == "Striping Ratio (SR) YTD") {
// console.log(actual)
// console.log(target)
// console.log(actual/target)
// }
if (target < 0) {
if (actual > target) {
totalAch = (actual / target) - 1
} else {
totalAch = (actual / target)
}
} else if (target == 0) {
if (target >= actual) {
totalAch = 1.25
} else {
totalAch = 0
}
} else {
if (actual == target) {
totalAch = (actual / target)
} else {
totalAch = 1 - (actual / target)
}
}
// if (item[5] == "Striping Ratio (SR) YTD") {
// console.log(actual)
// console.log(target)
// console.log(actual/target)
// }
} else { } else {
let actual = item[11] == "" ? 0 : Number(item[11]) let actual = item[11] == "" ? 0 : Number(item[11])
let target = item[12] == "" ? 0 : Number(item[12]) let target = item[12] == "" ? 0 : Number(item[12])
totalAch = actual / target if (target < 0) {
if (actual >= target) {
totalAch = ((target-actual) / target) + 1
} else {
totalAch = (target-actual) / target
}
} else if (target == 0) {
if (target <= actual) {
totalAch = 1.25
} else {
totalAch = 0
}
} else {
if (actual <= target) {
totalAch = (actual / target)
} else {
totalAch = 1 - (actual / target)
}
}
} }
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 = Number(totalAch) * 100
// if (item[5] == "People Benchstrength") {
// console.log(totalAch)
// }
//score //score
let listParameter = this.state.parameterScore let listParameter = this.state.parameterScore
...@@ -1209,14 +1252,59 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1209,14 +1252,59 @@ export default class CorporateAnnualTargetMR extends Component {
const handleAchiement = (tableMeta) => { const handleAchiement = (tableMeta) => {
let total = 0 let total = 0
// if (tableMeta.rowData[8] == 'HIB') {
// let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
// let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
// total = 2 - (actual / target)
// } else {
// let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
// let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
// total = actual / target
// }
if (tableMeta.rowData[8] == 'HIB') { if (tableMeta.rowData[8] == 'HIB') {
let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11]) let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12]) let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
total = 2 - (actual / target) if (target < 0) {
if (actual > target) {
total = (actual / target) - 1
} else {
total = (actual / target)
}
} else if (target == 0) {
if (target >= actual) {
total = 1.25
} else {
total = 0
}
} else {
if (actual == target) {
total = (actual / target)
} else {
total = 1 - (actual / target)
}
}
} else { } else {
let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11]) let actual = tableMeta.rowData[11] == "" ? 0 : Number(tableMeta.rowData[11])
let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12]) let target = tableMeta.rowData[12] == "" ? 0 : Number(tableMeta.rowData[12])
total = actual / target if (target < 0) {
if (actual >= target) {
total = ((target-actual) / target) + 1
} else {
total = (target-actual) / target
}
} else if (target == 0) {
if (target <= actual) {
total = 1.25
} else {
total = 0
}
} else {
if (actual <= target) {
total = (actual / target)
} else {
total = 1 - (actual / target)
}
}
} }
total = String(total) == 'NaN' || String(total) == 'Infinity' || String(total) == '-Infinity' ? 0 : total total = String(total) == 'NaN' || String(total) == 'Infinity' || String(total) == '-Infinity' ? 0 : total
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100 dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total) * 100
......
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