This commit is contained in:
zhangzhiguo 2025-11-20 22:07:38 +08:00
parent 27dee639e6
commit 694a0d61ef
1 changed files with 24 additions and 35 deletions

View File

@ -731,23 +731,16 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
this.getModel().deleteEntryData("materialinentry"); this.getModel().deleteEntryData("materialinentry");
this.getModel().setValue("issettlebyreconc", false); this.getModel().setValue("issettlebyreconc", false);
this.getModel().deleteEntryData("reconcentry"); this.getModel().deleteEntryData("reconcentry");
DynamicObject contract = (DynamicObject) changeData.getNewValue();//合同名称新值 Object value = this.getModel().getValue("contattr");//合同属性
if (contract != null) { if (value != null) {
DynamicObject contractType = contract.getDynamicObject("contracttype");//合同名称-合同类型 DynamicObject contAttr = (DynamicObject) value;
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contractType.get("number"))}; String numebr = contAttr.getString("number");
DynamicObject ec_conttype = BusinessDataServiceHelper.loadSingle("ec_conttype", "contattr", qFilters);//合同类型 if (!numebr.equals("sbwbl")) {
DynamicObject contattr = ec_conttype.getDynamicObject("contattr");//合同属性
String number = contattr.getString("number");//合同属性编码
if (!number.equals("sbwbl")) {
this.getModel().setValue("iseqsettle", false); 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"); this.getModel().deleteEntryData("eqsettleentry");
DynamicObject contract = (DynamicObject) changeData.getNewValue();
if (contract == null) { if (contract == null) {
this.getView().setVisible(false, new String[]{"issettlebymatin"}); this.getView().setVisible(false, new String[]{"issettlebymatin"});
this.getView().setVisible(false, new String[]{"issettlebyreconc"}); this.getView().setVisible(false, new String[]{"issettlebyreconc"});
@ -758,22 +751,22 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
this.getView().setEnable(false, new String[]{"project"}); this.getView().setEnable(false, new String[]{"project"});
} }
// boolean isPurchaseContract = this.isPurchaseType(contract); boolean isPurchaseContract = this.isPurchaseType();
// if (isPurchaseContract) { if (isPurchaseContract) {
String contractSettle = contract.getString("settlemethod"); String contractSettle = contract.getString("settlemethod");
if (StringUtils.equals(contractSettle, "B")) { if (StringUtils.equals(contractSettle, "B")) {
this.getModel().setValue("issettlebymatin", true); this.getModel().setValue("issettlebymatin", true);
this.getModel().setValue("issettlebyreconc", false); this.getModel().setValue("issettlebyreconc", false);
} else if (StringUtils.equals(contractSettle, "A")) { } else if (StringUtils.equals(contractSettle, "A")) {
this.getModel().setValue("issettlebymatin", false); this.getModel().setValue("issettlebymatin", false);
this.getModel().setValue("issettlebyreconc", true); this.getModel().setValue("issettlebyreconc", true);
}
} }
// }
this.getView().setVisible(true, new String[]{"issettlebymatin"}); this.getView().setVisible(isPurchaseContract, new String[]{"issettlebymatin"});
this.getView().setVisible(true, new String[]{"issettlebyreconc"}); this.getView().setVisible(isPurchaseContract, new String[]{"issettlebyreconc"});
// boolean isLeaseContract = this.isLeaseType(); boolean isLeaseContract = this.isLeaseType();
// this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"}); this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"});
} }
}//二开替换 }//二开替换
@ -1026,16 +1019,12 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
} }
protected boolean isPurchaseType(DynamicObject contract) { protected boolean isPurchaseType() {
DynamicObject contract1 = (DynamicObject) this.getModel().getValue("contract"); DynamicObject contractAttr = (DynamicObject) this.getModel().getValue("contattr");
if (contract1 == null) { if (contractAttr == null) {
return false; return false;
} else { } else {
DynamicObject contractType = contract.getDynamicObject("contracttype");//合同名称-合同类型 String basicType = contractAttr.getString("basictype");
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); return "02".equals(basicType) || "09".equals(basicType);
} }
} }