Commit 0c87d3cd authored by fahrur huzain's avatar fahrur huzain

issue LOV MR validasi

parent 5184d8db
...@@ -21,6 +21,7 @@ import { ExcelRenderer } from 'react-excel-renderer'; ...@@ -21,6 +21,7 @@ import { ExcelRenderer } from 'react-excel-renderer';
import { fixNumber, roundMath } from "../../library/Utils"; import { fixNumber, roundMath } from "../../library/Utils";
import LOCF from './LOCFMR'; import LOCF from './LOCFMR';
import LOV from './LOVMR'; import LOV from './LOVMR';
import PopUpValidationLOV from '../../library/PopUpValidationLOV';
const Alert = withStyles({ const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />); })((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
...@@ -142,6 +143,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -142,6 +143,7 @@ export default class ListOfCreditFacilities extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
emptyData: false,
} }
} }
...@@ -947,14 +949,18 @@ export default class ListOfCreditFacilities extends Component { ...@@ -947,14 +949,18 @@ export default class ListOfCreditFacilities extends Component {
if (i[0] == 3) { if (i[0] == 3) {
if (i[6] == null || i[7] == null || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") { if (i[6] == null || i[7] == null || i[9] == "" || i[10] == "" || i[11] == "" || i[12] == "") {
error = true error = true
this.setState({ emptyData: true})
} }
if (i[7] == null || i[7] == ""){
if ((i[7]?.value == 'Government bonds' && i[8] == '') || (i[7]?.value == 'Stocks' && i[8] == '') || (i[7]?.value == 'Mutual funds' && i[8] == '') || (i[7]?.value == 'Investment in associate' && i[8] == '') || (i[7]?.value == 'Investment in joint venture' && i[8] == '') || (i[7]?.value == 'Investment in subsidiary' && i[8] == '') || (i[7]?.value == 'Corporate bonds' && i[8] == '') || (i[7]?.value == 'Others' && i[8] == '')) { error = true
}else {
if ((i[7].value == 'Government bonds' && i[8] == '') || (i[7].value == 'Stocks' && i[8] == '') || (i[7].value == 'Mutual funds' && i[8] == '') || (i[7].value == 'Investment in associate' && i[8] == '') || (i[7].value == 'Investment in joint venture' && i[8] == '') || (i[7].value == 'Investment in subsidiary' && i[8] == '') || (i[7].value == 'Corporate bonds' && i[8] == '') || (i[7].value == 'Others' && i[8] == '')) {
error = true error = true
this.setState({ emptyData: true})
} else { } else {
error = false error = false
} }
}
// if (i[7].value == 'Government bonds' || i[7].value == 'Stocks' || i[7].value == 'Mutual funds' || i[7].value == 'Investment in associate' || i[7].value == 'Investment in joint venture' || i[7].value == 'Investment in subsidiary' || i[7].value == 'Corporate bonds' || i[7].value == 'Others' && i[8] == '' ) { // if (i[7].value == 'Government bonds' || i[7].value == 'Stocks' || i[7].value == 'Mutual funds' || i[7].value == 'Investment in associate' || i[7].value == 'Investment in joint venture' || i[7].value == 'Investment in subsidiary' || i[7].value == 'Corporate bonds' || i[7].value == 'Others' && i[8] == '' ) {
// error = true // error = true
// } // }
...@@ -1764,7 +1770,11 @@ export default class ListOfCreditFacilities extends Component { ...@@ -1764,7 +1770,11 @@ export default class ListOfCreditFacilities extends Component {
</div> </div>
</Paper>} </Paper>}
</div> </div>
{this.state.emptyData && (
<PopUpValidationLOV
onClickClose={() => this.setState({ emptyData: false })}
/>
)}
{ {
this.state.visibleAlertSave && ( this.state.visibleAlertSave && (
<div className="test app-popup-show"> <div className="test app-popup-show">
......
import React, { Component } from 'react';
import Images from '../assets/Images';
import { Typography } from '@material-ui/core';
export default class PopUpValidationLOV extends Component {
render() {
return (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<img src={Images.failedCopy} />
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`There is empty value`}
</span>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please fill the blank`}
</span>
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}>
<button
className={"btn-save"}
onClick={()=> this.props.onClickClose()}
>
<span style={{ color: 'white' }}>OK</span>
</button>
</div>
</div>
</div>
);
}
}
\ No newline at end of file
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