提交 89b6f355 authored 作者: 王绍森's avatar 王绍森

提交按钮增加draftCode

上级 a706cad3
...@@ -41,7 +41,7 @@ export default class idnex extends Component { ...@@ -41,7 +41,7 @@ export default class idnex extends Component {
}); });
} }
handleOk = () => { handleOk = () => {
let {dispatch} = this.props; let {dispatch, draftCode } = this.props;
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
preHandle(values); // 引入 import preHandle from '@/webPublic/one_stop_public/utils/myutils.js' preHandle(values); // 引入 import preHandle from '@/webPublic/one_stop_public/utils/myutils.js'
...@@ -54,7 +54,8 @@ export default class idnex extends Component { ...@@ -54,7 +54,8 @@ export default class idnex extends Component {
payload: { payload: {
content: JSON.stringify(values), // 表单数据 content: JSON.stringify(values), // 表单数据
appId: this.props.appId, // 这里应该由上级路由跳转传入 事务Id appId: this.props.appId, // 这里应该由上级路由跳转传入 事务Id
id: !!this.state.draftId ? this.state.draftId : null // 确认是否存在草稿表单Id存在即传入 id: !!this.state.draftId ? this.state.draftId : null, // 确认是否存在草稿表单Id存在即传入
code: typeof draftCode !== 'undefined' ? draftCode : null, // 确认是否存在草稿表单code存在即传入
}, },
callback: val => { callback: val => {
if (val) { if (val) {
...@@ -86,7 +87,7 @@ export default class idnex extends Component { ...@@ -86,7 +87,7 @@ export default class idnex extends Component {
}) })
} }
handleDraft = () => { handleDraft = () => {
let {dispatch, id, radioValue,draftCallback} = this.props; let {dispatch, id, radioValue,draftCallback, draftCode} = this.props;
this.setState({ this.setState({
isLoading:true isLoading:true
},() => { },() => {
...@@ -96,9 +97,10 @@ export default class idnex extends Component { ...@@ -96,9 +97,10 @@ export default class idnex extends Component {
dispatch({ dispatch({
type: 'affair/saveDraft', type: 'affair/saveDraft',
payload: { payload: {
content: JSON.stringify(values), // 表单数据 content: JSON.stringify(values), // 表单数据
appId: this.props.appId, // 这里应该由上级路由跳转传入 事务Id appId: this.props.appId, // 这里应该由上级路由跳转传入 事务Id
id: !!this.state.draftId ? this.state.draftId : null // 确认是否存在草稿表单Id存在即传入 id: !!this.state.draftId ? this.state.draftId : null, // 确认是否存在草稿表单Id存在即传入
code: typeof draftCode !== 'undefined' ? draftCode : null, // 确认是否存在草稿表单code存在即传入
}, },
callback: val => { callback: val => {
if (isEmpty(val) === false) { if (isEmpty(val) === false) {
...@@ -156,7 +158,7 @@ export default class idnex extends Component { ...@@ -156,7 +158,7 @@ export default class idnex extends Component {
text??'提交' text??'提交'
} }
</Button> </Button>
<AddModel <AddModel
visible={visible} visible={visible}
handleOk={this.handleOk} handleOk={this.handleOk}
isLoading={isLoading} isLoading={isLoading}
......
...@@ -14,6 +14,7 @@ import SumbitButton from '@/webPublic/one_stop_public/AffairButton/SumbitButton' ...@@ -14,6 +14,7 @@ import SumbitButton from '@/webPublic/one_stop_public/AffairButton/SumbitButton'
appId = {'事务ID'} // 事务ID appId = {'事务ID'} // 事务ID
text = '提交' // 按钮文本 text = '提交' // 按钮文本
draftId = {'草稿Id'} // 可不传 不传为发起全新 传后修改草稿 draftId = {'草稿Id'} // 可不传 不传为发起全新 传后修改草稿
draftCode = {'草稿code'} // 可不传 不传为发起全新 传后修改草稿,草稿id和草稿code传一个就行。
openDraftButton = {true} // 开启保存草稿按钮 openDraftButton = {true} // 开启保存草稿按钮
DraftButtonText = '草稿按钮文本' // 草稿按钮内置文本 DraftButtonText = '草稿按钮文本' // 草稿按钮内置文本
callback = '提交按钮回调函数' // 提交按钮回调函数 callback = '提交按钮回调函数' // 提交按钮回调函数
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论