king
2020-02-28 282fd00654a0e777cdbca700fe6488d04fec6be8
src/tabviews/formtab/index.jsx
@@ -94,9 +94,6 @@
      let _arrField = [config.setting.primaryKey]     // 字段集 , 默认添加主键
      // if (this.props.param && this.props.param.arr_field) { // 使用显示列字段查询
      //   _arrField = this.props.param.arr_field
      // } else {
      config.groups.forEach(group => {
        group.sublist.forEach(item => {
          if (!item.field) return
@@ -105,7 +102,6 @@
        })
      })
      _arrField = _arrField.join(',')
      // }
      // 权限过滤
      if (this.props.menuType !== 'HS') {
@@ -122,16 +118,30 @@
        actions: config.action,
        arr_field: _arrField,
        primaryId: this.props.param.primaryId || '',
        data: config.setting.datatype === 'query' ? null : this.props.param.data,
        data: this.props.param.data || null,
        BIDs: {
          mainTable: this.props.param.primaryId || '',
          mainTabledata: config.setting.datatype === 'query' ? '' : this.props.param.data
          mainTable: config.setting.onload === 'true' ? (this.props.param.primaryId || '') : '',
          mainTabledata: config.setting.onload === 'true' ? (config.setting.datatype === 'query' ? '' : this.props.param.data) : ''
        }
      }, () => {
        this.improveSelectOption(config.groups)
        if (config.setting.datatype === 'query' && this.props.param.primaryId) {
          this.loadmaindata()
        if (config.setting.datatype === 'query' && config.setting.onload === 'true') {
          if (!this.props.param.primaryId) {
            notification.warning({
              top: 92,
              message: '未获取到主键ID!',
              duration: 10
            })
          } else {
            this.loadmaindata()
          }
        } else if (config.setting.datatype !== 'query' && (!this.props.param.primaryId || !this.props.param.data)) {
          notification.warning({
            top: 92,
            message: '未获取到主表数据!',
            duration: 10
          })
        }
      })
    } else {
@@ -262,7 +272,7 @@
   * @description 主表数据加载
   */ 
  async loadmaindata () {
    const { setting, BIDs } = this.state
    const { setting, BIDs, config } = this.state
    if (setting.datatype !== 'query') {
      notification.warning({
@@ -290,6 +300,12 @@
      if (_data) {
        _primaryId = _data[setting.primaryKey] || ''
      } else {
        notification.warning({
          top: 92,
          message: '未查询到数据信息!',
          duration: 10
        })
      }
      this.setState({
@@ -301,6 +317,31 @@
          mainTabledata: _data
        }
      })
      if (_data && (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc))) {
        let keys = Object.keys(_data)
        let emptys = []
        if (!keys.includes(config.setting.primaryKey)) {
          emptys.push(config.setting.primaryKey)
        }
        config.groups.forEach(group => {
          group.sublist.forEach(item => {
            if (!keys.includes(item.field)) {
              emptys.push(item.field + '(' + item.label + ')')
            }
          })
        })
        if (emptys.length > 0) {
          notification.warning({
            top: 92,
            message: '未查询到' + emptys.join(', ') + '字段信息!',
            duration: 10
          })
        }
      }
    } else {
      notification.error({
        top: 92,