Commit 4e4caec8 authored by a.bairuha's avatar a.bairuha

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into syadziy

parents 012441fc 3cef8616
......@@ -38,6 +38,10 @@ export default class CreateReportItems extends Component {
errorEndDate: false,
errorTipeData: false,
errorCondition: false,
errorJenisLaporan: false,
errorPerusahaan: false,
msgErrorJenisLaporan: '',
msgErrorPerusahaan: '',
msgErrorTipeData: '',
msgErrorCondition: '',
msgErrorOrder: '',
......@@ -136,9 +140,11 @@ export default class CreateReportItems extends Component {
validasi() {
// alert('coba ya')
if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required.");
if (R.isNil(this.state.company)) return alert("Perusahaan is Required.");
else if (R.isEmpty(this.state.order)) {
if (R.isNil(this.state.reportType)) {
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Jenis Laporan Harus Diisi'})
} else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Perusahaan Harus Diisi'})
} else if (R.isEmpty(this.state.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order Harus Diisi' })
}
else if (R.isEmpty(this.state.description)) {
......@@ -289,10 +295,14 @@ export default class CreateReportItems extends Component {
clearMessage() {
this.setState({
errorFormula: false, msgErrorFormula: '',
errorTipeData: false,
errorCondition: false,
msgErrorTipeData: '',
msgErrorCondition: '',
errorRV: false, msgErrorRV: '',
errorJenisLaporan: false, msgErrorJenisLaporan: '',
errorPerusahaan: false, msgErrorPerusahaan: ''
})
}
......@@ -348,7 +358,7 @@ export default class CreateReportItems extends Component {
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue })}
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, ()=> this.clearMessage())}
debug
renderInput={(params) =>
<TextField {...params}
......@@ -360,6 +370,8 @@ export default class CreateReportItems extends Component {
color: '#7e8085'
}
}}
error={this.state.errorJenisLaporan}
helperText={this.state.msgErrorJenisLaporan}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
......@@ -374,7 +386,7 @@ export default class CreateReportItems extends Component {
<Autocomplete
{...this.state.listCompany}
id="company"
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => this.getParent())}
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => this.getParent(), this.clearMessage())}
debug
renderInput={(params) =>
<TextField {...params}
......@@ -386,6 +398,8 @@ export default class CreateReportItems extends Component {
color: '#7e8085'
}
}}
error={this.state.errorPerusahaan}
helperText={this.state.msgErrorPerusahaan}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.company}
......@@ -583,6 +597,8 @@ export default class CreateReportItems extends Component {
color: '#7e8085'
}
}}
error={this.state.errorTipeData}
helperText={this.state.msgErrorTipeData}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.InputType}
......
......@@ -41,6 +41,10 @@ export default class EditReportItems extends Component {
errorRV: false,
errorStartDate: false,
errorEndDate: false,
errorJenisLaporan: false,
errorPerusahaan: false,
msgErrorJenisLaporan: '',
msgErrorPerusahaan: '',
msgErrorOrder: '',
msgErrorDesc: '',
msgErrorFormula: '',
......@@ -123,9 +127,11 @@ export default class EditReportItems extends Component {
validasi() {
// alert('coba ya')
if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required.");
if (R.isNil(this.state.company)) return alert("Perusahaan is Required.");
else if (R.isEmpty(this.state.tempData.order)) {
if (R.isNil(this.state.reportType)){
this.setState({errorJenisLaporan: true, msgErrorJenisLaporan: 'Jenis Laporan Harus Diisi'})
} else if (R.isNil(this.state.company)){
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Perusahaan Harus Diisi'})
} else if (R.isEmpty(this.state.tempData.order)) {
this.setState({ errorOrder: true, msgErrorOrder: 'Order Harus Diisi' })
} else if (R.isEmpty(this.state.tempData.description)) {
this.setState({ errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi' })
......@@ -159,7 +165,7 @@ export default class EditReportItems extends Component {
"type_report_id": this.state.InputType == null ? this.state.tempData.type_report_id : this.state.InputType.type_report_id,
"formula": this.state.tempData.formula,
"uom": this.state.tempData.uom,
"weight": this.state.tempData.weight,
"weight": this.state.tempData.weight == null ? "" : this.state.tempData.weight,
"condition_if_wrong": this.state.tempData.condition_if_wrong,
"condition_it_should_be": this.state.tempData.condition_it_should_be,
"start_date": this.state.tempData.start_date,
......@@ -306,7 +312,9 @@ export default class EditReportItems extends Component {
errorFormula: false, msgErrorFormula: '',
errorTipeData: false, msgErrorTipeData: '',
errorCondition: false, msgErrorCondition: '',
errorRV: false, msgErrorRV: ''
errorRV: false, msgErrorRV: '',
errorJenisLaporan: false, msgErrorJenisLaporan: '',
errorPerusahaan: false, msgErrorPerusahaan: ''
})
}
......@@ -373,7 +381,7 @@ export default class EditReportItems extends Component {
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, () => this.getParent())}
onChange={(event, newInputValue) => this.setState({ reportType: newInputValue }, () => this.getParent(), this.clearMessage() )}
debug
renderInput={(params) =>
<TextField {...params}
......@@ -385,6 +393,8 @@ export default class EditReportItems extends Component {
color: '#7e8085'
}
}}
error={this.state.errorJenisLaporan}
helperText={this.state.msgErrorJenisLaporan}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
......@@ -398,7 +408,7 @@ export default class EditReportItems extends Component {
<Autocomplete
{...this.state.listCompany}
id="company"
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => this.getParent())}
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => this.getParent(), this.clearMessage())}
debug
renderInput={(params) =>
<TextField {...params}
......@@ -410,6 +420,8 @@ export default class EditReportItems extends Component {
color: '#7e8085'
}
}}
error={this.state.errorPerusahaan}
helperText={this.state.msgErrorPerusahaan}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.company}
......
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