组装拆卸单BOM展开,成品表仓库仓位赋值到子件表仓库仓位
【业务背景】组装拆卸单点BOM展开后,表体仓库希望可以获取成品表仓库。目前系统获取的是物料清单上或者是物料上维护的仓库
【问题分析】系统的标准插件逻辑中,BOM展开时,BOM展示时,插件会将子件单据体的数据清空,再根据返回的BOM清单明细,重新创建出子件物料数据。子件表数据设置仓库仓位的处理规则:
1、取组装BOM中子项的仓库设置
2、子项仓库设置为空,则携带物料的仓库、仓位
根据上述的处理过程,若需要对BOM展开后的数据进行修改,只能通过表单插件,在BOM展开点击,执行完系统的标准逻辑后,二开修改相关数据。
【二开实现】
# 组装拆卸单BOM展开,成品表仓库仓位赋值到子件表仓库仓位
import clr clr.AddReference("System") clr.AddReference("Kingdee.BOS") clr.AddReference("Kingdee.BOS.Core") from System import * from System import StringComparison from Kingdee.BOS.Core.DynamicForm import * from Kingdee.BOS.Core.Metadata.FieldElement import * from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import * def AfterEntryBarItemClick(e): if e.BarItemKey.Equals("TBBOMEXPAND", StringComparison.OrdinalIgnoreCase): entity = this.View.BusinessInfo.GetEntity("FEntity") rowCount = this.Model.GetEntryRowCount("FEntity") for i in range (0, rowCount): entityRow = this.Model.GetEntityDataObject(entity, i); subEntry = entityRow["STK_ASSEMBLYSUBITEM"] stock = this.View.Model.GetValue("FStockID", i) stockLoc = this.View.Model.GetValue("FStockLocId", i) for j in range (0, subEntry.Count): if stock is not None: stockField = this.View.BusinessInfo.GetField("FStockIDSETY"); this.Model.SetValue(stockField, subEntry[j], stock["Id"], j); if stockLoc is not None: stockLocField = this.View.BusinessInfo.GetField("FStockLocIdSETY"); this.Model.SetValue(stockLocField, subEntry[j], stockLoc["Id"], j);
public override void AfterEntryBarItemClick(AfterBarItemClickEventArgs e) { switch (e.BarItemKey.ToUpperInvariant()) { case "TBBOMEXPAND": var entity = this.View.BusinessInfo.GetEntity("FEntity"); int rowCount = this.Model.GetEntryRowCount("FEntity"); for (var i = 0; i < rowCount; i++) { var entityRow = this.Model.GetEntityDataObject(entity, i); var subEntry = entityRow["STK_ASSEMBLYSUBITEM"] as DynamicObjectCollection; DynamicObject stock = this.View.Model.GetValue("FStockID", i) as DynamicObject; DynamicObject stockLoc = this.View.Model.GetValue("FStockLocId", i) as DynamicObject; for (var j = 0; j < subEntry.Count; j++) { if (stock != null) { Field stockField = this.View.BusinessInfo.GetField("FStockIDSETY"); this.Model.SetValue(stockField, subEntry[j], stock["Id"], j); if (stockLoc != null) { Field stockLocField = this.View.BusinessInfo.GetField("FStockLocIdSETY"); this.Model.SetValue(stockLocField, subEntry[j], stockLoc["Id"], j); } } } } } }
组装拆卸单BOM展开,成品表仓库仓位赋值到子件表仓库仓位
【业务背景】组装拆卸单点BOM展开后,表体仓库希望可以获取成品表仓库。目前系统获取的是物料清单上或者是物料上维护的仓库【问题分析】系...
点击下载文档
上一篇:允许入库数量大于质检数量下一篇:复盘2021互联网电商的十大事件
本文2024-09-16 19:06:18发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-26425.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章