|
|
@ -159,6 +159,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { createPdf, createPdfRsk, listPage, ctskd } from '@/api/anruifinmanagement/paymentConfirmation.js' |
|
|
|
import req from '@/api/anruifinmanagement/subscriptionAfterSale' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
@ -184,7 +185,7 @@ export default { |
|
|
|
visibleDisabled: false, |
|
|
|
printSid: '', |
|
|
|
print: '', |
|
|
|
printSource: false, |
|
|
|
printSource: '', |
|
|
|
btndisabled: false, |
|
|
|
isSearchShow: false, |
|
|
|
searchxianshitit: '隐藏查询条件', |
|
|
@ -365,13 +366,13 @@ export default { |
|
|
|
}, |
|
|
|
handleDownLoad(row) { |
|
|
|
this.printSid = row.sid |
|
|
|
this.printSource = row.loan |
|
|
|
this.printSource = row.source |
|
|
|
this.print = '' |
|
|
|
this.dialogVisible = true |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
this.visibleDisabled = true |
|
|
|
if (!this.printSource) { |
|
|
|
if (this.printSource === '02') { |
|
|
|
createPdf({ skdSid: this.printSid, printerType: this.print }).then((resp) => { |
|
|
|
if (resp.success && resp.data.pdfPath !== '') { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
@ -396,7 +397,7 @@ export default { |
|
|
|
xhr.send() |
|
|
|
this.dialogVisible = false |
|
|
|
this.printSid = '' |
|
|
|
this.printSource = false |
|
|
|
this.printSource = '' |
|
|
|
this.visibleDisabled = false |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
@ -405,7 +406,41 @@ export default { |
|
|
|
}).catch(() => { |
|
|
|
this.visibleDisabled = false |
|
|
|
}) |
|
|
|
} else if (this.printSource) { |
|
|
|
} else if (this.printSource === '03') { |
|
|
|
req.createPdf({ skdSid: this.printSid, printerType: this.print }).then((resp) => { |
|
|
|
if (resp.success && resp.data.pdfPath !== '') { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.data.pdfPath + '&outFileName=' + '售后收款单', true) |
|
|
|
xhr.setRequestHeader('token', getStorage()) |
|
|
|
xhr.responseType = 'blob' |
|
|
|
xhr.onload = function(e) { |
|
|
|
// 如果请求执行成功 |
|
|
|
var blob = this.response |
|
|
|
var filename = '售后收款单.pdf' |
|
|
|
var a = document.createElement('a') |
|
|
|
// blob.type="application/octet-stream"; |
|
|
|
// 创键临时url对象 |
|
|
|
var url = URL.createObjectURL(blob) |
|
|
|
a.href = url |
|
|
|
a.download = filename |
|
|
|
a.click() |
|
|
|
// 释放之前创建的URL对象 |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} |
|
|
|
// 发送请求 |
|
|
|
xhr.send() |
|
|
|
this.dialogVisible = false |
|
|
|
this.printSid = '' |
|
|
|
this.printSource = '' |
|
|
|
this.visibleDisabled = false |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
|
this.visibleDisabled = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.visibleDisabled = false |
|
|
|
}) |
|
|
|
} else if (this.printSource === '' || this.printSource === null) { |
|
|
|
createPdfRsk({ skdSid: this.printSid, printerType: this.print }).then((resp) => { |
|
|
|
if (resp.success && resp.data.pdfPath !== '') { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
@ -430,7 +465,7 @@ export default { |
|
|
|
xhr.send() |
|
|
|
this.dialogVisible = false |
|
|
|
this.printSid = '' |
|
|
|
this.printSource = false |
|
|
|
this.printSource = '' |
|
|
|
this.visibleDisabled = false |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
|