单据录入序列号自动换行插件(Python)原创
91人赞赏了该文章
461次浏览
编辑于2023年12月16日 17:16:33
在单据序列号页签中,录入序列号,按回车键【Enter】,光标跳到下一行,免去了鼠标点击切换的麻烦。
插件代码如下(插件注册在单据表单插件处):
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 import * from Kingdee.BOS.Core.Bill.PlugIn import * from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import * def EntryCellFocued(e): if (e.EntryKey.ToUpperInvariant() == "FSERIALSUBENTITY" and e.NewFieldKey.ToUpperInvariant() == "FSERIALNOTE" and e.OldFieldKey.ToUpperInvariant() == "FSERIALNO"): this.View.SetEntityFocusRow("FSerialSubEntity", e.NewRow + 1) this.View.GetFieldEditor("FSERIALNO", e.NewRow + 1).SetFocus()