Browse Source

[fix] 售后管理

修改售后单的前端新增页面
修改售后单修改页面
新增售后单VO类。加上流程相关字段
修改后端售后单列表查询接口
修改后端售后单列表导出接口
修改后端保存售后单接口:新增开始审核方法和审核状态
新增 加载审批弹窗后端接口
新增 自动绑定页面字段后端接口
新增 完成任务后端接口
修改查询售后单详情接口
修改查询售后端集合接口
修改售后单的resultMap为vo类型
新增发起人节点判断后端接口,加入需要的角色节点人
新增售后单驳回调整页面
新增售后单业务经理审核页面
新增售后单业务主管审核页面
dev
liuxiaoxu 4 months ago
parent
commit
cb94b914ab
  1. 129
      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. 15
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOrderService.java
  5. 165
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOrderServiceImpl.java
  6. 1
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  7. 9
      ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesOrderMapper.xml
  8. 110
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/add.html
  9. 132
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html
  10. 2
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/edit.html
  11. 140
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/taskModifyApply.html
  12. 147
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/taskYwjlVerify.html
  13. 147
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/taskYwzgVerify.html

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

@ -1,20 +1,26 @@
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;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.aftersales.domain.AftersalesOrder;
@ -24,6 +30,9 @@ 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
*
@ -46,6 +55,17 @@ public class AftersalesOrderController extends BaseController
@Autowired
private ISysUserService sysUserService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@RequiresPermissions("aftersales:aftersalesOrder:view")
@GetMapping()
public String aftersalesOrder()
@ -59,10 +79,10 @@ public class AftersalesOrderController extends BaseController
@RequiresPermissions("aftersales:aftersalesOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(AftersalesOrder aftersalesOrder)
public TableDataInfo list(AftersalesOrderVO aftersalesOrderVO)
{
startPage();
List<AftersalesOrder> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder);
List<AftersalesOrderVO> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO);
return getDataTable(list);
}
@ -75,10 +95,10 @@ public class AftersalesOrderController extends BaseController
@Log(title = "售后单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(AftersalesOrder aftersalesOrder)
public AjaxResult export(AftersalesOrderVO aftersalesOrderVO)
{
List<AftersalesOrder> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrder);
ExcelUtil<AftersalesOrder> util = new ExcelUtil<AftersalesOrder>(AftersalesOrder.class);
List<AftersalesOrderVO> list = aftersalesOrderService.selectAftersalesOrderList(aftersalesOrderVO);
ExcelUtil<AftersalesOrderVO> util = new ExcelUtil<AftersalesOrderVO>(AftersalesOrderVO.class);
return util.exportExcel(list, "售后单数据");
}
@ -100,9 +120,95 @@ public class AftersalesOrderController extends BaseController
@ResponseBody
public AjaxResult addSave(AftersalesOrder aftersalesOrder)
{
return toAjax(aftersalesOrderService.insertAftersalesOrder(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;
}
/**
* 自动绑定页面字段
*/
@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("任务已完成");
}
/**
* 修改售后单
*/
@ -189,7 +295,6 @@ public class AftersalesOrderController extends BaseController
/**
* 查询选择设备列表
*/
@RequiresPermissions("aftersales:aftersalesOrder:list")
@PostMapping("/optionDevices")
@ResponseBody
public TableDataInfo optionDevices(AftersalesOrder aftersalesOrder)

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

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

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

@ -2,6 +2,9 @@ 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;
/**
* 售后单Service接口
@ -17,7 +20,7 @@ public interface IAftersalesOrderService
* @param aftersalesOrderId 售后单ID
* @return 售后单
*/
public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId);
public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId);
/**
@ -31,10 +34,10 @@ public interface IAftersalesOrderService
/**
* 查询售后单列表
*
* @param aftersalesOrder 售后单
* @param aftersalesOrderVO 售后单
* @return 售后单集合
*/
public List<AftersalesOrder> selectAftersalesOrderList(AftersalesOrder aftersalesOrder);
public List<AftersalesOrderVO> selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO);
/**
* 新增售后单
@ -81,4 +84,10 @@ public interface IAftersalesOrderService
* @return
*/
int restoreAftersalesOrderById(Long aftersalesOrderId);
/**
* 审批流程启动
* */
ProcessInstance submitApply(AftersalesOrder aftersalesOrder);
}

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

@ -1,16 +1,30 @@
package com.ruoyi.aftersales.service.impl;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
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;
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;
@ -38,9 +52,28 @@ 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;
/**
* 查询售后单
*
@ -48,7 +81,7 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
* @return 售后单
*/
@Override
public AftersalesOrder selectAftersalesOrderById(Long aftersalesOrderId)
public AftersalesOrderVO selectAftersalesOrderById(Long aftersalesOrderId)
{
return aftersalesOrderMapper.selectAftersalesOrderById(aftersalesOrderId);
}
@ -76,9 +109,60 @@ public class AftersalesOrderServiceImpl implements IAftersalesOrderService
* @return 售后单
*/
@Override
public List<AftersalesOrder> selectAftersalesOrderList(AftersalesOrder aftersalesOrder)
public List<AftersalesOrderVO> selectAftersalesOrderList(AftersalesOrderVO aftersalesOrderVO)
{
return aftersalesOrderMapper.selectAftersalesOrderList(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;
}
/**
@ -191,4 +275,73 @@ 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/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectShippingDeviceByMakeNo" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}
and add_shipping_device_flag = '0'
</select>
<select id="selectShippingDeviceBySalesOrderCode" parameterType="String" resultMap="AfterSalesShippingDeviceResult">

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="AftersalesOrder" id="AftersalesOrderResult">
<resultMap type="AftersalesOrderVO" id="AftersalesOrderResult">
<result property="aftersalesOrderId" column="aftersales_order_id" />
<result property="aftersalesOrderCode" column="aftersales_order_code" />
<result property="salesOrderCode" column="sales_order_code" />
@ -33,6 +33,7 @@ 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" />
@ -46,7 +47,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="AftersalesOrder" resultMap="AftersalesOrderResult">
<select id="selectAftersalesOrderList" parameterType="AftersalesOrderVO" resultMap="AftersalesOrderResult">
<include refid="selectAftersalesOrderVo"/>
<where>
<if test="aftersalesOrderCode != null and aftersalesOrderCode != ''"> and aftersales_order_code = #{aftersalesOrderCode}</if>
@ -109,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where so.aftersales_order_id = #{aftersalesOrderId}
</select>
<insert id="insertAftersalesOrder" parameterType="AftersalesOrder" useGeneratedKeys="true" keyProperty="aftersalesOrderId">
<insert id="insertAftersalesOrder" parameterType="AftersalesOrderVO" useGeneratedKeys="true" keyProperty="aftersalesOrderId">
insert into aftersales_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="aftersalesOrderCode != null">aftersales_order_code,</if>
@ -183,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateAftersalesOrder" parameterType="AftersalesOrder">
<update id="updateAftersalesOrder" parameterType="AftersalesOrderVO">
update aftersales_order
<trim prefix="SET" suffixOverrides=",">
<if test="aftersalesOrderCode != null">aftersales_order_code = #{aftersalesOrderCode},</if>

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

@ -8,12 +8,6 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-add">
<div class="form-group">
<label class="col-sm-3 control-label">售后单号:</label>
<div class="col-sm-8">
<input name="aftersalesOrderCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
@ -32,24 +26,7 @@
<input name="userId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="auditStatus" value="">
<label th:for="auditStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后状态:</label>
<div class="col-sm-8">
<select name="aftersalesStatus" class="form-control m-b" th:with="type=${@dict.getType('sales_aftersales_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
@ -107,97 +84,12 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label>
<div class="col-sm-8">
<input name="deliveryName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryNumber" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">公司地址:</label>
<div class="col-sm-8">
<input name="companyAddress" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">服务内容:</label>
<div class="col-sm-8">
<input type="hidden" class="form-control" name="serviceContent">
<div class="summernote" id="serviceContent"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户评价:</label>
<div class="col-sm-8">
<input name="userCommentAttachment" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">流程实例ID:</label>
<div class="col-sm-8">
<input name="instanceId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">流程实例类型:</label>
<div class="col-sm-8">
<select name="instanceType" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">流程提交实例ID:</label>
<div class="col-sm-8">
<input name="submitInstanceId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请标题:</label>
<div class="col-sm-8">
<input name="applyTitle" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<input name="applyUser" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">流程作废实例ID:</label>
<div class="col-sm-8">
<input name="cancelInstanceId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">流程恢复实例ID:</label>
<div class="col-sm-8">
<input name="restoreInstanceId" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />

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

@ -47,21 +47,33 @@
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="aftersales:aftersalesOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:remove')}]];
var sendOrdersFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:sendOrders')}]];
var uploadReportFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:uploadReport')}]];
var detailFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:detail')}]];
var aftersalesStatusDatas = [[${@dict.getType('sales_aftersales_status')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var prefix = ctx + "aftersales/aftersalesOrder";
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$(function() {
var options = {
url: prefix + "/list",
@ -86,6 +98,73 @@
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',
@ -153,17 +232,50 @@
title: '上次更新时间',
field: 'updateTime',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
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> ');
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('');
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
//
// 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('');
// }
// }
{
title: '操作',
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('');
}
}
}]
]
};
$.table.init(options);
});

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

@ -9,6 +9,8 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-edit" th:object="${aftersalesOrder}">
<input name="aftersalesOrderId" th:field="*{aftersalesOrderId}" type="hidden">
<!--驳回调整允许更新内容-->
<input type="hidden" name="saveEntity" value="true" />
<div class="form-group">
<label class="col-sm-3 control-label">售后单号:</label>
<div class="col-sm-8">

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

@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('驳回调整')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-edit" th:object="${formData}">
<input name="aftersalesOrderId" th:field="*{aftersalesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">售后单号:</label>
<div class="col-sm-8">
<input name="aftersalesOrderCode" th:field="*{aftersalesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户ID:</label>
<div class="col-sm-8">
<input name="userId" th:field="*{userId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input name="businessName" th:field="*{businessName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后员:</label>
<div class="col-sm-8">
<input name="aftersalesName" th:field="*{aftersalesName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label>
<div class="col-sm-8">
<select id="reApply" name="p_B_reApply" class="form-control m-b">
<option value="true">重新申请</option>
<!-- <option value="false">结束流程</option>-->
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:inline="javascript">
var prefix = ctx + "aftersales/aftersalesOrder";
$("#form-aftersalesOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-aftersalesOrder-edit').serialize());
}
}
$("input[name='startDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
});
</script>
</body>
</html>

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

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('业务经理审核售后单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-ywjl" th:object="${formData}">
<input name="aftersalesOrderId" th:field="*{aftersalesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">售后单号:</label>
<div class="col-sm-8">
<input name="aftersalesOrderCode" th:field="*{aftersalesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户ID:</label>
<div class="col-sm-8">
<input name="userId" th:field="*{userId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input name="businessName" th:field="*{businessName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后员:</label>
<div class="col-sm-8">
<input name="aftersalesName" th:field="*{aftersalesName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="ywjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_ywjlVerifyApproved" id="ywjlVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "aftersales/aftersalesOrder";
$("#form-aftersalesOrder-ywjl").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-aftersalesOrder-ywjl').serialize());
}
}
$("input[name='startDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
});
</script>
</body>
</html>

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

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('业务经理审核售后单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-ywzg" th:object="${formData}">
<input name="aftersalesOrderId" th:field="*{aftersalesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">售后单号:</label>
<div class="col-sm-8">
<input name="aftersalesOrderCode" th:field="*{aftersalesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户ID:</label>
<div class="col-sm-8">
<input name="userId" th:field="*{userId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input name="businessName" th:field="*{businessName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">售后员:</label>
<div class="col-sm-8">
<input name="aftersalesName" th:field="*{aftersalesName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="ywzgVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_ywzgVerifyApproved" id="ywzgVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "aftersales/aftersalesOrder";
$("#form-aftersalesOrder-ywzg").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-aftersalesOrder-ywzg').serialize());
}
}
$("input[name='startDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
});
</script>
</body>
</html>
Loading…
Cancel
Save