fix:询价单替换

This commit is contained in:
ljw 2024-09-20 21:28:50 +08:00
parent 8c13ff38a2
commit fe50c336ee

View File

@ -80,28 +80,33 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
public static void optionalOperation(IDataModel model, IFormView view, String formId, String operationNumber) { public static void optionalOperation(IDataModel model, IFormView view, String formId, String operationNumber) {
String name = model.getDataEntity().getDataEntityType().getName(); String name = model.getDataEntity().getDataEntityType().getName();
int currentRowIndex = -1; int currentRowIndex = -1;
if("yem_es_salesorder".equals(name)||"yem_es_xsalesorder".equals(name)){ if ("yem_es_salesorder".equals(name) || "yem_es_xsalesorder".equals(name)) {
currentRowIndex = model.getEntryCurrentRowIndex("yem_es_materialinfo"); currentRowIndex = model.getEntryCurrentRowIndex("yem_es_materialinfo");
} }
if("yem_im_clientdemand".equals(name) || "yem_im_inquirylist".equals(name)){ if ("yem_im_clientdemand".equals(name) || "yem_im_inquirylist".equals(name)) {
currentRowIndex = model.getEntryCurrentRowIndex("yem_im_detailedinfor"); currentRowIndex = model.getEntryCurrentRowIndex("yem_im_detailedinfor");
} }
DynamicObject billType = (DynamicObject) model.getValue("yem_billtype"); DynamicObject billType = (DynamicObject) model.getValue("yem_billtype");
DynamicObjectCollection yem_im_detailedinfor = model.getEntryEntity("yem_im_detailedinfor"); DynamicObjectCollection yem_im_detailedinfor = model.getEntryEntity("yem_im_detailedinfor");
for (DynamicObject dynamicObject : yem_im_detailedinfor) {
DynamicObject productModel = (DynamicObject)model.getValue("yem_productmodel",currentRowIndex);
DynamicObject products = dynamicObject.getDynamicObject("yem_productmodel.yem_products");
DynamicObjectCollection yem_multiconfig = dynamicObject.getDynamicObjectCollection("yem_multiconfig");
if (yem_multiconfig != null) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<Long> ids = new ArrayList(); List<Long> ids = new ArrayList();
DynamicObject productModel = (DynamicObject) model.getValue("yem_productmodel", currentRowIndex);
DynamicObject products = yem_im_detailedinfor.get(0).getDynamicObject("yem_productmodel.yem_products");
for (DynamicObject dynamicObject : yem_im_detailedinfor) {
DynamicObjectCollection yem_multiconfig = dynamicObject.getDynamicObjectCollection("yem_multiconfig");
if (yem_multiconfig != null) {
// int multiConfigRows = model.getEntryRowCount("yem_multiconfig"); // int multiConfigRows = model.getEntryRowCount("yem_multiconfig");
for (DynamicObject object : yem_multiconfig) { for (DynamicObject object : yem_multiconfig) {
// String configurType = (String) model.getValue("yem_configurtype", i); // String configurType = (String) model.getValue("yem_configurtype", i);
Long configEntryId = object.getLong("yem_configentryid"); Long configEntryId = object.getLong("yem_configentryid");
ids.add(configEntryId); ids.add(configEntryId);
} }
}
}
map.put("billTypeNumber", billType.getString("number")); map.put("billTypeNumber", billType.getString("number"));
map.put("products", products.getPkValue()); map.put("products", products.getPkValue());
map.put("operationNumber", operationNumber); map.put("operationNumber", operationNumber);
@ -110,8 +115,6 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
map.put("productModel", productModel); map.put("productModel", productModel);
viewForm(formId, map, view); viewForm(formId, map, view);
} }
}
}
/** /**