diff --git a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java index b130d62..5778976 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java @@ -35,6 +35,7 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -285,12 +286,19 @@ public class ReceiptHeaderController extends BaseController { if (receiptHeader == null) { return AjaxResult.error("没有找到单据" + String.valueOf(id)); } - if(receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { +/* if(receiptHeader.getFirstStatus() >= QuantityConstant.RECEIPT_HEADER_POOL) { return AjaxResult.error("订单状态大于100不能删除"); - } + }*/ LambdaQueryWrapper<ReceiptDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); lambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper); + BigDecimal finishQty = BigDecimal.ZERO; + for (ReceiptDetail receiptDetail : list) { + finishQty = finishQty.add(receiptDetail.getTaskQty()); + } + if(finishQty.compareTo(BigDecimal.ZERO) >0){ + return AjaxResult.error("入库的那删除:已收数量不为零不能删除入库单"); + } List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>(); if (!receiptHeaderService.removeById(receiptHeader)) { throw new ServiceException("删除头表失败"); diff --git a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html index 2dd418b..a005e15 100644 --- a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html +++ b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html @@ -261,11 +261,11 @@ actions.push('<a class="btn btn-primary btn-xs to-receive" ' +addFlag+ ' onclick="Toreceiving(\''+ row.code + '\')"><i class="fa fa-cart-plus"></i>收货</a> '); if (row.firstStatus < 100) { actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); } if (row.firstStatus == 800 && row.lastStatus == 800) { actions.push('<a class="btn btn-info btn-xs ' + receiveFlag + '" href="#" onclick="backERP(\''+row.id+'\')"><i class="fa fa-upload"></i>回传</a>'); } + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); } }, @@ -401,7 +401,7 @@ { field : 'lastUpdated', title : '最后修改时间', - visible:true, + visible:false, }, { field : 'lastUpdatedBy', @@ -595,7 +595,7 @@ { field : 'lastUpdated', title : '最后修改时间', - visible:true + visible:false }, { field : 'productionWorkerName',