Commit 1e83d715 authored by faisalhamdi's avatar faisalhamdi

template cat

parent 92930d4b
...@@ -187,6 +187,21 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -187,6 +187,21 @@ export default class CorporateAnnualTargetMR extends Component {
}) })
} }
downloadTemplate = async () => {
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report/cat/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
res = await res.blob()
console.log(res);
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = 'Template Monthly Report Corporate Annual Target.xlsx'
a.click();
}
}
getKPIType() { getKPIType() {
let body = { let body = {
group: 'CAT', group: 'CAT',
...@@ -1065,7 +1080,7 @@ export default class CorporateAnnualTargetMR extends Component { ...@@ -1065,7 +1080,7 @@ export default class CorporateAnnualTargetMR extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => null} onClick={() => this.downloadTemplate() }
> >
<img src={Images.template} /> <img src={Images.template} />
</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