|
|
@ -42,12 +42,11 @@ |
|
|
|
>查看</el-button |
|
|
|
> |
|
|
|
<i class="el-icon-download" style="margin-left: 16px;"></i> |
|
|
|
<a |
|
|
|
v-if="resultDescFile" |
|
|
|
:href="resultDescFile" |
|
|
|
target="_blank" |
|
|
|
style="color: #ff4d4f; cursor: pointer" |
|
|
|
>下载导入失败数据</a |
|
|
|
<el-button |
|
|
|
v-if="this.importFailNum>0" |
|
|
|
type="text" |
|
|
|
@click="handelClickDownFile" |
|
|
|
>下载导入失败数据</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -92,6 +91,7 @@ |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import axios from "axios"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -105,7 +105,9 @@ export default { |
|
|
|
pageNo:1, |
|
|
|
pageSize:20, |
|
|
|
total:0, |
|
|
|
tableType:null |
|
|
|
tableType:null, |
|
|
|
resultDescFilePath:null, |
|
|
|
originFileName:null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -169,6 +171,39 @@ export default { |
|
|
|
}, |
|
|
|
handelClickBackList() { |
|
|
|
this.$emit("handelClickBack"); |
|
|
|
}, |
|
|
|
handelClickDownFile(){ |
|
|
|
const url = "/actual/base/intelligentImportData/downloadFailExcel"; |
|
|
|
let parm = { |
|
|
|
originFileName:this.originFileName, |
|
|
|
resultDescFilePath :this.resultDescFilePath, |
|
|
|
}; |
|
|
|
axios({ |
|
|
|
url: window.SITE_CONFIG["apiURL"] + url, |
|
|
|
method: "post", |
|
|
|
data:parm, |
|
|
|
responseType: "blob", |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
let fileName = window.decodeURI( |
|
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
); |
|
|
|
console.log("filename", fileName); |
|
|
|
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" }); |
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
var aLink = document.createElement("a"); |
|
|
|
aLink.style.display = "none"; |
|
|
|
aLink.href = url; |
|
|
|
aLink.setAttribute("download", fileName); |
|
|
|
document.body.appendChild(aLink); |
|
|
|
aLink.click(); |
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("获取导出情失败", err); |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
async getTaskInfo() { |
|
|
|
let url = "/actual/base/intelligentImportData/getTaskInfo"; |
|
|
@ -181,7 +216,8 @@ export default { |
|
|
|
this.importFailNum = data.importFailNum.toString(); |
|
|
|
this.importSuccessNum = data.importSuccessNum.toString(); |
|
|
|
this.importCategory = data.importCategory; |
|
|
|
this.resultDescFile = data.resultDescFile; |
|
|
|
this.originFileName = data.originFileName; |
|
|
|
this.resultDescFilePath = data.resultDescFile; |
|
|
|
this.$emit("updateoperatorName", { |
|
|
|
operatorName: data.operatorName, |
|
|
|
createdTime: data.createdTime, |
|
|
|