From 2fc35ed948e19f8fde5b49c330bda099b0c2b3d4 Mon Sep 17 00:00:00 2001 From: ggxl <194689125@qq.com> Date: Sat, 30 Nov 2024 10:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3=E3=80=81?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=B8=9A=E5=8A=A1=E7=B1=BB=E5=9E=8B=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=AD=97=E6=AE=B5=E5=92=8C=E5=AE=B9=E5=99=A8=E6=98=BE?= =?UTF-8?q?=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ControlFieldOnBizTypePlugin.java | 69 +++++++++++++++++++ .../ImportPurchaseApplyBillPlugin.java | 4 ++ 2 files changed, 73 insertions(+) create mode 100644 main/java/shkd/repc/rebm/formplugin/ControlFieldOnBizTypePlugin.java diff --git a/main/java/shkd/repc/rebm/formplugin/ControlFieldOnBizTypePlugin.java b/main/java/shkd/repc/rebm/formplugin/ControlFieldOnBizTypePlugin.java new file mode 100644 index 0000000..0cdd6c2 --- /dev/null +++ b/main/java/shkd/repc/rebm/formplugin/ControlFieldOnBizTypePlugin.java @@ -0,0 +1,69 @@ +package shkd.repc.rebm.formplugin; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.entity.datamodel.events.ChangeData; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.bos.form.IFormView; +import kd.sdk.plugin.Plugin; + +import java.util.EventObject; + +/** + * 单据界面插件 + */ +public class ControlFieldOnBizTypePlugin extends AbstractBillPlugIn implements Plugin { + + /* + * 采购需求单-根据业务类型控制字段和容器显隐 + * */ + + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + IDataModel model = this.getModel(); + IFormView view = this.getView(); + DynamicObject bizType = (DynamicObject) model.getValue("qeug_biztype"); + if (bizType != null) { + String number = bizType.getString("number"); + if ("pur-001".equals(number)) { + view.setVisible(true, "qeug_renovation_proj", "qeug_renovation_pur", "qeug_renovation_scop", "qeug_renovation_type", "qeug_softdecoration", "qeug_emt_bp", "qeug_proj_budget", "qeug_soft_budget"); + } else if ("pur-002".equals(number)) { + view.setVisible(true, "qeug_purchase_type", "qeug_applyamount", "qeug_outline"); + } else if ("pur-003".equals(number)) { + view.setVisible(true, "qeug_purchase_type", "qeug_applyamount", "qeug_outline", "advconap"); + } else if ("pur-004".equals(number) || "pur-005".equals(number) || "pur-006".equals(number)) { + view.setVisible(true, "qeug_applyamount", "qeug_outline", "advconap"); + } + } + } + + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + String name = e.getProperty().getName(); + if ("qeug_biztype".equals(name)) { + ChangeData changeData = e.getChangeSet()[0]; + Object newValue = changeData.getNewValue(); + IFormView view = this.getView(); + view.setVisible(false, "qeug_renovation_proj", "qeug_renovation_pur", "qeug_renovation_scop", "qeug_renovation_type", + "qeug_softdecoration", "qeug_emt_bp", "qeug_proj_budget", "qeug_soft_budget", "qeug_purchase_type", + "qeug_applyamount", "qeug_outline", "advconap"); + + if (newValue != null) { + DynamicObject bizType = (DynamicObject) newValue; + String number = bizType.getString("number"); + if ("pur-001".equals(number)) { + view.setVisible(true, "qeug_renovation_proj", "qeug_renovation_pur", "qeug_renovation_scop", "qeug_renovation_type", "qeug_softdecoration", "qeug_emt_bp", "qeug_proj_budget", "qeug_soft_budget"); + } else if ("pur-002".equals(number)) { + view.setVisible(true, "qeug_purchase_type", "qeug_applyamount", "qeug_outline"); + } else if ("pur-003".equals(number)) { + view.setVisible(true, "qeug_purchase_type", "qeug_applyamount", "qeug_outline", "advconap"); + } else if ("pur-004".equals(number) || "pur-005".equals(number) || "pur-006".equals(number)) { + view.setVisible(true, "qeug_applyamount", "qeug_outline", "advconap"); + } + } + } + } +} \ No newline at end of file diff --git a/main/java/shkd/repc/rebm/formplugin/ImportPurchaseApplyBillPlugin.java b/main/java/shkd/repc/rebm/formplugin/ImportPurchaseApplyBillPlugin.java index 0f7f193..0d9b975 100644 --- a/main/java/shkd/repc/rebm/formplugin/ImportPurchaseApplyBillPlugin.java +++ b/main/java/shkd/repc/rebm/formplugin/ImportPurchaseApplyBillPlugin.java @@ -26,6 +26,10 @@ import kd.sdk.plugin.Plugin; */ public class ImportPurchaseApplyBillPlugin extends AbstractBillPlugIn implements Plugin { + /* + * 采购计划单/标前预备会-引入采购需求单 + * */ + String[] fields = new String[]{ "qeug_auditoption", "qeug_option",