【修改】下载

This commit is contained in:
zhoulingpo
2023-05-26 14:26:06 +08:00
parent 4aed5a8e7d
commit 7bb05f8b8a
2 changed files with 19 additions and 6 deletions
+18 -5
View File
@@ -56,7 +56,7 @@
<div class="report-download">
<span>报告详情</span>
<el-button v-if="row.downPower==1" @click="downloadRow(file)"
:disabled="showText" size="mini" class="checkBtn">报告下载</el-button>
:disabled="showText && !isExcel" size="mini" class="checkBtn">报告下载</el-button>
</div>
<div class="preview-box" v-watermark="{ text: watermarkText }">
<div class="preview-list" >
@@ -153,6 +153,7 @@ export default {
},
userId: this.$store.getters.userInfo.usid,
userName: this.$store.getters.userInfo.usname,
isExcel:false
}
},
methods: {
@@ -266,6 +267,7 @@ export default {
},
handleFile(row){
this.file=row
let lastName=row.fileName.split('.')
let list=['xls','xlsx','XLS','XLSX']
if(list.indexOf(lastName[lastName.length-1])>-1){
@@ -283,9 +285,16 @@ export default {
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
this.$api.report.reportDownload({ reportId: this.row.id}).then(res => {
downloadFile(res)
})
if(this.isExcel){
this.$api.report.reportDownloadALL({ reportId: this.row.id}).then(res => {
downloadFile(res)
})
}else{
this.$api.report.reportDownload({ reportId: this.row.id}).then(res => {
downloadFile(res)
})
}
// })
},
// 获取详情
@@ -300,7 +309,11 @@ export default {
},
mounted() {
this.reportId = this.$route.query.reportId
if(this.$route.query.isExecel){
this.isExcel=true
}else{
this.isExcel=false
}
// this.previewRow()
this.getComment()
this.getReportDetail()
+1 -1
View File
@@ -731,7 +731,7 @@ export default {
// this.content = data.content;
// this.dialogPreview = true;
// })
window.open('/report/detail?id='+this.$route.query.id+'&reportId='+row.id)
window.open('/report/detail?id='+this.$route.query.id+'&reportId='+row.id +'&isExecel=1')
// this.$router.push({path: '/report/detail', query: {id: this.$route.query.id, reportId: row.id}})
this.reportDateList();
},