|
|
|
@ -25,7 +25,7 @@ |
|
|
|
import { |
|
|
|
uploadProjectPartExcel, // 导入项目物料文件 |
|
|
|
queryFileId, // 查询文件ID |
|
|
|
downLoadFile, //下载文件 |
|
|
|
downLoadFile, downLoadFile2, |
|
|
|
} from '@/api/part/partInformation.js' |
|
|
|
export default { |
|
|
|
name:'projectPartUpload', |
|
|
|
@ -105,24 +105,9 @@ export default { |
|
|
|
// 下载 |
|
|
|
async downloadFile () { |
|
|
|
let file = { |
|
|
|
id: 0, |
|
|
|
fileName: '' |
|
|
|
fileName: '项目物料导入模板.xlsx' |
|
|
|
} |
|
|
|
let tempData = { |
|
|
|
orderRef1: this.pageData.site, |
|
|
|
orderRef2: 'projectPart' |
|
|
|
} |
|
|
|
await queryFileId(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
file.id = data.data.id |
|
|
|
file.fileName = data.data.fileName |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
await downLoadFile(file).then(({data}) => { |
|
|
|
await downLoadFile2(file).then(({data}) => { |
|
|
|
// 不限制文件下载类型 |
|
|
|
const blob = new Blob([data], {type: "application/octet-stream"}) |
|
|
|
// 下载文件名称 |
|
|
|
|