From a9b02f6862522b54d0824152017bf2acfec2af7b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 三月 2024 10:29:50 +0800
Subject: [PATCH] 2024-03-21

---
 src/tabviews/zshare/actionList/normalbutton/index.jsx |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index 4f97b7d..1f42b73 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2475,9 +2475,38 @@
 
     if (!id) return
 
-    setTimeout(() => {
-      window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))))
-    }, 500)
+    if (btn.verify.preHandle === 'true' && btn.verify.pre_func && /#position-print/.test(btn.verify.pre_func)) {
+      MKEmitter.emit('queryModuleParam', btn.$menuId, (res) => {
+        let searches = {}
+        res.search && res.search.forEach(item => {
+          searches[item.key] = item.value
+        })
+        let _param = { id: id || '', tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')}
+
+        try {
+          // eslint-disable-next-line
+          let func = new Function('btn', 'searches', 'param', 'systemType', btn.verify.pre_func)
+          _param = func(btn, searches, _param, window.GLOB.systemType)
+        } catch (e) {
+          console.warn(e)
+        }
+
+        if (!_param || _param.error) {
+          notification.warning({
+            top: 92,
+            message: _param ? _param.error : '鏈幏鍙栧埌鎵撳嵃鍙傛暟锛岃嚜瀹氫箟鑴氭湰閿欒锛�',
+            duration: 5
+          })
+          return
+        }
+        
+        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param))))
+      })
+    } else {
+      setTimeout(() => {
+        window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))))
+      }, 200)
+    }
   }
 
   sendWxMessage = (verify, id) => {

--
Gitblit v1.8.0