【插件开发笔记】插件打开各种列表
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Kingdee.BOS;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.WNReport;
namespace JDSample.FormPlugIn.DynamicForm
{
[Description("打开各种界面")]
public class S160405ShowFormEdit : AbstractDynamicFormPlugIn
{
public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
{
if (e.BarItemKey.EqualsIgnoreCase("tbShowDynamicForm"))
{
// 打开动态表单界面
// using Kingdee.BOS.Core.DynamicForm;
string pageId = Guid.NewGuid().ToString();
DynamicFormShowParameter showParameter = new DynamicFormShowParameter();
showParameter.FormId = "a6fe71c4beda4f7baf60411c4b5f3b3e";
showParameter.PageId = pageId;
//showParameter.OpenStyle.ShowType = ShowType.InContainer;
//showParameter.OpenStyle.TagetKey = "FTab_P2";
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowInventoryQuery"))
{
// 打开即时库存查询界面,传入过滤条件
DynamicFormShowParameter inventoryQueryShowParameter = new DynamicFormShowParameter();
inventoryQueryShowParameter.FormId = "STK_InventoryQuery";
inventoryQueryShowParameter.PageId = Guid.NewGuid().ToString();
inventoryQueryShowParameter.CustomParams.Add("QueryMode", "1");
inventoryQueryShowParameter.CustomParams.Add("NeedReturnData", "0");
inventoryQueryShowParameter.CustomParams.Add("QueryOrgId", "100003");
inventoryQueryShowParameter.CustomParams.Add("StockOrgIds", "100003");
inventoryQueryShowParameter.CustomParams.Add("QueryFilter", " FMaterialId.FNumber = '1.01.001' and FStockId.FNumber = 'CK001' ");
this.View.ShowForm(inventoryQueryShowParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowBill"))
{
// 打开单据维护界面:以打开销售订单100001为例
// using Kingdee.BOS.Core.Bill;
string pageId = Guid.NewGuid().ToString();
BillShowParameter showParameter = new BillShowParameter();
showParameter.FormId = "SAL_SaleOrder";
showParameter.OpenStyle.ShowType = ShowType.MainNewTabPage;
showParameter.PageId = pageId;
showParameter.Status = OperationStatus.EDIT;
// 传入需要修改的销售订单内码,演示代码直接固定写死为100001
showParameter.PKey = "100001";
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowList"))
{
// 打开单据列表界面:以打开物料F8查询列表为例
// using Kingdee.BOS.Core.List;
string pageId = Guid.NewGuid().ToString();
ListShowParameter showParameter = new ListShowParameter();
showParameter.FormId = "BD_Material";
showParameter.PageId = pageId;
showParameter.UseOrgId = this.Context.CurrentOrganizationInfo.ID;
showParameter.IsLookUp = true;
showParameter.ListFilterParameter.Filter = "";
this.View.ShowForm(showParameter);
// 打开单据联查列表:以联查销售订单为例
string billNo = Convert.ToString(this.Model.GetValue("FBillNo"));
string fldName = "销售合同号字段标识";
IRegularFilterParameter filterParameter = new ListRegularFilterParameter();
filterParameter.Filter = string.Format(" {0} = '{1}' ", fldName, billNo); ;
filterParameter.SelectEntitys = new List<string>() { "FSaleOrderEntry" };
var listTrackParameter = new ListTrackBillShowParameter();
listTrackParameter.FormId = "SAL_SaleOrder";
listTrackParameter.PageId = Guid.NewGuid().ToString();
listTrackParameter.IsShowFilter = false;
listTrackParameter.ListFilterParameter = filterParameter;
this.View.ShowForm(listTrackParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowSQLReport"))
{
// 打开直接SQL报表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
SQLReportShowParameter showParameter = new SQLReportShowParameter();
showParameter.FormId = "a9e51595c6c1433ebb623c8e340f7b5b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowSysReport"))
{
// 打开简单系统账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
SysReportShowParameter showParameter = new SysReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af9b";
showParameter.PageId = pageId;
showParameter.IsShowFilter = true;
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowMoveReport"))
{
// 打开分页账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
MoveReportShowParameter showParameter = new MoveReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af8b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowTreeReport"))
{
// 打开树形账表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
TreeReportShowParameter showParameter = new TreeReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29af7b";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowPivotGridReport"))
{
// 打开透视表
// using Kingdee.BOS.Core.Report;
string pageId = Guid.NewGuid().ToString();
CrossReportShowParameter showParameter = new CrossReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29ae59";
showParameter.PageId = pageId;
this.View.ShowForm(showParameter);
}
else if (e.BarItemKey.EqualsIgnoreCase("tbShowWNSQLReport"))
{
// 打开万能报表(SQL增强报表是一种万能报表)
// using Kingdee.BOS.Core.WNReport;
string pageId = Guid.NewGuid().ToString();
WNReportShowParameter showParameter = new WNReportShowParameter();
showParameter.FormId = "c3329ed2a55c4c31b9420d104f29ae69";
showParameter.PageId = pageId;
showParameter.ReporType = Kingdee.BOS.Core.Enums.BOSEnums.Enu_DevReportType.SqlOver;// SQL增强报表
this.View.ShowForm(showParameter);
}
}
}
}
麻烦问一下,即时库存 的自定义参数中,Add都是等于,如"QueryOrgId" , "100001",就是=100001,有没有like 或者 in 这样的,如:"QueryOrgId" in("100001",“100002”),或者如何能选 出全部组织,我试了一下,如果不传递组织参数,系统会默认为当前登录组织
昨天我也单独提问了,链接里面写的可能容易理解点:https://vip.kingdee.com/questions/155312118894993408
最后去掉我圈中的那行就达到我要的效果了【emoji】
【emoji】如果想实现打开列表之后,不影响原来列表的操作要怎么设置呢?我现在设置的这种方式,新列表窗口打开之后,只能对新列表窗口操作,原来的界面是不可以进行例如上下左右拖动等操作,有时候需要对比数据就很麻烦
大佬,ListFilterParameter在设置过滤条件后,打开的form在重置搜索后怎么查询出所有的呢?
很强大,解决了我的问题!
【emoji】
【emoji】
【插件开发笔记】插件打开各种列表
本文2024-09-16 17:29:25发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-16029.html