Browse Source

[feat] 销售管理 仓库管理 售后管理

售后维护设备出库新增 确认验收后端接口
销售出库新增 客户验收前端页面
销售出库实体类新增 销售出库单详情集合字段
销售订单子表新增 已验收数字段
销售出库新增 客户验收后端接口
销售出库新增 客户验收修改保存后端接口
销售出库新增 客户验收 物料信息信息后端接口
客户验收时新增更新销售出库和销售订单状态后端接口
dev
liuxiaoxu 4 months ago
parent
commit
025c80e203
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
  3. 46
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  4. 39
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  5. 12
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java
  6. 15
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInform.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java
  8. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  9. 79
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  10. 9
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  11. 8
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml
  12. 41
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html
  13. 246
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/customerCheckGoods.html
  14. 10
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

12
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java

@ -387,4 +387,16 @@ public class AftersalesWarehouseOutController extends BaseController
return toAjax(warehouseOutOrderService.confirmReceivingGoodsById(outOrderId));
}
/**
* 确认验收
*/
@RequiresPermissions("aftersales:warehouseOutOrder:confirmCheckGoods")
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE)
@GetMapping( "/confirmCheckGoods/{outOrderId}")
@ResponseBody
public AjaxResult confirmCheckGoods(@PathVariable("outOrderId") Long outOrderId){
return toAjax(warehouseOutOrderService.confirmCheckGoodsById(outOrderId));
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java

@ -145,4 +145,9 @@ public interface IAftersalesWarehouseOutService
* 确认收货
*/
int confirmReceivingGoodsById(Long outOrderId);
/**
* 确认验收
*/
int confirmCheckGoodsById(Long outOrderId);
}

46
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java

@ -426,6 +426,52 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/**
* 确认验收
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int confirmCheckGoodsById(Long outOrderId) {
String loginName = ShiroUtils.getLoginName();
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderById(outOrderId);
if (warehouseOutOrder == null){
log.warn("出库单Id为空:{}",outOrderId);
}
String outOrderCode = warehouseOutOrder.getOutOrderCode();
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(outOrderCode);
sysSalesShippingInform.setWarehouseOutStatus("12");
sysSalesShippingInform.setUpdateTime(new Date());
sysSalesShippingInform.setUpdateBy(loginName);
int updateSalesShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateSalesShippingInformResult <= 0){
throw new BusinessException("更新销售出库数据失败");
}
String salesOrderCode = warehouseOutOrder.getSalesOrderCode();
if (StringUtils.isEmpty(salesOrderCode)){
log.warn("销售订单号为空:{}",salesOrderCode);
}
SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setSalesOrderCode(salesOrderCode);
//设置为全部出货
sysSalesOrder.setDeliveryStatus("8");
sysSalesOrder.setUpdateTime(new Date());
sysSalesOrder.setUpdateBy(loginName);
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
if (updateSysSalesOrderResult <= 0){
throw new BusinessException("更新销售订单数据失败");
}
warehouseOutOrder.setUpdateTime(new Date());
warehouseOutOrder.setUpdateBy(loginName);
//设置为全部验收
warehouseOutOrder.setWarehouseOutStatus("12");
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/*
* 售后第一次维护设备信息根据设备ID删除出货设备信息
* */

39
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java

@ -2,7 +2,9 @@ package com.ruoyi.system.controller;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -193,4 +195,41 @@ public class SysSalesShippingInformController extends BaseController
return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform));
}
/**
* 客户验收
*/
@GetMapping("/customerCheckGoods/{shippingInformId}")
public String customerCheckGoods(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/customerCheckGoods";
}
/**
* 修改保存客户验收
*/
@RequiresPermissions("system:salesShippingInform:customerCheckGoods")
@Log(title = "销售取消发货", businessType = BusinessType.UPDATE)
@PostMapping("/customerCheckGoods")
@ResponseBody
public AjaxResult customerCheckGoodsSave(@RequestBody SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateCustomerCheckGoods(sysSalesShippingInform));
}
/**
* 客户验收 物料信息信息
*/
@PostMapping("/getMaterialListByOutOrderCode")
@ResponseBody
public TableDataInfo getMaterialListByOutOrderCode(SysSalesShippingInform sysSalesShippingInform)
{
startPage();
List<SysSalesShippingInformDetail> list = sysSalesShippingInformService.getMaterialListByOutOrderCode(sysSalesShippingInform);
return getDataTable(list);
}
}

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

@ -146,6 +146,9 @@ public class SysSalesOrderChild extends BaseEntity {
//已申请出货数
private Integer hasApplyShippingNum;
//已验收数
private Integer hasCheckNum;
private String bomId;
public Long getId() {
@ -469,6 +472,14 @@ public class SysSalesOrderChild extends BaseEntity {
this.hasApplyShippingNum = hasApplyShippingNum;
}
public Integer getHasCheckNum() {
return hasCheckNum;
}
public void setHasCheckNum(Integer hasCheckNum) {
this.hasCheckNum = hasCheckNum;
}
@Override
public String toString() {
return Objects.toStringHelper(this)
@ -511,6 +522,7 @@ public class SysSalesOrderChild extends BaseEntity {
.add("finishNum", finishNum)
.add("applyShippingNum", applyShippingNum)
.add("hasApplyShippingNum", hasApplyShippingNum)
.add("hasCheckNum", hasCheckNum)
.toString();
}
}

15
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesShippingInform.java

@ -2,6 +2,8 @@ package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -112,6 +114,10 @@ public class SysSalesShippingInform extends BaseEntity
@Excel(name = "送货日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliverTime;
/** 销售出库单详情*/
private List<SysSalesShippingInformDetail> shippingInformDetailList;
public void setShippingInformId(Long shippingInformId)
{
this.shippingInformId = shippingInformId;
@ -320,6 +326,14 @@ public class SysSalesShippingInform extends BaseEntity
return deliverTime;
}
public List<SysSalesShippingInformDetail> getShippingInformDetailList() {
return shippingInformDetailList;
}
public void setShippingInformDetailList(List<SysSalesShippingInformDetail> shippingInformDetailList) {
this.shippingInformDetailList = shippingInformDetailList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -351,6 +365,7 @@ public class SysSalesShippingInform extends BaseEntity
.append("paymentCondition", getPaymentCondition())
.append("deliveryCondition", getDeliveryCondition())
.append("deliverTime", getDeliverTime())
.append("shippingInformDetailList",getShippingInformDetailList())
.toString();
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformDetailMapper.java

@ -74,4 +74,9 @@ public interface SysSalesShippingInformDetailMapper
* @return 结果
*/
public int restoreSysSalesShippingInformDetailById(Long shippingInformDetailId);
/*
* 根据出库单号查询销售出库详情
* */
List<SysSalesShippingInformDetail> selectSysSalesShippingInformDetailByCode(String outOrderCode);
}

11
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
/**
* 销售出货通知Service接口
@ -90,4 +91,14 @@ public interface ISysSalesShippingInformService
* 修改保存取消发货
*/
int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform);
/**
* 客户验收
* */
int updateCustomerCheckGoods(SysSalesShippingInform sysSalesShippingInform);
/*
* 客户验收查询物料相关数据
* */
List<SysSalesShippingInformDetail> getMaterialListByOutOrderCode(SysSalesShippingInform sysSalesShippingInform);
}

79
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysSalesShippingInformDetailMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
@ -48,6 +49,8 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
@Autowired
private SysSalesShippingInformDetailMapper shippingInformDetailMapper;
@Autowired
private SysSalesOrderChildMapper salesOrderChildMapper;
/**
* 查询销售出货通知
*
@ -259,4 +262,80 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
return 1;
}
/**
* 客户验收
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateCustomerCheckGoods(SysSalesShippingInform sysSalesShippingInform) {
String loginName = ShiroUtils.getLoginName();
List<SysSalesShippingInformDetail> shippingInformDetailList = sysSalesShippingInform.getShippingInformDetailList();
for (SysSalesShippingInformDetail shippingInformDetail : shippingInformDetailList) {
SysSalesOrderChild sysSalesOrderChild = new SysSalesOrderChild();
sysSalesOrderChild.setMaterialCode(shippingInformDetail.getMaterialNo());
sysSalesOrderChild.setQuoteId(sysSalesShippingInform.getSalesOrderCode());
sysSalesOrderChild.setUpdateBy(loginName);
sysSalesOrderChild.setUpdateTime(new Date());
sysSalesOrderChild.setHasCheckNum(shippingInformDetail.getThisCheckNum());
int updateSysSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild);
if (updateSysSalesOrderChildResult <= 0){
throw new BusinessException("更新销售订单子表数据失败");
}
shippingInformDetail.setUpdateBy(loginName);
shippingInformDetail.setUpdateTime(new Date());
shippingInformDetail.setHasCheckNum(shippingInformDetail.getThisCheckNum());
int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(shippingInformDetail);
if (updateShippingInformDetailResult <= 0){
throw new BusinessException("更新销售出库详情数据失败");
}
}
//设置出货状态为全部验收
sysSalesShippingInform.setWarehouseOutStatus("11");
//更新出库状态
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
warehouseOutOrder.setOutOrderCode(sysSalesShippingInform.getOutOrderCode());
warehouseOutOrder.setUpdateTime(new Date());
warehouseOutOrder.setUpdateBy(loginName);
//设置为全部验收
warehouseOutOrder.setWarehouseOutStatus("12");
int updateWarehouseOutOrdeResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
if (updateWarehouseOutOrdeResult <= 0){
throw new BusinessException("更新出库单数据失败");
}
//更新销售订单状态
SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setSalesOrderCode(sysSalesShippingInform.getSalesOrderCode());
//设置为全部验收
sysSalesOrder.setDeliveryStatus("8");
sysSalesOrder.setUpdateTime(new Date());
sysSalesOrder.setUpdateBy(loginName);
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
if (updateSysSalesOrderResult <= 0){
throw new BusinessException("更新销售订单数据失败");
}
return sysSalesShippingInformMapper.updateSysSalesShippingInform(sysSalesShippingInform);
}
/*
* 客户验收查询物料相关数据
* */
@Override
public List<SysSalesShippingInformDetail> getMaterialListByOutOrderCode(SysSalesShippingInform sysSalesShippingInform) {
String outOrderCode = sysSalesShippingInform.getOutOrderCode();
if (StringUtils.isEmpty(outOrderCode)){
log.warn("出库单号为空:{}",outOrderCode);
}
List<SysSalesShippingInformDetail> list = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
return list;
}
}

9
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="finishNum" column="finish_num" />
<result property="applyShippingNum" column="apply_shipping_num" />
<result property="hasApplyShippingNum" column="has_apply_shipping_num" />
<result property="hasCheckNum" column="has_check_num" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -81,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSalesOrderChildByCodeAndNo" resultMap="SysSalesOrderChildResult">
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, brand,
warehouseDept,materialNum
warehouseDept,materialNum, has_check_num, apply_shipping_num, out_bound_quantity
from sys_sales_order_child
where quoteId = #{quoteId}
and materialCode = #{materialCode}
@ -128,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="finishNum != null">finish_num,</if>
<if test="applyShippingNum != null">apply_shipping_num,</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num,</if>
<if test="hasCheckNum != null">has_check_num,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
@ -167,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="finishNum != null">#{finishNum},</if>
<if test="applyShippingNum != null">#{applyShippingNum}</if>
<if test="hasApplyShippingNum != null">#{hasApplyShippingNum},</if>
<if test="hasCheckNum != null">#{hasCheckNum},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
@ -210,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="finishNum != null">finish_num = #{finishNum},</if>
<if test="applyShippingNum != null">apply_shipping_num = #{applyShippingNum},</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num = #{hasApplyShippingNum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="hasCheckNum != null">has_check_num = #{hasCheckNum},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
@ -255,7 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="finishNum != null">finish_num = #{finishNum},</if>
<if test="applyShippingNum != null">apply_shipping_num = #{applyShippingNum},</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num = #{hasApplyShippingNum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="hasCheckNum != null">has_check_num = #{hasCheckNum},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>

8
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformDetailMapper.xml

@ -45,7 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSysSalesShippingInformDetailVo"/>
where shipping_inform_detail_id = #{shippingInformDetailId}
</select>
<select id="selectSysSalesShippingInformDetailByCode" parameterType="String" resultMap="SysSalesShippingInformDetailResult">
<include refid="selectSysSalesShippingInformDetailVo"/>
where out_order_code = #{outOrderCode}
</select>
<insert id="insertSysSalesShippingInformDetail" parameterType="SysSalesShippingInformDetail" useGeneratedKeys="true" keyProperty="shippingInformDetailId">
insert into sys_sales_shipping_inform_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

41
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html

@ -68,6 +68,7 @@
var maintenanceEquipmentTwoFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentTwo')}]];
var confirmReceivingGoodsFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:confirmReceivingGoods')}]];
var confirmCheckGoodsFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:confirmCheckGoods')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -186,6 +187,9 @@
if (row.warehouseOutStatus=="7"){
actions.push('<a class="btn btn-success btn-xs ' + confirmReceivingGoodsFlag + '" href="javascript:void(0)" onclick="confirmReceivingGoods(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>确认收货</a> ');
}
// if (row.warehouseOutStatus=="10"){
// actions.push('<a class="btn btn-success btn-xs ' + confirmCheckGoodsFlag + '" href="javascript:void(0)" onclick="confirmCheckGoods(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>确认验收</a> ');
// }
return actions.join('');
}
}]
@ -248,6 +252,43 @@
});
}
//确认验收
function confirmCheckGoods(outOrderId) {
// 使用layer.confirm替代alert,以实现确认功能
layer.confirm("确定要验收吗?", {
title: "系统提示",
btn: ['确定', '取消'], // 自定义按钮文本
yes: function(index, layero) {
// 用户点击确定后的操作
$.ajax({
url: prefix + '/confirmCheckGoods/' + outOrderId,
type: 'GET',
dataType: 'json',
success: function(data) {
if (data.code == web_status.SUCCESS) {
// 成功后提示
layer.close(index); // 关闭当前confirm对话框
$.modal.alert("验收成功。");
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
} else {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError(data.msg);
}
},
error: function(error) {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError("验收失败。");
}
});
},
cancel: function(index, layero) {
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可
layer.close(index);
}
});
}
</script>
</body>
</html>

246
ruoyi-admin/src/main/resources/templates/system/salesShippingInform/customerCheckGoods.html

@ -0,0 +1,246 @@
<!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-customerCheckGoods-edit" th:object="${sysSalesShippingInform}">
<input name="shippingInformId" th:field="*{shippingInformId}" 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">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</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')}">
<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">
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliverTime" th:value="${#dates.format(sysSalesShippingInform.deliverTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" 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 name="customerName" th:field="*{customerName}" 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 name="customerContact" th:field="*{customerContact}" 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 name="contactNumber" th:field="*{contactNumber}" 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 name="customerContactAddress" th:field="*{customerContactAddress}" 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 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 sysSalesShippingInform = [[${sysSalesShippingInform}]];
var prefix = ctx + "system/salesShippingInform";
$("#form-customerCheckGoods-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const shippingInformData = $("#form-customerCheckGoods-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 {
"shippingInformDetailId":item.shippingInformDetailId,
"outOrderCode":item.outOrderCode,
"materialNo": item.materialNo, // 假设id对应materialId
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"makeNum": item.makeNum,
"thisShippingNum": item.thisShippingNum,
"hasOutOrderSum": item.hasOutOrderSum,
"hasCheckNum": item.hasCheckNum,
"thisCheckNum": item.thisCheckNum,
// ...其他字段
};
});
const combinedData = Object.assign({}, shippingInformData, {
shippingInformDetailList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/customerCheckGoods", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/getMaterialListByOutOrderCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '销售出库单详情ID',
field: 'shippingInformDetailId',
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: 'thisShippingNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '已验收数',
field: 'hasCheckNum',
},
{
title: '本次验收数',
field: 'thisCheckNum',
editable:true,
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: sysSalesShippingInform.outOrderCode
};
return curParams;
}
</script>
</body>
</html>

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

@ -226,6 +226,10 @@
if(row.warehouseOutStatus == '2'){
actions.push('<a class="btn btn-success btn-xs ' + confirmShippingFlag + '" href="javascript:void(0)" onclick="confirmShipping(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认发货</a> ');
}
if(row.warehouseOutStatus == '10' || row.warehouseOutStatus == '11'){
actions.push('<a class="btn btn-success btn-xs ' + confirmShippingFlag + '" href="javascript:void(0)" onclick="customerCheckGoods(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认验收</a> ');
}
return actions.join('');
}
}]
@ -238,6 +242,12 @@
var url = prefix +'/confirmShipping/' + shippingInformId;
$.modal.open("确认发货",url);
}
//客户验收
function customerCheckGoods(shippingInformId){
var url = prefix +'/customerCheckGoods/' + shippingInformId;
$.modal.open("客户验收",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save