Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. t.prototype.downloadXlsx = function () {
  2. var t = this, e = {
  3. date_from: this.helpers.formatDate(this.filter.date_from),
  4. date_to: this.helpers.formatDate(this.filter.date_to),
  5. download: "fees"
  6. };
  7. this.http.get("team-accounts/" + this.route.snapshot.params.id, e).subscribe(function (n) {
  8. var i = {type: 'application/octet-stream'},
  9. r = t.account.team.name + "_summary_" + e.date_from + "_" + e.date_to + ".xlsx";
  10. t.helpers.downloadXlsxFile(n._body, i, r);
  11. })
  12.  
  13. t.prototype.downloadXlsxFile = function (t, e, n, i) {
  14. var r = new Blob(t], e);
  15. if (navigator.msSaveBlob) navigator.msSaveBlob(r, n); else {
  16. var a = document.createElement("a");
  17. if (void 0 !== a.download) {
  18. var o = i || document.body, s = URL.createObjectURL(r);
  19. a.setAttribute("href", s), a.setAttribute("download", n), a.style.visibility = "hidden", o.appendChild(a), a.click(), o.removeChild(a)
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement