【修改】下载
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user