From b09b821ef36fd1ea979e9a5daa98e95732ac81d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 16 七月 2025 18:16:00 +0800 Subject: [PATCH] 2025-07-16 --- src/utils/utils.js | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index cc06e69..f80ad44 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -569,8 +569,8 @@ } else if (item.type === 'range') { let val = item.value.split(',') - newsearches[item.key] = val[0] || -999999999 - newsearches[item.key + '1'] = val[1] || 999999999 + newsearches[item.key] = val[0] || -99999999 + newsearches[item.key + '1'] = val[1] || 99999999 } else if (item.type === 'dateweek') { let _startval = '' let _endval = '' @@ -718,7 +718,7 @@ } else if (item.type === 'range') { let val = item.value.split(',') - searchText.push('(' + item.key + ' >= ' + (val[0] || -999999999) + ' AND ' + item.key + ' <= ' + (val[1] || 999999999) + ')') + searchText.push('(' + item.key + ' >= ' + (val[0] || -99999999) + ' AND ' + item.key + ' <= ' + (val[1] || 99999999) + ')') } else { searchText.push('(' + item.key + ' ' + item.match + ' \'' + item.value + '\')') } @@ -859,12 +859,12 @@ key: item.key, match: '>=', type: 'text', - value: val[0] || -999999999 + value: val[0] || -99999999 }, { key: item.key, match: '<=', type: 'text', - value: val[1] || 999999999 + value: val[1] || 99999999 }) } else { searchText.push(cell) @@ -945,9 +945,9 @@ let copy = JSON.parse(JSON.stringify(item)) copy.key = copy.key + '1' - copy.value = val[1] || 999999999 + copy.value = val[1] || 99999999 - item.value = val[0] || -999999999 + item.value = val[0] || -99999999 options.push(item) options.push(copy) @@ -1187,6 +1187,10 @@ } val = val.replace(/(^\s+$)|\t+|\v+/ig, '') + + if (col.interception !== 'false') { + val = val.replace(/^\s+|\s+$/g, '') + } if (!val && col.required === 'true') { // 蹇呭~鏍¢獙 errors.push(_position + '鍐呭涓嶅彲涓虹┖') @@ -1877,6 +1881,7 @@ let _initColfields = [] let _declarefields = [] let verifyValSql = '' + let datavars = {} // 鑾峰彇瀛楁閿�煎 formdata && formdata.forEach(form => { @@ -1891,6 +1896,7 @@ } let _key = form.key.toLowerCase() + datavars[_key] = form.value if (!_initvars.includes(_key)) { _initvars.push(_key) @@ -1945,6 +1951,8 @@ // 娣诲姞鏁版嵁涓瓧娈碉紝琛ㄥ崟鍊间紭鍏�(鎸夐挳涓嶉�夎鎴栧琛屾嫾鎺ユ椂璺宠繃) if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { + datavars = {..._data, ...datavars} + const setField = (col) => { if (!col.field) return let _key = col.field.toLowerCase() @@ -2239,7 +2247,7 @@ item.field.split(',').forEach((_field, index) => { let _key = _field.toLowerCase() let _val = '' - let _val2 = '' + let _val2 = datavars[_key] !== undefined ? datavars[_key] : '' arr.push(_key) if (_key === 'bid') { @@ -2250,8 +2258,6 @@ if (_key === 'bid') { _val2 = BID - } else { - _val2 = `' + @${_field} + '` } _fieldValue.push(`${_key}=${_val}`) @@ -2665,12 +2671,17 @@ statusName = line.mkdata.statusName sign = line.mkdata.seniorSign || '' target = flow.cells.filter(cell => cell.id === line.target.cell)[0] + let departs = [] line.mkdata.members && line.mkdata.members.forEach(item => { if (line.mkdata.approver === 'departmentManager') { - if (item.job_type === 'manage' && departmentcode === item.parentIds[1]) { - checkIds.push(item.worker_id) - checkUsers.push(item) + if (item.job_type === 'manage') { + if (departmentcode === item.parentIds[1]) { + checkIds.push(item.worker_id) + checkUsers.push(item) + } else if (item.parentNames[1]) { + departs.push(item.parentNames[1]) + } } } else if (line.mkdata.approver === 'directManager') { if (departmentcode === item.parentIds[1] && item.work_grade > work_grade) { @@ -2689,7 +2700,12 @@ if (!target) { error = '鏈煡璇㈠埌宸ヤ綔娴佺洰鏍囪妭鐐�' } else if (checkIds.length === 0 && !['startEdge', 'endEdge', 'throughEdge'].includes(line.mknode)) { - error = '鏈幏鍙栧埌涓嬩竴姝ュ鎵逛汉' + if (departs.length) { + departs = Array.from(new Set(departs)) + error = '鏈幏鍙栧埌涓嬩竴姝ュ鎵逛汉锛岄渶瑕�' + departs.join('銆�') + '鎵嶅彲浠ユ搷浣滃綋鍓嶅姛鑳姐��' + } else { + error = '鏈幏鍙栧埌涓嬩竴姝ュ鎵逛汉' + } } else if (line.approvalMethod === 'countersign' && (!node.checkIds || !node.checkIds.includes(userid))) { error = '褰撳墠鐢ㄦ埛涓嶅湪瀹℃壒浜哄垪琛ㄤ腑' } -- Gitblit v1.8.0