单据表体弹出物料附件列表二开示例

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

单据表体弹出物料附件列表二开示例

单据表体弹出物料附件列表,以采购申请单为例。在BOS设计器中打开采购申请单,明细信息增加菜单“查看物料附件”。

在采购申请单的表单插件中挂上插件,插件代码示例如下:

using Kingdee.BOS.Core;
using Kingdee.BOS.Core.Attachment;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Orm.DataEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kingdee.BOS.Printing.PlugIn.Test
{
    public class ShowAttachmentPlugIn : AbstractBillPlugIn
    {
        public override void EntryBarItemClick(Core.DynamicForm.PlugIn.Args.BarItemClickEventArgs e)
        {
            base.EntryBarItemClick(e);
            if (e.BarItemKey == "PAEZ_tbButton")
            {
                int rowIndex = this.View.Model.GetEntryCurrentRowIndex("FEntity");
                object entryPkValue = this.View.Model.GetEntryPKValue("FEntity", rowIndex);
                object obj = this.View.Model.GetValue("FMaterialId", rowIndex);
                if (obj is DynamicObject)
                {
                    ShowAttachmentList(Convert.ToString((obj as DynamicObject) ["Id"]));
                }
            }
        }
        private void ShowAttachmentList(string interId)
        {
            AttachmentKey attachmentKey = new AttachmentKey()
            {
                BillType = "BD_MATERIAL",
                BillNo = "",
                BillInterID = interId,
                EntryKey = " ",
                EntryInterID = "-1",
                OperationStatus = Core.Metadata.OperationStatus.EDIT
            };

            ListShowParameter listpara = new ListShowParameter();

            listpara.IsLookUp = false;
            listpara.CustomParams.Add(KeyConst.AttachmentKey, AttachmentKey.ConvertToString(attachmentKey));

            listpara.OpenStyle.ShowType = ShowType.Default;
            listpara.Caption = Kingdee.BOS.Resource.ResManager.LoadKDString("附件管理", "002012030003226", Resource.SubSystemType.BOS);
            listpara.FormId = FormIdConst.BOS_Attachment;
            listpara.MultiSelect = true; //设置是否多选。
            listpara.PageId = string.Format("{0}_{1}_F7", this.View.PageId, listpara.FormId);
            listpara.Width = 800;
            listpara.Height = 500;
            string filter = string.Format(@"FBILLTYPE='{0}' and FINTERID in ('{1}')",attachmentKey.BillType, attachmentKey.BillInterID);
            listpara.ListFilterParameter.Filter = filter;
            listpara.IsShowQuickFilter = false;

            this.View.ShowForm(listpara);
        }
    }
}

执行效果如下所示:

单据表体弹出物料附件列表二开示例

单据表体弹出物料附件列表,以采购申请单为例。在BOS设计器中打开采购申请单,明细信息增加菜单“查看物料附件”。在采购申请单的表单插件...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息