| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } else if (btn.OpenType === 'pop') { // 表单 |
| | | if (index !== 0) { |
| | | let _cell = {} |
| | | Object.keys(cell).forEach(key => { |
| | | _cell[key.toLowerCase()] = cell[key] |
| | | }) |
| | | formdata = formdata.map(_data => { |
| | | if (_data.readin && cell.hasOwnProperty(_data.key)) { |
| | | _data.value = cell[_data.key] |
| | | if (_data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) { |
| | | _data.value = _cell[_data.key.toLowerCase()] |
| | | } |
| | | return _data |
| | | }) |
| | |
| | | |
| | | if (btn.OpenType === 'pop') { // 表单 |
| | | if (index !== 0) { |
| | | let _cell = {} |
| | | Object.keys(cell).forEach(key => { |
| | | _cell[key.toLowerCase()] = cell[key] |
| | | }) |
| | | formdata = formdata.map(_data => { |
| | | if (_data.readin && cell.hasOwnProperty(_data.key)) { |
| | | _data.value = cell[_data.key] |
| | | if (_data.readin && _cell.hasOwnProperty(_data.key.toLowerCase())) { |
| | | _data.value = _cell[_data.key.toLowerCase()] |
| | | } |
| | | return _data |
| | | }) |
| | |
| | | } |
| | | |
| | | modelconfirm = () => { |
| | | const { BData, btn } = this.props |
| | | const { btn } = 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 |
| | | let _readin = item.readin !== 'false' |
| | |
| | | _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] |
| | | let key = item.field.toLowerCase() |
| | | |
| | | if (item.type === 'linkMain' && BData.hasOwnProperty(key)) { |
| | | _initval = BData[key] |
| | | } else if (_readin && _data.hasOwnProperty(key)) { |
| | | _initval = _data[key] |
| | | } else if (item.type === 'date' && _initval) { |
| | | _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD') |
| | | } else if (item.type === 'datemonth' && _initval) { |