Commit 654f4d75 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

update download taxplan

parent 2d443edd
...@@ -48,7 +48,7 @@ export default class TaxPlanning extends Component { ...@@ -48,7 +48,7 @@ export default class TaxPlanning extends Component {
buttonError: false buttonError: false
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); // this.fileHandler = this.fileHandler.bind(this);
} }
componentDidMount() { componentDidMount() {
...@@ -232,6 +232,21 @@ export default class TaxPlanning extends Component { ...@@ -232,6 +232,21 @@ export default class TaxPlanning 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 = 'Tax Planning.xlsx';
a.click();
}
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, indexChilds) => { const handleChange = (value, tableMeta, indexChilds) => {
...@@ -4212,7 +4227,12 @@ export default class TaxPlanning extends Component { ...@@ -4212,7 +4227,12 @@ export default class TaxPlanning extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => null} onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </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