From fb616f2a4d91dd9fb16320fb0b3d5fc3cd9e112c Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 05 一月 2024 13:30:02 +0800 Subject: [PATCH] 销售订单-下载按钮修改2 --- src/api/plan/customerorder.js | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/api/plan/customerorder.js b/src/api/plan/customerorder.js index 9a05ac4..3c851b7 100644 --- a/src/api/plan/customerorder.js +++ b/src/api/plan/customerorder.js @@ -260,7 +260,7 @@ export function downloadProcessConfigFile(filename, bucket, originalFileName) { return request({ url: '/mes/plan/customerOrder/processConfig/' + bucket + '/' + filename, - method: 'get', + method: 'post', responseType: 'blob' }).then((response) => { // 澶勭悊杩斿洖鐨勬枃浠舵祦 @@ -391,7 +391,31 @@ // 浣滃簾 export function dropByContractNo(contractNo) { return request({ - url: '/mes/plan/customerOrder/dropByContractNo/' + contractNo, - method: 'get' + url: '/mes/plan/customerOrder/dropByContractNo', + method: 'get', + params: contractNo }) } + +export function downloadWordFile(data) { + return request({ + url: '/mes/plan/customerOrder/package', + method: 'post', + params: data, + responseType: 'blob' + }).then((response) => { + // 澶勭悊杩斿洖鐨勬枃浠舵祦 + const blob = response.data + const link = document.createElement('a') + link.href = URL.createObjectURL(blob) + link.download = data.originalFileName + document.body.appendChild(link) + link.click() + window.setTimeout(function() { + URL.revokeObjectURL(blob) + document.body.removeChild(link) + }, 0) + }) + } + + -- Gitblit v1.9.3