diff --git a/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java b/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java new file mode 100644 index 0000000..9dd01da --- /dev/null +++ b/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java @@ -0,0 +1,32 @@ +package shkd.repc.rebm.formplugin; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.events.AfterDoOperationEventArgs; +import kd.sdk.plugin.Plugin; + +/** + * 单据界面插件 + */ +public class UpdateDrawPurDataPlugin extends AbstractBillPlugIn implements Plugin { + + @Override + public void afterDoOperation(AfterDoOperationEventArgs args) { + super.afterDoOperation(args); + String operateKey = args.getOperateKey(); + if ("draw".equals(operateKey)) { + IDataModel model = this.getModel(); + int rowIndex = model.getEntryCurrentRowIndex("bidsection"); + DynamicObjectCollection bidSections = model.getEntryEntity("bidsection"); + DynamicObject dynamicObject1 = bidSections.get(rowIndex); + DynamicObject dynamicObject2 = bidSections.get(bidSections.size() - 1); + + DynamicObjectCollection projectEntries = dynamicObject1.getDynamicObjectCollection("projectentry"); + projectEntries.addAll(dynamicObject2.getDynamicObjectCollection("projectentry")); + model.deleteEntryRow("bidsection", bidSections.size() - 1); + this.getView().updateView("projectentry"); + } + } +} \ No newline at end of file