Commit 7c135d22 authored by Riri Novita's avatar Riri Novita

Merge branch 'dev-riri' into 'ENV-DEV'

Issue Weight CAT

See merge request !2326
parents f7382f22 fcf97568
......@@ -196,6 +196,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
getItemHierarki() {
this.setState({ loading: true })
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
......@@ -218,7 +219,7 @@ export default class CorporateAnnualTargetMR extends Component {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
let weight = String(item.weight).includes('%') ? String(item.weight).substr(0, String(item.weight).length - 1) : String(item.weight)
// let weight = String(item.weight).includes('%') ? String(item.weight).substr(0, String(item.weight).length - 1) : String(item.weight)
let weightTB = String(item.corporate_annual_target.weight).includes('%') ? String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1) : String(item.corporate_annual_target.weight)
// console.log(weight)
dataTable.push([
......@@ -229,7 +230,8 @@ export default class CorporateAnnualTargetMR extends Component {
item.level,
item.description,
// item.corporate_annual_target.weight == "" ? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue ? weight : weightTB,
// parentTrue ? weight : weightTB,
weightTB,
parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type,
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -282,6 +284,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
}
res.map((item, index) => {
let weightParent = String(item.corporate_annual_target.weight).includes('%') ? String(item.corporate_annual_target.weight).substr(0, String(item.corporate_annual_target.weight).length - 1) : String(item.corporate_annual_target.weight)
dataTable.push([
item.type_report_id,
item.id,
......@@ -289,7 +292,8 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.weight == '' ? Number(0) : Number(Number(item.weight) * 100),
item.parent == null ? weightParent : item.corporate_annual_target.weight,
// item.weight == '' ? Number(0) : Number(Number(item.weight) * 100),
item.uom,
item.kpi_type == "" ? null : item.kpi_type,
// item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -621,11 +625,11 @@ export default class CorporateAnnualTargetMR extends Component {
options: inputMaxAch,
getOptionLabel: (option) => titleCase(option.value),
};
// setTimeout(() => {
this.setState({ maxAchList: defaultProps }, () => {
this.getItemHierarki()
})
// }, 300);
setTimeout(() => {
this.setState({ maxAchList: defaultProps }, () => {
this.getItemHierarki()
})
}, 300);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -939,11 +943,11 @@ export default class CorporateAnnualTargetMR extends Component {
})
}
// console.log(Number(lastTotal))
console.log(this.state.parameterPerfom)
console.log(listPerfomanceDefault)
console.log(perfomanceScore)
console.log(perfomanceScoreColor)
console.log(datatable3)
// console.log(this.state.parameterPerfom)
// console.log(listPerfomanceDefault)
// console.log(perfomanceScore)
// console.log(perfomanceScoreColor)
// console.log(datatable3)
// if (lastTotal >= 1.00 && lastTotal <= 2.00) {
// perfomanceScore = 'K'
// } else if (lastTotal >= 2.01 && lastTotal <= 2.75) {
......
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