From c6d0dcdccdb898e1abcdb7fb8312d3b7b653743f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 16 八月 2022 01:34:18 +0800
Subject: [PATCH] 2022-08-16

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index ff0cd12..8eeb0c5 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -726,9 +726,16 @@
             _param[setting.primaryKey] = cell[setting.primaryKey]
           }
 
+          let _cell = {}
+          if (index !== 0) {
+            Object.keys(cell).forEach(key => {
+              _cell[key.toLowerCase()] = cell[key]
+            })
+          }
+
           formlist.forEach(_data => {
-            if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) {
-              _param[_data.key] = cell[_data.key]
+            if (index !== 0 && _data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) {
+              _param[_data.key] = _cell[_data.key.toLowerCase()]
             } else {
               _param[_data.key] = _data.value
             }
@@ -1519,10 +1526,22 @@
   }
 
   modelconfirm = () => {
-    const { BData } = this.props
     const { btnconfig, selines } = this.state
     let _this = this
     let result = []
+    let _data = {}
+    let BData = {}
+
+    if (selines[0]) {
+      Object.keys(selines[0]).forEach(key => {
+        _data[key.toLowerCase()] = selines[0][key]
+      })
+    }
+    if (this.props.BData) {
+      Object.keys(this.props.BData).forEach(key => {
+        BData[key.toLowerCase()] = this.props.BData[key]
+      })
+    }
     
     btnconfig.fields.forEach(item => {
       if (!item.field) return
@@ -1533,10 +1552,10 @@
         _readin = false
       }
 
-      if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) {
-        _initval = BData[item.field]
-      } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) {
-        _initval = selines[0][item.field]
+      if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) {
+        _initval = BData[item.field.toLowerCase()]
+      } else if (_readin && _data.hasOwnProperty(item.field.toLowerCase())) {
+        _initval = _data[item.field.toLowerCase()]
       } else if (item.type === 'date' && _initval) {
         _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD')
       } else if (item.type === 'datemonth' && _initval) {

--
Gitblit v1.8.0