This commit is contained in:
liangjunyu
2025-11-26 10:49:38 +08:00
parent 566746e624
commit c8027bd094
8 changed files with 238 additions and 74 deletions

View File

@@ -0,0 +1,43 @@
using Kingdee.BOS;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.List.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.CUST_PAYMENT_PERIOD
{
[Description("【客户账期_列表插件】列表动态创建列"), HotUpdate]
public class List : AbstractListPlugIn
{
public override void CreateListHeader(CreateListHeaderEventArgs e)
{
base.CreateListHeader(e);
// 创建动态列1
var header = e.ListHeader.AddChild();// 将动态列放在列表的最后面
//var header = e.ListHeader.AddChild(0);// 将动态列放在列表的指定位置
header.Caption = new LocaleValue("账期情况");
header.Key = "FDynamicColumn1";
header.FieldName = "FDynamicColumn1";
header.ColType = SqlStorageType.Sqlnvarchar;
header.Width = 200;
header.Visible = true;
header.ColIndex = e.ListHeader.GetChilds().Max(o => o.ColIndex) + 1;// 注意列的显示顺序不是ColIndex决定的而是由该列在ListHeader的childs集合中的位置决定的。
}
public override void FormatCellValue(FormatCellValueArgs args)
{
base.FormatCellValue(args);
if (args.Header.Key.Equals("FDynamicColumn1", StringComparison.OrdinalIgnoreCase))
{
args.FormateValue = string.Format("{0}=>{1}", args.Header.Caption, DateTime.Now);
}
}
}
}