downloads(url){
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, true);
xmlhttp.responseType = "blob";
xmlhttp.onload = function () {
if (this.status == 200) {
const blob = this.response;
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = '发票';
document.body.appendChild(link);
const evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
link.dispatchEvent(evt);
window.URL.revokeObjectURL(link.href);
document.body.removeChild(link);
}
};
xmlhttp.send();
}