⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 VB开发的ERP系统
💻
📖 第 1 页 / 共 3 页
字号:
                    Set mitem = lvListView.ListItems.Add()
                    mitem.Text = Trim(Xtgnbrec!gnmc)
                    If Xtgnbrec.Fields("mjbz") Then
                        mitem.SmallIcon = "gnqx"
                        mitem.Icon = "y"
                    Else
                        mitem.Icon = "i"
                        mitem.SmallIcon = "stb"
                    End If
                    mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
                    Xtgnbrec.MoveNext
                Loop
                '---------------
            End If
        End If
    End If
End Sub

Private Sub lvListView_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then
        Call lvListView_DblClick
    End If

End Sub

Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
    Dim SSql As String
    If Node.Tag <> "" Then
        If Node.Tag = False Then
            SSql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "' and MenuList=1 order by gnbm"
            If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
                Exit Sub
            Else
                sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
            End If
        Else
            SSql = "SELECT * FROM xt_xtgnb a," _
                    & "(SELECT sjgnbm FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "')b" & " where a.sjgnbm=b.sjgnbm and MenuList=1 order by gnbm"
        End If
        
        Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(SSql)
        If Node.Tag = True Then
            If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
                Exit Sub
            Else
                sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
            End If
        End If
        lvListView.ColumnHeaders.Clear
        lvListView.ListItems.Clear
        lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
        Do While Not Xtgnbrec.EOF
            Set mitem = lvListView.ListItems.Add()
            mitem.Text = Trim(Xtgnbrec!gnmc)
            If Xtgnbrec.Fields("mjbz") Then
                mitem.SmallIcon = "gnqx"
                mitem.Icon = "y"
            Else
                mitem.Icon = "i"
                mitem.SmallIcon = "stb"
            End If
            mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
            Xtgnbrec.MoveNext
        Loop
    End If
End Sub

Public Sub Cshgns()                                                    '初始化系统功能树
  
    Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '12%' and MenuList=1 order by gnbm")
    tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
    With Xtgnbrec
        Do While Not .EOF
            If .Fields("mjbz") Then
                Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
            Else
                If Trim(.Fields("sjgnbm")) = "" Then
                    Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kftb")
                Else
                    Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
                End If
            End If
            nodX.Tag = Xtgnbrec!mjbz
            If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
                nodX.EnsureVisible
            End If
            .MoveNext
        Loop
    End With

End Sub

'系统功能树操作
Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  Cancel = 1
End Sub

Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
    
    If Node.Index <> 1 And Node.Key <> "T12" Then
        Node.Image = "stb"
    End If
 
End Sub

Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
    
    If Node.Index <> 1 And Node.Key <> "T12" Then
        Node.Image = "szk"
    End If

End Sub

Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
    
    If KeyAscii = vbKeyReturn Then
        Call tvTreeView_DblClick
    End If

End Sub

Private Sub tvTreeView_DblClick()                                             '选择功能
    
    If tvTreeView.SelectedItem.Children = 0 Then
        Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
        If Not Xtgnbrec.EOF Then
            gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
            Call Zxxymk(gnsyte)
        End If
    End If

End Sub

Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  
    Dim RecTemp As New ADODB.Recordset     '临时使用动态集
    Dim Sqlstr As String                   '临时查询字符串
  
    If Len(Trim(gnsy)) = 0 Then
        Exit Sub
    End If
       
    On Error GoTo Cwcl:
    Select Case gnsy
        '文件
        Case "Kf_Register"                      '用户重新注册
            XT_login.Show 1
        Case "Kf_SysDefine"                     '帐套参数设置
            If Not Security_Log("Kf_SysDefine", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmAccInfo.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        '期初设置
        Case "Kf_StartInput"                    '期初数据录入
             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_StartInput_edit", Xtczybm, 1) Then
                Exit Sub
            End If
       
            '判断是否已经完成初始化
            If CheckStartFinish = True Then
                Tsxx = "系统已经完成初始化操作,不允许进行期初数据录入操作!"
                Call Xtxxts(Tsxx, 0, 1)
                Exit Sub
            Else
                Xtcdcs = "1"
                KF_StartInput.Show 1
            End If
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志

        Case "Kf_StartInputList"                '期初数据列表
            If Not Security_Log("Kf_StartInputList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmStartcxjg.Show
            KF_FrmStartCxtj.Show 1
            
        Case "Kf_StartStockIn"                  '期初采购入库单
            If Not Security_Log("Kf_StartStockIn_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmStartStockIn.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
            
        Case "Kf_StartStockInList"              '期初采购入库单列表
            If Not Security_Log("Kf_StartStockInList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmStartStockInList.Show
            KF_FrmStartStockInQuery.Show 1
        Case "Kf_StartChalk"                    '期初记帐
            If Not Security_Log("Kf_StartChalk", Xtczybm, 1) Then
                Exit Sub
            End If
        
            '判断是否已经完成初始化
            If CheckStartFinish = True Then
                Tsxx = "系统已经完成初始化操作,不允许进行期初结帐操作!"
                Call Xtxxts(Tsxx, 0, 1)
                Exit Sub
            Else
                KF_FrmStartEnd.Show 1
            End If
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_StartFinish"                   '初始化完成
            If Not Security_Log("Kf_StartFinish", Xtczybm, 1) Then
                Exit Sub
            End If
        
            '判断是否已经完成初始化
            If CheckStartFinish = True Then
                Tsxx = "系统已经完成初始化操作!"
                Call Xtxxts(Tsxx, 0, 1)
                Exit Sub
            Else        '初始化过程
                KF_FrmStartFinish.Show 1
            End If
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
            
        '基础设置
        Case "KF_Material"                      '物料档案
            If Not Security_Log("KF_Material", Xtczybm, 1) Then
                Exit Sub
            End If
            Gy_Material.Show 1
        Case "KF_Warehouse"                     '仓库档案
            If Not Security_Log("KF_Warehouse", Xtczybm, 1) Then
                Exit Sub
            End If
            Gy_Warehouse.Show 1
        Case "Kf_Cost"                          '成本对象
            If Not Security_Log("Kf_Cost", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmCostObject.Show 1
        Case "Kf_Area"                          '货区设置
            If Not Security_Log("Kf_Area", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmArea.Show 1
        Case "Kf_GetMaterial"                   '领料用途
            If Not Security_Log("Kf_GetMaterial", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmIssueUse.Show 1
        Case "Kf_ProjectType"                   '工程类型
            If Not Security_Log("Kf_ProjectType", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmProjectType.Show 1
        Case "Kf_Project"                       '工程类型
            If Not Security_Log("Kf_Project", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmProject.Show 1
        Case "Kf_NowQuan"                       '现存量
            If Not Security_Log("Kf_NowQuan", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmNowQuan.Show
            KF_FrmNowQuanCxtj.Show 1
        Case "Kf_MateSort"                       '物料分类
            If Not Security_Log("Kf_MateSort", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmwlflSet.Show 1
            
        '业务处理
        Case "Kf_StockIn"                       '采购入库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_StockIn_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmStockIn.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_StockInList"                   '采购入库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_StockInList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmStockInList.Show
            KF_FrmStockInQuery.Show 1
        Case "Kf_ProductIn"                     '产成品入库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_ProductIn_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmProductIn.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_ProductInList"                 '产成品入库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_ProductInList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmProductInList.Show
            KF_FrmProductInQuery.Show 1
        Case "Kf_OtherIn"                       '其它入库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_OtherIn_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmOtherIn.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_OtherInList"                   '其它入库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_OtherInList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmOtherInList.Show
            KF_FrmOtherInQuery.Show 1
        Case "Kf_MaterialOut"                   '材料出库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_MaterialOut_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmMateOut.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_MaterialOutList"               '材料出库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_MaterialOutList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmMateOutList.Show
            KF_FrmMateOutQuery.Show 1
        Case "Kf_SellOut"                       '销售出库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_SellOut_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmSellOut.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_SellOutList"                   '销售出库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_SellOutList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmSellOutList.Show
            KF_FrmSellOutQuery.Show 1
        Case "Kf_OtherOut"                      '其它出库单
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_OtherOut_edit", Xtczybm, 1) Then
                Exit Sub
            End If
            Xtcdcs = "1"
            KF_FrmOtherOut.Show 1
            Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
        Case "Kf_OtherOutList"                 '其它出库单列表
            '判断用户是否有此功能执行权限,如有则写上机日志(进入)
            If Not Security_Log("Kf_OtherOutList", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_FrmOtherOutList.Show
            KF_FrmOtherOutQuery.Show 1
            
        '储备分析
        Case "Kf_SafeAlart"                     '安全库存预警
            If Not Security_Log("Kf_SafeAlart", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_AlertSafe.Show
            KF_AlertSafeQuery.Show 1
            
        Case "Kf_LowerAlart"                    '低储预警
            If Not Security_Log("Kf_LowerAlart", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_AlertMin.Show
            KF_AlertMinQuery.Show 1
            
        Case "Kf_OverAlart"                     '高储预警
            If Not Security_Log("Kf_OverAlart", Xtczybm, 1) Then
                Exit Sub
            End If
            KF_AlertExceed.Show
            KF_AlertExceedQuery.Show 1
        
        Case "Kf_DzjyAssay"                     '呆滞积压分析
            If Not Security_Log("Kf_DzjyAssay", Xtczybm, 1) Then
                Exit Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -