diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractFilterPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractFilterPlugin.java index 01f4e67..468ac55 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractFilterPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractFilterPlugin.java @@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.form; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.form.FormShowParameter; import kd.bos.form.field.BasedataEdit; import kd.bos.form.field.events.BeforeF7SelectEvent; import kd.bos.form.field.events.BeforeF7SelectListener; @@ -26,12 +27,15 @@ public class ContractFilterPlugin extends AbstractBillPlugIn implements Plugin, //给物品基础资料添加beforef7Select事件监听 BasedataEdit supplies = this.getControl("contracttype"); supplies.addBeforeF7SelectListener(this); + BasedataEdit qdlx = this.getControl("treeresourceitem"); + qdlx.addBeforeF7SelectListener(this); } @Override public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) { - if (beforeF7SelectEvent.getProperty().getName().equals("contracttype")) { + String name1 = beforeF7SelectEvent.getProperty().getName(); + if (name1.equals("contracttype")) { // int row = beforeF7SelectEvent.getRow(); // if (this.getModel().getValue("contracttype") != null) { //判断当前支出还是收入 @@ -55,6 +59,14 @@ public class ContractFilterPlugin extends AbstractBillPlugIn implements Plugin, showParameter.getListFilterParameter().getQFilters().add(qFilter); //设置F7列表左树的过滤条件 showParameter.getTreeFilterParameter().getQFilters().add(treeFilter); + } else if (name1.equals("treeresourceitem")) { + FormShowParameter showParameter = beforeF7SelectEvent.getFormShowParameter(); + Object contType = this.getModel().getValue("contracttype"); + if(contType!=null){ + DynamicObject contractType = (DynamicObject)contType; + showParameter.setCustomParam("contractType",contractType.getString("number")); + } + } } // } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java new file mode 100644 index 0000000..13bf340 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -0,0 +1,18 @@ +package zcgj.zcdev.zcdev.pr.plugin.form; + +import kd.bos.form.FormShowParameter; +import kd.ec.basedata.formplugin.ResourceFilterPlugin; + +import java.util.EventObject; +import java.util.Map; + +public class ResourceFilterExtPlugin extends ResourceFilterPlugin { + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + FormShowParameter formShowParameter = this.getView().getParentView().getFormShowParameter(); + Map customParams = formShowParameter.getCustomParams(); +// customParams.get("contractType") + System.out.println(); + } +}