|
|
@ -43,6 +43,7 @@ |
|
|
|
<el-table-column label="操作" width="180px" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="toEdit(scope.row)" :disabled="scope.row.nodeState =='发起申请' ? false : scope.row.nodeState == '待提交' ? false : true">办理</el-button> |
|
|
|
<el-button type="primary" size="mini" :disabled="scope.row.nodeState !='已办结'" @click="toDownload(scope.row)">下载</el-button> |
|
|
|
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -324,6 +325,32 @@ export default { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divAdd'].showEdit(row) |
|
|
|
}, |
|
|
|
toDownload(row) { |
|
|
|
req.createPdf({ sid: row.sid, userName: window.sessionStorage.getItem('name') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.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(() => {}) |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 4 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|