Browse Source

完善销售订单查询--增加下载合同

master
yunuo970428 2 years ago
parent
commit
6be14359f6
  1. 27
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue

27
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue

@ -61,9 +61,10 @@
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column width="50" type="selection" align="center"/>
<el-table-column fixed label="序号" width="60" type="index" :index="indexMethod" align="center"/>
<el-table-column fixed label="操作" width="100" align="center">
<el-table-column fixed label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button type="primary" v-show="scope.row.printOrderBtn" size="mini" @click="handlePrint(scope.row)">下载打印</el-button>
<el-button type="primary" v-show="scope.row.printOrderBtn" size="mini" @click="handlePrint(scope.row)">下载订单</el-button>
<el-button type="primary" v-show="scope.row.showContractBtn2" size="mini" @click="handleDown(scope.row)">下载合同</el-button>
</template>
</el-table-column>
<el-table-column label="分公司" align="center" width="120">
@ -412,6 +413,28 @@ export default {
}
})
},
handleDown(row) {
var xhr = new XMLHttpRequest()
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + row.contractFilePath + '&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()
},
handleLook(row) {
this.viewState = 2
let aa = null

Loading…
Cancel
Save