Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
be21ea1f
Commit
be21ea1f
authored
Dec 21, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cashflow
parent
94c78007
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
CashFlowMR.js
src/container/MonthlyReport/CashFlowMR.js
+19
-2
No files found.
src/container/MonthlyReport/CashFlowMR.js
View file @
be21ea1f
...
@@ -117,6 +117,23 @@ export default class CashFlowMR extends Component {
...
@@ -117,6 +117,23 @@ export default class CashFlowMR extends Component {
})
})
}
}
async
downloadAllData
()
{
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/monthly_report_cf/export_monthly_report?monthly_report_id=
${
this
.
props
.
monthlyReportId
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
console
.
log
(
url
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/monthly_report_cf/export_monthly_report?monthly_report_id=
${
this
.
props
.
monthlyReportId
===
null
?
""
:
this
.
props
.
monthlyReportId
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
)
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
=
'Monthly Report Cash Flow.xlsx'
;
a
.
click
();
}
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
...
@@ -426,7 +443,7 @@ export default class CashFlowMR extends Component {
...
@@ -426,7 +443,7 @@ export default class CashFlowMR extends Component {
onClick
=
{()
=>
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
this
.
setState
({
loading
:
true
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
//
this.downloadAllData()
this
.
downloadAllData
()
},
100
);
},
100
);
})}
})}
>
>
...
@@ -452,7 +469,7 @@ export default class CashFlowMR extends Component {
...
@@ -452,7 +469,7 @@ export default class CashFlowMR extends Component {
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
{
/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
(this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? */
}
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"grid grid-2x"
style
=
{{
marginTop
:
20
}}
>
<
div
className
=
"col-1"
>
<
div
className
=
"col-1"
style
=
{{
paddingLeft
:
0
}}
>
<
button
<
button
type
=
"button"
type
=
"button"
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
onClick
=
{()
=>
this
.
setState
({
loading
:
true
},
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment