Commit 9d29bf7c authored by fahrur huzain's avatar fahrur huzain

issue CAT OLPA

parent 0ff51395
...@@ -430,19 +430,19 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -430,19 +430,19 @@ export default class CorporateAnnualTargetRO extends Component {
"kpi_type": i[8] == null ? "" : i[8].value, "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, "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]), "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(fixNumber(Number(i[12].value), 1)) : String(i[12]), "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(fixNumber(Number(i[13].value), 1)) : String(i[13]), "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(fixNumber(Number(i[14].value), 1)) : String(i[14]), "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(fixNumber(Number(i[15].value), 1)) : String(i[15]), "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(fixNumber(Number(i[16].value), 1)) : String(i[16]), "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(fixNumber(Number(i[17].value), 1)) : String(i[17]), "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(fixNumber(Number(i[18].value), 1)) : String(i[18]), "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(fixNumber(Number(i[19].value), 1)) : String(i[19]), "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(fixNumber(Number(i[20].value), 1)) : String(i[20]), "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(fixNumber(Number(i[21].value), 1)) : String(i[21]), "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(fixNumber(Number(i[22].value), 1)) : String(i[22]), "december": stateFR ? i[0] == 3 ? String(i[22]) : String(Number(i[22].value)) : String(i[22]),
"total_current_year": String(fixNumber(Number(i[23]), 1)) == "" ? "0.0" : String(fixNumber(Number(i[23]), 1)), "total_current_year": String(Number(i[23])) == "" ? "0.0" : String(Number(i[23])),
"strategic": String(i[24]), "strategic": String(i[24]),
"pic": String(i[25]) "pic": String(i[25])
}) })
...@@ -1467,7 +1467,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1467,7 +1467,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1494,7 +1494,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1494,7 +1494,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1521,7 +1521,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1521,7 +1521,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1549,7 +1549,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1549,7 +1549,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1558,7 +1558,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1558,7 +1558,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1586,7 +1586,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1586,7 +1586,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1595,7 +1595,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1595,7 +1595,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1623,7 +1623,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1623,7 +1623,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1632,7 +1632,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1632,7 +1632,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1660,7 +1660,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1660,7 +1660,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1669,7 +1669,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1669,7 +1669,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1697,7 +1697,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1697,7 +1697,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1706,7 +1706,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1706,7 +1706,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1734,7 +1734,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1734,7 +1734,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1743,7 +1743,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1743,7 +1743,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1771,7 +1771,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1771,7 +1771,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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 <NumberFormat
...@@ -1780,7 +1780,7 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1780,7 +1780,7 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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> </div>
...@@ -1808,35 +1808,11 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1808,35 +1808,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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) ? (handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}> <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 ?
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1846,10 +1822,9 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1846,10 +1822,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" 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={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} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1858,29 +1833,54 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1858,29 +1833,54 @@ export default class CorporateAnnualTargetRO extends Component {
/> />
} }
/> />
: </div>
<FormControlLabel :
style={{ margin: 0 }} <div style={{ flex: 1 }}>
value={value} {tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 || tableMeta.rowData[0] === 7 ?
control={ <FormControlLabel
<NumberFormat style={{ margin: 0 }}
thousandSeparator={true} value={value}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} control={
type="text" <NumberFormat
placeholder="" thousandSeparator={true}
value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(value), 1) : Number(value) == 0 ? "0.0" : Number(value)} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
disabled={false} type="text"
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} placeholder=""
onBlur={(event) => { 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))}
// updateValue(event.target.value) // value={Number(value).toFixed(1)}
handleChange(event.target.value, tableMeta) disabled={true}
// console.log(tableMeta.rowData[0]) 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> />
}
/>
:
<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> </div>
...@@ -1908,35 +1908,11 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1908,35 +1908,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} 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) ? (handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}> <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 ?
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -1946,31 +1922,9 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1946,31 +1922,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" 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={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} 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)
// 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), 1) : Number(value) == 0 ? "0.0" : Number(value)}
disabled={false}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1979,8 +1933,54 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -1979,8 +1933,54 @@ export default class CorporateAnnualTargetRO extends Component {
/> />
} }
/> />
} </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> </div>
...@@ -2008,36 +2008,11 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -2008,36 +2008,11 @@ export default class CorporateAnnualTargetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={fixNumber(Number(value), 1)} value={fixNumber(Number(value), 2)}
/> />
: :
(handleReturnFormula(tableMeta.rowData[2], tableMeta) ? (handleReturnFormula(tableMeta.rowData[2], tableMeta) ?
<div style={{ flex: 1 }}> <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 <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -2047,31 +2022,9 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -2047,31 +2022,9 @@ export default class CorporateAnnualTargetRO extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// value={Number(handleValueFormula(value, tableMeta, 13)).toFixed(1)} value={this.props.defaultCurrency.id == 1 ? fixNumber(Number(handleTotal(tableMeta)), 2) : Number(handleTotal(tableMeta)) == 0 ? "0.00" : Number(handleTotal(tableMeta))}
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])
}}
/>
}
/>
:
<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} disabled={true}
decimalScale={this.props.defaultCurrency.id == 1 ? 1 : 16} decimalScale={this.props.defaultCurrency.id == 1 ? 2 : 16}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2079,8 +2032,55 @@ export default class CorporateAnnualTargetRO extends Component { ...@@ -2079,8 +2032,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> </div>
......
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