| | |
| | | _param[setting.primaryKey] = cell[setting.primaryKey] |
| | | } |
| | | |
| | | let _cell = {} |
| | | if (index !== 0) { |
| | | Object.keys(cell).forEach(key => { |
| | | _cell[key.toLowerCase()] = cell[key] |
| | | }) |
| | | } |
| | | |
| | | formlist.forEach(_data => { |
| | | if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) { |
| | | _param[_data.key] = cell[_data.key] |
| | | if (index !== 0 && _data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) { |
| | | _param[_data.key] = _cell[_data.key.toLowerCase()] |
| | | } else { |
| | | _param[_data.key] = _data.value |
| | | } |
| | |
| | | } |
| | | |
| | | modelconfirm = () => { |
| | | const { BData } = this.props |
| | | const { btnconfig, selines } = this.state |
| | | let _this = this |
| | | let result = [] |
| | | let _data = {} |
| | | let BData = {} |
| | | |
| | | if (selines[0]) { |
| | | Object.keys(selines[0]).forEach(key => { |
| | | _data[key.toLowerCase()] = selines[0][key] |
| | | }) |
| | | } |
| | | if (this.props.BData) { |
| | | Object.keys(this.props.BData).forEach(key => { |
| | | BData[key.toLowerCase()] = this.props.BData[key] |
| | | }) |
| | | } |
| | | |
| | | btnconfig.fields.forEach(item => { |
| | | if (!item.field) return |
| | |
| | | _readin = false |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { |
| | | _initval = BData[item.field] |
| | | } else if (_readin && selines[0] && selines[0].hasOwnProperty(item.field)) { |
| | | _initval = selines[0][item.field] |
| | | if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) { |
| | | _initval = BData[item.field.toLowerCase()] |
| | | } else if (_readin && _data.hasOwnProperty(item.field.toLowerCase())) { |
| | | _initval = _data[item.field.toLowerCase()] |
| | | } else if (item.type === 'date' && _initval) { |
| | | _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD') |
| | | } else if (item.type === 'datemonth' && _initval) { |