From ec98e336b79afc2a43c998134b46b71e0e201049 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 20 八月 2021 18:24:09 +0800 Subject: [PATCH] 2021-08-20 --- src/utils/utils.js | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 6804c9e..aaa6d10 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -826,6 +826,11 @@ // 鎺у埗鍙版墦鍗版暟鎹� let conLtext = [] + let cols = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + for (let i = 0; i < 26; i++) { + cols.push('A' + cols[i]) + } + let _Ltext = data.map((item, lindex) => { let vals = [] let convals = [] @@ -833,14 +838,15 @@ if (col.import === 'false') return let val = item[col.Column] !== undefined ? item[col.Column] : '' - let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + (cindex + 1) + dict['main.excel.column'] + ' ' + let _colindex = cols[cindex] || (cindex + 1) + let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + _colindex + dict['main.excel.column'] + ' ' if (/^Nvarchar/ig.test(col.type)) { if (typeof(val) === 'number') { val = val.toString() } - val = val.replace(/(^\s*$)|\t*|\v*/ig, '') + val = val.replace(/(^\s*$)|\t*|\v*|'*/ig, '') if (!val && col.required === 'true') { // 蹇呭~鏍¢獙 errors.push(_position + dict['main.excel.content.emptyerror']) @@ -1181,6 +1187,10 @@ if (!_initvars.includes(_key)) { let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' + + if (col.datatype && /^date/ig.test(col.datatype) && !_val) { + _val = '1900-01-01' + } _initvars.push(_key) _initColfields.push(`@${_key}='${_val}'`) @@ -1748,6 +1758,9 @@ _sql += ` aaa: if @ErrorCode!='' insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@` + } else if (btn.output) { + _sql += ` + aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,${btn.output} as mk_b_id` } else { _sql += ` aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` @@ -1805,7 +1818,6 @@ } } } - } /** -- Gitblit v1.8.0