From 04a71ecb03c8aaebceade470045ea8676f0baf2f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 01 七月 2022 14:31:23 +0800
Subject: [PATCH] 2022-07-01

---
 src/views/billprint/index.jsx |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index 5493e12..62ead55 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -37,6 +37,7 @@
     data: '',
     tempId: '',
     config: null,
+    urlParam: null,
     auto: true
   }
 
@@ -58,7 +59,8 @@
         sessionStorage.setItem('localDataM', param.dataM || '')
         this.setState({
           BID: param.id || '',
-          tempId: param.tempId
+          tempId: param.tempId,
+          urlParam: param
         }, () => {
           this.getMenuParam()
         })
@@ -135,7 +137,7 @@
   }
 
   getMenuParam = () => {
-    const { tempId, BID } = this.state
+    const { tempId, BID, urlParam } = this.state
 
     let _param = {
       func: 'sPC_Get_LongParam',
@@ -243,6 +245,16 @@
           })
         }
 
+        if (config.urlFields) {
+          config.urlFields.forEach(field => {
+            let val = `'${urlParam ? (urlParam[field] || '') : ''}'`
+            regs.push({
+              reg: new RegExp('@' + field + '@', 'ig'),
+              value: val
+            })
+          })
+        }
+
         config.components = config.components.map(component => {
           if (component.action) component.action = []
           if (component.search) component.search = []

--
Gitblit v1.8.0