down:async function(obj){
axios({
method: 'post',
url:`${this.$http.defaults.baseURL}/order/generatePayment`,
headers: {
'Content-Type': 'application/json'
},
data: {
price:this.newObj2.orderMoney,
carteststationTitle:this.billingInfo.carteststationTitle,
bankName:this.billingInfo.bankName,
bankAccount:this.billingInfo.bankAccount,
settlementPrice :this.billingInfo.safePrice + this.billingInfo.envPrice,
today:this.today
}, // data是给到后端的信息
responseType: 'arraybuffer'
}).then(res => {
let headers = res.headers;
let blob = new Blob([res.data], {
type: headers['content-type']
});
let link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = "检测站订单结算申请单.docx"; // 更改下载文件名字
link.click();
});
},
参照: