king
2025-01-14 9348217f72a36dc66d86934acbf439096a7ec503
src/utils/utils.js
@@ -1775,7 +1775,6 @@
  let primaryId = param.ID
  let BID = param.BID || ''
  let verify = btn.verify || {}
  let datavars = {}                 // 声明的变量,表单及显示列
  let _actionType = null
  let _callbacksql = ''
@@ -1825,7 +1824,6 @@
  // 获取字段键值对
  formdata && formdata.forEach(form => {
    let _key = form.key.toLowerCase()
    datavars[_key] = form.value
    if (!_initvars.includes(_key)) {
      _initvars.push(_key)
@@ -1880,14 +1878,12 @@
  // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过)
  if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) {
    datavars = {..._data, ...datavars}
    const setField = (col) => {
      if (!col.field) return
      let _key = col.field.toLowerCase()
      if (!_initvars.includes(_key)) {
        let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : ''
        let _val = _data.hasOwnProperty(_key) ? _data[_key] : ''
        if (col.datatype && /^date/ig.test(col.datatype) && !_val) {
          _val = '1949-10-01'
@@ -2176,18 +2172,27 @@
      item.field.split(',').forEach((_field, index) => {
        let _key = _field.toLowerCase()
        let _val = datavars[_key] !== undefined ? datavars[_key] : ''
        let _val = ''
        let _val2 = ''
        arr.push(_key)
        if (_key === 'bid' && !_val) { // 表单中没有bid则使用系统bid变量
          _val = BID
        if (_key === 'bid') {
          _val = `'${BID}'`
        } else {
          _val = `@${_field}`
        }
        _fieldValue.push(`${_key}='${_val}'`)
        _value.push(`${_labels[index] || ''}:${_val || ''}`)
        if (_key === 'bid') {
          _val2 = BID
        } else {
          _val2 = `' + @${_field} + '`
        }
        _fieldValue.push(`${_key}=${_val}`)
        _value.push(`${_labels[index] || ''}:${_val2}`)
      })
      if (!arr.includes(primaryKey.toLowerCase())) {
      if (!arr.includes(primaryKey.toLowerCase()) && btn.Ot !== 'notRequired') {
        _fieldValue.push(`${primaryKey} !='${primaryId}'`)
      }
@@ -2246,7 +2251,7 @@
    _sql += `
      /* 创建凭证 */
      exec s_BVoucher_Create
        @Bill ='${_data[_voucher.linkField.toLowerCase()] || ''}',
        @Bill = @${_voucher.linkField},
        @BVoucherType ='${_voucher.BVoucherType}',
        @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
        @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',