From f561deb896de5754d94d17447f3d87aedcbd3198 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 18 九月 2023 20:02:38 +0800
Subject: [PATCH] Merge branch 'positec' into bms

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx |   82 ++++++++++++++++++++++++++++++-----------
 1 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
index ebce7e5..85e463d 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -3,7 +3,6 @@
 import { fromJS } from 'immutable'
 import { Form, Tabs, Row, Col, Button, notification, Modal, message, InputNumber, Spin, Typography, Popconfirm } from 'antd'
 import { EditOutlined, StopOutlined, CheckCircleOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons'
-import moment from 'moment'
 import md5 from 'md5'
 
 import Api from '@/api'
@@ -600,11 +599,25 @@
     const { verify } = this.state
 
     let columns = fromJS(verify.columns).toJS()
-    let fields = columns.map(item => item.Column)
+    let _names = {}
+    let fields = columns.map(item => {
+      let key = item.Column.toLowerCase()
+      _names[key] = item.Text
+
+      return key
+    })
+    let names = {$up: false}
 
     config.columns.forEach(item => {
-      if (fields.includes(item.field) || !item.field) return
-      fields.push(item.field)
+      if (!item.field) return
+      let key = item.field.toLowerCase()
+      if (fields.includes(key)) {
+        if (_names[key] !== item.label) {
+          names.$up = true
+          names[key] = item.label
+        }
+        return
+      }
 
       let cell = {
         Column: item.field,
@@ -627,8 +640,15 @@
 
     if (config.subtype === 'dualdatacard') {
       config.subColumns.forEach(item => {
-        if (fields.includes(item.field) || !item.field) return
-        fields.push(item.field)
+        if (!item.field) return
+        let key = item.field.toLowerCase()
+        if (fields.includes(key)) {
+          if (_names[key] !== item.label) {
+            names.$up = true
+            names[key] = item.label
+          }
+          return
+        }
   
         let cell = {
           Column: item.field,
@@ -650,9 +670,37 @@
       })
     }
 
-    this.setState({
-      verify: {...verify, columns: columns}
-    })
+    if (names.$up) {
+      const that = this
+
+      confirm({
+        content: '閮ㄥ垎瀛楁鍚嶇О涓庢樉绀哄垪涓嶄竴鑷达紝鏄惁鏇存柊锛�',
+        onOk() {
+          columns = columns.map(item => {
+            let key = item.Column.toLowerCase()
+
+            if (names[key]) {
+              item.Text = names[key]
+            }
+
+            return item
+          })
+          
+          that.setState({
+            verify: {...verify, columns: columns}
+          })
+        },
+        onCancel() {
+          that.setState({
+            verify: {...verify, columns: columns}
+          })
+        }
+      })
+    } else {
+      this.setState({
+        verify: {...verify, columns: columns}
+      })
+    }
   }
 
   clearField = () => {
@@ -836,8 +884,7 @@
       return
     }
 
-    let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-    let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils, '2023-04-20 15:29:37')
+    let sql = SettingUtils.getDebugSql(verify, scripts, (verify.useSearch === 'true' ? searches : []), Utils)
 
     let _debugId = md5(sql)
 
@@ -846,17 +893,8 @@
       return
     }
 
-    let param = {
-      func: 's_debug_sql',
-      exec_type: 'y',
-      LText: sql
-    }
-    param.LText = Utils.formatOptions(param.LText)
-    param.timestamp = timestamp
-    param.secretkey = Utils.encrypt('', timestamp)
-
-    Api.genericInterface(param).then(result => {
-      if (result.status) {
+    Api.sDebug(sql).then(result => {
+      if (result.status || result.ErrCode === '-2') {
         this.setState({debugId: _debugId})
         _resolve()
       } else {

--
Gitblit v1.8.0