【二开】生产订单列表下推订单级联调整
【应用场景】
订单级联调整没有对应单据转换,选单操作是通过标准产品插件实现,客户想要在生产订单列表进行下推生成,方便操作。
【注意事项】
本方案目前只涉及生产订单列表进行下推生成订单级联调整,具体效果参考以下实现截图
【实现步骤】
<1>BOS设计器中,生产订单列表,菜单添加按钮-【下推订单级联调整】,添加好后生产订单列表如下图按钮可点击
<2>生产订单添加列表插件,列表插件实现点击事件,代码参考如下:
public override void BarItemClick(BarItemClickEventArgs e) { switch (e.BarItemKey) { case "tbToCascade": BillShowParameter paramEK = new BillShowParameter(); paramEK.OpenStyle.ShowType = ShowType.MainNewTabPage; paramEK.FormId = "PLN_CASCADEADJUST"; paramEK.ParentPageId = this.View.PageId; paramEK.Status = OperationStatus.ADDNEW; paramEK.CustomParams.Add("IsMoPush", "true"); Dictionary<string, List<string>> moIdAndEntryIds = new Dictionary<string, List<string>>(); foreach (var item in this.ListView.SelectedRowsInfo) { string moId = item.PrimaryKeyValue; string entryId = item.EntryPrimaryKeyValue; if (moIdAndEntryIds.Keys.Contains(moId)) { moIdAndEntryIds[moId].Add(entryId); } else { moIdAndEntryIds[moId] = new List<string>() { entryId }; } } paramEK.CustomComplexParams.Add("moIdAndEntryIds", moIdAndEntryIds); this.ListView.ShowForm(paramEK); break; } }
<3>添加订单级联调整表单插件,继承原订单级联调整类:CascadeAdjustEdit,具体实现代码如下:
using Kingdee.BOS.Core.BusinessFlow.ReserveLogic; using Kingdee.K3.Core.MFG.EnumConst; using Kingdee.K3.MFG.PLN.Business.PlugIn.Bill.CascadeAdjust; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Kingdee.K3.MFG.PLN.Business.PlugIn.EK { public class EKMoToCascade : CascadeAdjustEdit { Dictionary<string, object> custParams = new Dictionary<string, object>(); private CascadeDataManage dataMangeEK = null; public override void OnLoad(EventArgs e) { object isMoPush = null; List<OriBillInfo> lstBillInfo = new List<OriBillInfo>(); if (custParams.TryGetValue("IsMoPush", out isMoPush)) { object moIdAndEntryIds = null; if (!custParams.TryGetValue("moIdAndEntryIds", out moIdAndEntryIds)) return; Dictionary<string, List<string>> moIdAndEntryIdD = moIdAndEntryIds as Dictionary<string, List<string>>; string formId = "PRD_MO"; this.View.Model.SetValue(CONST_PLN_CASCADEADJUST.CONST_FBillHead.KEY_FBillTypeID, "6046eadde4f054");//生产订单级联调整 foreach (var item in moIdAndEntryIdD) { string moid = item.Key; List<string> moentryid = item.Value.ToList(); foreach (var i in moentryid) { OriBillInfo billInfo = new OriBillInfo(formId, moid, i); lstBillInfo.Add(billInfo); } } this.dataMangeEK.GetReserveLinkByBillInfo(lstBillInfo); CascadeReserveTree cascadeTree = new CascadeReserveTree(this.View, this.dataMangeEK); cascadeTree.FillCascadeEntry(lstBillInfo); } } public override void OnInitialize(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.InitializeEventArgs e) { base.OnInitialize(e); this.custParams = e.Paramter.GetCustomParameters(); dataMangeEK = new CascadeDataManage(this.View.Context); } } }
<4>按照以上步骤添加好对应插件与按钮,具体实现效果如下图(勾选两行生产订单点击下推订单级联调整):
【金蝶云星空BOS二次开发案例演示】
https://vip.kingdee.com/article/94751030918525696
【二开】生产订单列表下推订单级联调整
【应用场景】订单级联调整没有对应单据转换,选单操作是通过标准产品插件实现,客户想要在生产订单列表进行下推生成,方便操作。【注意事项...
点击下载文档
本文2024-09-23 03:13:11发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-157457.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章