Browse Source

[feat]售后管理:

售后维护设备出库
新增添加设备页面
新增详情页面
新增详情物料VO类
新增添加出货设备VO类
出货设备表格新增关联销售订单编号
新增根据销售订单号查询物料信息
新增根据销售订单号查询出货设备信息
dev
liuxiaoxu 7 months ago
parent
commit
c7eecd20cb
  1. 108
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/WarehouseOutOrderController.java
  2. 16
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java
  3. 35
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectMaterialsVO.java
  4. 22
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
  5. 9
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  6. 24
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IWarehouseOutOrderService.java
  7. 108
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/WarehouseOutOrderServiceImpl.java
  8. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java
  9. 8
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  10. 106
      ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html
  11. 186
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html
  12. 198
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/detail.html
  13. 33
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html

108
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/WarehouseOutOrderController.java

@ -1,6 +1,11 @@
package com.ruoyi.aftersales.controller;
import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOrder;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -113,38 +118,105 @@ public class WarehouseOutOrderController extends BaseController
}
/**
* 删除出库单
* 查看出库单详情
*/
@RequiresPermissions("aftersales:warehouseOutOrder:remove")
@Log(title = "出库单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@GetMapping("/detail/{outOrderId}")
public String detail(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
{
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId);
mmap.put("warehouseOutOrder", warehouseOutOrder);
return prefix + "/detail";
}
/**
* 修改保存出库单详情
*/
@RequiresPermissions("aftersales:warehouseOutOrder:edit")
@Log(title = "出库单", businessType = BusinessType.UPDATE)
@PostMapping("/detail")
@ResponseBody
public AjaxResult remove(String ids)
public AjaxResult detailSave(WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.deleteWarehouseOutOrderByIds(ids));
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder));
}
/**
* 作废出库单
* 物料新增出货设备
*/
@RequiresPermissions("aftersales:warehouseOutOrder:cancel")
@Log(title = "出库单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@GetMapping("/addShippingDevices/{quoteId}/{materialCode}")
public String addShippingDevices(@PathVariable("quoteId") String quoteId,
@PathVariable("materialCode") String materialCode,
ModelMap mmap) {
SelectMaterialsVO selectMaterialsVO = warehouseOutOrderService.selectShippingDevicesById(quoteId, materialCode);
// 假设您还需要根据materialCode获取额外信息,可以在这里添加逻辑
mmap.put("selectMaterialsVO", selectMaterialsVO);
return prefix + "/addShippingDevices";
}
/**
* 修改保存出货设备
*/
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevices")
@Log(title = "出库单", businessType = BusinessType.INSERT)
@PostMapping("/addShippingDevices")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(warehouseOutOrderService.cancelWarehouseOutOrderById(id));
public AjaxResult addShippingDevicesSave(WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder));
}
/**
* 恢复出库单
* 查询物料信息列表
*/
@RequiresPermissions("aftersales:warehouseOutOrder:restore")
@Log(title = "出库单", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@RequiresPermissions("aftersales:warehouseOutOrder:optionMaterials")
@PostMapping("/optionMaterials")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
public TableDataInfo optionMaterials(WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.restoreWarehouseOutOrderById(id));
startPage();
List<SelectMaterialsVO> list = warehouseOutOrderService.selectMaterialBySalesOrderCode(warehouseOutOrder);
return getDataTable(list);
}
/**
* 添加出货设备查询物料信息
*/
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesMaterial")
@PostMapping("/addShippingDevicesMaterial")
@ResponseBody
public TableDataInfo optionMaterial(SelectMaterialsVO selectMaterialsVO)
{
startPage();
List<SelectMaterialsVO> list = warehouseOutOrderService.selectMaterialByMaterialCode(selectMaterialsVO);
return getDataTable(list);
}
/**
* 添加出货设备查询出货设备信息
*/
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesOptions")
@PostMapping("/addShippingDevicesOptions")
@ResponseBody
public TableDataInfo addShippingDevicesOptions(SelectMaterialsVO selectMaterialsVO)
{
startPage();
List<SelectShippingDeviceVO> list = warehouseOutOrderService.selectShippingDeviceBySalesOrderCode(selectMaterialsVO);
return getDataTable(list);
}
/**
* 删除出库单
*/
@RequiresPermissions("aftersales:warehouseOutOrder:remove")
@Log(title = "出库单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(warehouseOutOrderService.deleteWarehouseOutOrderByIds(ids));
}

16
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java

@ -29,6 +29,10 @@ public class AfterSalesShippingDevice extends BaseEntity
@Excel(name = "关联单号")
private String makeNo;
/** 关联销售单号 */
@Excel(name = "关联销售单号")
private String salesOrderCode;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
@ -182,7 +186,16 @@ public class AfterSalesShippingDevice extends BaseEntity
{
return makeNo;
}
public void setMaterialNo(String materialNo)
public String getSalesOrderCode() {
return salesOrderCode;
}
public void setSalesOrderCode(String salesOrderCode) {
this.salesOrderCode = salesOrderCode;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
@ -457,6 +470,7 @@ public class AfterSalesShippingDevice extends BaseEntity
.append("shippingDeviceCode", getShippingDeviceCode())
.append("shippingDeviceId", getShippingDeviceId())
.append("makeNo", getMakeNo())
.append("salesOrderCode()", getSalesOrderCode())
.append("materialNo", getMaterialNo())
.append("materialPhotourl", getMaterialPhotourl())
.append("materialName", getMaterialName())

35
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectMaterialsVO.java

@ -0,0 +1,35 @@
package com.ruoyi.aftersales.domain.vo;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
@Data
public class SelectMaterialsVO {
/*销售订单号*/
private String quoteId;
/*料号*/
private String materialCode;
/** 物料的名称 */
private String materialName;
/** 物料的类型 */
private String materialType;
/** 物料的加工方式 */
private String processMethod;
/** 物料的品牌 */
private String brand;
/** 物料单位*/
private String unit;
/** 物料的图片 */
private String photoUrl;
/** 物料的描述 */
private String describe;
}

22
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java

@ -0,0 +1,22 @@
package com.ruoyi.aftersales.domain.vo;
import lombok.Data;
/**
* 添加出货设备时新增出货设备列表
*/
@Data
public class SelectShippingDeviceVO {
private String quoteId;
private String shippingDeviceId;
private String deviceModelCode;
private String deviceRunningNumber;
private String makePhotoUrl;
}

9
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java

@ -36,6 +36,15 @@ public interface AfterSalesShippingDeviceMapper
*/
public List<AfterSalesShippingDevice> selectAfterSalesShippingDeviceList(AfterSalesShippingDevice afterSalesShippingDevice);
/**
* 查询出货设备列表
*
* @param salesOrderCode 销售订单号
* @return 出货设备集合
*/
public List<AfterSalesShippingDevice> selectShippingDeviceBySalesOrderCode(String salesOrderCode);
/**
* 新增出货设备
*

24
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IWarehouseOutOrderService.java

@ -2,6 +2,9 @@ package com.ruoyi.aftersales.service;
import java.util.List;
import com.ruoyi.aftersales.domain.WarehouseOutOrder;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
/**
* 出库单Service接口
@ -27,6 +30,23 @@ public interface IWarehouseOutOrderService
*/
public List<WarehouseOutOrder> selectWarehouseOutOrderList(WarehouseOutOrder warehouseOutOrder);
/**
* 查询关联销售单的物料列表
*
* @param salesOrderCode 销售单号
* @return 出库单集合
*/
public List<SelectMaterialsVO> selectMaterialBySalesOrderCode(WarehouseOutOrder warehouseOutOrder);
/**
* 查询添加出货设备的物料列表
*
* @param salesOrderCode 销售单号
* @return 出库单集合
*/
public List<SelectMaterialsVO> selectMaterialByMaterialCode(SelectMaterialsVO selectMaterialsVO);
/**
* 新增出库单
*
@ -72,4 +92,8 @@ public interface IWarehouseOutOrderService
* @return
*/
int restoreWarehouseOutOrderById(Long outOrderId);
SelectMaterialsVO selectShippingDevicesById(String quoteId, String materialCode);
List<SelectShippingDeviceVO> selectShippingDeviceBySalesOrderCode(SelectMaterialsVO selectMaterialsVO);
}

108
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/WarehouseOutOrderServiceImpl.java

@ -1,9 +1,21 @@
package com.ruoyi.aftersales.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.implementation.bytecode.Throw;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.mapper.WarehouseOutOrderMapper;
import com.ruoyi.aftersales.domain.WarehouseOutOrder;
@ -17,11 +29,18 @@ import com.ruoyi.common.core.text.Convert;
* @date 2024-04-23
*/
@Service
@Slf4j
public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
{
@Autowired
private WarehouseOutOrderMapper warehouseOutOrderMapper;
@Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper;
@Autowired
private AfterSalesShippingDeviceMapper shippingDeviceMapper;
/**
* 查询出库单
*
@ -46,6 +65,93 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
return warehouseOutOrderMapper.selectWarehouseOutOrderList(warehouseOutOrder);
}
@Override
public List<SelectMaterialsVO> selectMaterialBySalesOrderCode(WarehouseOutOrder warehouseOutOrder) {
List<SelectMaterialsVO> selectMaterialsVOs = new ArrayList<>();
List<SysSalesOrderChild> sysSalesOrderChildren = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(warehouseOutOrder.getSalesOrderCode());
if (!StringUtils.isNotEmpty(sysSalesOrderChildren)){
// 记录日志
log.warn("未查找到与销售订单关联的物料数据, 销售订单编码: {}", warehouseOutOrder.getSalesOrderCode());
throw new RuntimeException("未查找到物料相关数据");
}
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildren) {
SelectMaterialsVO selectMaterialsVO = new SelectMaterialsVO();
selectMaterialsVO.setQuoteId(sysSalesOrderChild.getQuoteId());
selectMaterialsVO.setMaterialCode(sysSalesOrderChild.getMaterialCode());
selectMaterialsVO.setMaterialName(sysSalesOrderChild.getMaterialName());
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType());
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand());
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe());
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit());
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl());
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod());
selectMaterialsVOs.add(selectMaterialsVO);
}
return selectMaterialsVOs;
}
@Override
public SelectMaterialsVO selectShippingDevicesById(String quoteId, String materialCode) {
SelectMaterialsVO selectMaterialsVO = new SelectMaterialsVO();
SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(quoteId, materialCode);
if (StringUtils.isNotNull(sysSalesOrderChild)){
selectMaterialsVO.setQuoteId(quoteId);
selectMaterialsVO.setMaterialCode(materialCode);
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType());
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand());
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe());
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit());
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl());
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod());
}
return selectMaterialsVO;
}
/*根据销售单号查询出货设备信息*/
@Override
public List<SelectShippingDeviceVO> selectShippingDeviceBySalesOrderCode(SelectMaterialsVO selectMaterialsVO) {
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>();
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceBySalesOrderCode(selectMaterialsVO.getQuoteId());
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) {
// 记录日志
log.warn("未查找到与销售订单关联的出库设备数据, 销售订单编码: {}", selectMaterialsVO.getQuoteId());
throw new RuntimeException("未查找到物料相关数据");
}
for (AfterSalesShippingDevice afterSalesShippingDevice : afterSalesShippingDevices) {
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO();
shippingDeviceVO.setShippingDeviceId(afterSalesShippingDevice.getShippingDeviceId());
shippingDeviceVO.setDeviceModelCode(afterSalesShippingDevice.getDeviceModelCode());
shippingDeviceVO.setDeviceRunningNumber(afterSalesShippingDevice.getDeviceRunningNumber());
shippingDeviceVO.setMakePhotoUrl(afterSalesShippingDevice.getMakePhotourl());
shippingDeviceVO.setQuoteId(afterSalesShippingDevice.getSalesOrderCode());
selectShippingDeviceVOs.add(shippingDeviceVO);
}
return selectShippingDeviceVOs;
}
@Override
public List<SelectMaterialsVO> selectMaterialByMaterialCode(SelectMaterialsVO selectMaterialsVO) {
List<SelectMaterialsVO> selectMaterialsVOs = new ArrayList<>();
SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(selectMaterialsVO.getQuoteId(), selectMaterialsVO.getMaterialCode());
if (StringUtils.isNotNull(sysSalesOrderChild)){
// selectMaterialsVO.setQuoteId(selectMaterialsVO.getQuoteId());
// selectMaterialsVO.setMaterialCode(selectMaterialsVO.getMaterialCode());
selectMaterialsVO.setMaterialName(sysSalesOrderChild.getMaterialName());
selectMaterialsVO.setMaterialType(sysSalesOrderChild.getMaterialType());
selectMaterialsVO.setBrand(sysSalesOrderChild.getBrand());
selectMaterialsVO.setDescribe(sysSalesOrderChild.getDescribe());
selectMaterialsVO.setUnit(sysSalesOrderChild.getUnit());
selectMaterialsVO.setPhotoUrl(sysSalesOrderChild.getPhotoUrl());
selectMaterialsVO.setProcessMethod(sysSalesOrderChild.getProcessMethod());
selectMaterialsVOs.add(selectMaterialsVO);
}
return selectMaterialsVOs;
}
/**
* 新增出库单
*
@ -123,4 +229,6 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
{
return warehouseOutOrderMapper.restoreWarehouseOutOrderById(outOrderId);
}
}

11
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java

@ -285,6 +285,17 @@ public class SysCustomerController extends BaseController
List<SysCustomer> list = sysCustomerService.selectSysCustomerToList();
return getDataTable(list);
}
/**
* 客诉报告查询客户信息
* */
@ResponseBody
@GetMapping("/getCustomers")
public List<SysCustomer> getCustomers() {
List<SysCustomer> list = sysCustomerService.selectSysCustomerToList();
return list;
}
@RequiresPermissions("system:customer:audit")
@PostMapping("/operList")
@ResponseBody

8
ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="shippingDeviceCode" column="shipping_device_code" />
<result property="shippingDeviceId" column="shipping_device_id" />
<result property="makeNo" column="make_no" />
<result property="salesOrderCode" column="sales_order_code" />
<result property="materialNo" column="material_no" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="materialName" column="material_name" />
@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectAfterSalesShippingDeviceVo">
select shipping_device_code, shipping_device_id, make_no, material_no, material_photoUrl, material_name, material_type, material_class, material_model_code, material_unit, material_brand, material_describe, device_model_code, device_running_number, make_photoUrl, sn_code, aftersales_photoUrl, factory_date, guarantee_period, guarantee_period_flag, lock_date, lock_date_flag, wastage_expire_date, wastage_expire_flag, component_guarantee_date, component_guarantee_flag, engineer_name, salesman_name, make_name,customer_id, customer_name, maintain_order_code, maintain_time, create_by, create_time, update_by, update_time from aftersales_shipping_device
select shipping_device_code, shipping_device_id, make_no,sales_order_code, material_no, material_photoUrl, material_name, material_type, material_class, material_model_code, material_unit, material_brand, material_describe, device_model_code, device_running_number, make_photoUrl, sn_code, aftersales_photoUrl, factory_date, guarantee_period, guarantee_period_flag, lock_date, lock_date_flag, wastage_expire_date, wastage_expire_flag, component_guarantee_date, component_guarantee_flag, engineer_name, salesman_name, make_name,customer_id, customer_name, maintain_order_code, maintain_time, create_by, create_time, update_by, update_time from aftersales_shipping_device
</sql>
<select id="selectAfterSalesShippingDeviceList" parameterType="AfterSalesShippingDevice" resultMap="AfterSalesShippingDeviceResult">
@ -81,6 +82,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where make_no = #{makeNo}
</select>
<select id="selectShippingDeviceBySalesOrderCode" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where sales_order_code = #{salesOrderCode}
</select>
<insert id="insertAfterSalesShippingDevice" parameterType="AfterSalesShippingDevice" useGeneratedKeys="true" keyProperty="shippingDeviceCode">
insert into aftersales_shipping_device
<trim prefix="(" suffix=")" suffixOverrides=",">

106
ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html

@ -6,22 +6,23 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-complaintNotice-add">
<div class="form-group">
<label class="col-sm-3 control-label">客诉单号:</label>
<div class="form-group">
<label class="col-sm-4 control-label">客户编号:</label>
<div class="col-sm-8">
<input name="complaintNoticeCode" class="form-control" type="text">
<select class="form-control" id="customerId" name="customerId" required>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产单号</label>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称</label>
<div class="col-sm-8">
<input name="makeNo" class="form-control" type="text">
<input name="customerName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户ID</label>
<div class="form-group">
<label class="col-sm-3 control-label">生产单号</label>
<div class="col-sm-8">
<input name="userId" class="form-control" type="text">
<input name="makeNo" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -33,62 +34,31 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否结案:</label>
<div class="col-sm-8">
<select name="closingProcedures" class="form-control m-b" th:with="type=${@dict.getType('aftersales_closing_procedures')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="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" 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="materialNo" 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="materialName" 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="materialSum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量合计:</label>
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input name="enterpriseSum" class="form-control" type="text">
<input name="remark" 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="deliveryGoodsNum" class="form-control" type="text">
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
<a class="btn btn-danger multiple disabled" onclick="insertNRow()">
<i class="fa fa-remove"></i> 添加无料号物料
</a>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-quoteChild"></table>
</div>
</div>
</form>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
@ -102,6 +72,26 @@
$.operate.save(prefix + "/add", $('#form-complaintNotice-add').serialize());
}
}
//获取客户信息
$(document).ready(function() {
// 初始化客户编号下拉框
$.getJSON(ctx + "system/customer/getCustomers", function(customers) {
$.each(customers, function(index, customer) {
$('#customerId').append(new Option(customer.customerId, customer.customerId));
});
});
// 监听客户编号选择事件
$('#customerId').on('change', function() {
const customerId = $(this).val();
$.getJSON(prefix + "/getCustomerDetails?customerId=" + encodeURIComponent(customerId), function(customer) {
$('#customerName').val(customer.customerName);
});
});
});
</script>
</body>
</html>

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

@ -0,0 +1,186 @@
<!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-warehouseOutOrder-edit" th:object="${selectMaterialsVO}">
<!-- <input name="quoteId" th:field="*{quoteId}" type="hidden">-->
<!-- <input name="materialCode" th:field="*{materialCode}" type="hidden">-->
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">物料信息</h3>
<table id="table-material"></table>
</div>
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">出货设备</h3>
<table id="table-shippingDevices"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
var prefix = ctx + "aftersales/warehouseOutOrder";
var selectMaterialsVO = [[${selectMaterialsVO}]];
$("#form-warehouseOutOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize());
}
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='planDeliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*物料信息列表*/
$(function() {
// 物料信息
$('#table-material').bootstrapTable('destroy');
var materialOptions = {
id:"table-material",
url: prefix + "/addShippingDevicesMaterial",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title: '料号',
field: 'materialCode',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
]
};
$.table.init(materialOptions);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
quoteId: selectMaterialsVO.quoteId,
materialCode: selectMaterialsVO.materialCode,
};
return curParams;
}
/* 出货设备列表 */
$(function() {
// 物料信息
$('#table-shippingDevices').bootstrapTable('destroy');
var shippingDevicesOptions = {
id: "table-shippingDevices",
url: prefix + "/addShippingDevicesOptions",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh: false,
showSearch: false,
queryParams:shippingDevicesQueryParams,
columns: [
{
checkbox: true // 保留原有全选checkbox
},
{
title: '销售订单号',
field: 'quoteId',
visible: false
},
{
title: '出货设备ID',
field: 'shippingDeviceId',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '流水号',
field: 'deviceRunningNumber',
},
{
title: '生产图片',
field: 'makePhotoUrl',
},
{
title: '确认添加', // 修改标题为操作
align: 'center',
// formatter: function(value, row, index) {
// // 自定义操作列内容,包含一个确认添加按钮和一个独立的checkbox
// var checkboxHtml = '<input type="checkbox" value="' + row.shippingDeviceId + '" class="custom-checkbox">';
// var addButtonHtml = '<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>';
// return checkboxHtml + ' ' + addButtonHtml;
// },
// events: { // 添加事件处理器
// 'click .custom-checkbox': function(e, value, row, index) {
// // 这里可以添加点击checkbox时的处理逻辑
// var checkbox = e.target;
// console.log("Checkbox for device ID: " + row.shippingDeviceId + " was clicked. Checked: " + checkbox.checked);
// }
// }
}
]
};
$.table.init(shippingDevicesOptions);
});
function shippingDevicesQueryParams(params) {
var curParams = {
// 传递参数查询参数
quoteId: selectMaterialsVO.quoteId,
};
return curParams;
}
</script>
</body>
</html>

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

@ -0,0 +1,198 @@
<!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-warehouseOutOrder-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">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出库对象:</label>
<div class="col-sm-8">
<input name="outOrderName" th:field="*{outOrderName}" 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">
<input name="applyName" th:field="*{applyName}" 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="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">
<select name="warehouseOutStatus" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutStatus}"></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">
</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="deliveryName" th:field="*{deliveryName}" 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="deliveryNumber" th:field="*{deliveryNumber}" 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="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text">
</div>
</div>
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">物料信息</h3>
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevices')}]];
var prefix = ctx + "aftersales/warehouseOutOrder";
var warehouseOutOrder = [[${warehouseOutOrder}]];
$("#form-warehouseOutOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize());
}
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='planDeliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
var options = {
url: prefix + "/optionMaterials",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title: '料号',
field: 'materialCode',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.quoteId + '\',\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>');
return actions.join('');
}
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
salesOrderCode: warehouseOutOrder.salesOrderCode
};
return curParams;
}
/*添加出货设备*/
function addShippingDevices(quoteId, materialCode) {
// 确保URL编码,特别是如果materialCode中可能含有特殊字符
var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevices/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode);
$.modal.open("添加出货设备", url);
}
</script>
</body>
</html>

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

@ -54,21 +54,6 @@
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="aftersales:warehouseOutOrder:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="aftersales:warehouseOutOrder:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="aftersales:warehouseOutOrder:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="aftersales:warehouseOutOrder:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- </div>-->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
@ -77,6 +62,7 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:edit')}]];
var detailFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:detail')}]];
var removeFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:restore')}]];
@ -186,19 +172,22 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.outOrderId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
/*详情*/
function detail(outOrderId ) {
// 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数
// 示例逻辑:
var url = ctx + 'aftersales/warehouseOutOrder/detail/'+outOrderId;
$.modal.open("详情",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save