Browse Source

[fix] 售后管理

删除售后单列表页面审核流程相关字段和方法
删除售后单控制层审核流程相关接口
删除售后单mapper.xml层审核流程相关字段
删除售后单VO类
修改售后单集合列表查询接口
修改售后单详情查询接口
dev
liuxiaoxu 4 months ago
parent
commit
6ab811ab1d
  1. 105
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java
  2. 33
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java
  4. 11
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java
  5. 157
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java
  6. 1
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java
  7. 2
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java
  8. 9
      ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml
  9. 89
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html

105
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java

@ -1,21 +1,14 @@
package com.ruoyi.aftersales.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.SysMakeorderPick;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.service.ISysUserService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -30,9 +23,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 售后单Controller
*
@ -79,10 +69,10 @@ public class AftersalesOrderController extends BaseController
@RequiresPermissions("aftersales:aftersalesOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(AftersalesOrderVO aftersalesOrderVO)
public TableDataInfo list(AftersalesOrder aftersalesOrder)
{
startPage();
List<AftersalesOrderVO> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO);
List<AftersalesOrder> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder);
return getDataTable(list);
}
@ -95,10 +85,10 @@ public class AftersalesOrderController extends BaseController
@Log(title = "售后单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(AftersalesOrderVO aftersalesOrderVO)
public AjaxResult export(AftersalesOrder aftersalesOrder)
{
List<AftersalesOrderVO> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO);
ExcelUtil<AftersalesOrderVO> util = new ExcelUtil<AftersalesOrderVO>(AftersalesOrderVO.class);
List<AftersalesOrder> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder);
ExcelUtil<AftersalesOrder> util = new ExcelUtil<AftersalesOrder>(AftersalesOrder.class);
return util.exportExcel(list, "售后单数据");
}
@ -120,93 +110,10 @@ public class AftersalesOrderController extends BaseController
@ResponseBody
public AjaxResult addSave(AftersalesOrder aftersalesOrder)
{
// 审核状态-待审核
aftersalesOrder.setAuditStatus("0");
aftersalesOrderService.submitApply(aftersalesOrder);
return AjaxResult.success();
}
/**
* 加载审批弹窗
* @param taskId
* @param mmap
* @return
*/
@GetMapping("/showVerifyDialog/{taskId}")
public String showVerifyDialog(@PathVariable("taskId") String taskId, ModelMap mmap) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
AftersalesOrderVO aftersalesOrderVO = aftersalesOrderService.selectAftersalesOrderById(new Long(processInstance.getBusinessKey()));
mmap.put("formData", aftersalesOrderVO);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
return toAjax(aftersalesOrderService.insertAftersalesOrder(aftersalesOrder));
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public AftersalesOrderVO getObj(@RequestParam(value = "aftersalesOrderId", required = false) Long aftersalesOrderId, HttpSession session) {
if (aftersalesOrderId != null) {
return aftersalesOrderService.selectAftersalesOrderById(aftersalesOrderId);
}
return new AftersalesOrderVO();
}
/**
* 完成任务
*
* @return
*/
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@ModelAttribute("preloadObj") AftersalesOrderVO aftersalesOrderVO, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = aftersalesOrderVO.getInstanceId();
//获取实例类型
String instanceType = aftersalesOrderVO.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, aftersalesOrderVO.getApplyTitle(), aftersalesOrderVO.getAftersalesOrderCode(), "aftersalesOrder", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
aftersalesOrderVO.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
aftersalesOrderVO.setAuditStatus("1");
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
// erpBomVo.setUseStatus("1");
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
// erpBomVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
// erpBomVo.setUseStatus("1");
}
}
aftersalesOrderService.updateAftersalesOrder(aftersalesOrderVO);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
aftersalesOrderService.updateAftersalesOrder(aftersalesOrderVO);
}
return success("任务已完成");
}
/**

33
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/AftersalesOrderVO.java

@ -1,33 +0,0 @@
package com.ruoyi.aftersales.domain.vo;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import lombok.Data;
import java.util.Date;
@Data
public class AftersalesOrderVO extends AftersalesOrder {
private static final long serialVersionUID = -3627380777050403384L;
/** 申请人姓名 */
private String applyUserName;
/** 任务ID */
private String taskId;
/** 任务名称 */
private String taskName;
/** 办理时间 */
private Date doneTime;
/** 创建人 */
private String createUserName;
/** 流程实例状态 1 激活 2 挂起 */
private String suspendState;
/** 待办用户id */
private String todoUserId;
/** 流程实例类型名称 */
private String instanceTypeName;
/**
* 关键词
*/
private String keyword;
}

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesOrderMapper.java

@ -2,7 +2,6 @@ package com.ruoyi.aftersales.mapper;
import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
/**
* 售后单Mapper接口
@ -18,7 +17,7 @@ public interface AftersalesOrderMapper
* @param aftersalesOrderId 售后单ID
* @return 售后单
*/
public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId);
public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId);
/**
@ -35,7 +34,7 @@ public interface AftersalesOrderMapper
* @param aftersalesOrder 售后单
* @return 售后单集合
*/
public List<AftersalesOrderVO> selectAftersalesOrderList(AftersalesOrder aftersalesOrder);
public List<AftersalesOrder> selectAftersalesOrderList(AftersalesOrder aftersalesOrder);
/**
* 新增售后单

11
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java

@ -2,8 +2,6 @@ package com.ruoyi.aftersales.service;
import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
import com.ruoyi.system.domain.SysMakeorderPick;
import org.activiti.engine.runtime.ProcessInstance;
/**
@ -20,7 +18,7 @@ public interface IAftersalesOrderService
* @param aftersalesOrderId 售后单ID
* @return 售后单
*/
public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId);
public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId);
/**
@ -37,7 +35,7 @@ public interface IAftersalesOrderService
* @param aftersalesOrderVO 售后单
* @return 售后单集合
*/
public List<AftersalesOrderVO> selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO);
public List<AftersalesOrder> selectAftersalesOrderList(AftersalesOrder aftersalesOrder);
/**
* 新增售后单
@ -85,9 +83,4 @@ public interface IAftersalesOrderService
*/
int restoreAftersalesOrderById(Long aftersalesOrderId);
/**
* 审批流程启动
* */
ProcessInstance submitApply(AftersalesOrder aftersalesOrder);
}

157
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java

@ -1,13 +1,7 @@
package com.ruoyi.aftersales.service.impl;
import java.text.SimpleDateFormat;
import java.util.*;
import com.github.pagehelper.Page;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
@ -15,16 +9,12 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.SysAttach;
import com.ruoyi.system.domain.SysMakeorderPick;
import com.ruoyi.system.mapper.SysAttachMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysAttachFileService;
import com.ruoyi.system.service.ISysAttachService;
import com.ruoyi.system.service.ISysRoleService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.mapper.AftersalesOrderMapper;
@ -52,28 +42,6 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
private ISysAttachFileService attachFileService;
@Autowired
private IProcessService processService;
@Autowired
private SysAttachMapper sysAttachMapper;
@Autowired
private RedisCache redisCache;
@Autowired
private ISysRoleService roleService;
@Autowired
private SysUserMapper userMapper;
@Autowired
private TaskService taskService;
@Autowired
private BizTodoItemMapper todoItemMapper;
/**
* 查询售后单
*
@ -81,7 +49,7 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
* @return 售后单
*/
@Override
public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId)
public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId)
{
return aftersalesOrderMapper.selectAftersalesOrderById(aftersalesOrderId);
}
@ -109,60 +77,9 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
* @return 售后单
*/
@Override
public List<AftersalesOrderVO> selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO)
public List<AftersalesOrder> selectAftersalesOrderList(AftersalesOrder aftersalesOrder)
{
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<AftersalesOrderVO> list = (Page<AftersalesOrderVO>) aftersalesOrderMapper.selectAftersalesOrderList(aftersalesOrderVO);
Page<AftersalesOrderVO> returnList = new Page<>();
for (AftersalesOrderVO tempAftersalesOrderVO: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempAftersalesOrderVO.getCreateBy());
if (sysUser != null) {
tempAftersalesOrderVO.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(tempAftersalesOrderVO.getApplyUser());
if (sysUser2 != null) {
tempAftersalesOrderVO.setApplyUserName(sysUser2.getUserName());
}
String instanceId = tempAftersalesOrderVO.getInstanceId();
// 当前环节
if (StringUtils.isNotBlank(instanceId)) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(instanceId)
// .singleResult();
.list(); // 例如请假会签,会同时拥有多个任务
if (!org.springframework.util.CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
String taskId = task.getId();
tempAftersalesOrderVO.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
tempAftersalesOrderVO.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
tempAftersalesOrderVO.setTaskName("已挂起");
tempAftersalesOrderVO.setSuspendState("2");
} else {
tempAftersalesOrderVO.setTaskName(task.getName());
tempAftersalesOrderVO.setSuspendState("1");
}
} else {
// 已办结或者已撤销
tempAftersalesOrderVO.setTaskName("已结束");
}
} else {
tempAftersalesOrderVO.setTaskName("未启动");
}
returnList.add(tempAftersalesOrderVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
return aftersalesOrderMapper.selectAftersalesOrderList(aftersalesOrder);
}
/**
@ -276,72 +193,4 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
return aftersalesOrderMapper.restoreAftersalesOrderById(aftersalesOrderId);
}
/**
* 审批流程启动
* */
@Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(AftersalesOrder aftersalesOrder) {
SysUser user = ShiroUtils.getSysUser();
aftersalesOrder.setApplyUser(user.getLoginName());
aftersalesOrder.setApplyTime(DateUtils.getNowDate());
aftersalesOrder.setAftersalesOrderCode(redisCache.generateBillNo("SH"));
// 保存
insertAftersalesOrder(aftersalesOrder);
// 启动流程
String applyTitle = user.getUserName()+"发起了售后单提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,aftersalesOrder, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
aftersalesOrder.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
aftersalesOrder.setAuditStatus("1");
}
aftersalesOrderMapper.updateAftersalesOrder(aftersalesOrder);
return processInstance;
}
/**
* 创建售后单审核流程
* @param applyTitle
* @param instanceType
* @param user
* @return
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, AftersalesOrder aftersalesOrder, SysUser user) {
Long aftersalesOrderId = aftersalesOrder.getAftersalesOrderId();
String businessKey = aftersalesOrderId.toString(); // 实体类 ID,作为流程的业务 key
String key = "aftersalesOrder";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
aftersalesOrder.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, aftersalesOrder.getAftersalesOrderCode(), key, variables);
String processInstanceId = processInstance.getId();
aftersalesOrder.setInstanceId(processInstanceId); // 建立双向关系
aftersalesOrder.setInstanceType(instanceType);
return processInstance;
}
/**
* 发起人节点判断
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("ywyRole")){
variables.put("authority",1);
}else if(roleKeys.contains("ywjlRole")){
variables.put("authority",2);
}else if(roleKeys.contains("ywzgRole")){
variables.put("authority",3);
}
}
}

1
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java

@ -3,7 +3,6 @@ package com.ruoyi.sales.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import org.activiti.engine.RuntimeService;

2
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java

@ -6,8 +6,6 @@ import java.util.Map;
import java.util.Set;
import com.github.pagehelper.Page;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.aftersales.domain.vo.AftersalesOrderVO;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;

9
ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.aftersales.mapper.AftersalesOrderMapper">
<resultMap type="AftersalesOrderVO" id="AftersalesOrderResult">
<resultMap type="AftersalesOrder" id="AftersalesOrderResult">
<result property="aftersalesOrderId" column="aftersales_order_id" />
<result property="aftersalesOrderCode" column="aftersales_order_code" />
<result property="salesOrderCode" column="sales_order_code" />
@ -33,7 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userCommentAttachment" column="user_comment_attachment" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyTime" column="apply_time" />
@ -47,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select aftersales_order_id, aftersales_order_code, sales_order_code, make_no, user_id, audit_status, aftersales_status, business_name, aftersales_name, customer_id, customer_name, material_no, material_name, material_sum, enterprise_sum, start_date, delivery_name, delivery_number, company_address, create_by, create_time, update_by, update_time, remark, service_content, user_comment_attachment, instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from aftersales_order
</sql>
<select id="selectAftersalesOrderList" parameterType="AftersalesOrderVO" resultMap="AftersalesOrderResult">
<select id="selectAftersalesOrderList" parameterType="AftersalesOrder" resultMap="AftersalesOrderResult">
<include refid="selectAftersalesOrderVo"/>
<where>
<if test="aftersalesOrderCode != null and aftersalesOrderCode != ''"> and aftersales_order_code = #{aftersalesOrderCode}</if>
@ -110,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where so.aftersales_order_id = #{aftersalesOrderId}
</select>
<insert id="insertAftersalesOrder" parameterType="AftersalesOrderVO" useGeneratedKeys="true" keyProperty="aftersalesOrderId">
<insert id="insertAftersalesOrder" parameterType="AftersalesOrder" useGeneratedKeys="true" keyProperty="aftersalesOrderId">
insert into aftersales_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="aftersalesOrderCode != null">aftersales_order_code,</if>
@ -184,7 +183,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateAftersalesOrder" parameterType="AftersalesOrderVO">
<update id="updateAftersalesOrder" parameterType="AftersalesOrder">
update aftersales_order
<trim prefix="SET" suffixOverrides=",">
<if test="aftersalesOrderCode != null">aftersales_order_code = #{aftersalesOrderCode},</if>

89
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html

@ -72,8 +72,6 @@
var prefix = ctx + "aftersales/aftersalesOrder";
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$(function() {
var options = {
url: prefix + "/list",
@ -97,74 +95,6 @@
field: 'aftersalesOrderId',
visible: false
},
{
field: 'instanceId',
title: '流程实例ID',
visible: false
},
{
field: 'submitInstanceId',
title: '流程提交实例ID',
visible: false
},
{
field: 'cancelInstanceId',
title: '流程作废实例ID',
visible: false
},
{
field: 'restoreInstanceId',
title: '流程恢复实例ID',
visible: false
},
{
field: 'instanceTypeName',
title: '流程实例类型',
visible: false
},
{
field: 'applyUser',
title: '申请人ID',
visible: false
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间'
},
{
field: 'taskId',
title: '当前任务ID',
visible: false
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false
},
{
field: 'taskName',
title: '当前任务名称',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
title: '审核状态',
field: 'auditStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
title: '售后状态',
field: 'aftersalesStatus',
@ -247,28 +177,11 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 审核状态-审核通过
if(row.auditStatus=="1"){
// 编辑
// actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + sendOrdersFlag + '" href="javascript:void(0)" onclick="sendOrders(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-edit"></i>派单</a> ');
actions.push('<a class="btn btn-success btn-xs ' + uploadReportFlag + '" href="javascript:void(0)" onclick="uploadReport(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-edit"></i>上传报告</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName) || loginName == 'admin'){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');

Loading…
Cancel
Save