Commit deb5fb05 authored by fahrur huzain's avatar fahrur huzain

issue CAT

parent c2ee5b1b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -334,7 +334,7 @@ export default class CorporateAnnualTargetMR extends Component {
}
} else {
// console.log('terrrr')
//
//
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, saveDraft: true })
}
console.log(dataTable);
......@@ -505,8 +505,8 @@ export default class CorporateAnnualTargetMR extends Component {
jenis_kpi: i[8] == null ? "" : i[8],
max_ach: i[9] == null ? "" : i[9],
formula_ytd: i[10] == null ? "" : i[10],
actual_monthly: String(fixNumber(Number(i[11]), 1)),
target_monthly: String(fixNumber(Number(i[12]), 1)),
actual_monthly: String(Number(i[11])),
target_monthly: String(Number(i[12])),
achivement_monthly: String(fixNumber(Number(i[13]), 1)),
score: String(fixNumber(Number(i[14]), 0)),
score_x_weight: String(fixNumber(Number(i[15]), 2)),
......@@ -681,8 +681,8 @@ export default class CorporateAnnualTargetMR extends Component {
"jenis_kpi": i[8] == null ? "" : i[8],
"max_ach": i[9] == null ? "" : i[9],
"formula_ytd": i[10] == null ? "" : i[10],
"actual_monthly": i[11] == null || i[11] == "" ? 0.0 : String(fixNumber(Number(i[11]), 1)),
"target_monthly": i[12] == null || i[12] == "" ? 0.0 : String(fixNumber(Number(i[12]), 1)),
"actual_monthly": i[11] == null || i[11] == "" ? 0.0 : String(Number(i[11])),
"target_monthly": i[12] == null || i[12] == "" ? 0.0 : String(Number(i[12])),
"achivement_monthly": String(fixNumber(Number(i[13]), 1)),
"score": String(fixNumber(Number(i[14]), 0)),
"score_x_weight": String(fixNumber(Number(i[15]), 2)),
......@@ -1745,26 +1745,26 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={fixNumber(Number(value), 1) == 0 ? "0.0" : fixNumber(Number(value), 1)}
value={fixNumber(Number(value), 2) == 0 ? "0.00" : fixNumber(Number(value), 2)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled={true}
decimalScale={1}
decimalScale={2}
/>
:
<div style={{ flex: 1, textAlign: 'right' }}>
<FormControlLabel
style={{ margin: 0 }}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value)}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view' ? "black" : handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) ? "#5198ea" : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? fixNumber(Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? (Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex))) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? fixNumber(Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? (Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex)) == 0 ? "0.00" : Number(handleValueFormula(value, tableMeta, tableMeta.columnIndex))) : Number(value) == 0 ? "0.00" : Number(value))}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled={this.state.get_for == 'view' ? true : !handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta)}
decimalScale={1}
decimalScale={2}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1792,21 +1792,33 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ width: 75, textAlign: 'right' }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
null :
<FormControlLabel
style={{ margin: 0 }}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
decimalScale={1}
disabled={true}
/>
}
/>
this.state.get_for == 'view' ?
<NumberFormat
thousandSeparator={true}
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={fixNumber(Number(value), 2) == 0 ? "0.00" : fixNumber(Number(value), 2)}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
disabled={true}
decimalScale={2}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? Number(value) == 0 ? "0.00" : fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
decimalScale={2}
disabled={true}
/>
}
/>
}
</div>
)
......@@ -1896,11 +1908,11 @@ export default class CorporateAnnualTargetMR extends Component {
value={handleScore(tableMeta)}
decimalScale={0}
disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // console.log(dataTable2)
// }}
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // // console.log(dataTable2)
// }}
/>
}
/>
......@@ -2115,10 +2127,10 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
{
this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
)
}) :
return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
)
}) :
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
}
......@@ -2302,10 +2314,10 @@ export default class CorporateAnnualTargetMR extends Component {
<div style={{ marginLeft: 10, overflowY: 'scroll', height: this.state.updateBy.length < 2 ? 25 : 75, marginTop: 10 }}>
{
this.state.updateBy.length > 0 ? this.state.updateBy.reverse().map((item, index) => {
return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
)
}) :
return (
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>{item.latest_update}</Typography>
)
}) :
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10, marginRight: 5 }}>-</Typography>
}
......
......@@ -402,20 +402,20 @@ export default class CorporateAnnualTargetRO extends Component {
"weight": String(i[6]),
"uom": String(i[7]),
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula": i[10] == null ? "" : i[10].value,
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value)) : String(i[22]),
"january": stateFR ? i[0] == 3 ? String(i[11]) :(i[5] == "ROIC" ? String(i[11].value): String(Number(i[11]?.formula[0].value)/1000)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : (i[5] == "ROIC" ? String(i[12].value): String(Number(i[12]?.formula[0].value)/1000)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : (i[5] == "ROIC" ? String(i[13].value): String(Number(i[13]?.formula[0].value)/1000)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : (i[5] == "ROIC" ? String(i[14].value): String(Number(i[14]?.formula[0].value)/1000)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : (i[5] == "ROIC" ? String(i[15].value): String(Number(i[15]?.formula[0].value)/1000)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : (i[5] == "ROIC" ? String(i[16].value): String(Number(i[16]?.formula[0].value)/1000)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : (i[5] == "ROIC" ? String(i[17].value): String(Number(i[17]?.formula[0].value)/1000)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : (i[5] == "ROIC" ? String(i[18].value): String(Number(i[18]?.formula[0].value)/1000)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : (i[5] == "ROIC" ? String(i[19].value): String(Number(i[19]?.formula[0].value)/1000)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : (i[5] == "ROIC" ? String(i[20].value): String(Number(i[20]?.formula[0].value)/1000)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : (i[5] == "ROIC" ? String(i[21].value): String(Number(i[21]?.formula[0].value)/1000)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : (i[5] == "ROIC" ? String(i[22].value): String(Number(i[22]?.formula[1].value)/1000)) : String(i[22]),
"total_current_year": String(Number(i[23])) == "" ? "0.0" : String(Number(i[23])),
"strategic": String(i[24]),
"pic": String(i[25])
......@@ -430,19 +430,19 @@ export default class CorporateAnnualTargetRO extends Component {
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula": i[10] == null ? "" : i[10].value,
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(fixNumber(Number(i[11].value), 1)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(fixNumber(Number(i[12].value), 1)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(fixNumber(Number(i[13].value), 1)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(fixNumber(Number(i[14].value), 1)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(fixNumber(Number(i[15].value), 1)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(fixNumber(Number(i[16].value), 1)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(fixNumber(Number(i[17].value), 1)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(fixNumber(Number(i[18].value), 1)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(fixNumber(Number(i[19].value), 1)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(fixNumber(Number(i[20].value), 1)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(fixNumber(Number(i[21].value), 1)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(fixNumber(Number(i[22].value), 1)) : String(i[22]),
"total_current_year": String(fixNumber(Number(i[23]), 1)) == "" ? "0.0" : String(fixNumber(Number(i[23]), 1)),
"january": stateFR ? i[0] == 3 ? String(i[11]) :(i[5] == "ROIC" ? String(i[11].value): String(Number(i[11]?.formula[0].value)/1000)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : (i[5] == "ROIC" ? String(i[12].value): String(Number(i[12]?.formula[0].value)/1000)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : (i[5] == "ROIC" ? String(i[13].value): String(Number(i[13]?.formula[0].value)/1000)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : (i[5] == "ROIC" ? String(i[14].value): String(Number(i[14]?.formula[0].value)/1000)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : (i[5] == "ROIC" ? String(i[15].value): String(Number(i[15]?.formula[0].value)/1000)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : (i[5] == "ROIC" ? String(i[16].value): String(Number(i[16]?.formula[0].value)/1000)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : (i[5] == "ROIC" ? String(i[17].value): String(Number(i[17]?.formula[0].value)/1000)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : (i[5] == "ROIC" ? String(i[18].value): String(Number(i[18]?.formula[0].value)/1000)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : (i[5] == "ROIC" ? String(i[19].value): String(Number(i[19]?.formula[0].value)/1000)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : (i[5] == "ROIC" ? String(i[20].value): String(Number(i[20]?.formula[0].value)/1000)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : (i[5] == "ROIC" ? String(i[21].value): String(Number(i[21]?.formula[0].value)/1000)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : (i[5] == "ROIC" ? String(i[22].value): String(Number(i[22]?.formula[1].value)/1000)) : String(i[22]),
"total_current_year": String(Number(i[23])) == "" ? "0.0" : String(Number(i[23])),
"strategic": String(i[24]),
"pic": String(i[25])
})
......@@ -662,57 +662,60 @@ export default class CorporateAnnualTargetRO extends Component {
stateFR = false
}
if (this.state.defaultCurrencyUpload?.id == 2) {
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_report": String(i[5]),
"weight": String(i[6]),
"uom": String(i[7]),
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula_ytd": i[10] == null ? "" : i[10].value,
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(Number(i[11].value)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(Number(i[12].value)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(Number(i[13].value)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(Number(i[14].value)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(Number(i[15].value)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(Number(i[16].value)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(Number(i[17].value)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(Number(i[18].value)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(Number(i[19].value)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(Number(i[20].value)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(Number(i[21].value)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value)) : String(i[22]),
"total_current_year": String(Number(i[23])) == "" ? "0.0" : String(Number(i[23])),
"strategic": i[24] == null ? "" : String(i[24]),
"pic": String(i[25])
})
} else {
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_report": String(i[5]),
"weight": String(i[6]),
"uom": String(i[7]),
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula_ytd": i[10] == null ? "" : i[10].value,
"january": stateFR ? i[0] == 3 ? String(i[11]) : String(fixNumber(Number(i[11].value), 1)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : String(fixNumber(Number(i[12].value), 1)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : String(fixNumber(Number(i[13].value), 1)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : String(fixNumber(Number(i[14].value), 1)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : String(fixNumber(Number(i[15].value), 1)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : String(fixNumber(Number(i[16].value), 1)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : String(fixNumber(Number(i[17].value), 1)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : String(fixNumber(Number(i[18].value), 1)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : String(fixNumber(Number(i[19].value), 1)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : String(fixNumber(Number(i[20].value), 1)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : String(fixNumber(Number(i[21].value), 1)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : String(fixNumber(Number(i[22].value), 1)) : String(i[22]),
"total_current_year": String(fixNumber(Number(i[23]), 1)) == "" ? "0.0" : String(fixNumber(Number(i[23]), 1)),
"strategic": i[24] == null ? "" : String(i[24]),
"pic": String(i[25])
})
if (String(i[5]) == 'revenue'){
console.log(String(Number(i[22]?.formula[1].value)/1000))
}
// if (this.state.defaultCurrencyUpload?.id == 2) {
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
"item_report": String(i[5]),
"weight": String(i[6]),
"uom": String(i[7]),
"kpi_type": i[8] == null ? "" : i[8].value,
"max_ach": i[9] == null ? "" : i[9].value,
"formula_ytd": i[10] == null ? "" : i[10].value,
"january": stateFR ? i[0] == 3 ? String(i[11]) :(i[5] == "ROIC" ? String(i[11].value): String(Number(i[11]?.formula[0].value)/1000)) : String(i[11]),
"february": stateFR ? i[0] == 3 ? String(i[12]) : (i[5] == "ROIC" ? String(i[12].value): String(Number(i[12]?.formula[0].value)/1000)) : String(i[12]),
"march": stateFR ? i[0] == 3 ? String(i[13]) : (i[5] == "ROIC" ? String(i[13].value): String(Number(i[13]?.formula[0].value)/1000)) : String(i[13]),
"april": stateFR ? i[0] == 3 ? String(i[14]) : (i[5] == "ROIC" ? String(i[14].value): String(Number(i[14]?.formula[0].value)/1000)) : String(i[14]),
"may": stateFR ? i[0] == 3 ? String(i[15]) : (i[5] == "ROIC" ? String(i[15].value): String(Number(i[15]?.formula[0].value)/1000)) : String(i[15]),
"june": stateFR ? i[0] == 3 ? String(i[16]) : (i[5] == "ROIC" ? String(i[16].value): String(Number(i[16]?.formula[0].value)/1000)) : String(i[16]),
"july": stateFR ? i[0] == 3 ? String(i[17]) : (i[5] == "ROIC" ? String(i[17].value): String(Number(i[17]?.formula[0].value)/1000)) : String(i[17]),
"august": stateFR ? i[0] == 3 ? String(i[18]) : (i[5] == "ROIC" ? String(i[18].value): String(Number(i[18]?.formula[0].value)/1000)) : String(i[18]),
"september": stateFR ? i[0] == 3 ? String(i[19]) : (i[5] == "ROIC" ? String(i[19].value): String(Number(i[19]?.formula[0].value)/1000)) : String(i[19]),
"october": stateFR ? i[0] == 3 ? String(i[20]) : (i[5] == "ROIC" ? String(i[20].value): String(Number(i[20]?.formula[0].value)/1000)) : String(i[20]),
"november": stateFR ? i[0] == 3 ? String(i[21]) : (i[5] == "ROIC" ? String(i[21].value): String(Number(i[21]?.formula[0].value)/1000)) : String(i[21]),
"december": stateFR ? i[0] == 3 ? String(i[22]) : (i[5] == "ROIC" ? String(i[22].value): String(Number(i[22]?.formula[1].value)/1000)) : String(i[22]),
"total_current_year": String(Number(i[23])) == "" ? "0.0" : String(Number(i[23])),
"strategic": i[24] == null ? "" : String(i[24]),
"pic": String(i[25])
})
// } else {
// data.push({
// "item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
// "item_report": String(i[5]),
// "weight": String(i[6]),
// "uom": String(i[7]),
// "kpi_type": i[8] == null ? "" : i[8].value,
// "max_ach": i[9] == null ? "" : i[9].value,
// "formula_ytd": i[10] == null ? "" : i[10].value,
// "january": stateFR ? i[0] == 3 ? String(i[11]) : String(fixNumber(Number(i[11].value), 1)) : String(i[11]),
// "february": stateFR ? i[0] == 3 ? String(i[12]) : String(fixNumber(Number(i[12].value), 1)) : String(i[12]),
// "march": stateFR ? i[0] == 3 ? String(i[13]) : String(fixNumber(Number(i[13].value), 1)) : String(i[13]),
// "april": stateFR ? i[0] == 3 ? String(i[14]) : String(fixNumber(Number(i[14].value), 1)) : String(i[14]),
// "may": stateFR ? i[0] == 3 ? String(i[15]) : String(fixNumber(Number(i[15].value), 1)) : String(i[15]),
// "june": stateFR ? i[0] == 3 ? String(i[16]) : String(fixNumber(Number(i[16].value), 1)) : String(i[16]),
// "july": stateFR ? i[0] == 3 ? String(i[17]) : String(fixNumber(Number(i[17].value), 1)) : String(i[17]),
// "august": stateFR ? i[0] == 3 ? String(i[18]) : String(fixNumber(Number(i[18].value), 1)) : String(i[18]),
// "september": stateFR ? i[0] == 3 ? String(i[19]) : String(fixNumber(Number(i[19].value), 1)) : String(i[19]),
// "october": stateFR ? i[0] == 3 ? String(i[20]) : String(fixNumber(Number(i[20].value), 1)) : String(i[20]),
// "november": stateFR ? i[0] == 3 ? String(i[21]) : String(fixNumber(Number(i[21].value), 1)) : String(i[21]),
// "december": stateFR ? i[0] == 3 ? String(i[22]) : String(fixNumber(Number(i[22].value), 1)) : String(i[22]),
// "total_current_year": String(fixNumber(Number(i[23]), 1)) == "" ? "0.0" : String(fixNumber(Number(i[23]), 1)),
// "strategic": i[24] == null ? "" : String(i[24]),
// "pic": String(i[25])
// })
// }
})
......@@ -1401,7 +1404,7 @@ export default class CorporateAnnualTargetRO extends Component {
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
</div>
}
// value={this.state.parent}
// value={this.state.parent}
/>
}
</div>
......@@ -1439,7 +1442,7 @@ export default class CorporateAnnualTargetRO extends Component {
<input style={{ borderColor: 'white', width: 96, textAlign: 'center', padding: 0, margin: 0, color: handleAction(tableMeta.rowData[2], tableMeta.rowData[0]) ? "#5198ea" : "black" }} type="text" {...params.inputProps} />
</div>
}
// value={this.state.parent}
// value={this.state.parent}
/>
}
</div>
......@@ -1467,7 +1470,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1494,7 +1497,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1521,7 +1524,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1549,7 +1552,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1558,7 +1561,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1586,7 +1589,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1595,7 +1598,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1623,7 +1626,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1632,7 +1635,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1660,7 +1663,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1669,7 +1672,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1697,7 +1700,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1706,7 +1709,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1734,7 +1737,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1743,7 +1746,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1771,7 +1774,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
<NumberFormat
......@@ -1780,7 +1783,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.0" : Number(value.value)) : Number(value) == 0 ? "0.0" : Number(value))}
value={this.props.defaultCurrency.id == 1 ? (tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)) : (tableMeta.rowData[0] === 6 ? (Number(value.value) == 0 ? "0.00" : Number(value.value)) : Number(value) == 0 ? "0.00" : Number(value))}
/>
}
</div>
......@@ -1808,35 +1811,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 11)), 1) : Number(handleValueFormula(value, tableMeta, 11)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 11))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1846,10 +1825,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 11)), 1) : Number(handleValueFormula(value, tableMeta, 11)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 11))}
// value={Number(value).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 11)), 2) : Number(handleValueFormula(value, tableMeta, 11)) == 0 ? "0.00" : Number(handleValueFormula(value, tableMeta, 11))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1858,29 +1836,54 @@ export default class CorporateAnnualTargetRO extends Component {
/>
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
disabled={false}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
}
</div>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 11)), 2) : Number(handleValueFormula(value, tableMeta, 11)) == 0 ? "0.00" : Number(handleValueFormula(value, tableMeta, 11))}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
disabled={false}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
}
</div>
)
}
</div>
......@@ -1908,35 +1911,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 1) : fixNumber(Number(value), 1)}
value={tableMeta.rowData[0] === 6 ? fixNumber(Number(value.value), 2) : fixNumber(Number(value), 2)}
/>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 12)), 1) : Number(handleValueFormula(value, tableMeta, 12)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 12))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -1946,10 +1925,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 12)), 1) : Number(handleValueFormula(value, tableMeta, 12)) == 0 ? "0.0" : Number(handleValueFormula(value, tableMeta, 12))}
// value={Number(value).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 12)), 2) : Number(handleValueFormula(value, tableMeta, 12)) == 0 ? "0.00" : Number(handleValueFormula(value, tableMeta, 12))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1958,29 +1936,54 @@ export default class CorporateAnnualTargetRO extends Component {
/>
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
disabled={false}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
}
</div>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleValueFormula(value, tableMeta, 12)), 2) : Number(handleValueFormula(value, tableMeta, 12)) == 0 ? "0.00" : Number(handleValueFormula(value, tableMeta, 12))}
// value={Number(value).toFixed(1)}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
disabled={false}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
}
</div>
)
}
</div>
......@@ -2008,58 +2011,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text"
placeholder=""
disabled={true}
value={fixNumber(Number(value), 1)}
value={fixNumber(Number(value), 2)}
/>
:
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta)), 1) : Number(handleTotal(tableMeta)) == 0 ? "0.0" : Number(handleTotal(tableMeta))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
// null
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(handleValueFormula(value, tableMeta, 13)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)}
disabled
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
......@@ -2069,9 +2025,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta)), 1) : Number(handleTotal(tableMeta)) == 0 ? "0.0" : Number(handleTotal(tableMeta))}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta)), 2) : Number(handleTotal(tableMeta)) == 0 ? "0.00" : Number(handleTotal(tableMeta))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -2079,8 +2035,55 @@ export default class CorporateAnnualTargetRO extends Component {
}}
/>
}
/>}
</div>
/>
</div>
:
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
// null
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// value={Number(handleValueFormula(value, tableMeta, 13)).toFixed(1)}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 2) : Number(value) == 0 ? "0.00" : Number(value)}
disabled
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>
:
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta)), 2) : Number(handleTotal(tableMeta)) == 0 ? "0.00" : Number(handleTotal(tableMeta))}
disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(tableMeta.rowData[0])
}}
/>
}
/>}
</div>
)
}
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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