2022年2022年金蝶V.BOS插件开发-审批插件 .pdf

上传人:Che****ry 文档编号:27244750 上传时间:2022-07-23 格式:PDF 页数:10 大小:503.70KB
返回 下载 相关 举报
2022年2022年金蝶V.BOS插件开发-审批插件 .pdf_第1页
第1页 / 共10页
2022年2022年金蝶V.BOS插件开发-审批插件 .pdf_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《2022年2022年金蝶V.BOS插件开发-审批插件 .pdf》由会员分享,可在线阅读,更多相关《2022年2022年金蝶V.BOS插件开发-审批插件 .pdf(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、金蝶 V12.1BOS 插件开发 -审批插件一、打开 vb,新建 DLL 工程,通过插件开发向导生成。选择“金蝶k/3-bos 客户端插件”点“确定”,勾选“金蝶k/3-bos 审批流插件” ,可以看到10 个审批事件。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 10 页 - - - - - - - - - 1、UnCheckOptionConfigured事件在反审核操作的选项配置完成后发生。语法Private Sub Object_UnCheckOptionCon

2、figured (ByRef dctConfig As KFO.Dictionary, ByRef bCancel As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。dctConfig KFO.Dictionary。反审核选项相关配置Cancel Boolean类型。目前保留。2 、UnCheckDone事件在审核操作完成后发生。语法Private Sub Object_UnCheckDone (ByVal lCheckNodeIndex As Long, ByVal bSucceed As Boolean) 部分描述Object MixedA

3、pprovalEvents对象的一个实例。lCheckNodeIndex Long 类型。指示反审核的节点ID bSucceed Boolean类型。指示反审核是否成功。3 、MessageConfigred事件名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 10 页 - - - - - - - - - 在审核操作完成后发生。语法Private Sub Object_MessageConfigred(MsgObj As Object, ByRef bCancel As B

4、oolean)部分描述Object MixedApprovalEvents对象的一个实例。MsgObj OBJECT 类型。消息操作对象bCancel Boolean类型。是否取消发送消息。4、CheckPrepare事件在审批流审核前发生。语法Private Sub Object_CheckPrepare (ByRef bShowConfigurationManager As Boolean, ByRef bCancel As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。bShowConfigurationManager Boolean类型。

5、指示是否显示审核选项配置界面Cancel Boolean类型。目前保留。5 、 CheckOptionConfigured事件在审核操作的选项配置完成后发生。语法Private Sub Object_CheckOptionConfigured (ByRef dctConfig As KFO.Dictionary, ByRef bCancel As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。dctConfig KFO.Dictionary。审核选项相关配置Cancel Boolean类型。目前保留。6 、CheckDone事件在审核操作完成后发

6、生。语法Private Sub Object_CheckDone(ByVal lCheckNodeIndex As Long, ByVal bSucceed As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。lCheckNodeIndex Long 类型。指示审核的节点ID bSucceed Boolean类型。指示审核是否成功。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 10 页 - - - - - - - - -

7、7 、SubmitPrepare事件该事件在触发提交审核后发生。语法Private Sub Object_SubmitPrepare (ByRef bShowConfigurationManager As Boolean, ByRef bCancel As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。bShowConfigurationManager Boolean类型。是否显示提交选项配置界面。bCancel Boolean类型。是否要取消操作。8、SubmitOptionConfigured事件在提交审核操作的选项配置完成后发生。语法Pri

8、vate Sub Object_SubmitOptionConfigured (ByRef dctConfig As KFO.Dictionary, ByRef bCancel As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。dctConfig KFO.Dictionary。提交审核选项相关配置Cancel Boolean类型。是否需要取消本次提交审核操作。9、SubmitDone事件提交审核完成后发生。语法Private Sub Object_CheckDone(ByVal lCheckNodeIndex As Long, ByVal bS

9、ucceed As Boolean) 部分描述Object MixedApprovalEvents对象的一个实例。lCheckNodeIndex Long 类型。提交审核的节点ID bSucceed Boolean类型。指示提交审核是否成功。10 、UnCheckPrepare事件在审批流反审核操作前发生。语法Private Sub Object_CheckPrepare (ByRef bShowConfigurationManager As Boolean, ByRef bCancel As Boolean) 部分描述名师资料总结 - - -精品资料欢迎下载 - - - - - - - -

10、- - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 10 页 - - - - - - - - - Object MixedApprovalEvents对象的一个实例。bShowConfigurationManager Boolean类型。指示是否显示反审核选项配置界面Cancel Boolean类型。目前保留。二、已单据“ t_BOS200000023”审批为例,该单据设置3 级审批,审批流程如下图,现在想把 1 级,2 级审核人,审核时间显示到单据上。单据中增加1-2 级审核人,审核日期。我们需要在CheckDone,和 UnCheckDone

11、事件中增加反写单据。具体代码如下:Private WithEvents m_ApprovalInterface As MixedApprovalEvents Dim m_CZEvent As Object Public Sub Show(ByVal oApprovalInterface As Object) 注意: 此方法必须存在, 请勿修改Set m_ApprovalInterface = oApprovalInterface End Sub Private Sub Class_Terminate() 释放接口对象注意: 此方法必须存在, 请勿修改Set m_ApprovalInterfac

12、e = Nothing End Sub Private Sub m_ApprovalInterface_CheckDone(ByVal lCheckNodeIndex As Long, ByVal bSucceed As Variant) TODO: 请在此处添加代码响应事件On Error GoTo Catch 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 10 页 - - - - - - - - - Dim oK3 As K3ClassEvents.K3Lib Di

13、m oUser As K3ClassEvents.User Dim oUserid As Long Dim strSql As String Dim vctRows As KFO.Vector Dim dctRow As KFO.Dictionary Dim rs As New ADODB.Recordset If m_ApprovalInterface.BillEvent Is Nothing Then 序时簿界面中执行Set m_CZEvent = m_ApprovalInterface.ListEvent Set oK3 = m_CZEvent.K3Lib Set oUser = oK3

14、.User oUserid = oUser.UserID Set vctRows = m_CZEvent.GetSelectedBillInfo If Not vctRows Is Nothing And bSucceed = True Then 循环序时簿For i = 1 To vctRows.Size Set dctRow = vctRows(i) strSql = select FTagIndex from icClassMCStatus200000023 WHERE FID =(SELECT MAX(FID) FROM icClassMCStatus200000023 WHERE F

15、BillID= & dctRow(FID) & AND FTagIndex NOT IN(-1) Set rs = oK3.GetData(strSql) If Not rs.EOF Then If rs(FTagIndex) = 2002 And lCheckNodeIndex = 2002 Then strSql = update t_BOS200000023 Set FUser1= & oUserid & ,FTime2=getdate() where FID= & dctRow(FID) & oK3.GetData (strSql) ElseIf rs(FTagIndex) = 200

16、1 And lCheckNodeIndex = 2001 Then strSql = update t_BOS200000023 Set FUser= & oUserid & ,FTime1=getdate() where FID= & dctRow(FID) & oK3.GetData (strSql) End If End If Next m_CZEvent.RefreshList True, True Set rs = Nothing Set dctRow = Nothing Set vctRows = Nothing End If Else 单据界面中执行Set m_CZEvent =

17、 m_ApprovalInterface.BillEvent Set oK3 = m_CZEvent.K3Lib Set oUser = oK3.User oUserid = oUser.UserID 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 10 页 - - - - - - - - - If m_CZEvent.Data(page1)(m_CZEvent.TableInfo(map)(FID)(FFLD) Then If lCheckNodeIndex = 200

18、1 And bSucceed = True Then strSql = update t_BOS200000023 Set FUser= & oUserid & ,FTime1=getdate() where FID= & m_CZEvent.Data(page1)(m_CZEvent.TableInfo(map)(FID)(FFLD) & Set rs = oK3.GetData(strSql) m_CZEvent.SetFieldValue FUser, oUserid m_CZEvent.SetFieldValue FTime1, Now() ElseIf lCheckNodeIndex

19、 = 2002 And bSucceed = True Then strSql = update t_BOS200000023 Set FUser1= & oUserid & ,FTime2=getdate() where FID= & m_CZEvent.Data(page1)(m_CZEvent.TableInfo(map)(FID)(FFLD) & Set rs = oK3.GetData(strSql) m_CZEvent.SetFieldValue FUser1, oUserid m_CZEvent.SetFieldValue FTime2, Now() End If End If

20、End If GoTo ExitSub Catch: If Err.Number 0 Then MsgBox Err.Description, vbCritical, oK3.LoadKDString(金蝶提示 ) End If ExitSub: Set oUser = Nothing Set oK3 = Nothing End Sub Private Sub m_ApprovalInterface_UnCheckDone(ByVal lCheckNodeIndex As Long, ByVal bSucceed As Variant) TODO: 请在此处添加代码响应事件On Error G

21、oTo Catch Dim oK3 As K3ClassEvents.K3Lib Dim oUser As K3ClassEvents.User Dim oUserid As Long Dim strSql As String Dim vctRows As KFO.Vector Dim dctRow As KFO.Dictionary Dim rs As New ADODB.Recordset If m_ApprovalInterface.BillEvent Is Nothing Then 序时簿界面中执行名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - -

22、 - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 10 页 - - - - - - - - - Set m_CZEvent = m_ApprovalInterface.ListEvent Set oK3 = m_CZEvent.K3Lib Set oUser = oK3.User oUserid = oUser.UserID Set vctRows = m_CZEvent.GetSelectedBillInfo If Not vctRows Is Nothing And bSucceed = True Then For i = 1 To vctRows.Siz

23、e Set dctRow = vctRows(i) strSql = select FNextNodeTagIndex from icClassMCStatus200000023 WHERE FID =(SELECT MAX(FID) FROM icClassMCStatus200000023 WHERE FBillID= & dctRow(FID) & AND FTagIndex NOT IN(-1) Set rs = oK3.GetData(strSql) If Not rs.EOF Then If rs(FNextNodeTagIndex) = 2002 Then strSql = up

24、date t_BOS200000023 Set FUser1=0,FTime2=null where FID= & dctRow(FID) & oK3.GetData (strSql) ElseIf rs(FNextNodeTagIndex) = 2001 Then strSql = update t_BOS200000023 Set FUser=0,FTime1=null where FID= & dctRow(FID) & oK3.GetData (strSql) End If End If Next m_CZEvent.RefreshList True, True Set rs = No

25、thing Set dctRow = Nothing Set vctRows = Nothing End If Else 单据界面中执行Set m_CZEvent = m_ApprovalInterface.BillEvent Set oK3 = m_CZEvent.K3Lib Set oUser = oK3.User oUserid = oUser.UserID If m_CZEvent.Data(page1)(m_CZEvent.TableInfo(map)(FID)(FFLD) And bSucceed = True Then strSql = select FNextNodeTagIn

26、dex from icClassMCStatus200000023 WHERE FID =(SELECT MAX(FID) FROM icClassMCStatus200000023 WHERE FBillID= & m_CZEvent.Data(page1)(m_CZEvent.TableInfo(map)(FID)(FFLD) & AND FTagIndex NOT IN(-1) Set rs = oK3.GetData(strSql) If Not rs.EOF Then If rs(FNextNodeTagIndex) = 2002 Then 名师资料总结 - - -精品资料欢迎下载

27、- - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 10 页 - - - - - - - - - strSql = update t_BOS200000023 Set FUser1=null,FTime2=null where FID= & dctRow(FID) & oK3.GetData (strSql) m_CZEvent.SetFieldValue FUser1, 0 m_CZEvent.SetFieldValue FTime2, Null ElseIf rs(FNextNodeTagIndex) = 200

28、1 Then strSql = update t_BOS200000023 Set FUser=null,FTime1=null where FID= & dctRow(FID) & oK3.GetData (strSql) m_CZEvent.SetFieldValue FUser, 0 m_CZEvent.SetFieldValue FTime1, Null End If End If End If End If GoTo ExitSub Catch: If Err.Number 0 Then MsgBox Err.Description, vbCritical, oK3.LoadKDSt

29、ring(金蝶提示 ) End If ExitSub: Set oUser = Nothing Set oK3 = Nothing End Sub 三、上面代码编译生成以后,在BOS 单据插件中增加对应插件。名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 10 页 - - - - - - - - - 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 10 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁