录入单据选择序列号,如何希望选中返回的个数不允许超过单据上的序列号数量?这个需要二开序列号选择界面的插件,点击确定时检查单据序列号数量和选中记录数
BOS设计器搜索并扩展“选择序列号”(FormID:STK_SelectSerial),打开表单插件列表,注册python脚本,发布文章时有被做格式处理,需要注意空格替换,代码大致如下:
import clr
clr.AddReference('System')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
from System import *
from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.Metadata import *
from Kingdee.BOS.Core.Bill import *
def BarItemClick(e):
if e.BarItemKey.upper() == "TBRETURN":
billqty = this.Model.GetValue("FEntryQty", -1)
sqty = this.Model.GetValue("FSelCount", -1)
if int(billqty) > 0 and int(sqty) > int(billqty):
#单据序列号数量大于0且选中记录数大于单据序列号数量
this.View.ShowMessage("选择的序列号数量不允许超过单据数量")
e.Cancel = True
推荐阅读