From 47cf5518f0f61dbf8066c2273b9f77c2cd7b1751 Mon Sep 17 00:00:00 2001
From: YLouie <929705085@qq.com>
Date: 星期五, 19 九月 2025 17:56:03 +0800
Subject: [PATCH] 销售订单plm同步
---
src/util/fileTransform.js | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/util/fileTransform.js b/src/util/fileTransform.js
index 6471e85..6f8ccec 100644
--- a/src/util/fileTransform.js
+++ b/src/util/fileTransform.js
@@ -36,4 +36,24 @@
URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
document.body.removeChild(elink)
}
-}
\ No newline at end of file
+}
+
+export function transformDoc(response) {
+ const relType = ['application/vnd.openxmlformats-officedocument.wordprocessingml.document']
+ let type = response.data.type
+ if (relType.includes(type)) {
+ const blob = new Blob([response.data], {type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'})
+ const disposition = response.headers["content-disposition"]
+ let temp = disposition.substring(disposition.lastIndexOf('=') + 1)
+ let filename = decodeURI(temp)
+ // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
+ const elink = document.createElement('a')
+ elink.download = filename
+ elink.style.display = 'none'
+ elink.href = URL.createObjectURL(blob)
+ document.body.appendChild(elink)
+ elink.click()
+ URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
+ document.body.removeChild(elink)
+ }
+}
--
Gitblit v1.9.3