From 3aea51e7bd4d1aae43e0ad2ccf98948e79424e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B4=B5=E5=BC=BA?= Date: Mon, 21 Apr 2025 11:40:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8C=89=E9=92=AE=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/plugin/form/PayBillListPlugin.java | 32 ++++++------- .../form/RecBillChangeListExtendPlugin.java | 48 ++++++++++++------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/PayBillListPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/PayBillListPlugin.java index 386fba0..aa34b09 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/PayBillListPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/PayBillListPlugin.java @@ -19,25 +19,25 @@ public class PayBillListPlugin extends AbstractListPlugin implements Plugin { @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - BillList list = (BillList) this.getView().getControl("billlistap"); - ListSelectedRowCollection selectedRows = list.getSelectedRows(); - if (selectedRows == null || selectedRows.isEmpty()) { - this.getView().showTipNotification("请选择需要操作的付款单!"); - evt.setCancel(true); - return; - } - if (selectedRows.size()>1){ - this.getView().showTipNotification("请选择单条数据进行操作"); - evt.setCancel(true); - return; - } - - DynamicObject recBill= BusinessDataServiceHelper.loadSingle( - selectedRows.get(0).getPrimaryKeyValue(), - EntityMetadataCache.getDataEntityType("cas_paybill")); String key = evt.getItemKey().toLowerCase(); if ("tblcancelpay".equals(key)){ + BillList list = (BillList) this.getView().getControl("billlistap"); + ListSelectedRowCollection selectedRows = list.getSelectedRows(); + if (selectedRows == null || selectedRows.isEmpty()) { + this.getView().showTipNotification("请选择需要操作的付款单!"); + evt.setCancel(true); + return; + } + if (selectedRows.size()>1){ + this.getView().showTipNotification("请选择单条数据进行操作"); + evt.setCancel(true); + return; + } + + DynamicObject recBill= BusinessDataServiceHelper.loadSingle( + selectedRows.get(0).getPrimaryKeyValue(), + EntityMetadataCache.getDataEntityType("cas_paybill")); this.cancelPayValidator(evt,recBill); } diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeListExtendPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeListExtendPlugin.java index 2e41209..afc8b28 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeListExtendPlugin.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeListExtendPlugin.java @@ -38,27 +38,43 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements @Override public void beforeItemClick(BeforeItemClickEvent evt) { super.beforeItemClick(evt); - BillList list = (BillList) this.getView().getControl("billlistap"); - ListSelectedRowCollection selectedRows = list.getSelectedRows(); - if (selectedRows == null || selectedRows.isEmpty()) { - this.getView().showTipNotification("请选择需要操作的收款单!"); - evt.setCancel(true); - return; - } - if (selectedRows.size()>1){ - this.getView().showTipNotification("请选择单条数据进行操作"); - evt.setCancel(true); - return; - } - - DynamicObject recBill= BusinessDataServiceHelper.loadSingle( - selectedRows.get(0).getPrimaryKeyValue(), - EntityMetadataCache.getDataEntityType("cas_recbill")); String key = evt.getItemKey().toLowerCase(); if ("tblrecchg".equals(key)) { + BillList list = (BillList) this.getView().getControl("billlistap"); + ListSelectedRowCollection selectedRows = list.getSelectedRows(); + if (selectedRows == null || selectedRows.isEmpty()) { + this.getView().showTipNotification("请选择需要操作的收款单!"); + evt.setCancel(true); + return; + } + if (selectedRows.size()>1){ + this.getView().showTipNotification("请选择单条数据进行操作"); + evt.setCancel(true); + return; + } + + DynamicObject recBill= BusinessDataServiceHelper.loadSingle( + selectedRows.get(0).getPrimaryKeyValue(), + EntityMetadataCache.getDataEntityType("cas_recbill")); this.changeBillValidator(evt,recBill); }else if ("cancelrec".equals(key)){ + BillList list = (BillList) this.getView().getControl("billlistap"); + ListSelectedRowCollection selectedRows = list.getSelectedRows(); + if (selectedRows == null || selectedRows.isEmpty()) { + this.getView().showTipNotification("请选择需要操作的收款单!"); + evt.setCancel(true); + return; + } + if (selectedRows.size()>1){ + this.getView().showTipNotification("请选择单条数据进行操作"); + evt.setCancel(true); + return; + } + + DynamicObject recBill= BusinessDataServiceHelper.loadSingle( + selectedRows.get(0).getPrimaryKeyValue(), + EntityMetadataCache.getDataEntityType("cas_recbill")); this.cancelRecValidator(evt,recBill); }