过滤表单.二开案例.设置高级过滤
【场景】二开案例,插件设置高级过滤
【案例】自动设置采购订单执行明细表的高级过滤条件
![image.webp](/download/01001e267dc92a9c4e08944907cf0c1f9af1.webp)
```csharp
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Core.CommonFilter.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
namespace DynamicFormPlugIn.Filter
{
[Kingdee.BOS.Util.HotUpdate]
public class FilterPlugIn_FBatchFilterGrid : AbstractCommonFilterPlugIn
{
/*
* 过滤表单插件设置高级过滤
*/
public override void TreeNodeClick(TreeNodeArgs e)
{
InitFBatchFilterGridInClient();
}
/// <summary>
/// 设置服务端的高级过滤逻辑(如果不显示过滤界面需要使用这个方案直接修改过滤方案)
/// </summary>
private void InitFBatchFilterGridInServer()
{
/*
* json 结构设置高级过滤
*/
Kingdee.BOS.JSON.JSONObject jsonObj = new Kingdee.BOS.JSON.JSONObject();
jsonObj["MakeUpType"] = "Column";
Kingdee.BOS.JSON.JSONArray jsonRows = new Kingdee.BOS.JSON.JSONArray();
Kingdee.BOS.JSON.JSONObject jsonSource = new Kingdee.BOS.JSON.JSONObject();
jsonSource["FieldName"] = "FSrcBillNo";
Kingdee.BOS.JSON.JSONArray jsonVal = new Kingdee.BOS.JSON.JSONArray();
jsonVal.Add("a");
jsonVal.Add("b");
jsonVal.Add("d");
jsonVal.Add("c");
jsonSource["Value"] = jsonVal.ToJSONString();
jsonSource["Logic"] = "OR";
jsonRows.Add(jsonSource);
jsonObj["Source"] = jsonRows;
var setting = jsonObj.ToJSONString();
var modelService = this.CommonFilterModel as ICommonFilterModelService;
if (modelService == null)
return;
modelService.SchemeEntity.BatchFilterSetting = setting;
this.CommonFilterModel.BatchFilterObject.Setting = modelService.SchemeEntity.BatchFilterSetting;
}
/// <summary>
/// 设置客户端的高级过滤逻辑
/// </summary>
private void InitFBatchFilterGridInClient()
{
Kingdee.BOS.JSON.JSONObject jsonObj = new Kingdee.BOS.JSON.JSONObject();
jsonObj["MakeUpType"] = "Column";
Kingdee.BOS.JSON.JSONArray jsonRows = new Kingdee.BOS.JSON.JSONArray();
Kingdee.BOS.JSON.JSONObject jsonSource = new Kingdee.BOS.JSON.JSONObject();
jsonSource["FieldName"] = "FSrcBillNo";
Kingdee.BOS.JSON.JSONArray jsonVal = new Kingdee.BOS.JSON.JSONArray();
jsonVal.Add("a");
jsonVal.Add("b");
jsonVal.Add("d");
jsonVal.Add("c");
jsonSource["Value"] = jsonVal.ToJSONString();
jsonSource["Logic"] = "OR";
jsonRows.Add(jsonSource);
jsonObj["Source"] = jsonRows;
jsonRows.Add(jsonSource);
var batchFilter = this.View.GetControl<BatchFilterGrid>("FBatchFilterGrid");
batchFilter.SetFilterRowsWithMakeUpType(jsonObj);
}
}
}
```
【效果】
![image.webp](/download/010033edf628116241b688c06a3ab60cd638.webp)
【高级过滤数据逻辑】
![image.webp](/download/0100732e28cde6d8458ba87820eb98a69c9d.webp)
【说明】
该方案适用于8.1的逻辑,8.1的高级过滤有加掩的逻辑;低版本的客户可能需要使用SetFilterRows,涉及前后端通讯的逻辑;
过滤表单.二开案例.设置高级过滤
【场景】二开案例,插件设置高级过滤【案例】自动设置采购订单执行明细表的高级过滤条件![image.webp](/download/01001e267dc92a9c4e089449...
点击下载文档
本文2024-09-16 18:19:56发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-21455.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章