Commit 0582e6ca authored by Riri Novita's avatar Riri Novita

issue issue issue

parent bb2541b4
...@@ -63,6 +63,7 @@ export default class ProfitLossMR extends Component { ...@@ -63,6 +63,7 @@ export default class ProfitLossMR extends Component {
maxValue: 0, maxValue: 0,
updateBy: '-' updateBy: '-'
} }
this.fileHandler = this.fileHandler.bind(this);
} }
componentDidMount() { componentDidMount() {
...@@ -122,7 +123,18 @@ export default class ProfitLossMR extends Component { ...@@ -122,7 +123,18 @@ export default class ProfitLossMR extends Component {
this.setState({ this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
}) })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
} }
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
...@@ -251,7 +263,7 @@ export default class ProfitLossMR extends Component { ...@@ -251,7 +263,7 @@ export default class ProfitLossMR extends Component {
} }
backToMonthlyReport(type) { backToMonthlyReport(type) {
console.log("masuk"); // this.setState({ loading: true })
let data = [] let data = []
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
data.push({ data.push({
...@@ -294,10 +306,7 @@ export default class ProfitLossMR extends Component { ...@@ -294,10 +306,7 @@ export default class ProfitLossMR extends Component {
}) })
} }
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false })
this.getSubmission()
document.body.style.overflow = 'unset';
})
} }
}) })
} }
...@@ -306,7 +315,7 @@ export default class ProfitLossMR extends Component { ...@@ -306,7 +315,7 @@ export default class ProfitLossMR extends Component {
console.log(event); console.log(event);
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
console.log(resp) // console.log(resp)
if (err) { if (err) {
// console.log(err); // console.log(err);
} }
...@@ -363,12 +372,18 @@ export default class ProfitLossMR extends Component { ...@@ -363,12 +372,18 @@ export default class ProfitLossMR extends Component {
item.actual, item.actual,
item.ytd_actual, item.ytd_actual,
item.actual_previous_month, item.actual_previous_month,
item.amount_act_vs_previous_month, 0,
item.percent_act_vs_previous_month, 0,
item.amount_act_vs_mb, 0,
item.percent_act_vs_mb, 0,
item.amount_act_vs_rb, 0,
item.percent_act_vs_rb, 0,
// item.amount_act_vs_previous_month,
// item.percent_act_vs_previous_month,
// item.amount_act_vs_mb,
// item.percent_act_vs_mb,
// item.amount_act_vs_rb,
// item.percent_act_vs_rb,
item.mtd_vs_previous_month, item.mtd_vs_previous_month,
item.mtd_vs_mb, item.mtd_vs_mb,
item.mtd_vs_rb, item.mtd_vs_rb,
...@@ -415,13 +430,13 @@ export default class ProfitLossMR extends Component { ...@@ -415,13 +430,13 @@ export default class ProfitLossMR extends Component {
}) })
}) })
let body = { let body = {
monthly_report_id: this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
company_id: this.props.company.company_id, "company_id": this.props.company.company_id,
periode: this.props.periode, "periode": this.props.periode,
report_id: this.props.report_id, "report_id": this.props.report_id,
months: this.props.month.month_id, "months": this.props.month.month_id,
status: type, "status": type,
profit_loss: data "profit_loss": data
} }
console.log(data); console.log(data);
api.create('UPLOAD').uploadMonthlyReportPL(body).then(response => { api.create('UPLOAD').uploadMonthlyReportPL(body).then(response => {
...@@ -1840,7 +1855,7 @@ export default class ProfitLossMR extends Component { ...@@ -1840,7 +1855,7 @@ export default class ProfitLossMR extends Component {
this.state.saveDraft === true ? this.state.saveDraft === true ?
null : null :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.backToMonthlyReport('draft') this.backToMonthlyReport('draft')
}) })
} }
...@@ -1958,7 +1973,7 @@ export default class ProfitLossMR extends Component { ...@@ -1958,7 +1973,7 @@ export default class ProfitLossMR extends Component {
this.state.saveDraft === true ? this.state.saveDraft === true ?
null : null :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.uploadProfitLossMR('draft') this.uploadProfitLossMR('draft')
}) })
} }
......
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