套打.二开案例.干预套打模板列表
【场景】干预套打模板列表
【数据准备】
模板id
![image.webp](/download/0100aeb7d63a118646a9bf638962d2778007.webp)
![image.webp](/download/010097660e023104405f86986fb9bf32b9f2.webp)
【案例1】针对采购申请单,仅干预选择模板界面的模板列表
```csharp
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using System.Collections.Generic;
using System.Linq;
namespace DynamicFormPlugIn.NotePrint
{
[Kingdee.BOS.Util.HotUpdate]
public class NotePrintPlugIn_GetValidNoteTemplates : AbstractBillPlugIn
{
public string[] templateIds = { "e9aad141-0ad2-409c-a9e6-9156c704b0c6", "4a587727-6695-47be-9688-aa0492f89a49" };
/// <summary>
/// 仅针对选择模板界面
/// 说明:当GetValidNoteTemplatesAll借口的模板数大于等于原始模板数时 才会触发;
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public override List<EnumItem> GetValidNoteTemplates(ValidNoteTemplatesEventArgs e)
{
List<EnumItem> filterItems = new List<EnumItem>();
foreach (EnumItem templateItem in e.Items)
{
if (templateItem == null)
continue;
if (templateIds.Contains(templateItem.EnumId))
{
filterItems.Add(templateItem);
}
}
e.Items = filterItems;
return filterItems;
}
/// <summary>
/// 针对选择模板界面和套打设置
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public override List<EnumItem> GetValidNoteTemplatesAll(ValidNoteTemplatesEventArgs e)
{
return base.GetValidNoteTemplatesAll(e);
}
}
}
```
![动画.webp](/download/01007affb5ded8564f439082cd60a1e65578.webp)
【案例2】针对采购申请单,干预套打设置和选择模板界面的模板列表
```csharp
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using System.Collections.Generic;
using System.Linq;
namespace DynamicFormPlugIn.NotePrint
{
[Kingdee.BOS.Util.HotUpdate]
public class NotePrintPlugIn_GetValidNoteTemplates : AbstractBillPlugIn
{
public string[] templateIds = { "e9aad141-0ad2-409c-a9e6-9156c704b0c6", "4a587727-6695-47be-9688-aa0492f89a49" };
/// <summary>
/// 仅针对选择模板界面
/// 说明:当GetValidNoteTemplatesAll借口的模板数大于等于原始模板数时 才会触发;
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public override List<EnumItem> GetValidNoteTemplates(ValidNoteTemplatesEventArgs e)
{
return base.GetValidNoteTemplates(e);
}
/// <summary>
/// 针对选择模板界面和套打设置
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public override List<EnumItem> GetValidNoteTemplatesAll(ValidNoteTemplatesEventArgs e)
{
List<EnumItem> filterItems = new List<EnumItem>();
foreach (EnumItem templateItem in e.Items)
{
if (templateItem == null)
continue;
if (templateIds.Contains(templateItem.EnumId))
{
filterItems.Add(templateItem);
}
}
e.Items = filterItems;
return filterItems;
}
}
}
```
![动画2.webp](/download/01007a3f8f9847b14ae2991a832a986dbbdb.webp)
套打.二开案例.干预套打模板列表
【场景】干预套打模板列表【数据准备】模板id![image.webp](/download/0100aeb7d63a118646a9bf638962d2778007.webp)![image.webp](/downloa...
点击下载文档
本文2024-09-23 04:12:17发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-163796.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章