|
@@ -109,19 +109,26 @@
|
|
|
</el-button>
|
|
|
</el-dropdown-item> -->
|
|
|
<el-dropdown-item>
|
|
|
- <el-dropdown
|
|
|
- size="mini"
|
|
|
- @command="
|
|
|
- (command) => handleCommand(command, scope.row)
|
|
|
- "
|
|
|
- >
|
|
|
+ <el-dropdown size="mini">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-d-arrow-right"
|
|
|
>触发异常
|
|
|
</el-button>
|
|
|
- <el-dropdown-menu slot="dropdown"> </el-dropdown-menu>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ v-for="item in scope.row.exceptionScriptList"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="exceptionTrigger(scope.row, item)"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ >{{ item.scriptName }}
|
|
|
+ </el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
@@ -145,7 +152,19 @@
|
|
|
<!-- <el-form label-width="100px" :model="commonData">
|
|
|
<h1>这里会引入当前节点需要处理的表单</h1>
|
|
|
</el-form> -->
|
|
|
- <component v-if="myForm" :is="myForm" ref="myFormRef"></component>
|
|
|
+ <k-form-build
|
|
|
+ v-if="formType == 'dragForm'"
|
|
|
+ class="formBuild"
|
|
|
+ ref="addFromRef"
|
|
|
+ :dynamicData="dynamicData"
|
|
|
+ :defaultValue="defaultValue"
|
|
|
+ :value="jsonData"
|
|
|
+ />
|
|
|
+ <component
|
|
|
+ v-else-if="formType == 'designForm'"
|
|
|
+ :is="myForm"
|
|
|
+ ref="myFormRef"
|
|
|
+ ></component>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="closeExecuteNode">取消</el-button>
|
|
|
<el-button type="primary" @click="executeNode">运行</el-button>
|
|
@@ -161,9 +180,11 @@ import {
|
|
|
processList,
|
|
|
runProcessNodeExecution,
|
|
|
} from "@/api/bpmprocess/run/executeProcess";
|
|
|
+import { triggerExceptionNode } from "@/api/bpmprocess/process";
|
|
|
+
|
|
|
import getNodeSequence from "@/utils/bpmn/getNodeSequence";
|
|
|
import GY1 from "./dialogCompments/GY1.vue";
|
|
|
-
|
|
|
+import { getForm } from "@/api/dragform/form";
|
|
|
export default {
|
|
|
name: "processMange",
|
|
|
props: [],
|
|
@@ -226,6 +247,11 @@ export default {
|
|
|
label: "创建时间",
|
|
|
},
|
|
|
],
|
|
|
+ formType: "", //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
|
|
|
+ // k-form-build 数据
|
|
|
+ dynamicData: {},
|
|
|
+ defaultValue: {},
|
|
|
+ jsonData: {},
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -246,17 +272,63 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 获取表单数据
|
|
|
+ async getFormData() {
|
|
|
+ let formData = {};
|
|
|
+ switch (this.formType) {
|
|
|
+ case "dragForm":
|
|
|
+ try {
|
|
|
+ formData = await this.$refs.addFromRef.getData();
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.$message.error("表单校验异常,请稍后重试");
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "designForm":
|
|
|
+ let temp = await this.$refs.myFormRef.getFormData();
|
|
|
+ if (!temp.flag) {
|
|
|
+ this.$message.error(temp.msg);
|
|
|
+ return {};
|
|
|
+ } else {
|
|
|
+ formData = temp.data;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return formData;
|
|
|
+ },
|
|
|
+ // 重置弹窗数据
|
|
|
+ resetDialogForm() {
|
|
|
+ this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
|
|
|
+ // k-form-build 数据
|
|
|
+ this.dynamicData = {};
|
|
|
+ this.defaultValue = {};
|
|
|
+ this.jsonData = {};
|
|
|
+ },
|
|
|
// 打开运行节点弹窗
|
|
|
- opneExecuteNode(row) {
|
|
|
+ async opneExecuteNode(row) {
|
|
|
console.log(row);
|
|
|
+
|
|
|
+ this.resetDialogForm();
|
|
|
let preFix = row.benTaskNodeName.split("-")[0];
|
|
|
- if (preFix) {
|
|
|
- //前缀式表单弹窗
|
|
|
+ if (row.benTaskNodeFormKey) {
|
|
|
+ if (row.benTaskNodeFormType == "dragForm") {
|
|
|
+ //拖拽表单
|
|
|
+ this.formType = "dragForm";
|
|
|
+ await this.getDragFormInfo(row.benTaskNodeFormKey);
|
|
|
+ } else if (row.benTaskNodeFormType == "composeForm") {
|
|
|
+ //工艺组合表单
|
|
|
+ this.formType = "composeForm";
|
|
|
+ }
|
|
|
+ } else if (preFix) {
|
|
|
+ //定制表单
|
|
|
+ this.formType = "designForm";
|
|
|
this.myForm = preFix;
|
|
|
- } else {
|
|
|
- //拖拽表单或工艺弹窗
|
|
|
}
|
|
|
this.row = row; //记录当前行数据
|
|
|
+ if (!this.formType) return;
|
|
|
this.open = true; // 打开弹窗
|
|
|
// 根据当前节点绑定的表单信息查询对应的表单进行展示
|
|
|
},
|
|
@@ -269,15 +341,8 @@ export default {
|
|
|
benTaskNodeKey,
|
|
|
bepTaskProcessXmlContent
|
|
|
);
|
|
|
- let formData = {};
|
|
|
- if (this.$refs.myFormRef) {
|
|
|
- //获取自定义表单组件内容
|
|
|
- formData = await this.$refs.myFormRef.getFormData();
|
|
|
- if (!formData.flag) {
|
|
|
- this.$message.error(formData.msg);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
+ let formData = await this.getFormData();
|
|
|
+
|
|
|
// let payLoad = {
|
|
|
// basicMap: {
|
|
|
// taskNodeKey: nodeId,
|
|
@@ -297,13 +362,28 @@ export default {
|
|
|
nextNodeKey: nextNodeId, //下一节点编码
|
|
|
implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
|
|
|
taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
|
|
|
- formDataMap: formData.data, //自定义表单组件收集的表单数据
|
|
|
+ formDataMap: formData, //自定义表单组件收集的表单数据
|
|
|
};
|
|
|
runProcessNodeExecution(payLoad).then((res) => {
|
|
|
console.log(res);
|
|
|
});
|
|
|
console.log(payLoad);
|
|
|
},
|
|
|
+ // 获取拖拽表单数据
|
|
|
+ async getDragFormInfo(fid) {
|
|
|
+ try {
|
|
|
+ let res = await getForm(fid);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.jsonData = JSON.parse(res.data.dfVueTemplate);
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
+ },
|
|
|
// 关闭运行节点弹窗
|
|
|
closeExecuteNode(row) {
|
|
|
console.log(row);
|
|
@@ -328,8 +408,31 @@ export default {
|
|
|
return xmlObj;
|
|
|
},
|
|
|
// 触发异常回调
|
|
|
- handleCommand(command, row) {
|
|
|
- console.log("触发异常");
|
|
|
+ exceptionTrigger(row, scriptData) {
|
|
|
+ this.$modal
|
|
|
+ .confirm("是否确认触发<" + scriptData.scriptName + ">异常?")
|
|
|
+ .then(function (val) {
|
|
|
+ console.log(val);
|
|
|
+ // 发送触发异常节点的请求
|
|
|
+ let payLoad = {
|
|
|
+ taskProcessKey: row.bepTaskKey,
|
|
|
+ taskNodeKey: row.benTaskNodeKey,
|
|
|
+ sysBpmNodeScriptVO: scriptData,
|
|
|
+ };
|
|
|
+ triggerExceptionNode(payLoad).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("触发成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.error("触发失败请稍后再试");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.open = false;
|
|
|
+ this.$message.info("取消成功");
|
|
|
+ });
|
|
|
},
|
|
|
// 获取字典对应label
|
|
|
getDictLabel(value, dictLsit = []) {
|