king
2025-02-12 ed698a4ef051a13fe22c9ccfe121232c753725c1
src/utils/utils-custom.js
@@ -1886,6 +1886,25 @@
    if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
      if (!cell.modal || cell.modal.fields.length === 0) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`})
      } else if (cell.OpenType === 'pop') {
        let forms = []
        cell.modal.fields.forEach(n => {
          if (n.type === 'funcvar' && n.field) {
            forms.push(n.field)
          }
        })
        if (cell.verify && cell.verify.billcodes && cell.verify.billcodes.length > 0) {
          let bills = cell.verify.billcodes.filter(item => item.status !== 'false').map(item => item.field)
          bills.forEach(n => {
            if (!forms.includes(n)) {
              errors.push({ level: 0, detail: `按钮“${cell.label}”中单号生成的函数变量“${n}”不存在`})
            }
          })
          forms = forms.filter(n => !bills.includes(n))
        }
        if (forms.length) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”中函数变量表单“${forms.join(',')}”尚未使用`})
        }
      }
    } else if (cell.OpenType === 'excelIn') {
      if (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0) {
@@ -2085,6 +2104,73 @@
    }
  }
  if (card.$c_fc) {
    let idCtrl = false
    let supModule = ''
    if (card.wrap.datatype === 'dynamic') {
      supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
      if (supModule === 'empty') {
        supModule = ''
      }
    } else {
      if (card.wrap.datatype === 'static') {
        supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
      } else {
        supModule = null
      }
    }
    card.subcards.forEach(item => {
      if (item.subButton.intertype === 'system' && !item.subButton.sqlType) {
        errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`})
      }
      if (item.subButton.verify && !item.subButton.output) {
        if (item.subButton.verify.noteEnable === 'true') {
          errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`})
        } else if (item.subButton.verify.emailEnable === 'true') {
          errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`})
        }
      }
      let forms = []
      item.fields.forEach(m => {
        if (m.type === 'funcvar' && m.field) {
          forms.push(m.field)
        }
        if (m.dataSource && /@ID@/ig.test(m.dataSource)) {
          idCtrl = true
        }
        if (m.type === 'linkMain' && !supModule && supModule !== null) {
          if (item.setting && item.setting.title) {
            errors.push({ level: 1, detail: `请检查分组“${item.setting.title}”中关联主表“${m.label}”是否有效`})
          } else {
            errors.push({ level: 1, detail: `请检查关联主表“${m.label}”是否有效`})
          }
        }
      })
      if (item.subButton.verify && item.subButton.verify.billcodes && item.subButton.verify.billcodes.length > 0) {
        let bills = item.subButton.verify.billcodes.filter(item => item.status !== 'false').map(item => item.field)
        bills.forEach(n => {
          if (!forms.includes(n)) {
            errors.push({ level: 0, detail: `按钮“${item.subButton.label}”中单号生成的函数变量“${n}”不存在`})
          }
        })
        forms = forms.filter(n => !bills.includes(n))
      }
      if (forms.length) {
        if (item.setting && item.setting.title) {
          errors.push({ level: 0, detail: `分组“${item.setting.title}”中函数变量表单“${forms.join(',')}”尚未使用`})
        } else {
          errors.push({ level: 0, detail: `函数变量表单“${forms.join(',')}”尚未使用`})
        }
      }
    })
    card.idCtrl = idCtrl
  }
  return errors
}