Commit 432b66c4 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

issue

See merge request !887
parents 902c91fd b617814f
......@@ -200,7 +200,7 @@ export default class ProfitLossMR extends Component {
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (item.type_report_id === 3 && item.level === 2) {
if (item.type_report_id === 3) {
if (item.profit_loss.mtd_vs_previous_month == "" && Number(item.profit_loss.percent_act_vs_previous_month) < this.state.minValue || Number(item.profit_loss.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
......@@ -249,7 +249,7 @@ export default class ProfitLossMR extends Component {
}
}
res.map((item, index) => {
if (item.type_report_id === 3 && item.level === 2) {
if (item.type_report_id === 3 ) {
if (item.profit_loss.mtd_vs_previous_month == "" && Number(item.profit_loss.percent_act_vs_previous_month) < this.state.minValue || Number(item.profit_loss.percent_act_vs_previous_month) > this.state.maxValue) {
err = true
......@@ -560,7 +560,7 @@ export default class ProfitLossMR extends Component {
let data = []
let err = false
this.state.dataTable.map((i, index) => {
if(i[0] === 3 && i[4] === 2) {
if(i[0] === 3 ) {
// console.log(i);
if ( i[19] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
console.log('msk 1');
......@@ -1505,6 +1505,7 @@ export default class ProfitLossMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[14]).toFixed(1) }
/>
......@@ -1579,6 +1580,7 @@ export default class ProfitLossMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[16]).toFixed(1) }
/>
......@@ -1652,6 +1654,7 @@ export default class ProfitLossMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={'%'}
disabled={true}
value={Number(tableMeta.rowData[18]).toFixed(1) }
/>
......@@ -1748,10 +1751,29 @@ export default class ProfitLossMR extends Component {
<div>
<div className="grid grid-3x content-center">
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ textAlign: 'left', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? tableMeta.rowData[19] :
{tableMeta.rowData[0] === 3 ?
this.state.get_for == 'view' ?
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
disabled={true}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 0)
}}
/>
:
<FormControlLabel
style={{ margin: 0 }}
// value={tableMeta.rowData[19]}
......@@ -1760,16 +1782,17 @@ export default class ProfitLossMR extends Component {
<LightTooltipError title={"MTD Explanation vs Prev. Month is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
color: "#5198ea",
textAlign: 'right',
textAlign: 'left',
backgroundColor: '#ffac99'
}
}}
......@@ -1781,9 +1804,10 @@ export default class ProfitLossMR extends Component {
:
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
// disabled={Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[19]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
......@@ -1791,7 +1815,7 @@ export default class ProfitLossMR extends Component {
inputProps={{
style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
textAlign: 'left'
}
}}
onBlur={(event) => {
......@@ -1800,15 +1824,36 @@ export default class ProfitLossMR extends Component {
/>
}
/>
:
null
}
</div>
</div>
</div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ textAlign: 'left', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? tableMeta.rowData[20] :
{tableMeta.rowData[0] === 3 ?
this.state.get_for == 'view' ?
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 1)
}}
/>
:
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -1817,16 +1862,17 @@ export default class ProfitLossMR extends Component {
<LightTooltipError title={"MTD Explanation vs MB is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
// value={tableMeta.rowData[20]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
color: "#5198ea",
textAlign: 'right',
textAlign: 'left',
backgroundColor: '#ffac99'
}
}}
......@@ -1838,9 +1884,10 @@ export default class ProfitLossMR extends Component {
:
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[20]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
......@@ -1848,7 +1895,7 @@ export default class ProfitLossMR extends Component {
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
textAlign: 'left'
}
}}
onBlur={(event) => {
......@@ -1856,15 +1903,37 @@ export default class ProfitLossMR extends Component {
}}
/>
}
/>}
/>
:
null
}
</div>
</div>
</div>
<div className="col-3">
<div style={{ textAlign: 'right', width: 90 }}>
<div style={{ textAlign: 'left', width: 90 }}>
<div style={{ flex: 1 }}>
{tableMeta.rowData[0] === 4 ? null : tableMeta.rowData[0] === 1 ? null : tableMeta.rowData[4] === 0 ? null : tableMeta.rowData[4] === 1 ? null :
this.state.get_for == 'view' ? tableMeta.rowData[21] :
{tableMeta.rowData[0] === 3 ?
this.state.get_for == 'view' ?
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
defaultValue={tableMeta.rowData[21]}
inputProps={{
style: {
color: Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'left'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 2)
}}
/>
:
<FormControlLabel
style={{ margin: 0 }}
// value={value}
......@@ -1873,16 +1942,17 @@ export default class ProfitLossMR extends Component {
<LightTooltipError title={"MTD Explanation vs RB is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
// value={tableMeta.rowData[21]}
defaultValue={tableMeta.rowData[21]}
inputProps={{
style: {
color: "#5198ea",
textAlign: 'right',
textAlign: 'left',
backgroundColor: '#ffac99'
}
}}
......@@ -1894,9 +1964,10 @@ export default class ProfitLossMR extends Component {
:
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
multiline={true}
// disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[21]}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
......@@ -1904,7 +1975,7 @@ export default class ProfitLossMR extends Component {
inputProps={{
style: {
color: Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
textAlign: 'left'
}
}}
onBlur={(event) => {
......@@ -1912,7 +1983,10 @@ export default class ProfitLossMR extends Component {
}}
/>
}
/>}
/>
:
null
}
</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