diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractMeasureBillEditExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractMeasureBillEditExtPlugin.java index de322b9..f7ffa24 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractMeasureBillEditExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractMeasureBillEditExtPlugin.java @@ -9,14 +9,17 @@ public class OutContractMeasureBillEditExtPlugin extends OutContractMeasureBillE protected void controlCostMustInput() { super.controlCostMustInput(); DynamicObject contract = this.getModel().getDataEntity().getDynamicObject("contract"); - String number = contract.getDynamicObject("contracttype").getString("number"); - if (number .equals("wzcg01")||number.equals("sbcg")||number.equals("jjfb")){ - BasedataEdit basedataEdit = (BasedataEdit)this.getControl("listcbs"); - basedataEdit.setMustInput(false); - basedataEdit = (BasedataEdit)this.getControl("cbs"); - basedataEdit.setMustInput(false); - this.getView().setVisible(false,"listcbs"); - this.getView().setVisible(false,"cbs"); + if(contract!=null){ + String number = contract.getDynamicObject("contracttype").getString("number"); + if (number .equals("wzcg01")||number.equals("sbcg")||number.equals("jjfb")){ + BasedataEdit basedataEdit = (BasedataEdit)this.getControl("listcbs"); + basedataEdit.setMustInput(false); + basedataEdit = (BasedataEdit)this.getControl("cbs"); + basedataEdit.setMustInput(false); + this.getView().setVisible(false,"listcbs"); + this.getView().setVisible(false,"cbs"); + } } + } }