let time = getFormatTime(new Date(), 'ymd');
let fileName = '产品库数据导出' + time + '.xls';
let upFile = new File([res], fileName, {type: "application/vnd.ms-excel"});
let reader = new FileReader();
reader.readAsDataURL(upFile); // 转换为base64,可以直接放入a标签href
reader.onload = function (e) {
let a = document.createElement('a'); // 转换完成,创建一个a标签用于下载
a.download = fileName;
a.target = '_blank';
a.href = e.target.result;
a.click();
}
//名字暂未生效
let time = getFormatTime(new Date(), 'ymd');
let fileName = '产品库数据导出' + time + '.xls';
let blob = new Blob([res], fileName, {type: "application/vnd.ms-excel"});
let objectUrl = URL.createObjectURL(blob);
window.location.href = objectUrl;