Browse Source

完善销售订单退车申请

master
yunuo970428 1 week ago
parent
commit
ad025d0c61
  1. 7
      anrui-buscenter/anrui-buscenter-ui/src/api/salesManagement/salesorderbycar.js
  2. 29
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdantuiche/salesorderbycar.vue

7
anrui-buscenter/anrui-buscenter-ui/src/api/salesManagement/salesorderbycar.js

@ -19,6 +19,13 @@ export default {
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
}) })
}, },
createPdf: function(data) {
return request({
url: '/buscenter/v1/bussalesorderreturnvehapply/createPdf',
method: 'post',
params: data
})
},
// 保存修改记录 // 保存修改记录
saveOrUpdate: function(params) { saveOrUpdate: function(params) {
return request({ return request({

29
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdantuiche/salesorderbycar.vue

@ -37,6 +37,7 @@
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center">
<template slot-scope="scope"> <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" @click="toEdit(scope.row)" :disabled="scope.row.nodeState =='发起申请' ? false : scope.row.nodeState == '待提交' ? false : true">办理</el-button>
<el-button type="primary" size="mini" v-if="scope.row.nodeState =='已办结'" @click="toDownload(scope.row)">下载</el-button>
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> <el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -204,7 +205,7 @@ export default {
procInsId: row.procInsId, procInsId: row.procInsId,
token: getStorage() token: getStorage()
} }
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params))) this.url = 'http://192.168.0.107:9530/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
}, },
init() { init() {
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => {
@ -320,6 +321,32 @@ export default {
}).catch(() => { }).catch(() => {
}) })
}, },
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) { toInfo(row) {
this.viewState = 4 this.viewState = 4
this.$refs['divInfo'].showInfo(row) this.$refs['divInfo'].showInfo(row)

Loading…
Cancel
Save