Browse Source

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

dev
zhangsiqi 3 months ago
parent
commit
348b4066eb
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java
  2. 193
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java
  3. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java
  5. 2
      ruoyi-admin/src/main/resources/mapper/system/SysShippingAddressMapper.xml
  6. 118
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html
  7. 125
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html
  8. 40
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterConfirmDelivery.html
  9. 97
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html
  10. 13
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html
  11. 307
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html
  12. 24
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html
  13. 60
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html
  14. 49
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html
  15. 44
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html
  16. 75
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html

6
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java

@ -90,10 +90,10 @@ public class QualityRefundsExchangesController extends BaseController
/** /**
* 新增品质管理退换货单 * 新增品质管理退换货单
*/ */
@GetMapping("/add/{refundsExchangesCode}") @GetMapping("/add")
public String add(@PathVariable("refundsExchangesCode") String refundsExchangesCode,ModelMap mmap) public String add(ModelMap mmap)
{ {
mmap.put("refundsExchangesCode", refundsExchangesCode); // mmap.put("refundsExchangesCode", refundsExchangesCode);
return prefix + "/add"; return prefix + "/add";
} }

193
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java

@ -2,15 +2,24 @@ package com.ruoyi.quality.service.impl;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quality.domain.QualityRefundsExchangesDetail; import com.ruoyi.quality.domain.QualityRefundsExchangesDetail;
import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified;
import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper; import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper;
import com.ruoyi.quality.mapper.QualityRefundsExchangesUnqualifiedMapper;
import com.ruoyi.storehouse.domain.WarehousingInInfo;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -36,6 +45,21 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
@Autowired @Autowired
private QualityRefundsExchangesDetailMapper refundsExchangesDetailMapper; private QualityRefundsExchangesDetailMapper refundsExchangesDetailMapper;
@Autowired
private QualityRefundsExchangesUnqualifiedMapper unqualifiedMapper;
@Autowired
private WarehouseStorageOrderMapper warehouseStorageOrderMapper;
@Autowired
private WarehouseStorageOrderDetailMapper warehouseStorageOrderDetailMapper;
@Autowired
private WarehouseStorageOrderDetailMapper storageOrderDetailMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询品质管理退换货单 * 查询品质管理退换货单
* *
@ -70,36 +94,111 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges) public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges)
{ {
String refundsExchangesCode = qualityRefundsExchanges.getRefundsExchangesCode(); String refundsExchangesCode = redisCache.generateBillNo("THH");
qualityRefundsExchanges.setRefundsExchangesCode(refundsExchangesCode);
if (StringUtils.isEmpty(refundsExchangesCode)){
log.warn("退换货单号为空:{}",refundsExchangesCode);
}
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
int exchangeSum = 0;
List<QualityRefundsExchangesDetail> refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails(); List<QualityRefundsExchangesDetail> refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails();
if (StringUtils.isEmpty(refundsExchangesDetails)){ if (StringUtils.isEmpty(refundsExchangesDetails)){
log.warn("物料数据为空:{}",qualityRefundsExchanges.getRefundsExchangesDetails()); log.warn("物料数据为空:{}",qualityRefundsExchanges.getRefundsExchangesCode());
} }
for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) { for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) {
QualityRefundsExchangesDetail refundsExchangesDetail = new QualityRefundsExchangesDetail(); tempDetail.setRefundsExchangesCode(refundsExchangesCode);
refundsExchangesDetail.setRefundsExchangesCode(refundsExchangesCode); tempDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime());
refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime()); tempDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark());
refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark()); tempDetail.setQualityUnqualifiedNum(tempDetail.getRefundsExchangesNum());
refundsExchangesDetail.setMaterialNo(tempDetail.getMaterialNo());
refundsExchangesDetail.setMaterialName(tempDetail.getMaterialName()); exchangeSum += tempDetail.getRefundsExchangesNum();
refundsExchangesDetail.setMaterialBrand(tempDetail.getMaterialBrand()); tempDetail.setCreateBy(loginName);
refundsExchangesDetail.setMaterialDescribe(tempDetail.getMaterialDescribe()); tempDetail.setCreateTime(DateUtils.getNowDate());
refundsExchangesDetail.setMaterialPhotourl(tempDetail.getMaterialPhotourl()); refundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(tempDetail);
refundsExchangesDetail.setMaterialType(tempDetail.getMaterialType()); List<QualityRefundsExchangesUnqualified> unqualifiedList = tempDetail.getRefundsExchangesUnqualifieds();
refundsExchangesDetail.setMaterialProcessMethod(tempDetail.getMaterialProcessMethod()); if(StringUtils.isEmpty(unqualifiedList)){
refundsExchangesDetail.setMaterialUnit(tempDetail.getMaterialUnit()); log.warn("不合格分类数据为空:{}",tempDetail.getRefundsExchangesCode());
refundsExchangesDetail.setCreateBy(loginName); }else{
refundsExchangesDetail.setCreateTime(new Date()); for (QualityRefundsExchangesUnqualified unqualified: unqualifiedList) {
refundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(refundsExchangesDetail); unqualified.setRefundsExchangesCode(refundsExchangesCode);
unqualified.setMaterialNo(tempDetail.getMaterialNo());
unqualified.setMaterialName(tempDetail.getMaterialName());
unqualified.setCreateBy(loginName);
unqualified.setCreateTime(DateUtils.getNowDate());
unqualifiedMapper.insertQualityRefundsExchangesUnqualified(unqualified);
}
} }
return 1;
} }
qualityRefundsExchanges.setMaterialTotal(refundsExchangesDetails.size());
qualityRefundsExchanges.setNumTotal(exchangeSum);
qualityRefundsExchanges.setCreateBy(loginName);
qualityRefundsExchanges.setCreateTime(DateUtils.getNowDate());
qualityRefundsExchanges.setQualityReturnNode("1");
qualityRefundsExchanges.setRefundsExchangesStatus("0");
// 生成入库单
WarehouseStorageOrder warehouseStorageOrder = generateWarehouseStorageOrder(qualityRefundsExchanges);
warehouseStorageOrder.setWarehouseStorageCode(redisCache.generateBillNo("RK"));
warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder);
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetails = createWarehouseStorageDetail(qualityRefundsExchanges,warehouseStorageOrder.getWarehouseStorageCode());
warehouseStorageOrderMapper.batchWarehouseStorageOrderDetail(warehouseStorageOrderDetails);
qualityRefundsExchanges.setQualityWarehouseStatus("0");
qualityRefundsExchanges.setInStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
qualityRefundsExchangesMapper.insertQualityRefundsExchanges(qualityRefundsExchanges);
return 1;
}
// 生成退换货入库单对象
public WarehouseStorageOrder generateWarehouseStorageOrder(QualityRefundsExchanges qualityRefundsExchanges){
WarehouseStorageOrder warehouseStorageOrder = new WarehouseStorageOrder();
warehouseStorageOrder.setRelatedOrderCode(qualityRefundsExchanges.getRefundsExchangesCode());
warehouseStorageOrder.setWarehouseStorageStatus("2");
warehouseStorageOrder.setWarehouseStorageType("3");
warehouseStorageOrder.setWarehouseOrderType("2");
warehouseStorageOrder.setWarehouseDeptType("0");
warehouseStorageOrder.setWarehouseQualityStatus("2");
warehouseStorageOrder.setActualArrivedNum(qualityRefundsExchanges.getNumTotal());
warehouseStorageOrder.setNotifyArrivedNum(qualityRefundsExchanges.getNumTotal());
warehouseStorageOrder.setStorageNum(qualityRefundsExchanges.getNumTotal());
warehouseStorageOrder.setQualityQualifiedNum(0);
warehouseStorageOrder.setQualityUnqualifiedNum(qualityRefundsExchanges.getNumTotal());
warehouseStorageOrder.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime());
warehouseStorageOrder.setQualityTime(qualityRefundsExchanges.getDeliveryInspectionTime());
warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName());
warehouseStorageOrder.setCreateTime(DateUtils.getNowDate());
return warehouseStorageOrder;
}
// 生成退换货入库单详情对象
public List<WarehouseStorageOrderDetail> createWarehouseStorageDetail(QualityRefundsExchanges qualityRefundsExchanges,String warehouseStorageCode){
List<WarehouseStorageOrderDetail> detailList = new ArrayList<>();
List<QualityRefundsExchangesDetail> exchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails();
if(StringUtils.isEmpty(exchangesDetails)){
log.warn("退换货详情物料数据为空:{}",qualityRefundsExchanges.getRefundsExchangesCode());
}else {
for (QualityRefundsExchangesDetail exchangeDetail:exchangesDetails) {
WarehouseStorageOrderDetail warehouseStorageOrderDetail = new WarehouseStorageOrderDetail();
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode);
warehouseStorageOrderDetail.setRelatedOrderCode(qualityRefundsExchanges.getRefundsExchangesCode());
warehouseStorageOrderDetail.setWarehouseStorageStatus("2");
warehouseStorageOrderDetail.setWarehouseStorageType("3");
warehouseStorageOrderDetail.setWarehouseOrderType("2");
warehouseStorageOrderDetail.setWarehouseDeptType("0");
warehouseStorageOrderDetail.setMaterialNo(exchangeDetail.getMaterialNo());
warehouseStorageOrderDetail.setMaterialName(exchangeDetail.getMaterialName());
warehouseStorageOrderDetail.setMaterialType(exchangeDetail.getMaterialType());
warehouseStorageOrderDetail.setMaterialPhotourl(exchangeDetail.getMaterialPhotourl());
warehouseStorageOrderDetail.setMaterialBrand(exchangeDetail.getMaterialBrand());
warehouseStorageOrderDetail.setMaterialUnit(exchangeDetail.getMaterialUnit());
warehouseStorageOrderDetail.setMaterialDescribe(exchangeDetail.getMaterialDescribe());
warehouseStorageOrderDetail.setMaterialProcessMethod(exchangeDetail.getMaterialProcessMethod());
warehouseStorageOrderDetail.setMaterialDeptType("0");
warehouseStorageOrderDetail.setRefundsExchangesNum(exchangeDetail.getRefundsExchangesNum());
warehouseStorageOrderDetail.setCreateBy(ShiroUtils.getLoginName());
warehouseStorageOrderDetail.setCreateTime(DateUtils.getNowDate());
detailList.add(warehouseStorageOrderDetail);
}
}
return detailList;
}
/** /**
* 修改品质管理退换货单 * 修改品质管理退换货单
* *
@ -192,24 +291,40 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
if (StringUtils.isEmpty(refundsExchangesDetails)){ if (StringUtils.isEmpty(refundsExchangesDetails)){
log.warn("退款换货单[{}]无关联的物料详情信息", qualityRefundsExchanges.getRefundsExchangesCode()); log.warn("退款换货单[{}]无关联的物料详情信息", qualityRefundsExchanges.getRefundsExchangesCode());
} }
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrderDetailMapper.selectStorageOrderDetailListByCode(qualityRefundsExchanges.getInStorageCode());
if (StringUtils.isEmpty(warehouseStorageOrderDetailList)){
log.warn("退款换货单[{}]无关联的入库单详情信息", qualityRefundsExchanges.getRefundsExchangesCode());
}
int updateRows = 0; int updateRows = 0;
for (QualityRefundsExchangesDetail refundsExchangesDetail : refundsExchangesDetails) { for (QualityRefundsExchangesDetail refundsExchangesDetail : refundsExchangesDetails) {
refundsExchangesDetail.setRefundsExchangesCode(qualityRefundsExchanges.getRefundsExchangesCode());
refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime());
refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark());
refundsExchangesDetail.setUpdateBy(loginName); refundsExchangesDetail.setUpdateBy(loginName);
refundsExchangesDetail.setUpdateTime(new Date()); refundsExchangesDetail.setUpdateTime(DateUtils.getNowDate());
for (WarehouseStorageOrderDetail storageOrderDetail:warehouseStorageOrderDetailList) {
if(storageOrderDetail.getMaterialNo().equals(refundsExchangesDetail.getMaterialNo())){
storageOrderDetail.setSupplierCode(refundsExchangesDetail.getSupplierCode());
storageOrderDetail.setSupplierName(refundsExchangesDetail.getSupplierName());
storageOrderDetail.setSupplierAddress(refundsExchangesDetail.getSupplierAddress());
storageOrderDetail.setCustomerContact(refundsExchangesDetail.getCustomerContact());
storageOrderDetail.setContactNumber(refundsExchangesDetail.getContactNumber());
storageOrderDetail.setUpdateBy(loginName);
storageOrderDetail.setUpdateTime(DateUtils.getNowDate());
warehouseStorageOrderDetailMapper.updateWarehouseStorageOrderDetail(storageOrderDetail);
}
}
//更新数据库记录 //更新数据库记录
updateRows += refundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(refundsExchangesDetail); updateRows += refundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(refundsExchangesDetail);
} }
qualityRefundsExchanges.setQualityPurchaseStatus("1");
qualityRefundsExchanges.setUpdateBy(loginName);
qualityRefundsExchanges.setUpdateTime(DateUtils.getNowDate());
qualityRefundsExchangesMapper.updateQualityRefundsExchanges(qualityRefundsExchanges);
return updateRows; return updateRows;
} }
/** /**
* 保存入库前退货-确认供应商 * 保存入库前退货-确认收货
*/ */
@Override @Override
public int updateBeforeConfirmDelivery(QualityRefundsExchanges qualityRefundsExchanges) { public int updateBeforeConfirmDelivery(QualityRefundsExchanges qualityRefundsExchanges) {
@ -224,12 +339,28 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
for (QualityRefundsExchangesDetail refundsExchangesDetail : refundsExchangesDetails) { for (QualityRefundsExchangesDetail refundsExchangesDetail : refundsExchangesDetails) {
refundsExchangesDetail.setRefundsExchangesCode(qualityRefundsExchanges.getRefundsExchangesCode()); refundsExchangesDetail.setRefundsExchangesCode(qualityRefundsExchanges.getRefundsExchangesCode());
refundsExchangesDetail.setUpdateBy(loginName); refundsExchangesDetail.setUpdateBy(loginName);
refundsExchangesDetail.setUpdateTime(new Date()); refundsExchangesDetail.setUpdateTime(DateUtils.getNowDate());
int purchaseStatus = Integer.parseInt(refundsExchangesDetail.getQualityDeliveryStatus());
refundsExchangesDetail.setQualityPurchaseStatus(String.valueOf((purchaseStatus+2)));
//更新数据库记录 //更新数据库记录
updateRows += refundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(refundsExchangesDetail); updateRows += refundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(refundsExchangesDetail);
} }
boolean allStatusZero = refundsExchangesDetails.stream()
.allMatch(detail -> "0".equals(detail.getQualityDeliveryStatus()));
boolean hasStatusOne = refundsExchangesDetails.stream()
.anyMatch(detail -> "1".equals(detail.getQualityDeliveryStatus()));
boolean allStatusTwo = refundsExchangesDetails.stream()
.allMatch(detail -> "2".equals(detail.getQualityDeliveryStatus()));
if(allStatusZero){
qualityRefundsExchanges.setQualityPurchaseStatus("2");
}else if(hasStatusOne){
qualityRefundsExchanges.setQualityPurchaseStatus("3");
}else if(allStatusTwo){
qualityRefundsExchanges.setQualityPurchaseStatus("4");
}
qualityRefundsExchanges.setUpdateBy(loginName);
qualityRefundsExchanges.setUpdateTime(DateUtils.getNowDate());
qualityRefundsExchangesMapper.updateQualityRefundsExchanges(qualityRefundsExchanges);
return updateRows; return updateRows;
} }

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

@ -90,7 +90,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单1模板 * 导出出货单1模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingOrderOne") @RequiresPermissions("system:salesShippingInform:exportShippingOrderOne")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingOrderOne/{outOrderCode}") @GetMapping("/exportShippingOrderOne/{outOrderCode}")
public void exportShippingOrderOne(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingOrderOne(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {
@ -103,7 +103,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单2模板 * 导出出货单2模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingOrderTwo") @RequiresPermissions("system:salesShippingInform:exportShippingOrderTwo")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingOrderTwo/{outOrderCode}") @GetMapping("/exportShippingOrderTwo/{outOrderCode}")
public void exportShippingOrderTwo(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingOrderTwo(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {
@ -116,7 +116,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单通知单模板 * 导出出货单通知单模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingInformOrder") @RequiresPermissions("system:salesShippingInform:exportShippingInformOrder")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingInformOrder/{outOrderCode}") @GetMapping("/exportShippingInformOrder/{outOrderCode}")
public void exportShippingInformOrder(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingInformOrder(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {

2
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java

@ -659,7 +659,7 @@ public class WarehouseStorageOrderController extends BaseController
@RequestMapping("/storageRefundsExchangesDetailList") @RequestMapping("/storageRefundsExchangesDetailList")
public Map<String,List<WarehouseStorageOrderDetail>> storageRefundsExchangesDetail(String warehouseStorageCode){ public Map<String,List<WarehouseStorageOrderDetail>> storageRefundsExchangesDetail(String warehouseStorageCode){
List<WarehouseStorageOrderDetail> allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode); List<WarehouseStorageOrderDetail> allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
Map<String, List<WarehouseStorageOrderDetail>> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getCustomerId)); Map<String, List<WarehouseStorageOrderDetail>> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getSupplierCode));
return groupedDetails; return groupedDetails;
} }
} }

2
ruoyi-admin/src/main/resources/mapper/system/SysShippingAddressMapper.xml

@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysShippingAddressList" parameterType="SysShippingAddress" resultMap="SysShippingAddressResult"> <select id="selectSysShippingAddressList" parameterType="SysShippingAddress" resultMap="SysShippingAddressResult">
<include refid="selectSysShippingAddressVo"/> <include refid="selectSysShippingAddressVo"/>
<where> <where>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = concat(#{enterpriseCode}, '%')</if> <if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = #{enterpriseCode}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if> <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="deliveryAddress != null and deliveryAddress != ''"> and delivery_address like concat('%', #{deliveryAddress}, '%')</if> <if test="deliveryAddress != null and deliveryAddress != ''"> and delivery_address like concat('%', #{deliveryAddress}, '%')</if>

118
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html

@ -4,6 +4,7 @@
<th:block th:include="include :: header('采购订单列表')" /> <th:block th:include="include :: header('采购订单列表')" />
<th:block th:include="include :: datetimepicker-css"/> <th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: bootstrap-select-css"/> <th:block th:include="include :: bootstrap-select-css"/>
<th:block th:include="include :: bootstrap-fileinput-css" />
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script> <script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
@ -74,10 +75,13 @@
</form> </form>
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="importPurchaseOrder()" shiro:hasPermission="purchase:purchaseOrder:add"> <!-- 导入合同按钮 -->
<i class="fa fa-plus"></i> 导入合同 <a class="btn btn-warning" data-toggle="modal" data-target="#importContractModal">
<i class="fa fa-download"></i> 导入合同
</a> </a>
<a class="btn btn-warning" onclick="exportContract()" shiro:hasPermission="purchase:purchaseOrder:exportContract"> <a class="btn btn-warning" onclick="exportContract()" shiro:hasPermission="purchase:purchaseOrder:exportContract">
<i class="fa fa-download"></i> 导出合同 <i class="fa fa-download"></i> 导出合同
</a> </a>
@ -131,9 +135,37 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 导入合同模态框 -->
<div class="modal inmodal fade" id="importContractModal" tabindex="-1" aria-labelledby="importContractModalLabel" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title">导入合同</h4>
</div>
<div class="modal-body">
<div class="file-loading">
<input id="singleFile" name="file" type="file">
<!-- 添加隐藏的输入框 -->
<input id="fileIdStr" name="fileIdStr" type="text" hidden>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js"/> <th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: select2-js"/> <th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include:: zh-js" />
<script th:src="@{/js/activiti.js}"></script> <script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('purchase:purchaseOrder:edit')}]]; var editFlag = [[${@permission.hasPermi('purchase:purchaseOrder:edit')}]];
@ -290,7 +322,7 @@
}); });
}; };
//导出合同
function exportContract() { function exportContract() {
// 获取选中的行 // 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections'); const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
@ -340,12 +372,87 @@
}); });
} }
// 显示警告消息的通用函数 // 显示警告消息的通用函数
function showWarning(message) { function showWarning(message) {
$.modal.msgWarning(message); $.modal.msgWarning(message);
} }
$(document).ready(function() {
// 获取导入合同按钮
var importContractButton = $('#importContractButton');
// 添加点击事件处理器
importContractButton.on('click', function(event) {
// 阻止默认行为
event.preventDefault();
// 执行校验逻辑
if (checkConditions()) {
// 如果校验通过,则显示模态框
$('#importContractModal').modal('show');
} else {
// 如果校验失败,则显示提示信息
alert('您不具备导入合同的权限!');
}
});
// 定义校验逻辑函数
function checkConditions() {
// 这里可以根据需要添加校验逻辑
// 例如:检查用户权限、表单状态等
// 返回 true 表示校验通过,false 表示校验失败
// 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
if (selectedRows.length !== 1) {
showWarning("请先选择一条采购订单");
return;
}
return true; // 示例:始终返回 true
}
});
//导入合同
$(document).ready(function () {
// 单图上传
$("#singleFile").fileinput({
uploadUrl: ctx + "common/uploadSingleFile",
language: 'zh', //设置语言
dropZoneEnabled: true, //是否显示拖拽区域
maxFileSize: 20480, //上传文件最大值,单位kb
allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'], //指定上传文件类型
maxFileCount: 1,
initialPreviewAsData: true,
uploadExtraData: {
img_key: "1000",
img_keywords: "happy, nature",
}
}).on('fileuploaded', function (event, data, previewId, index) {
var response = data.response;
// var rsp = data.response;
// document.getElementById('attachFileId').value = rsp.attachFileId;
var attachFileId = response.data.id;
if (response.code === web_status.SUCCESS) {
$('#fileIdStr').val(attachFileId);
$.modal.msgSuccess("上传成功");
} else {
$.modal.alertError(response.msg);
}
});
});
// 订单结案 // 订单结案
function reviewCloseCase(){ function reviewCloseCase(){
let data = $("#bootstrap-table").bootstrapTable("getSelections"); let data = $("#bootstrap-table").bootstrapTable("getSelections");
@ -381,8 +488,6 @@
}); });
} }
function tableSet(data) { function tableSet(data) {
var options = { var options = {
id: "closeCaseTable", id: "closeCaseTable",
@ -405,6 +510,9 @@
], ],
} }
} }
</script> </script>
</body> </body>
</html> </html>

125
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html

@ -46,8 +46,9 @@
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges" var prefix = ctx + "quality/refundsExchanges"
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ ''; var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var materialUnqualifiedList = [];
$("#form-refundsExchanges-add").validate({ $("#form-refundsExchanges-add").validate({
focusCleanup: true focusCleanup: true
}); });
@ -85,6 +86,14 @@
}; };
}); });
materialDataList.forEach(function (material){
var key = 'unqualifiedDataList' + material.materialNo;
var dataString = sessionStorage.getItem(key);
if(dataString){
var refundsExchangesUnqualifieds = JSON.parse(dataString);
material.refundsExchangesUnqualifieds = refundsExchangesUnqualifieds;
}
})
// 将全局变量 refundsExchangesCode 添加到要提交的数据中 // 将全局变量 refundsExchangesCode 添加到要提交的数据中
const combinedData = Object.assign({}, refundsExchangesData, { const combinedData = Object.assign({}, refundsExchangesData, {
refundsExchangesDetails: materialDataList, refundsExchangesDetails: materialDataList,
@ -132,6 +141,9 @@
{ {
title: '图片', title: '图片',
field: 'materialPhotourl', field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
}, },
{ {
title: '物料名称', title: '物料名称',
@ -140,6 +152,9 @@
{ {
title: '物料类型', title: '物料类型',
field: 'materialType', field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
}, },
{ {
title: '描述', title: '描述',
@ -156,6 +171,9 @@
{ {
title: '物料加工方式', title: '物料加工方式',
field: 'materialProcessMethod', field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
}, },
{ {
title: '品质报告', title: '品质报告',
@ -163,7 +181,7 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 这里直接使用row对象获取refundsExchangesCode,假设它是存在的 // 这里直接使用row对象获取refundsExchangesCode,假设它是存在的
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\', \'' + row.hasQualifiedReport + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join(''); return actions.join('');
} }
}, },
@ -171,6 +189,11 @@
title: '退换数', title: '退换数',
field: 'refundsExchangesNum', field: 'refundsExchangesNum',
}, },
{
title: '是否含品质报告数据',
field: 'hasQuolifiedReport',
visible: false,
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
@ -209,11 +232,13 @@
materialPhotourl:rowData.materialPhotourl, materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName, materialName: rowData.materialName,
materialType: rowData.materialType, materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe, materialDescribe: rowData.describe,
materialBrand: rowData.materialBrand, materialBrand: rowData.brand,
materialUnit: rowData.materialUnit, materialUnit: rowData.unit,
materialProcessMethod: rowData.materialProcessMethod, materialProcessMethod: rowData.processMethod,
makeTotal:rowData.makeTotal makeTotal:rowData.makeTotal,
refundsExchangesNum: '',
hasQualifiedReport: 0,
} }
}) })
layer.close(index); layer.close(index);
@ -225,17 +250,97 @@
field: 'materialNo', field: 'materialNo',
values: materialNo values: materialNo
}) })
// 删除该物料品质报告数据
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
} }
// 按料号查找更新表格数据
function updateRowByMaterialNo(materialNo, newData) {
// 获取所有行的数据
var rows = $('#bootstrap-table').bootstrapTable('getData');
for (var i = 0; i < rows.length; i++) {
if (rows[i].materialNo === materialNo) {
rows[i] = Object.assign({}, rows[i], newData); // 合并新旧数据
console.log(rows[i]);
$('#bootstrap-table').bootstrapTable('updateRow', {
index: i,
row: rows[i]
});
}
}
}
// 处理品质报告子页面数据
function handleQualityReportData(index, layero){
var iframeWin = window[layero.find('iframe')[0]['name']];
var materialNo = iframeWin.$('#materialNo').val();
var inspectionTime = iframeWin.$('input[name="inspectionTime"]').val();
var remark = iframeWin.$('#remark').val();
var refundsExchangesNum = 0;
var table = iframeWin.$('#bootstrap-unqualified-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"qualityOrderReportId": item.qualityOrderReportId,
"processBadClassification": item.processBadClassification,
"processBadGrade": item.processBadGrade,
"processBadNum": item.processBadNum,
"unqualifiedReportUrl": item.unqualifiedReportUrl
// ...其他字段
};
});
unqualifiedDataList.forEach(function (index){
index.inspectionTime = inspectionTime;
index.remark = remark;
processBadNum = Number(index.processBadNum);
if (!isNaN(processBadNum) ) {
refundsExchangesNum += processBadNum;
}
})
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
sessionStorage.setItem(key,JSON.stringify(unqualifiedDataList));
var newData = {
refundsExchangesNum: refundsExchangesNum,
hasQualifiedReport: '1'
};
updateRowByMaterialNo(materialNo,newData);
layer.close(index);
}
/*品质报告*/ /*品质报告*/
function qualityReport(materialNo, refundsExchangesCode) { function qualityReport(materialNo, refundsExchangesCode, hasQualifiedReport) {
var queryParams = new URLSearchParams(); var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo); queryParams.append('materialNo', materialNo);
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode)); queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
if(hasQualifiedReport === "0"){
// 删除该物料品质报告数据
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
}
var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString(); var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url); var options = {
title: '品质报告',
url: url,
callBack: handleQualityReportData
};
$.modal.openOptions(options);
} }
</script> </script>

40
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterConfirmDelivery.html

@ -51,6 +51,9 @@
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]] var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var qualityDeliveryStatusDatas = [[${@dict.getType('quality_delivery_status')}]]; var qualityDeliveryStatusDatas = [[${@dict.getType('quality_delivery_status')}]];
var prefix = ctx + "quality/refundsExchanges"; var prefix = ctx + "quality/refundsExchanges";
$("#form-afterConfirmDelivery-edit").validate({ $("#form-afterConfirmDelivery-edit").validate({
@ -156,17 +159,24 @@
{ {
title: '料号', title: '料号',
field: 'materialNo' field: 'materialNo'
}, { },
{
title: '物料名称', title: '物料名称',
field: 'materialName' field: 'materialName'
}, },
{ {
title: '物料类型', title: '物料类型',
field: 'materialType', field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
}, },
{ {
title: '物料图片地址', title: '物料图片',
field: 'materialPhotourl', field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
}, },
{ {
title: '物料描述', title: '物料描述',
@ -183,26 +193,16 @@
{ {
title: '物料加工方式', title: '物料加工方式',
field: 'materialProcessMethod', field: 'materialProcessMethod',
}, formatter: function(value, row, index) {
{ return $.table.selectDictLabel(processMethodDatas, value);
title: '订单数', }
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
}, },
{ {
title: '品质报告', title: '品质报告',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')">报告</a> ');
return actions.join(''); return actions.join('');
} }
}, },
@ -227,13 +227,13 @@
/*品质报告*/ /*品质报告*/
function qualityReport(materialNo, supplierCode) { function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams(); var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo); queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode)); queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString(); var url = ctx + 'quality/refundsExchanges/afterQualityReportDetail?' + queryParams.toString();
$.modal.open("品质报告", url); $.modal.open("品质报告详情", url);
} }
// 列中获取收货状态下拉改变数据 // 列中获取收货状态下拉改变数据

97
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html

@ -6,6 +6,8 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-afterNoConfirmSupplier-edit" th:object="${qualityRefundsExchanges}"> <form class="form-horizontal m" id="form-afterNoConfirmSupplier-edit" th:object="${qualityRefundsExchanges}">
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden">
<input name="inStorageCode" th:field="*{inStorageCode}" type="hidden">
<div class="form-group"> <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"> <div class="col-sm-8">
@ -13,17 +15,17 @@
</div> </div>
</div> </div>
<div class="form-group"> <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"> <div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" disabled> <select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <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"> <div class="col-sm-8">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled> <input name="qualityRemark" th:field="*{qualityRemark}" class="form-control" type="text" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div> </div>
</div> </div>
</form> </form>
@ -42,7 +44,10 @@
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]] var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]]; var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var supplier = [];
var $table = $("#bootstrap-table"); var $table = $("#bootstrap-table");
var prefix = ctx + "quality/refundsExchanges"; var prefix = ctx + "quality/refundsExchanges";
@ -50,18 +55,12 @@
focusCleanup: true focusCleanup: true
}); });
// function submitHandler() {
// if ($.validate.form()) {
// $.operate.save(prefix + "/returnBeforeStorageDetail", $('#form-qualityRefundsExchanges-edit').serialize());
// }
// }
// 新增提交 // 新增提交
function submitHandler() { function submitHandler() {
// 获取表单数据
// const afterNoConfirmSupplierData = $("#form-afterNoConfirmSupplier-edit").serializeArray(); $("input[name='refundsExchangesCode']").removeAttr("disabled");
// 获取表单数据 $("input[name='qualityRemark']").removeAttr("disabled");
const afterNoConfirmSupplierData = $("#form-afterNoConfirmSupplier-edit").serializeArray().reduce((obj, item) => { const afterNoConfirmSupplierData = $("#form-afterNoConfirmSupplier-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value; obj[item.name] = item.value;
return obj; return obj;
@ -121,65 +120,77 @@
checkbox: true checkbox: true
}, },
{ {
title: '供应商ID', title: '退换货详情Id',
field: 'supplierCode', field: 'refundsExchangesDetailId',
visible: false visible: false
}, },
{ {
title: '退换货详情Id', title: '退换货单号',
field: 'refundsExchangesDetailId', field: 'refundsExchangesCode',
visible: false visible: false
}, },
{ {
title: '料号', title: '料号',
field: 'materialNo' field: 'materialNo'
}, { },
{
title: '图片',
field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
title: '物料名称', title: '物料名称',
field: 'materialName' field: 'materialName'
}, },
{ {
title: '物料类型', title: '物料类型',
field: 'materialType', field: 'materialType',
}, formatter: function(value, row, index) {
{ return $.table.selectCategoryLabel(materialTypeDatas, value);
title: '物料图片地址', }
field: 'materialPhotourl',
}, },
{ {
title: '物料描述', title: '物料描述',
field: 'materialDescribe', field: 'materialDescribe',
}, },
{ {
title: '物料品牌', title: '品牌',
field: 'materialBrand', field: 'materialBrand',
}, },
{ {
title: '物料单位', title: '单位',
field: 'materialUnit', field: 'materialUnit',
}, },
{ {
title: '物料加工方式', title: '加工方式',
field: 'materialProcessMethod', field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
}, },
{ {
title: '订单数', title: '订单数',
field: 'makeTotal', field: 'makeTotal',
visible: false
}, },
{ {
title: '品质已合格数', title: '品质已合格数',
field: 'qualityHasqualifiedNum', field: 'qualityHasqualifiedNum',
visible: false
}, },
{ {
title: '本次到货数', title: '本次到货数',
field: 'thisArrivedNum', field: 'thisArrivedNum',
visible: false
}, },
{ {
title: '品质报告', title: '品质报告',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')">报告</a> ');
return actions.join(''); return actions.join('');
} }
}, },
@ -244,6 +255,7 @@
codes.forEach(function (code) { codes.forEach(function (code) {
selectElement.append('<option value="' + code.supplierCode + '">' + code.supplierCode + '</option>'); selectElement.append('<option value="' + code.supplierCode + '">' + code.supplierCode + '</option>');
}); });
supplier = codes;
// 设置默认值(如果存在) // 设置默认值(如果存在)
var rowData = $table.bootstrapTable('getData')[index]; var rowData = $table.bootstrapTable('getData')[index];
if (rowData && rowData.supplierCode) { if (rowData && rowData.supplierCode) {
@ -259,6 +271,14 @@
var tableData = $table.bootstrapTable('getData'); var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; var newRow = tableData[rowIndex];
newRow.supplierCode = newSupplierCode; newRow.supplierCode = newSupplierCode;
supplier.forEach(function (index){
if(index.supplierCode === newSupplierCode){
newRow.supplierName = index.supplierName;
newRow.customerContact = index.customerContact;
newRow.contactNumber = index.contactNumber;
newRow.supplierAddress = index.customerAddress;
}
});
// getSupplierNameType(newRow.supplierCode,newRow,rowIndex); // getSupplierNameType(newRow.supplierCode,newRow,rowIndex);
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
@ -293,9 +313,26 @@
var tableData = $table.bootstrapTable('getData'); var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据 var newRow = tableData[rowIndex]; // 获取当前行数据
newRow.supplierName = newSupplierName; newRow.supplierName = newSupplierName;
supplier.forEach(function (index){
if(index.supplierName === newSupplierName){
newRow.customerContact = index.customerContact;
newRow.contactNumber = index.contactNumber;
newRow.supplierAddress = index.customerAddress;
}
});
// 更新行数据 // 更新行数据
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
} }
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
console.log("materialNo:"+materialNo);
console.log("refundsExchangesCode:"+refundsExchangesCode);
var url = ctx + 'quality/refundsExchanges/afterQualityReportDetail?' + queryParams.toString();
$.modal.open("品质报告详情", url);
}
</script> </script>
</body> </body>
</html> </html>

13
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html

@ -89,9 +89,7 @@
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
queryParams:queryParams, queryParams:queryParams,
columns: [{ columns: [
checkbox: false
},
{ {
title: '品质报告单id', title: '品质报告单id',
field: 'qualityOrderReportId', field: 'qualityOrderReportId',
@ -100,6 +98,7 @@
{ {
title: '不良分类', title: '不良分类',
field: 'processBadClassification', field: 'processBadClassification',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(processBadClassificationDatas, value); return $.table.selectDictLabel(processBadClassificationDatas, value);
} }
@ -108,6 +107,7 @@
{ {
title: '不良等级', title: '不良等级',
field: 'processBadGrade', field: 'processBadGrade',
align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(processBadGradeDatas, value); return $.table.selectDictLabel(processBadGradeDatas, value);
} }
@ -115,10 +115,17 @@
{ {
title: '数量', title: '数量',
field: 'processBadNum', field: 'processBadNum',
align: 'center',
}, },
{ {
title: '报告', title: '报告',
field: 'unqualifiedReportUrl', field: 'unqualifiedReportUrl',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" >报告</a> ');
return actions.join('');
}
}, },
] ]
}; };

307
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html

@ -0,0 +1,307 @@
<!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-qualityOrderReport-edit" th:object="${qualityOrderReport}">
<input name="supplierCode" th:field="*{supplierCode}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-6">
<input name="materialNo" th:field="*{materialNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-6">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单数:</label>
<div class="col-sm-6">
<input name="makeTotal" th:field="*{makeTotal}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质已合格数:</label>
<div class="col-sm-6">
<input name="qualityHasqualifiedNum" th:field="*{qualityHasqualifiedNum}" class="form-control" type="text">
</div>
</div>
<div class="container">
<!--合格数-->
<div class="col-sm-12">
<h3>合格数</h3>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label is-required">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text" required>
</div>
<div class="form-group col-sm-6">
<label class="control-label">ok报告图片:</label>
<input name="okReportUrl" th:field="*{okReportUrl}" class="form-control" type="text">
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label is-required">特采/让步数:</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text" required>
</div>
<div class="form-group col-sm-6">
<label class="control-label">特采报告图片:</label>
<input name="specialReportUrl" th:field="*{specialReportUrl}" class="form-control" type="text">
</div>
</div>
</div>
<!--不合格数-->
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12 d-flex align-items-center">
<span style="font-weight: bold; font-family: Arial, sans-serif; font-size: 15px;">不合格数</span>
<a class="btn btn-success ml-auto" onclick="addUnqualified()">
<i class="fa fa-plus"></i> 添加
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-unqualified-table"></table>
</div>
</div>
</div>
</div>
<!--其他字段-->
<div class="form-group">
<label class="col-sm-4 control-label">检验完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="checkoutCompletionTime" th:value="${#dates.format(qualityOrderReport.checkoutCompletionTime, '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-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control" type="text"></textarea>
</div>
</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 processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({
focusCleanup: true
});
function submitHandler() {
// 获取表单数据
const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-unqualified-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
console.log(JSON.stringify(table));
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"processBadClassification": item.processBadClassification,
"processBadGrade": item.processBadGrade,
"processBadNum": item.processBadNum,
"unqualifiedReportUrl": item.unqualifiedReportUrl
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList });
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/qualityReport", jsonData);
}
$("input[name='checkoutCompletionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//添加不合格数
function addUnqualified() {
// 生成一个简单的唯一标识,这里使用时间戳作为示例
var uniqueId = new Date().getTime();
// 创建一个新行数据模板,这里仅为示例,具体根据表格列来定义
var newRow = {
qualityOrderReportId:uniqueId,
processBadClassification: "",
processBadGrade: "",
processBadNum: "",
unqualifiedReportUrl: ""
};
// 使用Bootstrap Table的API插入新行
$('#bootstrap-unqualified-table').bootstrapTable('append', newRow);
}
//收款凭证table列表
$(function() {
var options = {
id:"bootstrap-unqualified-table",
modalName: "收款凭证",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
singleSelect:true,
columns: [{
checkbox: false
},
{
title: '品质报告单id',
field: 'qualityOrderReportId',
visible: false
},
{title: '不良分类',field: 'processBadClassification',
formatter:function (value, row, index) {
return processBadClassificationFormatter(value,row,index);
}
},
{title: '不良等级',field: 'processBadGrade',
formatter:function (value, row, index) {
return processBadGradeFormatter(value,row,index);
}
},
{
title: '数量',
field: 'processBadNum',
editable:{
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
}
}
},
{
title: '报告',
field: 'unqualifiedReportUrl',
editable: {
mode:'inline',
type: 'text', // 表示该列可以被编辑为文本
},
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.qualityOrderReportId + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
});
// 逻辑删除不合格数前端的一行数据
function removeRow(qualityOrderReportId){
console.log(qualityOrderReportId);
// 直接使用 receivablesRecordsId 值进行删除操作
$("#bootstrap-unqualified-table").bootstrapTable('remove', {
field: 'qualityOrderReportId',
values: qualityOrderReportId
});
}
// 列中获取不良分类的下拉改变数据
function onProcessBadClassification(selectElement, rowIndex) {
var processBadClassificationValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadClassification = processBadClassificationValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良分类的格式化函数
function processBadClassificationFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadClassification(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadClassificationDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
// 列中获取不良等级的下拉改变数据
function onProcessBadGrade(selectElement, rowIndex) {
var processBadGradeValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadGrade = processBadGradeValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良等级的格式化函数
function processBadGradeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadGrade(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadGradeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
</script>
</body>
</html>

24
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html

@ -16,6 +16,11 @@
var prefix = ctx + "quality/refundsExchanges"; var prefix = ctx + "quality/refundsExchanges";
// 从后端拿到传入的makeNo // 从后端拿到传入的makeNo
var makeNo = /*[[${makeNo}]]*/ ''; var makeNo = /*[[${makeNo}]]*/ '';
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sysUnitClassDatas')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
$(function() { $(function() {
var options = { var options = {
id: 'bootstrap-materialSelect-table', id: 'bootstrap-materialSelect-table',
@ -38,6 +43,10 @@
{ {
title: '图片', title: '图片',
field: 'materialPhotourl', field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
}, },
{ {
title: '物料名称', title: '物料名称',
@ -46,18 +55,27 @@
{ {
title: '类型', title: '类型',
field: 'materialType', field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
}, },
{ {
title: '描述', title: '描述',
field: 'materialDescribe', field: 'describe',
}, },
{ {
title: '品牌', title: '品牌',
field: 'materialBrand', field: 'brand',
}, },
{ {
title: '单位', title: '单位',
field: 'materialUnit', field: 'unit',
},
{ title: '加工方式',
field: 'processMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
}, },
] ]
}; };

60
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html

@ -7,7 +7,7 @@
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityOrderReport-add"> <form class="form-horizontal m" id="form-qualityOrderReport-add">
<input name="materialNo" th:field="*{materialNo}" type="hidden"> <input name="materialNo" id="materialNo" th:field="*{materialNo}" type="hidden">
<div class="container"> <div class="container">
<!--不合格数--> <!--不合格数-->
<div class="col-sm-12"> <div class="col-sm-12">
@ -41,7 +41,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">备注:</label> <label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" class="form-control" type="text"></textarea> <textarea name="remark" id="remark" class="form-control" type="text"></textarea>
</div> </div>
</div> </div>
</form> </form>
@ -52,7 +52,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges"; var prefix = ctx + "quality/refundsExchanges";
var materialNo = /*[[${materialNo}]]*/''; var materialNo = [[${materialNo}]];
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/''; var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/'';
@ -77,7 +77,6 @@
$.modal.alertWarning("请至少添加一条不合格数再保存!"); $.modal.alertWarning("请至少添加一条不合格数再保存!");
return; return;
} }
console.log(JSON.stringify(table));
// 将表数据转换成与qualityReportData格式一致的数组 // 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) { var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整 // 根据实际字段名调整
@ -89,19 +88,25 @@
// ...其他字段 // ...其他字段
}; };
}); });
const combinedData = Object.assign({}, qualityReportData, { const combinedData = Object.assign({}, qualityReportData, {
refundsExchangesUnqualifieds: unqualifiedDataList , refundsExchangesUnqualifieds: unqualifiedDataList ,
materialNo:materialNo, materialNo:materialNo,
refundsExchangesCode:refundsExchangesCode refundsExchangesCode:refundsExchangesCode
}); });
// 合并表单数据和表格数据 // 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData); console.log(combinedData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据 var key = 'unqualifiedDataList' + materialNo;
const jsonData = JSON.stringify(combinedData); if (localStorage.getItem(key)) {
// 发送 AJAX 请求到后端接口 localStorage.removeItem(key);
$.operate.saveJson(prefix + "/qualityReport", jsonData); }
localStorage.setItem(key,JSON.stringify(unqualifiedDataList));
$.modal.close();
// // 使用 JSON.stringify() 序列化数据
// const jsonData = JSON.stringify(combinedData);
// // 发送 AJAX 请求到后端接口
// $.operate.saveJson(prefix + "/qualityReport", jsonData);
} }
$("input[name='inspectionTime']").datetimepicker({ $("input[name='inspectionTime']").datetimepicker({
@ -131,31 +136,30 @@
} }
//收款凭证table列表 //收款凭证table列表
$(function() { $(function() {
$('#materialNo').val(materialNo);
var options = { var options = {
id:"bootstrap-unqualified-table", id:"bootstrap-unqualified-table",
modalName: "收款凭证", modalName: "品质报告单",
showColumns: false, showColumns: false,
pagination: false, pagination: false,
showToggle: false, showToggle: false,
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
singleSelect:true, singleSelect:true,
columns: [{ columns: [
checkbox: false
},
{ {
title: '品质报告单id', title: '品质报告单id',
field: 'qualityOrderReportId', field: 'qualityOrderReportId',
visible: false visible: false
}, },
{title: '不良分类',field: 'processBadClassification', {title: '不良分类',field: 'processBadClassification',align: 'center',
formatter:function (value, row, index) { formatter:function (value, row, index) {
return processBadClassificationFormatter(value,row,index); return processBadClassificationFormatter(value,row,index);
} }
}, },
{title: '不良等级',field: 'processBadGrade', {title: '不良等级',field: 'processBadGrade',align: 'center',
formatter:function (value, row, index) { formatter:function (value, row, index) {
return processBadGradeFormatter(value,row,index); return processBadGradeFormatter(value,row,index);
} }
@ -163,6 +167,7 @@
{ {
title: '数量', title: '数量',
field: 'processBadNum', field: 'processBadNum',
align: 'center',
editable:{ editable:{
type: 'text', type: 'text',
mode:'inline', mode:'inline',
@ -177,10 +182,12 @@
{ {
title: '报告', title: '报告',
field: 'unqualifiedReportUrl', field: 'unqualifiedReportUrl',
editable: { align: 'center',
mode:'inline', formatter: function(value, row, index) {
type: 'text', // 表示该列可以被编辑为文本 var actions = [];
}, actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>上传</a> ');
return actions.join('');
}
}, },
{ {
title: '操作', title: '操作',
@ -193,6 +200,17 @@
} }
] ]
}; };
var key = 'unqualifiedDataList' + materialNo;
var dataString = sessionStorage.getItem(key);
if (dataString) {
var data = JSON.parse(dataString);
options.data = data;
$('input[name="inspectionTime"]').val(data[0].inspectionTime);
$('#remark').val(data[0].remark);
}
$.table.init(options); $.table.init(options);
}); });

49
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

@ -137,13 +137,9 @@
} }
}, },
{ {
title: '关联单号', title: '关联单号',
field: 'relatedOrderCode', field: 'relatedOrderCode',
}, },
{
title: '入库单号',
field: 'inStorageCode',
},
{ {
title: '退货节点', title: '退货节点',
field: 'qualityReturnNode', field: 'qualityReturnNode',
@ -152,7 +148,7 @@
} }
}, },
{ {
title: '物料合计', title: '物料合计',
field: 'materialTotal', field: 'materialTotal',
}, },
{ {
@ -162,14 +158,7 @@
{ {
title: '交付质检时间', title: '交付质检时间',
field: 'deliveryInspectionTime', field: 'deliveryInspectionTime',
}, visible: false,
{
title: '品质备注',
field: 'qualityRemark',
},
{
title: '备注',
field: 'remark',
}, },
{ {
title: '录入人', title: '录入人',
@ -192,7 +181,7 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.refundsExchangesStatus == 0 && row.qualityPurchaseStatus == 4){ if (row.refundsExchangesStatus == 0 && row.qualityPurchaseStatus == 4){
actions.push('<a class="btn btn-success btn-xs ' + closingProceduresFlag + '" href="javascript:void(0)" onclick="closingProcedures(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>结案</a> '); actions.push('<a class="btn btn-success btn-xs ' + closingProceduresFlag + '" href="javascript:void(0)" onclick="closingProcedures(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
} }
@ -247,21 +236,23 @@
/*添加退货单*/ /*添加退货单*/
function add() { function add() {
var rows = $("#bootstrap-table").bootstrapTable('getSelections'); var url = ctx + 'quality/refundsExchanges/add';
console.log("rows" + rows);
if (rows.length == 1){
// var curQualityReturnNode = rows[0].qualityReturnNode;
// var curRefundsExchangesCode = rows[0].refundsExchangesCode;
if (rows[0].qualityReturnNode == 1){
var url = ctx + 'quality/refundsExchanges/add/' +rows[0].refundsExchangesCode;
$.modal.open("添加退换货",url); $.modal.open("添加退换货",url);
}else { // var rows = $("#bootstrap-table").bootstrapTable('getSelections');
$.modal.msgWarning("请选择退货节点为入库后退货的数据!") // console.log("rows" + rows);
} // if (rows.length == 1){
// $.modal.open("添加" + table.options.modalName, $.operate.addUrl(rows[0].id)); // // var curQualityReturnNode = rows[0].qualityReturnNode;
}else{ // // var curRefundsExchangesCode = rows[0].refundsExchangesCode;
$.modal.msgWarning("只能选中一行作为添加对象!") // if (rows[0].qualityReturnNode == 1){
} // var url = ctx + 'quality/refundsExchanges/add/' +rows[0].refundsExchangesCode;
// $.modal.open("添加退换货",url);
// }else {
// $.modal.msgWarning("请选择退货节点为入库后退货的数据!")
// }
// // $.modal.open("添加" + table.options.modalName, $.operate.addUrl(rows[0].id));
// }else{
// $.modal.msgWarning("只能选中一行作为添加对象!")
// }
}; };

44
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html

@ -48,6 +48,9 @@
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ ''; var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]]; var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
$("input[name='deliveryInspectionTime']").datetimepicker({ $("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
@ -136,26 +139,38 @@
{ {
title: '物料名称', title: '物料名称',
field: 'materialName', field: 'materialName',
align: 'center',
}, },
{ {
title: '物料类型', title: '物料类型',
field: 'materialType', field: 'materialType',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
}, },
{ {
title: '描述', title: '描述',
field: 'materialDescribe', field: 'materialDescribe',
align: 'center',
}, },
{ {
title: '品牌', title: '品牌',
field: 'materialBrand', field: 'materialBrand',
align: 'center',
}, },
{ {
title: '单位', title: '单位',
field: 'materialUnit', field: 'materialUnit',
align: 'center',
}, },
{ {
title: '加工方式', title: '加工方式',
field: 'materialProcessMethod', field: 'materialProcessMethod',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
}, },
{ {
title: '品质报告', title: '品质报告',
@ -163,13 +178,40 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 这里直接使用row对象获取refundsExchangesCode,假设它是存在的 // 这里直接使用row对象获取refundsExchangesCode,假设它是存在的
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')">报告</a> ');
return actions.join(''); return actions.join('');
} }
}, },
{ {
title: '退换数', title: '退换数',
field: 'refundsExchangesNum', field: 'refundsExchangesNum',
align: 'center',
},
{
title: '供应商ID',
field: 'supplierCode',
align: 'center',
},
{
title: '供应商名称',
field: 'supplierName',
align: 'center',
},
{
title: '退货联系人',
field: 'customerContact',
align: 'center',
},
{
title: '联系人电话',
field: 'contactNumber',
align: 'center',
},
{
title: '退货地址',
field: 'supplierAddress',
align: 'center',
} }
] ]
}; };

75
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html

@ -50,19 +50,22 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label> <label class="col-sm-3 control-label">收货联系人(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerDelivery" th:field="*{customerDelivery}" class="form-control" type="text" disabled> <select class="form-control" name="customerDelivery" th:field="*{customerDelivery}" id="customerDelivery" required>
<!-- 这里动态生成生产单号选项 -->
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label> <label class="col-sm-3 control-label">收货电话(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled> <input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label> <label class="col-sm-3 control-label">收货地址(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled> <input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled>
</div> </div>
@ -138,6 +141,70 @@
$.operate.saveJson(prefix + "/salesDeliverGoods", jsonData); $.operate.saveJson(prefix + "/salesDeliverGoods", jsonData);
} }
loadCustomerDelivery();
//获取已经选择客户Id相关的生产单号
function loadCustomerDelivery() {
const url = ctx + 'system/customer/shippingList';
const data = {
enterpriseCode: sysSalesOrder.enterpriseCode,
};
// 使用 $.ajax 发送请求
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: data,
success: function(response) {
console.log("response:", response);
if (response.code === 0 && Array.isArray(response.rows) && response.rows.length > 0) {
const selectElement = $('#customerDelivery');
selectElement.empty();
// 存储每个客户名称对应的信息
const customerDataMap = {};
// 遍历返回的数据,添加为下拉框的选项并存储数据
$.each(response.rows, function(index, item) {
const customerName = item.customerName;
customerDataMap[customerName] = item; // 存储数据
// 添加选项到下拉框
selectElement.append($('<option>', {value: customerName}).text(customerName));
});
// 监听下拉框的选择变化
selectElement.on('change', function() {
const selectedCustomerName = $(this).val();
if (selectedCustomerName in customerDataMap) {
const selectedCustomer = customerDataMap[selectedCustomerName];
$('#deliveryPhone').val(selectedCustomer.customerPhone);
$('#deliveryAddress').val(selectedCustomer.deliveryAddress);
}
});
// 如果已经有了默认选项,则设置默认值
if (selectElement.children('option').length > 0) {
selectElement.trigger('change');
}
} else {
// 显示错误消息
$.modal.alertWarning("数据为空");
}
},
error: function(xhr, status, error) {
// 处理错误情况
console.error('AJAX Error:', error);
$.modal.alertWarning("请求失败,请稍后再试。");
},
});
}
//物料信息展示列表 //物料信息展示列表
$(function() { $(function() {
var options = { var options = {

Loading…
Cancel
Save