Browse Source

[update]:生产入库、委内入库详情

dev
youjianchi 6 months ago
parent
commit
424cd32d3f
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpEquipmentResumeController.java
  2. 54
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  3. 190
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderDetailController.java
  4. 20
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetail.java
  5. 39
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetailDto.java
  6. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderDetailMapper.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderDetailService.java
  8. 11
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderDetailServiceImpl.java
  9. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipMaterialDto.java
  10. 85
      ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderDetailMapper.xml
  11. 229
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/equipmentResumeDetail.html
  12. 29
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  13. 363
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/processInboundDetail.html
  14. 432
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/produceInboundDetail.html

151
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpEquipmentResumeController.java

@ -0,0 +1,151 @@
package com.ruoyi.erp.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.erp.domain.ErpEquipmentResume;
import com.ruoyi.erp.service.IErpEquipmentResumeService;
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-27
*/
@Controller
@RequestMapping("/erp/equipmentResume")
public class ErpEquipmentResumeController extends BaseController
{
private String prefix = "erp/equipmentResume";
@Autowired
private IErpEquipmentResumeService erpEquipmentResumeService;
@RequiresPermissions("erp:equipmentResume:view")
@GetMapping()
public String equipmentResume()
{
return prefix + "/equipmentResume";
}
/**
* 查询设备履历列表
*/
// @RequiresPermissions("erp:equipmentResume:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpEquipmentResume erpEquipmentResume)
{
startPage();
List<ErpEquipmentResume> list = erpEquipmentResumeService.selectErpEquipmentResumeList(erpEquipmentResume);
return getDataTable(list);
}
/**
* 导出设备履历列表
*/
@RequiresPermissions("erp:equipmentResume:export")
@Log(title = "设备履历", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErpEquipmentResume erpEquipmentResume)
{
List<ErpEquipmentResume> list = erpEquipmentResumeService.selectErpEquipmentResumeList(erpEquipmentResume);
ExcelUtil<ErpEquipmentResume> util = new ExcelUtil<ErpEquipmentResume>(ErpEquipmentResume.class);
return util.exportExcel(list, "设备履历数据");
}
/**
* 新增设备履历
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存设备履历
*/
@RequiresPermissions("erp:equipmentResume:add")
@Log(title = "设备履历", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ErpEquipmentResume erpEquipmentResume)
{
return toAjax(erpEquipmentResumeService.insertErpEquipmentResume(erpEquipmentResume));
}
/**
* 修改设备履历
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
ErpEquipmentResume erpEquipmentResume = erpEquipmentResumeService.selectErpEquipmentResumeById(id);
mmap.put("erpEquipmentResume", erpEquipmentResume);
return prefix + "/edit";
}
/**
* 修改保存设备履历
*/
@RequiresPermissions("erp:equipmentResume:edit")
@Log(title = "设备履历", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ErpEquipmentResume erpEquipmentResume)
{
return toAjax(erpEquipmentResumeService.updateErpEquipmentResume(erpEquipmentResume));
}
/**
* 删除设备履历
*/
@RequiresPermissions("erp:equipmentResume:remove")
@Log(title = "设备履历", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(erpEquipmentResumeService.deleteErpEquipmentResumeByIds(ids));
}
/**
* 作废设备履历
*/
@RequiresPermissions("erp:equipmentResume:cancel")
@Log(title = "设备履历", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(erpEquipmentResumeService.cancelErpEquipmentResumeById(id));
}
/**
* 恢复设备履历
*/
@RequiresPermissions("erp:equipmentResume:restore")
@Log(title = "设备履历", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(erpEquipmentResumeService.restoreErpEquipmentResumeById(id));
}
}

54
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java

@ -1,15 +1,17 @@
package com.ruoyi.erp.controller;
import java.util.List;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.service.ISysSalesOrderChildService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.erp.domain.ErpInboundOrder;
@ -34,6 +36,9 @@ public class ErpInboundOrderController extends BaseController
@Autowired
private IErpInboundOrderService erpInboundOrderService;
@Autowired
private ISysSalesOrderChildService salesOrderChildService;
@RequiresPermissions("erp:inboundOrder:view")
@GetMapping()
public String inboundOrder()
@ -147,5 +152,44 @@ public class ErpInboundOrderController extends BaseController
return toAjax(erpInboundOrderService.restoreErpInboundOrderById(id));
}
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{
mmap.put("currentUser", ShiroUtils.getSysUser());
ErpInboundOrder erpInboundOrder = erpInboundOrderService.selectErpInboundOrderById(id);
String inboundType = erpInboundOrder.getInboundType();
mmap.put("erpInboundOrder", erpInboundOrder);
// 生产入库
if("0".equals(inboundType)){
return prefix + "/produceInboundDetail";
}
// 委内入库
else if("1".equals(inboundType)){
return prefix + "/processInboundDetail";
}
return "";
}
@GetMapping("/detailEquipmentResume")
public String detailEquipmentResume(@RequestParam("curIndex")Integer curIndex
,@RequestParam("makeNo")String makeNo
,@RequestParam("saleNo")String saleNo
,@RequestParam("materialNo")String materialNo
,@RequestParam("inboundOrderNo")String inboundOrderNo, ModelMap mmap)
{
SysEquipMaterialDto equipMaterialDto = new SysEquipMaterialDto();
mmap.put("currentUser", ShiroUtils.getSysUser());
SysSalesOrderChild salesOrderChild = salesOrderChildService.selectOneByQuoteIdAndMaterialCode(saleNo, materialNo);
BeanUtils.copyProperties(salesOrderChild,equipMaterialDto);
equipMaterialDto.setMakeNo(makeNo);
equipMaterialDto.setCurIndex(curIndex);
equipMaterialDto.setInboundOrderNo(inboundOrderNo);
mmap.put("equipMaterial", equipMaterialDto);
return prefix + "/equipmentResumeDetail";
}
}

190
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderDetailController.java

@ -0,0 +1,190 @@
package com.ruoyi.erp.controller;
import java.util.List;
import com.ruoyi.erp.domain.ErpInboundOrder;
import com.ruoyi.erp.domain.ErpInboundOrderDetailDto;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.service.ISysSalesOrderChildService;
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.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.service.IErpInboundOrderDetailService;
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-24
*/
@Controller
@RequestMapping("/erp/inboundOrderDetail")
public class ErpInboundOrderDetailController extends BaseController
{
private String prefix = "erp/inboundOrderDetail";
@Autowired
private IErpInboundOrderDetailService erpInboundOrderDetailService;
@Autowired
private ISysSalesOrderChildService salesOrderChildService;
@RequiresPermissions("erp:inboundOrderDetail:view")
@GetMapping()
public String inboundOrderDetail()
{
return prefix + "/inboundOrderDetail";
}
/**
* 查询入库单明细列表
*/
// @RequiresPermissions("erp:inboundOrderDetail:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpInboundOrderDetail erpInboundOrderDetail)
{
startPage();
List<ErpInboundOrderDetail> list = erpInboundOrderDetailService.selectErpInboundOrderDetailList(erpInboundOrderDetail);
return getDataTable(list);
}
/**
* 导出入库单明细列表
*/
@RequiresPermissions("erp:inboundOrderDetail:export")
@Log(title = "入库单明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErpInboundOrderDetail erpInboundOrderDetail)
{
List<ErpInboundOrderDetail> list = erpInboundOrderDetailService.selectErpInboundOrderDetailList(erpInboundOrderDetail);
ExcelUtil<ErpInboundOrderDetail> util = new ExcelUtil<ErpInboundOrderDetail>(ErpInboundOrderDetail.class);
return util.exportExcel(list, "入库单明细数据");
}
/**
* 新增入库单明细
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存入库单明细
*/
@RequiresPermissions("erp:inboundOrderDetail:add")
@Log(title = "入库单明细", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ErpInboundOrderDetail erpInboundOrderDetail)
{
return toAjax(erpInboundOrderDetailService.insertErpInboundOrderDetail(erpInboundOrderDetail));
}
/**
* 修改入库单明细
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
ErpInboundOrderDetail erpInboundOrderDetail = erpInboundOrderDetailService.selectErpInboundOrderDetailById(id);
mmap.put("erpInboundOrderDetail", erpInboundOrderDetail);
return prefix + "/edit";
}
/**
* 修改保存入库单明细
*/
@RequiresPermissions("erp:inboundOrderDetail:edit")
@Log(title = "入库单明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ErpInboundOrderDetail erpInboundOrderDetail)
{
return toAjax(erpInboundOrderDetailService.updateErpInboundOrderDetail(erpInboundOrderDetail));
}
/**
* 删除入库单明细
*/
@RequiresPermissions("erp:inboundOrderDetail:remove")
@Log(title = "入库单明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(erpInboundOrderDetailService.deleteErpInboundOrderDetailByIds(ids));
}
/**
* 作废入库单明细
*/
@RequiresPermissions("erp:inboundOrderDetail:cancel")
@Log(title = "入库单明细", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(erpInboundOrderDetailService.cancelErpInboundOrderDetailById(id));
}
/**
* 恢复入库单明细
*/
@RequiresPermissions("erp:inboundOrderDetail:restore")
@Log(title = "入库单明细", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(erpInboundOrderDetailService.restoreErpInboundOrderDetailById(id));
}
@PostMapping("/produceDetaillist")
@ResponseBody
public TableDataInfo produceDetaillist(ErpInboundOrderDetail inboundOrderDetail)
{
String inboundOrderNo = inboundOrderDetail.getInboundOrderNo();
String saleNo = inboundOrderDetail.getSaleNo();
startPage();
ErpInboundOrderDetail erpInboundOrderDetail = new ErpInboundOrderDetail();
erpInboundOrderDetail.setInboundOrderNo(inboundOrderNo);
erpInboundOrderDetail.setSaleNo(saleNo);
List<ErpInboundOrderDetailDto> list = erpInboundOrderDetailService.selectProduceInboundOrderDetailList(erpInboundOrderDetail);
return getDataTable(list);
}
@PostMapping("/processDetaillist")
@ResponseBody
public TableDataInfo processDetaillist(ErpInboundOrderDetail inboundOrderDetail)
{
String inboundOrderNo = inboundOrderDetail.getInboundOrderNo();
String saleNo = inboundOrderDetail.getSaleNo();
String salesOrderMaterialNo = inboundOrderDetail.getSalesOrderMaterialNo();
startPage();
ErpInboundOrderDetail erpInboundOrderDetail = new ErpInboundOrderDetail();
erpInboundOrderDetail.setInboundOrderNo(inboundOrderNo);
erpInboundOrderDetail.setSaleNo(saleNo);
erpInboundOrderDetail.setSalesOrderMaterialNo(salesOrderMaterialNo);
List<ErpInboundOrderDetailDto> list = erpInboundOrderDetailService.selectProcessInboundOrderDetailList(erpInboundOrderDetail);
return getDataTable(list);
}
}

20
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetail.java

@ -48,6 +48,10 @@ public class ErpInboundOrderDetail extends BaseEntity
private String equipResumeArrayStr;
private String saleNo;
private String salesOrderMaterialNo;
public void setId(Long id)
{
this.id = id;
@ -129,6 +133,22 @@ public class ErpInboundOrderDetail extends BaseEntity
this.equipResumeArrayStr = equipResumeArrayStr;
}
public String getSaleNo() {
return saleNo;
}
public void setSaleNo(String saleNo) {
this.saleNo = saleNo;
}
public String getSalesOrderMaterialNo() {
return salesOrderMaterialNo;
}
public void setSalesOrderMaterialNo(String salesOrderMaterialNo) {
this.salesOrderMaterialNo = salesOrderMaterialNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

39
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetailDto.java

@ -0,0 +1,39 @@
package com.ruoyi.erp.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 入库单明细对象 erp_inbound_order_detail
*
* @author ruoyi
* @date 2024-04-24
*/
@Data
public class ErpInboundOrderDetailDto extends ErpInboundOrderDetail
{
private static final long serialVersionUID = 1L;
private String quoteId;
private String materialName;
private String materialType;
private String processMethod;
private String brand;
private String unit;
private String photoUrl;
private String describe;
private String deliveryTime;
private Integer materialNum;
private String salesOrderCode;
private String bomNo;
private Integer useNum;
private BigDecimal lossRate;
private Integer level;
private Integer sortNo;
}

5
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderDetailMapper.java

@ -1,6 +1,7 @@
package com.ruoyi.erp.mapper;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.domain.ErpInboundOrderDetailDto;
import java.util.List;
@ -75,4 +76,8 @@ public interface ErpInboundOrderDetailMapper
* @return 结果
*/
public int restoreErpInboundOrderDetailById(Long id);
List<ErpInboundOrderDetailDto> selectProduceInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
List<ErpInboundOrderDetailDto> selectProcessInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
}

5
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderDetailService.java

@ -1,6 +1,7 @@
package com.ruoyi.erp.service;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.domain.ErpInboundOrderDetailDto;
import java.util.List;
@ -73,4 +74,8 @@ public interface IErpInboundOrderDetailService
* @return
*/
int restoreErpInboundOrderDetailById(Long id);
List<ErpInboundOrderDetailDto> selectProduceInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
List<ErpInboundOrderDetailDto> selectProcessInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
}

11
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderDetailServiceImpl.java

@ -4,6 +4,7 @@ import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.domain.ErpInboundOrderDetailDto;
import com.ruoyi.erp.mapper.ErpInboundOrderDetailMapper;
import com.ruoyi.erp.service.IErpInboundOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
@ -124,4 +125,14 @@ public class ErpInboundOrderDetailServiceImpl implements IErpInboundOrderDetailS
{
return erpInboundOrderDetailMapper.restoreErpInboundOrderDetailById(id);
}
@Override
public List<ErpInboundOrderDetailDto> selectProduceInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail) {
return erpInboundOrderDetailMapper.selectProduceInboundOrderDetailList(erpInboundOrderDetail);
}
@Override
public List<ErpInboundOrderDetailDto> selectProcessInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail) {
return erpInboundOrderDetailMapper.selectProcessInboundOrderDetailList(erpInboundOrderDetail);
}
}

1
ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipMaterialDto.java

@ -25,4 +25,5 @@ public class SysEquipMaterialDto implements Serializable {
private String describe;
private String makeNo;
private Integer curIndex;
private String inboundOrderNo;
}

85
ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderDetailMapper.xml

@ -20,6 +20,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="processFeeUnitPrice" column="process_fee_unit_price" />
</resultMap>
<resultMap type="ErpInboundOrderDetailDto" id="produceInboundOrderDetailResult">
<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="inboundOrderNo" column="inbound_order_no" />
<result property="materialNo" column="material_no" />
<result property="makeorderBomId" column="makeorder_bom_id" />
<result property="completedNum" column="completed_num" />
<result property="currentNum" column="current_num" />
<result property="processFeeUnitPrice" column="process_fee_unit_price" />
<result property="quoteId" column="quoteId" />
<result property="materialName" column="materialName" />
<result property="materialType" column="materialType" />
<result property="processMethod" column="processMethod" />
<result property="brand" column="brand" />
<result property="photoUrl" column="photoUrl" />
<result property="unit" column="unit" />
<result property="describe" column="describe" />
<result property="materialNum" column="materialNum" />
<result property="deliveryTime" column="delivery_time" />
</resultMap>
<resultMap type="ErpInboundOrderDetailDto" id="processInboundOrderDetailResult">
<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="inboundOrderNo" column="inbound_order_no" />
<result property="materialNo" column="material_no" />
<result property="makeorderBomId" column="makeorder_bom_id" />
<result property="completedNum" column="completed_num" />
<result property="currentNum" column="current_num" />
<result property="processFeeUnitPrice" column="process_fee_unit_price" />
<result property="salesOrderCode" column="sales_order_code" />
<result property="salesOrderMaterialNo" column="sales_order_material_no" />
<result property="bomNo" column="bom_no" />
<result property="materialType" column="material_type" />
<result property="processMethod" column="process_method" />
<result property="brand" column="brand" />
<result property="photoUrl" column="photoUrl" />
<result property="unit" column="unit" />
<result property="describe" column="describe" />
<result property="useNum" column="use_num" />
<result property="lossRate" column="loss_rate" />
<result property="level" column="level" />
<result property="sortNo" column="sort_no" />
</resultMap>
<sql id="selectErpInboundOrderDetailVo">
select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.inbound_order_no, a.material_no, a.makeorder_bom_id, a.completed_num, a.current_num, a.process_fee_unit_price from erp_inbound_order_detail a
</sql>
@ -40,7 +95,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectErpInboundOrderDetailVo"/>
where a.id = #{id}
</select>
<select id="selectProduceInboundOrderDetailList"
resultMap="produceInboundOrderDetailResult">
select
a.*
,c.quoteId,c.materialName,c.materialType,c.processMethod,c.brand,c.photoUrl,c.unit,c.`describe`,c.delivery_time,c.materialNum
from erp_inbound_order_detail a
left join erp_inbound_order b
on a.inbound_order_no = b.inbound_order_no
left join sys_sales_order_child c
on a.material_no = c.materialCode and b.sale_no = c.quoteId
where a.inbound_order_no = #{inboundOrderNo}
and b.sale_no = #{saleNo}
</select>
<select id="selectProcessInboundOrderDetailList"
resultMap="processInboundOrderDetailResult">
select
a.*
,c.sales_order_code,c.sales_order_material_no,c.bom_no,c.photoUrl,c.material_name,c.material_type,c.process_method,c.brand,c.unit,c.`describe`,c.use_num,c.loss_rate,c.level,c.sort_no
from erp_inbound_order_detail a
left join erp_inbound_order b
on a.inbound_order_no = b.inbound_order_no
left join sys_makeorder_bom c
on b.make_no = c.make_no and b.sale_no = c.sales_order_code and a.material_no = c.material_no
where a.inbound_order_no = #{inboundOrderNo}
and b.sale_no = #{saleNo}
and c.sales_order_material_no = #{salesOrderMaterialNo}
order by c.sort_no
</select>
<insert id="insertErpInboundOrderDetail" parameterType="ErpInboundOrderDetail" useGeneratedKeys="true" keyProperty="id">
insert into erp_inbound_order_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

229
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/equipmentResumeDetail.html

@ -0,0 +1,229 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('设备履历详情')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal" id="form-equipMaterial-add" th:object="${equipMaterial}">
<input name="curIndex" th:field="*{curIndex}" type="hidden">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">生产订单号:</label>
<div class="col-sm-8">
<input readonly name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input readonly name="saleNo" th:field="*{quoteId}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">料号:</label>
<div class="col-sm-8">
<input readonly id="materialNo" name="materialNo" th:field="*{materialCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">物料名称:</label>
<div class="col-sm-8">
<input readonly name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">物料类型:</label>
<div class="col-sm-8">
<select disabled id="selectMaterialType" class="form-control m-b select2-multiple" th:field="*{materialType}" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup>
<option value="">请选择</option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
</select>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">加工方式:</label>
<div class="col-sm-8">
<select disabled name="processMethod" class="form-control m-b" th:field="*{processMethod}" th:with="type=${@dict.getType('processMethod')}" required>
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">单位:</label>
<div class="col-sm-8">
<select disabled name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">品牌:</label>
<div class="col-sm-8">
<input readonly name="brand" th:field="*{brand}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">描述:</label>
<div class="col-sm-8">
<textarea readonly name="describe" class="form-control">[[*{describe}]]</textarea>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">入库单号:</label>
<div class="col-sm-8">
<input readonly id="inboundOrderNo" name="inboundOrderNo" th:field="*{inboundOrderNo}" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<!-- <button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>-->
<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 :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/equipmentResume";
$(function(){
var options = {
url: prefix + "/list",
id: 'bootstrap-sub-table-1',
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
columns: [{
checkbox: true
},
{
field: 'id',
align: 'center',
title: "主键id",
visible: false
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='equipResumes[%s].index' value='%s'>", index,$.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' name='equipResumes[%s].id' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
}
},
{
field: 'equipmentId',
align: 'center',
title: '出货设备id'
},
{
field: 'equipmentModel',
align: 'center',
title: '设备型号'
},
{
field: 'serialNo',
align: 'center',
title: '流水号'
},
{
field: 'producePic',
align: 'center',
title: '生产图片',
formatter: function(value, row, index) {
}
}]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.inboundOrderNo = $("#inboundOrderNo").val();
curParams.materialNo = $("#materialNo").val();
return curParams;
}
function addRow() {
var count = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
equipmentId: "",
equipmentModel: "",
serialNo: "",
producePic: "",
}
sub.addRow(row);
}
$("#form-equipMaterial-add").validate({
focusCleanup: true
});
/*function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-equipMaterial-add').serialize());
}
}*/
</script>
</body>
</html>

29
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -11,17 +11,18 @@
<div class="select-list">
<ul>
<li>
<label>生产订单号:</label>
<label>入库单号:</label>
<input type="text" name="inboundOrderNo"/>
</li>
<li>
<label>关联生成单号:</label>
<input type="text" name="makeNo"/>
</li>
<li>
<label>关联销售订单号:</label>
<input type="text" name="saleNo"/>
</li>
<li>
<label>入库单号:</label>
<input type="text" name="inboundOrderNo"/>
</li>
<li>
<label>入库状态:</label>
<select name="inboundStatus" th:with="type=${@dict.getType('erp_inbound_status')}">
@ -36,10 +37,6 @@
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>入库数:</label>
<input type="text" name="inboundNum"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -50,7 +47,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:inboundOrder:add">
<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:inboundOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:inboundOrder:edit">
@ -61,7 +58,7 @@
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export">
<i class="fa fa-download"></i> 导出
</a>
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
@ -83,6 +80,7 @@
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
@ -96,10 +94,6 @@
field: 'id',
visible: false
},
{
title: '备注',
field: 'remark',
},
{
title: '生产订单号',
field: 'makeNo',
@ -135,13 +129,14 @@
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.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
/*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
}*/
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]

363
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/processInboundDetail.html

@ -0,0 +1,363 @@
<!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="${erpInboundOrder}">
<input name="inboundType" type="hidden" value="1">
<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="inboundOrderNo" th:field="*{inboundOrderNo}" class="form-control" type="text">
</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 + "erp/inboundOrder"
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/inboundOrderDetail/processDetaillist",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
inboundOrderNo: $("#inboundOrderNo").val(),
saleNo: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
},
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 = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="inboundDetails['+curIndex+'].materialNo" value="'+value+'">' +
'<input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="inboundDetails['+curIndex+'].makeorderBomId" 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: 'completedNum',
title: '已完成数'
},
{
field: 'currentNum',
title: '本次委内完成数量'
},
{
field: 'processFeeUnitPrice',
title: '委内加工费单价'
},
{
field: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
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(JSON.stringify(data));
$.operate.save(ctx + "erp/inboundOrder/add", data);
}
</script>
</body>
</html>

432
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/produceInboundDetail.html

@ -0,0 +1,432 @@
<!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="${erpInboundOrder}">
<input name="inboundType" type="hidden" value="0">
<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 id="inboundOrderNo" name="inboundOrderNo" th:field="*{inboundOrderNo}" class="form-control" type="text">
</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 + "erp/inboundOrder"
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 + "erp/inboundOrderDetail/produceDetaillist",
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: 'materialNo',
align: 'center',
title: '料号',
formatter: function (value,row,index){
var curIndex = index;
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="inboundDetails['+curIndex+'].materialNo" value="'+value+'">';
}
},
{
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: '订单数量'
},
{
field: 'completedNum',
align: 'center',
title: '已完成数'
},
{
field: 'currentNum',
align: 'center',
title: '本次完成数'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 物料类型是成品,查看设备履历表
if(row.materialType == 'chcpsb'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detailEquipmentResume(\'' + index + '\',\'' + row.materialNo + '\')">查看设备履历</a> ');
}
return actions.join('');
}
}
]
};
$.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 + "system/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
},
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: '料号'
},
{
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: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
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.saleNo = $("#saleNo").val();
curParams.inboundOrderNo = $("#inboundOrderNo").val();
return curParams;
}
function detailEquipmentResume(curIndex,materialCode){
var url = prefix + "/detailEquipmentResume?makeNo="+$("#makeNo").val()+"&saleNo="+$("#saleNo").val()+"&materialNo="+materialCode+"&curIndex="+curIndex+"&inboundOrderNo="+$("#inboundOrderNo").val();
var options = {
title: '设备履历表详情',
url: url,
skin: 'layui-layer-gray',
btn: ['关闭'],
yes: function (index, layero) {
layer.close(index);
}
};
$.modal.openOptions(options);
}
function serializeObject(formData) {
var obj = {};
$.each(formData, function () {
if (this.name.indexOf("[") !== -1 && this.name.indexOf("].") !== -1) {
let temp1 = this.name.split("[");
let temp2 = temp1[1].split("].");
let list_name = temp1[0];
let list_index = parseInt(temp2[0]);
let list_key = temp2[1];
// console.log(list_name, '-', list_index, '-', list_key)
if (obj[list_name]) {
// console.log(obj[list_name])
let arr = obj[list_name]
if (arr.length < list_index + 1) {
for (let i = arr.length; i < list_index + 1; i++) {
// console.log(list_index + 1)
let list_obj_temp = {}
arr.push(list_obj_temp)
}
}
let list_obj = obj[list_name][list_index];
list_obj[list_key] = this.value || '';
} else {
let arr = []
if (list_index !== 0) {
for (let i = 0; i < list_index + 1; i++) {
// console.log(list_index + 1)
let list_obj_temp = {}
arr.push(list_obj_temp)
}
}
let list_obj = {}
list_obj[list_key] = this.value || '';
arr.push(list_obj)
obj[list_name] = arr;
}
} else {
if (obj[this.name]) {
if (!obj[this.name].push) {
obj[this.name] = [obj[this.name]];
}
obj[this.name].push(this.value || '');
} else {
obj[this.name] = this.value || '';
}
}
});
return obj;
}
$("#form-makeorder-edit").validate({
focusCleanup: true
});
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data));
$.operate.save(ctx + "erp/inboundOrder/add", data);
}
</script>
</body>
</html>
Loading…
Cancel
Save