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

zpc --- 提交流程刷新表格数据

上级 d0d620df
...@@ -383,7 +383,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -383,7 +383,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
*/ */
private onFormLoad(data: any = {},action:string): void { private onFormLoad(data: any = {},action:string): void {
<#if de??> <#if de??>
if(Object.is(action,"save") || Object.is(action,"autoSave")) if(Object.is(action,"save") || Object.is(action,"autoSave") || Object.is(action,"submit"))
// 更新context的实体主键 // 更新context的实体主键
if(data.${appde.getCodeName()?lower_case}){ if(data.${appde.getCodeName()?lower_case}){
Object.assign(this.context,{${appde.getCodeName()?lower_case}:data.${appde.getCodeName()?lower_case}}) Object.assign(this.context,{${appde.getCodeName()?lower_case}:data.${appde.getCodeName()?lower_case}})
...@@ -1169,6 +1169,13 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1169,6 +1169,13 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
const post: Promise<any> = Object.is(arg.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator); const post: Promise<any> = Object.is(arg.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 保存完成UI处理
this.onFormLoad(arg,'save');
this.$emit('save', arg);
this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg });
});
// 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1180,6 +1187,8 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1180,6 +1187,8 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
} }
return; return;
} }
this.onFormLoad(arg,'submit');
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$Notice.info({ title: '', desc: '工作流提交成功' }); this.$Notice.info({ title: '', desc: '工作流提交成功' });
resolve(response); resolve(response);
}).catch((response: any) => { }).catch((response: any) => {
......
...@@ -105,7 +105,42 @@ ...@@ -105,7 +105,42 @@
tree.setCurrentKey(data.userTaskId); tree.setCurrentKey(data.userTaskId);
}) })
} }
<#if view.hasPSControl('grid')>
<#assign grid = view.getPSControl('grid')>
/**
* 刷新数据
*
* @readonly
* @type {(number | null)}
* @memberof ${srfclassname('${view.name}')}Base
*/
get refreshdata(): number | null {
return this.$store.getters['viewaction/getRefreshData'](this.viewtag);
}
/**
* 监控数据变化
*
* @param {*} newVal
* @param {*} oldVal
* @returns
* @memberof ${srfclassname('${view.name}')}Base
*/
@Watch('refreshdata')
onRefreshData(newVal: any, oldVal: any) {
if (newVal === null || newVal === undefined) {
return;
}
if (newVal === 0) {
return;
}
const grid: any = this.$refs.${grid.name};
if (grid) {
grid.load({});
}
}
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl ../@MACRO/VIEW-BASE.vue.ftl
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册