|
|
@ -43,7 +43,7 @@ |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column width="50px" fixed type="selection" align="center"/> |
|
|
|
<el-table-column width="80px" fixed label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="操作" fixed width="100px" align="center"> |
|
|
|
<el-table-column label="操作" fixed width="180px" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="handlePrint(scope.row)">打印</el-button> |
|
|
|
<el-button type="primary" :disabled="scope.row.state === '未支付' ? false : true" size="mini" @click="handleEdit(scope.row)">办理</el-button> |
|
|
@ -462,34 +462,58 @@ export default { |
|
|
|
this.dialogUrl = row.payFile |
|
|
|
}, |
|
|
|
handlePrint(row) { |
|
|
|
axios({ |
|
|
|
method: 'get', |
|
|
|
url: process.env.VUE_APP_URL + '/api/fin/v1/finpaymentrecord/createPdf', |
|
|
|
params: { |
|
|
|
sid: row.sid |
|
|
|
}, |
|
|
|
responseType: 'blob', |
|
|
|
headers: { token: getStorage() } |
|
|
|
}).then((response) => { |
|
|
|
console.log(response) |
|
|
|
if (response.data == undefined) { |
|
|
|
const blob = new Blob([response], { type: 'application/pdf' }) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = window.URL.createObjectURL(blob) |
|
|
|
link.download = '出纳付款.pdf' |
|
|
|
link.click() |
|
|
|
window.URL.revokeObjectURL(link.href) |
|
|
|
} else { |
|
|
|
const blob = new Blob([response.data], { type: 'application/pdf' }) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = window.URL.createObjectURL(blob) |
|
|
|
link.download = '出纳付款.pdf' |
|
|
|
link.click() |
|
|
|
window.URL.revokeObjectURL(link.href) |
|
|
|
req.createPdf({ sid: row.sid }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + resp.data + '&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() |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
// axios({ |
|
|
|
// method: 'post', |
|
|
|
// url: '/api' + '/fin/v1/finpaymentrecord/createPdf', |
|
|
|
// params: { |
|
|
|
// sid: row.sid |
|
|
|
// }, |
|
|
|
// responseType: 'blob', |
|
|
|
// headers: { token: getStorage() } |
|
|
|
// }).then((response) => { |
|
|
|
// console.log(response) |
|
|
|
// if (response.data == undefined) { |
|
|
|
// const blob = new Blob([response], { type: 'application/pdf' }) |
|
|
|
// const link = document.createElement('a') |
|
|
|
// link.href = window.URL.createObjectURL(blob) |
|
|
|
// link.download = '出纳付款.pdf' |
|
|
|
// link.click() |
|
|
|
// window.URL.revokeObjectURL(link.href) |
|
|
|
// } else { |
|
|
|
// const blob = new Blob([response.data], { type: 'application/pdf' }) |
|
|
|
// const link = document.createElement('a') |
|
|
|
// link.href = window.URL.createObjectURL(blob) |
|
|
|
// link.download = '出纳付款.pdf' |
|
|
|
// link.click() |
|
|
|
// window.URL.revokeObjectURL(link.href) |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// this.$message.error(error) |
|
|
|
// }) |
|
|
|
}, |
|
|
|
handleEdit(row) { |
|
|
|
this.dialogVisible = true |
|
|
|