提交 addc839c 编写于 作者: tony001's avatar tony001

增加表单拷贝功能

上级 aac6478f
...@@ -1216,6 +1216,9 @@ import schema from 'async-validator'; ...@@ -1216,6 +1216,9 @@ import schema from 'async-validator';
return; return;
} }
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
if(this.viewparams && this.viewparams.copymode){
data.srfuf = '0';
}
const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(action,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator); const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(action,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response: any) => { post.then((response: any) => {
if (!response.status || response.status !== 200) { if (!response.status || response.status !== 200) {
...@@ -1224,7 +1227,7 @@ import schema from 'async-validator'; ...@@ -1224,7 +1227,7 @@ import schema from 'async-validator';
} }
return; return;
} }
this.viewparams.copymode = false;
const data = response.data; const data = response.data;
this.onFormLoad(data,'save'); this.onFormLoad(data,'save');
this.$emit('save', data); this.$emit('save', data);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册