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

优化数据拷贝逻辑

上级 c6fb17d6
......@@ -947,26 +947,6 @@ import schema from 'async-validator';
</#if>
}
/**
* 拷贝内容
*
* @param {*} [arg={}]
* @memberof @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public copy(srfkey: string): void {
let copyData = this.$store.getters.getCopyData(srfkey);
copyData.srfkey = Util.createUUID();
copyData.${appde.getCodeName()?lower_case} = copyData.srfkey;
copyData.${appde.getKeyPSAppDEField().getCodeName()?lower_case} = copyData.srfkey;
Object.assign(this.context,{${appde.getCodeName()?lower_case}:copyData.${appde.getCodeName()?lower_case}})
this.data = copyData;
this.$nextTick(() => {
this.formState.next({ type: 'load', data: copyData });
this.data.srfuf = '0';
this.setFormEnableCond(this.data);
});
}
/**
*打印
*@memberof @memberof ${srfclassname('${ctrl.codeName}')}Base
......@@ -1209,6 +1189,9 @@ import schema from 'async-validator';
return;
}
}
if(this.viewparams && this.viewparams.copymode){
data.srfuf = '0';
}
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
......@@ -1216,9 +1199,6 @@ import schema from 'async-validator';
return;
}
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);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册