feat: 流程设计数据回显
parent
f8a4d8f9a7
commit
8c8dfa1c0f
|
|
@ -11,7 +11,7 @@ public class ProcessConstants {
|
|||
/**
|
||||
* 动态数据
|
||||
*/
|
||||
public static final String DATA_TYPE = "dynamic";
|
||||
public static final String DYNAMIC = "dynamic";
|
||||
|
||||
/**
|
||||
* 固定任务接收
|
||||
|
|
@ -21,19 +21,19 @@ public class ProcessConstants {
|
|||
/**
|
||||
* 单个审批人
|
||||
*/
|
||||
public static final String USER_TYPE_ASSIGNEE = "assignee";
|
||||
public static final String ASSIGNEE = "assignee";
|
||||
|
||||
|
||||
/**
|
||||
* 候选人
|
||||
*/
|
||||
public static final String USER_TYPE_USERS = "candidateUsers";
|
||||
public static final String CANDIDATE_USERS = "candidateUsers";
|
||||
|
||||
|
||||
/**
|
||||
* 审批组
|
||||
*/
|
||||
public static final String USER_TYPE_ROUPS = "candidateGroups";
|
||||
public static final String CANDIDATE_GROUPS = "candidateGroups";
|
||||
|
||||
/**
|
||||
* 单个审批人
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import com.ruoyi.flowable.domain.dto.FlowNextDto;
|
|||
import com.ruoyi.flowable.domain.dto.FlowTaskDto;
|
||||
import com.ruoyi.flowable.domain.dto.FlowViewerDto;
|
||||
import com.ruoyi.flowable.domain.vo.FlowTaskVo;
|
||||
import com.ruoyi.flowable.domain.vo.ReturnTaskNodeVo;
|
||||
import com.ruoyi.flowable.factory.FlowServiceFactory;
|
||||
import com.ruoyi.flowable.flow.CustomProcessDiagramGenerator;
|
||||
import com.ruoyi.flowable.flow.FindNextNodeUtil;
|
||||
|
|
@ -32,15 +31,12 @@ import org.flowable.bpmn.model.Process;
|
|||
import org.flowable.bpmn.model.*;
|
||||
import org.flowable.common.engine.api.FlowableException;
|
||||
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
|
||||
import org.flowable.common.engine.api.query.QueryProperty;
|
||||
import org.flowable.common.engine.impl.identity.Authentication;
|
||||
import org.flowable.engine.ProcessEngineConfiguration;
|
||||
import org.flowable.engine.history.HistoricActivityInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstance;
|
||||
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
||||
import org.flowable.engine.impl.ActivityInstanceQueryProperty;
|
||||
import org.flowable.engine.repository.ProcessDefinition;
|
||||
import org.flowable.engine.runtime.ActivityInstance;
|
||||
import org.flowable.engine.runtime.Execution;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.flowable.engine.task.Comment;
|
||||
|
|
@ -60,7 +56,6 @@ import java.util.*;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author XuanXuan
|
||||
|
|
@ -952,44 +947,19 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|||
// 会签节点
|
||||
if (Objects.nonNull(multiInstance)) {
|
||||
List<SysUser> list = sysUserService.selectUserList(new SysUser());
|
||||
|
||||
flowNextDto.setVars(ProcessConstants.PROCESS_MULTI_INSTANCE_USER);
|
||||
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
||||
flowNextDto.setUserList(list);
|
||||
} else {
|
||||
|
||||
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
|
||||
String dataType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_DATA_TYPE);
|
||||
String userType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_USER_TYPE);
|
||||
|
||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||
flowNextDto.setType(userType);
|
||||
// 处理加载动态指定下一节点接收人员信息
|
||||
if (ProcessConstants.DATA_TYPE.equals(dataType)) {
|
||||
// 指定单个人员
|
||||
if (ProcessConstants.USER_TYPE_ASSIGNEE.equals(userType)) {
|
||||
List<SysUser> list = sysUserService.selectUserList(new SysUser());
|
||||
|
||||
if (ProcessConstants.DYNAMIC.equals(dataType)) {
|
||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||
flowNextDto.setType(ProcessConstants.USER_TYPE_ASSIGNEE);
|
||||
flowNextDto.setUserList(list);
|
||||
}
|
||||
// 候选人员(多个)
|
||||
if (ProcessConstants.USER_TYPE_USERS.equals(userType)) {
|
||||
List<SysUser> list = sysUserService.selectUserList(new SysUser());
|
||||
|
||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||
flowNextDto.setType(ProcessConstants.USER_TYPE_USERS);
|
||||
flowNextDto.setUserList(list);
|
||||
}
|
||||
// 候选组
|
||||
if (ProcessConstants.USER_TYPE_ROUPS.equals(userType)) {
|
||||
List<SysRole> sysRoles = sysRoleService.selectRoleAll();
|
||||
|
||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||
flowNextDto.setType(ProcessConstants.USER_TYPE_ROUPS);
|
||||
flowNextDto.setRoleList(sysRoles);
|
||||
}
|
||||
} else {
|
||||
flowNextDto.setType(ProcessConstants.FIXED);
|
||||
flowNextDto.setType(userType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<flow-user :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user>
|
||||
<flow-user :checkType="checkType" :selectValues="selectValues" @handleUserSelect="handleUserSelect"></flow-user>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="userVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="checkUserComplete">确 定</el-button>
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<flow-exp @handleSingleExpSelect="handleSingleExpSelect"></flow-exp>
|
||||
<flow-exp :selectValues="selectValues" @handleSingleExpSelect="handleSingleExpSelect"></flow-exp>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="expVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="checkExpComplete">确 定</el-button>
|
||||
|
|
@ -169,6 +169,7 @@ export default {
|
|||
checkType: 'single',
|
||||
// 选中的值
|
||||
checkValues: null,
|
||||
selectValues: null,
|
||||
// 用户列表
|
||||
userList: this.users,
|
||||
groupList: this.groups,
|
||||
|
|
@ -375,14 +376,14 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
'formData.userType': function(val, oldVal) {
|
||||
if (oldVal) {
|
||||
const types = ['assignee', 'candidateUsers', 'candidateGroups']
|
||||
if (oldVal) {
|
||||
types.forEach(type => {
|
||||
delete this.element.businessObject.$attrs[`flowable:${type}`]
|
||||
delete this.formData[type]
|
||||
this.updateProperties({'flowable:userType': type})
|
||||
})
|
||||
}
|
||||
this.updateProperties({'flowable:userType': val})
|
||||
},
|
||||
// // 动态选择流程执行人
|
||||
// 'formData.dataType': function(val) {
|
||||
|
|
@ -510,19 +511,21 @@ export default {
|
|||
const attrs = that.element.businessObject.$attrs;
|
||||
const businessObject = that.element.businessObject;
|
||||
// 指定用户
|
||||
if (attrs.hasOwnProperty("flowable:assignee")){
|
||||
if (attrs.hasOwnProperty("flowable:assignee")) {
|
||||
const val = attrs["flowable:assignee"];
|
||||
// 查找是否动态指定人员(选中流程表达式)
|
||||
if (attrs["flowable:dataType"] === "dynamic"){
|
||||
this.checkValues = that.expList.find(item => item.id == val).name;
|
||||
}else {
|
||||
if (attrs["flowable:dataType"] === "dynamic") {
|
||||
this.checkValues = that.expList.find(item => item.expression == val).name;
|
||||
this.selectValues = that.expList.find(item => item.expression == val).id;
|
||||
} else {
|
||||
this.checkValues = that.userList.find(item => item.userId == val).nickName;
|
||||
this.selectValues = that.userList.find(item => item.userId == val).userId;
|
||||
}
|
||||
// 候选用户
|
||||
} else if (attrs.hasOwnProperty("flowable:candidateUsers")) {
|
||||
const val = attrs["flowable:candidateUsers"];
|
||||
if (attrs["flowable:dataType"] === "dynamic") {
|
||||
this.checkValues = that.expList.find(item => item.id == val).name;
|
||||
this.checkValues = that.expList.find(item => item.expression == val).name;
|
||||
} else {
|
||||
const array = [];
|
||||
const vals = val.split(',');
|
||||
|
|
@ -533,25 +536,13 @@ export default {
|
|||
}
|
||||
})
|
||||
this.checkValues = array.join(',');
|
||||
this.selectValues = array.join(',');
|
||||
}
|
||||
// if (val.indexOf(",") !== -1) {
|
||||
// const vals = val.split(',');
|
||||
// vals.forEach(key => {
|
||||
// const user = that.userList.find(item => item.userId == key)
|
||||
// if (user) {
|
||||
// array.push(user.nickName);
|
||||
// }
|
||||
// })
|
||||
// this.checkValues = array.join(',');
|
||||
// }else {
|
||||
// const user = that.userList.find(item => item.userId == val);
|
||||
// this.checkValues = user.nickName;
|
||||
// }
|
||||
} else if (businessObject.hasOwnProperty("candidateGroups")){
|
||||
} else if (businessObject.hasOwnProperty("candidateGroups")) {
|
||||
// 候选角色信息
|
||||
const val = businessObject["candidateGroups"];
|
||||
if (attrs["flowable:dataType"] === "dynamic") {
|
||||
this.checkValues = that.expList.find(item => item.id == val).name;
|
||||
this.checkValues = that.expList.find(item => item.expression == val).name;
|
||||
} else {
|
||||
const array = [];
|
||||
const vals = val.split(',');
|
||||
|
|
@ -563,19 +554,6 @@ export default {
|
|||
})
|
||||
this.checkValues = array.join(',');
|
||||
}
|
||||
// if (val.indexOf(",") !== -1) {
|
||||
// const vals = val.split(',');
|
||||
// vals.forEach(key => {
|
||||
// const role = that.groupList.find(item => item.roleId == key)
|
||||
// if (role) {
|
||||
// array.push(role.roleName);
|
||||
// }
|
||||
// })
|
||||
// this.checkValues = array.join(',');
|
||||
// }else {
|
||||
// const role = that.groupList.find(item => item.roleId == val);
|
||||
// this.checkValues = role.roleName;
|
||||
// }
|
||||
}
|
||||
},
|
||||
finishExecutionListener() {
|
||||
|
|
@ -622,44 +600,42 @@ export default {
|
|||
this.expType = expType;
|
||||
},
|
||||
// 选中表达式
|
||||
handleSingleExpSelect(selection){
|
||||
handleSingleExpSelect(selection) {
|
||||
this.deleteFlowAttar();
|
||||
console.log(this.element.businessObject,"element.businessObject")
|
||||
this.updateProperties({'flowable:dataType': 'dynamic'})
|
||||
if ("assignee" === this.expType){
|
||||
this.updateProperties({'flowable:assignee': selection.id.toString()});
|
||||
}else if ("candidateUsers" === this.expType) {
|
||||
this.updateProperties({'flowable:candidateUsers': selection.id.toString()});
|
||||
}else if ("candidateGroups" === this.expType) {
|
||||
this.updateProperties({'flowable:candidateGroups': selection.id.toString()});
|
||||
if ("assignee" === this.expType) {
|
||||
this.updateProperties({'flowable:assignee': selection.expression});
|
||||
} else if ("candidateUsers" === this.expType) {
|
||||
this.updateProperties({'flowable:candidateUsers': selection.expression});
|
||||
} else if ("candidateGroups" === this.expType) {
|
||||
this.updateProperties({'flowable:candidateGroups': selection.expression});
|
||||
}
|
||||
this.checkValues = selection.name;
|
||||
this.expType = null;
|
||||
},
|
||||
// 用户选中数据
|
||||
handleUserSelect(selection) {
|
||||
console.log(selection,"handleUserSelect")
|
||||
const that = this;
|
||||
if (selection) {
|
||||
that.deleteFlowAttar();
|
||||
this.updateProperties({'flowable:dataType': 'fixed'})
|
||||
if (selection instanceof Array){
|
||||
that.updateProperties({'flowable:dataType': 'fixed'})
|
||||
if (selection instanceof Array) {
|
||||
const userIds = selection.map(item => item.userId);
|
||||
const nickName = selection.map(item => item.nickName);
|
||||
that.updateProperties({'flowable:candidateUsers': userIds.join(',')})
|
||||
that.checkValues = nickName.join(',');
|
||||
}else {
|
||||
} else {
|
||||
that.updateProperties({'flowable:assignee': selection.userId})
|
||||
that.checkValues = selection.nickName;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 角色选中数据
|
||||
handleRoleSelect(selection,name) {
|
||||
handleRoleSelect(selection, name) {
|
||||
const that = this;
|
||||
if (selection && name) {
|
||||
that.deleteFlowAttar();
|
||||
this.updateProperties({'flowable:dataType': 'fixed'})
|
||||
that.updateProperties({'flowable:dataType': 'fixed'})
|
||||
that.updateProperties({'flowable:candidateGroups': selection});
|
||||
that.checkValues = name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,19 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listExpression, getExpression, delExpression, addExpression, updateExpression } from "@/api/system/expression";
|
||||
import { listExpression } from "@/api/system/expression";
|
||||
|
||||
export default {
|
||||
name: "Expression",
|
||||
dicts: ['sys_common_status'],
|
||||
// 接受父组件的值
|
||||
props: {
|
||||
selectValues: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
@ -83,9 +91,18 @@ export default {
|
|||
expression: null,
|
||||
status: null,
|
||||
},
|
||||
radioSelected:null
|
||||
radioSelected: this.selectValues
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
selectValues: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
console.log(newVal,"selectValues")
|
||||
this.radioSelected = newVal
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
|
@ -112,7 +129,6 @@ export default {
|
|||
// 单选框选中数据
|
||||
handleSingleExpSelect(selection) {
|
||||
this.radioSelected = selection.id;//点击当前行时,radio同样有选中效果
|
||||
// console.log( this.radioSelected ,"handleSingleExpSelect");
|
||||
this.$emit('handleSingleExpSelect',selection);
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,10 +97,17 @@ export default {
|
|||
components: { Treeselect },
|
||||
// 接受父组件的值
|
||||
props: {
|
||||
checkType: String,
|
||||
default: 'multiple',
|
||||
selectValues: {
|
||||
type: Number | String,
|
||||
default: 0,
|
||||
required: false
|
||||
},
|
||||
checkType: {
|
||||
type: String,
|
||||
default: 'multiple',
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectType: this.checkType,
|
||||
|
|
@ -166,6 +173,13 @@ export default {
|
|||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
selectValues: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
console.log(newVal,"user-selectValues")
|
||||
this.radioSelected = newVal
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ function formBtns(h) {
|
|||
}
|
||||
|
||||
function renderFormItem(h, elementList) {
|
||||
if (elementList) {
|
||||
return elementList.map(scheme => {
|
||||
const config = scheme.__config__
|
||||
const layout = layouts[config.layout]
|
||||
|
|
@ -88,6 +89,7 @@ function renderFormItem(h, elementList) {
|
|||
}
|
||||
throw new Error(`没有与${config.layout}匹配的layout`)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function renderChildren(h, scheme) {
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@
|
|||
import Parser from '@/components/parser/Parser'
|
||||
import {definitionStart, readXml} from "@/api/flowable/definition";
|
||||
import flow from '@/views/flowable/task/record/flow'
|
||||
import {treeselect} from "@/api/system/dept";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import {listUser} from "@/api/system/user";
|
||||
import {flowFormData} from "@/api/flowable/process";
|
||||
|
||||
|
|
@ -37,7 +35,6 @@ export default {
|
|||
components: {
|
||||
Parser,
|
||||
flow,
|
||||
Treeselect
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
|
|
@ -83,12 +80,6 @@ export default {
|
|||
this.loadModelXml(this.taskForm.deployId);
|
||||
},
|
||||
methods: {
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
|
|
|
|||
|
|
@ -78,61 +78,13 @@
|
|||
</el-card>
|
||||
|
||||
<!--审批正常流程-->
|
||||
<el-dialog :title="completeTitle" :visible.sync="completeOpen" :width="checkSendUser? '60%':'40%'" append-to-body>
|
||||
<el-dialog :title="completeTitle" :visible.sync="completeOpen" width="60%" append-to-body>
|
||||
<el-form ref="taskForm" :model="taskForm">
|
||||
<el-form-item v-if="checkSendUser" prop="targetKey">
|
||||
<el-row :gutter="24">
|
||||
<!-- <flow-user @handleUserSelect="handleUserSelect"></flow-user>-->
|
||||
<flow-role @handleRoleSelect="handleRoleSelect"></flow-role>
|
||||
<!-- <!–部门数据–>-->
|
||||
<!-- <el-col :span="6" :xs="24">-->
|
||||
<!-- <h6>部门列表</h6>-->
|
||||
<!-- <div class="head-container">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="deptName"-->
|
||||
<!-- placeholder="请输入部门名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- prefix-icon="el-icon-search"-->
|
||||
<!-- style="margin-bottom: 20px"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="head-container">-->
|
||||
<!-- <el-tree-->
|
||||
<!-- :data="deptOptions"-->
|
||||
<!-- :props="defaultProps"-->
|
||||
<!-- :expand-on-click-node="false"-->
|
||||
<!-- :filter-node-method="filterNode"-->
|
||||
<!-- ref="tree"-->
|
||||
<!-- default-expand-all-->
|
||||
<!-- @node-click="handleNodeClick"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="10" :xs="24">-->
|
||||
<!-- <h6>待选人员</h6>-->
|
||||
<!-- <el-table-->
|
||||
<!-- ref="singleTable"-->
|
||||
<!-- :data="userList"-->
|
||||
<!-- border-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- @selection-change="handleSelectionChange">-->
|
||||
<!-- <el-table-column type="selection" width="50" align="center" />-->
|
||||
<!-- <el-table-column label="用户名" align="center" prop="nickName" />-->
|
||||
<!-- <el-table-column label="部门" align="center" prop="dept.deptName" />-->
|
||||
<!-- </el-table>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8" :xs="24">-->
|
||||
<!-- <h6>已选人员</h6>-->
|
||||
<!-- <el-tag-->
|
||||
<!-- v-for="(user,index) in userData"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- closable-->
|
||||
<!-- @close="handleClose(user)">-->
|
||||
<!-- {{user.nickName}} {{user.dept.deptName}}-->
|
||||
<!-- </el-tag>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
<el-form-item prop="targetKey">
|
||||
<!-- <el-row :gutter="24">-->
|
||||
<flow-user v-if="checkSendUser" :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user>
|
||||
<flow-role v-if="checkSendRole" @handleRoleSelect="handleRoleSelect"></flow-role>
|
||||
<!-- </el-row>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="处理意见" label-width="80px" prop="comment" :rules="[{ required: true, message: '请输入处理意见', trigger: 'blur' }]">
|
||||
<el-input type="textarea" v-model="taskForm.comment" placeholder="请输入处理意见"/>
|
||||
|
|
@ -189,9 +141,7 @@ import Parser from '@/components/parser/Parser'
|
|||
import {definitionStart, getProcessVariables, readXml, getFlowViewer} from "@/api/flowable/definition";
|
||||
import {complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate} from "@/api/flowable/todo";
|
||||
import flow from '@/views/flowable/task/record/flow'
|
||||
import {treeselect} from "@/api/system/dept";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import {listUser} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
|
|
@ -199,7 +149,6 @@ export default {
|
|||
components: {
|
||||
Parser,
|
||||
flow,
|
||||
Treeselect,
|
||||
FlowUser,
|
||||
FlowRole,
|
||||
},
|
||||
|
|
@ -212,7 +161,6 @@ export default {
|
|||
// 部门名称
|
||||
deptName: undefined,
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
defaultProps: {
|
||||
|
|
@ -235,7 +183,6 @@ export default {
|
|||
delegateTaskShow: false, // 是否展示回退表单
|
||||
defaultTaskShow: true, // 默认处理
|
||||
sendUserShow: false, // 审批用户
|
||||
multiple: false,
|
||||
comment:"", // 意见内容
|
||||
procInsId: "", // 流程实例编号
|
||||
instanceId: "", // 流程实例编号
|
||||
|
|
@ -245,7 +192,6 @@ export default {
|
|||
vars: "",
|
||||
targetKey:""
|
||||
},
|
||||
userDataList:[], // 流程候选人
|
||||
assignee: null,
|
||||
formConf: {}, // 默认表单数据
|
||||
variables: [], // 流程变量数据
|
||||
|
|
@ -258,7 +204,9 @@ export default {
|
|||
rejectOpen: false,
|
||||
rejectTitle: null,
|
||||
userData:[],
|
||||
checkSendUser: false // 是否展示选择人员模块
|
||||
checkSendUser: false, // 是否展示人员选择模块
|
||||
checkSendRole: false,// 是否展示角色选择模块
|
||||
checkType: 'single', // 选择类型
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -278,12 +226,6 @@ export default {
|
|||
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
|
||||
},
|
||||
methods: {
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
|
|
@ -328,11 +270,10 @@ export default {
|
|||
return "#b3bdbb";
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
// 用户信息选中数据
|
||||
handleUserSelect(selection) {
|
||||
console.log(selection,"handleUserSelect")
|
||||
if (selection) {
|
||||
this.userData = selection
|
||||
const selectVal = selection.map(item => item.userId);
|
||||
if (selectVal instanceof Array) {
|
||||
this.taskForm.values = {
|
||||
|
|
@ -345,28 +286,22 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
// 角色信息选中数据
|
||||
handleRoleSelect(selection) {
|
||||
console.log(selection,"handleRoleSelect")
|
||||
if (selection) {
|
||||
this.userData = selection
|
||||
const selectVal = selection.map(item => item.userId);
|
||||
if (selectVal instanceof Array) {
|
||||
if (selection instanceof Array) {
|
||||
const selectVal = selection.map(item => item.roleId);
|
||||
this.taskForm.values = {
|
||||
"approval": selectVal.join(',')
|
||||
}
|
||||
} else {
|
||||
this.taskForm.values = {
|
||||
"approval": selectVal
|
||||
"approval": selection
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 关闭标签
|
||||
handleClose(tag) {
|
||||
this.userData.splice(this.userData.indexOf(tag), 1);
|
||||
this.$refs.singleTable.toggleRowSelection(tag, false)
|
||||
},
|
||||
/** 流程变量赋值 */
|
||||
handleCheckChange(val) {
|
||||
if (val instanceof Array) {
|
||||
|
|
@ -413,46 +348,42 @@ export default {
|
|||
getNextFlowNode(params).then(res => {
|
||||
const data = res.data;
|
||||
if (data) {
|
||||
this.checkSendUser = true
|
||||
if (data.type === 'assignee') { // 指定人员
|
||||
this.userDataList = res.data.userList;
|
||||
} else if (data.type === 'candidateUsers') { // 指定人员(多个)
|
||||
this.userDataList = res.data.userList;
|
||||
this.taskForm.multiple = true;
|
||||
this.checkSendUser = true;
|
||||
this.checkType = "single";
|
||||
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
||||
this.checkSendUser = true;
|
||||
this.checkType = "multiple";
|
||||
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
||||
res.data.roleList.forEach(role => {
|
||||
role.userId = role.roleId;
|
||||
role.nickName = role.roleName;
|
||||
})
|
||||
this.userDataList = res.data.roleList;
|
||||
this.taskForm.multiple = false;
|
||||
this.checkSendRole = true;
|
||||
} else if (data.type === 'multiInstance') { // 会签?
|
||||
this.userDataList = res.data.userList;
|
||||
this.taskForm.multiple = true;
|
||||
}else if (data.type === 'fixed') { // 已经固定人员接收下一任务
|
||||
this.checkSendUser = false;
|
||||
this.checkSendUser = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 审批任务选择 */
|
||||
/** 加载审批任务弹框 */
|
||||
handleComplete() {
|
||||
this.completeOpen = true;
|
||||
this.completeTitle = "流程审批";
|
||||
this.getTreeselect();
|
||||
},
|
||||
/** 审批任务 */
|
||||
/** 用户审批任务 */
|
||||
taskComplete() {
|
||||
if (!this.taskForm.values && this.checkSendUser){
|
||||
this.msgError("请选择流程接收人员");
|
||||
this.$modal.msgError("请选择流程接收人员!");
|
||||
return;
|
||||
}
|
||||
if (!this.taskForm.values && this.checkSendRole){
|
||||
this.$modal.msgError("请选择流程接收角色组!");
|
||||
return;
|
||||
}
|
||||
if (!this.taskForm.comment){
|
||||
this.msgError("请输入审批意见");
|
||||
this.$modal.msgError("请输入审批意见!");
|
||||
return;
|
||||
}
|
||||
console.log(this.taskForm,"流程审批提交表单数据")
|
||||
complete(this.taskForm).then(response => {
|
||||
this.msgSuccess(response.msg);
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.goBack();
|
||||
});
|
||||
},
|
||||
|
|
@ -504,7 +435,7 @@ export default {
|
|||
variables.variables = formData;
|
||||
// 启动流程并将表单数据加入流程变量
|
||||
definitionStart(that.taskForm.procDefId, JSON.stringify(variables)).then(res => {
|
||||
that.msgSuccess(res.msg);
|
||||
that.$modal.msgSuccess(res.msg);
|
||||
that.goBack();
|
||||
})
|
||||
}
|
||||
|
|
@ -520,7 +451,7 @@ export default {
|
|||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
rejectTask(this.taskForm).then(res => {
|
||||
this.msgSuccess(res.msg);
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
|
@ -540,7 +471,7 @@ export default {
|
|||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
returnTask(this.taskForm).then(res => {
|
||||
this.msgSuccess(res.msg);
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.goBack()
|
||||
});
|
||||
}
|
||||
|
|
@ -558,7 +489,7 @@ export default {
|
|||
this.$refs["taskForm"].validate(valid => {
|
||||
if (valid) {
|
||||
delegate(this.taskForm).then(response => {
|
||||
this.msgSuccess(response.msg);
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue