Browse Source

完善交回车辆出库申请

master
yunuo970428 1 month ago
parent
commit
b6257d4776
  1. 7
      anrui-riskcenter-ui/src/api/returntothewarehouse/returntothewarehouse.js
  2. 27
      anrui-riskcenter-ui/src/views/returntothewarehouse/returntothewarehouse.vue

7
anrui-riskcenter-ui/src/api/returntothewarehouse/returntothewarehouse.js

@ -25,6 +25,13 @@ export default {
params: data
})
},
createPdf: function(data) {
return request({
url: '/riskcenter/v1/loanoutboundapply/createPdf',
method: 'post',
params: data
})
},
// 提交流程
submit: function(params) {
return request({

27
anrui-riskcenter-ui/src/views/returntothewarehouse/returntothewarehouse.vue

@ -79,6 +79,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>
@ -338,6 +339,32 @@ export default {
this.viewState = 4
this.$refs['divInfo'].showInfo(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(() => {})
},
//
resetState() {
this.viewState = 1

Loading…
Cancel
Save