From 6be14359f6fc9452cc62969f0144c8755008ecd7 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Mon, 3 Jul 2023 13:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E8=AF=A2--=E5=A2=9E=E5=8A=A0=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=90=88=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dingdanchaxun/xiaoshoudingdanchaxun.vue | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue b/anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue index 7b3027469a..09da110879 100644 --- a/anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue +++ b/anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/dingdanchaxun/xiaoshoudingdanchaxun.vue @@ -61,9 +61,10 @@ - + @@ -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