对于单据列表中,基础资料链接可直接开启资料明细,其他单据类型的链接需通过二开实现。
思路:
通过单据体行点击事件捕获点击的列,查询到对应的单据内码,通过ShowForm()打开单据明细。
以生产领料单列表页中的【系统源单编号】为例,参考代码:
public override void EntityRowClick(EntityRowClickEventArgs e)
{
base.EntityRowClick(e);
//通过单击的列来确定需要打开的单据
if (e.ColKey == "FSrcBillNo")
{
long srcInterId = 0L;
string pickMtrlId = this.ListView.CurrentSelectedRowInfo.PrimaryKeyValue;
//通过领料单内码查询源单单据内码
QueryBuilderParemeter queryPara = new QueryBuilderParemeter();
queryPara.FormId = MFGFormIdConst.SubSys_PRD.PickMtrlBill;
queryPara.SelectItems = SelectorItemInfo.CreateItems("FSrcBillType", "FEntrySrcInterId", "FMoId");
queryPara.FilterClauseWihtKey = string.Format("FID={0}", pickMtrlId);
DynamicObjectCollection pickMtrlEntrys =
QueryServiceHelper.GetDynamicObjectCollection(this.Context, queryPara);
if (pickMtrlEntrys != null && pickMtrlEntrys.Count > 0)
{
DynamicObject entry = pickMtrlEntrys.FirstOrDefault();
srcInterId = entry.GetDynamicObjectItemValue<long>("FEntrySrcInterId");
}
BillShowParameter showPara = new BillShowParameter();
showPara.OpenStyle.ShowType = ShowType.Modal;
showPara.FormId = MFGFormIdConst.SubSys_PRD.PPBOMBill;
showPara.Status = BOS.Core.Metadata.OperationStatus.EDIT;
showPara.ParentPageId = this.View.PageId;
showPara.PKey = srcInterId.ToString();
this.View.ShowForm(showPara);
}
}