|
|
@ -12,15 +12,19 @@ |
|
|
<el-tab-pane label="表单信息" name="1"> |
|
|
<el-tab-pane label="表单信息" name="1"> |
|
|
<el-col :span="16" :offset="4"> |
|
|
<el-col :span="16" :offset="4"> |
|
|
<div class="test-form"> |
|
|
<div class="test-form"> |
|
|
<parser :key="new Date().getTime()" :form-conf="variablesData" /> |
|
|
<!-- <parser :key="new Date().getTime()" :form-conf="variablesData"/>--> |
|
|
|
|
|
<parser :key="new Date().getTime()" :form-conf="variablesData" @submit="submitForm" ref="parser"/> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-left:15%;margin-bottom: 20px;font-size: 14px;"> |
|
|
<div style="margin-left:15%;margin-bottom: 20px;font-size: 14px;"> |
|
|
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleComplete">审批</el-button> |
|
|
<el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini" |
|
|
|
|
|
@click="handleComplete">审批 |
|
|
|
|
|
</el-button> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>--> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>--> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>--> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>--> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>--> |
|
|
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>--> |
|
|
<el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button> |
|
|
<!-- <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>--> |
|
|
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button> |
|
|
<!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>--> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
@ -83,7 +87,8 @@ |
|
|
<flow-user v-if="checkSendUser" :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user> |
|
|
<flow-user v-if="checkSendUser" :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user> |
|
|
<flow-role v-if="checkSendRole" @handleRoleSelect="handleRoleSelect"></flow-role> |
|
|
<flow-role v-if="checkSendRole" @handleRoleSelect="handleRoleSelect"></flow-role> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="处理意见" label-width="80px" prop="comment" :rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]"> |
|
|
<el-form-item label="处理意见" label-width="80px" prop="comment" |
|
|
|
|
|
:rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]"> |
|
|
<el-input type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/> |
|
|
<el-input type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -101,10 +106,12 @@ |
|
|
v-for="item in returnTaskList" |
|
|
v-for="item in returnTaskList" |
|
|
:key="item.id" |
|
|
:key="item.id" |
|
|
:label="item.id" |
|
|
:label="item.id" |
|
|
>{{item.name}}</el-radio-button> |
|
|
>{{ item.name }} |
|
|
|
|
|
</el-radio-button> |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="退回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]"> |
|
|
<el-form-item label="退回意见" prop="comment" |
|
|
|
|
|
:rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]"> |
|
|
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/> |
|
|
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -116,7 +123,8 @@ |
|
|
<!--驳回流程--> |
|
|
<!--驳回流程--> |
|
|
<el-dialog :title="rejectTitle" :visible.sync="rejectOpen" width="40%" append-to-body> |
|
|
<el-dialog :title="rejectTitle" :visible.sync="rejectOpen" width="40%" append-to-body> |
|
|
<el-form ref="taskForm" :model="taskForm" label-width="80px"> |
|
|
<el-form ref="taskForm" :model="taskForm" label-width="80px"> |
|
|
<el-form-item label="驳回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]"> |
|
|
<el-form-item label="驳回意见" prop="comment" |
|
|
|
|
|
:rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]"> |
|
|
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/> |
|
|
<el-input style="width: 50%" type="textarea" v-model="taskForm.comment" placeholder="请输入意见"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -134,8 +142,16 @@ import {flowRecord} from "@/api/flowable/finished"; |
|
|
import FlowUser from '@/components/flow/User' |
|
|
import FlowUser from '@/components/flow/User' |
|
|
import FlowRole from '@/components/flow/Role' |
|
|
import FlowRole from '@/components/flow/Role' |
|
|
import Parser from '@/components/parser/Parser' |
|
|
import Parser from '@/components/parser/Parser' |
|
|
import {getProcessVariables, flowXmlAndNode} from "@/api/flowable/definition"; |
|
|
import {getProcessVariables, flowXmlAndNode, definitionStart} from "@/api/flowable/definition"; |
|
|
import {complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate} from "@/api/flowable/todo"; |
|
|
import { |
|
|
|
|
|
complete, |
|
|
|
|
|
rejectTask, |
|
|
|
|
|
returnList, |
|
|
|
|
|
returnTask, |
|
|
|
|
|
getNextFlowNode, |
|
|
|
|
|
delegate, |
|
|
|
|
|
flowTaskForm, |
|
|
|
|
|
} from "@/api/flowable/todo"; |
|
|
import flow from '@/views/flowable/task/todo/detail/flow' |
|
|
import flow from '@/views/flowable/task/todo/detail/flow' |
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|
|
import {listUser} from "@/api/system/user"; |
|
|
import {listUser} from "@/api/system/user"; |
|
|
@ -186,7 +202,9 @@ export default { |
|
|
taskId: "",// 流程任务编号 |
|
|
taskId: "",// 流程任务编号 |
|
|
procDefId: "", // 流程编号 |
|
|
procDefId: "", // 流程编号 |
|
|
targetKey: "", |
|
|
targetKey: "", |
|
|
variables:{}, |
|
|
variables: { |
|
|
|
|
|
variables: {} |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
assignee: null, |
|
|
assignee: null, |
|
|
formConf: {}, // 默认表单数据 |
|
|
formConf: {}, // 默认表单数据 |
|
|
@ -205,7 +223,8 @@ export default { |
|
|
checkType: 'single', // 选择类型 |
|
|
checkType: 'single', // 选择类型 |
|
|
taskName: null, // 任务节点 |
|
|
taskName: null, // 任务节点 |
|
|
startUser: null, // 发起人信息, |
|
|
startUser: null, // 发起人信息, |
|
|
multiInstanceVars: '' // 会签节点 |
|
|
multiInstanceVars: '', // 会签节点 |
|
|
|
|
|
formKeyExist: false, // 当前节点是否存在表单 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
@ -217,10 +236,11 @@ export default { |
|
|
this.taskForm.procInsId = this.$route.query.procInsId; |
|
|
this.taskForm.procInsId = this.$route.query.procInsId; |
|
|
this.taskForm.executionId = this.$route.query.executionId; |
|
|
this.taskForm.executionId = this.$route.query.executionId; |
|
|
this.taskForm.instanceId = this.$route.query.procInsId; |
|
|
this.taskForm.instanceId = this.$route.query.procInsId; |
|
|
// 流程任务重获取变量表单 |
|
|
// 流程任务获取变量信息 |
|
|
if (this.taskForm.taskId) { |
|
|
if (this.taskForm.taskId) { |
|
|
this.processVariables(this.taskForm.taskId) |
|
|
this.processVariables(this.taskForm.taskId) |
|
|
this.getNextFlowNode(this.taskForm.taskId) |
|
|
this.getFlowTaskForm(this.taskForm.taskId) |
|
|
|
|
|
// this.getNextFlowNode(this.taskForm.taskId) |
|
|
} |
|
|
} |
|
|
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId); |
|
|
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId); |
|
|
} |
|
|
} |
|
|
@ -296,7 +316,18 @@ export default { |
|
|
if (taskId) { |
|
|
if (taskId) { |
|
|
// 提交流程申请时填写的表单存入了流程变量中后续任务处理时需要展示 |
|
|
// 提交流程申请时填写的表单存入了流程变量中后续任务处理时需要展示 |
|
|
getProcessVariables(taskId).then(res => { |
|
|
getProcessVariables(taskId).then(res => { |
|
|
this.variablesData = res.data.variables; |
|
|
// this.variablesData = res.data.variables; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
/** 流程节点表单 */ |
|
|
|
|
|
getFlowTaskForm(taskId) { |
|
|
|
|
|
if (taskId) { |
|
|
|
|
|
// 提交流程申请时填写的表单存入了流程变量中后续任务处理时需要展示 |
|
|
|
|
|
flowTaskForm({taskId: taskId}).then(res => { |
|
|
|
|
|
this.variablesData = res.data.formData; |
|
|
|
|
|
this.taskForm.variables = res.data.formData; |
|
|
|
|
|
this.formKeyExist = res.data.formKeyExist; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -326,8 +357,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
/** 加载审批任务弹框 */ |
|
|
/** 加载审批任务弹框 */ |
|
|
handleComplete() { |
|
|
handleComplete() { |
|
|
this.completeOpen = true; |
|
|
// this.completeOpen = true; |
|
|
this.completeTitle = "流程审批"; |
|
|
// this.completeTitle = "流程审批"; |
|
|
|
|
|
this.submitForm(null); |
|
|
}, |
|
|
}, |
|
|
/** 用户审批任务 */ |
|
|
/** 用户审批任务 */ |
|
|
taskComplete() { |
|
|
taskComplete() { |
|
|
@ -343,11 +375,26 @@ export default { |
|
|
this.$modal.msgError("请输入审批意见!"); |
|
|
this.$modal.msgError("请输入审批意见!"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.taskForm && this.formKeyExist) { |
|
|
|
|
|
// 表单是否禁用 |
|
|
|
|
|
this.taskForm.formData.formData.disabled = true; |
|
|
|
|
|
// 是否显示按钮 |
|
|
|
|
|
this.taskForm.formData.formData.formBtns = false; |
|
|
|
|
|
this.taskForm.variables = Object.assign({}, this.taskForm.variables, this.taskForm.formData.valData); |
|
|
|
|
|
this.taskForm.variables.variables = this.taskForm.formData.formData; |
|
|
|
|
|
|
|
|
console.log(this.taskForm, "流程审批提交表单数据") |
|
|
console.log(this.taskForm, "流程审批提交表单数据") |
|
|
complete(this.taskForm).then(response => { |
|
|
complete(this.taskForm).then(response => { |
|
|
this.$modal.msgSuccess(response.msg); |
|
|
this.$modal.msgSuccess(response.msg); |
|
|
this.goBack(); |
|
|
this.goBack(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log(this.taskForm, "流程审批提交表单数据") |
|
|
|
|
|
complete(this.taskForm).then(response => { |
|
|
|
|
|
this.$modal.msgSuccess(response.msg); |
|
|
|
|
|
this.goBack(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
/** 委派任务 */ |
|
|
/** 委派任务 */ |
|
|
handleDelegate() { |
|
|
handleDelegate() { |
|
|
@ -363,28 +410,6 @@ export default { |
|
|
this.$store.dispatch("tagsView/delView", this.$route); |
|
|
this.$store.dispatch("tagsView/delView", this.$route); |
|
|
this.$router.go(-1) |
|
|
this.$router.go(-1) |
|
|
}, |
|
|
}, |
|
|
/** 接收子组件传的值 */ |
|
|
|
|
|
getData(data) { |
|
|
|
|
|
if (data) { |
|
|
|
|
|
const variables = []; |
|
|
|
|
|
data.fields.forEach(item => { |
|
|
|
|
|
let variableData = {}; |
|
|
|
|
|
variableData.label = item.__config__.label |
|
|
|
|
|
// 表单值为多个选项时 |
|
|
|
|
|
if (item.__config__.defaultValue instanceof Array) { |
|
|
|
|
|
const array = []; |
|
|
|
|
|
item.__config__.defaultValue.forEach(val => { |
|
|
|
|
|
array.push(val) |
|
|
|
|
|
}) |
|
|
|
|
|
variableData.val = array; |
|
|
|
|
|
} else { |
|
|
|
|
|
variableData.val = item.__config__.defaultValue |
|
|
|
|
|
} |
|
|
|
|
|
variables.push(variableData) |
|
|
|
|
|
}) |
|
|
|
|
|
this.variables = variables; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
/** 驳回任务 */ |
|
|
/** 驳回任务 */ |
|
|
handleReject() { |
|
|
handleReject() { |
|
|
this.rejectOpen = true; |
|
|
this.rejectOpen = true; |
|
|
@ -444,7 +469,43 @@ export default { |
|
|
this.taskForm.defaultTaskShow = true; |
|
|
this.taskForm.defaultTaskShow = true; |
|
|
this.returnTaskList = []; |
|
|
this.returnTaskList = []; |
|
|
}, |
|
|
}, |
|
|
|
|
|
/** 申请流程表单数据提交 */ |
|
|
|
|
|
submitForm(formData) { |
|
|
|
|
|
// 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况 |
|
|
|
|
|
const params = {taskId: this.taskForm.taskId} |
|
|
|
|
|
getNextFlowNode(params).then(res => { |
|
|
|
|
|
const data = res.data; |
|
|
|
|
|
if (data) { |
|
|
|
|
|
if (data.type === 'assignee') { // 指定人员 |
|
|
|
|
|
this.checkSendUser = true; |
|
|
|
|
|
this.checkType = "single"; |
|
|
|
|
|
} else if (data.type === 'candidateUsers') { // 候选人员(多个) |
|
|
|
|
|
this.checkSendUser = true; |
|
|
|
|
|
this.checkType = "multiple"; |
|
|
|
|
|
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务) |
|
|
|
|
|
this.checkSendRole = true; |
|
|
|
|
|
} else if (data.type === 'multiInstance') { // 会签? |
|
|
|
|
|
// 流程设计指定的 elementVariable 作为会签人员列表 |
|
|
|
|
|
this.multiInstanceVars = data.vars; |
|
|
|
|
|
this.checkSendUser = true; |
|
|
|
|
|
this.checkType = "multiple"; |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.checkSendUser || this.checkSendRole) { |
|
|
|
|
|
this.completeOpen = true; |
|
|
|
|
|
this.completeTitle = "流程审批"; |
|
|
|
|
|
this.taskForm.formData = formData; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 最后一个任务节点 |
|
|
|
|
|
console.log(this.taskForm, "流程审批提交表单数据") |
|
|
|
|
|
complete(this.taskForm).then(response => { |
|
|
|
|
|
this.$modal.msgSuccess(response.msg); |
|
|
|
|
|
this.goBack(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@ -459,6 +520,7 @@ export default { |
|
|
display: table; |
|
|
display: table; |
|
|
content: ""; |
|
|
content: ""; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.clearfix:after { |
|
|
.clearfix:after { |
|
|
clear: both |
|
|
clear: both |
|
|
} |
|
|
} |
|
|
|