| | |
| | | |
| | | let primaryKey = setting.primaryKey || 'id' // 主键字段 |
| | | // 系统变量声明与设置初始值 |
| | | let _sql = `Declare @tbid nvarchar(50), @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50) |
| | | Select @BVoucher='',@FIBVoucherDate='',@FiYear='' |
| | | let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50) |
| | | ` |
| | | if (verify && verify.scripts && verify.scripts.length > 0 && formdata) { |
| | | let _formfields = formdata.filter(form => !['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear'].includes(form.key)) |
| | | _formfields = _formfields.map(form => `@${form.key} nvarchar(50)`) |
| | | _formfields = _formfields.join(',') |
| | | _sql += `${_formfields} |
| | | ` |
| | | } |
| | | |
| | | _sql += `Select @BVoucher='',@FIBVoucherDate='',@FiYear='' |
| | | ` |
| | | |
| | | if (verify && verify.accountdate === 'true') { // 启用账期验证 |
| | |
| | | let _val = '' |
| | | if (item.linkField === 'BID' && BID) { // 替换bid |
| | | _val = BID |
| | | } else if (data.hasOwnProperty(item.linkField)) { |
| | | } else if (data && data.hasOwnProperty(item.linkField)) { |
| | | _val = data[item.linkField] |
| | | } |
| | | _ModularDetailCode = item.TypeCharOne + _val |
| | |
| | | |
| | | let _updateconfig = '' |
| | | |
| | | if (verify && verify.voucher && verify.voucher.enabled) { // 凭证-显示列中选取,必须选行 |
| | | if (verify && verify.voucher && verify.voucher.enabled && data) { // 凭证-显示列中选取,必须选行 |
| | | let _voucher = verify.voucher |
| | | |
| | | _updateconfig = ',BVoucher=@BVoucher,FIBVoucherDate=@FIBVoucherDate,FiYear=@FiYear' |
| | |
| | | } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'delete') { // 物理删除 |
| | | _sql += `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: ${primaryKey}='+@${primaryKey},@userid delete ${btn.sql} where ${primaryKey}=@${primaryKey}` |
| | | } |
| | | _sql += ` |
| | | aaa: |
| | | select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | |
| | | if (verify && verify.scripts && verify.scripts.length > 0) { |
| | | let _scripts = '' |
| | | verify.scripts.forEach(item => { |
| | | _scripts += `${item.sql} |
| | | ` |
| | | }) |
| | | _sql += ` |
| | | ${_scripts}` |
| | | } |
| | | |
| | | _sql += `aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | console.log(_sql) |
| | | return _sql |