单据申请人切换支付公司重新赋值

This commit is contained in:
zengweihai 2024-05-31 14:28:42 +08:00
parent d94ad89a2e
commit b1a5103114
1 changed files with 18 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package shkd.fi.er.plugin.formplugin;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener;
@ -95,6 +97,22 @@ public class CommonCostCenterBillFormPlugin extends AbstractBillPlugIn implement
}
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
if(payList.contains(entityId)){
String name = e.getProperty().getName();//获取变更字段
if("costcompany".equals(name)){
DynamicObject applier = (DynamicObject) this.getModel().getValue("applier");
if (applier != null){
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle(applier.getPkValue(), "bos_user");
DynamicObject shkd_labororg = bos_user.getDynamicObject("shkd_labororg");
this.getModel().setValue("paycompany",shkd_labororg);//设置支付公司为申请人员上的劳动主体
}
}
}
}
/**
* 费用明细分录的成本中心只能选择申请人员上存在的成本中心
* @param beforeF7SelectEvent