From 7530eb6f0d45b92a29fd23b721af1d9f4d5ae6fc Mon Sep 17 00:00:00 2001 From: zengweihai Date: Fri, 22 Nov 2024 14:18:32 +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.2=EF=BC=9A=20=E6=A0=87=E5=87=86=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=B8=8D=E5=85=81=E8=AE=B8=E5=88=A0?= =?UTF-8?q?=E9=99=A4=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=88=9D=E5=A7=8B=E4=B8=BA?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SupplierInvitationFormPlugin.java | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java b/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java index a089108..21f138c 100644 --- a/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java +++ b/main/java/shkd/repc/rebm/formplugin/SupplierInvitationFormPlugin.java @@ -9,6 +9,7 @@ import kd.bos.entity.EntityMetadataCache; import kd.bos.entity.EntityType; import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.IEntryOperate; +import kd.bos.entity.datamodel.events.AfterAddRowEventArgs; import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.control.Button; @@ -74,33 +75,38 @@ 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}); -// } -// } -// -// } -// } - + FormOperate source = (FormOperate) args.getSource(); + String operateKey = source.getOperateKey(); + if ("deleteentry1".equals(operateKey)){ + EntryGrid SEEntryGrid = this.getControl("supplierenrollentry"); + DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry"); + int[] selectRows = SEEntryGrid.getSelectRows(); + int flag = 0; + for (int selectRow : selectRows) { + DynamicObject dy = SEEntry.get(selectRow); + boolean qeug_isaddnew = dy.getBoolean("qeug_isaddnew"); + if (!qeug_isaddnew){ + flag++; + } + } + if (flag > 0){ + args.setCancel(true); + this.getView().showTipNotification("选择供应商存在非新增供应商,请重新选择!"); + } + } } - + @Override + public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { + super.afterDoOperation(afterDoOperationEventArgs); + String operateKey = afterDoOperationEventArgs.getOperateKey(); + if ("newentry1".equals(operateKey)){ + DynamicObjectCollection supplierenrollentry = this.getModel().getEntryEntity("supplierenrollentry"); + DynamicObject addNew = supplierenrollentry.get(supplierenrollentry.size() - 1); + addNew.set("qeug_isaddnew",true); + this.getView().updateView("supplierenrollentry"); + } + } @Override public void propertyChanged(PropertyChangedArgs args) {