提交代码
parent
b17dbd03aa
commit
da24dec217
|
@ -0,0 +1,38 @@
|
||||||
|
package com.yanzhu.common.enums;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否状态
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
*/
|
||||||
|
public enum ShiFouEnum {
|
||||||
|
|
||||||
|
FOU("0", "否"), SHI("1", "是");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
ShiFouEnum(String code, String info)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInfo()
|
||||||
|
{
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLongCode()
|
||||||
|
{
|
||||||
|
return Convert.toLong(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -20,6 +20,10 @@
|
||||||
<groupId>com.yanzhu</groupId>
|
<groupId>com.yanzhu</groupId>
|
||||||
<artifactId>yanzhu-system</artifactId>
|
<artifactId>yanzhu-system</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yanzhu</groupId>
|
||||||
|
<artifactId>yanzhu-mapper</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yanzhu</groupId>
|
<groupId>com.yanzhu</groupId>
|
||||||
<artifactId>yanzhu-common</artifactId>
|
<artifactId>yanzhu-common</artifactId>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.yanzhu.common.core.domain.entity.SysRole;
|
||||||
import com.yanzhu.common.core.domain.entity.SysUser;
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
import com.yanzhu.common.core.text.Convert;
|
import com.yanzhu.common.core.text.Convert;
|
||||||
import com.yanzhu.flowable.domain.FlowSaveXmlVo;
|
import com.yanzhu.flowable.domain.FlowSaveXmlVo;
|
||||||
|
import com.yanzhu.project.domain.ProProjectApply;
|
||||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||||
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
||||||
import com.yanzhu.system.domain.FlowProcDefDto;
|
import com.yanzhu.system.domain.FlowProcDefDto;
|
||||||
|
@ -160,9 +161,8 @@ public class FlowDefinitionController extends BaseController {
|
||||||
@ApiOperation(value = "发起流程")
|
@ApiOperation(value = "发起流程")
|
||||||
@PostMapping("/start/{procDefId}")
|
@PostMapping("/start/{procDefId}")
|
||||||
public AjaxResult start(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
|
public AjaxResult start(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
|
||||||
@ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
|
@ApiParam(value = "申请表单") @RequestBody ProProjectApply proProjectApply) {
|
||||||
return flowDefinitionService.startProcessInstanceById(procDefId, variables);
|
return flowDefinitionService.startProcessInstanceById(procDefId, proProjectApply);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "激活或挂起流程定义")
|
@ApiOperation(value = "激活或挂起流程定义")
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.yanzhu.flowable.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
import com.yanzhu.common.core.domain.AjaxResult;
|
||||||
|
import com.yanzhu.project.domain.ProProjectApply;
|
||||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||||
import com.yanzhu.system.domain.FlowProcDefDto;
|
import com.yanzhu.system.domain.FlowProcDefDto;
|
||||||
|
|
||||||
|
@ -45,12 +46,11 @@ public interface IFlowDefinitionService {
|
||||||
/**
|
/**
|
||||||
* 根据流程定义ID启动流程实例
|
* 根据流程定义ID启动流程实例
|
||||||
*
|
*
|
||||||
* @param procDefId
|
* @param procDefId 流程ID
|
||||||
* @param variables
|
* @param proProjectApply 申请表单
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
AjaxResult startProcessInstanceById(String procDefId, ProProjectApply proProjectApply);
|
||||||
AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,19 +3,21 @@ package com.yanzhu.flowable.service.impl;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.yanzhu.common.core.text.Convert;
|
|
||||||
import com.yanzhu.common.utils.StringUtils;
|
|
||||||
import com.yanzhu.flowable.common.constant.ProcessConstants;
|
|
||||||
import com.yanzhu.common.core.domain.AjaxResult;
|
import com.yanzhu.common.core.domain.AjaxResult;
|
||||||
import com.yanzhu.common.core.domain.entity.SysUser;
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
|
import com.yanzhu.common.core.text.Convert;
|
||||||
import com.yanzhu.common.utils.SecurityUtils;
|
import com.yanzhu.common.utils.SecurityUtils;
|
||||||
import com.yanzhu.system.domain.flowable.FlowDeptVo;
|
import com.yanzhu.common.utils.StringUtils;
|
||||||
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
import com.yanzhu.flowable.common.constant.ProcessConstants;
|
||||||
import com.yanzhu.system.domain.FlowProcDefDto;
|
import com.yanzhu.flowable.common.enums.FlowComment;
|
||||||
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
import com.yanzhu.flowable.factory.FlowServiceFactory;
|
||||||
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
import com.yanzhu.flowable.service.IFlowDefinitionService;
|
||||||
import com.yanzhu.flowable.service.ISysDeployFormService;
|
import com.yanzhu.flowable.service.ISysDeployFormService;
|
||||||
import com.yanzhu.system.domain.SysForm;
|
import com.yanzhu.project.domain.ProProjectApply;
|
||||||
|
import com.yanzhu.project.service.IProProjectApplyService;
|
||||||
|
import com.yanzhu.system.domain.FlowProcDefDto;
|
||||||
|
import com.yanzhu.system.domain.flowable.FlowDeptVo;
|
||||||
|
import com.yanzhu.system.domain.flowable.FlowQueryVo;
|
||||||
import com.yanzhu.system.mapper.FlowDeployMapper;
|
import com.yanzhu.system.mapper.FlowDeployMapper;
|
||||||
import com.yanzhu.system.service.ISysDeptService;
|
import com.yanzhu.system.service.ISysDeptService;
|
||||||
import com.yanzhu.system.service.ISysPostService;
|
import com.yanzhu.system.service.ISysPostService;
|
||||||
|
@ -27,7 +29,10 @@ import org.flowable.bpmn.model.BpmnModel;
|
||||||
import org.flowable.engine.repository.Deployment;
|
import org.flowable.engine.repository.Deployment;
|
||||||
import org.flowable.engine.repository.ProcessDefinition;
|
import org.flowable.engine.repository.ProcessDefinition;
|
||||||
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
import org.flowable.engine.repository.ProcessDefinitionQuery;
|
||||||
|
import org.flowable.engine.runtime.ProcessInstance;
|
||||||
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
|
import org.flowable.image.impl.DefaultProcessDiagramGenerator;
|
||||||
|
import org.flowable.task.api.Task;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -62,6 +67,9 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
@Resource
|
@Resource
|
||||||
private FlowDeployMapper flowDeployMapper;
|
private FlowDeployMapper flowDeployMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProProjectApplyService proProjectApplyService;
|
||||||
|
|
||||||
private static final String BPMN_FILE_SUFFIX = ".bpmn";
|
private static final String BPMN_FILE_SUFFIX = ".bpmn";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -185,42 +193,54 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
* 根据流程定义ID启动流程实例
|
* 根据流程定义ID启动流程实例
|
||||||
*
|
*
|
||||||
* @param procDefId 流程模板ID
|
* @param procDefId 流程模板ID
|
||||||
* @param variables 流程变量
|
* @param proProjectApply 流程表单
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
public AjaxResult startProcessInstanceById(String procDefId, ProProjectApply proProjectApply) {
|
||||||
try {
|
try {
|
||||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
int res;
|
||||||
.latestVersion().singleResult();
|
if(proProjectApply.getId()!=null){
|
||||||
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
|
res = proProjectApplyService.updateProProjectApply(proProjectApply);
|
||||||
return AjaxResult.error("流程已被挂起,请先激活流程");
|
}else{
|
||||||
|
res = proProjectApplyService.insertProProjectApply(proProjectApply);
|
||||||
|
}
|
||||||
|
if(res>0){
|
||||||
|
Map<String, Object> variables = new HashMap<>();
|
||||||
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
||||||
|
.latestVersion().singleResult();
|
||||||
|
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
|
||||||
|
return AjaxResult.error("流程已被挂起,请联系管理员激活流程");
|
||||||
|
}
|
||||||
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
|
String userId = Convert.toStr(sysUser.getUserId());
|
||||||
|
// 设置流程发起人Id到流程中
|
||||||
|
identityService.setAuthenticatedUserId(userId);
|
||||||
|
variables.put(ProcessConstants.PROCESS_INITIATOR, userId);
|
||||||
|
variables.put("businessKey", proProjectApply.getId());
|
||||||
|
ProcessInstance processInstance;
|
||||||
|
if(variables.get("businessKey")!=null){
|
||||||
|
processInstance = runtimeService.startProcessInstanceById(procDefId, Convert.toStr(variables.get("businessKey")),variables);
|
||||||
|
}else{
|
||||||
|
processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
|
||||||
|
}
|
||||||
|
// 给第一步申请人节点设置任务执行人和意见
|
||||||
|
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
||||||
|
if (Objects.nonNull(task)) {
|
||||||
|
taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
|
||||||
|
taskService.setAssignee(task.getId(), Convert.toStr(userId));
|
||||||
|
taskService.complete(task.getId(), variables);
|
||||||
|
}
|
||||||
|
return AjaxResult.success("流程启动成功");
|
||||||
|
}else{
|
||||||
|
return AjaxResult.error("流程表单保存失败");
|
||||||
}
|
}
|
||||||
// 设置流程发起人Id到流程中
|
|
||||||
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
||||||
identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
|
||||||
variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
|
|
||||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
|
||||||
// 流程发起时 跳过发起人节点
|
|
||||||
// SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
||||||
// identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
|
||||||
// variables.put(ProcessConstants.PROCESS_INITIATOR, "");
|
|
||||||
// ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
|
|
||||||
// // 给第一步申请人节点设置任务执行人和意见
|
|
||||||
// Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
|
||||||
// if (Objects.nonNull(task)) {
|
|
||||||
// taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
|
|
||||||
//// taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
|
|
||||||
// taskService.complete(task.getId(), variables);
|
|
||||||
// }
|
|
||||||
return AjaxResult.success("流程启动成功");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return AjaxResult.error("流程启动错误");
|
return AjaxResult.error("流程启动错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 激活或挂起流程定义
|
* 激活或挂起流程定义
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,7 +7,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import com.yanzhu.common.constant.Constants;
|
import com.yanzhu.common.constant.Constants;
|
||||||
import com.yanzhu.common.core.domain.entity.SysUser;
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
import com.yanzhu.common.core.redis.RedisCache;
|
import com.yanzhu.common.core.redis.RedisCache;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package com.yanzhu.project.service.impl;
|
package com.yanzhu.project.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.yanzhu.common.core.domain.entity.SysUser;
|
||||||
|
import com.yanzhu.common.enums.ShiFouEnum;
|
||||||
import com.yanzhu.common.utils.DateUtils;
|
import com.yanzhu.common.utils.DateUtils;
|
||||||
|
import com.yanzhu.common.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -58,6 +62,12 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
|
||||||
@Override
|
@Override
|
||||||
public int insertProProjectApply(ProProjectApply proProjectApply)
|
public int insertProProjectApply(ProProjectApply proProjectApply)
|
||||||
{
|
{
|
||||||
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
|
proProjectApply.setDeptId(sysUser.getDeptId());
|
||||||
|
proProjectApply.setParProjName(sysUser.getParDeptName());
|
||||||
|
proProjectApply.setApplyUser(sysUser.getUserId());
|
||||||
|
proProjectApply.setIsDel(ShiFouEnum.FOU.getCode());
|
||||||
|
proProjectApply.setCreateBy(sysUser.getNickName());
|
||||||
proProjectApply.setCreateTime(DateUtils.getNowDate());
|
proProjectApply.setCreateTime(DateUtils.getNowDate());
|
||||||
int rows = proProjectApplyMapper.insertProProjectApply(proProjectApply);
|
int rows = proProjectApplyMapper.insertProProjectApply(proProjectApply);
|
||||||
insertProProjectApplyDetail(proProjectApply);
|
insertProProjectApplyDetail(proProjectApply);
|
||||||
|
@ -74,6 +84,8 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
|
||||||
@Override
|
@Override
|
||||||
public int updateProProjectApply(ProProjectApply proProjectApply)
|
public int updateProProjectApply(ProProjectApply proProjectApply)
|
||||||
{
|
{
|
||||||
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
|
proProjectApply.setUpdateBy(sysUser.getNickName());
|
||||||
proProjectApply.setUpdateTime(DateUtils.getNowDate());
|
proProjectApply.setUpdateTime(DateUtils.getNowDate());
|
||||||
proProjectApplyMapper.deleteProProjectApplyDetailByApplyId(proProjectApply.getId());
|
proProjectApplyMapper.deleteProProjectApplyDetailByApplyId(proProjectApply.getId());
|
||||||
insertProProjectApplyDetail(proProjectApply);
|
insertProProjectApplyDetail(proProjectApply);
|
||||||
|
|
|
@ -30,10 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="parentId == 0 ">
|
<if test="parentId == 0 ">
|
||||||
and parent_id is null
|
and parent_id is null
|
||||||
</if>
|
</if>
|
||||||
<if test="parentId < 0 ">
|
<if test="parentId > 0 ">
|
||||||
and parent_id is null
|
|
||||||
</if>
|
|
||||||
<if test="parentId > 0 ">
|
|
||||||
and parent_id = #{parentId}
|
and parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -42,3 +42,11 @@ export function delAssetsType(id) {
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据分类查询物资
|
||||||
|
export function findAllByCategory(category) {
|
||||||
|
return request({
|
||||||
|
url: '/base/assetsType/findAllByCategory/' + category,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -96,44 +96,48 @@
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="index" width="50" />
|
<el-table-column label="序号" align="center" prop="index" width="50" />
|
||||||
<el-table-column label="申请明细" align="center" prop="assetsId">
|
<el-table-column label="<span class='required'>*</span>申请明细" align="center" prop="assetsId">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="form.projId"
|
v-model="scope.row.assetsId"
|
||||||
placeholder="请选择项目名称"
|
placeholder="请选择申请明细"
|
||||||
style="width: 100%"
|
|
||||||
filterable
|
filterable
|
||||||
@change="projectChage"
|
style="width: 100%"
|
||||||
|
@change="selectAssetsId"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option-group
|
||||||
v-for="(item, index) in projectOptions"
|
v-for="group in AssetsTypeOptions"
|
||||||
:key="index"
|
:key="group.id + ''"
|
||||||
:label="item.projName"
|
:label="
|
||||||
:value="item.id"
|
group.name + ' [' + group.deptId ? '项目自定义' : '系统默认' + '] '
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
|
v-for="item in group.childrenAssetsTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="
|
||||||
|
item.name + ' [' + group.deptId ? '项目自定义' : '系统默认' + '] '
|
||||||
|
"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-option-group>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="申请数量" prop="number" align="center" width="180">
|
<el-table-column label="<span class='required'>*</span>申请数量" prop="number" align="center" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12"
|
<el-col :span="12"
|
||||||
><el-input v-model="scope.row.number" placeholder="数量"
|
><el-input v-model="scope.row.number" placeholder="数量"
|
||||||
/></el-col>
|
/></el-col>
|
||||||
<el-col :span="12"
|
<el-col :span="12"
|
||||||
><el-select
|
><el-select v-model="scope.row.assetsUnit" placeholder="单位" filterable>
|
||||||
v-model="form.projId"
|
|
||||||
placeholder="单位"
|
|
||||||
style="width: 100%"
|
|
||||||
filterable
|
|
||||||
@change="projectChage"
|
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) in projectOptions"
|
v-for="(item, index) in unitOptions"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.projName"
|
:label="item"
|
||||||
:value="item.id"
|
:value="item"
|
||||||
>
|
>
|
||||||
</el-option> </el-select
|
</el-option> </el-select
|
||||||
></el-col>
|
></el-col>
|
||||||
|
@ -157,7 +161,7 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="使用说明" prop="useReason" align="center">
|
<el-table-column label="<span class='required'>*</span>使用说明" prop="useReason" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
@ -184,6 +188,7 @@ import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
||||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
||||||
import { getNextFlowNodeByStart } from "@/api/flowable/todo";
|
import { getNextFlowNodeByStart } from "@/api/flowable/todo";
|
||||||
import { findMyDeptProject } from "@/api/project/projectInfo";
|
import { findMyDeptProject } from "@/api/project/projectInfo";
|
||||||
|
import { findAllByCategory } from "@/api/base/assetsType";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -222,16 +227,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
projId: [{ required: true, message: "请选择项目名称", trigger: "blur" }],
|
||||||
files: [{ required: true, message: "请上传申请内容", trigger: "blur" }],
|
applyReason: [{ required: true, message: "请输入申请原因", trigger: "blur" }]
|
||||||
remark: [
|
|
||||||
{ required: false, message: "请输入申请说明", trigger: "blur" },
|
|
||||||
{
|
|
||||||
max: 500,
|
|
||||||
message: "申请说明最多输入500字",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
projectOptions: [],
|
projectOptions: [],
|
||||||
deptName: null,
|
deptName: null,
|
||||||
|
@ -244,7 +241,9 @@ export default {
|
||||||
proProjectApplyDetailList: [],
|
proProjectApplyDetailList: [],
|
||||||
// 子表选中数据
|
// 子表选中数据
|
||||||
checkedProProjectApplyDetail: [],
|
checkedProProjectApplyDetail: [],
|
||||||
showAssetsVersion:false,
|
showAssetsVersion: false,
|
||||||
|
AssetsTypeOptions: [],
|
||||||
|
unitOptions: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -257,10 +256,20 @@ export default {
|
||||||
initMyProject() {
|
initMyProject() {
|
||||||
// 获取项目列表的接口
|
// 获取项目列表的接口
|
||||||
findMyDeptProject().then((response) => {
|
findMyDeptProject().then((response) => {
|
||||||
if (response.code == 200 && response.data) {
|
if (response.code == 200) {
|
||||||
this.projectOptions = response.data;
|
this.projectOptions = response.data;
|
||||||
this.form.projId = response.data[0].id;
|
if(response.data.length>0){
|
||||||
this.form.projName = response.data[0].projName;
|
this.form.projId = response.data[0].id;
|
||||||
|
this.form.projName = response.data[0].projName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
initCategoryAssetsType(val) {
|
||||||
|
// 获取项目列表的接口
|
||||||
|
findAllByCategory(val).then((response) => {
|
||||||
|
if (response.code == 200 && response.data) {
|
||||||
|
this.AssetsTypeOptions = response.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -280,9 +289,10 @@ export default {
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.initMyProject();
|
this.initMyProject();
|
||||||
//物资设备类需要输入规格
|
//物资设备类需要输入规格
|
||||||
if(options.category==1){
|
if (options.category == 1) {
|
||||||
this.showAssetsVersion=true;
|
this.showAssetsVersion = true;
|
||||||
}
|
}
|
||||||
|
this.initCategoryAssetsType(options.category);
|
||||||
this.title = options.name;
|
this.title = options.name;
|
||||||
this.form.parProjName = store.getters.parDeptName;
|
this.form.parProjName = store.getters.parDeptName;
|
||||||
this.nickName = store.getters.name;
|
this.nickName = store.getters.name;
|
||||||
|
@ -309,8 +319,27 @@ export default {
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
for(let i=0;i<this.proProjectApplyDetailList.length;i++){
|
||||||
|
if(!this.proProjectApplyDetailList[i].assetsId){
|
||||||
|
this.$modal.msgWarning("申请明细第 ”"+(i+1)+"“行未选择...");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!this.proProjectApplyDetailList[i].number){
|
||||||
|
this.$modal.msgWarning("申请明细第 ”"+(i+1)+"“行数量未输入...");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!this.proProjectApplyDetailList[i].assetsUnit){
|
||||||
|
this.$modal.msgWarning("申请明细第 ”"+(i+1)+"“行单位未选择...");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!this.proProjectApplyDetailList[i].useReason){
|
||||||
|
this.$modal.msgWarning("申请明细第 ”"+(i+1)+"“行申请说明未输入...");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.form.proProjectApplyDetailList = this.proProjectApplyDetailList;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
definitionStart(this.options.id, JSON.stringify(this.form)).then((res) => {
|
definitionStart(this.options.id, this.form).then((res) => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
//关闭并刷新列表
|
//关闭并刷新列表
|
||||||
|
@ -360,6 +389,28 @@ export default {
|
||||||
handleProProjectApplyDetailSelectionChange(selection) {
|
handleProProjectApplyDetailSelectionChange(selection) {
|
||||||
this.checkedProProjectApplyDetail = selection.map((item) => item.index);
|
this.checkedProProjectApplyDetail = selection.map((item) => item.index);
|
||||||
},
|
},
|
||||||
|
selectAssetsId(val) {
|
||||||
|
for (let i = 0; i < this.AssetsTypeOptions.length; i++) {
|
||||||
|
for (
|
||||||
|
let x = 0;
|
||||||
|
x < this.AssetsTypeOptions[i].childrenAssetsTypeList.length;
|
||||||
|
x++
|
||||||
|
) {
|
||||||
|
if (this.AssetsTypeOptions[i].childrenAssetsTypeList[x].id == val) {
|
||||||
|
this.unitOptions = this.AssetsTypeOptions[i].childrenAssetsTypeList[x].unit;
|
||||||
|
if (this.unitOptions.length > 0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.AssetsTypeOptions.forEach((item) => {
|
||||||
|
item.userinfoList.forEach((u) => {
|
||||||
|
if (u.phonenumber == val) {
|
||||||
|
this.form.superviseUserName = u.nickName + " [" + u.jobTypeName + "] ";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue