From 6282af0fb3ac4ebd4b297984f5fa8492aa05c877 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Fri, 22 Aug 2025 11:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B4=B9=E7=94=A8=E6=89=BF=E6=8B=85=E5=85=AC?= =?UTF-8?q?=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/PaymentApplicationPlugin.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PaymentApplicationPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PaymentApplicationPlugin.java index ac21b84..96c7f90 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PaymentApplicationPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PaymentApplicationPlugin.java @@ -5,11 +5,14 @@ import kd.bos.bill.BillShowParameter; import kd.bos.bill.OperationStatus; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.entity.ILocaleString; import kd.bos.dataentity.metadata.IDataEntityProperty; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.IClientViewProxy; import kd.bos.form.control.AttachmentPanel; +import kd.bos.form.control.Label; import kd.bos.form.control.events.AttachmentOperaClickListener; import kd.bos.form.events.AfterDoOperationEventArgs; import kd.bos.form.field.BasedataEdit; @@ -22,6 +25,12 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.user.UserServiceHelper; +import kd.fi.er.business.bean.CostDeptF7ChangePram; +import kd.fi.er.business.servicehelper.CoreBaseBillServiceHelper; +import kd.fi.er.business.utils.ErCommonUtils; +import kd.fi.er.business.utils.ErCostCenterUtil; +import kd.fi.er.business.utils.ErEntityTypeUtils; +import kd.fi.er.business.utils.ErStdConfig; import kd.sdk.plugin.Plugin; import java.util.ArrayList; @@ -87,6 +96,10 @@ public class PaymentApplicationPlugin extends AbstractBillPlugIn implements Atta if (costDept != null) { setOrg(costDept); } + String propName = e.getProperty().getName(); + ChangeData[] valueSet = e.getChangeSet(); + Object propValue = valueSet[0].getNewValue(); + costDeptChange(propName,(DynamicObject)propValue); } } @@ -198,4 +211,40 @@ public class PaymentApplicationPlugin extends AbstractBillPlugIn implements Atta new QFilter("number", QCP.equals, viewParent.getString("number"))}); this.getModel().setValue("zcgj_org", bos_adminorg);//所属组织 } + + //获取费用承担公司 + protected void costDeptChange(String propName, DynamicObject costDept) { + if (costDept != null) { + IDataModel model = this.getModel(); + this.refreshBaseInfoLabel(propName, costDept); + DynamicObject company = (DynamicObject)model.getValue("zcgj_org"); + DynamicObject costCompany = (DynamicObject)model.getValue("zcgj_costcompany"); + CostDeptF7ChangePram costDeptF7ChangePram = new CostDeptF7ChangePram(Boolean.TRUE, costDept, costCompany, company); + Long costCompanyId = CoreBaseBillServiceHelper.getAccountOrgId(costDeptF7ChangePram);//获取费用承担公司 + model.setValue("zcgj_costcompany", costCompanyId); + this.getView().updateView("zcgj_costcompany"); + + } + } + + private boolean isShowTypeExceptionBill() { + String entryName = this.getView().getEntityId(); + return ErEntityTypeUtils.isApplyProjectBill(entryName) || ErEntityTypeUtils.isCostEstimateBill(entryName) || ErEntityTypeUtils.isApplyPayBill(entryName) || ErEntityTypeUtils.isPrePayBill(entryName) || ErEntityTypeUtils.isRepaymentBill(entryName) || ErEntityTypeUtils.isShareBill(entryName) || ErEntityTypeUtils.isWithholdingBill(entryName); + } + + protected void refreshBaseInfoLabel(String propName, Object propValue) { + String propStr = null; + if (propValue instanceof DynamicObject) { + ILocaleString name = ((DynamicObject)propValue).getLocaleString("name"); + propStr = name.getLocaleValue(); + } else if (propValue instanceof String) { + propStr = (String)propValue; + } + + Label propControl = (Label)this.getControl(propName + "V"); + if (propControl != null) { + propControl.setText(propStr); + } + + } }