From ef705ef8ef19e6e00835e2acc33066a7cf331e08 Mon Sep 17 00:00:00 2001 From: "tanfengling@x-ri.com" <123456> Date: Mon, 1 Dec 2025 18:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=89=A9=E6=96=99=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E3=80=91=E8=AF=A6=E6=83=85=E7=95=8C=E9=9D=A2=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/sys/MaterialBillPlugin.java | 20 +++++++++++-------- .../plugin/form/sys/MaterialListPlugin.java | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) 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"); } }