提交 d23d786b 编写于 作者: Mosher's avatar Mosher

update:更新工作流动态编辑视图

上级 21e6af37
......@@ -1319,7 +1319,7 @@ import { Util } from '@/ibiz-core/utils';
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected async wfsubmit(data: any, linkItem: any, datas: any): Promise<any> {
protected async wfsubmit(data: any, linkItem: any): Promise<any> {
if (!(await this.validAll())) {
this.$notice.error('值规则校验错误');
}
......@@ -1354,7 +1354,7 @@ import { Util } from '@/ibiz-core/utils';
if (copyData.srfwfmemo) {
Object.assign(arg, { srfwfmemo: copyData.srfwfmemo });
}
this.service.wfsubmit(this.WFSubmitAction, { ...this.context }, datas, this.showBusyIndicator, arg).then((response: any) => {
this.service.wfsubmit(this.WFSubmitAction, { ...this.context }, args, this.showBusyIndicator, linkItem).then((response: any) => {
if (response && response.status === 200) {
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
resolve(response);
......
......@@ -114,30 +114,136 @@ import WFDynaEditViewEngine from '@engine/view/mob-wfdyna-edit-view-engine';
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public async dynamic_toolbar_click(linkItem: any, $event: any) {
let datas: any;
const _this: any = this
let datas: any[] = [];
let xData: any = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = xData.getDatas()[0];
datas = [...xData.getDatas()];
}
let falg = await this.openSrfwfmemo(linkItem,datas);
if(!falg){
return
const submit: Function = (submitData: any, linkItem: any) => {
xData.wfsubmit(submitData, linkItem).then((response: any) => {
if (!response || response.status !== 200) {
return;
}
const { data: _data } = response;
if (_this.viewparams) {
this.$emit('viewdataschange', [{ ..._data }]);
this.closeView(_data);
} else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
});
}
let res = await xData.save();
if (!res || res.status !== 200) {
return;
const submitAction: Function = () => {
if (linkItem && linkItem.sequenceflowview) {
<#noparse>const targetView = this.viewRefData[`WFACTION@${linkItem.sequenceflowview}`];</#noparse>
if (targetView) {
let tempContext: any = Util.deepCopy(_this.context);
Object.assign(tempContext, { '${view.getPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case}': datas && datas[0].srfkey });
let tempViewParam: any = { actionView: linkItem.sequenceflowview, actionForm: linkItem.sequenceflowform };
const appmodal = _this.$appmodal.openModal();
ViewOpenService.getInstance().openModal(targetView, tempContext, tempViewParam).then((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
let tempSubmitData: any = Util.deepCopy(datas[0]);
if (result.datas && result.datas[0]) {
const resultData: any = result.datas[0];
if (Object.keys(resultData).length > 0) {
let tempData: any = {};
Object.keys(resultData).forEach((key: any) => {
if (resultData[key] && (key !== "srfuf")) tempData[key] = resultData[key];
})
Object.assign(tempSubmitData, tempData);
}
}
submit([tempSubmitData], linkItem);
})
}
} else {
submit(datas, linkItem);
}
}
if (linkItem && linkItem.type) {
if (Object.is(linkItem.type, "finish")) {
submitAction();
} else {
this.handleWFAddiFeature(linkItem);
}
} else {
submitAction();
}
let response = await xData.wfsubmit(this.context,linkItem,datas);
if (!response || response.status !== 200) {
}
/**
* 处理工作流辅助功能
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public handleWFAddiFeature(linkItem: any) {
let featureTag: string = this.wfAddiFeatureRef[linkItem?.type]?.featureTag;
if (!featureTag) return;
<#noparse>let targetView: any = this.viewRefData[`WFUTILACTION@${featureTag}`];</#noparse>
if (!targetView) {
console.warn(this.$t('app.wizardpanel.nofind'))
return;
}
const { data: _data } = response;
if (this.viewparams) {
this.$emit('viewdataschange', [{ ..._data }]);
this.closeView(_data);
} else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
// 准备参数
let datas: any[] = [];
let xData: any = this.$refs.form;
if (xData.getDatas && xData.getDatas instanceof Function) {
datas = [...xData.getDatas()];
}
let tempContext: any = Util.deepCopy(this.context);
Object.assign(tempContext, { '${view.getPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case}': datas && datas[0].srfkey });
let tempViewParam: any = { actionView: linkItem.sequenceflowview, actionForm: linkItem.sequenceflowform };
ViewOpenService.getInstance().openModal(targetView, tempContext, tempViewParam).then((result: any) => {
if (!result || !Object.is(result.ret, 'OK')) {
return;
}
let tempSubmitData: any = Util.deepCopy(datas[0]);
if (result.datas && result.datas[0]) {
const resultData: any = result.datas[0];
if (Object.keys(resultData).length > 0) {
let tempData: any = {};
Object.keys(resultData).forEach((key: any) => {
if (resultData[key] && (key !== "srfuf")) tempData[key] = resultData[key];
})
Object.assign(tempSubmitData, tempData);
}
this.submitWFAddiFeature(linkItem, tempSubmitData);
}
});
}
/**
* 提交工作流辅助功能
*
* @memberof ${srfclassname('${view.codeName}')}Base
*/
public submitWFAddiFeature(linkItem: any, submitData: any) {
let tempSubmitData: any = Object.assign(linkItem, { "activedata": submitData });
let action: string = this.wfAddiFeatureRef[linkItem?.type]?.action;
if (!action) return;
(this.appEntityService as any)[action](Util.deepCopy(this.context), tempSubmitData).then((response: any) => {
const { data: data } = response;
if (!response || response.status !== 200) {
this.$notice.error(response);
return;
}
let _this: any = this;
if (_this.viewparams) {
this.$emit('viewdataschange', [{ ...data }]);
this.closeView(data);
} else if (this.$tabPageExp) {
this.$tabPageExp.onClose(this.$route.fullPath);
}
AppCenterService.notifyMessage({ name: '${view.getPSAppDataEntity().getCodeName()}', action: 'appRefresh', data: data });
this.$notice.success(data?.message ? data.message : this.$t('app.wizardpanel.success'))
}).catch((error: any) => {
this.$notice.error(error);
})
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册