新增按钮跳过校验

This commit is contained in:
李贵强 2025-04-21 11:40:40 +08:00
parent 5f13369891
commit 3aea51e7bd
2 changed files with 48 additions and 32 deletions

View File

@ -19,25 +19,25 @@ public class PayBillListPlugin extends AbstractListPlugin implements Plugin {
@Override @Override
public void beforeItemClick(BeforeItemClickEvent evt) { public void beforeItemClick(BeforeItemClickEvent evt) {
super.beforeItemClick(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(); String key = evt.getItemKey().toLowerCase();
if ("tblcancelpay".equals(key)){ 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); this.cancelPayValidator(evt,recBill);
} }

View File

@ -38,27 +38,43 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements
@Override @Override
public void beforeItemClick(BeforeItemClickEvent evt) { public void beforeItemClick(BeforeItemClickEvent evt) {
super.beforeItemClick(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(); String key = evt.getItemKey().toLowerCase();
if ("tblrecchg".equals(key)) { 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); this.changeBillValidator(evt,recBill);
}else if ("cancelrec".equals(key)){ }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); this.cancelRecValidator(evt,recBill);
} }