差旅默认明细的费用项目

This commit is contained in:
“wyx12345678” 2024-06-28 10:27:01 +08:00
parent 0c48054a22
commit 1a233f303f
1 changed files with 27 additions and 6 deletions

View File

@ -2,6 +2,8 @@ package shkd.fi.em.plugin.formplugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.RowDataEntity;
import kd.bos.entity.datamodel.events.AfterAddRowEventArgs;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.control.Control;
@ -21,8 +23,8 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
BasedataEdit std_costcenter = this.getControl("std_costcenter");
std_costcenter.setMustInput(true);
// BasedataEdit std_costcenter = this.getControl("std_costcenter");
// std_costcenter.setMustInput(true);
}
@Override
@ -36,9 +38,11 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
DynamicObjectCollection entryentity = this.getModel().getEntryEntity("entryentity");
DynamicObject dynamicObject = entryentity.get(rowIndex);
DynamicObject expenseitem = dynamicObject.getDynamicObject("expenseitem");
String longnumber = expenseitem.getString("longnumber");//获取编码
if ("0016".equals(longnumber)){
this.getModel().setValue("orientryamount",newValue.multiply(BigDecimal.valueOf(100)),rowIndex);
if(expenseitem!=null){
String longnumber = expenseitem.getString("longnumber");//获取编码
if ("0016".equals(longnumber)){
this.getModel().setValue("orientryamount",newValue.multiply(BigDecimal.valueOf(100)),rowIndex);
}
}
}else if ("std_costcenter".equals(name)){
ChangeData[] changeSet = e.getChangeSet();
@ -52,4 +56,21 @@ public class TripReimBillStaAmountCalculationFormPlugin extends AbstractFormPlug
}
}
@Override
public void afterAddRow(AfterAddRowEventArgs e) {
super.afterAddRow(e);
String name = e.getEntryProp().getName();
if ("accountentry".equals(name)) {
Object std_costcenter = this.getModel().getValue("std_costcenter");
DynamicObjectCollection entryentity = this.getModel().getEntryEntity("entryentity");
for (DynamicObject dynamicObject : entryentity) {
dynamicObject.set("travelcostcenter",std_costcenter);
}
this.getView().updateView("entryentity");
}
}
}