Commit 61b32313 authored by EKSAD's avatar EKSAD

solve issue report item

parent 0f26e4a6
......@@ -53,6 +53,7 @@ export default class ReportItems extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
if (err) {
console.log(err);
}
......@@ -82,10 +83,14 @@ export default class ReportItems extends Component {
let body = {
item_report: payload
}
// console.log(JSON.stringify(body))
console.log(resp.rows[1])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
api.create().checkUploadReportItems(body).then(response => {
}
});
}
checkUpload(){
api.create().checkUploadReportItems(this.state.payload).then(response => {
console.log(response)
let dataRow = []
if (response.data) {
......@@ -445,11 +450,12 @@ export default class ReportItems extends Component {
}
]
console.log(dataRow);
// console.log(dataRow);
this.setState({
dataLoaded: true,
cols: columns,
rows: dataRow
rows: dataRow, visibleUpload: false,
itemReport: false
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -467,13 +473,11 @@ export default class ReportItems extends Component {
} else {
this.setState({
dataLoaded: false,
alert: true, messageAlert: response.problem, tipeAlert: 'error' })
alert: true, messageAlert: response.problem, tipeAlert: 'error'
});
}
console.log(response);
})
}
});
}
componentDidMount() {
this.getData()
......@@ -1057,7 +1061,7 @@ export default class ReportItems extends Component {
}}
onUpload={() => {
this.state.judul === "MASTER DATA - REPORT ITEMS" ?
this.setState({ visibleUpload: false, itemReport: false }) :
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", 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