From efd8b2a3e5593dc41982f2c368e1267818767ad6 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Fri, 29 Aug 2025 11:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BB=A3=E7=A0=81=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=A2=86=E6=96=99=E4=BA=BA=E5=BF=85=E5=A1=AB=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/MaterialOutBillEditPluginExt.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialOutBillEditPluginExt.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialOutBillEditPluginExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialOutBillEditPluginExt.java new file mode 100644 index 0000000..49e36e0 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialOutBillEditPluginExt.java @@ -0,0 +1,79 @@ +package zcgj.zcdev.zcdev.pr.plugin.form; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.entity.LocaleString; +import kd.bos.form.field.BasedataEdit; +import kd.bos.form.field.ComboEdit; +import kd.bos.form.field.ComboItem; +import kd.ec.material.formplugin.MaterialOutBillEditPlugin; + +import java.util.ArrayList; +import java.util.EventObject; +import java.util.Iterator; + +/** + * 出库单扩展系统代码:修改领料人必填逻辑 + */ +public class MaterialOutBillEditPluginExt extends MaterialOutBillEditPlugin { + public MaterialOutBillEditPluginExt() { + } + + public void afterBindData(EventObject e) { + super.afterBindData(e); + DynamicObject labour = (DynamicObject) this.getModel().getValue("labour"); + this.buildRequestPerson(labour); + this.setProjectAndUnitProEable(); + this.setUnitProject(); + this.setMustInputByCostType((String) this.getModel().getValue("costtype")); + } + + protected void buildRequestPerson(DynamicObject labour) { + BasedataEdit reqPersonF7; + if (labour != null) { + String team = labour.getString("team"); + if ("01".equals(team)) { + ComboEdit reqPersonCombo = (ComboEdit) this.getControl("reqpersonname"); + this.getView().setVisible(false, new String[]{"reqpersonname"}); + reqPersonCombo.setMustInput(false); + BasedataEdit reqPersonF71 = (BasedataEdit) this.getControl("requestperson"); + this.getView().setVisible(true, new String[]{"requestperson"}); +// reqPersonF71.setMustInput(true); + } else if ("02".equals(team)) { + reqPersonF7 = (BasedataEdit) this.getControl("requestperson"); + this.getView().setVisible(false, new String[]{"requestperson"}); + reqPersonF7.setMustInput(false); + ComboEdit reqPersonCombo = (ComboEdit) this.getControl("reqpersonname"); + this.getView().setVisible(true, new String[]{"reqpersonname"}); + reqPersonCombo.setMustInput(true); + DynamicObjectCollection personEntryEntitys = labour.getDynamicObjectCollection("entryentity"); + ArrayList comboList = new ArrayList(); + if (personEntryEntitys != null && personEntryEntitys.size() > 0) { + Iterator var7 = personEntryEntitys.iterator(); + + while (var7.hasNext()) { + DynamicObject person = (DynamicObject) var7.next(); + ComboItem comboItem = new ComboItem(); + LocaleString localeString = new LocaleString(); + String personName = person.getString("pickmaterialsname"); + localeString.setLocaleValue(personName); + comboItem.setCaption(localeString); + comboItem.setValue(personName); + comboList.add(comboItem); + } + } + + reqPersonCombo.setComboItems(comboList); + } + } else { + ComboEdit reqPersonCombo = (ComboEdit) this.getControl("reqpersonname"); + this.getView().setVisible(false, new String[]{"reqpersonname"}); + reqPersonCombo.setMustInput(false); + reqPersonF7 = (BasedataEdit) this.getControl("requestperson"); + this.getView().setVisible(true, new String[]{"requestperson"}); +// reqPersonF7.setMustInput(true);//系统代码 + reqPersonF7.setMustInput(false);//二开系统代码 + } + + } +}