|
@@ -63,7 +63,7 @@
|
|
|
<template scope="scope">
|
|
|
<el-button :disabled="scope.row.status !== 1" size="mini" type="text" @click="handleToDeposit(scope.row)">转定金</el-button>
|
|
|
<el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
|
|
|
- <el-button :disabled="scope.row.status === 1" size="mini" type="text" @click="downLoad(scope.row)">意向金收据</el-button>
|
|
|
+ <el-button :disabled="scope.row.status === 1" :loading="downLoadFlag" size="mini" type="text" @click="downLoad(scope.row)">意向金收据</el-button>
|
|
|
<el-button :disabled="scope.row.status === 2" size="mini" type="text" @click="handleRefund(scope.row)">退意向金</el-button>
|
|
|
<el-button :disabled="!(scope.row.status === 1)" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
</template>
|
|
@@ -144,6 +144,7 @@ import ToDeposit from '@/views/receiveRefundsManagement/intentionalDepositManage
|
|
|
import RefundIntentionalDeposit from '@/views/receiveRefundsManagement/intentionalDepositManagement/refundIntentionalDeposit.vue'
|
|
|
import constant from '@/static/utils/constant'
|
|
|
import AddIntentionalDeposit from '@/views/customerManagement/intentionalDeposit/addIntentionalDeposit.vue'
|
|
|
+import axios from 'axios'
|
|
|
|
|
|
export default {
|
|
|
name: 'Index',
|
|
@@ -161,7 +162,8 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
dialogTitle: '新增',
|
|
|
dialogRefundVisible: false,
|
|
|
- dialogIntentionalVisible: false
|
|
|
+ dialogIntentionalVisible: false,
|
|
|
+ downLoadFlag: false
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -237,8 +239,32 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
downLoad(row) {
|
|
|
- const url = constant.BASE_URI + '/IntentionalDepositController/downLoadReceipt?id=' + row.id
|
|
|
- window.open(url, '_blank')
|
|
|
+ // const url = constant.BASE_URI + '/IntentionalDepositController/downLoadReceipt?id=' + row.id
|
|
|
+ // window.open(url, '_blank')
|
|
|
+ this.downLoadFlag = true
|
|
|
+ axios({
|
|
|
+ headers: {
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ },
|
|
|
+ method: 'get',
|
|
|
+ url: constant.BASE_URI + '/IntentionalDepositController/downLoadReceipt?id=' + 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
|
|
|
},
|
|
|
handleRefund(val) {
|
|
|
this.dialogRefundVisible = true
|