From 400fee62fb40006a9839f1c3a8244b82566b5057 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 08 五月 2025 16:30:39 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/views/billprint/index.jsx |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index a202327..4f2aa10 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -619,9 +619,10 @@
           params.unshift(_pars)
         } else if (window.backend && config.allSqls && params.length > 0) {
           let data = []
+          let ids = []
           params = params.filter(item => {
             if (!item.$backend || item.public) return true
-
+            ids.push(item.componentId)
             item.data[0].exps.forEach(cell => {
               if (cell.key === 'mk_obj_name') {
                 cell.value = 'mk' + item.componentId.slice(-18)
@@ -635,6 +636,7 @@
               $backend: true,
               $type: 's_Get_TableData',
               componentId: '',
+              componentIds: ids,
               data
             })
           }
@@ -668,6 +670,8 @@
           
           if (params.length === 0 && initInters.length === 0) {
             this.setState({loadingview: false, pages: [config.components]})
+
+            this.autoExec()
           } else if (initInters.length > 0) {
             this.loadinit(initInters, params)
           } else {
@@ -983,6 +987,8 @@
     Promise.all(deffers).then(() => {
       if (params.length === 0) {
         this.setState({loadingview: false, pages: [this.state.config.components]})
+
+        this.autoExec()
       } else {
         this.loadmaindata(params)
       }
@@ -997,7 +1003,9 @@
 
     let deffers = params.map(item => {
       let componentId = item.componentId
+      let ids = item.componentIds
       delete item.componentId
+      delete item.componentIds
       delete item.public
       return new Promise(resolve => {
         Api.genericInterface(item).then(res => {
@@ -1015,6 +1023,20 @@
               })
             }
             resolve(false)
+          } else if (ids) {
+            ids.forEach(id => {
+              let _id = 'mk' + id.slice(-18)
+
+              if (res[_id]) {
+                let _data = { $$empty: true }
+                if (res[_id][0]) {
+                  _data = res[_id][0]
+                }
+                window.GLOB.CacheData.set(id, _data)
+              }
+            })
+
+            resolve(res)
           } else {
             res.componentId = componentId
 
@@ -1185,9 +1207,21 @@
       })
 
       this.setState({loadingview: false, pages, rePos})
+
+      this.autoExec()
     })
   }
 
+  autoExec = () => {
+    const { config } = this.state
+
+    if (config.autoExec !== 'true') return
+
+    setTimeout(() => {
+      this.print()
+    }, config.autoExecSplit || 500)
+  }
+
   reloadTabs = () => {
     if (this.reloading) return
 

--
Gitblit v1.8.0