Commit c7bd42f0 authored by dahai's avatar dahai

Merge remote-tracking branch 'origin/dev' into dev

parents 3bbce10e 99c06612
...@@ -939,15 +939,28 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -939,15 +939,28 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
// printReceitpData:function(data,success) {
// var body = JSON.stringify(data);
// $http({
// method: 'POST',
// url: "../exportExcel/printReceiptExcelData",
// data: body,
// headers: {'Content-Type': 'application/json'},
// transformRequest: angular.identity,
// responseType:'arraybuffer'
// }).then(function successCallback(response) {
// success(response.data)
// })
// },
printReceitpData:function(data,success) { printReceitpData:function(data,success) {
var body = JSON.stringify(data); var body = JSON.stringify(data);
$http({ $http({
method: 'POST', method: 'POST',
url: "../exportExcel/printReceiptExcelData", url: "../exportExcel/printReceiptExcelData",
data: body, data: body,
headers: {'Content-Type': 'application/json'}, headers: {'Content-Type': 'application/json'}
transformRequest: angular.identity, // transformRequest: angular.identity,
responseType:'arraybuffer' // responseType:'arraybuffer'
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
}) })
......
...@@ -135,12 +135,13 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http']) ...@@ -135,12 +135,13 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http'])
} }
console.log(json) console.log(json)
HttpService.printReceitpData(json,function (data) { HttpService.printReceitpData(json,function (data) {
var blob = new Blob([data], {type: "application/vnd.ms-excel"}); console.log(data)
var a = document.createElement("a"); // var blob = new Blob([data], {type: "application/vnd.ms-excel"});
document.body.appendChild(a); // var a = document.createElement("a");
a.href = URL.createObjectURL(blob); // document.body.appendChild(a);
// a.download = fileName; // a.href = URL.createObjectURL(blob);
a.click(); // // a.download = fileName;
// a.click();
}) })
} }
......
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