refactor(product): 优化产品列表和订单编辑功能

- 移除部分冗余代码
-改进价格格式化和计算逻辑
- 调整产品列表显示和选择功能
- 优化订单编辑界面布局
master
chenhao 2025-06-25 09:05:41 +08:00
parent 5ea8fa9c5b
commit 317e5db7c6
4 changed files with 9 additions and 8 deletions

View File

@ -278,7 +278,7 @@
$('.productTable .catalogue-price-format').on('input', function () { $('.productTable .catalogue-price-format').on('input', function () {
let val = $(this).val() let val = $(this).val()
$(this).parent().parent().find('.cataloguePrice').val(val) $(this).parent().parent().find('.cataloguePrice').val(val)
// let quantity = $(this).parent().parent().find('.quantity').val() let quantity = $(this).parent().parent().find('.quantity').val()
// let discount=$(this).parent().parent().find('.discount').val() // let discount=$(this).parent().parent().find('.discount').val()
// if (discount && val){ // if (discount && val){
// $(this).parent().parent().find('.price').val((val * discount).toFixed(2)) // $(this).parent().parent().find('.price').val((val * discount).toFixed(2))
@ -290,10 +290,10 @@
// $(this).parent().parent().find('.allPrice-formmat').val(formatAmountNumber(allPrice)) // $(this).parent().parent().find('.allPrice-formmat').val(formatAmountNumber(allPrice))
// } // }
// } // }
// if (quantity && val) { if (quantity && val) {
// $(this).parent().parent().find('.catalogueAllPrice').val((val * quantity).toFixed(2)) $(this).parent().parent().find('.catalogueAllPrice').val((val * quantity).toFixed(2))
// $(this).parent().parent().find('.catalogueAllPrice-formmat').val(formatAmountNumber((val * quantity).toFixed(2))) $(this).parent().parent().find('.catalogueAllPrice-formmat').val(formatAmountNumber((val * quantity).toFixed(2)))
// } }
}) })
$('.productTable .guidance-discount-format').on('input', function () { $('.productTable .guidance-discount-format').on('input', function () {

View File

@ -96,6 +96,7 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
projectInfo.setHardwareProjectProductInfoList(productListMap.get(ProductInfo.ProductTypeEnum.HARDWARE.getType())); projectInfo.setHardwareProjectProductInfoList(productListMap.get(ProductInfo.ProductTypeEnum.HARDWARE.getType()));
List<ProjectProductInfo> maintenanceProjectProductInfoList = productListMap.getOrDefault(ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType(), new ArrayList<>()); List<ProjectProductInfo> maintenanceProjectProductInfoList = productListMap.getOrDefault(ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType(), new ArrayList<>());
maintenanceProjectProductInfoList.addAll(productListMap.getOrDefault(ProductInfo.ProductTypeEnum.SOFTWARE_MAINTENANCE.getType(), new ArrayList<>())); maintenanceProjectProductInfoList.addAll(productListMap.getOrDefault(ProductInfo.ProductTypeEnum.SOFTWARE_MAINTENANCE.getType(), new ArrayList<>()));
maintenanceProjectProductInfoList.addAll(productListMap.getOrDefault(ProductInfo.ProductTypeEnum.OTHER.getType(), new ArrayList<>()));
projectInfo.setMaintenanceProjectProductInfoList(maintenanceProjectProductInfoList); projectInfo.setMaintenanceProjectProductInfoList(maintenanceProjectProductInfoList);
//查询变更记录信息 //查询变更记录信息
List<ProjectWorkProgress> projectWorkProgresses = workProgressService.selectProjectWorkProgressListByProjectId(Collections.singletonList((projectInfo.getId()))); List<ProjectWorkProgress> projectWorkProgresses = workProgressService.selectProjectWorkProgressListByProjectId(Collections.singletonList((projectInfo.getId())));

View File

@ -171,12 +171,12 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
} }
String shortCode = cnareas.get(0).getShortCode(); String shortCode = cnareas.get(0).getShortCode();
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
result.append("ZGXS-").append(currentDate).append(shortCode); result.append("ZGXV-").append(currentDate).append(shortCode);
// 查询当天已有的订单数量,用于生成顺序编码 // 查询当天已有的订单数量,用于生成顺序编码
int count = projectOrderInfoMapper.selectMaxOrderCode(result.toString()); int count = projectOrderInfoMapper.selectMaxOrderCode(result.toString());
// 生成顺序编码,不足三位补零 // 生成顺序编码,不足三位补零
String sequence = String.format("%03d", count + 1); String sequence = String.format("%03d", count + 1);
result.append(sequence).append("-VDI"); result.append(sequence);
// 拼接订单编号 // 拼接订单编号
return result.toString(); return result.toString();
} }