Browse Source

[update]:生产订单-创建领料单、领料单详情

dev
youjianchi 5 months ago
parent
commit
5f581d87f6
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 151
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderPickDetailController.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPick.java
  4. 125
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickVo.java
  6. 77
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderPickDetailMapper.java
  7. 75
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderPickDetailService.java
  8. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderPickDetailServiceImpl.java
  9. 33
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderPickServiceImpl.java
  10. 109
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickDetailMapper.xml
  11. 45
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickMapper.xml
  12. 355
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html
  13. 12
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html
  14. 14
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmzgqr.html
  15. 14
      ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html
  16. 4
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html
  17. 300
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html
  18. 10
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/makeorderpick.html

12
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -90,6 +90,18 @@ public class SysMakeOrderController extends BaseController
return prefix + "/gcsh";
}
/**
* 跳转添加领料页面
*/
@GetMapping("/addpick/{id}")
public String addPick(@PathVariable("id") Long id, ModelMap mmap)
{
mmap.put("currentUser", ShiroUtils.getSysUser());
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/addPick";
}
/**
* 部门评审

151
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderPickDetailController.java

@ -0,0 +1,151 @@
package com.ruoyi.system.controller;
import java.util.List;
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 com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
import com.ruoyi.system.service.ISysMakeorderPickDetailService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 生产订单领料明细Controller
*
* @author ruoyi
* @date 2024-04-13
*/
@Controller
@RequestMapping("/system/detail")
public class SysMakeorderPickDetailController extends BaseController
{
private String prefix = "system/detail";
@Autowired
private ISysMakeorderPickDetailService sysMakeorderPickDetailService;
@RequiresPermissions("system:detail:view")
@GetMapping()
public String detail()
{
return prefix + "/detail";
}
/**
* 查询生产订单领料明细列表
*/
@RequiresPermissions("system:detail:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysMakeorderPickDetail sysMakeorderPickDetail)
{
startPage();
List<SysMakeorderPickDetail> list = sysMakeorderPickDetailService.selectSysMakeorderPickDetailList(sysMakeorderPickDetail);
return getDataTable(list);
}
/**
* 导出生产订单领料明细列表
*/
@RequiresPermissions("system:detail:export")
@Log(title = "生产订单领料明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysMakeorderPickDetail sysMakeorderPickDetail)
{
List<SysMakeorderPickDetail> list = sysMakeorderPickDetailService.selectSysMakeorderPickDetailList(sysMakeorderPickDetail);
ExcelUtil<SysMakeorderPickDetail> util = new ExcelUtil<SysMakeorderPickDetail>(SysMakeorderPickDetail.class);
return util.exportExcel(list, "生产订单领料明细数据");
}
/**
* 新增生产订单领料明细
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存生产订单领料明细
*/
@RequiresPermissions("system:detail:add")
@Log(title = "生产订单领料明细", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysMakeorderPickDetail sysMakeorderPickDetail)
{
return toAjax(sysMakeorderPickDetailService.insertSysMakeorderPickDetail(sysMakeorderPickDetail));
}
/**
* 修改生产订单领料明细
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysMakeorderPickDetail sysMakeorderPickDetail = sysMakeorderPickDetailService.selectSysMakeorderPickDetailById(id);
mmap.put("sysMakeorderPickDetail", sysMakeorderPickDetail);
return prefix + "/edit";
}
/**
* 修改保存生产订单领料明细
*/
@RequiresPermissions("system:detail:edit")
@Log(title = "生产订单领料明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysMakeorderPickDetail sysMakeorderPickDetail)
{
return toAjax(sysMakeorderPickDetailService.updateSysMakeorderPickDetail(sysMakeorderPickDetail));
}
/**
* 删除生产订单领料明细
*/
@RequiresPermissions("system:detail:remove")
@Log(title = "生产订单领料明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysMakeorderPickDetailService.deleteSysMakeorderPickDetailByIds(ids));
}
/**
* 作废生产订单领料明细
*/
@RequiresPermissions("system:detail:cancel")
@Log(title = "生产订单领料明细", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(sysMakeorderPickDetailService.cancelSysMakeorderPickDetailById(id));
}
/**
* 恢复生产订单领料明细
*/
@RequiresPermissions("system:detail:restore")
@Log(title = "生产订单领料明细", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(sysMakeorderPickDetailService.restoreSysMakeorderPickDetailById(id));
}
}

12
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPick.java

@ -1,6 +1,8 @@
package com.ruoyi.system.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -80,6 +82,8 @@ public class SysMakeorderPick extends BaseEntity
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
private List<SysMakeorderPickDetail> pickDetails;
public void setId(Long id)
{
this.id = id;
@ -225,6 +229,14 @@ public class SysMakeorderPick extends BaseEntity
return applyTime;
}
public List<SysMakeorderPickDetail> getPickDetails() {
return pickDetails;
}
public void setPickDetails(List<SysMakeorderPickDetail> pickDetails) {
this.pickDetails = pickDetails;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

125
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java

@ -0,0 +1,125 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 生产订单领料明细对象 sys_makeorder_pick_detail
*
* @author ruoyi
* @date 2024-04-13
*/
public class SysMakeorderPickDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 生产订单号 */
@Excel(name = "生产订单号")
private String makeNo;
/** 生产领料单号 */
@Excel(name = "生产领料单号")
private String pickNo;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** bomid */
@Excel(name = "bomid")
private Long bomId;
/** 领料数量 */
@Excel(name = "领料数量")
private Long pickNum;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public void setMakeNo(String makeNo)
{
this.makeNo = makeNo;
}
public String getMakeNo()
{
return makeNo;
}
public void setPickNo(String pickNo)
{
this.pickNo = pickNo;
}
public String getPickNo()
{
return pickNo;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setBomId(Long bomId)
{
this.bomId = bomId;
}
public Long getBomId()
{
return bomId;
}
public void setPickNum(Long pickNum)
{
this.pickNum = pickNum;
}
public Long getPickNum()
{
return pickNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("makeNo", getMakeNo())
.append("pickNo", getPickNo())
.append("materialNo", getMaterialNo())
.append("bomId", getBomId())
.append("pickNum", getPickNum())
.toString();
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickVo.java

@ -32,6 +32,11 @@ public class SysMakeorderPickVo extends SysMakeorderPick {
/** 流程实例类型名称 */
private String instanceTypeName;
/*物料合计*/
private Double materialSum;
/*数量合计*/
private Double enterpriseSum;
/**
* 关键词
*/

77
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderPickDetailMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
/**
* 生产订单领料明细Mapper接口
*
* @author ruoyi
* @date 2024-04-13
*/
public interface SysMakeorderPickDetailMapper
{
/**
* 查询生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 生产订单领料明细
*/
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id);
/**
* 查询生产订单领料明细列表
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 生产订单领料明细集合
*/
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 新增生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 修改生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 删除生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 结果
*/
public int deleteSysMakeorderPickDetailById(Long id);
/**
* 批量删除生产订单领料明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysMakeorderPickDetailByIds(String[] ids);
/**
* 作废生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 结果
*/
public int cancelSysMakeorderPickDetailById(Long id);
/**
* 恢复生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 结果
*/
public int restoreSysMakeorderPickDetailById(Long id);
}

75
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderPickDetailService.java

@ -0,0 +1,75 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
/**
* 生产订单领料明细Service接口
*
* @author ruoyi
* @date 2024-04-13
*/
public interface ISysMakeorderPickDetailService
{
/**
* 查询生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 生产订单领料明细
*/
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id);
/**
* 查询生产订单领料明细列表
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 生产订单领料明细集合
*/
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 新增生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 修改生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail);
/**
* 批量删除生产订单领料明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysMakeorderPickDetailByIds(String ids);
/**
* 删除生产订单领料明细信息
*
* @param id 生产订单领料明细ID
* @return 结果
*/
public int deleteSysMakeorderPickDetailById(Long id);
/**
* 作废生产订单领料明细
* @param id 生产订单领料明细ID
* @return
*/
int cancelSysMakeorderPickDetailById(Long id);
/**
* 恢复生产订单领料明细
* @param id 生产订单领料明细ID
* @return
*/
int restoreSysMakeorderPickDetailById(Long id);
}

126
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderPickDetailServiceImpl.java

@ -0,0 +1,126 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
import com.ruoyi.system.service.ISysMakeorderPickDetailService;
import com.ruoyi.common.core.text.Convert;
/**
* 生产订单领料明细Service业务层处理
*
* @author ruoyi
* @date 2024-04-13
*/
@Service
public class SysMakeorderPickDetailServiceImpl implements ISysMakeorderPickDetailService
{
@Autowired
private SysMakeorderPickDetailMapper sysMakeorderPickDetailMapper;
/**
* 查询生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 生产订单领料明细
*/
@Override
public SysMakeorderPickDetail selectSysMakeorderPickDetailById(Long id)
{
return sysMakeorderPickDetailMapper.selectSysMakeorderPickDetailById(id);
}
/**
* 查询生产订单领料明细列表
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 生产订单领料明细
*/
@Override
public List<SysMakeorderPickDetail> selectSysMakeorderPickDetailList(SysMakeorderPickDetail sysMakeorderPickDetail)
{
return sysMakeorderPickDetailMapper.selectSysMakeorderPickDetailList(sysMakeorderPickDetail);
}
/**
* 新增生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
@Override
public int insertSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail)
{
String loginName = ShiroUtils.getLoginName();
sysMakeorderPickDetail.setCreateBy(loginName);
sysMakeorderPickDetail.setCreateTime(DateUtils.getNowDate());
return sysMakeorderPickDetailMapper.insertSysMakeorderPickDetail(sysMakeorderPickDetail);
}
/**
* 修改生产订单领料明细
*
* @param sysMakeorderPickDetail 生产订单领料明细
* @return 结果
*/
@Override
public int updateSysMakeorderPickDetail(SysMakeorderPickDetail sysMakeorderPickDetail)
{
String loginName = ShiroUtils.getLoginName();
sysMakeorderPickDetail.setUpdateBy(loginName);
sysMakeorderPickDetail.setUpdateTime(DateUtils.getNowDate());
return sysMakeorderPickDetailMapper.updateSysMakeorderPickDetail(sysMakeorderPickDetail);
}
/**
* 删除生产订单领料明细对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysMakeorderPickDetailByIds(String ids)
{
return sysMakeorderPickDetailMapper.deleteSysMakeorderPickDetailByIds(Convert.toStrArray(ids));
}
/**
* 删除生产订单领料明细信息
*
* @param id 生产订单领料明细ID
* @return 结果
*/
@Override
public int deleteSysMakeorderPickDetailById(Long id)
{
return sysMakeorderPickDetailMapper.deleteSysMakeorderPickDetailById(id);
}
/**
* 作废生产订单领料明细
*
* @param id 生产订单领料明细ID
* @return 结果
*/
@Override
public int cancelSysMakeorderPickDetailById(Long id)
{
return sysMakeorderPickDetailMapper.cancelSysMakeorderPickDetailById(id);
}
/**
* 恢复生产订单领料明细信息
*
* @param id 生产订单领料明细ID
* @return 结果
*/
@Override
public int restoreSysMakeorderPickDetailById(Long id)
{
return sysMakeorderPickDetailMapper.restoreSysMakeorderPickDetailById(id);
}
}

33
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderPickServiceImpl.java

@ -12,9 +12,11 @@ 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.SysMakeorderPick;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.mapper.SysMakeorderPickMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysMakeorderPickDetailService;
import com.ruoyi.system.service.ISysMakeorderPickService;
import com.ruoyi.system.service.ISysRoleService;
import org.activiti.engine.TaskService;
@ -23,6 +25,7 @@ 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 org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
@ -41,6 +44,9 @@ public class SysMakeorderPickServiceImpl implements ISysMakeorderPickService
@Autowired
private SysMakeorderPickMapper sysMakeorderPickMapper;
@Autowired
private ISysMakeorderPickDetailService makeorderPickDetailService;
@Autowired
private RedisCache redisCache;
@ -69,10 +75,16 @@ public class SysMakeorderPickServiceImpl implements ISysMakeorderPickService
public SysMakeorderPickVo selectSysMakeorderPickById(Long id)
{
SysMakeorderPickVo makeorderPickVo = sysMakeorderPickMapper.selectSysMakeorderPickById(id);
SysUser pickUser = userMapper.selectUserByLoginName(makeorderPickVo.getPickUser());
makeorderPickVo.setPickUserName(pickUser.getUserName());
SysUser applyUser = userMapper.selectUserByLoginName(makeorderPickVo.getApplyUser());
makeorderPickVo.setApplyUserName(applyUser.getUserName());
if(makeorderPickVo!=null){
SysUser pickUser = userMapper.selectUserByLoginName(makeorderPickVo.getPickUser());
if(pickUser!=null){
makeorderPickVo.setPickUserName(pickUser.getUserName());
}
SysUser applyUser = userMapper.selectUserByLoginName(makeorderPickVo.getApplyUser());
if(applyUser!=null){
makeorderPickVo.setApplyUserName(applyUser.getUserName());
}
}
return makeorderPickVo;
}
@ -146,8 +158,11 @@ public class SysMakeorderPickServiceImpl implements ISysMakeorderPickService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertSysMakeorderPick(SysMakeorderPick sysMakeorderPick)
{
String makeNo = sysMakeorderPick.getMakeNo();
List<SysMakeorderPickDetail> pickDetails = sysMakeorderPick.getPickDetails();
String loginName = ShiroUtils.getLoginName();
sysMakeorderPick.setCreateBy(loginName);
sysMakeorderPick.setCreateTime(DateUtils.getNowDate());
@ -155,7 +170,13 @@ public class SysMakeorderPickServiceImpl implements ISysMakeorderPickService
String billNo = redisCache.generateBillNo("SCLL");
sysMakeorderPick.setPickNo(billNo);
int id = sysMakeorderPickMapper.insertSysMakeorderPick(sysMakeorderPick);
// yjc todo 子表插入领料数量
// 插入子表
for (int i = 0; i < pickDetails.size(); i++) {
SysMakeorderPickDetail pickDetail = pickDetails.get(i);
pickDetail.setPickNo(billNo);
pickDetail.setMakeNo(makeNo);
makeorderPickDetailService.insertSysMakeorderPickDetail(pickDetail);
}
return id;
}
@ -227,7 +248,7 @@ public class SysMakeorderPickServiceImpl implements ISysMakeorderPickService
SysUser user = ShiroUtils.getSysUser();
makeorderPick.setApplyUser(user.getLoginName());
makeorderPick.setApplyTime(DateUtils.getNowDate());
//获取插入的Bom列表的id
// 保存
insertSysMakeorderPick(makeorderPick);
// 启动流程
String applyTitle = user.getUserName()+"发起了生产领料单提交审批-"+DateUtils.dateTimeNow();

109
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickDetailMapper.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysMakeorderPickDetailMapper">
<resultMap type="SysMakeorderPickDetail" id="SysMakeorderPickDetailResult">
<result property="id" column="id" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="makeNo" column="make_no" />
<result property="pickNo" column="pick_no" />
<result property="materialNo" column="material_no" />
<result property="bomId" column="bom_id" />
<result property="pickNum" column="pick_num" />
</resultMap>
<sql id="selectSysMakeorderPickDetailVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, pick_no, material_no, bom_id, pick_num from sys_makeorder_pick_detail
</sql>
<select id="selectSysMakeorderPickDetailList" parameterType="SysMakeorderPickDetail" resultMap="SysMakeorderPickDetailResult">
<include refid="selectSysMakeorderPickDetailVo"/>
<where>
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if>
<if test="pickNo != null and pickNo != ''"> and pick_no = #{pickNo}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="bomId != null "> and bom_id = #{bomId}</if>
<if test="pickNum != null "> and pick_num = #{pickNum}</if>
</where>
</select>
<select id="selectSysMakeorderPickDetailById" parameterType="Long" resultMap="SysMakeorderPickDetailResult">
<include refid="selectSysMakeorderPickDetailVo"/>
where id = #{id}
</select>
<insert id="insertSysMakeorderPickDetail" parameterType="SysMakeorderPickDetail" useGeneratedKeys="true" keyProperty="id">
insert into sys_makeorder_pick_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="makeNo != null">make_no,</if>
<if test="pickNo != null">pick_no,</if>
<if test="materialNo != null">material_no,</if>
<if test="bomId != null">bom_id,</if>
<if test="pickNum != null">pick_num,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="makeNo != null">#{makeNo},</if>
<if test="pickNo != null">#{pickNo},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="bomId != null">#{bomId},</if>
<if test="pickNum != null">#{pickNum},</if>
</trim>
</insert>
<update id="updateSysMakeorderPickDetail" parameterType="SysMakeorderPickDetail">
update sys_makeorder_pick_detail
<trim prefix="SET" suffixOverrides=",">
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="makeNo != null">make_no = #{makeNo},</if>
<if test="pickNo != null">pick_no = #{pickNo},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="bomId != null">bom_id = #{bomId},</if>
<if test="pickNum != null">pick_num = #{pickNum},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysMakeorderPickDetailById" parameterType="Long">
delete from sys_makeorder_pick_detail where id = #{id}
</delete>
<delete id="deleteSysMakeorderPickDetailByIds" parameterType="String">
delete from sys_makeorder_pick_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="cancelSysMakeorderPickDetailById" parameterType="Long">
update sys_makeorder_pick_detail set del_flag = '1' where id = #{id}
</update>
<update id="restoreSysMakeorderPickDetailById" parameterType="Long">
update sys_makeorder_pick_detail set del_flag = '0' where id = #{id}
</update>
</mapper>

45
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickMapper.xml

@ -27,41 +27,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
<result property="materialSum" column="material_sum" />
<result property="enterpriseSum" column="enterprise_sum" />
</resultMap>
<sql id="selectSysMakeorderPickVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, sale_no, pick_no, pick_status, pick_user, audit_status, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from sys_makeorder_pick
select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark
, a.make_no, a.sale_no, a.pick_no, a.pick_status, a.pick_user, a.audit_status
, a.instance_id, a.instance_type, a.submit_instance_id, a.cancel_instance_id, a.restore_instance_id, a.apply_title, a.apply_user, a.apply_time
,b.material_sum
,b.enterprise_sum
from sys_makeorder_pick a
left join sys_sales_order b
on a.sale_no = b.sales_order_code
</sql>
<select id="selectSysMakeorderPickList" parameterType="SysMakeorderPick" resultMap="SysMakeorderPickResult">
<include refid="selectSysMakeorderPickVo"/>
<where>
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if>
<if test="saleNo != null and saleNo != ''"> and sale_no = #{saleNo}</if>
<if test="pickNo != null and pickNo != ''"> and pick_no = #{pickNo}</if>
<if test="pickStatus != null and pickStatus != ''"> and pick_status = #{pickStatus}</if>
<if test="pickUser != null and pickUser != ''"> and pick_user = #{pickUser}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="instanceId != null and instanceId != ''"> and instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="makeNo != null and makeNo != ''"> and a.make_no = #{makeNo}</if>
<if test="saleNo != null and saleNo != ''"> and a.sale_no = #{saleNo}</if>
<if test="pickNo != null and pickNo != ''"> and a.pick_no = #{pickNo}</if>
<if test="pickStatus != null and pickStatus != ''"> and a.pick_status = #{pickStatus}</if>
<if test="pickUser != null and pickUser != ''"> and a.pick_user = #{pickUser}</if>
<if test="auditStatus != null and auditStatus != ''"> and a.audit_status = #{auditStatus}</if>
<if test="instanceId != null and instanceId != ''"> and a.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and a.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and a.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and a.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and a.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and a.apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and a.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and a.apply_time = #{applyTime}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND date_format(a.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND date_format(a.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectSysMakeorderPickById" parameterType="Long" resultMap="SysMakeorderPickResult">
<include refid="selectSysMakeorderPickVo"/>
where id = #{id}
where a.id = #{id}
</select>
<insert id="insertSysMakeorderPick" parameterType="SysMakeorderPick" useGeneratedKeys="true" keyProperty="id">

355
ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html

@ -0,0 +1,355 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-makeorder-edit" th:object="${sysMakeOrder}">
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" 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 readonly id="saleNo" name="saleNo" th:field="*{saleNo}" 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 readonly name="Salesman" th:field="*{Salesman}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单类型:</label>
<div class="col-sm-8">
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required>
<option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/makeorder";
var curUser = [[${currentUser}]];
var curUsrDeptNumber = curUser.dept.deptNumber;
// 字典
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
// var subTableFormArray = [];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialCode',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'deliveryTime',
align: 'center',
title: '客户期望交付时间'
},
{
field: 'materialNum',
align: 'center',
title: '订单数量'
}
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].bomId" value="'+row.id+'">';
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
}
},
{
field: 'parentId',
title: '父级id',
visible: false,
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
return curParams;
}
$("#form-makeorder-edit").validate({
focusCleanup: true
});
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(data);
$.operate.save(ctx + "system/makeorderpick/add", data);
}
</script>
</body>
</html>

12
ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html

@ -330,7 +330,7 @@
field : 'id',
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
}
},
@ -339,7 +339,7 @@
title : '生产订单号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
}
},
@ -348,7 +348,7 @@
title : '料号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
}
},
@ -379,7 +379,7 @@
/*if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}*/
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
@ -387,7 +387,7 @@
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
@ -434,7 +434,7 @@
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length; i++) {
var curIndex = parentRowIndex*5+i;
var curIndex = parentRowIndex*6+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;

14
ruoyi-admin/src/main/resources/templates/system/makeorder/bmzgqr.html

@ -334,7 +334,7 @@
field : 'id',
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
}
},
@ -343,7 +343,7 @@
title : '生产订单号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
}
},
@ -352,7 +352,7 @@
title : '料号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
}
},
@ -383,7 +383,7 @@
/*if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}*/
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
@ -391,7 +391,7 @@
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
@ -411,7 +411,7 @@
field : 'deptLeaderConfirmStatus',
title : '部门主管确认',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
var disabledFlag = row.deptNumber == curUsrDeptNumber;
var html = '<select '+(disabledFlag?'':"disabled")+' class="form-control" name="orderDepts['+curIndex+'].deptLeaderConfirmStatus">' +
'<option value="0" '+(value=='0'?'selected':"")+'>待确认</option>' +
@ -437,7 +437,7 @@
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length; i++) {
var curIndex = parentRowIndex*5+i;
var curIndex = parentRowIndex*6+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;

14
ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

@ -334,7 +334,7 @@
field : 'id',
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
}
},
@ -343,7 +343,7 @@
title : '生产订单号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
}
},
@ -352,7 +352,7 @@
title : '料号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
}
},
@ -383,7 +383,7 @@
/*if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}*/
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input disabled class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
@ -391,7 +391,7 @@
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
@ -411,7 +411,7 @@
field : 'deptLeaderConfirmStatus',
title : '部门主管确认',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*5+index;
var curIndex = parentRowIndex*6+index;
var html = '<select disabled class="form-control" name="orderDepts['+curIndex+'].deptLeaderConfirmStatus">' +
'<option value="0" '+(value=='0'?'selected':"")+'>待确认</option>' +
'<option value="1" '+(value=='1'?'selected':"")+'>已确认</option>' +
@ -436,7 +436,7 @@
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length; i++) {
var curIndex = parentRowIndex*5+i;
var curIndex = parentRowIndex*6+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;

4
ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

@ -230,6 +230,10 @@
if(row.makeStatus == '2'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> ');
}
// 待生产、生产中、部分完成
if(row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> ');
}
// if(row.delFlag == '0'){

300
ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html

@ -17,7 +17,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly>
<input id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -34,22 +34,314 @@
</div>
</div>
<!--缺订单类型-->
<!--缺表格-->
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/makeorderpick";
// 字典
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialCode',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'deliveryTime',
align: 'center',
title: '客户期望交付时间'
},
{
field: 'materialNum',
align: 'center',
title: '订单数量'
}
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].bomId" value="'+row.id+'">';
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index;
return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
}
},
{
field: 'parentId',
title: '父级id',
visible: false,
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
return curParams;
}
$("#form-makeorderpick-edit").validate({
focusCleanup: true
});
function submitHandler() {
/*function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-makeorderpick-edit').serialize());
}
}
}*/
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",

10
ruoyi-admin/src/main/resources/templates/system/makeorderpick/makeorderpick.html

@ -173,6 +173,14 @@
title: '领料员',
field: 'pickUser',
},
{
title: '物料合计',
field: 'materialSum',
},
{
title: '数量合计',
field: 'enterpriseSum',
},
{
title: '审核状态',
field: 'auditStatus',
@ -188,7 +196,7 @@
// 审核状态-审核通过
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" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id
if (row.instanceId) {

Loading…
Cancel
Save