1.费用申请单事先申请类型

2.公费经费报销单经费申请过滤
This commit is contained in:
zhangzhiguo 2025-09-01 22:39:28 +08:00
parent f05f0bb314
commit 0cb92c5234
4 changed files with 93 additions and 14 deletions

View File

@ -3,26 +3,32 @@ package zcgj.zcdev.zcdev.fs.plugin.form;
import kd.bos.bill.AbstractBillPlugIn; import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.LocaleString; import kd.bos.dataentity.entity.LocaleString;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.field.ComboEdit; import kd.bos.form.field.ComboEdit;
import kd.bos.form.field.ComboItem; import kd.bos.form.field.ComboItem;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin; import kd.sdk.plugin.Plugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.*;
import java.util.EventObject;
import java.util.List;
/** /**
* 费用申请单插件 * 费用申请单插件
*/ */
public class DailyapplybillPlugin extends AbstractBillPlugIn implements Plugin { public class DailyapplybillPlugin extends AbstractBillPlugIn implements Plugin {
private static final Logger log = LoggerFactory.getLogger(DailyapplybillPlugin.class);
@Override @Override
public void afterBindData(EventObject e) { public void afterBindData(EventObject e) {
super.afterBindData(e); super.afterBindData(e);
DynamicObject costcompany = (DynamicObject) this.getModel().getValue("costcompany"); DynamicObject costcompany = (DynamicObject) this.getModel().getValue("costcompany");
if(costcompany != null) { if(costcompany != null) {
List<ComboItem> comboList = new ArrayList<>();
if("10007186".equals(costcompany.getString("number"))){ if("10007186".equals(costcompany.getString("number"))){
List<ComboItem> comboList = new ArrayList<>();
comboList.add(new ComboItem(new LocaleString("采购申请"), "purchase_apply")); comboList.add(new ComboItem(new LocaleString("采购申请"), "purchase_apply"));
comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply")); comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply"));
comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain")); comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain"));
@ -31,10 +37,52 @@ public class DailyapplybillPlugin extends AbstractBillPlugIn implements Plugin {
comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car")); comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car"));
comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren")); comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren"));
comboList.add(new ComboItem(new LocaleString("工会经费申请"), "union_funding")); comboList.add(new ComboItem(new LocaleString("工会经费申请"), "union_funding"));
}else{
comboList.add(new ComboItem(new LocaleString("采购申请"), "purchase_apply"));
comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply"));
comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain"));
comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply"));
comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental"));
comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car"));
comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren"));
}
ComboEdit comboEdit = getView().getControl("zcgj_apply_type");
comboEdit.setComboItems(comboList);
}
}
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
if (e.getProperty().getName().equals("costcompany")) {
ChangeData[] valueSet = e.getChangeSet();
DynamicObject newValue = (DynamicObject) valueSet[0].getNewValue();
if(newValue!=null){
List<ComboItem> comboList = new ArrayList<>();
if("10007186".equals(newValue.getString("number"))){
comboList.add(new ComboItem(new LocaleString("采购申请"), "purchase_apply"));
comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply"));
comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain"));
comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply"));
comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental"));
comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car"));
comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren"));
comboList.add(new ComboItem(new LocaleString("工会经费申请"), "union_funding"));
}else{
comboList.add(new ComboItem(new LocaleString("采购申请"), "purchase_apply"));
comboList.add(new ComboItem(new LocaleString("固定资产采购申请"), "gdzc_apply"));
comboList.add(new ComboItem(new LocaleString("车辆维修保养申请"), "vehicle_maintain"));
comboList.add(new ComboItem(new LocaleString("维修保养申请-非车辆"), "maintain_apply"));
comboList.add(new ComboItem(new LocaleString("租车申请"), "car_rental"));
comboList.add(new ComboItem(new LocaleString("派车单"), "dispatch_car"));
comboList.add(new ComboItem(new LocaleString("费用申请单(兖州机关)"), "zc_morren"));
}
ComboEdit comboEdit = getView().getControl("zcgj_apply_type"); ComboEdit comboEdit = getView().getControl("zcgj_apply_type");
comboEdit.setComboItems(comboList); comboEdit.setComboItems(comboList);
} }
} }
} }
} }

View File

@ -25,7 +25,7 @@ public class PrepaybillNoContractPlugin extends AbstractBillPlugIn {
editTitle = isec1; editTitle = isec1;
this.getView().updateView("zcgj_isec"); this.getView().updateView("zcgj_isec");
if(isec1){ if(isec1){
this.getView().setFormTitle(new LocaleString("无合同预付单")); this.getView().setFormTitle(new LocaleString("无合同预付单"));
} }
} }
} }
@ -35,7 +35,7 @@ public class PrepaybillNoContractPlugin extends AbstractBillPlugIn {
super.afterBindData(e); super.afterBindData(e);
boolean isec=(boolean)this.getModel().getValue("zcgj_isec"); boolean isec=(boolean)this.getModel().getValue("zcgj_isec");
if(isec){ if(isec){
this.getView().setFormTitle(new LocaleString("无合同预付单")); this.getView().setFormTitle(new LocaleString("无合同预付单"));
} }
} }

View File

@ -0,0 +1,31 @@
package zcgj.zcdev.zcdev.fs.plugin.form;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.filter.FilterColumn;
import kd.bos.form.events.FilterContainerInitArgs;
import kd.bos.form.events.SetFilterEvent;
import kd.bos.form.field.events.BeforeFilterF7SelectEvent;
import kd.bos.list.ListShowParameter;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.user.UserServiceHelper;
import kd.fi.bcm.spread.domain.view.event.FilterEvent;
import java.util.ArrayList;
import java.util.List;
/**
* 设置公费经费报销单选择费用申请单过滤
*/
public class TradefundsListPlugin extends AbstractListPlugin {
@Override
public void setFilter(SetFilterEvent e) {
e.getQFilters().clear();
e.getQFilters().add(new QFilter("zcgj_billstatus", QCP.equals, "E"));
e.getQFilters().add(new QFilter("zcgj_apply_type", QCP.equals, "union_funding"));
}
}

View File

@ -4,12 +4,14 @@ import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.LocaleString; import kd.bos.dataentity.entity.LocaleString;
import kd.bos.dataentity.metadata.IDataEntityProperty; import kd.bos.dataentity.metadata.IDataEntityProperty;
import kd.bos.form.ShowType;
import kd.bos.form.field.BasedataEdit; import kd.bos.form.field.BasedataEdit;
import kd.bos.form.field.ComboEdit; import kd.bos.form.field.ComboEdit;
import kd.bos.form.field.ComboItem; import kd.bos.form.field.ComboItem;
import kd.bos.form.field.RefBillEdit; import kd.bos.form.field.RefBillEdit;
import kd.bos.form.field.events.BeforeF7SelectEvent; import kd.bos.form.field.events.BeforeF7SelectEvent;
import kd.bos.form.field.events.BeforeF7SelectListener; import kd.bos.form.field.events.BeforeF7SelectListener;
import kd.bos.list.ListFilterParameter;
import kd.bos.list.ListShowParameter; import kd.bos.list.ListShowParameter;
import kd.bos.orm.query.QCP; import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter; import kd.bos.orm.query.QFilter;
@ -38,19 +40,17 @@ public class TradefundsPlugin extends AbstractBillPlugIn implements BeforeF7Sele
IDataEntityProperty property = beforeF7SelectEvent.getProperty();//过滤字段信息 IDataEntityProperty property = beforeF7SelectEvent.getProperty();//过滤字段信息
String propertyName = property.getName();//过滤字段标识 String propertyName = property.getName();//过滤字段标识
if("zcgj_funding_apply".equals(propertyName)){ //经费申请过滤 if("zcgj_funding_apply".equals(propertyName)){ //经费申请过滤 迁移至 TradefundsListPlugin
DynamicObject costcompany = (DynamicObject)this.getModel().getValue("createorg");//创建组织过滤 //DynamicObject costcompany = (DynamicObject)this.getModel().getValue("createorg");//创建组织过滤
List<QFilter> qFilter = new ArrayList<>(); List<QFilter> qFilter = new ArrayList<>();
/*if(costcompany!=null){ /*if(costcompany!=null){
Long companyId = costcompany.getLong("id"); Long companyId = costcompany.getLong("id");
qFilter.add(new QFilter("zcgj_costcompany", QCP.equals, companyId)); qFilter.add(new QFilter("zcgj_costcompany", QCP.equals, companyId));
}*/ }*/
//qFilter.add(new QFilter("zcgj_billstatus", QCP.equals, "E"));
//qFilter.add(new QFilter("zcgj_apply_type", QCP.equals, "union_funding"));
qFilter.add(new QFilter("zcgj_billstatus", QCP.equals, "E"));
qFilter.add(new QFilter("zcgj_apply_type", QCP.equals, "union_funding"));
formShowParameter.getListFilterParameter().setQFilters(qFilter); formShowParameter.getListFilterParameter().setQFilters(qFilter);
} }
} }
} }