Commit 5b8494b0 authored by faisalhamdi's avatar faisalhamdi

update 180920

parent babf96c2
......@@ -690,24 +690,34 @@ export default class BudgetTahunan extends Component {
)}
{this.state.visibleFAM && (
<FixedAssetsMovement
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleFAM: false, visibleBudgetTahunan: true })}
getReport={this.getReport.bind(this)}
getReportAttachment={this.getReportAttachment.bind(this)}
/>
)}
{this.state.visibleCAT && (
<CorporateAnnualTarget
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
getReport={this.getReport.bind(this)}
getReportAttachment={this.getReportAttachment.bind(this)}
/>
)}
</div >
......
......@@ -906,6 +906,22 @@ export default class FixedAssetsMovement extends Component {
})
}
async downloadAllData() {
console.log(this.props)
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 = 'Fixed Assets Movement.xlsx';
a.click();
}
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -1014,8 +1030,8 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{console.log(val)}
{console.log(tableMeta)}
{/* {console.log(val)} */}
{/* {console.log(tableMeta)} */}
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
......@@ -2473,7 +2489,12 @@ export default class FixedAssetsMovement 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