二开案例.点击明细行,显示附件列表
实现效果:点击单据体明细行,在右侧显示该行的附件列表。
1、在单据上添加面板,ID为FPanelAttachmentList,用于显示附件列表
2、插件代码
using Kingdee.BOS.Core; using Kingdee.BOS.Core.Attachment; using Kingdee.BOS.Core.Bill.PlugIn; using Kingdee.BOS.Core.DynamicForm; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.List; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Core.Metadata.EntityElement; using Kingdee.BOS.Core.Metadata.FieldElement; using Kingdee.BOS.Core.Metadata.FormElement; using Kingdee.BOS.Resource; using Kingdee.BOS.ServiceHelper; using System; namespace Test202408 { [Kingdee.BOS.Util.HotUpdate] public class 显示单据体附件列表 : AbstractBillPlugIn { string targetPanelKey = "FPanelAttachmentList"; string attachmentPageId = Guid.NewGuid().ToString(); public override void EntityRowClick(EntityRowClickEventArgs e) { var interId = this.View.Model.GetEntryPKValue(e.Key, e.Row).ToString(); ShowEntityAttachmentList(e.Key, interId, targetPanelKey); } private void ShowEntityAttachmentList(string entityKey, string entryInterID, string targetPanelKey) { var view = this.View; try { var attachmentView = view.GetView(attachmentPageId); if (attachmentView != null) { attachmentView.Close(); this.View.SendAynDynamicFormAction(attachmentView); attachmentPageId = Guid.NewGuid().ToString(); } } catch { } Form frm = this.View.BillBusinessInfo.GetForm(); var pk = this.View.Model.GetPKValue().ToString(); AttachmentKey attachmentKey = new AttachmentKey() { BillType = frm.Id, BillNo = "", BillInterID = pk, EntryKey = entityKey, EntryInterID = entryInterID, OperationStatus = OperationStatus.EDIT, ForceEnableAttachOperate = true }; #region 获取附件数Key Entity ty = view.BillBusinessInfo.GetEntity(attachmentKey.EntryKey); foreach (Field f in ty.Fields) { if (f is AttachmentCountField) { attachmentKey.AttachmentCountFieldKeys.Add(f.Key); } } #endregion string filter = BusinessDataServiceHelper.GetAttachmentListFilter(view.Context, attachmentKey, view.BillBusinessInfo); ListShowParameter listpara = new ListShowParameter(); listpara.IsLookUp = false; listpara.CustomParams.Add(KeyConst.AttachmentKey, AttachmentKey.ConvertToString(attachmentKey)); listpara.Caption = ResManager.LoadKDString("附件管理", "002012030003226", SubSystemType.BOS); listpara.FormId = FormIdConst.BOS_Attachment; listpara.MultiSelect = true; listpara.PageId = attachmentPageId;// string.Format("{0}_{1}_F7", view.PageId, listpara.FormId); listpara.OpenStyle.TagetKey = targetPanelKey; listpara.OpenStyle.ShowType = ShowType.InContainer; listpara.ListFilterParameter.Filter = filter; listpara.IsShowQuickFilter = false; view.ShowForm(listpara, delegate (FormResult result) { foreach (string key in attachmentKey.AttachmentCountFieldKeys) { view.UpdateView(key, attachmentKey.RowIndex); } }); } } }
二开案例.点击明细行,显示附件列表
实现效果:点击单据体明细行,在右侧显示该行的附件列表。1、在单据上添加面板,ID为FPanelAttachmentList,用于显示附件列表2、插件代码us...
点击下载文档
本文2024-09-16 18:04:52发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-19821.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章