Commit c6bec937 authored by Deni Rinaldi's avatar Deni Rinaldi

isu

parent 0255d61f
...@@ -136,7 +136,7 @@ export default class CreateParameter extends Component { ...@@ -136,7 +136,7 @@ export default class CreateParameter extends Component {
options: perusahaanData, options: perusahaanData,
getOptionLabel: (option) => option.company_name, getOptionLabel: (option) => option.company_name,
}; };
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: 'Company has been inactive', errorPerusahaan: true }) this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: index === -1 ? 'Company has been inactive' : "", errorPerusahaan: index === -1 ? true : false })
} else { } else {
alert(response.data.message) alert(response.data.message)
} }
...@@ -698,14 +698,15 @@ export default class CreateParameter extends Component { ...@@ -698,14 +698,15 @@ export default class CreateParameter extends Component {
}} }}
name="order" name="order"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g,''); let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
tempData: { tempData: {
...this.state.tempData, ...this.state.tempData,
order: coba order: coba
} }
}) })
this.clearMessage()} this.clearMessage()
}
// this.handleChange(coba, 'value')} // this.handleChange(coba, 'value')}
} }
// error={this.state.errorOrder} // error={this.state.errorOrder}
...@@ -914,11 +915,12 @@ export default class CreateParameter extends Component { ...@@ -914,11 +915,12 @@ export default class CreateParameter extends Component {
}} }}
name="value" name="value"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g,''); let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
value: coba value: coba
}) })
this.clearMessage()} this.clearMessage()
}
// this.handleChange(coba, 'value')} // this.handleChange(coba, 'value')}
} }
// error={this.state.errorValue} // error={this.state.errorValue}
...@@ -946,11 +948,12 @@ export default class CreateParameter extends Component { ...@@ -946,11 +948,12 @@ export default class CreateParameter extends Component {
}} }}
name="minValue" name="minValue"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g,''); let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
minValue: coba minValue: coba
}) })
this.clearMessage()} this.clearMessage()
}
// this.handleChange(coba, 'value')} // this.handleChange(coba, 'value')}
} }
error={this.state.errorMinValue} error={this.state.errorMinValue}
...@@ -1071,11 +1074,12 @@ export default class CreateParameter extends Component { ...@@ -1071,11 +1074,12 @@ export default class CreateParameter extends Component {
}} }}
name="order" name="order"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g,''); let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
order: coba order: coba
}) })
this.clearMessage()} this.clearMessage()
}
// this.handleChange(coba, 'value')} // this.handleChange(coba, 'value')}
} }
// error={this.state.errorOrder} // error={this.state.errorOrder}
...@@ -1103,11 +1107,12 @@ export default class CreateParameter extends Component { ...@@ -1103,11 +1107,12 @@ export default class CreateParameter extends Component {
}} }}
name="maxValue" name="maxValue"
onChange={(e) => { onChange={(e) => {
let coba = String(e.target.value).replace(/[^\d]/g,''); let coba = String(e.target.value).replace(/[^\d]/g, '');
this.setState({ this.setState({
maxValue: coba maxValue: coba
}) })
this.clearMessage()} this.clearMessage()
}
// this.handleChange(coba, 'value')} // this.handleChange(coba, 'value')}
} }
error={this.state.errorMaxValue} error={this.state.errorMaxValue}
......
...@@ -246,7 +246,7 @@ export default class EditReportItems extends Component { ...@@ -246,7 +246,7 @@ export default class EditReportItems extends Component {
getOptionLabel: (option) => option.company_name, getOptionLabel: (option) => option.company_name,
}; };
// let index = companyData.findIndex((val) => val.company_id === this.state.tempData.company_id) // let index = companyData.findIndex((val) => val.company_id === this.state.tempData.company_id)
this.setState({ listCompany: defaultProps, companyData: response.data.data, company: index === -1 ? null : companyData[index] }, () => this.getParent()) this.setState({ listCompany: defaultProps, companyData: response.data.data, company: index === -1 ? null : companyData[index], msgErrorPerusahaan: index === -1 ? 'Company has been Inactive.' : "", errorPerusahaan: index === -1 ? true : false }, () => this.getParent())
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
} }
......
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