Browse Source

fix: 会签任务可选择任务接收人

master
tony 3 years ago
parent
commit
bfd75ac552
  1. 4
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java
  2. 22
      ruoyi-ui/src/views/flowable/definition/index.vue
  3. 31
      ruoyi-ui/src/views/flowable/task/myProcess/send/index.vue
  4. 58
      ruoyi-ui/src/views/flowable/task/todo/detail/index.vue

4
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java

@ -954,7 +954,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
// 会签节点
if (Objects.nonNull(multiInstance)) {
flowNextDto.setVars(ProcessConstants.PROCESS_MULTI_INSTANCE_USER);
flowNextDto.setVars(multiInstance.getInputDataItem());
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
} else {
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
@ -994,7 +994,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
// 会签节点
if (Objects.nonNull(multiInstance)) {
flowNextDto.setVars(ProcessConstants.PROCESS_MULTI_INSTANCE_USER);
flowNextDto.setVars(multiInstance.getInputDataItem());
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
} else {
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组

22
ruoyi-ui/src/views/flowable/definition/index.vue

@ -176,7 +176,7 @@
<!-- 流程图 -->
<el-dialog :title="readImage.title" :visible.sync="readImage.open" width="70%" append-to-body>
<!-- <el-image :src="readImage.src"></el-image> -->
<flow :xmlData="xmlData"/>
<flow :flowData="flowData"/>
</el-dialog>
<!--表单配置详情-->
@ -227,7 +227,16 @@
</template>
<script>
import { listDefinition, updateState, delDeployment, addDeployment, updateDeployment, exportDeployment, definitionStart, readXml} from "@/api/flowable/definition";
import {
listDefinition,
updateState,
delDeployment,
addDeployment,
updateDeployment,
exportDeployment,
definitionStart,
flowXmlAndNode
} from "@/api/flowable/definition";
import { getToken } from "@/utils/auth";
import { getForm, addDeployForm ,listForm } from "@/api/flowable/form";
import Parser from '@/components/parser/Parser'
@ -311,7 +320,7 @@ export default {
},
currentRow: null,
// xml
xmlData:"",
flowData: {},
//
form: {},
//
@ -380,13 +389,12 @@ export default {
this.$router.push({ path: '/flowable/definition/model',query: { deployId: row.deploymentId }})
},
/** 流程图查看 */
handleReadImage(deploymentId){
handleReadImage(deployId){
this.readImage.title = "流程图";
this.readImage.open = true;
// this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId;
// xml
readXml(deploymentId).then(res =>{
this.xmlData = res.data
flowXmlAndNode({deployId:deployId}).then(res => {
this.flowData = res.data;
})
},
/** 表单查看 */

31
ruoyi-ui/src/views/flowable/task/myProcess/send/index.vue

@ -5,9 +5,9 @@
<span class="el-icon-document">发起任务</span>
<el-button style="float: right;" size="mini" type="primary" @click="goBack">关闭</el-button>
</div>
<el-tabs tab-position="top" @tab-click="handleClick">
<el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
<!--表单信息-->
<el-tab-pane label="表单信息">
<el-tab-pane label="表单信息" name="1">
<!--初始化流程加载表单信息-->
<el-col :span="16" :offset="4">
<div class="test-form">
@ -16,7 +16,7 @@
</el-col>
</el-tab-pane>
<!--流程图-->
<el-tab-pane label="流程图">
<el-tab-pane label="流程图" name="2">
<flow :flowData="flowData"/>
</el-tab-pane>
</el-tabs>
@ -56,6 +56,7 @@ export default {
return {
// xml
flowData: {},
activeName: '1', // tab
defaultProps: {
children: "children",
label: "label"
@ -74,10 +75,10 @@ export default {
taskOpen: false,
checkSendUser: false, //
checkSendRole: false,//
checkType: 'single', //
checkType: '', //
checkValues: null, //
formData: {}, // ,
activeValue: 1, // tab
multiInstanceVars: '' //
};
},
created() {
@ -89,7 +90,7 @@ export default {
},
methods: {
handleClick(tab, event) {
if (tab.name === '3'){
if (tab.name === '2'){
flowXmlAndNode({deployId:this.deployId}).then(res => {
this.flowData = res.data;
})
@ -149,7 +150,10 @@ export default {
} 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.taskOpen = true;
@ -194,7 +198,11 @@ export default {
//
formData.formBtns = false;
variables.variables = formData;
variables.approval = this.checkValues;
if (this.multiInstanceVars) {
this.$set(variables, this.multiInstanceVars, this.checkValues);
} else {
this.$set(variables, "approval", this.checkValues);
}
console.log(variables,"流程发起提交表单数据")
//
definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
@ -218,7 +226,10 @@ export default {
} else if (data.type === 'candidateGroups') { // ()
this.checkSendRole = true;
} else if (data.type === 'multiInstance') { // ?
// elementVariable
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
}
})
@ -228,7 +239,11 @@ export default {
if (selection) {
if (selection instanceof Array) {
const selectVal = selection.map(item => item.userId);
this.checkValues = selectVal.join(',')
if (this.multiInstanceVars) {
this.checkValues = selection;
} else {
this.checkValues = selectVal.join(',');
}
} else {
this.checkValues = selection.userId;
}

58
ruoyi-ui/src/views/flowable/task/todo/detail/index.vue

@ -179,15 +179,14 @@ export default {
returnTaskShow: false, // 退
delegateTaskShow: false, // 退
defaultTaskShow: true, //
sendUserShow: false, //
comment:"", //
procInsId: "", //
instanceId: "", //
deployId: "", //
taskId: "" ,//
procDefId: "", //
vars: "",
targetKey:""
targetKey:"",
variables:{},
},
assignee: null,
formConf: {}, //
@ -205,7 +204,8 @@ export default {
checkSendRole: false,//
checkType: 'single', //
taskName: null, //
startUser: null, //
startUser: null, // ,
multiInstanceVars: '' //
};
},
created() {
@ -252,13 +252,13 @@ export default {
if (selection) {
if (selection instanceof Array) {
const selectVal = selection.map(item => item.userId);
this.taskForm.values = {
"approval": selectVal.join(',')
if (this.multiInstanceVars) {
this.$set(this.taskForm.variables, this.multiInstanceVars, selection);
} else {
this.$set(this.taskForm.variables, "approval", selectVal.join(','));
}
} else {
this.taskForm.values = {
"approval": selection
}
this.$set(this.taskForm.variables, "approval", selection);
}
}
},
@ -267,25 +267,9 @@ export default {
if (selection) {
if (selection instanceof Array) {
const selectVal = selection.map(item => item.roleId);
this.taskForm.values = {
"approval": selectVal.join(',')
}
this.$set(this.taskForm.variables, "approval", selectVal.join(','));
} else {
this.taskForm.values = {
"approval": selection
}
}
}
},
/** 流程变量赋值 */
handleCheckChange(val) {
if (val instanceof Array) {
this.taskForm.values = {
"approval": val.join(',')
}
} else {
this.taskForm.values = {
"approval": val
this.$set(this.taskForm.variables, "approval", selection);
}
}
},
@ -332,12 +316,10 @@ export default {
} else if (data.type === 'candidateGroups') { // ()
this.checkSendRole = true;
} else if (data.type === 'multiInstance') { //
listUser().then(response => {
this.taskForm.values = {
"userList": response.rows
}
}
);
// elementVariable
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
}
})
@ -349,11 +331,11 @@ export default {
},
/** 用户审批任务 */
taskComplete() {
if (!this.taskForm.values && this.checkSendUser){
if (!this.taskForm.variables && this.checkSendUser){
this.$modal.msgError("请选择流程接收人员!");
return;
}
if (!this.taskForm.values && this.checkSendRole){
if (!this.taskForm.variables && this.checkSendRole){
this.$modal.msgError("请选择流程接收角色组!");
return;
}
@ -361,7 +343,7 @@ export default {
this.$modal.msgError("请输入审批意见!");
return;
}
// console.log(this.taskForm,"")
console.log(this.taskForm,"流程审批提交表单数据")
complete(this.taskForm).then(response => {
this.$modal.msgSuccess(response.msg);
this.goBack();
@ -425,7 +407,7 @@ export default {
this.returnTitle = "退回流程";
returnList(this.taskForm).then(res => {
this.returnTaskList = res.data;
this.taskForm.values = null;
this.taskForm.variables = null;
})
},
/** 提交退回任务 */
@ -443,7 +425,6 @@ export default {
cancelTask() {
this.taskForm.returnTaskShow = false;
this.taskForm.defaultTaskShow = true;
this.taskForm.sendUserShow = true;
this.returnTaskList = [];
},
/** 委派任务 */
@ -461,7 +442,6 @@ export default {
cancelDelegateTask() {
this.taskForm.delegateTaskShow = false;
this.taskForm.defaultTaskShow = true;
this.taskForm.sendUserShow = true;
this.returnTaskList = [];
},
}

Loading…
Cancel
Save