Browse Source

[fix]

委外加工 委外领料
修改委外领料实体类 添加审批流程必需字段
修改前端页面 添加审批相关内容
修改mapper文件返回实体类字段,更新、插入记录的方法
修改委外领料列表查询方法 新增启动审批流程、发起人节点判断方法
修改后端接口 新增加载审批弹窗、审批任务完成的处理流程方法

[feat]
委外加工 委外领料
新增委外领料委外经理、委外主管审核页面
dev
王晓迪 4 months ago
parent
commit
aee8dfff0e
  1. 130
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java
  2. 102
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java
  3. 27
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java
  4. 23
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java
  5. 209
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java
  6. 55
      ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml
  7. 97
      ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html
  8. 108
      ruoyi-admin/src/main/resources/templates/system/outsource_requisition/taskWwjlVerify.html
  9. 108
      ruoyi-admin/src/main/resources/templates/system/outsource_requisition/taskWwzgVerify.html

130
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java

@ -1,10 +1,23 @@
package com.ruoyi.system.controller;
import java.util.HashMap;
import java.util.List;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.OutsourceOrder;
import com.ruoyi.system.domain.OutsourceRequisition;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO;
import com.ruoyi.system.service.IOutsourceOrderService;
import com.ruoyi.system.service.IOutsourceRequisitionService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.impl.OutsourceRequisitionServiceImpl;
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;
@ -18,6 +31,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 委外领料Controller
*
@ -33,6 +49,22 @@ public class OutsourceRequisitionController extends BaseController
@Autowired
private IOutsourceRequisitionService outsourceRequisitionService;
@Autowired
private IOutsourceOrderService outsourceOrderService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private IProcessService processService;
@RequiresPermissions("system:outsource_requisition:view")
@GetMapping()
public String outsource_requisition()
@ -46,10 +78,10 @@ public class OutsourceRequisitionController extends BaseController
@RequiresPermissions("system:outsource_requisition:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OutsourceRequisition outsourceRequisition)
public TableDataInfo list(OutsourceRequisitionVO outsourceRequisitionVO)
{
startPage();
List<OutsourceRequisition> list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisition);
List<OutsourceRequisitionVO> list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisitionVO);
return getDataTable(list);
}
@ -60,10 +92,10 @@ public class OutsourceRequisitionController extends BaseController
@Log(title = "委外领料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceRequisition outsourceRequisition)
public AjaxResult export(OutsourceRequisitionVO outsourceRequisitionVO)
{
List<OutsourceRequisition> list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisition);
ExcelUtil<OutsourceRequisition> util = new ExcelUtil<OutsourceRequisition>(OutsourceRequisition.class);
List<OutsourceRequisitionVO> list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisitionVO);
ExcelUtil<OutsourceRequisitionVO> util = new ExcelUtil<OutsourceRequisitionVO>(OutsourceRequisitionVO.class);
return util.exportExcel(list, "委外领料数据");
}
@ -83,12 +115,88 @@ public class OutsourceRequisitionController extends BaseController
@Log(title = "委外领料", businessType = BusinessType.INSERT)
@PostMapping("/addRequisition")
@ResponseBody
public AjaxResult addSave(@RequestBody OutsourceRequisition outsourceRequisition)
public AjaxResult addSave(@RequestBody OutsourceRequisitionVO outsourceRequisitionVO)
{
System.out.println(outsourceRequisition);
return toAjax(outsourceRequisitionService.insertOutsourceRequisition(outsourceRequisition));
outsourceRequisitionVO.setAuditStatus("0");
outsourceRequisitionService.submitApply(outsourceRequisitionVO);
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();
OutsourceRequisitionVO outsourceRequisitionVO = outsourceRequisitionService.selectOutsourceRequisitionByOutsourceRequisitionId(new Long(processInstance.getBusinessKey()));
System.out.println(outsourceRequisitionVO);
mmap.put("formData", outsourceRequisitionVO);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("preloadObj")
public OutsourceRequisitionVO getObj(@RequestParam(value = "outsourceRequisitionId", required = false) Long outsourceRequisitionId, HttpSession session) {
if (outsourceRequisitionId != null) {
return outsourceRequisitionService.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
}
return new OutsourceRequisitionVO();
}
/**
* 完成任务
*
* @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") OutsourceRequisitionVO outsourceRequisitionVO, HttpServletRequest request) {
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
//获取实例id
String instanceId = outsourceRequisitionVO.getInstanceId();
//获取实例类型
String instanceType = outsourceRequisitionVO.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId, outsourceRequisitionVO.getApplyTitle(), outsourceRequisitionVO.getOutsourceRequisitionNo(), "outsourceRequisition", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
outsourceRequisitionVO.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
outsourceRequisitionVO.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");
}
}
outsourceRequisitionService.updateOutsourceRequisition(outsourceRequisitionVO);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
outsourceRequisitionService.updateOutsourceRequisition(outsourceRequisitionVO);
}
return success("任务已完成");
}
/**
* 修改委外领料
@ -98,6 +206,8 @@ public class OutsourceRequisitionController extends BaseController
public String edit(@PathVariable("outsourceRequisitionId") Long outsourceRequisitionId, ModelMap mmap)
{
OutsourceRequisition outsourceRequisition = outsourceRequisitionService.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
List<OutsourceOrder> outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderNo(outsourceRequisition.getOutsourceOrderNo());
mmap.put("outsourceOrderList",outsourceOrder);
mmap.put("outsourceRequisition", outsourceRequisition);
return prefix + "/edit";
}
@ -109,9 +219,9 @@ public class OutsourceRequisitionController extends BaseController
@Log(title = "委外领料", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OutsourceRequisition outsourceRequisition)
public AjaxResult editSave(OutsourceRequisitionVO outsourceRequisitionVO)
{
return toAjax(outsourceRequisitionService.updateOutsourceRequisition(outsourceRequisition));
return toAjax(outsourceRequisitionService.updateOutsourceRequisition(outsourceRequisitionVO));
}
/**

102
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisition.java

@ -1,5 +1,6 @@
package com.ruoyi.system.domain;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -47,13 +48,30 @@ public class OutsourceRequisition extends BaseEntity
@Excel(name = "领料状态")
private String requisitionStatus;
public String getRequisitionStatus() {
return requisitionStatus;
}
/** 流程实例ID */
private String instanceId;
/** 流程实例类型 */
private String instanceType;
/** 流程提交实例ID */
private String submitInstanceId;
/** 申请标题 */
private String applyTitle;
/** 申请时间 */
private Date applyTime;
/** 申请人 */
private String applyUser;
/** 流程作废实例ID */
private String cancelInstanceId;
/** 流程恢复实例ID */
private String restoreInstanceId;
public void setRequisitionStatus(String requisitionStatus) {
this.requisitionStatus = requisitionStatus;
}
/** 委外领料详情信息 */
private List<OutsourceRequisitionDetail> outsourceRequisitionDetailList;
@ -123,6 +141,78 @@ public class OutsourceRequisition extends BaseEntity
this.outsourceRequisitionDetailList = outsourceRequisitionDetailList;
}
public String getInstanceId() {
return instanceId;
}
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
public String getInstanceType() {
return instanceType;
}
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
public String getSubmitInstanceId() {
return submitInstanceId;
}
public void setSubmitInstanceId(String submitInstanceId) {
this.submitInstanceId = submitInstanceId;
}
public String getApplyTitle() {
return applyTitle;
}
public void setApplyTitle(String applyTitle) {
this.applyTitle = applyTitle;
}
public Date getApplyTime() {
return applyTime;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public String getApplyUser() {
return applyUser;
}
public void setApplyUser(String applyUser) {
this.applyUser = applyUser;
}
public String getCancelInstanceId() {
return cancelInstanceId;
}
public void setCancelInstanceId(String cancelInstanceId) {
this.cancelInstanceId = cancelInstanceId;
}
public String getRestoreInstanceId() {
return restoreInstanceId;
}
public void setRestoreInstanceId(String restoreInstanceId) {
this.restoreInstanceId = restoreInstanceId;
}
public String getRequisitionStatus() {
return requisitionStatus;
}
public void setRequisitionStatus(String requisitionStatus) {
this.requisitionStatus = requisitionStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

27
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.OutsourceRequisition;
import com.ruoyi.system.domain.OutsourceRequisitionDetail;
import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO;
import java.util.List;
@ -20,31 +21,39 @@ public interface OutsourceRequisitionMapper
* @param outsourceRequisitionId 委外领料主键
* @return 委外领料
*/
public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId);
public OutsourceRequisitionVO selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId);
/**
* 查询委外领料列表
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 委外领料集合
*/
public List<OutsourceRequisition> selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition);
public List<OutsourceRequisitionVO> selectOutsourceRequisitionList(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 查询委外领料详情列表
*
* @param outsourceRequisitionNo 委外领料编号
* @return 委外领料详情集合
*/
public List<OutsourceRequisitionDetail> selectOutsourceRequisitionDetailList(String outsourceRequisitionNo);
/**
* 新增委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition);
public int insertOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 修改委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition);
public int updateOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 删除委外领料
@ -82,8 +91,8 @@ public interface OutsourceRequisitionMapper
/**
* 通过委外领料主键删除委外领料详情信息
*
* @param outsourceRequisitionId 委外领料ID
* @param outsourceRequisitionNo 委外领料ID
* @return 结果
*/
public int deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(Long outsourceRequisitionId);
public int deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(String outsourceRequisitionNo);
}

23
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceRequisitionService.java

@ -1,6 +1,9 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.OutsourceRequisition;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO;
import org.activiti.engine.runtime.ProcessInstance;
import java.util.List;
@ -19,31 +22,31 @@ public interface IOutsourceRequisitionService
* @param outsourceRequisitionId 委外领料主键
* @return 委外领料
*/
public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId);
public OutsourceRequisitionVO selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId);
/**
* 查询委外领料列表
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 委外领料集合
*/
public List<OutsourceRequisition> selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition);
public List<OutsourceRequisitionVO> selectOutsourceRequisitionList(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 新增委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition);
public int insertOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 修改委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition);
public int updateOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO);
/**
* 批量删除委外领料
@ -60,4 +63,10 @@ public interface IOutsourceRequisitionService
* @return 结果
*/
public int deleteOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId);
/**
* 审批流程启动
* */
ProcessInstance submitApply(OutsourceRequisitionVO outsourceRequisitionVO);
}

209
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceRequisitionServiceImpl.java

@ -1,17 +1,30 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.*;
import com.github.pagehelper.Page;
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.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.OutsourceRequisition;
import com.ruoyi.system.domain.OutsourceRequisitionDetail;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO;
import com.ruoyi.system.mapper.OutsourceRequisitionMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.IOutsourceRequisitionService;
import org.activiti.engine.RuntimeService;
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 java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
@ -32,6 +45,24 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer
@Autowired
private RedisCache redisCache;
@Autowired
private SysRoleServiceImpl roleService;
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private BizTodoItemMapper todoItemMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private IProcessService processService;
/**
* 查询委外领料
*
@ -39,60 +70,119 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer
* @return 委外领料
*/
@Override
public OutsourceRequisition selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId)
public OutsourceRequisitionVO selectOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId)
{
return outsourceRequisitionMapper.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
OutsourceRequisitionVO outsourceRequisitionVO = outsourceRequisitionMapper.selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
if(outsourceRequisitionMapper.selectOutsourceRequisitionDetailList(outsourceRequisitionVO.getOutsourceRequisitionNo())!=null){
List<OutsourceRequisitionDetail> details = outsourceRequisitionMapper.selectOutsourceRequisitionDetailList(outsourceRequisitionVO.getOutsourceRequisitionNo());
outsourceRequisitionVO.setOutsourceRequisitionDetailList(details);
}
return outsourceRequisitionVO;
}
/**
* 查询委外领料列表
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 委外领料
*/
@Override
public List<OutsourceRequisition> selectOutsourceRequisitionList(OutsourceRequisition outsourceRequisition)
public List<OutsourceRequisitionVO> selectOutsourceRequisitionList(OutsourceRequisitionVO outsourceRequisitionVO)
{
return outsourceRequisitionMapper.selectOutsourceRequisitionList(outsourceRequisition);
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
// PageHelper 仅对第一个 List 分页
Page<OutsourceRequisitionVO> list = (Page<OutsourceRequisitionVO>) outsourceRequisitionMapper.selectOutsourceRequisitionList(outsourceRequisitionVO);
Page<OutsourceRequisitionVO> returnList = new Page<>();
for (OutsourceRequisitionVO tempOutsourceRequisitionVO: list) {
SysUser sysUser = userMapper.selectUserByLoginName(tempOutsourceRequisitionVO.getCreateBy());
if (sysUser != null) {
tempOutsourceRequisitionVO.setCreateUserName(sysUser.getUserName());
}
SysUser sysUser2 = userMapper.selectUserByLoginName(tempOutsourceRequisitionVO.getApplyUser());
if (sysUser2 != null) {
tempOutsourceRequisitionVO.setApplyUserName(sysUser2.getUserName());
}
String instanceId = tempOutsourceRequisitionVO.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();
tempOutsourceRequisitionVO.setTaskId(taskId);
// 设置待办用户
List<String> todoUserList = todoItemMapper.selectUndealTodoUserList(taskId);
if(!org.springframework.util.CollectionUtils.isEmpty(taskList)){
tempOutsourceRequisitionVO.setTodoUserId(String.join(",",todoUserList));
}
if (task.getSuspensionState() == 2) {
tempOutsourceRequisitionVO.setTaskName("已挂起");
tempOutsourceRequisitionVO.setSuspendState("2");
} else {
tempOutsourceRequisitionVO.setTaskName(task.getName());
tempOutsourceRequisitionVO.setSuspendState("1");
}
} else {
// 已办结或者已撤销
tempOutsourceRequisitionVO.setTaskName("已结束");
}
} else {
tempOutsourceRequisitionVO.setTaskName("未启动");
}
returnList.add(tempOutsourceRequisitionVO);
}
returnList.setTotal(org.springframework.util.CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
returnList.setPageNum(pageNum);
returnList.setPageSize(pageSize);
return returnList;
}
/**
* 新增委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
@Transactional
@Override
public int insertOutsourceRequisition(OutsourceRequisition outsourceRequisition)
public int insertOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO)
{
String loginName = ShiroUtils.getLoginName();
outsourceRequisition.setCreateBy(loginName);
outsourceRequisition.setCreateTime(DateUtils.getNowDate());
outsourceRequisition.setAuditStatus("0");
outsourceRequisition.setRequisitionStatus("0");
outsourceRequisitionVO.setCreateBy(loginName);
outsourceRequisitionVO.setCreateTime(DateUtils.getNowDate());
outsourceRequisitionVO.setAuditStatus("0");
outsourceRequisitionVO.setRequisitionStatus("0");
String outsourceRequisitionNo = redisCache.generateBillNo("WWLL");
outsourceRequisition.setRequisitionPerson(loginName);
outsourceRequisition.setOutsourceRequisitionNo(outsourceRequisitionNo);
int rows = outsourceRequisitionMapper.insertOutsourceRequisition(outsourceRequisition);
insertOutsourceRequisitionDetail(outsourceRequisition);
outsourceRequisitionVO.setRequisitionPerson(loginName);
outsourceRequisitionVO.setOutsourceRequisitionNo(outsourceRequisitionNo);
int rows = outsourceRequisitionMapper.insertOutsourceRequisition(outsourceRequisitionVO);
insertOutsourceRequisitionDetail(outsourceRequisitionVO);
return rows;
}
/**
* 修改委外领料
*
* @param outsourceRequisition 委外领料
* @param outsourceRequisitionVO 委外领料
* @return 结果
*/
@Transactional
@Override
public int updateOutsourceRequisition(OutsourceRequisition outsourceRequisition)
public int updateOutsourceRequisition(OutsourceRequisitionVO outsourceRequisitionVO)
{
outsourceRequisition.setUpdateTime(DateUtils.getNowDate());
outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(outsourceRequisition.getOutsourceRequisitionId());
insertOutsourceRequisitionDetail(outsourceRequisition);
return outsourceRequisitionMapper.updateOutsourceRequisition(outsourceRequisition);
outsourceRequisitionVO.setUpdateTime(DateUtils.getNowDate());
String loginName = ShiroUtils.getLoginName();
outsourceRequisitionVO.setUpdateBy(loginName);
int rows = outsourceRequisitionMapper.updateOutsourceRequisition(outsourceRequisitionVO);
outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(outsourceRequisitionVO.getOutsourceRequisitionNo());
insertOutsourceRequisitionDetail(outsourceRequisitionVO);
return rows;
}
/**
@ -119,19 +209,82 @@ public class OutsourceRequisitionServiceImpl implements IOutsourceRequisitionSer
@Override
public int deleteOutsourceRequisitionByOutsourceRequisitionId(Long outsourceRequisitionId)
{
outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(outsourceRequisitionId);
OutsourceRequisitionVO requisitionVO = selectOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
outsourceRequisitionMapper.deleteOutsourceRequisitionDetailByOutsourceRequisitionNo(requisitionVO.getOutsourceRequisitionNo());
return outsourceRequisitionMapper.deleteOutsourceRequisitionByOutsourceRequisitionId(outsourceRequisitionId);
}
@Override
public ProcessInstance submitApply(OutsourceRequisitionVO outsourceRequisitionVO) {
SysUser user = ShiroUtils.getSysUser();
outsourceRequisitionVO.setApplyUser(user.getLoginName());
outsourceRequisitionVO.setApplyTime(DateUtils.getNowDate());
// 保存
insertOutsourceRequisition(outsourceRequisitionVO);
// 启动流程
String applyTitle = user.getUserName()+"发起了委外报价提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,outsourceRequisitionVO, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
outsourceRequisitionVO.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
outsourceRequisitionVO.setAuditStatus("1");
}
outsourceRequisitionMapper.updateOutsourceRequisition(outsourceRequisitionVO);
return processInstance;
}
/**
* 创建委外领料审核流程
* @param applyTitle
* @param instanceType
* @param user
* @return
*/
private ProcessInstance startProcessInstance(String applyTitle, String instanceType, OutsourceRequisitionVO outsourceRequisitionVO, SysUser user) {
Long outsourceRequisitionId = outsourceRequisitionVO.getOutsourceRequisitionId();
String businessKey = outsourceRequisitionId.toString(); // 实体类 ID,作为流程的业务 key
String key = "outsourceRequisition";
Map<String,Object> variables = new HashMap<>();
// 构造authority传参
buildAuthority(user, variables);
outsourceRequisitionVO.setApplyTitle(applyTitle);
// 启动流程
ProcessInstance processInstance = processService.submitApply(user.getLoginName(), businessKey, applyTitle, outsourceRequisitionVO.getOutsourceRequisitionNo(), key, variables);
String processInstanceId = processInstance.getId();
outsourceRequisitionVO.setInstanceId(processInstanceId); // 建立双向关系
outsourceRequisitionVO.setInstanceType(instanceType);
return processInstance;
}
/**
* 发起人节点判断
* */
private void buildAuthority(SysUser user, Map<String, Object> variables) {
Set<String> roleKeys = roleService.selectRoleKeys(user.getUserId());
// 角色不同审核人不同
if(roleKeys.contains("wwyRole")){
variables.put("authority",1);
}else if(roleKeys.contains("wwjlRole")){
variables.put("authority",2);
}else if(roleKeys.contains("wwzgRole")){
variables.put("authority",3);
}
}
/**
* 新增委外领料详情信息
*
* @param outsourceRequisition 委外领料对象
* @param outsourceRequisitionVO 委外领料对象
*/
public void insertOutsourceRequisitionDetail(OutsourceRequisition outsourceRequisition)
public void insertOutsourceRequisitionDetail(OutsourceRequisitionVO outsourceRequisitionVO)
{
List<OutsourceRequisitionDetail> outsourceRequisitionDetailList = outsourceRequisition.getOutsourceRequisitionDetailList();
String outsourceRequisitionNo = outsourceRequisition.getOutsourceRequisitionNo();
List<OutsourceRequisitionDetail> outsourceRequisitionDetailList = outsourceRequisitionVO.getOutsourceRequisitionDetailList();
String outsourceRequisitionNo = outsourceRequisitionVO.getOutsourceRequisitionNo();
if (StringUtils.isNotNull(outsourceRequisitionDetailList))
{
List<OutsourceRequisitionDetail> list = new ArrayList<OutsourceRequisitionDetail>();

55
ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.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.system.mapper.OutsourceRequisitionMapper">
<resultMap type="OutsourceRequisition" id="OutsourceRequisitionResult">
<resultMap type="OutsourceRequisitionVO" id="OutsourceRequisitionResult">
<result property="outsourceRequisitionId" column="outsource_requisition_id" />
<result property="outsourceRequisitionNo" column="outsource_requisition_no" />
<result property="outsourceOrderNo" column="outsource_order_no" />
@ -17,9 +17,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="totalAmount" column="total_amount" />
<result property="auditStatus" column="audit_status" />
<result property="requisitionStatus" column="requisition_status" />
<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" />
<result property="applyUser" column="apply_user" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
</resultMap>
<resultMap id="OutsourceRequisitionOutsourceRequisitionDetailResult" type="OutsourceRequisition" extends="OutsourceRequisitionResult">
<resultMap id="OutsourceRequisitionOutsourceRequisitionDetailResult" type="OutsourceRequisitionVO" extends="OutsourceRequisitionResult">
<collection property="outsourceRequisitionDetailList" ofType="OutsourceRequisitionDetail" column="outsource_requisition_id" select="selectOutsourceRequisitionDetailList" />
</resultMap>
@ -32,10 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOutsourceRequisitionVo">
select outsource_requisition_id, outsource_requisition_no, outsource_order_no, requisition_person, create_by, create_time, update_by, update_time, material_amount, total_amount, audit_status,requisition_status from outsource_requisition
select outsource_requisition_id, outsource_requisition_no, outsource_order_no, requisition_person, create_by, create_time, update_by, update_time, material_amount, total_amount, audit_status,requisition_status,instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from outsource_requisition
</sql>
<select id="selectOutsourceRequisitionList" parameterType="OutsourceRequisition" resultMap="OutsourceRequisitionResult">
<select id="selectOutsourceRequisitionList" parameterType="OutsourceRequisitionVO" resultMap="OutsourceRequisitionResult">
<include refid="selectOutsourceRequisitionVo"/>
<where>
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''"> and outsource_requisition_no = #{outsourceRequisitionNo}</if>
@ -46,18 +56,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectOutsourceRequisitionByOutsourceRequisitionId" parameterType="Long" resultMap="OutsourceRequisitionOutsourceRequisitionDetailResult">
select outsource_requisition_id, outsource_requisition_no, outsource_order_no, requisition_person, create_by, create_time, update_by, update_time, material_amount, total_amount, audit_status,requisition_status
from outsource_requisition
<include refid="selectOutsourceRequisitionVo"/>
where outsource_requisition_id = #{outsourceRequisitionId}
</select>
<select id="selectOutsourceRequisitionDetailList" resultType="OutsourceRequisitionDetail" resultMap="OutsourceRequisitionDetailResult">
<select id="selectOutsourceRequisitionDetailList" parameterType="String" resultMap="OutsourceRequisitionDetailResult">
select outsource_requisition_detail_id, outsource_requisition_no, material_no, taken_material, taking_material
from outsource_requisition_detail
where outsource_requisition_no = #{outsource_requisition_no}
</select>
<insert id="insertOutsourceRequisition" parameterType="OutsourceRequisition" useGeneratedKeys="true" keyProperty="outsourceRequisitionId">
<insert id="insertOutsourceRequisition" parameterType="OutsourceRequisitionVO" useGeneratedKeys="true" keyProperty="outsourceRequisitionId">
insert into outsource_requisition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''">outsource_requisition_no,</if>
@ -71,6 +80,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalAmount != null">total_amount,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="requisitionStatus != null">requisition_status,</if>
<if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if>
<if test="applyTitle != null">apply_title,</if>
<if test="applyTime != null">apply_time,</if>
<if test="applyUser != null">apply_user,</if>
<if test="cancelInstanceId != null">cancel_instance_id,</if>
<if test="restoreInstanceId != null">restore_instance_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''">#{outsourceRequisitionNo},</if>
@ -84,10 +101,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="totalAmount != null">#{totalAmount},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="requisitionStatus != null">#{requisitionStatus},</if>
<if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="applyUser != null">#{applyUser},</if>
<if test="cancelInstanceId != null">#{cancelInstanceId},</if>
<if test="restoreInstanceId != null">#{restoreInstanceId},</if>
</trim>
</insert>
<update id="updateOutsourceRequisition" parameterType="OutsourceRequisition">
<update id="updateOutsourceRequisition" parameterType="OutsourceRequisitionVO">
update outsource_requisition
<trim prefix="SET" suffixOverrides=",">
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''">outsource_requisition_no = #{outsourceRequisitionNo},</if>
@ -100,7 +125,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="requisitionStatus != null">requsition_status = #{requisitionStatus},</if>
<if test="requisitionStatus != null">requisition_status = #{requisitionStatus},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if>
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if>
</trim>
where outsource_requisition_id = #{outsourceRequisitionId}
</update>
@ -123,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deleteOutsourceRequisitionDetailByOutsourceRequisitionNo" parameterType="Long">
<delete id="deleteOutsourceRequisitionDetailByOutsourceRequisitionNo" parameterType="String">
delete from outsource_requisition_detail where outsource_requisition_no = #{outsourceRequisitionNo}
</delete>

97
ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html

@ -46,12 +46,15 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:outsource_requisition:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:outsource_requisition:remove')}]];
var detailFlag = [[${@permission.hasPermi('system:outsource_requisition:detail')}]];
var prefix = ctx + "system/outsource_requisition";
var auditStatusDatas = [[${@dict.getType('audit_status')}]];
var requisitionStatusDatas = [[${@dict.getType('requisition_status')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var requisitionStatusDatas = [[${@dict.getType('requisitionStatus')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
$(function() {
@ -59,6 +62,7 @@
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "委外领料",
@ -78,7 +82,65 @@
formatter: function(value, row, index) {
return $.table.selectDictLabel(requisitionStatusDatas, value);
}
},
}, {
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>';
}
},
{
field: 'outsourceRequisitionId',
title: '委外领料id',
@ -121,8 +183,33 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceRequisitionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.outsourceRequisitionId + '\')"><i class="fa fa-detail"></i>详情</a>');
// 审核状态-审核通过
// 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.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>派单</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + uploadReportFlag + '" href="javascript:void(0)" onclick="uploadReport(\'' + row.outsourceQuoteId + '\')"><i class="fa fa-edit"></i>上传报告</a> ');
// }
// 审核状态-审核拒绝
if(row.auditStatus=="2"){
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceRequisitionId + '\')"><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-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.outsourceRequisitionId + '\')"><i class="fa fa-detail"></i>详情</a>');
return actions.join('');
}
}]

108
ruoyi-admin/src/main/resources/templates/system/outsource_requisition/taskWwjlVerify.html

@ -0,0 +1,108 @@
<!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-outsourceQuote-wwjl" th:object="${formData}">
<input name="outsourceRequisitionId" th:field="*{outsourceRequisitionId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" 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="outsourceRequisitionNo" th:field="*{outsourceRequisitionNo}" class="form-control" type="text" readonly>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">供应商编号:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">供应商名称:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">工序合计:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="processAmount" th:field="*{processAmount}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">税率:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">定价日期:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">备注:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="wwjlVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_wwjlVerifyApproved" id="wwjlVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
</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 + "system/outsource_requisition";
$("#form-outsourceQuote-wwjl").validate({
focusCleanup: true
});
var childData = [[${formData}]];
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-outsourceQuote-wwjl').serialize());
}
}
$(function() {
console.log(childData);
});
</script>
</body>
</html>

108
ruoyi-admin/src/main/resources/templates/system/outsource_requisition/taskWwzgVerify.html

@ -0,0 +1,108 @@
<!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-outsourceQuote-wwzg" th:object="${formData}">
<input name="outsourceRequisitionId" th:field="*{outsourceRequisitionId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" 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="outsourceRequisitionNo" th:field="*{outsourceRequisitionNo}" class="form-control" type="text" readonly>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">供应商编号:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">供应商名称:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">工序合计:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="processAmount" th:field="*{processAmount}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">税率:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">定价日期:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">备注:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label is-required" for="wwzgVerifyApproved">审批意见:</label>
<div class="col-sm-6">
<select name="p_B_wwzgVerifyApproved" id="wwzgVerifyApproved" class="form-control" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">批注:</label>
<div class="col-sm-6">
<textarea name="comment" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
</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 + "system/outsource_requisition";
$("#form-outsourceQuote-wwzg").validate({
focusCleanup: true
});
var childData = [[${formData}]];
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-outsourceQuote-wwzg').serialize());
}
}
$(function() {
console.log(childData);
});
</script>
</body>
</html>
Loading…
Cancel
Save