Commit 76ae7cba authored by d.arizona's avatar d.arizona

apdet

parent 480e7a56
......@@ -731,17 +731,17 @@ export default class CorporateAnnualTarget extends Component {
let valReal = Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
let totalBaru = valChild + valReal
if (totalBaru > weightParent) {
dataTableBaru[index][7] = `${(weightParent - valChild)}%`
dataTableBaru[index][7] = `${String(Number(weightParent - valChild).toFixed(1)) + '%'}`
dataTampung[indexID].valChild = dataTampung[indexID].valChild + weightParent - valChild
weightReal = `${(weightParent - valChild)}%`
weightReal = `${String(Number(weightParent - valChild).toFixed(1)) + '%'}`
} else {
dataTableBaru[index][7] = i[7]
weightReal = i[7]
dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
}
// // // // console.log(weightReal)
// // // // console.log(dataTableBaru[index][7])
// // // // console.log(dataTampung[indexID].valChild)
// console.log(dataTableBaru[index][7])
// console.log(dataTampung[indexID].valChild)
}
}
// // console.log(String(weightReal).substr(0,String(weightReal).length-1))
......@@ -750,7 +750,7 @@ export default class CorporateAnnualTarget extends Component {
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_name": String(i[6]),
"parent": i[2] == "" ? null : i[2],
"weight": weightReal == null ? String(i[7]) : String(Number(String(weightReal).substr(0,String(weightReal).length-1)).toFixed(1)) + '%',
"weight": weightReal == null ? String(i[7]) : weightReal,
"uom": String(i[8]),
"kpi_type": i[9] == null ? "" : i[9].value,
"max_ach": i[10] == null ? "" : i[10].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