youjianchi
7 months ago
14 changed files with 1591 additions and 23 deletions
@ -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)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -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; |
||||
|
|
||||
|
|
||||
|
} |
@ -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> |
@ -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> |
@ -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…
Reference in new issue