| | |
| | | } |
| | | |
| | | handleOk = () => { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | let values = [] |
| | | this.props.param.formdata.forEach(column => { |
| | | let value = '' |
| | | if (res[column.FieldName] || res[column.FieldName] === 0) { // 依次选取表单值、表格数据值、初始值 |
| | | if (res.hasOwnProperty(column.FieldName)) { // 依次选取表单值、初始值 |
| | | value = res[column.FieldName] |
| | | } else if (this.state.tabledata && this.state.tabledata[column.FieldName]) { |
| | | value = this.state.tabledata[column.FieldName] |
| | | } else if (column.InitVal) { |
| | | value = column.InitVal |
| | | } |
| | | values.push(column.FieldName + 'equal\'' + value + '\'') |
| | | }) |
| | | Api.submitInterface({ |
| | | |
| | | let queryparam = { // 请求参数 |
| | | func: this.props.param.execAction.AuditProc || this.props.param.defaultproc[this.props.param.execAction.Action], |
| | | UptLongText: values.join(','), // 表单数据 |
| | | ID: (this.props.param.tabledata && this.props.param.primarykey) ? this.props.param.tabledata[this.props.param.primarykey] : '', // 主键字段 |
| | | BID: (this.props.param.tabledata && this.props.param.bidkey) ? this.props.param.tabledata[this.props.param.bidkey] : '' // BID字段 |
| | | }).then(result => { |
| | | } |
| | | // 添加和修改请求参数字段不同 |
| | | if (this.props.param.execAction.Action === 'Add') { |
| | | queryparam.AddLongText = values.join(',') |
| | | } else if (this.props.param.execAction.Action === 'Update') { |
| | | queryparam.UptLongText = values.join(',') |
| | | } |
| | | |
| | | Api.submitInterface(queryparam).then(result => { |
| | | if (result.status) { |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | }) |
| | | |
| | | // 刷新主列表页面 |
| | | if (this.props.param.execAction.ReloadForm && this.props.param.execAction.ReloadForm !== 'false' && this.props.param.execAction.ReloadForm !== 'singlegrid') { |
| | | this.props.refreshTabView({ |
| | | MenuNo: this.props.MenuNo, |
| | | ReloadForm: this.props.param.execAction.ReloadForm |
| | | }) |
| | | } |
| | | this.props.refreshTabView({ |
| | | MenuNo: this.props.MenuNo, |
| | | ReloadForm: this.props.param.execAction.ReloadForm |
| | | }) |
| | | |
| | | this.handleCancel() |
| | | if (this.props.param.execAction.BackPre !== 'false') { // 页面返回 |
| | | this.handleCancel() |
| | | } |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 15 |
| | | }) |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | } |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, () => {}) |
| | | } |
| | |
| | | return tab.MenuID !== this.props.MenuID |
| | | }) |
| | | this.props.modifyTabview(tabs) |
| | | // 提交成功或返回时,滚动至顶部 |
| | | document.body.scrollTop = 0 |
| | | document.documentElement.scrollTop = 0 |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |