【物料变更】详情界面复制报错问题修复

This commit is contained in:
tanfengling@x-ri.com 2025-12-01 18:51:41 +08:00
parent 14c9c3f36a
commit ef705ef8ef
2 changed files with 13 additions and 8 deletions

View File

@ -297,20 +297,23 @@ 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 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);
@ -318,6 +321,7 @@ public class MaterialBillPlugin extends AbstractBillPlugIn {
dataEntity.set("tqq9_srcnumber", copySrcBillNumber);
this.getView().invokeOperation("save");
}
}
public void afterDoOperation(AfterDoOperationEventArgs evt) {
super.afterDoOperation(evt);

View File

@ -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");
}
}