|
@@ -90,10 +90,11 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column header-align="center" label="操作" width="180">
|
|
|
+ <el-table-column header-align="center" label="操作" width="300">
|
|
|
<template scope="scope">
|
|
|
<el-button size="mini" type="text" :disabled="scope.row.fundCollectionStatus == '2' || scope.row.fundCollectionStatus == '3'" @click="handleEdit(scope.row)">收款登记</el-button>
|
|
|
<el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
|
|
|
+ <el-button :loading="downLoadFlag" :disabled="scope.row.fundCollectionStatus == '1'" size="mini" type="text" @click="downLoad(scope.row)">收据下载</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -135,6 +136,8 @@
|
|
|
import Base from '@/views/base/base'
|
|
|
import BaseData from '@/views/base/baseData'
|
|
|
import AddFunds from '@/views/receiveRefundsManagement/maintenanceFundsManagement/addFunds.vue'
|
|
|
+import axios from 'axios'
|
|
|
+import constant from '@/static/utils/constant'
|
|
|
|
|
|
export default {
|
|
|
name: 'MaintenanceFundsManagementIndex',
|
|
@@ -150,7 +153,8 @@ export default {
|
|
|
loading: false,
|
|
|
// 弹框相关
|
|
|
dialogVisible: false,
|
|
|
- dialogTitle: '新增'
|
|
|
+ dialogTitle: '新增',
|
|
|
+ downLoadFlag: false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -216,8 +220,31 @@ export default {
|
|
|
cancel: function() {
|
|
|
this.dialogVisible = false
|
|
|
},
|
|
|
- downLoad() {
|
|
|
-
|
|
|
+ downLoad(row) {
|
|
|
+ this.downLoadFlag = true
|
|
|
+ axios({
|
|
|
+ headers: {
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ },
|
|
|
+ method: 'get',
|
|
|
+ url: constant.BASE_URI + '/MaintenanceFundsManagementController/downLoadReceipt?contractId=' + row.id,
|
|
|
+ responseType: 'blob'
|
|
|
+ }).then(res => {
|
|
|
+ this.previewPDF(res.data)
|
|
|
+ }).catch((err) => {
|
|
|
+ this.downLoadFlag = false
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ previewPDF(blobPart, filename) {
|
|
|
+ const binaryData = []
|
|
|
+ binaryData.push(blobPart)
|
|
|
+ // 获取blob链接
|
|
|
+ let pdfUrl = ''
|
|
|
+ pdfUrl = window.URL.createObjectURL(new Blob(binaryData, { type: 'application/pdf' }))
|
|
|
+ window.open(pdfUrl)
|
|
|
+ this.downLoadFlag = false
|
|
|
},
|
|
|
baseRequest(opUrl, postData) {
|
|
|
return this.$channel.globeRequest('MaintenanceFundsManagementController', opUrl, postData, 'project')
|