插件中F7调用其他核算项目或者BOS基础资料界面
事件参数说明:
'/********************************************************************
'/*描述:F7调出界面之前触发事件
'/*dct : 字段模板包
'/*vCurValue : 当前值
'/*lRow : 当前行 单据头 -1
'/*strFilter : 过滤条件
'/*sRetMsg : 返回显示值
'/* bCancel: 是否取消F7的处理
'/********************************************************************
Public Event F7LookUp(ByVal dct As KFO.Dictionary, _
ByVal vCurValue As Variant, _
ByVal lRow As Long, _
ByRef strFilter As String, _
ByRef sRetMsg As String, _
ByRef bCancel As Boolean)
具体代码示例如下:
Private Sub m_BillInterface_F7LookUp(ByVal dct As KFO.IDictionary, ByVal vCurValue As Variant, ByVal lRow As Long, strFilter As String, sRetMsg As String, bCancel As Boolean)
Dim iLookUpcls As Long
Dim obj As Object
Dim oDict As KFO.Dictionary
Dim retVect As KFO.Vector
Dim RtnCollection As Object
bCancel = True '取消系统的F7处理,单独在插件中处理调其他核算项目字段的F7界面
iLookUpcls = 4 '(iLookUpCls表示要调的基础资料的类别ID,可以从t_itemclass里查询ID,例如物料ID为:4)
iLookUpcls = 1001310 '不在T_ITEMCLASS表中,且FClassTypeID>1000000的为BOS基础资料,例如检验值的ID为:1001310
Select Case iLookUpcls
Case 1, 2, 3, 4, 5, 8, 9, 10, 14, 1000 To 10000 '核算项目
Set oDict = New KFO.Dictionary
oDict("BeShortNumber") = False '是否短代码
oDict("GetDataType") = 1 '1表示只显示核算项目明细,0表示显示核算项目上级组和明细,2表示只显示核算项目上级组
oDict("MultiSlt") = True '是否允许选择多条基础资料返回
oDict("Refresh") = 0
Set obj = CreateObject("EBCGLView.GLView")
Set RtnCollection = obj.ItemLookUp(iLookUpcls, "", strFilter, oDict)
'数据包RtnCollection就是核算项目界面双击返回的数据,其中该数据包中的RtnCollection.ReturnObject.Properties就记录着该核算项目的所有属性值
'根据返回的数据包,再去填充单据界面的其他字段的值,例如给第一行物料赋上返回的基础资料编码RtnCollection.ReturnObject.Properties("FNumber")
m_BillInterface.SetFieldValue "FItemID", RtnCollection.ReturnObject.Properties("FNumber"), 1
Case Is >= 1000000 'BOS基础资料
Set obj = CreateObject("K3ClassLookUp.SingleBillLookUp")
obj.ClassTypeID = iLookUpcls
'If dct.Lookup("FFilter") Then
' dct("FFilter") = "QMAGroupInfo.FNumber LIKE '%01%'" '想要加过滤条件,例如过滤出代码类似“01”的检验值
'End If
'要模糊查询的值
dct("CurFFNDValue") = "001" '查询代码FNumber包含有"001"的基础资料
Set obj.Filter = dct
obj.MultiSelect = True 'bos基础资料支持多选返回
obj.ShowType = 1
Set retVect = obj.Show 'retVect为返回的数据包,为数组结构
'例如去返回的第一条基础资料的编码FNumber赋值到界面上去
If Not retVect Is Nothing Then
If retVect.Size > 0 Then
m_BillInterface.SetFieldValue "FItemID", retVect(1)("FNumber"), 1
End If
End If
End Select
Set obj = Nothing
Set oDict = Nothing
Set retVect = Nothing
Set RtnCollection = Nothing
End Sub
插件中F7调用其他核算项目或者BOS基础资料界面
本文2024-09-22 16:39:52发表“k3wise知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3wise-89393.html