Browse Source

[feat] 工程管理 仓库管理

开发修改单领料新增审核通过后生成仓库出库单数据
开发修改单领料新增根据开发修改单号查询开发修改领料数据
开发修改单领料详情新增通过领料单号查询领料单详情集合后端接口方法
仓库出库单前端页面:新增开发修改单-出库按钮;新增开发修改单-出库前端注解;新增打开开发修改单-出库前端js方法
仓库出库单Controller层:新增生产单-出库后端接口;新增修改保存生产单-出库后端接口;新增通用保存出库单详情接口;新增出库的同时关联开发修改单领料数据;新增出库的仓库出库单详情数据
仓库出库单列表修改成通过创建时间降序排列
dev
liuxiaoxu 4 months ago
parent
commit
ef4c3a8e23
  1. 17
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderPickingController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderPickingDetailMapper.java
  3. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderPickingMapper.java
  4. 1
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderPickingServiceImpl.java
  5. 38
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java
  6. 16
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java
  7. 183
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  8. 4
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderPickingDetailMapper.xml
  9. 7
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderPickingMapper.xml
  10. 1
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml
  11. 191
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/developModifyOutWarehouse.html
  12. 29
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html

17
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderPickingController.java

@ -5,15 +5,13 @@ import java.util.List;
import com.ruoyi.erp.domain.*;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderVo;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper;
import com.ruoyi.erp.service.IErpBomService;
import com.ruoyi.erp.service.IErpDevelopModifyorderDetailService;
import com.ruoyi.erp.service.IErpDevelopModifyorderPickingDetailService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
@ -31,10 +29,10 @@ 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;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* 开发修改单领料Controller
*
@ -71,6 +69,11 @@ public class ErpDevelopModifyorderPickingController extends BaseController
@Autowired
private IErpDevelopModifyorderPickingDetailService pickingDetailService;
@Autowired
private IWarehouseOutOrderService warehouseOutOrderService;
@RequiresPermissions("erp:developModifyorderPicking:view")
@GetMapping()
public String developModifyorderPicking()
@ -188,8 +191,8 @@ public class ErpDevelopModifyorderPickingController extends BaseController
erpDevelopModifyorderPickingVo.setAuditStatus("1");
// String developOderCode = erpDevelopModifyorderPickingVo.getDevelopOrderCode();
//如果审核通过生成采购计划
// purchasePlanService.generatePurchasePlanByDevelopModifyorder(erpDevelopModifyorderPickingVo);
//如果审核通过生成仓库出库单
warehouseOutOrderService.generateWarehouseOutOrderByDevelopModifyorderPicking(erpDevelopModifyorderPickingVo);
// SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO = salesAftersalesNoticeService.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);

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

@ -80,4 +80,9 @@ public interface ErpDevelopModifyorderPickingDetailMapper
* 通过bomId和领料单号查询领料单详情集合
* */
List<ErpDevelopModifyorderPickingDetail> selectPickingDetailListByIdAndCode(ErpDevelopModifyorderPickingDetail developModifyorderPickingDetail);
/**
* 通过领料单号查询领料单详情集合
* */
List<ErpDevelopModifyorderPickingDetail> selectDevelopModifyDetailMaterialByPickingCode(String pickingOrderCode);
}

6
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderPickingMapper.java

@ -75,4 +75,10 @@ public interface ErpDevelopModifyorderPickingMapper
* @return 结果
*/
public int restoreErpDevelopModifyorderPickingById(Long developOrderPickingId);
/**
*
* 根据开发修改单号查询开发修改领料数据
* */
ErpDevelopModifyorderPicking selectErpDevelopModifyorderPickingByDevelopCode(String developOderCode);
}

1
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderPickingServiceImpl.java

@ -267,6 +267,7 @@ public class ErpDevelopModifyorderPickingServiceImpl implements IErpDevelopModif
ErpDevelopModifyorderPickingDetail dvelopModifyorderPickingDetail = new ErpDevelopModifyorderPickingDetail();
dvelopModifyorderPickingDetail.setDevelopOderCode(erpDevelopModifyorder.getDevelopOrderCode());
dvelopModifyorderPickingDetail.setPickNum(erpDevelopModifyorderDetail.getPickNum());
dvelopModifyorderPickingDetail.setOrderUseNum(erpDevelopModifyorderDetail.getMaterialNum());
dvelopModifyorderPickingDetail.setMaterialNo(erpDevelopModifyorderDetail.getMaterialNo());
dvelopModifyorderPickingDetail.setMaterialName(erpDevelopModifyorderDetail.getMaterialName());
dvelopModifyorderPickingDetail.setMaterialDescribe(erpDevelopModifyorderDetail.getMaterialDescribe());

38
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java

@ -209,7 +209,7 @@ public class WarehouseOutOrderController extends BaseController
/**
* 销售单-出库
* 销售单-出库详情
*/
@GetMapping("/salesOutWarehouseDetail/{outOrderId}")
public String salesOutWarehouseDetail(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
@ -220,7 +220,7 @@ public class WarehouseOutOrderController extends BaseController
}
/**
* 修改保存销售单-出库
* 修改保存销售单-出库详情
*/
@RequiresPermissions("warehouse:warehouseOutOrder:salesOutWarehouseDetail")
@Log(title = "仓库出库单", businessType = BusinessType.UPDATE)
@ -228,7 +228,7 @@ public class WarehouseOutOrderController extends BaseController
@ResponseBody
public AjaxResult salesOutWarehouseDetailSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateSalesOutWarehouse(warehouseOutOrder));
return toAjax(warehouseOutOrderService.generalUpdateWarehouseOutOrder(warehouseOutOrder));
}
@ -291,9 +291,35 @@ public class WarehouseOutOrderController extends BaseController
@ResponseBody
public AjaxResult makeOutWarehouseDetailSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder));
return toAjax(warehouseOutOrderService.generalUpdateWarehouseOutOrder(warehouseOutOrder));
}
/**
* 生产单-出库
*/
@GetMapping("/developModifyOutWarehouse/{outOrderId}")
public String developModifyOutWarehouse(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
{
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId);
mmap.put("warehouseOutOrder", warehouseOutOrder);
return prefix + "/developModifyOutWarehouse";
}
/**
* 修改保存生产单-出库
*/
@RequiresPermissions("warehouse:warehouseOutOrder:developModifyOutWarehouse")
@Log(title = "仓库出库单", businessType = BusinessType.UPDATE)
@PostMapping("/developModifyOutWarehouse")
@ResponseBody
public AjaxResult developModifyOutWarehouseSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateDevelopModifyOutWarehouse(warehouseOutOrder));
}
/**
* 请购单-出库
*/
@ -338,7 +364,7 @@ public class WarehouseOutOrderController extends BaseController
@ResponseBody
public AjaxResult requisitioningOutWarehouseDetailSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder));
return toAjax(warehouseOutOrderService.generalUpdateWarehouseOutOrder(warehouseOutOrder));
}
@ -385,7 +411,7 @@ public class WarehouseOutOrderController extends BaseController
@ResponseBody
public AjaxResult refundsExchangesOutWarehouseDetailSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateRefundsExchangesOutWarehouse(warehouseOutOrder));
return toAjax(warehouseOutOrderService.generalUpdateWarehouseOutOrder(warehouseOutOrder));
}

16
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java

@ -2,6 +2,7 @@ package com.ruoyi.warehouse.service;
import java.util.List;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
@ -106,4 +107,19 @@ public interface IWarehouseOutOrderService
* 通过销售发起出货生成仓库出库单
* */
int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode);
/**
* 开发修改单领料审核通过后生产出库单
* */
void generateWarehouseOutOrderByDevelopModifyorderPicking(ErpDevelopModifyorderPickingVo erpDevelopModifyorderPickingVo);
/**
* 仓库出库单通用修改保持方法
* */
int generalUpdateWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder);
/**
* 修改保存 开发修改单-出库
* */
int updateDevelopModifyOutWarehouse(WarehouseOutOrder warehouseOutOrder);
}

183
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java

@ -8,6 +8,13 @@ import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpDevelopModifyorder;
import com.ruoyi.erp.domain.ErpDevelopModifyorderPicking;
import com.ruoyi.erp.domain.ErpDevelopModifyorderPickingDetail;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingDetailMapper;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.*;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
@ -65,6 +72,13 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
@Autowired
private SysSalesShippingInformDetailMapper shippingInformDetailMapper;
@Autowired
private ErpDevelopModifyorderPickingDetailMapper modifyorderPickingDetailMapper;
@Autowired
private ErpDevelopModifyorderPickingMapper modifyorderPickingMapper;
/**
* 查询仓库出库单
*
@ -660,4 +674,173 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
}
}
}
/**
* 修改保存 开发修改单-出库
* */
@Override
public int updateDevelopModifyOutWarehouse(WarehouseOutOrder warehouseOutOrder) {
String loginName = ShiroUtils.getLoginName();
// 参数校验
if (warehouseOutOrder == null || StringUtils.isEmpty(warehouseOutOrder.getRelatedOrderCode())) {
throw new BusinessException("更新出库单信息失败:缺少必要参数");
}
List<WarehouseOutOrderDetail> warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList();
if (CollectionUtils.isEmpty(warehouseOutOrderDetailList)){
log.warn("保存生产单出库,物料列表信息为空:{}",warehouseOutOrder);
throw new BusinessException("出库单详情数据为空");
}else {
int updateRows = 0;
for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) {
warehouseOutOrderDetail.setUpdateBy(loginName);
warehouseOutOrderDetail.setUpdateTime(new Date());
warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark());
//设置已出库数
warehouseOutOrderDetail.setHasOutOrderSum(warehouseOutOrderDetail.getActualOutOrderSum());
//设置仓库员
warehouseOutOrderDetail.setWarehouseName(loginName);
//更新数据库记录
updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail);
}
if (updateRows <= 0){
throw new BusinessException("更新出库单详情数据失败");
}
}
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
//表明已出库
warehouseOutOrder.setWarehouseOutStatus("7");
//设置出库时间
warehouseOutOrder.setOutOrderTime(new Date());
//设置仓库员
warehouseOutOrder.setWarehouseName(loginName);
//计算出库单主表的出库数
Integer outOrderSum = 0;
// 检查outOrderSum是否含有null值
boolean hasOutOrderSumNull = warehouseOutOrderDetailList.stream()
.anyMatch(item -> item.getActualOutOrderSum() == null);
if (hasOutOrderSumNull) {
throw new BusinessException("存在实际出库数为空,请检查!");
}
// 计算各个字段的总和
outOrderSum = warehouseOutOrderDetailList.stream()
.mapToInt(WarehouseOutOrderDetail::getActualOutOrderSum)
.sum();
//设置出库单主表的出库数
warehouseOutOrder.setOutOrderSum(outOrderSum);
//更新开发修改单领料信息
String developOderCode = warehouseOutOrder.getRelatedOrderCode();
ErpDevelopModifyorderPicking erpDevelopModifyorderPicking = modifyorderPickingMapper.selectErpDevelopModifyorderPickingByDevelopCode(developOderCode);
//暂时设置为全部领料
erpDevelopModifyorderPicking.setPickingStatus("2");
erpDevelopModifyorderPicking.setDevelopOderCode(warehouseOutOrder.getRelatedOrderCode());
erpDevelopModifyorderPicking.setUpdateBy(loginName);
erpDevelopModifyorderPicking.setUpdateTime(new Date());
int updateModifyorderPickingResult = modifyorderPickingMapper.updateErpDevelopModifyorderPicking(erpDevelopModifyorderPicking);
if (updateModifyorderPickingResult <= 0){
log.warn("更新开发修改单领料信息失败");
throw new BusinessException("更新开发修改单领料信息失败");
}
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/**
* 开发修改单领料审核通过后生产出库单
* */
@Override
public void generateWarehouseOutOrderByDevelopModifyorderPicking(ErpDevelopModifyorderPickingVo erpDevelopModifyorderPickingVo) {
String developOderCode = erpDevelopModifyorderPickingVo.getDevelopOderCode();
String loginName = ShiroUtils.getLoginName();
String outOrderCode = redisCache.generateBillNo("CK");
if (StringUtils.isEmpty(developOderCode)){
log.warn("开发修改单编号:{}",developOderCode);
}
String pickingOrderCode = erpDevelopModifyorderPickingVo.getPickingOrderCode();
if (StringUtils.isEmpty(developOderCode)){
log.warn("开发修改单领料编号:{}",developOderCode);
}
List<ErpDevelopModifyorderPickingDetail> modifyorderPickingDetailList = modifyorderPickingDetailMapper.selectDevelopModifyDetailMaterialByPickingCode(pickingOrderCode);
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
warehouseOutOrder.setWarehouseOutStatus("4");
warehouseOutOrder.setOutOrderCode(outOrderCode);
warehouseOutOrder.setMaterialSum(erpDevelopModifyorderPickingVo.getMaterialSum());
warehouseOutOrder.setEnterpriseSum(erpDevelopModifyorderPickingVo.getEnterpriseSum());
warehouseOutOrder.setWarehouseOrderType("5");
warehouseOutOrder.setWarehouseOutType("5");
warehouseOutOrder.setMakeNo(erpDevelopModifyorderPickingVo.getMakeNo());
warehouseOutOrder.setRelatedOrderCode(developOderCode);
warehouseOutOrder.setApplyName(erpDevelopModifyorderPickingVo.getApplyUser());
warehouseOutOrder.setCreateTime(new Date());
warehouseOutOrder.setCreateBy(loginName);
warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder);
// List<ErpDevelopModifyorderPickingDetail> mergeDevelopModifyorderPickingDetails = mergePickingDetailList(modifyorderPickingDetailList);
for (ErpDevelopModifyorderPickingDetail erpDevelopModifyorderPickingDetail : modifyorderPickingDetailList) {
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail();
warehouseOutOrderDetail.setRelatedOrderCode(developOderCode);
warehouseOutOrderDetail.setOutOrderCode(outOrderCode);
warehouseOutOrderDetail.setMaterialNo(erpDevelopModifyorderPickingDetail.getMaterialNo());
warehouseOutOrderDetail.setMaterialName(erpDevelopModifyorderPickingDetail.getMaterialName());
warehouseOutOrderDetail.setMaterialType(erpDevelopModifyorderPickingDetail.getMaterialType());
warehouseOutOrderDetail.setMaterialBrand(erpDevelopModifyorderPickingDetail.getMaterialBrand());
warehouseOutOrderDetail.setMaterialUnit(erpDevelopModifyorderPickingDetail.getMaterialUnit());
warehouseOutOrderDetail.setMaterialDescribe(erpDevelopModifyorderPickingDetail.getMaterialDescribe());
warehouseOutOrderDetail.setMaterialProcessMethod(erpDevelopModifyorderPickingDetail.getMaterialProcessMethod());
warehouseOutOrderDetail.setApplyOutOrderSum(erpDevelopModifyorderPickingDetail.getPickNum());
warehouseOutOrderDetail.setMakeNum(erpDevelopModifyorderPickingDetail.getOrderUseNum());
warehouseOutOrderDetail.setCreateTime(new Date());
warehouseOutOrderDetail.setCreateBy(loginName);
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail);
if (insertOutOrderDetailResult <= 0){
throw new BusinessException("新增出库单明细数据失败");
}
}
}
private List<ErpDevelopModifyorderPickingDetail> mergePickingDetailList(List<ErpDevelopModifyorderPickingDetail> pickingDetailList) {
Map<String, ErpDevelopModifyorderPickingDetail> aggregatedMap = new HashMap<>();
for (ErpDevelopModifyorderPickingDetail pickingDetail : pickingDetailList) {
String materialNo = pickingDetail.getMaterialNo();
if (aggregatedMap.containsKey(materialNo)) {
ErpDevelopModifyorderPickingDetail existing = aggregatedMap.get(materialNo);
existing.setMaterialNum(existing.getPickNum() + pickingDetail.getPickNum());
existing.setOrderUseNum(existing.getOrderUseNum() + pickingDetail.getOrderUseNum());
} else {
aggregatedMap.put(materialNo, pickingDetail);
}
}
return new ArrayList<>(aggregatedMap.values());
}
/**
* 仓库出库单通用修改保持方法
* */
@Override
public int generalUpdateWarehouseOutOrder(WarehouseOutOrder warehouseOutOrder) {
return 1;
}
}

4
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderPickingDetailMapper.xml

@ -60,6 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where picking_order_code = #{pickingOrderCode}
and bom_id = #{bomId}
</select>
<select id="selectDevelopModifyDetailMaterialByPickingCode" parameterType="String" resultMap="ErpDevelopModifyorderPickingDetailResult">
<include refid="selectErpDevelopModifyorderPickingDetailVo"/>
where picking_order_code = #{pickingOrderCode}
</select>
<insert id="insertErpDevelopModifyorderPickingDetail" parameterType="ErpDevelopModifyorderPickingDetail" useGeneratedKeys="true" keyProperty="developOrderPickingDetailId">
insert into erp_develop_modifyorder_picking_detail

7
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderPickingMapper.xml

@ -53,7 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectErpDevelopModifyorderPickingVo"/>
where develop_order_picking_id = #{developOrderPickingId}
</select>
<select id="selectErpDevelopModifyorderPickingByDevelopCode" parameterType="String" resultMap="ErpDevelopModifyorderPickingResult">
<include refid="selectErpDevelopModifyorderPickingVo"/>
where develop_oder_code = #{developOderCode}
</select>
<insert id="insertErpDevelopModifyorderPicking" parameterType="ErpDevelopModifyorderPickingVo" useGeneratedKeys="true" keyProperty="developOrderPickingId">
insert into erp_develop_modifyorder_picking
<trim prefix="(" suffix=")" suffixOverrides=",">

1
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml

@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="deliveryDate != null "> and delivery_date = #{deliveryDate}</if>
</where>
order by create_time desc
</select>

191
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/developModifyOutWarehouse.html

@ -0,0 +1,191 @@
<!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-makeOutWarehouse-edit" th:object="${warehouseOutOrder}">
<input name="outOrderId" th:field="*{outOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="warehouseOrderType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_order_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开发修改单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人员:</label>
<div class="col-sm-8">
<input name="applyName" th:field="*{applyName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var warehouseOutOrder = [[${warehouseOutOrder}]];
var prefix = ctx + "warehouse/warehouseOutOrder";
$("#form-makeOutWarehouse-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const warehouseOutOrderData = $("#form-makeOutWarehouse-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"outOrderDetailId":item.outOrderDetailId,
"outOrderCode":item.outOrderCode,
"materialNo": item.materialNo, // 假设id对应materialId
"prepareOutOrderSum":item.prepareOutOrderSum,
"actualOutOrderSum":item.actualOutOrderSum
// ...其他字段
};
});
const combinedData = Object.assign({}, warehouseOutOrderData, {
warehouseOutOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/developModifyOutWarehouse", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: ctx + "warehouse/warehouseOutOrder/getMaterialListByOutOrderCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '出库单详情ID',
field: 'outOrderDetailId',
visible: false
},
{
title: '出库单号',
field: 'outOrderCode',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '实际出库数',
field: 'actualOutOrderSum',
editable:true
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: warehouseOutOrder.outOrderCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>

29
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html

@ -72,16 +72,15 @@
var salesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:salesOutWarehouse')}]];
var makeOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:makeOutWarehouse')}]];
var requisitioningOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:requisitioningOutWarehouse')}]];
var refundsExchangesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:refundsExchangesOutWarehouse')}]];
var developModifyOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:developModifyOutWarehouse')}]];
var prepareMaterialDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:prepareMaterialDetail')}]];
var salesOutWarehouseDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:salesOutWarehouseDetail')}]];
var makeOutWarehouseDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:makeOutWarehouseDetail')}]];
var requisitioningOutWarehouseDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:requisitioningOutWarehouseDetail')}]];
var refundsExchangesOutWarehouseDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:refundsExchangesOutWarehouseDetail')}]];
var developModifyOutWarehouseDetailFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:developModifyOutWarehouseDetail')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -228,6 +227,17 @@
actions.push('<a class="btn btn-success btn-xs ' + refundsExchangesOutWarehouseDetailFlag + '" href="javascript:void(0)" onclick="refundsExchangesOutWarehouseDetail(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
/*开发修改单-出库*/
if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 5 && row.warehouseOutType == 5){
actions.push('<a class="btn btn-success btn-xs ' + developModifyOutWarehouseFlag + '" href="javascript:void(0)" onclick="developModifyOutWarehouse(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>出库</a> ');
}
/*开发修改单-出库详情*/
if (row.warehouseOrderType == 5 && row.warehouseOutType == 5){
actions.push('<a class="btn btn-success btn-xs ' + developModifyOutWarehouseDetailFlag + '" href="javascript:void(0)" onclick="developModifyOutWarehouseDetail(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
return actions.join('');
}
}]
@ -272,6 +282,19 @@
$.modal.open("出库详情",url);
}
/*开发修改单-出库*/
function developModifyOutWarehouse(outOrderId){
var url = ctx + 'warehouse/warehouseOutOrder/developModifyOutWarehouse/' + outOrderId;
$.modal.open("出库",url);
}
/*开发修改单-出库详情*/
function developModifyOutWarehouseDetail(outOrderId){
var url = ctx + 'warehouse/warehouseOutOrder/developModifyOutWarehouseDetail/' + outOrderId;
$.modal.open("出库详情",url);
}
/*请购单-出库*/
function requisitioningOutWarehouse(outOrderId){
var url = ctx + 'warehouse/warehouseOutOrder/requisitioningOutWarehouse/' + outOrderId;

Loading…
Cancel
Save