单据上引用附件列表示例分享
金蝶云社区-星星火
星星火
0人赞赏了该文章 7,973次浏览 未经作者许可,禁止转载编辑于2014年08月14日 09:36:30

在单据插件的绑定事件中参考以下代码实现加载附件列表

Form frm = this.View.BillBusinessInfo.GetForm();
//获取单据编号
string billNo = "";
Field billNoField = this.View.BusinessInfo.GetBillNoField();
if (billNoField != null)
{
object objBillNo = this.View.Model.GetValue(billNoField.Key);
if (objBillNo != null)
{
billNo = objBillNo.ToString();
}
}
//获取附件列表过滤条件
AttachmentKey attachmentKey = new AttachmentKey();
attachmentKey.BillType = frm.Id;
attachmentKey.BillNo = billNo;
attachmentKey.BillInterID = objPkValue.ToString();
attachmentKey.OperationStatus = this.View.OpenParameter.Status;
//单据头
if (string.IsNullOrEmpty(OperationObjectKey))
{
attachmentKey.EntryKey = " ";
attachmentKey.EntryInterID = "-1";
attachmentKey.RowIndex = 0;
}
string filter = string.Format(@"FBILLTYPE='{0}' and FINTERID='{1}' and FENTRYKEY='{2}' and FENTRYINTERID='{3}'",
attachmentKey.BillType, attachmentKey.BillInterID, attachmentKey.EntryKey, attachmentKey.EntryInterID);
ListShowParameter listpara = new ListShowParameter();
listpara.IsLookUp = false;
listpara.CustomParams.Add(KeyConst.AttachmentKey, AttachmentKey.ConvertToString(attachmentKey));
listpara.OpenStyle.ShowType = ShowType.InContainer;
listpara.OpenStyle.TagetKey = "Panelxxx";//自己添加的面板
listpara.Caption = Kingdee.BOS.Resource.ResManager.LoadKDString("附件管理", "002012030003226", Resource.SubSystemType.BOS);
listpara.FormId = FormIdConst.BOS_Attachment;
listpara.MultiSelect = false;
listpara.PageId = string.Format("{0}_{1}_F7", this.View.PageId, listpara.FormId);

listpara.ListFilterParameter.Filter = filter;
listpara.IsShowQuickFilter = false;
this.View.ShowForm(listpara );