过滤表单.二开案例.设置高级过滤

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

过滤表单.二开案例.设置高级过滤

【场景】二开案例,插件设置高级过滤 【案例】自动设置采购订单执行明细表的高级过滤条件 ![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...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息