From 7ad159fbf6f0d1e8fb4650f640bfc0c07cf0fd26 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十二月 2024 14:24:40 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   81 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index e204a75..b0e6202 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -558,9 +558,47 @@
     const { btn } = this.props
 
     let callback = null
+    let printReject = null
+    let skip = false
+    let send = false
+
+    let data = fromJS({
+      data: printlist,
+      form: formdata
+    }).toJS()
+
+    if (!window.GLOB.errorLog) {
+      printReject = (msg) => {
+        if (send) return
+
+        send = true
+        data.message = msg
+
+        window.mkInfo(JSON.stringify(data))
+      }
+    } else {
+      printReject = (msg) => {
+        if (send) return
+
+        send = true
+        data.message = msg
+
+        let param = {
+          func: 's_special_error_note_log',
+          api_url: btn.logLabel,
+          error_code: 507,
+          error_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+          api_param: JSON.stringify(data)
+        }
+        Api.genericInterface(param)
+      }
+    }
 
     if (/callback\(\)/.test(btn.verify.printFunc)) {
       callback = () => {
+        if (skip) return
+        skip = true
+
         this.execSuccess({
           ErrCode: '-1',
           message: '',
@@ -577,8 +615,8 @@
 
     try {
       // eslint-disable-next-line
-      let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', 'callback', btn.verify.printFunc)
-      func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType, callback)
+      let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', 'callback', 'printReject', btn.verify.printFunc)
+      func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType, callback, printReject)
 
       // 鑷畾涔夋墦鍗扮ず渚�
       // let defaultPrinter = printer.defaultPrinter || 'lackprinter'
@@ -779,6 +817,8 @@
         message: window.GLOB.dict['func_error'] || '鑷畾涔夊嚱鏁版墽琛岄敊璇紒',
         duration: 5
       })
+
+      printReject(window.GLOB.dict['func_error'] || '鑷畾涔夊嚱鏁版墽琛岄敊璇紒')
     }
   }
 
@@ -1694,6 +1734,41 @@
     const { btn } = this.props
     const { dict } = this.state
 
+    let printReject = null
+    let send = false
+
+    let data = fromJS({ 
+      data: list,
+      template: template
+    }).toJS()
+
+    if (!window.GLOB.errorLog) {
+      printReject = (msg) => {
+        if (send) return
+
+        send = true
+        data.message = msg
+
+        window.mkInfo(JSON.stringify(data))
+      }
+    } else {
+      printReject = (msg) => {
+        if (send) return
+
+        send = true
+        data.message = msg
+
+        let param = {
+          func: 's_special_error_note_log',
+          api_url: btn.logLabel,
+          error_code: 507,
+          error_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+          api_param: JSON.stringify(data)
+        }
+        Api.genericInterface(param)
+      }
+    }
+
     let _errors = []
 
     let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter'
@@ -1906,6 +1981,8 @@
           message: data.message,
           status: false
         })
+
+        printReject(data.message)
       }
     }
 

--
Gitblit v1.8.0