询价单二开

This commit is contained in:
ljw 2024-09-04 20:31:51 +08:00
parent 630b9212d2
commit 0b5ee97851

View File

@ -201,12 +201,14 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
super.propertyChanged(e);
IDataModel model = this.getModel();
String name = e.getProperty().getName();
int rowIndex = e.getChangeSet()[0].getRowIndex();
switch (name) {
case "yem_productmodel":
model.deleteEntryData("yem_multiconfig");
price(rowIndex);
break;
case "yem_material":
int rowIndex = e.getChangeSet()[0].getRowIndex();
DynamicObjectCollection entryEntity = model.getEntryEntity("yem_im_detailedinfor");
DynamicObject dynamicObject = entryEntity.get(rowIndex);
long materialId = dynamicObject.getLong("yem_material.id");
@ -225,6 +227,26 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
model.setValue("yem_classification", null, rowIndex);
}
break;
case"yem_qingdaounitprice":
price(rowIndex);
}
}
private void price(int rowIndex) {
DynamicObject yemImDetailedinfor = this.getModel().getEntryEntity("yem_im_detailedinfor").get(rowIndex);
DynamicObject yemProductmodel = yemImDetailedinfor.getDynamicObject("yem_productmodel");
BigDecimal yemQingdaounitprice = yemImDetailedinfor.getBigDecimal("yem_qingdaounitprice");
if (yemQingdaounitprice.compareTo(BigDecimal.ZERO)==0){
return;
}
if (yemProductmodel!=null){
DynamicObject yemProducts = yemProductmodel.getDynamicObject("yem_products");
if (yemProducts!=null){
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productstree", "id,number,yem_costdifference"
, new QFilter[]{new QFilter("id", QCP.equals, yemProducts.getLong("id"))});
BigDecimal yemCostdifference = loadSingle.getBigDecimal("yem_costdifference");
this.getModel().setValue("yem_unitprice",yemQingdaounitprice.subtract(yemCostdifference), rowIndex);
}
}
}