|
@@ -8,7 +8,7 @@
|
|
|
<span class="title">我的处理</span>
|
|
|
<span class="sub-title">需要我处理的管道</span>
|
|
|
</div>
|
|
|
- <span class="data">{{tableData.length||0}}</span>
|
|
|
+ <span class="data">{{ tableData.length }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :md="8" :xl="8" class="col">
|
|
@@ -40,9 +40,14 @@
|
|
|
<el-radio-button :label="1">我的处理</el-radio-button>
|
|
|
<el-radio-button :label="2">其他处理</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- <el-radio-group class="btn-list-two" v-model="taskStatus">
|
|
|
- <el-radio-button :label="3">已完成</el-radio-button>
|
|
|
- <el-radio-button :label="4">进行中</el-radio-button>
|
|
|
+ <el-radio-group
|
|
|
+ class="btn-list-two"
|
|
|
+ v-model="queryParams.taskProcessState"
|
|
|
+ @change="getList"
|
|
|
+ >
|
|
|
+ <el-radio-button label="3">已完成</el-radio-button>
|
|
|
+ <el-radio-button label="0">进行中</el-radio-button>
|
|
|
+ <el-radio-button label="">所有</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<div class="search-input">
|
|
@@ -76,7 +81,13 @@
|
|
|
getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
|
|
|
}}</span>
|
|
|
<span v-else-if="col.prop == 'benTaskNodeState'">{{
|
|
|
- scope.row.benTaskNodeState == "0" ? "已执行" : "未执行"
|
|
|
+ scope.row.benTaskNodeState == "0" ? "未执行" : "已执行"
|
|
|
+ }}</span>
|
|
|
+ <span v-else-if="col.prop == 'bepTaskProcessState'">{{
|
|
|
+ getDictLabel(
|
|
|
+ scope.row.bepTaskProcessState,
|
|
|
+ dict.type.task_process_state
|
|
|
+ )
|
|
|
}}</span>
|
|
|
<span v-else>{{ scope.row[col.prop] }}</span>
|
|
|
</template>
|
|
@@ -89,6 +100,7 @@
|
|
|
plain
|
|
|
size="small"
|
|
|
class="mr10 mb5"
|
|
|
+ v-show="scope.row.bepTaskProcessState == '0'"
|
|
|
@click="opneExecuteNode(scope.row)"
|
|
|
>
|
|
|
运行
|
|
@@ -109,19 +121,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>
|
|
@@ -130,6 +149,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
<!-- 分页 -->
|
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
@@ -139,13 +159,42 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="show-window">
|
|
|
<!-- 运行节点弹窗 -->
|
|
|
- <el-dialog :title="nodeTitle" :visible.sync="open" width="50%">
|
|
|
- <!-- <el-form label-width="100px" :model="commonData">
|
|
|
+
|
|
|
+ <el-dialog :title="nodeTitle" :visible.sync="open">
|
|
|
+ <!-- <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"
|
|
|
+ /> -->
|
|
|
+ <!-- <DialogTemplate
|
|
|
+ v-else-if="formType == 'composeForm'"
|
|
|
+ ref="dialogRef"
|
|
|
+ :groupKey="groupKey"
|
|
|
+ :rowobj="row"
|
|
|
+ :subCount="subCount"
|
|
|
+ :tableCount="tableCount"
|
|
|
+ :subTableName="subTableName"
|
|
|
+ @addList="() => {}"
|
|
|
+ ></DialogTemplate> -->
|
|
|
+ <!-- ></DialogTemplate> -->
|
|
|
+ <component
|
|
|
+ :is="myForm"
|
|
|
+ :formData="formData"
|
|
|
+ :row="row"
|
|
|
+ ref="myFormRef"
|
|
|
+ ></component>
|
|
|
+ <!-- <CG1 ref="myFormRef"></CG1>
|
|
|
+ <KC1 ref="myFormRef"></KC1> -->
|
|
|
+ <!-- <GY06 ref="myFormRef" :formData="formData" :row="row"></GY06> -->
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="closeExecuteNode">取消</el-button>
|
|
|
<el-button type="primary" @click="executeNode">运行</el-button>
|
|
@@ -160,15 +209,31 @@
|
|
|
import {
|
|
|
processList,
|
|
|
runProcessNodeExecution,
|
|
|
+ getProcessNodeFormTemplate,
|
|
|
+ getProcessNodeFormInfoData,
|
|
|
} from "@/api/bpmprocess/run/executeProcess";
|
|
|
+import { triggerExceptionNode } from "@/api/bpmprocess/process";
|
|
|
+
|
|
|
import getNodeSequence from "@/utils/bpmn/getNodeSequence";
|
|
|
-import GY1 from "./dialogCompments/GY1.vue";
|
|
|
+import GY02 from "./dialogCompments/GongYi/GY02.vue";
|
|
|
+import ZL1 from "./dialogCompments/ZhiLiang/ZL1.vue";
|
|
|
+import { getForm } from "@/api/dragform/form";
|
|
|
+import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
|
|
|
+
|
|
|
+// 弹窗表单组件
|
|
|
+import GY01 from "./dialogCompments/GongYi/GY01.vue";
|
|
|
+import GY03 from "./dialogCompments/GongYi/GY03.vue";
|
|
|
+import CG1 from "./dialogCompments/test-component/CaiGou/CG1.vue";
|
|
|
+import CG2 from "./dialogCompments/test-component/CaiGou/CG02.vue";
|
|
|
+import KC1 from "./dialogCompments/test-component/KuCun/KC1.vue";
|
|
|
+import KC02 from "./dialogCompments/test-component/KuCun/KC02.vue";
|
|
|
+import GY06 from "./dialogCompments/GongYi/GY06.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "processMange",
|
|
|
props: [],
|
|
|
- components: { GY1 },
|
|
|
- dicts: ["bpm_type"],
|
|
|
+ components: { GY01, DialogTemplate, CG1, CG2, KC1, GY06, GY03, KC02, GY02 },
|
|
|
+ dicts: ["bpm_type", "task_process_state"],
|
|
|
data() {
|
|
|
return {
|
|
|
row: {}, //当前操作行数据
|
|
@@ -180,12 +245,13 @@ export default {
|
|
|
commonData: {},
|
|
|
taskType: 1,
|
|
|
queryString: "",
|
|
|
- taskStatus: 3,
|
|
|
+ taskStatus: "",
|
|
|
tableData: [], //表格数据
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ taskProcessState: "0",
|
|
|
},
|
|
|
total: 0,
|
|
|
columns: [
|
|
@@ -193,10 +259,10 @@ export default {
|
|
|
prop: "bepTaskKey",
|
|
|
label: "任务编号",
|
|
|
},
|
|
|
- //{
|
|
|
- // prop: "bepTaskName",
|
|
|
- // label: "任务名称",
|
|
|
- //},
|
|
|
+ {
|
|
|
+ prop: "bepTaskName",
|
|
|
+ label: "任务名称",
|
|
|
+ },
|
|
|
{
|
|
|
prop: "bepTaskProcessType",
|
|
|
label: "任务流程类型",
|
|
@@ -226,6 +292,22 @@ export default {
|
|
|
label: "创建时间",
|
|
|
},
|
|
|
],
|
|
|
+ formType: "", //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
|
|
|
+ // k-form-build 数据
|
|
|
+ dynamicData: {},
|
|
|
+ tableName: "",
|
|
|
+ defaultValue: {},
|
|
|
+ jsonData: {},
|
|
|
+ // 拖拽数据
|
|
|
+ taskInfo: {},
|
|
|
+ groupKey: "",
|
|
|
+ subCount: {},
|
|
|
+ tableCount: {},
|
|
|
+ subTableName: "",
|
|
|
+
|
|
|
+ // 弹窗表单渲染数据
|
|
|
+ formData: {},
|
|
|
+ backExceptionTaskList: ["GY06"], //特殊回退表单组件列表
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -236,7 +318,6 @@ export default {
|
|
|
// 获取列表数据
|
|
|
getList() {
|
|
|
processList(this.queryParams).then((res) => {
|
|
|
- console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
this.tableData = res.rows.map((item) => item.resultMap);
|
|
|
this.total = res.total;
|
|
@@ -246,61 +327,198 @@ 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;
|
|
|
+ // }
|
|
|
+ let temp = await this.$refs.myFormRef?.getFormData();
|
|
|
+ if (!temp?.flag) {
|
|
|
+ this.$message.error(temp.msg);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ formData = temp.data;
|
|
|
+ }
|
|
|
+ return formData;
|
|
|
+ },
|
|
|
+ // 重置弹窗数据
|
|
|
+ resetDialogForm() {
|
|
|
+ this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
|
|
|
+ // k-form-build 数据
|
|
|
+ this.dynamicData = {};
|
|
|
+ this.defaultValue = {};
|
|
|
+ this.jsonData = {};
|
|
|
+ },
|
|
|
// 打开运行节点弹窗
|
|
|
- opneExecuteNode(row) {
|
|
|
+ async opneExecuteNode(row) {
|
|
|
+ this.resetDialogForm();
|
|
|
console.log(row);
|
|
|
- this.myForm = row.benTaskNodeName.split("-")[0];
|
|
|
+ this.nodeTitle = row.benTaskNodeName;
|
|
|
+ // let preFix = row.benTaskNodeName.split("-")[0];
|
|
|
+ let preFix = row.benTaskNodeFormKey;
|
|
|
+ let {
|
|
|
+ benTaskNodeFormKey,
|
|
|
+ benTaskNodeFormType,
|
|
|
+ bepTaskPlanKey,
|
|
|
+ bepTaskKey,
|
|
|
+ bepTaskNodeKey,
|
|
|
+ benTaskProcessKey,
|
|
|
+ benmTaskAutomaticScriptTriggerType,
|
|
|
+ bepTaskNodeNextKey,
|
|
|
+ } = row;
|
|
|
+ // 新的运行逻辑
|
|
|
+ let payLoad = {
|
|
|
+ taskNodeKey: bepTaskNodeNextKey,
|
|
|
+ taskProcessKey: benTaskProcessKey,
|
|
|
+ taskAutomaticScriptTriggerType: benmTaskAutomaticScriptTriggerType,
|
|
|
+ taskPlanKey: bepTaskPlanKey,
|
|
|
+ };
|
|
|
+
|
|
|
+ // let formData = await getProcessNodeFormTemplate(payLoad);
|
|
|
+ // console.log(formData);
|
|
|
+ // if (benTaskNodeFormKey) {
|
|
|
+ // if (benTaskNodeFormType == "dragForm") {
|
|
|
+ // let templateInfo = formData.data[0]?.template;
|
|
|
+ // //拖拽表单
|
|
|
+ // this.formType = "dragForm";
|
|
|
+ // this.jsonData = JSON.parse(templateInfo.dfVueTemplate);
|
|
|
+ // this.tableName = templateInfo.dfTableName;
|
|
|
+ // if (Object.keys(JSON.parse(templateInfo.dfFormSql)).length) {
|
|
|
+ // this.dynamicData = JSON.parse(templateInfo.dfFormSql);
|
|
|
+ // }
|
|
|
+ // // await this.getDragFormInfo(benTaskNodeFormKey);
|
|
|
+ // } else if (benTaskNodeFormType == "composeForm") {
|
|
|
+ // //工艺组合表单
|
|
|
+ // this.formType = "composeForm";
|
|
|
+ // this.groupKey = benTaskNodeFormKey;
|
|
|
+ // let queryPayload = {
|
|
|
+ // row,
|
|
|
+ // groupKey: benTaskNodeFormKey,
|
|
|
+ // };
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.dialogRef.getLists(queryPayload);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // } else if (preFix) {
|
|
|
+ // //定制表单
|
|
|
+ // this.formType = "designForm";
|
|
|
+ // this.myForm = preFix;
|
|
|
+ // }
|
|
|
+ //定制表单
|
|
|
+ this.formType = "designForm";
|
|
|
+ this.myForm = preFix;
|
|
|
+ let res = await getProcessNodeFormInfoData(payLoad);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.formData = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
+
|
|
|
this.row = row; //记录当前行数据
|
|
|
+ // if (!this.formType) return; //没有表单,直接掉运行逻辑
|
|
|
this.open = true; // 打开弹窗
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.myFormRef?.resetForm();
|
|
|
+ });
|
|
|
// 根据当前节点绑定的表单信息查询对应的表单进行展示
|
|
|
},
|
|
|
- // 运行节点按钮
|
|
|
+ // 运行节点按钮 确认运行回调
|
|
|
async executeNode() {
|
|
|
- console.log(this.row);
|
|
|
let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
|
|
|
this.row;
|
|
|
let { nodeId, nextNodeId } = this.getNextNodeKey(
|
|
|
benTaskNodeKey,
|
|
|
bepTaskProcessXmlContent
|
|
|
);
|
|
|
- let formData = {};
|
|
|
- if (this.$refs.myFormRef) {
|
|
|
- //获取自定义表单组件内容
|
|
|
- formData = await this.$refs.myFormRef.getFormData();
|
|
|
- if (!formData.flag) {
|
|
|
- this.$message.error(formData.msg);
|
|
|
+ // 只有完成状态的可以运行
|
|
|
+ if (this.formType == "composeForm") {
|
|
|
+ let res = this.$refs.dialogRef.getComposeFormData();
|
|
|
+ if (!res.isSuccess) {
|
|
|
+ this.$message.warning("非完成状态节点不能运行!");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- // let payLoad = {
|
|
|
- // basicMap: {
|
|
|
- // taskNodeKey: nodeId,
|
|
|
- // nextNodeKey: nextNodeId,
|
|
|
- // // tableName: "",
|
|
|
- // implementationName: this.row.benmTaskAutomaticScriptTriggerType,
|
|
|
- // taskProcessKey: this.row.bepTaskKey,
|
|
|
- // },
|
|
|
- // commMap: {
|
|
|
- // //formData
|
|
|
- // },
|
|
|
- // };
|
|
|
-
|
|
|
+ // return;
|
|
|
+ let formData = await this.getFormData();
|
|
|
+ if (!formData) return;
|
|
|
+ formData.taskPlanKey = this.row.bepTaskPlanKey;
|
|
|
let payLoad = {
|
|
|
taskProcessKey: this.row.bepTaskKey, //当前任务流程编码
|
|
|
taskNodeKey: nodeId, //当前执行节点唯一编码
|
|
|
nextNodeKey: nextNodeId, //下一节点编码
|
|
|
implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
|
|
|
- taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
|
|
|
- formDataMap: formData.data, //自定义表单组件收集的表单数据
|
|
|
+ // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
|
|
|
+ tableName: this.tableName,
|
|
|
+ formDataMap: JSON.stringify(formData), //自定义表单组件收集的表单数据
|
|
|
+ taskNodeType: this.backExceptionTaskList.includes(
|
|
|
+ this.row.benTaskNodeFormKey
|
|
|
+ )
|
|
|
+ ? "backExceptionTask"
|
|
|
+ : this.row.benTaskNodeType,
|
|
|
};
|
|
|
- runProcessNodeExecution(payLoad).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ let fileXML = new File(
|
|
|
+ [this.row.bepTaskProcessXmlContent],
|
|
|
+ this.row.bepTaskKey + ".bpmn",
|
|
|
+ {
|
|
|
+ type: "text/bpmn",
|
|
|
+ }
|
|
|
+ );
|
|
|
+ const subformData = new FormData();
|
|
|
+ subformData.append("fileXML", fileXML);
|
|
|
+ for (let key in payLoad) {
|
|
|
+ subformData.append(key, payLoad[key] == null ? "" : payLoad[key]);
|
|
|
+ }
|
|
|
+ runProcessNodeExecution(subformData).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("运行成功!");
|
|
|
+ this.getList();
|
|
|
+ this.open = false;
|
|
|
+ }
|
|
|
});
|
|
|
- console.log(payLoad);
|
|
|
+ },
|
|
|
+ // 获取拖拽表单数据
|
|
|
+ async getDragFormInfo(fid) {
|
|
|
+ try {
|
|
|
+ let res = await getForm(fid);
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.jsonData = JSON.parse(res.data.dfVueTemplate);
|
|
|
+ this.tableName = res.data.dfTableName;
|
|
|
+ if (res.data.dfFormSql) {
|
|
|
+ this.dynamicData = JSON.parse(res.data.dfFormSql);
|
|
|
+ console.log(this.dynamicData);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ throw new Error(res);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
},
|
|
|
// 关闭运行节点弹窗
|
|
|
closeExecuteNode(row) {
|
|
|
- console.log(row);
|
|
|
this.open = false;
|
|
|
},
|
|
|
// 获取下一个节点的nodekey
|
|
@@ -322,8 +540,33 @@ export default {
|
|
|
return xmlObj;
|
|
|
},
|
|
|
// 触发异常回调
|
|
|
- handleCommand(command, row) {
|
|
|
- console.log("触发异常");
|
|
|
+ exceptionTrigger(row, scriptData) {
|
|
|
+ let _this = this;
|
|
|
+ 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) => {
|
|
|
+ console.log(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 = []) {
|
|
@@ -343,9 +586,9 @@ export default {
|
|
|
.col {
|
|
|
background-color: #fff;
|
|
|
border-right: 1px solid #ebedf2;
|
|
|
- // margin-right: 3px;
|
|
|
+ /* margin-right: 3px; */
|
|
|
.statistic-wrap {
|
|
|
- // height: 70px;
|
|
|
+ /* // height: 70px; */
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -388,8 +631,8 @@ export default {
|
|
|
padding: 0px 20px 0px 20px;
|
|
|
height: 70px;
|
|
|
|
|
|
- .header {
|
|
|
- }
|
|
|
+ /* .header {
|
|
|
+ } */
|
|
|
|
|
|
.search-list {
|
|
|
display: flex;
|