From 2d95cc0f94335eee717406e7a777c1193a42081c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 25 四月 2026 15:00:34 +0800
Subject: [PATCH] 天津宝东 1.销售台账填完信息后,可以导出模版供客户直接盖章 2.销售台账打印报价单,可以多选销售订单,得相同公司名称,样式随意发挥 3.销售台账子表格产品的库存状态改为库存数量
---
src/utils/request.js | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/utils/request.js b/src/utils/request.js
index 9cfcf5b..ba31649 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -125,16 +125,25 @@
// 閫氱敤涓嬭浇鏂规硶
export function download(url, params, filename, config) {
downloadLoadingInstance = ElLoading.service({ text: "姝e湪涓嬭浇鏁版嵁锛岃绋嶅��", background: "rgba(0, 0, 0, 0.7)", })
- return service.post(url, params, {
- transformRequest: [(params) => { return tansParams(params) }],
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
- responseType: 'blob',
- ...config
- }).then(async (data) => {
+ const downloadName = config?.filename || filename
+ const requestMethod = (config?.method || 'post').toLowerCase()
+ const requestPromise = requestMethod === 'get'
+ ? service.get(url, {
+ params,
+ responseType: 'blob',
+ ...config
+ })
+ : service.post(url, params, {
+ transformRequest: [(params) => { return tansParams(params) }],
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+ responseType: 'blob',
+ ...config
+ })
+ return requestPromise.then(async (data) => {
const isBlob = blobValidate(data)
if (isBlob) {
const blob = new Blob([data])
- saveAs(blob, filename)
+ saveAs(blob, downloadName)
} else {
const resText = await data.text()
const rspObj = JSON.parse(resText)
--
Gitblit v1.9.3