Commit aee4022a authored by rifkaki's avatar rifkaki

mlm

parent 79e955ef
...@@ -132,7 +132,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -132,7 +132,7 @@ export default class CorporateAnnualTargetMR extends Component {
api.create().getParameterByGroupName({ api.create().getParameterByGroupName({
"group_name": 'ACHIEVEMENT_KPI' "group_name": 'ACHIEVEMENT_KPI'
}).then((response) => { }).then((response) => {
// console.log(response.data) console.log(response.data)
if (response.data) { if (response.data) {
this.setState({ parameterScore: response.data.data }) this.setState({ parameterScore: response.data.data })
} }
...@@ -693,10 +693,12 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -693,10 +693,12 @@ export default class CorporateAnnualTargetMR extends Component {
if (item[12] == '' || String(item[12]) == '0' || String(item[12]) == '0.0') { if (item[12] == '' || String(item[12]) == '0' || String(item[12]) == '0.0') {
totalSW = 0 totalSW = 0
} else { } else {
totalSW = Number(totalScore) * Number(handlePercent) / 100 totalSW = Number(totalScore) * Number(handlePercent) / 1000
} }
totalSW = Number(totalSW).toFixed(2) totalSW = Number(totalSW).toFixed(2)
console.log(totalScore)
console.log(handlePercent)
console.log(totalSW)
if (item[0] !== 1 && item[0] !== 4) { if (item[0] !== 1 && item[0] !== 4) {
total += Number(totalSW) total += Number(totalSW)
} }
...@@ -1183,9 +1185,13 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1183,9 +1185,13 @@ export default class CorporateAnnualTargetMR extends Component {
} }
}) })
} }
if (Number(tableMeta.rowData[12]) > Number(0)){
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0)
return Number(totalScore).toFixed(0) return Number(totalScore).toFixed(0)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(0).toFixed(0)
return Number(0).toFixed(0)
}
} }
let someXXX = this.state.aa let someXXX = this.state.aa
......
...@@ -150,7 +150,7 @@ export default class TaxPlanningMR extends Component { ...@@ -150,7 +150,7 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getLastestUpdateMR(payload).then(response => { api.create().getLastestUpdateMR(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -806,7 +806,6 @@ export default class TaxPlanningMR extends Component { ...@@ -806,7 +806,6 @@ export default class TaxPlanningMR extends Component {
const handleTotal = (value, tableMeta, dex) => { const handleTotal = (value, tableMeta, dex) => {
// console.log(tableMeta) // console.log(tableMeta)
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) { if (index == 9) {
let valItemTBF = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf let valItemTBF = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
......
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