Commit 0082810f authored by EKSAD's avatar EKSAD

edit

parent 5b4e080b
......@@ -54,10 +54,7 @@ export default class EditReportItems extends Component {
componentDidMount() {
// console.log(this.props.data);
this.getDetailReportItems();
this.getInputType()
this.getPerusahaan()
this.getReportType()
this.getParent()
}
handleChange(e, type) {
......@@ -148,13 +145,13 @@ export default class EditReportItems extends Component {
updateReportItems() {
// alert('test')
let payload = {
"item_report_id": this.state.tempData.item_report_id,
"report_id": this.state.tempData.report_id,
"company_id": this.state.tempData.company_id,
"item_report_id": this.state.parent.item_report_id,
"report_id": this.state.reportType.report_id,
"company_id": this.state.company.company_id,
"description": this.state.tempData.description,
"orders": this.state.tempData.order,
"parent": this.state.tempData.parent,
"type_report_id": this.state.tempData.type_report_id,
"type_report_id": this.state.InputType.type_report_id,
"formula": this.state.tempData.formula,
"uom": this.state.tempData.uom,
"weight": this.state.tempData.weight,
......@@ -164,14 +161,14 @@ export default class EditReportItems extends Component {
"end_date": this.state.tempData.end_date
}
console.log(payload)
// api.create().updateUser(payload).then((response) => {
// if (response.data.status === 'success') {
// this.props.onClickClose()
// this.props.refresh()
// } else {
// alert(response.data.message)
// }
// })
api.create().updateReportItems(payload).then((response) => {
if (response.data.status === 'success') {
this.props.onClickClose()
this.props.refresh()
} else {
alert(response.data.message)
}
})
}
getDetailReportItems() {
......@@ -665,35 +662,20 @@ export default class EditReportItems extends Component {
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="endDate"
label="Berlaku Hingga"
format="dd MMMM yyyy"
value={this.state.tempData === null ? '' : this.state.tempData.end_date}
error={this.state.errorEndDate}
helperText={this.state.msgErrorED}
onChange={(e) => this.handleChange(e, 'end_date')}
minDate={this.state.tempData === null ? null : this.state.tempData.start_date}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{padding: 0, margin: 0, width: '100%'}}
margin="normal"
id="endDate"
label="Berlaku Hingga"
format="dd MMMM yyyy"
value={this.state.tempData === null ? null : this.state.tempData.end_date}
error={this.state.errorEndDate}
helperText={this.state.msgErrorED}
minDate={this.state.tempData === null ? null : this.state.tempData.start_date}
onChange={(e) => this.handleChange(e, 'end_date')}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
style={{ padding: 0, margin: 0, width: '100%' }}
/>
</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