|
@@ -49,66 +49,34 @@
|
|
|
@selection-change="() => {}"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column type="index" width="50" align="center" />
|
|
|
<el-table-column
|
|
|
- label="流程编号"
|
|
|
+ v-for="col in newColumn"
|
|
|
+ :prop="col.prop"
|
|
|
+ :key="col.prop"
|
|
|
+ :label="col.label"
|
|
|
align="center"
|
|
|
- prop="procInsId"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="流程名称"
|
|
|
- align="center"
|
|
|
- prop="procDefName"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="流程类别"
|
|
|
- align="center"
|
|
|
- prop="category"
|
|
|
- width="100px"
|
|
|
- />
|
|
|
- <el-table-column label="流程版本" align="center" width="80px">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="提交时间"
|
|
|
- align="center"
|
|
|
- prop="createTime"
|
|
|
- width="180"
|
|
|
- />
|
|
|
- <el-table-column label="流程状态" align="center" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.finishTime == null" size="mini"
|
|
|
- >进行中</el-tag
|
|
|
- >
|
|
|
- <el-tag
|
|
|
- type="success"
|
|
|
- v-if="scope.row.finishTime != null"
|
|
|
- size="mini"
|
|
|
- >已完成</el-tag
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="耗时"
|
|
|
- align="center"
|
|
|
- prop="duration"
|
|
|
- width="180"
|
|
|
- />
|
|
|
- <el-table-column label="当前节点" align="center" prop="taskName" />
|
|
|
- <el-table-column label="办理人" align="center">
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <label v-if="scope.row.assigneeName"
|
|
|
- >{{ scope.row.assigneeName }}
|
|
|
- <el-tag type="info" size="mini">{{
|
|
|
- scope.row.assigneeDeptName
|
|
|
- }}</el-tag></label
|
|
|
- >
|
|
|
- <!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
|
|
|
+ <span v-if="col.prop == 'benCreateTime'">{{
|
|
|
+ scope.row.benCreateTime.replace("T", " ")
|
|
|
+ }}</span>
|
|
|
+ <span v-else-if="col.prop == 'bepTaskProcessType'">{{
|
|
|
+ getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
|
|
|
+ }}</span>
|
|
|
+ <span v-else-if="col.prop == 'benTaskNodeState'">{{
|
|
|
+ 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>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
width="150"
|
|
@@ -116,7 +84,48 @@
|
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="(scope) => {}" type="text" size="small"
|
|
|
+ <el-button
|
|
|
+ class="mr5 mb5"
|
|
|
+ @click="approveHandler(scope.row)"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ >审批</el-button
|
|
|
+ >
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button type="warning" plain size="small">
|
|
|
+ 处理<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <!-- <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ @click="approveHandler(scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ >审批</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item> -->
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button @click="(scope) => {}" type="text" size="small"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button @click="() => {}" type="text" size="small"
|
|
|
+ >取消申请</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ @click="() => {}"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ v-hasPermi="['system:deployment:remove']"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <!-- <el-button @click="(scope) => {}" type="text" size="small"
|
|
|
>详情</el-button
|
|
|
>
|
|
|
<el-button @click="() => {}" type="text" size="small"
|
|
@@ -128,19 +137,30 @@
|
|
|
size="small"
|
|
|
v-hasPermi="['system:deployment:remove']"
|
|
|
>删除</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
- <!-- <pagination
|
|
|
+ <pagination
|
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
- /> -->
|
|
|
+ />
|
|
|
+ <!-- 审批弹窗 -->
|
|
|
+ <el-dialog title="审批" :visible.sync="show">
|
|
|
+ <!-- <FormGroup ref="formGroupRef" :formList="formList"></FormGroup> -->
|
|
|
+ <Approve ref="approveRef" :formList="formList"></Approve>
|
|
|
+ <template #footer>
|
|
|
+ <span>
|
|
|
+ <el-button @click="show = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmHandler">确认</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
@@ -152,18 +172,25 @@ import {
|
|
|
runProcessNodeExecution,
|
|
|
getProcessNodeFormTemplate,
|
|
|
getProcessNodeFormInfoData,
|
|
|
+ processNodeExecutionApproval,
|
|
|
} from "@/api/bpmprocess/run/executeProcess";
|
|
|
import { triggerExceptionNode } from "@/api/bpmprocess/process";
|
|
|
import getNodeSequence from "@/utils/bpmn/getNodeSequence";
|
|
|
import { getForm } from "@/api/dragform/form";
|
|
|
+import FormGroup from "@/components/FormGroup/index.vue";
|
|
|
+import Approve from "@/components/FormGroup/Approve.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "processMange",
|
|
|
props: [],
|
|
|
- components: {},
|
|
|
+ components: { FormGroup, Approve },
|
|
|
dicts: ["bpm_type", "task_process_state"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 弹窗表单数据
|
|
|
+ row: {},
|
|
|
+ formList: [],
|
|
|
+ show: false,
|
|
|
loading: false,
|
|
|
row: {}, //当前操作行数据
|
|
|
myForm: "", //自定义表单组件名
|
|
@@ -181,6 +208,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
taskProcessState: "0",
|
|
|
+ taskProcessType: 1,
|
|
|
},
|
|
|
total: 0,
|
|
|
columns: [
|
|
@@ -192,10 +220,10 @@ export default {
|
|
|
prop: "bepTaskName",
|
|
|
label: "任务名称",
|
|
|
},
|
|
|
- {
|
|
|
- prop: "bepTaskProcessType",
|
|
|
- label: "任务流程类型",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: "bepTaskProcessType",
|
|
|
+ // label: "任务流程类型",
|
|
|
+ // },
|
|
|
{
|
|
|
prop: "bepTaskProcessState",
|
|
|
label: "任务流程状态",
|
|
@@ -239,14 +267,158 @@ export default {
|
|
|
backExceptionTaskList: ["GY06"], //特殊回退表单组件列表
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
- mounted() {},
|
|
|
+ computed: {
|
|
|
+ newColumn() {
|
|
|
+ if (this.queryParams.taskProcessState == "3") {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ prop: "bepTaskKey",
|
|
|
+ label: "任务编号",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "bepTaskName",
|
|
|
+ label: "任务名称",
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // prop: "bepTaskProcessType",
|
|
|
+ // label: "任务流程类型",
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: "bepTaskProcessState",
|
|
|
+ label: "任务流程状态",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "benCreateBy",
|
|
|
+ label: "创建人",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "benCreateTime",
|
|
|
+ label: "创建时间",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ return this.columns;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ // 审批回调
|
|
|
+ async approveHandler(row) {
|
|
|
+ console.log(row);
|
|
|
+ this.row = row;
|
|
|
+ let {
|
|
|
+ benTaskNodeFormKey,
|
|
|
+ benTaskNodeFormType,
|
|
|
+ bepTaskPlanKey,
|
|
|
+ bepTaskKey,
|
|
|
+ benTaskNodeKey,
|
|
|
+ bepTaskNodeKey,
|
|
|
+ benTaskProcessKey,
|
|
|
+ benmTaskAutomaticScriptTriggerType,
|
|
|
+ bepTaskNodeNextKey,
|
|
|
+ } = row;
|
|
|
+ // 新的运行逻辑
|
|
|
+ let payLoad = {
|
|
|
+ taskNodeKey: benTaskNodeKey,
|
|
|
+ taskProcessKey: benTaskProcessKey,
|
|
|
+ // taskAutomaticScriptTriggerType: benmTaskAutomaticScriptTriggerType,
|
|
|
+ taskPlanKey: bepTaskPlanKey,
|
|
|
+ };
|
|
|
+ let res = await getProcessNodeFormTemplate(payLoad);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.formList = res.data;
|
|
|
+ this.tableName = res.data[0].template.dfTableName;
|
|
|
+ this.show = true;
|
|
|
+ console.log(this.show);
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
+ },
|
|
|
toDetail() {
|
|
|
this.$router.push({
|
|
|
path: "/processMange/detail",
|
|
|
});
|
|
|
},
|
|
|
+ // 获取列表数据
|
|
|
+ getList() {
|
|
|
+ processList({ ...this.queryParams, taskName: this.queryString }).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableData = res.rows.map((item) => item.resultMap);
|
|
|
+ this.total = res.total;
|
|
|
+ console.log(this.tableData);
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络异常,请稍后再试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 获取字典对应label
|
|
|
+ getDictLabel(value, dictLsit = []) {
|
|
|
+ return dictLsit.find((item) => {
|
|
|
+ return item.value == value;
|
|
|
+ })?.label;
|
|
|
+ },
|
|
|
+ // xml字符串转xml对象
|
|
|
+ xmlStr2XmlObj(xmlStr) {
|
|
|
+ var xmlObj = {};
|
|
|
+ if (document.all) {
|
|
|
+ var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
|
|
|
+ xmlDom.loadXML(xmlStr);
|
|
|
+ xmlObj = xmlDom;
|
|
|
+ } else {
|
|
|
+ xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml");
|
|
|
+ }
|
|
|
+ return xmlObj;
|
|
|
+ },
|
|
|
+ // 获取下一个节点的nodekey
|
|
|
+ getNextNodeKey(nodeKey, xmlStr) {
|
|
|
+ let xmlObj = this.xmlStr2XmlObj(xmlStr);
|
|
|
+ let nodeSequence = getNodeSequence(xmlObj);
|
|
|
+ return nodeSequence.find((item) => item.nodeId == nodeKey) || {};
|
|
|
+ },
|
|
|
+ // 确认审批回调
|
|
|
+ async confirmHandler() {
|
|
|
+ let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
|
|
|
+ this.row;
|
|
|
+ let { nodeId, nextNodeId } = this.getNextNodeKey(
|
|
|
+ benTaskNodeKey,
|
|
|
+ bepTaskProcessXmlContent
|
|
|
+ );
|
|
|
+ console.log(this.$refs);
|
|
|
+ let res = await this.$refs.approveRef.getformInfo();
|
|
|
+ console.log(res);
|
|
|
+ if (!res.flag) return;
|
|
|
+ // 准备审批数据
|
|
|
+ let payLoad = {
|
|
|
+ taskProcessKey: this.row.bepTaskKey, //当前任务流程编码
|
|
|
+ taskNodeKey: nodeId, //当前执行节点唯一编码
|
|
|
+ nextNodeKey: nextNodeId, //下一节点编码
|
|
|
+ implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
|
|
|
+ // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
|
|
|
+ tableName: this.tableName,
|
|
|
+ // formDataMap: JSON.stringify(res.data), //自定义表单组件收集的表单数据
|
|
|
+ taskNodeType: this.row.benTaskNodeType,
|
|
|
+ ...res.data,
|
|
|
+ };
|
|
|
+ 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]);
|
|
|
+ }
|
|
|
+ let result = await processNodeExecutionApproval(subformData);
|
|
|
+ console.log(result);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|