diff --git a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java index 02b0fe0..e0570c8 100644 --- a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java @@ -297,26 +297,30 @@ public class MaterialBillPlugin extends AbstractBillPlugIn { } if("copyandchange".equals(operateKey)) { super.beforeDoOperation(args); + this.getPageCache().put("copyMatId", this.getModel().getValue("id").toString()); FormOperate operate = (FormOperate) args.getSource(); String operateNo = operate.getOperateKey(); - if(operateNo.equalsIgnoreCase("copy")){ + if(operateNo.equalsIgnoreCase("copyandchange")){ DynamicObject bill = this.getModel().getDataEntity(); this.getView().getFormShowParameter().setCustomParam("copySrcBillName", bill.getString("name")); this.getView().getFormShowParameter().setCustomParam("copySrcBillNumber", bill.getString("number")); + this.getView().getFormShowParameter().setCustomParam("operateKey", "copyandchange"); } } } - @Override public void afterCopyData(EventObject e) { super.afterCopyData(e); - String copySrcBillName = this.getView().getFormShowParameter().getCustomParam("copySrcBillName"); - String copySrcBillNumber = this.getView().getFormShowParameter().getCustomParam("copySrcBillNumber"); - DynamicObject dataEntity = this.getModel().getDataEntity(true); - dataEntity.set("name", copySrcBillName + "_copy"); - dataEntity.set("tqq9_srcnumber", copySrcBillNumber); - this.getView().invokeOperation("save"); + String operateKey = this.getView().getFormShowParameter().getCustomParam("operateKey"); + if("copyandchange".equals(operateKey)){ + String copySrcBillName = this.getView().getFormShowParameter().getCustomParam("copySrcBillName"); + String copySrcBillNumber = this.getView().getFormShowParameter().getCustomParam("copySrcBillNumber"); + DynamicObject dataEntity = this.getModel().getDataEntity(true); + dataEntity.set("name", copySrcBillName + "_copy"); + dataEntity.set("tqq9_srcnumber", copySrcBillNumber); + this.getView().invokeOperation("save"); + } } public void afterDoOperation(AfterDoOperationEventArgs evt) { diff --git a/lc123/cloud/app/plugin/form/sys/MaterialListPlugin.java b/lc123/cloud/app/plugin/form/sys/MaterialListPlugin.java index 2257082..87620be 100644 --- a/lc123/cloud/app/plugin/form/sys/MaterialListPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/MaterialListPlugin.java @@ -229,6 +229,7 @@ public class MaterialListPlugin extends AbstractListPlugin implements Plugin { BillShowParameter parameter = e.getParameter(); parameter.setCustomParam("copySrcBillName",bd_material.getString("name")); parameter.setCustomParam("copySrcBillNumber",bd_material.getString("number")); + this.getView().getFormShowParameter().setCustomParam("operateKey", "copyandchange"); } }