Commit f035e50d authored by EKSAD's avatar EKSAD

update edit

parent d8f0479f
...@@ -225,7 +225,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -225,7 +225,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
getMenuByRole, getMenuByRole,
saveVisualisasiReport, saveVisualisasiReport,
saveVisualisasiPerusahaan, saveVisualisasiPerusahaan,
getReportParent getReportParent,
searchParameter, searchParameter,
checkUploadPerusahaan, checkUploadPerusahaan,
getDetailPerusahaan, getDetailPerusahaan,
......
...@@ -119,7 +119,7 @@ export default class CreateReportItems extends Component { ...@@ -119,7 +119,7 @@ export default class CreateReportItems extends Component {
this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'}) this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'})
} }
else if (R.isNil(this.state.parent)) return alert("Parent ID is Required.") else if (R.isNil(this.state.parent)) return alert("Parent ID is Required.")
else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required."); else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required.")
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) { else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'}) this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'})
} }
......
...@@ -115,27 +115,11 @@ export default class EditReportItems extends Component { ...@@ -115,27 +115,11 @@ export default class EditReportItems extends Component {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required."); if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required.");
if (R.isNil(this.state.company)) return alert("Perusahaan is Required."); if (R.isNil(this.state.company)) return alert("Perusahaan is Required.");
else if (R.isNil(this.state.order)) { else if (R.isEmpty(this.state.tempData.order)) {
this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'}) this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'})
} } else if (R.isEmpty(this.state.tempData.description)) {
else if (R.isEmpty(this.state.description)) {
this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'}) this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'})
} } else if (R.isNil(this.state.tempData.InputType)) return alert("Tipe Data is Required.")
else if (R.isNil(this.state.parent)) return alert("Parent ID is Required.")
else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required.");
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'})
}
else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) {
this.setState({errorRV: true, msgErrorRV: 'Nilai Seharusnya Harus Diisi'})
}
else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) return alert("Kondisi Jika Salah is Required.")
else if (R.isNil(this.state.startDate)) {
this.setState({errorStartDate: true, msgErrorSD: 'Start Date tidak boleh kosong'})
}
else if (R.isNil(this.state.endDate)) {
this.setState({errorEndDate: true, msgErrorED: 'End Date tidak boleh kosong'})
}
else { else {
this.updateReportItems() this.updateReportItems()
} }
...@@ -367,6 +351,8 @@ export default class EditReportItems extends Component { ...@@ -367,6 +351,8 @@ export default class EditReportItems extends Component {
id="description" id="description"
label="Deskripsi" label="Deskripsi"
name="description" name="description"
error={this.state.errorDesc}
helperText={this.state.msgErrorDesc}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.description} value={this.state.tempData === null ? '' : this.state.tempData.description}
inputProps={{ inputProps={{
...@@ -544,14 +530,15 @@ export default class EditReportItems extends Component { ...@@ -544,14 +530,15 @@ export default class EditReportItems extends Component {
id="order" id="order"
label="Order" label="Order"
name="order" name="order"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.order} value={this.state.tempData === null ? '' : this.state.tempData.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif'
paddingLeft: 10
} }
}} }}
InputLabelProps={{ InputLabelProps={{
...@@ -559,8 +546,7 @@ export default class EditReportItems extends Component { ...@@ -559,8 +546,7 @@ export default class EditReportItems extends Component {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085', color: '#7e8085'
paddingLeft: 10
} }
}} }}
> >
...@@ -700,7 +686,7 @@ export default class EditReportItems extends Component { ...@@ -700,7 +686,7 @@ export default class EditReportItems extends Component {
</button> </button>
</div> </div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button onClick={() => this.updateReportItems()}> <button onClick={() => this.validasi()}>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span> <span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</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