this.requestUp.post(this.APIS.UPLOADFORM, formData,{ responseType: "blob"}).then(res => {
console.log('UPLOADFORM', res)
if(res.type == 'application/json'){
this.fileList = []
this.batchImportBox = false
this.resetList()
}else{
// 下载失败文件
function downloadFile(data, fileName) {
let blob = new Blob([data], {type: `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8`});
// 获取heads中的filename文件名
let downloadElement = document.createElement('a');
// 创建下载的链接
let href = window.URL.createObjectURL(blob);
downloadElement.href = href;
// 下载后文件名
downloadElement.download = fileName;
document.body.appendChild(downloadElement);
// 点击下载
downloadElement.click();
// 下载完成移除元素
document.body.removeChild(downloadElement);
// 释放掉blob对象
window.URL.revokeObjectURL(href);
}
downloadFile(res,'物料导出错误数据表')
}
})