From c288a28fe13fc6c07b33a0708382ed18ee9a5c11 Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Wed, 11 Dec 2024 18:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr/plugin/form/ContractFilterPlugin.java | 14 +++++++++++++- .../plugin/form/ResourceFilterExtPlugin.java | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java 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(); + } +}