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

zpc---调整表单开始流程逻辑

上级 0de1f6c1
...@@ -98,20 +98,21 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi ...@@ -98,20 +98,21 @@ import ${srfclassname('${_appde.getCodeName()}')}Service from '@/service/${srffi
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
* @param {boolean} [isloading] * @param {boolean} [isloading]
* @param {*} [localdata]
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service * @memberof ${srfclassname('${ctrl.codeName}')}Service
*/ */
@Errorlog @Errorlog
public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public wfstart(action: string,context: any = {},data: any = {}, isloading?: boolean,localdata?:any): Promise<any> {
data = this.handleWFData(data); data = this.handleWFData(data);
context = this.handleRequestData(action,context,data).context; context = this.handleRequestData(action,context,data).context;
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
let result: Promise<any>; let result: Promise<any>;
const _appEntityService: any = this.appEntityService; const _appEntityService: any = this.appEntityService;
if (_appEntityService[action] && _appEntityService[action] instanceof Function) { if (_appEntityService[action] && _appEntityService[action] instanceof Function) {
result = _appEntityService[action](context,data, isloading); result = _appEntityService[action](context,data, isloading,localdata);
} else { } else {
result = this.appEntityService.Create(context,data, isloading); result = this.appEntityService.WFStart(context,data, isloading,localdata);
} }
result.then((response) => { result.then((response) => {
this.handleResponse(action, response); this.handleResponse(action, response);
......
...@@ -1087,10 +1087,11 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1087,10 +1087,11 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
* 工作流启动 * 工作流启动
* *
* @param {*} [data={}] * @param {*} [data={}]
* @param {*} [localdata={}]
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
protected async wfstart(data: any): Promise<any> { protected async wfstart(data: any,localdata?:any): Promise<any> {
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
if(!this.WFStartAction){ if(!this.WFStartAction){
this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' }); this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
...@@ -1105,7 +1106,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; ...@@ -1105,7 +1106,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
const result: Promise<any> = this.service.wfstart(_this.WFStartAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator); const result: Promise<any> = this.service.wfstart(_this.WFStartAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator,localdata);
result.then((response: any) => { result.then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.info }); this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.info });
......
...@@ -14,7 +14,16 @@ ...@@ -14,7 +14,16 @@
if (!xData || !(xData.wfstart instanceof Function)) { if (!xData || !(xData.wfstart instanceof Function)) {
return; return;
} }
<#if item.getPSControlContainer()?? && item.getPSControlContainer().getPSWorkflow()??>
<#assign curWorkflow = item.getPSControlContainer().getPSWorkflow() />
<#-- 通过是否使用代理模式来区分流程启动的模式 -->
<#if curWorkflow.isUseWFProxyApp()>
xData.wfstart(args).then((response: any) => { xData.wfstart(args).then((response: any) => {
<#else>
let localdata:any = {processDefinitionKey:null};
xData.wfstart(args,localdata).then((response: any) => {
</#if>
</#if>
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
return; return;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册