From a24beb36feaa46f39cbb26ce5277e84f91241ce8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 26 三月 2020 01:30:05 +0800
Subject: [PATCH] 2020-03-26

---
 src/utils/utils.js |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index a3abb26..d757a9c 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -634,7 +634,6 @@
     let _formFieldValue = {}
     // 闇�瑕佸0鏄庣殑鍙橀噺闆�
     // let _vars = ['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'UserName', 'FullName', 'ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey']
-    // let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey']
     let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode']
 
     // 涓婚敭瀛楁
@@ -645,7 +644,6 @@
       `
 
     // let _initvars = ['ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] // 宸茶祴鍊煎瓧娈甸泦
-    // let _initvars = ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'] // 宸茶祴鍊煎瓧娈甸泦
     let _initvars = [] // 宸茶祴鍊煎瓧娈甸泦
     let _initfields = []
     let _declarefields = []
@@ -734,11 +732,6 @@
         `
     }
 
-    // 娣诲姞鏃朵富閿负绌� 鏀逛负鍓嶅彴鐢熸垚
-    // if (btn.sqlType === 'insert') {
-    //   primaryId = ''
-    // }
-
     // 鍘婚櫎绂佺敤鐨勯獙璇�
     if (verify.contrasts) {
       verify.contrasts = verify.contrasts.filter(item => item.status !== 'false')
@@ -756,8 +749,16 @@
       verify.scripts = verify.scripts.filter(item => item.status !== 'false')
     }
 
-    // 鍒濆鍖栧嚟璇佸瓧娈�
-    _sql += `select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg=''
+    let userName = sessionStorage.getItem('User_Name') || ''
+    let fullName = sessionStorage.getItem('Full_Name') || ''
+
+    if (sessionStorage.getItem('isEditState') === 'true') {
+      userName = sessionStorage.getItem('CloudUserName') || ''
+      fullName = sessionStorage.getItem('CloudFullName') || ''
+    }
+
+    // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁
+    _sql += `select @BVoucher='',@FIBVoucherDate='',@FiYear='',@ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}'
       `
 
     // 鍚敤璐︽湡楠岃瘉
@@ -926,10 +927,6 @@
         `
     }
 
-    // 鐢ㄤ簬鍙栫敤鎴蜂俊鎭�
-    let _user = `select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@
-      `
-
     let primaryKeyName = ['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(primaryKey.toLowerCase()) ? primaryKey + '@' : primaryKey
 
     let _actionType = null
@@ -979,7 +976,6 @@
 
       keys = keys.join(',')
       values = values.join(',')
-      _sql += _user
       _sql += `insert into ${btn.sql} (${keys}) select ${values};`
     } else if (_actionType === 'update') {
       let _form = []
@@ -1031,7 +1027,6 @@
           }
         })
       }
-      _sql += _user
       _sql += `insert into snote (remark,createuserid,CreateUser,CreateStaff) select '鍒犻櫎琛�:${btn.sql} 鏁版嵁: ${_msg}${primaryKey}='+@${primaryKeyName},@userid@,@username,@fullname delete ${btn.sql} where ${primaryKey}=@${primaryKeyName};`
     }
 

--
Gitblit v1.8.0