downloadTpl(){
dangerIdentifyTplApi().then(res=>{
console.log(res,999)
const blob = new Blob([res.data]);
const elink = document.createElement('a');
elink.download = '模板.xlsx';
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
})
},
importData(params){
let contractId = this.contractId
const fileForm = new FormData()
fileForm.append('file',params.file)
dangerIdentifyImportApi(contractId,fileForm).then(res=>{
if(res.data.code==0){
this.$message.success('导入成功')
this.initData()
}else{
this.$message.success('导入失败')
}
}).catch(err=>{
this.$message.success('导入失败')
})
}
vue文件导出/下载
于 2023-01-31 14:59:44 首次发布