Commit 5c02bc17 authored by Deni Rinaldi's avatar Deni Rinaldi

balancesheet

parent 340d80c1
......@@ -312,7 +312,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget(data) {
this.setState({ loading: true })
// console.log(JSON.stringify(data));
api.create().createSubmitReport(data).then(response => {
api.create('UPLOAD').createSubmitReport(data).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
......
......@@ -908,6 +908,21 @@ export default class BalanceSheet extends Component {
})
}
async downloadAllData() {
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
)
res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Balance Sheet.xlsx';
a.click();
}
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -2511,7 +2526,12 @@ export default class BalanceSheet extends Component {
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
>
<img src={Images.download} />
</button>
......
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