king
2024-09-15 dbc911dbb044895f98a49ef69ef5a5800a4aba3e
src/utils/utils-custom.js
@@ -1950,6 +1950,33 @@
    }
    if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) {
      if (cell.Ot !== 'requiredOnce' && ['pop', 'form'].includes(cell.OpenType) && cell.verify && cell.verify.uniques && cell.verify.uniques.length > 0) {
        let forms = ['BID']
        if (cell.OpenType === 'form') {
          forms.push(cell.field)
        } else if (cell.modal && cell.modal.fields.length > 0) {
          cell.modal.fields.forEach(n => {
            if (!n.field) return
            forms.push(n.field)
          })
        }
        let emptys = []
        cell.verify.uniques.forEach(m => {
          if (m.status === 'false') return
          m.field.split(',').forEach(n => {
            if (!forms.includes(n)) {
              emptys.push(n)
            }
          })
        })
        if (emptys.length) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单中不存在!`})
        }
      }
      if (cell.OpenType === 'form' && cell.formType === 'count_line') return
     
      if (cell.intertype === 'system') {
@@ -3428,7 +3455,7 @@
            type: item.type,
            isconst: item.constant === 'true'
          }
          if (_item.type === 'datemonth') {
            _item.type = 'text'
          } else if (_item.type === 'number' || _item.type === 'rate') {
@@ -3698,6 +3725,7 @@
        item.field.split(',').forEach((_field, index) => {
          let _key = _field.toLowerCase()
          let _val = ''
          let _val2 = ''
  
          arr.push(_key)
          if (_key === 'bid') { // 表单中没有bid则使用系统bid变量
@@ -3707,7 +3735,14 @@
          }
          _fieldValue.push(`${_key}=${_val}`)
          _value.push(`${_labels[index] || ''}:${_val || ''}`)
          if (_key === 'bid') { // 表单中没有bid则使用系统bid变量
            _val2 = `' + ${BID} + '`
          } else {
            _val2 = `@mk_${_key}_mk@`
          }
          _value.push(`${_labels[index] || ''}:${_val2}`)
        })
  
        if (!arr.includes(primaryKey.toLowerCase())) {
@@ -3797,11 +3832,7 @@
        let _key = item.key.toLowerCase()
  
        keys.push(_key)
        if (item.type === 'number' || item.type === 'rate') {
          values.push('@mk_' + _key + '_mk@')
        } else {
          values.push(`'@mk_${_key}_mk@'`)
        }
        values.push('@' + _key)
      })
  
      if (!keys.includes(primaryKey.toLowerCase())) {
@@ -3845,11 +3876,7 @@
        let _key = item.key.toLowerCase()
        
        _arr.push(_key)
        if (item.type === 'number' || item.type === 'rate') {
          _form.push(`${_key}=@mk_${_key}_mk@`)
        } else {
          _form.push(`${_key}='@mk_${_key}_mk@'`)
        }
        _form.push(_key + '=@' + _key)
      })
  
      if (_actionType === 'audit') {
@@ -4781,7 +4808,7 @@
        arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}'
      `
      _tailScript += `${_tailScript}
      _tailScript = `${_tailScript}
        select @ErrorCode as ErrorCode,@retmsg as retmsg
        ${callback}
      `
@@ -4791,7 +4818,7 @@
        arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}'
      `
      _tailScript += `${_tailScript}
      _tailScript = `${_tailScript}
        select @ErrorCode as ErrorCode,@retmsg as retmsg
      `
    }