Commit 0082810f authored by EKSAD's avatar EKSAD

edit

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