From 0c6a43235fbb2d3091ca5d446db225c3e6e14e57 Mon Sep 17 00:00:00 2001 From: zengweihai Date: Thu, 21 Nov 2024 17:07:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E6=96=B9=E5=85=A5=E5=9B=B4=E5=8F=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=AE=E8=AE=A2?= =?UTF-8?q?=E7=89=881.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SupplierInvitationFormPlugin.java | 56 +++++++++++++++---- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java b/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java index be907ae..dc8f441 100644 --- a/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java +++ b/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java @@ -11,8 +11,11 @@ import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.IEntryOperate; import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.bos.form.control.Button; import kd.bos.form.control.Control; import kd.bos.form.control.EntryGrid; +import kd.bos.form.control.events.BeforeItemClickEvent; +import kd.bos.form.control.events.ItemClickEvent; import kd.bos.form.events.AfterDoOperationEventArgs; import kd.bos.form.events.BeforeDoOperationEventArgs; import kd.bos.form.operate.FormOperate; @@ -37,27 +40,24 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit { private HashMap projectSectionMap = new HashMap(); List isCheckList = new ArrayList(); - @Override - public void beforeDoOperation(BeforeDoOperationEventArgs args) { - super.beforeDoOperation(args); - FormOperate source = (FormOperate) args.getSource(); - String operateKey = source.getOperateKey(); - if ("addsupplierdetail".equals(operateKey)){ - } + public void registerListener(EventObject e) { + super.registerListener(e); + addItemClickListeners("supplierenrolltoolbar"); } + @Override - public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { - super.afterDoOperation(afterDoOperationEventArgs); - String operateKey = afterDoOperationEventArgs.getOperateKey(); + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); DynamicObject bidproject = (DynamicObject) this.getModel().getValue("bidproject"); - if ("addsupplierdetail".equals(operateKey)){ + if ("addsupplierdetail".equals(itemKey)){ EntryGrid SEEntryGrid = this.getControl("supplierenrollentry"); DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry"); int[] selectRows = SEEntryGrid.getSelectRows(); - this.getView().showTipNotification(String.valueOf(selectRows[0])); for (int selectRow : selectRows) { + this.getView().showTipNotification("beforedo:"+String.valueOf(selectRow)); DynamicObject dy = SEEntry.get(selectRow); DynamicObject enrollsupplier = dy.getDynamicObject("enrollsupplier");//报名供应商 if (enrollsupplier != null){ @@ -72,8 +72,40 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit { } } + } + @Override + public void beforeDoOperation(BeforeDoOperationEventArgs args) { + super.beforeDoOperation(args); +// FormOperate source = (FormOperate) args.getSource(); +// String operateKey = source.getOperateKey(); +// DynamicObject bidproject = (DynamicObject) this.getModel().getValue("bidproject"); +// if ("addsupplierdetail".equals(operateKey)){ +// EntryGrid SEEntryGrid = this.getControl("supplierenrollentry"); +// DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry"); +// int[] selectRows = SEEntryGrid.getSelectRows(); +// for (int selectRow : selectRows) { +// this.getView().showTipNotification("beforedo:"+String.valueOf(selectRow)); +// DynamicObject dy = SEEntry.get(selectRow); +// DynamicObject enrollsupplier = dy.getDynamicObject("enrollsupplier");//报名供应商 +// if (enrollsupplier != null){ +// Object enrollsupplierPkValue = enrollsupplier.getPkValue(); +// boolean flag = checkSupplierCollection(enrollsupplierPkValue,bidproject); +// if (!flag){ +// this.createRespMyTender(enrollsupplierPkValue); +// DynamicObject dataEntity = this.getModel().getDataEntity(); +// SaveServiceHelper.save(new DynamicObject[]{dataEntity}); +// } +// } +// +// } +// } + + } + + + @Override public void propertyChanged(PropertyChangedArgs args) { ChangeData changeData = args.getChangeSet()[0];