|
|
@@ -39,11 +39,11 @@
|
|
|
<p style="width: 65px">附件:</p>
|
|
|
<div class="filesName">
|
|
|
<p
|
|
|
- v-for="(item, index) in detailData.files"
|
|
|
+ v-for="(item, index) in filesList"
|
|
|
:key="index"
|
|
|
@click="downloadFile(index)"
|
|
|
>
|
|
|
- {{ item.name }}
|
|
|
+ {{ item.fileName }}
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -115,6 +115,7 @@ export default {
|
|
|
pageSize: 20,
|
|
|
tableData: [],
|
|
|
optionValue: "",
|
|
|
+ filesList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -167,37 +168,31 @@ export default {
|
|
|
},
|
|
|
// 下载附件
|
|
|
downloadFile: function (i) {
|
|
|
- this.selectInformationFileList(i);
|
|
|
+ console.log(i);
|
|
|
+ let dataObj = {
|
|
|
+ fileId: this.filesList[i]['id'],
|
|
|
+ informationId: this.detailData['id'],
|
|
|
+ agentId: this.filesList[i]['informationId']
|
|
|
+ }
|
|
|
+ console.log(dataObj);
|
|
|
+ this.dealerDownload(dataObj);
|
|
|
},
|
|
|
// 导出文件
|
|
|
downloadExcel: function () {
|
|
|
let id = this.detailData["id"];
|
|
|
- this.exportTem(id);
|
|
|
+ let data = {
|
|
|
+ informationId: id
|
|
|
+ }
|
|
|
+ this.exportTem(data);
|
|
|
},
|
|
|
- // 下载文件接口
|
|
|
- // selectInformationFileList: function (id) {
|
|
|
- // this.$http({
|
|
|
- // method: "post",
|
|
|
- // url: "/selectInformationFileList",
|
|
|
- // data: {
|
|
|
- // id: id,
|
|
|
- // },
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // console.log(res);
|
|
|
- // })
|
|
|
- // .catch((err) => {
|
|
|
- // console.log(err);
|
|
|
- // });
|
|
|
- // },
|
|
|
- // 导出模板
|
|
|
- exportTem: function (i) {
|
|
|
+ // 导出 接口
|
|
|
+ exportTem: function (data) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$http({
|
|
|
url: "/export",
|
|
|
method: "post",
|
|
|
- data: { id: i },
|
|
|
- responseType: "blob",
|
|
|
+ data: data,
|
|
|
+ // responseType: "blob",
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log(res);
|
|
|
@@ -206,7 +201,7 @@ export default {
|
|
|
link.href = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
link.target = "_blank";
|
|
|
//文件名和格式
|
|
|
- link.download = "文件模板.zip";
|
|
|
+ link.download = "下载记录.xlsx";
|
|
|
document.body.appendChild(link);
|
|
|
link.click();
|
|
|
document.body.removeChild(link);
|
|
|
@@ -225,7 +220,7 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res.data && res.data.code === 200) {
|
|
|
- console.log(res);
|
|
|
+ console.log(res.data.data);
|
|
|
this.tableData = res.data.data;
|
|
|
this.sum = res.data.count;
|
|
|
} else {
|
|
|
@@ -245,7 +240,8 @@ export default {
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res.data && res.data.code === 200) {
|
|
|
- console.log(res , '文件');
|
|
|
+ this.filesList = res.data.data;
|
|
|
+ console.log(res.data.data , '文件');
|
|
|
} else {
|
|
|
console.log(res);
|
|
|
}
|
|
|
@@ -254,6 +250,25 @@ export default {
|
|
|
console.log(err);
|
|
|
});
|
|
|
},
|
|
|
+ // 文件下载接口
|
|
|
+ dealerDownload: function(data) {
|
|
|
+ this.$http({
|
|
|
+ method: "post",
|
|
|
+ url: "/dealerDownload",
|
|
|
+ data: data
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ this.filesList = res.data.data;
|
|
|
+ console.log(res.data.data , '文件下载');
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|