Browse Source

1、前端自动登录;

2、手动端展示;
3、用户关联工单;
dev
mh 5 months ago
parent
commit
8312183a80
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java
  2. 5
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/domain/ProcessQuery.java
  3. 47
      ruoyi-system/src/main/java/com/ruoyi/workflow/domain/UserDeployRelation.java
  4. 55
      ruoyi-system/src/main/java/com/ruoyi/workflow/domain/bo/UserDeployRelationBo.java
  5. 55
      ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/UserDeployRelationVo.java
  6. 15
      ruoyi-system/src/main/java/com/ruoyi/workflow/mapper/UserDeployRelationMapper.java
  7. 48
      ruoyi-system/src/main/java/com/ruoyi/workflow/service/IUserDeployRelationService.java
  8. 3
      ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java
  9. 110
      ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/UserDeployRelationServiceImpl.java
  10. 40
      ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java
  11. 2
      ruoyi-ui/.env.development
  12. 4
      ruoyi-ui/.env.production
  13. 2
      ruoyi-ui/package.json
  14. BIN
      ruoyi-ui/public/favicon.ico
  15. 4
      ruoyi-ui/src/api/workflow/process.js
  16. BIN
      ruoyi-ui/src/assets/logo/logo.png
  17. 2
      ruoyi-ui/src/layout/components/Sidebar/Logo.vue
  18. 35
      ruoyi-ui/src/router/index.js
  19. 18
      ruoyi-ui/src/views/login.vue
  20. 2
      ruoyi-ui/src/views/register.vue
  21. 120
      ruoyi-ui/src/views/workflow/work/detail.vue
  22. 656
      ruoyi-ui/src/views/workflow/work/detail_cellphone.vue
  23. 64
      ruoyi-ui/src/views/workflow/work/index.vue
  24. 126
      ruoyi-ui/src/views/workflow/work/own.vue
  25. 231
      ruoyi-ui/src/views/workflow/work/own_cellphone.vue
  26. 91
      ruoyi-ui/src/views/workflow/work/start_cellphone.vue
  27. 8
      ruoyi-ui/vue.config.js

8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java

@ -199,9 +199,11 @@ public class WfProcessController extends BaseController {
* @param variables 变量集合,json对象
*/
@SaCheckPermission("workflow:process:start")
@PostMapping("/start/{processDefId}")
public R<Void> start(@PathVariable(value = "processDefId") String processDefId, @RequestBody Map<String, Object> variables) {
processService.startProcessByDefId(processDefId, variables);
@PostMapping("/start/{processDefId}/{cellphone}")
public R<Void> start(@PathVariable(value = "processDefId") String processDefId,
@PathVariable(value = "cellphone") String cellphone,
@RequestBody Map<String, Object> variables) {
processService.startProcessByDefId(processDefId, cellphone, variables);
return R.ok("流程启动成功");
}

5
ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/domain/ProcessQuery.java

@ -34,6 +34,11 @@ public class ProcessQuery {
*/
private String state;
/**
* 手机号码
*/
private String cellphone;
/**
* 请求参数
*/

47
ruoyi-system/src/main/java/com/ruoyi/workflow/domain/UserDeployRelation.java

@ -0,0 +1,47 @@
package com.ruoyi.workflow.domain;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 用户流程关联对象 user_deploy_relation
*
* @author ruoyi
* @date 2024-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("user_deploy_relation")
public class UserDeployRelation extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* id
*/
private String id;
/**
* 手机号码
*/
private String cellphone;
/**
* 流程id
*/
private String deployId;
/**
* 流程编号
*/
private String procInsId;
/**
* 备注
*/
private String remark;
}

55
ruoyi-system/src/main/java/com/ruoyi/workflow/domain/bo/UserDeployRelationBo.java

@ -0,0 +1,55 @@
package com.ruoyi.workflow.domain.bo;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 用户流程关联业务对象 user_deploy_relation
*
* @author ruoyi
* @date 2024-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class UserDeployRelationBo extends BaseEntity {
/**
* id
*/
@NotBlank(message = "id不能为空", groups = { AddGroup.class, EditGroup.class })
private String id;
/**
* 手机号码
*/
@NotBlank(message = "手机号码不能为空", groups = { AddGroup.class, EditGroup.class })
private String cellphone;
/**
* 流程id
*/
@NotBlank(message = "流程id不能为空", groups = { AddGroup.class, EditGroup.class })
private String deployId;
/**
* 流程编号
*/
@NotBlank(message = "流程编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String procInsId;
/**
* 备注
*/
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
private String remark;
}

55
ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/UserDeployRelationVo.java

@ -0,0 +1,55 @@
package com.ruoyi.workflow.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.Date;
/**
* 用户流程关联视图对象 user_deploy_relation
*
* @author ruoyi
* @date 2024-04-25
*/
@Data
@ExcelIgnoreUnannotated
public class UserDeployRelationVo {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ExcelProperty(value = "id")
private String id;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号码")
private String cellphone;
/**
* 流程id
*/
@ExcelProperty(value = "流程id")
private String deployId;
/**
* 流程编号
*/
@ExcelProperty(value = "流程编号")
private String procInsId;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

15
ruoyi-system/src/main/java/com/ruoyi/workflow/mapper/UserDeployRelationMapper.java

@ -0,0 +1,15 @@
package com.ruoyi.workflow.mapper;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.workflow.domain.UserDeployRelation;
import com.ruoyi.workflow.domain.vo.UserDeployRelationVo;
/**
* 用户流程关联Mapper接口
*
* @author ruoyi
* @date 2024-04-25
*/
public interface UserDeployRelationMapper extends BaseMapperPlus<UserDeployRelationMapper, UserDeployRelation, UserDeployRelationVo> {
}

48
ruoyi-system/src/main/java/com/ruoyi/workflow/service/IUserDeployRelationService.java

@ -0,0 +1,48 @@
package com.ruoyi.workflow.service;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.workflow.domain.bo.UserDeployRelationBo;
import com.ruoyi.workflow.domain.vo.UserDeployRelationVo;
import java.util.Collection;
import java.util.List;
/**
* 用户流程关联Service接口
*
* @author ruoyi
* @date 2024-04-25
*/
public interface IUserDeployRelationService {
/**
* 查询用户流程关联
*/
UserDeployRelationVo queryById(String id);
/**
* 查询用户流程关联列表
*/
TableDataInfo<UserDeployRelationVo> queryPageList(UserDeployRelationBo bo, PageQuery pageQuery);
/**
* 查询用户流程关联列表
*/
List<UserDeployRelationVo> queryList(UserDeployRelationBo bo);
/**
* 新增用户流程关联
*/
Boolean insertByBo(UserDeployRelationBo bo);
/**
* 修改用户流程关联
*/
Boolean updateByBo(UserDeployRelationBo bo);
/**
* 校验并批量删除用户流程关联信息
*/
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
}

3
ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java

@ -83,9 +83,10 @@ public interface IWfProcessService {
/**
* 启动流程实例
* @param procDefId 流程定义ID
* @param cellphone 发起流程手机号码
* @param variables 扩展参数
*/
void startProcessByDefId(String procDefId, Map<String, Object> variables);
void startProcessByDefId(String procDefId, String cellphone, Map<String, Object> variables);
/**
* 通过DefinitionKey启动流程

110
ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/UserDeployRelationServiceImpl.java

@ -0,0 +1,110 @@
package com.ruoyi.workflow.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.workflow.domain.UserDeployRelation;
import com.ruoyi.workflow.domain.bo.UserDeployRelationBo;
import com.ruoyi.workflow.domain.vo.UserDeployRelationVo;
import com.ruoyi.workflow.mapper.UserDeployRelationMapper;
import com.ruoyi.workflow.service.IUserDeployRelationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 用户流程关联Service业务层处理
*
* @author ruoyi
* @date 2024-04-25
*/
@RequiredArgsConstructor
@Service
public class UserDeployRelationServiceImpl implements IUserDeployRelationService {
private final UserDeployRelationMapper baseMapper;
/**
* 查询用户流程关联
*/
@Override
public UserDeployRelationVo queryById(String id){
return baseMapper.selectVoById(id);
}
/**
* 查询用户流程关联列表
*/
@Override
public TableDataInfo<UserDeployRelationVo> queryPageList(UserDeployRelationBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<UserDeployRelation> lqw = buildQueryWrapper(bo);
Page<UserDeployRelationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询用户流程关联列表
*/
@Override
public List<UserDeployRelationVo> queryList(UserDeployRelationBo bo) {
LambdaQueryWrapper<UserDeployRelation> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<UserDeployRelation> buildQueryWrapper(UserDeployRelationBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<UserDeployRelation> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getCellphone()), UserDeployRelation::getCellphone, bo.getCellphone());
lqw.eq(StringUtils.isNotBlank(bo.getDeployId()), UserDeployRelation::getDeployId, bo.getDeployId());
return lqw;
}
/**
* 新增用户流程关联
*/
@Override
public Boolean insertByBo(UserDeployRelationBo bo) {
UserDeployRelation add = BeanUtil.toBean(bo, UserDeployRelation.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
}
return flag;
}
/**
* 修改用户流程关联
*/
@Override
public Boolean updateByBo(UserDeployRelationBo bo) {
UserDeployRelation update = BeanUtil.toBean(bo, UserDeployRelation.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(UserDeployRelation entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除用户流程关联
*/
@Override
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

40
ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java

@ -32,8 +32,10 @@ import com.ruoyi.flowable.utils.TaskUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.workflow.domain.WfDeployForm;
import com.ruoyi.workflow.domain.bo.UserDeployRelationBo;
import com.ruoyi.workflow.domain.vo.*;
import com.ruoyi.workflow.mapper.WfDeployFormMapper;
import com.ruoyi.workflow.service.IUserDeployRelationService;
import com.ruoyi.workflow.service.IWfProcessService;
import com.ruoyi.workflow.service.IWfTaskService;
import lombok.RequiredArgsConstructor;
@ -75,6 +77,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
private final ISysRoleService roleService;
private final ISysDeptService deptService;
private final WfDeployFormMapper deployFormMapper;
private final IUserDeployRelationService userDeployRelationService;
/**
* 流程定义列表
@ -163,9 +166,25 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
// 构建搜索条件
ProcessUtils.buildProcessSearch(historicProcessInstanceQuery, processQuery);
int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1);
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery
.listPage(offset, pageQuery.getPageSize());
page.setTotal(historicProcessInstanceQuery.count());
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.list();
if (!StringUtils.isEmpty(processQuery.getCellphone())) {
UserDeployRelationBo userDeployRelationBo = new UserDeployRelationBo();
userDeployRelationBo.setCellphone(processQuery.getCellphone());
List<UserDeployRelationVo> userDeployRelationVos = userDeployRelationService.queryList(userDeployRelationBo);
historicProcessInstances = historicProcessInstances.stream()
.filter(taskVo -> userDeployRelationVos.stream()
.anyMatch(userDeployRelationVo ->
(taskVo.getDeploymentId().equals(userDeployRelationVo.getDeployId()))
&& taskVo.getId().equals(userDeployRelationVo.getProcInsId())))
.collect(Collectors.toList());
}
int pageTotal = historicProcessInstances.size();
if (pageTotal == 0) {
return TableDataInfo.build();
}
historicProcessInstances = historicProcessInstances.subList(offset, pageTotal<pageQuery.getPageSize()?pageTotal:pageQuery.getPageSize());
page.setTotal(historicProcessInstances.size());
List<WfTaskVo> taskVoList = new ArrayList<>();
for (HistoricProcessInstance hisIns : historicProcessInstances) {
WfTaskVo taskVo = new WfTaskVo();
@ -582,11 +601,11 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void startProcessByDefId(String procDefId, Map<String, Object> variables) {
public void startProcessByDefId(String procDefId, String cellphone, Map<String, Object> variables) {
try {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(procDefId).singleResult();
startProcess(processDefinition, variables);
startProcess(processDefinition, variables, cellphone);
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("流程启动错误");
@ -604,7 +623,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
try {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionKey(procDefKey).latestVersion().singleResult();
startProcess(processDefinition, variables);
startProcess(processDefinition, variables, "");
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("流程启动错误");
@ -680,7 +699,7 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
/**
* 启动流程实例
*/
private void startProcess(ProcessDefinition procDef, Map<String, Object> variables) {
private void startProcess(ProcessDefinition procDef, Map<String, Object> variables, String cellphone) {
if (ObjectUtil.isNotNull(procDef) && procDef.isSuspended()) {
throw new ServiceException("流程已被挂起,请先激活流程");
}
@ -694,6 +713,13 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDef.getId(), variables);
// 第一个用户任务为发起人,则自动完成任务
wfTaskService.startFirstTask(processInstance, variables);
// 流程编号跟手机绑定
String deploymentId = procDef.getDeploymentId();
UserDeployRelationBo userDeployRelationBo = new UserDeployRelationBo();
userDeployRelationBo.setDeployId(deploymentId);
userDeployRelationBo.setProcInsId(processInstance.getProcessInstanceId());
userDeployRelationBo.setCellphone(cellphone);
userDeployRelationService.insertByBo(userDeployRelationBo);
}

2
ruoyi-ui/.env.development

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 铭慧通-工单后台管理系统
VUE_APP_TITLE = 广州城市学院报修管理系统
# 开发环境配置
ENV = 'development'

4
ruoyi-ui/.env.production

@ -1,11 +1,11 @@
# 页面标题
VUE_APP_TITLE = 铭慧通-工单后台管理系统
VUE_APP_TITLE = 广州城市学院报修管理系统
# 生产环境配置
ENV = 'production'
# 若依管理系统/生产环境
VUE_APP_BASE_API = 'http://bx.mhito.net:8090'
VUE_APP_BASE_API = 'https://bxserver.mhito.net:8090'
# 应用访问路径 例如使用前缀 /admin/
VUE_APP_CONTEXT_PATH = '/'

2
ruoyi-ui/package.json

@ -1,7 +1,7 @@
{
"name": "flowable-plus",
"version": "0.8.3",
"description": "铭慧通-工单后台管理系统",
"description": "广州城市学院报修管理系统",
"author": "mh",
"license": "MIT",
"scripts": {

BIN
ruoyi-ui/public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 29 KiB

4
ruoyi-ui/src/api/workflow/process.js

@ -19,9 +19,9 @@ export function getProcessForm(query) {
}
// 部署流程实例
export function startProcess(processDefId, data) {
export function startProcess(processDefId, cellphone, data) {
return request({
url: '/workflow/process/start/' + processDefId,
url: '/workflow/process/start/' + processDefId + '/' + cellphone,
method: 'post',
data: data
})

BIN
ruoyi-ui/src/assets/logo/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 29 KiB

2
ruoyi-ui/src/layout/components/Sidebar/Logo.vue

@ -40,7 +40,7 @@ export default {
},
data() {
return {
title: '铭慧通-工单系统',
title: '广州城市学院报修管理系统',
logo: logoImg
}
}

35
ruoyi-ui/src/router/index.js

@ -30,6 +30,24 @@ import Layout from '@/layout'
// 公共路由
export const constantRoutes = [
// 手机端发起报修
{
path: '/bx/start/:deployId([\\w|\\-]+)',
component: () => import('@/views/workflow/work/start_cellphone'),
hidden: true
},
// 手机端查询报修列表
{
path: '/bx/list',
component: () => import('@/views/workflow/work/own_cellphone'),
hidden: true
},
// 手机端查询报修详情
{
path: '/bx/detail/:procInsId([\\w|\\-]+)',
component: () => import('@/views/workflow/work/detail_cellphone'),
hidden: true
},
{
path: '/redirect',
component: Layout,
@ -195,6 +213,23 @@ export const dynamicRoutes = [
}
]
},
{
path: '/workflow/process/bx',
children: [
{
path: 'start/:deployId([\\w|\\-]+)',
component: () => import('@/views/workflow/work/start_cellphone'),
},
{
path: 'list',
component: () => import('@/views/workflow/work/own_cellphone'),
},
{
path: 'detail/:procInsId([\\w|\\-]+)',
component: () => import('@/views/workflow/work/detail_cellphone'),
}
]
},
]
// 防止连续点击多次路由报错

18
ruoyi-ui/src/views/login.vue

@ -1,7 +1,7 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">铭慧通-工单后台管理系统</h3>
<h3 class="title">广州城市学院报修管理系统</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@ -13,7 +13,7 @@
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item prop="code" v-if="captchaEnabled" hidden>
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%"
@keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
@ -24,7 +24,7 @@
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" v-trigger
@click.native.prevent="handleLogin">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
@ -65,7 +65,7 @@ export default {
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
// code: [{ required: true, trigger: "change", message: "" }]
},
loading: false,
//
@ -87,7 +87,17 @@ export default {
this.getCode();
this.getCookie();
},
directives: {
trigger: {
inserted(el, binging) {
el.click()
}
}
},
methods: {
autoClick() {
this.$refs.loginBtn.click()
},
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled;

2
ruoyi-ui/src/views/register.vue

@ -1,7 +1,7 @@
<template>
<div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">RuoYi-Vue-Plus后台管理系统</h3>
<h3 class="title">广州城市学院报修管理系统 </h3>
<el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

120
ruoyi-ui/src/views/workflow/work/detail.vue

@ -8,8 +8,7 @@
<span>填写表单</span>
</div>
<div class="cu-content">
<v-form-render :form-json="taskFormData.formModel" :form-data="{}"
ref="taskFormParser"></v-form-render>
<v-form-render :form-json="taskFormData.formModel" :form-data="{}" ref="taskFormParser"></v-form-render>
</div>
</el-card>
<el-card class="box-card" shadow="hover">
@ -23,31 +22,25 @@
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见" />
</el-form-item>
<el-form-item label="抄送人" prop="copyUserIds">
<el-tag
:key="index"
v-for="(item, index) in copyUser"
closable
:disable-transitions="false"
<el-tag :key="index" v-for="(item, index) in copyUser" closable :disable-transitions="false"
@close="handleClose('copy', item)">
{{ item.nickName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectCopyUsers" />
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
@click="onSelectCopyUsers" />
</el-form-item>
<el-form-item label="指定审批人" prop="copyUserIds">
<el-tag
:key="index"
v-for="(item, index) in nextUser"
closable
:disable-transitions="false"
<el-tag :key="index" v-for="(item, index) in nextUser" closable :disable-transitions="false"
@close="handleClose('next', item)">
{{ item.nickName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle @click="onSelectNextUsers" />
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
@click="onSelectNextUsers" />
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row :gutter="10" type="flex" justify="center" >
<el-row :gutter="10" type="flex" justify="center">
<el-col :span="1.5">
<el-button icon="el-icon-circle-check" type="success" @click="handleComplete">通过</el-button>
</el-col>
@ -80,30 +73,40 @@
</div>
</el-card>
</div>
</el-tab-pane >
</el-tab-pane>
<el-tab-pane label="流转记录" name="record">
<el-card class="box-card" shadow="never">
<el-col :span="20" :offset="2">
<div class="block">
<el-timeline>
<el-timeline-item v-for="(item,index) in historyProcNodeList" :key="index" :icon="setIcon(item.endTime)" :color="setColor(item.endTime)">
<el-timeline-item v-for="(item, index) in historyProcNodeList" :key="index" :icon="setIcon(item.endTime)"
:color="setColor(item.endTime)">
<p style="font-weight: 700">{{ item.activityName }}</p>
<el-card v-if="item.activityType === 'startEvent'" class="box-card" shadow="hover">
{{ item.assigneeName }} {{ item.createTime }} 发起流程
</el-card>
<el-card v-if="item.activityType === 'userTask'" class="box-card" shadow="hover">
<el-descriptions :column="5" :labelStyle="{'font-weight': 'bold'}">
<el-descriptions-item label="实际办理">{{ item.assigneeName || '-'}}</el-descriptions-item>
<el-descriptions-item label="候选办理">{{ item.candidate || '-'}}</el-descriptions-item>
<el-descriptions-item label="接收时间">{{ item.createTime || '-'}}</el-descriptions-item>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="实际办理">{{ item.assigneeName || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="候选办理">{{ item.candidate || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="接收时间">{{ item.createTime || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="办结时间">{{ item.endTime || '-' }}</el-descriptions-item>
<el-descriptions-item label="耗时">{{ item.duration || '-'}}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="耗时">{{ item.duration || '-' }}</el-descriptions-item>
</el-descriptions>
<div v-if="item.commentList && item.commentList.length > 0">
<div v-for="(comment, index) in item.commentList" :key="index">
<el-divider content-position="left">
<el-tag :type="approveTypeTag(comment.type)" size="mini">{{ commentType(comment.type) }}</el-tag>
<el-tag :type="approveTypeTag(comment.type)" size="mini">{{ commentType(comment.type)
}}</el-tag>
<el-tag type="info" effect="plain" size="mini">{{ comment.time }}</el-tag>
</el-divider>
<span>{{ comment.fullMessage }}</span>
@ -123,22 +126,18 @@
<el-tab-pane label="流程跟踪" name="track">
<el-card class="box-card" shadow="never">
<process-viewer :key="`designer-${loadIndex}`" :style="'height:' + height" :xml="xmlData"
:finishedInfo="finishedInfo" :allCommentList="historyProcNodeList"
/>
:finishedInfo="finishedInfo" :allCommentList="historyProcNodeList" />
</el-card>
</el-tab-pane>
</el-tabs>
<!--退回流程-->
<el-dialog :title="returnTitle" :visible.sync="returnOpen" 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="targetKey">
<el-radio-group v-model="taskForm.targetKey">
<el-radio-button
v-for="item in returnTaskList"
:key="item.id"
:label="item.id"
>{{item.name}}</el-radio-button>
<el-radio-button v-for="item in returnTaskList" :key="item.id"
:label="item.id">{{ item.name }}</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
@ -157,44 +156,27 @@
<span>部门列表</span>
</div>
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search"/>
<el-tree
:data="deptOptions"
:props="deptProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" />
<el-tree :data="deptOptions" :props="deptProps" :expand-on-click-node="false"
:filter-node-method="filterNode" ref="tree" default-expand-all @node-click="handleNodeClick" />
</div>
</el-card>
</el-col>
<el-col :span="18">
<el-table ref="userTable"
:key="userData.type"
height="500"
v-loading="userLoading"
:data="userList"
highlight-current-row
@current-change="changeCurrentUser"
@selection-change="handleSelectionChange">
<el-table ref="userTable" :key="userData.type" height="500" v-loading="userLoading" :data="userList"
highlight-current-row @current-change="changeCurrentUser" @selection-change="handleSelectionChange">
<el-table-column v-if="userData.type === 'copy' || userData.type === 'next'" width="55" type="selection" />
<el-table-column v-else width="30">
<template slot-scope="scope">
<el-radio :label="scope.row.userId" v-model="currentUserId">{{''}}</el-radio>
<el-radio :label="scope.row.userId" v-model="currentUserId">{{ '' }}</el-radio>
</template>
</el-table-column>
<el-table-column label="用户名" align="center" prop="nickName" />
<el-table-column label="手机" align="center" prop="phonenumber" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
@ -281,13 +263,13 @@ export default {
total: 0,
//
loading: true,
taskForm:{
comment:"", //
taskForm: {
comment: "", //
procInsId: "", //
taskId: "" ,//
taskId: "",//
copyUserIds: "", // Id
vars: "",
targetKey:""
targetKey: ""
},
rules: {
comment: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
@ -374,7 +356,7 @@ export default {
},
toggleSelection(selection) {
if (selection && selection.length > 0) {
this.$nextTick(()=> {
this.$nextTick(() => {
selection.forEach(item => {
let row = this.userList.find(k => k.userId === item.userId);
this.$refs.userTable.toggleRowSelection(row);
@ -423,7 +405,7 @@ export default {
}
},
getProcessDetails(procInsId, taskId) {
const params = {procInsId: procInsId, taskId: taskId}
const params = { procInsId: procInsId, taskId: taskId }
detailProcess(params).then(res => {
const data = res.data;
this.xmlData = data.bpmnXml;
@ -477,7 +459,7 @@ export default {
});
Promise.all([taskFormPromise, approvalPromise]).then(async () => {
if (isExistTaskForm) {
this.taskForm.variables =await taskFormRef.getFormData(false)
this.taskForm.variables = await taskFormRef.getFormData(false)
}
complete(this.taskForm).then(response => {
this.$modal.msgSuccess(response.msg);
@ -497,7 +479,7 @@ export default {
})
},
/** 转办任务 */
handleTransfer(){
handleTransfer() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
this.userData.type = 'transfer';
@ -512,7 +494,7 @@ export default {
this.$refs["taskForm"].validate(valid => {
if (valid) {
const _this = this;
this.$modal.confirm('拒绝审批单流程会终止,是否继续?').then(function() {
this.$modal.confirm('拒绝审批单流程会终止,是否继续?').then(function () {
return rejectTask(_this.taskForm);
}).then(res => {
this.$modal.msgSuccess(res.msg);
@ -632,6 +614,7 @@ export default {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
@ -641,16 +624,18 @@ export default {
margin-bottom: 20px;
}
.el-tag + .el-tag {
.el-tag+.el-tag {
margin-left: 10px;
}
.el-row {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
.el-col {
border-radius: 4px;
}
@ -663,7 +648,8 @@ export default {
margin-top: 15px;
text-align: center;
}
.cu-content{
.cu-content {
width: 80%;
margin: 15px auto;
}

656
ruoyi-ui/src/views/workflow/work/detail_cellphone.vue

@ -0,0 +1,656 @@
<template>
<div class="app-container">
<el-tabs tab-position="top" :value="processed === true ? 'approval' : 'form'">
<el-tab-pane label="任务办理" name="approval" v-if="processed === true">
<el-card class="box-card" shadow="hover" v-if="taskFormOpen">
<div slot="header" class="clearfix">
<span>填写表单</span>
</div>
<div class="cu-content">
<v-form-render :form-json="taskFormData.formModel" :form-data="{}" ref="taskFormParser"></v-form-render>
</div>
</el-card>
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<span>审批流程</span>
</div>
<el-row>
<el-col :span="20" :offset="2">
<el-form ref="taskForm" :model="taskForm" :rules="rules" label-width="120px">
<el-form-item label="审批意见" prop="comment">
<el-input type="textarea" :rows="5" v-model="taskForm.comment" placeholder="请输入 审批意见" />
</el-form-item>
<el-form-item label="抄送人" prop="copyUserIds">
<el-tag :key="index" v-for="(item, index) in copyUser" closable :disable-transitions="false"
@close="handleClose('copy', item)">
{{ item.nickName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
@click="onSelectCopyUsers" />
</el-form-item>
<el-form-item label="指定审批人" prop="copyUserIds">
<el-tag :key="index" v-for="(item, index) in nextUser" closable :disable-transitions="false"
@close="handleClose('next', item)">
{{ item.nickName }}
</el-tag>
<el-button class="button-new-tag" type="primary" icon="el-icon-plus" size="mini" circle
@click="onSelectNextUsers" />
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row :gutter="10" type="flex" justify="center">
<el-col :span="1.5">
<el-button icon="el-icon-circle-check" type="success" @click="handleComplete">通过</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-chat-line-square" type="primary" @click="handleDelegate">委派</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-thumb" type="success" @click="handleTransfer">转办</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-refresh-left" type="warning" @click="handleReturn">退回</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-circle-close" type="danger" @click="handleReject">拒绝</el-button>
</el-col>
</el-row>
</el-card>
</el-tab-pane>
<el-tab-pane label="表单信息" name="form">
<div v-if="formOpen">
<el-card class="box-card" shadow="never" v-for="(formInfo, index) in processFormList" :key="index">
<div slot="header" class="clearfix">
<span>{{ formInfo.title }}</span>
</div>
<!--流程处理表单模块-->
<div class="cu-content">
<v-form-render :form-json="formInfo.formModel" :form-data="formInfo.formData"
ref="vFormRef"></v-form-render>
</div>
</el-card>
</div>
</el-tab-pane>
<el-tab-pane label="流转记录" name="record">
<el-card class="box-card" shadow="never">
<el-col :span="20" :offset="2">
<div class="block">
<el-timeline>
<el-timeline-item v-for="(item, index) in historyProcNodeList" :key="index" :icon="setIcon(item.endTime)"
:color="setColor(item.endTime)">
<p style="font-weight: 700">{{ item.activityName }}</p>
<el-card v-if="item.activityType === 'startEvent'" class="box-card" shadow="hover">
{{ item.assigneeName }} {{ item.createTime }} 发起流程
</el-card>
<el-card v-if="item.activityType === 'userTask'" class="box-card" shadow="hover">
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="实际办理">{{ item.assigneeName || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="候选办理">{{ item.candidate || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="接收时间">{{ item.createTime || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="办结时间">{{ item.endTime || '-' }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="1" :labelStyle="{ 'font-weight': 'bold' }">
<el-descriptions-item label="耗时">{{ item.duration || '-' }}</el-descriptions-item>
</el-descriptions>
<div v-if="item.commentList && item.commentList.length > 0">
<div v-for="(comment, index) in item.commentList" :key="index">
<el-divider content-position="left">
<el-tag :type="approveTypeTag(comment.type)" size="mini">{{ commentType(comment.type)
}}</el-tag>
<el-tag type="info" effect="plain" size="mini">{{ comment.time }}</el-tag>
</el-divider>
<span>{{ comment.fullMessage }}</span>
</div>
</div>
</el-card>
<el-card v-if="item.activityType === 'endEvent'" class="box-card" shadow="hover">
{{ item.createTime }} 结束流程
</el-card>
</el-timeline-item>
</el-timeline>
</div>
</el-col>
</el-card>
</el-tab-pane>
<!-- <el-tab-pane label="流程跟踪" name="track">-->
<!-- <el-card class="box-card" shadow="never">-->
<!-- <process-viewer :key="`designer-${loadIndex}`" :style="'height:' + height" :xml="xmlData"-->
<!-- :finishedInfo="finishedInfo" :allCommentList="historyProcNodeList" />-->
<!-- </el-card>-->
<!-- </el-tab-pane>-->
</el-tabs>
<!--退回流程-->
<el-dialog :title="returnTitle" :visible.sync="returnOpen" width="40%" append-to-body>
<el-form ref="taskForm" :model="taskForm" label-width="80px">
<el-form-item label="退回节点" prop="targetKey">
<el-radio-group v-model="taskForm.targetKey">
<el-radio-button v-for="item in returnTaskList" :key="item.id"
:label="item.id">{{ item.name }}</el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="returnOpen = false"> </el-button>
<el-button type="primary" @click="submitReturn"> </el-button>
</span>
</el-dialog>
<el-dialog :title="userData.title" :visible.sync="userData.open" width="60%" append-to-body>
<el-row type="flex" :gutter="20">
<!--部门数据-->
<el-col :span="5">
<el-card shadow="never" style="height: 100%">
<div slot="header">
<span>部门列表</span>
</div>
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" />
<el-tree :data="deptOptions" :props="deptProps" :expand-on-click-node="false"
:filter-node-method="filterNode" ref="tree" default-expand-all @node-click="handleNodeClick" />
</div>
</el-card>
</el-col>
<el-col :span="18">
<el-table ref="userTable" :key="userData.type" height="500" v-loading="userLoading" :data="userList"
highlight-current-row @current-change="changeCurrentUser" @selection-change="handleSelectionChange">
<el-table-column v-if="userData.type === 'copy' || userData.type === 'next'" width="55" type="selection" />
<el-table-column v-else width="30">
<template slot-scope="scope">
<el-radio :label="scope.row.userId" v-model="currentUserId">{{ '' }}</el-radio>
</template>
</el-table-column>
<el-table-column label="用户名" align="center" prop="nickName" />
<el-table-column label="手机" align="center" prop="phonenumber" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
</el-table>
<pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</el-col>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="userData.open = false"> </el-button>
<el-button type="primary" @click="submitUserData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { detailProcess } from '@/api/workflow/process'
import { complete, delegate, transfer, rejectTask, returnList, returnTask } from '@/api/workflow/task'
import { selectUser, deptTreeSelect } from '@/api/system/user'
import ProcessViewer from '@/components/ProcessViewer'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
export default {
name: "WorkDetail",
components: {
ProcessViewer,
Treeselect
},
props: {},
computed: {
commentType() {
return val => {
switch (val) {
case '1': return '通过'
case '2': return '退回'
case '3': return '驳回'
case '4': return '委派'
case '5': return '转办'
case '6': return '终止'
case '7': return '撤回'
}
}
},
approveTypeTag() {
return val => {
switch (val) {
case '1': return 'success'
case '2': return 'warning'
case '3': return 'danger'
case '4': return 'primary'
case '5': return 'success'
case '6': return 'danger'
case '7': return 'info'
}
}
}
},
data() {
return {
height: document.documentElement.clientHeight - 205 + 'px;',
// xml
loadIndex: 0,
xmlData: undefined,
finishedInfo: {
finishedSequenceFlowSet: [],
finishedTaskSet: [],
unfinishedTaskSet: [],
rejectedTaskSet: []
},
historyProcNodeList: [],
//
deptName: undefined,
//
deptOptions: undefined,
userLoading: false,
//
userList: null,
deptProps: {
children: "children",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: undefined
},
total: 0,
//
loading: true,
taskForm: {
comment: "", //
procInsId: "", //
taskId: "",//
copyUserIds: "", // Id
vars: "",
targetKey: ""
},
rules: {
comment: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
},
currentUserId: null,
variables: [], //
taskFormOpen: false,
taskFormData: {}, //
processFormList: [], //
formOpen: false, //
returnTaskList: [], // 退
processed: false,
returnTitle: null,
returnOpen: false,
rejectOpen: false,
rejectTitle: null,
userData: {
title: '',
type: '',
open: false,
},
copyUser: [],
nextUser: [],
userMultipleSelection: [],
userDialogTitle: '',
userOpen: false
};
},
created() {
this.initData();
},
methods: {
initData() {
this.taskForm.procInsId = this.$route.params && this.$route.params.procInsId;
this.taskForm.taskId = this.$route.query && this.$route.query.taskId;
this.processed = this.$route.query && eval(this.$route.query.processed || false);
//
this.getProcessDetails(this.taskForm.procInsId, this.taskForm.taskId);
this.loadIndex = this.taskForm.procInsId;
},
/** 查询部门下拉树结构 */
getTreeSelect() {
deptTreeSelect().then(response => {
this.deptOptions = response.data;
});
},
/** 查询用户列表 */
getList() {
this.userLoading = true;
selectUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.toggleSelection(this.userMultipleSelection);
this.userLoading = false;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
setIcon(val) {
if (val) {
return "el-icon-check";
} else {
return "el-icon-time";
}
},
setColor(val) {
if (val) {
return "#2bc418";
} else {
return "#b3bdbb";
}
},
//
handleSelectionChange(selection) {
this.userMultipleSelection = selection
},
toggleSelection(selection) {
if (selection && selection.length > 0) {
this.$nextTick(() => {
selection.forEach(item => {
let row = this.userList.find(k => k.userId === item.userId);
this.$refs.userTable.toggleRowSelection(row);
})
})
} else {
this.$nextTick(() => {
this.$refs.userTable.clearSelection();
});
}
},
//
handleClose(type, tag) {
let userObj = this.userMultipleSelection.find(item => item.userId === tag.id);
this.userMultipleSelection.splice(this.userMultipleSelection.indexOf(userObj), 1);
if (type === 'copy') {
this.copyUser = this.userMultipleSelection;
// ID
if (this.copyUser && this.copyUser.length > 0) {
const val = this.copyUser.map(item => item.id);
this.taskForm.copyUserIds = val instanceof Array ? val.join(',') : val;
} else {
this.taskForm.copyUserIds = '';
}
} else if (type === 'next') {
this.nextUser = this.userMultipleSelection;
// ID
if (this.nextUser && this.nextUser.length > 0) {
const val = this.nextUser.map(item => item.id);
this.taskForm.nextUserIds = val instanceof Array ? val.join(',') : val;
} else {
this.taskForm.nextUserIds = '';
}
}
},
/** 流程变量赋值 */
handleCheckChange(val) {
if (val instanceof Array) {
this.taskForm.values = {
"approval": val.join(',')
}
} else {
this.taskForm.values = {
"approval": val
}
}
},
getProcessDetails(procInsId, taskId) {
const params = { procInsId: procInsId, taskId: taskId }
detailProcess(params).then(res => {
const data = res.data;
this.xmlData = data.bpmnXml;
this.processFormList = data.processFormList;
this.taskFormOpen = data.existTaskForm;
if (this.taskFormOpen) {
this.taskFormData = data.taskFormData;
}
this.historyProcNodeList = data.historyProcNodeList;
this.finishedInfo = data.flowViewer;
this.formOpen = true
this.$nextTick(() => {
this.processFormList.forEach((item, index) => {
if (item.disabled) {
this.$refs.vFormRef[index].disableForm()
}
})
})
})
},
onSelectCopyUsers() {
this.userMultipleSelection = this.copyUser;
this.onSelectUsers('添加抄送人', 'copy')
},
onSelectNextUsers() {
this.userMultipleSelection = this.nextUser;
this.onSelectUsers('指定审批人', 'next')
},
onSelectUsers(title, type) {
this.userData.title = title;
this.userData.type = type;
this.getTreeSelect();
this.getList()
this.userData.open = true;
},
/** 通过任务 */
handleComplete() {
//
const taskFormRef = this.$refs.taskFormParser;
const isExistTaskForm = taskFormRef !== undefined;
// taskFormPromise true
const taskFormPromise = !isExistTaskForm ? true : new Promise(async (resolve, reject) => {
taskFormRef.validateForm(valid => {
valid ? resolve() : reject()
})
});
const approvalPromise = new Promise((resolve, reject) => {
this.$refs['taskForm'].validate(valid => {
valid ? resolve() : reject()
})
});
Promise.all([taskFormPromise, approvalPromise]).then(async () => {
if (isExistTaskForm) {
this.taskForm.variables = await taskFormRef.getFormData(false)
}
complete(this.taskForm).then(response => {
this.$modal.msgSuccess(response.msg);
this.goBack();
});
})
},
/** 委派任务 */
handleDelegate() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
this.userData.type = 'delegate';
this.userData.title = '委派任务'
this.userData.open = true;
this.getTreeSelect();
}
})
},
/** 转办任务 */
handleTransfer() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
this.userData.type = 'transfer';
this.userData.title = '转办任务';
this.userData.open = true;
this.getTreeSelect();
}
})
},
/** 拒绝任务 */
handleReject() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
const _this = this;
this.$modal.confirm('拒绝审批单流程会终止,是否继续?').then(function () {
return rejectTask(_this.taskForm);
}).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
});
},
changeCurrentUser(val) {
this.currentUserId = val.userId
},
/** 返回页面 */
goBack() {
//
this.$tab.closePage(this.$route)
this.$router.back()
},
/** 接收子组件传的值 */
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;
}
},
submitUserData() {
let type = this.userData.type;
if (type === 'copy' || type === 'next') {
if (!this.userMultipleSelection || this.userMultipleSelection.length <= 0) {
this.$modal.msgError("请选择用户");
return false;
}
let userIds = this.userMultipleSelection.map(k => k.userId);
if (type === 'copy') {
// ID
this.copyUser = this.userMultipleSelection;
this.taskForm.copyUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
} else if (type === 'next') {
// ID
this.nextUser = this.userMultipleSelection;
this.taskForm.nextUserIds = userIds instanceof Array ? userIds.join(',') : userIds;
}
this.userData.open = false;
} else {
if (!this.taskForm.comment) {
this.$modal.msgError("请输入审批意见");
return false;
}
if (!this.currentUserId) {
this.$modal.msgError("请选择用户");
return false;
}
this.taskForm.userId = this.currentUserId;
if (type === 'delegate') {
delegate(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
if (type === 'transfer') {
transfer(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
});
}
}
},
/** 可退回任务列表 */
handleReturn() {
this.$refs['taskForm'].validate(valid => {
if (valid) {
this.returnTitle = "退回流程";
returnList(this.taskForm).then(res => {
this.returnTaskList = res.data;
this.taskForm.values = null;
this.returnOpen = true;
})
}
});
},
/** 提交退回任务 */
submitReturn() {
this.$refs["taskForm"].validate(valid => {
if (valid) {
if (!this.taskForm.targetKey) {
this.$modal.msgError("请选择退回节点!");
}
returnTask(this.taskForm).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack()
});
}
});
}
}
};
</script>
<style lang="scss" scoped>
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 100%;
margin-bottom: 20px;
}
.el-tag+.el-tag {
margin-left: 10px;
}
.el-row {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
.el-col {
border-radius: 4px;
}
.button-new-tag {
margin-left: 10px;
}
.cu-submit {
margin-top: 15px;
text-align: center;
}
.cu-content {
width: 80%;
margin: 15px auto;
}
</style>

64
ruoyi-ui/src/views/workflow/work/index.vue

@ -2,29 +2,16 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="流程标识" prop="processKey">
<el-input
v-model="queryParams.processKey"
placeholder="请输入流程标识"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.processKey" placeholder="请输入流程标识" clearable size="small"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="流程名称" prop="processName">
<el-input
v-model="queryParams.processName"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.processName" placeholder="请输入流程名称" clearable size="small"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="流程分类" prop="category">
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
<el-option
v-for="item in categoryOptions"
:key="item.categoryId"
:label="item.categoryName"
<el-option v-for="item in categoryOptions" :key="item.categoryId" :label="item.categoryName"
:value="item.code">
</el-option>
</el-select>
@ -36,14 +23,8 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
v-hasPermi="['workflow:process:startExport']"
@click="handleExport"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini"
v-hasPermi="['workflow:process:startExport']" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -60,7 +41,7 @@
<el-table-column label="流程分类" align="center" prop="categoryName" :formatter="categoryFormat" />
<el-table-column label="流程版本" align="center">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.version }}</el-tag>
<el-tag size="medium">v{{ scope.row.version }}</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
@ -69,30 +50,20 @@
<el-tag type="warning" v-if="scope.row.suspended">挂起</el-tag>
</template>
</el-table-column>
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="180"/>
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
icon="el-icon-video-play"
@click="handleStart(scope.row)"
v-hasPermi="['workflow:process:start']"
>发起</el-button>
<el-button type="text" size="mini" icon="el-icon-video-play" @click="handleStart(scope.row)"
v-hasPermi="['workflow:process:start']">发起</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 流程图 -->
<el-dialog :title="processView.title" :visible.sync="processView.open" width="70%" append-to-body>
<process-viewer :key="`designer-${processView.index}`" :xml="processView.xmlData" :style="{height: '400px'}" />
<process-viewer :key="`designer-${processView.index}`" :xml="processView.xmlData" :style="{ height: '400px' }" />
</el-dialog>
</div>
</template>
@ -135,7 +106,7 @@ export default {
title: '',
open: false,
index: undefined,
xmlData:"",
xmlData: "",
}
}
},
@ -179,6 +150,7 @@ export default {
this.processView.open = true;
},
handleStart(row) {
debugger
this.$router.push({
path: '/workflow/process/start/' + row.deploymentId,
query: {
@ -199,6 +171,4 @@ export default {
}
</script>
<style scoped>
</style>
<style scoped></style>

126
ruoyi-ui/src/views/workflow/work/own.vue

@ -2,44 +2,24 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="流程标识" prop="processKey">
<el-input
v-model="queryParams.processKey"
placeholder="请输入流程标识"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.processKey" placeholder="请输入流程标识" clearable size="small"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="流程名称" prop="processName">
<el-input
v-model="queryParams.processName"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.processName" placeholder="请输入流程名称" clearable size="small"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="流程分类" prop="category">
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
<el-option
v-for="item in categoryOptions"
:key="item.categoryId"
:label="item.categoryName"
<el-option v-for="item in categoryOptions" :key="item.categoryId" :label="item.categoryName"
:value="item.code">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="提交时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -49,88 +29,50 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
@click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
v-hasPermi="['workflow:process:ownExport']"
@click="handleExport"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" v-hasPermi="['workflow:process:ownExport']"
@click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column 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="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" :formatter="categoryFormat" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
<el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
</template>
</el-table-column>
<el-table-column label="当前节点" align="center" prop="taskName"/>
<el-table-column label="提交时间" align="center" prop="createTime" width="180"/>
<el-table-column label="当前节点" align="center" prop="taskName" />
<el-table-column label="提交时间" align="center" prop="createTime" width="180" />
<el-table-column label="流程状态" align="center" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus" />
</template>
</el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
<el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
icon="el-icon-tickets"
@click="handleFlowRecord(scope.row)"
v-hasPermi="['workflow:process:query']"
>详情</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-if="scope.row.finishTime"
v-hasPermi="['workflow:process:remove']"
>删除</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-circle-close"
@click="handleStop(scope.row)"
v-hasPermi="['workflow:process:cancel']"
>取消</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-refresh-right"
v-hasPermi="['workflow:process:start']"
@click="handleAgain(scope.row)"
>重新发起</el-button>
<el-button type="text" size="mini" icon="el-icon-tickets" @click="handleFlowRecord(scope.row)"
v-hasPermi="['workflow:process:query']">详情</el-button>
<el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-if="scope.row.finishTime" v-hasPermi="['workflow:process:remove']">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-circle-close" @click="handleStop(scope.row)"
v-hasPermi="['workflow:process:cancel']">取消</el-button>
<el-button type="text" size="mini" icon="el-icon-refresh-right" v-hasPermi="['workflow:process:start']"
@click="handleAgain(scope.row)">重新发起</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
@ -159,7 +101,7 @@ export default {
//
total: 0,
categoryOptions: [],
processTotal:0,
processTotal: 0,
//
ownProcessList: [],
//
@ -167,7 +109,7 @@ export default {
//
open: false,
src: "",
definitionList:[],
definitionList: [],
//
dateRange: [],
//
@ -256,11 +198,11 @@ export default {
console.log(row);
},
/** 取消流程申请 */
handleStop(row){
handleStop(row) {
const params = {
procInsId: row.procInsId
}
stopProcess(params).then( res => {
stopProcess(params).then(res => {
this.$modal.msgSuccess(res.msg);
this.getList();
});
@ -281,7 +223,7 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(function () {
return delProcess(ids);
}).then(() => {
this.getList();

231
ruoyi-ui/src/views/workflow/work/own_cellphone.vue

@ -0,0 +1,231 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="提交时间">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"-->
<!-- @click="handleDelete">删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" v-hasPermi="['workflow:process:ownExport']"-->
<!-- @click="handleExport">导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column 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" :formatter="categoryFormat" />-->
<!-- <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="taskName" />-->
<el-table-column label="提交时间" align="center" prop="createTime" width="180" />
<el-table-column label="报修状态" align="center" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus" />
</template>
</el-table-column>
<el-table-column label="耗时" align="center" prop="duration" width="180" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-tickets" @click="handleFlowRecord(scope.row)"
v-hasPermi="['workflow:process:query']">详情</el-button>
<!-- <el-button type="text" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)"-->
<!-- v-if="scope.row.finishTime" v-hasPermi="['workflow:process:remove']">删除</el-button>-->
<!-- <el-button type="text" size="mini" icon="el-icon-circle-close" @click="handleStop(scope.row)"-->
<!-- v-hasPermi="['workflow:process:cancel']">取消</el-button>-->
<!-- <el-button type="text" size="mini" icon="el-icon-refresh-right" v-hasPermi="['workflow:process:start']"-->
<!-- @click="handleAgain(scope.row)">重新发起</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import { listOwnProcess, stopProcess, delProcess } from '@/api/workflow/process';
import { listAllCategory } from '@/api/workflow/category';
export default {
name: "Own",
dicts: ['wf_process_status'],
components: {
},
data() {
return {
//
loading: true,
processLoading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
categoryOptions: [],
processTotal: 0,
//
ownProcessList: [],
//
title: "",
//
open: false,
src: "",
definitionList: [],
//
dateRange: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
processKey: undefined,
processName: undefined,
category: undefined,
cellphone: undefined
},
//
form: {},
//
rules: {
},
};
},
created() {
this.getCategoryList();
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.getList()
})
},
methods: {
/** 查询流程分类列表 */
getCategoryList() {
listAllCategory().then(response => this.categoryOptions = response.data)
},
/** 查询流程定义列表 */
getList() {
this.loading = true;
this.queryParams.cellphone = this.$route.query && this.$route.query.cellphone;
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.ownProcessList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.procInsId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
handleAgain(row) {
this.$router.push({
path: '/workflow/process/start/' + row.deployId,
query: {
definitionId: row.procDefId,
procInsId: row.procInsId
}
})
console.log(row);
},
/** 取消流程申请 */
handleStop(row) {
const params = {
procInsId: row.procInsId
}
stopProcess(params).then(res => {
this.$modal.msgSuccess(res.msg);
this.getList();
});
},
/** 流程流转记录 */
handleFlowRecord(row) {
this.$router.push({
path: '/bx/detail/' + row.procInsId,
query: {
processed: false
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.procInsId || this.ids;
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delProcess(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
this.download('workflow/process/ownExport', {
...this.queryParams
}, `wf_own_process_${new Date().getTime()}.xlsx`)
},
categoryFormat(row, column) {
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
}
}
};
</script>

91
ruoyi-ui/src/views/workflow/work/start_cellphone.vue

@ -0,0 +1,91 @@
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>填写报修单</span>
</div>
<div class="form-conf" v-if="formOpen">
<v-form-render :form-json="formModel" :form-data="formData" ref="vFormRef"></v-form-render>
<div class="cu-submit">
<el-button type="primary" @click="submit">提交</el-button>
<el-button @click="reset">重置</el-button>
</div>
</div>
</el-card>
</div>
</template>
<script>
import { getProcessForm, startProcess } from '@/api/workflow/process'
export default {
name: 'WorkStart',
data() {
return {
definitionId: null,
deployId: null,
procInsId: null,
formOpen: false,
formModel: {},
formData: {},
cellphone: null
}
},
created() {
this.initData();
},
methods: {
initData() {
this.deployId = this.$route.params && this.$route.params.deployId;
this.definitionId = this.$route.query && this.$route.query.definitionId;
this.procInsId = this.$route.query && this.$route.query.procInsId;
this.cellphone = this.$route.query && this.$route.query.cellphone;
getProcessForm({
definitionId: this.definitionId,
deployId: this.deployId,
procInsId: this.procInsId
}).then(response => {
const data = response.data;
this.formModel = data.formModel;
this.formData = data.formData || {};
this.formOpen = true
this.$nextTick(() => {
this.$refs.vFormRef.setFormJson(this.formModel || { formConfig: {}, widgetList: [] })
})
})
},
submit() {
this.$refs.vFormRef.getFormData().then(formData => {
if (this.definitionId) {
//
startProcess(this.definitionId, this.cellphone, JSON.stringify(formData)).then(res => {
this.$modal.msgSuccess(res.msg);
window.history.go(-1);
// this.$tab.closeOpenPage({
// path: '/work/own'
// })
})
}
}).catch(err => {
this.$modal.msgError(err);
})
},
reset() {
this.$refs.vFormRef.resetForm()
},
}
}
</script>
<style lang="scss" scoped>
.form-conf {
margin: 15px auto;
width: 80%;
/*padding: 15px;*/
}
.cu-submit {
margin-top: 15px;
text-align: center;
}
</style>

8
ruoyi-ui/vue.config.js

@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '铭慧通-工单后台管理系统' // 网页标题
const name = process.env.VUE_APP_TITLE || '广州城市学院报修管理系统' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口
@ -34,11 +34,11 @@ module.exports = {
open: false,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
'/dev-api': {
target: 'http://bx.mhito.net:8090',
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
changeOrigin: true,
pathRewrite: {
'^/dev-api': ''
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
},

Loading…
Cancel
Save