Commit 99c06612 authored by liboyang's avatar liboyang

打印交接单

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