From f7d1f17bdcb8c3e794a798165737bb7529dbe8ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 三月 2020 12:15:19 +0800 Subject: [PATCH] 2020-03-26 --- src/utils/utils.js | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index d96799c..d757a9c 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -194,7 +194,9 @@ key: search.field, match: search.match, type: search.type, - value: search.initval + label: search.label, + value: search.initval, + required: search.required === 'true' } if (item.type === 'date') { item.value = item.value ? moment().subtract(item.value, 'days').format('YYYY-MM-DD') : '' @@ -287,6 +289,12 @@ newsearches[item.key] = item.value.join(',') } else { newsearches[item.key] = item.value + } + }) + + Object.keys(newsearches).forEach(key => { + if (!newsearches[key]) { + delete newsearches[key] } }) @@ -626,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'] // 涓婚敭瀛楁 @@ -637,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 = [] @@ -726,11 +732,6 @@ ` } - // 娣诲姞鏃朵富閿负绌� 鏀逛负鍓嶅彴鐢熸垚 - // if (btn.sqlType === 'insert') { - // primaryId = '' - // } - // 鍘婚櫎绂佺敤鐨勯獙璇� if (verify.contrasts) { verify.contrasts = verify.contrasts.filter(item => item.status !== 'false') @@ -748,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}' ` // 鍚敤璐︽湡楠岃瘉 @@ -918,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 @@ -971,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 = [] @@ -1023,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