Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
#	ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
#	ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
#	ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
#	ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
#	ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
#	ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html
dev
zhangsiqi 4 months ago
parent
commit
baa4a941e0
  1. 66
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
  2. 20
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
  4. 86
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  5. 55
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  6. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  7. 48
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  8. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java
  9. 8
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml
  10. 4
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html
  11. 405
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentTwo.html
  12. 16
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html
  13. 35
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html
  14. 49
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html
  15. 19
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

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

@ -182,7 +182,6 @@ public class AftersalesWarehouseOutController extends BaseController
/**
* 添加出货设备查询物料信息
*/
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesMaterial")
@PostMapping("/addShippingDevicesMaterial")
@ResponseBody
public TableDataInfo optionMaterial(SelectMaterialsVO selectMaterialsVO)
@ -196,7 +195,6 @@ public class AftersalesWarehouseOutController extends BaseController
/**
* 添加出货设备查询出货设备信息
*/
@RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesOptions")
@PostMapping("/addShippingDevicesOptions")
@ResponseBody
public TableDataInfo addShippingDevicesOptions(SelectMaterialsVO selectMaterialsVO)
@ -220,9 +218,6 @@ public class AftersalesWarehouseOutController extends BaseController
}
/**
* 售后第一次维护设备
*/
@ -263,9 +258,9 @@ public class AftersalesWarehouseOutController extends BaseController
/**
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息
*/
@PostMapping("/showAftersalesShippingDeviceList")
@PostMapping("/showAftersalesShippingDeviceListOne")
@ResponseBody
public TableDataInfo showAftersalesShippingDeviceList(@RequestParam("materialNo") String materialNo)
public TableDataInfo showAftersalesShippingDeviceListOne(@RequestParam("materialNo") String materialNo)
{
startPage();
@ -287,14 +282,12 @@ public class AftersalesWarehouseOutController extends BaseController
return prefix + "/addShippingDevicesOne";
}
/**
* 修改保存售后第一次维护设备 添加出货设备信息
*/
@ResponseBody
@PostMapping("/addShippingDevicesOne")
public AjaxResult addShippingDevicesOne(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail)
public AjaxResult addShippingDevicesOneSave(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail)
{
return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail));
@ -330,4 +323,57 @@ public class AftersalesWarehouseOutController extends BaseController
/**
* 售后第二次维护设备
*/
@GetMapping("/maintenanceEquipmentTwo/{outOrderId}")
public String maintenanceEquipmentTwo(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
{
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId);
mmap.put("warehouseOutOrder", warehouseOutOrder);
return prefix + "/maintenanceEquipmentTwo";
}
/**
* 修改保存售后第二次维护设备
*/
@RequiresPermissions("aftersales:warehouseOutOrder:maintenanceEquipmentTwo")
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE)
@PostMapping("/maintenanceEquipmentTwo")
@ResponseBody
public AjaxResult maintenanceEquipmentTwoSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentTwo(warehouseOutOrder));
}
/**
* 展示售后第二次维护设备物料信息
* */
@PostMapping("/getMaintenanceEquipmentTwoMaterials")
@ResponseBody
public TableDataInfo getMaintenanceEquipmentTwoMaterials(WarehouseOutOrder warehouseOutOrder)
{
startPage();
List<WarehouseOutOrderDetail> list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder);
return getDataTable(list);
}
/**
* 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息
*/
@PostMapping("/showAftersalesShippingDeviceListTwo")
@ResponseBody
public TableDataInfo showAftersalesShippingDeviceListTwo(@RequestParam("materialNo") String materialNo)
{
startPage();
List<SelectShippingDeviceVO> list = warehouseOutOrderService.showAftersalesShippingDeviceListTwo(materialNo);
return getDataTable(list);
}
}

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

@ -1,5 +1,7 @@
package com.ruoyi.aftersales.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
/**
* 添加出货设备时新增出货设备列表
@ -20,5 +22,23 @@ public class SelectShippingDeviceVO {
private String snCode;
/** 出厂日期 */
private String factoryDate;
/** 保修期 */
private String guaranteePeriod;
/** 锁机时间 */
private String lockDate;
/** 是否有锁机时间 */
private String lockDateFlag;
/** 损耗品到期时间 */
private String wastageExpireDate;
/** 二次维修后部件质保时间 */
private String componentGuaranteeDate;
}

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

@ -129,4 +129,15 @@ public interface IAftersalesWarehouseOutService
* 修改保存售后第一次维护设备
*/
int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder);
/**
* 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息
*/
List<SelectShippingDeviceVO> showAftersalesShippingDeviceListTwo(String materialNo);
/**
* 修改保存售后第二次维护设备
*/
int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder);
}

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

@ -290,6 +290,92 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/**
* 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息
*/
@Override
public List<SelectShippingDeviceVO> showAftersalesShippingDeviceListTwo(String materialNo) {
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>();
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMaterialNo(materialNo);
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice);
List<AfterSalesShippingDevice> filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList());
if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) {
// 记录日志
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo);
}
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) {
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO();
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId());
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode());
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber());
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl());
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode());
shippingDeviceVO.setSnCode(tempAfterSalesShippingDevice.getSnCode());
shippingDeviceVO.setFactoryDate(tempAfterSalesShippingDevice.getFactoryDate());
shippingDeviceVO.setGuaranteePeriod(tempAfterSalesShippingDevice.getGuaranteePeriod());
shippingDeviceVO.setLockDate(tempAfterSalesShippingDevice.getLockDate());
shippingDeviceVO.setLockDateFlag(tempAfterSalesShippingDevice.getLockDateFlag());
shippingDeviceVO.setWastageExpireDate(tempAfterSalesShippingDevice.getWastageExpireDate());
shippingDeviceVO.setComponentGuaranteeDate(tempAfterSalesShippingDevice.getComponentGuaranteeDate());
selectShippingDeviceVOs.add(shippingDeviceVO);
}
return selectShippingDeviceVOs;
}
/**
* 修改保存售后第二次维护设备
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder) {
String loginName = ShiroUtils.getLoginName();
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList();
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) {
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId());
afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode());
afterSalesShippingDevice.setFactoryDate(selectShippingDeviceVO.getFactoryDate());
afterSalesShippingDevice.setGuaranteePeriod(selectShippingDeviceVO.getGuaranteePeriod());
afterSalesShippingDevice.setLockDate(selectShippingDeviceVO.getLockDate());
afterSalesShippingDevice.setLockDateFlag(selectShippingDeviceVO.getLockDateFlag());
afterSalesShippingDevice.setWastageExpireDate(selectShippingDeviceVO.getWastageExpireDate());
afterSalesShippingDevice.setComponentGuaranteeDate(selectShippingDeviceVO.getComponentGuaranteeDate());
afterSalesShippingDevice.setUpdateBy(loginName);
afterSalesShippingDevice.setUpdateTime(new Date());
int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice);
if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新出货设备数据失败");
}
}
//设置出库单为待业务确认发货
warehouseOutOrder.setWarehouseOutStatus("4");
//更新销售管理销售出库的出货状态 待业务确认发货
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode());
sysSalesShippingInform.setWarehouseOutStatus("4");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateShippingInformResult <= 0){
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode());
throw new BusinessException("更新销售出库单数据失败");
}
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/*
* 售后第一次维护设备信息根据设备ID删除出货设备信息
* */

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

@ -1,15 +1,13 @@
package com.ruoyi.system.controller;
import java.util.List;
import com.ruoyi.system.domain.SysSalesOrder;
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 org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysSalesShippingInform;
@ -147,5 +145,52 @@ public class SysSalesShippingInformController extends BaseController
return toAjax(sysSalesShippingInformService.restoreSysSalesShippingInformById(id));
}
/**
* 确认发货
*/
@GetMapping("/confirmShipping/{shippingInformId}")
public String confirmShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/confirmShipping";
}
/**
* 修改保存确认发货
*/
@RequiresPermissions("system:salesShippingInform:confirmShipping")
@Log(title = "销售确认发货", businessType = BusinessType.UPDATE)
@PostMapping("/confirmShipping")
@ResponseBody
public AjaxResult confirmShippingSave(SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateConfirmShipping(sysSalesShippingInform));
}
/**
* 取消发货
*/
@GetMapping("/cancelShipping/{shippingInformId}")
public String cancelShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/cancelShipping";
}
/**
* 修改保存取消发货
*/
@RequiresPermissions("system:salesShippingInform:cancelShipping")
@Log(title = "销售取消发货", businessType = BusinessType.UPDATE)
@PostMapping("/cancelShipping")
@ResponseBody
public AjaxResult cancelShippingSave(SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform));
}
}

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

@ -79,4 +79,15 @@ public interface ISysSalesShippingInformService
* 通过销售发起出货生成销售出货通知单列表
* */
int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode);
/**
* 修改保存确认发货
*/
int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform);
/**
* 修改保存取消发货
*/
int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform);
}

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

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
@ -12,6 +13,8 @@ import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -19,6 +22,7 @@ import com.ruoyi.system.mapper.SysSalesShippingInformMapper;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.service.ISysSalesShippingInformService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 销售出货通知Service业务层处理
@ -28,7 +32,7 @@ import com.ruoyi.common.core.text.Convert;
*/
@Slf4j
@Service
public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService
public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService
{
@Autowired
private SysSalesShippingInformMapper sysSalesShippingInformMapper;
@ -39,6 +43,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
@Autowired
private RedisCache redisCache;
@Autowired
private WarehouseOutOrderMapper warehouseOutOrderMapper;
/**
* 查询销售出货通知
*
@ -174,4 +181,43 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform);
}
/**
* 修改保存确认发货
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform) {
String loginName = ShiroUtils.getLoginName();
//设置出库状态为 待设备维护2
sysSalesShippingInform.setWarehouseOutStatus("3");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
//更新出库单数据
String outOrderCode = sysSalesShippingInform.getOutOrderCode();
if (StringUtils.isEmpty(outOrderCode)){
log.warn("出库单号为空:{}",outOrderCode);
}
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderByCode(outOrderCode);
warehouseOutOrder.setWarehouseOutStatus("3");
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
if (updateWarehouseOutOrderResult <= 0){
throw new BusinessException("更新出库单数据失败");
}
return sysSalesShippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
}
/**
* 修改保存取消发货 后续完善
*/
@Override
public int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform) {
return 1;
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java

@ -83,4 +83,9 @@ public interface WarehouseOutOrderMapper
* @return 结果
*/
public int restoreWarehouseOutOrderById(Long outOrderId);
/*
* 根据出库单号查询出库单数据
* */
WarehouseOutOrder selectWarehouseOutOrderByCode(String outOrderCode);
}

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

@ -89,6 +89,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWarehouseOutOrderVo"/>
where out_order_id = #{outOrderId}
</select>
<select id="selectWarehouseOutOrderByCode" parameterType="String" resultMap="WarehouseOutOrderResult">
<include refid="selectWarehouseOutOrderVo"/>
where out_order_code = #{outOrderCode}
</select>
<insert id="insertWarehouseOutOrder" parameterType="WarehouseOutOrder" useGeneratedKeys="true" keyProperty="outOrderId">
insert into warehouse_out_order

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

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改出库单')" />
<th:block th:include="include :: header('售后维护设备1')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
@ -238,7 +238,7 @@
var childTableId = 'child_table_'+index;
$detail.html('<table id="'+childTableId+'"></table>');
$('#'+childTableId).bootstrapTable({
url: prefix + "/showAftersalesShippingDeviceList",
url: prefix + "/showAftersalesShippingDeviceListOne",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",

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

@ -0,0 +1,405 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('售后维护设备2')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-maintenanceEquipmentTwo-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">
<div class="input-group date">
<input name="deliveryDate" th:value="${#dates.format(warehouseOutOrder.deliveryDate, '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="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" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevices')}]];
var prefix = ctx + "aftersales/warehouseOutOrder";
var warehouseOutOrder = [[${warehouseOutOrder}]];
$("#form-maintenanceEquipmentTwo-edit").validate({
focusCleanup: true
});
$("input[name='deliveryDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
// 获取表单数据
const shippingDevicesData = $("#form-maintenanceEquipmentTwo-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 在需要收集所有子表数据的地方调用此函数
var allSubData = getAllSubTablesData();
// 将表数据转换成与complaintNoticeData格式一致的数组
var equipDetailDataList = allSubData.map(function(item) {
// 根据实际字段名调整
return {
"shippingDeviceId": item.shippingDeviceId,
"deviceModelCode": item.deviceModelCode,
"deviceRunningNumber": item.deviceRunningNumber,
"makePhotoUrl": item.makePhotoUrl,
"snCode": item.snCode,
"factoryDate": item.factoryDate,
"guaranteePeriod": item.guaranteePeriod,
"lockDateFlag": item.lockDateFlag,
"lockDate": item.lockDate,
"wastageExpireDate": item.wastageExpireDate,
"componentGuaranteeDate": item.componentGuaranteeDate
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/maintenanceEquipmentTwo", jsonData);
}
$("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 = {
id:'bootstrap-table',
url: prefix + "/getMaintenanceEquipmentTwoMaterials",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title:'出库单详情Id',
field:'outOrderDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '准备出库数',
field: 'prepareOutOrderSum',
},
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var childTableId = 'child_table_'+index;
$detail.html('<table id="'+childTableId+'"></table>');
$('#'+childTableId).bootstrapTable({
url: prefix + "/showAftersalesShippingDeviceListTwo",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
// salesOrderCode: warehouseOutOrder.salesOrderCode,
materialNo: parentRow.materialNo
},
columns: [
{
title: '出货设备ID',
field: 'shippingDeviceId',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '流水号',
field: 'deviceRunningNumber',
},
{
title: '设备SN号',
field: 'snCode',
align: 'center',
editable:true
},
{
title: '出库日期',
field: 'factoryDate',
align: 'center',
editable:{
type:'date',
title: '出库日期',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '保修期',
field: 'guaranteePeriod',
align: 'center',
editable:true
},
{
title: '是否有锁机时间',
field: 'lockDateFlag',
align: 'center',
editable: {
type: 'select',
title: '是否有锁机时间',
source:[{value:"0",text:"是"},{value:"1",text:"否"}]
}
},
{
title: '锁机时间',
field: 'lockDate',
align: 'center',
editable:{
type:'date',
title: '锁机时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '损耗品到期时间',
field: 'wastageExpireDate',
align: 'center',
editable:{
type:'date',
title: '损耗品到期时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '二次维修后部件质保时间',
field: 'componentGuaranteeDate',
align: 'center',
editable:{
type:'date',
title: '二次维修后部件质保时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteRow(\'' + row.shippingDeviceId + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}
],
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: warehouseOutOrder.outOrderCode
};
return curParams;
}
// 获取所有子表数据的函数
// 获取所有子表数据的函数
function getAllSubTablesData() {
var allSubData = [];
// 获取所有被展开的行
var parentLength = $("#bootstrap-table").bootstrapTable("getData").length;
for (let i = 0; i < parentLength; i++) {
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData");
//循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中
allSubData = allSubData.concat(sonData);
}
return allSubData;
}
function deleteRow(shippingDeviceId) {
// 弹出确认框询问用户是否确定删除
if (confirm("确定要删除这条记录吗?")) {
// 发送删除请求到服务器
$.ajax({
url: prefix + "/deleteRow", // 请根据实际API路径调整
type: 'POST',
data: {
shippingDeviceId: shippingDeviceId, // 传递需要删除的记录的ID
},
success: function(result) {
if (result.success) { // 假设result是一个对象,包含success属性来表示操作是否成功
// 删除操作成功,从表格中移除这一行
$('#child_table_' + index).bootstrapTable('remove', {
field: 'shippingDeviceId',
values: [shippingDeviceId]
});
toastr.success("删除成功!"); // 显示成功提示信息,这里使用toastr作为示例,确保已引入相关库
} else {
toastr.error("删除失败: " + result.message); // 显示失败原因,同样确保已引入toastr库
}
},
error: function() {
toastr.error("发生错误,删除失败!"); // 网络错误或后端错误处理
}
});
}
};
</script>
</body>
</html>

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

@ -66,7 +66,7 @@
var removeFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:remove')}]];
var maintenanceEquipmentOneFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentOne')}]];
var maintenanceEquipmentTwoFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentTwo')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -179,6 +179,9 @@
if (row.warehouseOutStatus== "1"){
actions.push('<a class="btn btn-success btn-xs ' + maintenanceEquipmentOneFlag + '" href="javascript:void(0)" onclick="maintenanceEquipmentOne(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>维护设备</a> ');
}
if (row.warehouseOutStatus== "3"){
actions.push('<a class="btn btn-success btn-xs ' + maintenanceEquipmentTwoFlag + '" href="javascript:void(0)" onclick="maintenanceEquipmentTwo(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>维护设备</a> ');
}
return actions.join('');
}
}]
@ -188,20 +191,23 @@
/*详情*/
function detail(outOrderId) {
// 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数
// 示例逻辑:
var url = ctx + 'aftersales/warehouseOutOrder/detail/'+outOrderId;
$.modal.open("详情",url);
}
/*售后第一次维护设备*/
function maintenanceEquipmentOne(outOrderId) {
// 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数
// 示例逻辑:
var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentOne/'+outOrderId;
$.modal.open("售后第一次维护设备",url);
}
/*售后第二次维护设备*/
function maintenanceEquipmentTwo(outOrderId) {
var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentTwo/'+outOrderId;
$.modal.open("售后第二次维护设备",url);
}
</script>
</body>
</html>

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

@ -0,0 +1,35 @@
<!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-cancelShipping-add">
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/salesShippingInform"
$("#form-cancelShipping-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancelShipping", $('#form-cancelShipping-add').serialize());
}
}
</script>
</body>
</html>

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

@ -0,0 +1,49 @@
<!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" id="form-confirmShipping-add" th:object="${sysSalesShippingInform}">
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden">
<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">备注:</label>
<div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/salesShippingInform"
$("#form-confirmShipping-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/confirmShipping", $('#form-confirmShipping-add').serialize());
}
}
$("input[name='deliverTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

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

@ -70,6 +70,12 @@
var removeFlag = [[${@permission.hasPermi('system:salesShippingInform:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:salesShippingInform:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:salesShippingInform:restore')}]];
var confirmShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmShipping')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -217,11 +223,8 @@
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.shippingInformId + '\')"><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.shippingInformId + '\')"><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> ');
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> ');
}
return actions.join('');
}
@ -229,6 +232,12 @@
};
$.table.init(options);
});
//确认发货
function confirmShipping(shippingInformId){
var url = prefix +'/confirmShipping/' + shippingInformId;
$.modal.open("确认发货",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save