修改上拉后的采购需求数据

This commit is contained in:
ggxl 2024-11-30 14:36:00 +08:00
parent 864353f230
commit 6c80808102
1 changed files with 32 additions and 0 deletions

View File

@ -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");
}
}
}