diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractSettleEditPluginExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractSettleEditPluginExt.java index e7dc7f8..3b845d1 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractSettleEditPluginExt.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractSettleEditPluginExt.java @@ -49,6 +49,7 @@ import kd.bos.form.field.events.BeforeF7SelectListener; import kd.bos.form.operate.FormOperate; import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.list.ListShowParameter; +import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.report.ReportShowParameter; import kd.bos.servicehelper.BusinessDataServiceHelper; @@ -730,16 +731,23 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement this.getModel().deleteEntryData("materialinentry"); this.getModel().setValue("issettlebyreconc", false); this.getModel().deleteEntryData("reconcentry"); - Object value = this.getModel().getValue("contattr");//合同属性 - if (value != null) { - DynamicObject contAttr = (DynamicObject) value; - String numebr = contAttr.getString("number"); - if (!numebr.equals("sbwbl")) { + DynamicObject contract = (DynamicObject) changeData.getNewValue();//合同名称新值 + if (contract != null) { + DynamicObject contractType = contract.getDynamicObject("contracttype");//合同名称-合同类型 + QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contractType.get("number"))}; + DynamicObject ec_conttype = BusinessDataServiceHelper.loadSingle("ec_conttype", "contattr", qFilters);//合同类型 + DynamicObject contattr = ec_conttype.getDynamicObject("contattr");//合同属性 + String number = contattr.getString("number");//合同属性编码 + if (!number.equals("sbwbl")) { this.getModel().setValue("iseqsettle", false); + this.getView().setVisible(false, "iseqsettle"); + } else { + this.getView().setVisible(true, "iseqsettle"); } + } else { + this.getView().setVisible(false, "iseqsettle"); } this.getModel().deleteEntryData("eqsettleentry"); - DynamicObject contract = (DynamicObject) changeData.getNewValue(); if (contract == null) { this.getView().setVisible(false, new String[]{"issettlebymatin"}); this.getView().setVisible(false, new String[]{"issettlebyreconc"}); @@ -750,22 +758,22 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement this.getView().setEnable(false, new String[]{"project"}); } - boolean isPurchaseContract = this.isPurchaseType(); - if (isPurchaseContract) { - String contractSettle = contract.getString("settlemethod"); - if (StringUtils.equals(contractSettle, "B")) { - this.getModel().setValue("issettlebymatin", true); - this.getModel().setValue("issettlebyreconc", false); - } else if (StringUtils.equals(contractSettle, "A")) { - this.getModel().setValue("issettlebymatin", false); - this.getModel().setValue("issettlebyreconc", true); - } +// boolean isPurchaseContract = this.isPurchaseType(contract); +// if (isPurchaseContract) { + String contractSettle = contract.getString("settlemethod"); + if (StringUtils.equals(contractSettle, "B")) { + this.getModel().setValue("issettlebymatin", true); + this.getModel().setValue("issettlebyreconc", false); + } else if (StringUtils.equals(contractSettle, "A")) { + this.getModel().setValue("issettlebymatin", false); + this.getModel().setValue("issettlebyreconc", true); } +// } - this.getView().setVisible(isPurchaseContract, new String[]{"issettlebymatin"}); - this.getView().setVisible(isPurchaseContract, new String[]{"issettlebyreconc"}); - boolean isLeaseContract = this.isLeaseType(); - this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"}); + this.getView().setVisible(true, new String[]{"issettlebymatin"}); + this.getView().setVisible(true, new String[]{"issettlebyreconc"}); +// boolean isLeaseContract = this.isLeaseType(); +// this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"}); } }//二开替换 @@ -1018,12 +1026,16 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement } - protected boolean isPurchaseType() { - DynamicObject contractAttr = (DynamicObject) this.getModel().getValue("contattr"); - if (contractAttr == null) { + protected boolean isPurchaseType(DynamicObject contract) { + DynamicObject contract1 = (DynamicObject) this.getModel().getValue("contract"); + if (contract1 == null) { return false; } else { - String basicType = contractAttr.getString("basictype"); + DynamicObject contractType = contract.getDynamicObject("contracttype");//合同名称-合同类型 + QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contractType.get("number"))}; + DynamicObject ec_conttype = BusinessDataServiceHelper.loadSingle("ec_conttype", "contattr", qFilters);//合同类型 + DynamicObject contattr = ec_conttype.getDynamicObject("contattr");//合同属性 + String basicType = contattr.getString("basictype"); return "02".equals(basicType) || "09".equals(basicType); } }