|
|
@ -7,6 +7,8 @@ |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<!--start 添加修改按钮--> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small">导出</el-button> |
|
|
|
<el-button type="primary" size="small" @click="download">下载</el-button> |
|
|
|
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -76,6 +78,7 @@ |
|
|
|
<script> |
|
|
|
import req from '@/api/specialrebate/specialrebatewithholding' |
|
|
|
import zhuanxiangfanliyutiInfo from './relation/zhuanxiangfanliyutiInfo' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'ZhuanXiangFanLiYuTiYiBanInfo', |
|
|
@ -223,6 +226,32 @@ export default { |
|
|
|
}) |
|
|
|
return sums |
|
|
|
}, |
|
|
|
download() { |
|
|
|
req.createPdf({ specialWithSid: this.formobj.sid, userName: window.sessionStorage.getItem('name') }).then((resp) => { |
|
|
|
if (resp.success && resp.data !== '') { |
|
|
|
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() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 确认撤回任务 */ |
|
|
|
openRevoke() { |
|
|
|
this.$confirm('是否确认执行撤回操作', '提示', { |
|
|
|