Commit fc9b4435 authored by liboyang's avatar liboyang

下载交接单

parent 67ec44bd
......@@ -172,7 +172,7 @@ public class ExportExcel {
FileOutputStream fout = null;
try {
// fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls");
fout = new FileOutputStream("D:\\Excel\\" + simpleDateFormat.format(new Date())+ "交接单" + ".xls");
fout = new FileOutputStream("F:\\Excel\\" + simpleDateFormat.format(new Date())+ "交接单" + ".xls");
wb.write(fout);
fout.close();
} catch (IOException e) {
......@@ -181,7 +181,7 @@ public class ExportExcel {
System.out.println("Excel文件生成成功..." + new Date());
// return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls";
return "D:\\Excel\\" + simpleDateFormat.format(new Date()) + "交接单" + ".xls";
return "F:\\Excel\\" + simpleDateFormat.format(new Date()) + "交接单" + ".xls";
}
......
......@@ -877,7 +877,9 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
method: 'POST',
url: "../exportExcel/printReceiptExcelData",
data: body,
headers: {'Content-Type': 'application/json'}
headers: {'Content-Type': 'application/json'},
transformRequest: angular.identity,
responseType:'arraybuffer'
}).then(function successCallback(response) {
success(response.data)
})
......
......@@ -88,7 +88,14 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http'])
}
}
console.log(json)
HttpService.printReceitpData(json,function (data) {})
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();
})
}
});
\ No newline at end of file
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