上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:33k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form Xt_Control 
  5.    Caption         =   "桌面"
  6.    ClientHeight    =   5850
  7.    ClientLeft      =   675
  8.    ClientTop       =   1665
  9.    ClientWidth     =   9240
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   9240
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.PictureBox picSplitter 
  17.       BackColor       =   &H00808080&
  18.       BorderStyle     =   0  'None
  19.       FillColor       =   &H00808080&
  20.       Height          =   4800
  21.       Left            =   4740
  22.       ScaleHeight     =   2090.126
  23.       ScaleMode       =   0  'User
  24.       ScaleWidth      =   780
  25.       TabIndex        =   0
  26.       Top             =   780
  27.       Visible         =   0   'False
  28.       Width           =   72
  29.    End
  30.    Begin MSComctlLib.ImageList ImageList1 
  31.       Left            =   5220
  32.       Top             =   2340
  33.       _ExtentX        =   1005
  34.       _ExtentY        =   1005
  35.       BackColor       =   -2147483643
  36.       ImageWidth      =   16
  37.       ImageHeight     =   16
  38.       MaskColor       =   12632256
  39.       _Version        =   393216
  40.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  41.          NumListImages   =   5
  42.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  43.             Picture         =   "系统_主操作桌面.frx":1042
  44.             Key             =   "stb"
  45.          EndProperty
  46.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  47.             Picture         =   "系统_主操作桌面.frx":2094
  48.             Key             =   "xttb"
  49.          EndProperty
  50.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  51.             Picture         =   "系统_主操作桌面.frx":30E6
  52.             Key             =   "szk"
  53.          EndProperty
  54.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  55.             Picture         =   "系统_主操作桌面.frx":3480
  56.             Key             =   "gnqx"
  57.          EndProperty
  58.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  59.             Picture         =   "系统_主操作桌面.frx":381A
  60.             Key             =   "kpgl"
  61.          EndProperty
  62.       EndProperty
  63.    End
  64.    Begin MSComctlLib.ListView lvListView 
  65.       Height          =   3375
  66.       Left            =   2160
  67.       TabIndex        =   5
  68.       Top             =   705
  69.       Width           =   2295
  70.       _ExtentX        =   4048
  71.       _ExtentY        =   5953
  72.       Arrange         =   2
  73.       LabelEdit       =   1
  74.       LabelWrap       =   -1  'True
  75.       HideSelection   =   -1  'True
  76.       OLEDragMode     =   1
  77.       OLEDropMode     =   1
  78.       PictureAlignment=   1
  79.       _Version        =   393217
  80.       Icons           =   "ImageList2"
  81.       SmallIcons      =   "ImageList1"
  82.       ColHdrIcons     =   "ImageList1"
  83.       ForeColor       =   -2147483640
  84.       BackColor       =   -2147483643
  85.       BorderStyle     =   1
  86.       Appearance      =   1
  87.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  88.          Name            =   "宋体"
  89.          Size            =   9
  90.          Charset         =   134
  91.          Weight          =   400
  92.          Underline       =   0   'False
  93.          Italic          =   0   'False
  94.          Strikethrough   =   0   'False
  95.       EndProperty
  96.       OLEDragMode     =   1
  97.       OLEDropMode     =   1
  98.       NumItems        =   0
  99.    End
  100.    Begin VB.PictureBox picTitles 
  101.       Align           =   1  'Align Top
  102.       Appearance      =   0  'Flat
  103.       BorderStyle     =   0  'None
  104.       ForeColor       =   &H80000008&
  105.       Height          =   300
  106.       Left            =   0
  107.       ScaleHeight     =   300
  108.       ScaleWidth      =   9240
  109.       TabIndex        =   1
  110.       TabStop         =   0   'False
  111.       Top             =   420
  112.       Width           =   9240
  113.       Begin VB.Label lblTitle 
  114.          BorderStyle     =   1  'Fixed Single
  115.          Caption         =   "百利/ERP"
  116.          Height          =   270
  117.          Index           =   0
  118.          Left            =   0
  119.          TabIndex        =   3
  120.          Tag             =   " 树形视图:"
  121.          Top             =   12
  122.          Width           =   2016
  123.       End
  124.       Begin VB.Label lblTitle 
  125.          BorderStyle     =   1  'Fixed Single
  126.          Caption         =   " 列表视图:"
  127.          Height          =   270
  128.          Index           =   1
  129.          Left            =   2078
  130.          TabIndex        =   2
  131.          Tag             =   " 列表视图:"
  132.          Top             =   12
  133.          Width           =   3216
  134.       End
  135.    End
  136.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  137.       Left            =   3360
  138.       Top             =   2160
  139.       _ExtentX        =   847
  140.       _ExtentY        =   847
  141.       _Version        =   393216
  142.    End
  143.    Begin MSComctlLib.TreeView tvTreeView 
  144.       Height          =   4800
  145.       Left            =   0
  146.       TabIndex        =   4
  147.       Top             =   705
  148.       Width           =   2010
  149.       _ExtentX        =   3545
  150.       _ExtentY        =   8467
  151.       _Version        =   393217
  152.       Indentation     =   564
  153.       Style           =   7
  154.       ImageList       =   "ImageList1"
  155.       Appearance      =   1
  156.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  157.          Name            =   "宋体"
  158.          Size            =   9
  159.          Charset         =   134
  160.          Weight          =   400
  161.          Underline       =   0   'False
  162.          Italic          =   0   'False
  163.          Strikethrough   =   0   'False
  164.       EndProperty
  165.    End
  166.    Begin MSComctlLib.Toolbar tbToolBar 
  167.       Align           =   1  'Align Top
  168.       Height          =   420
  169.       Left            =   0
  170.       TabIndex        =   6
  171.       Top             =   0
  172.       Width           =   9240
  173.       _ExtentX        =   16298
  174.       _ExtentY        =   741
  175.       ButtonWidth     =   609
  176.       ButtonHeight    =   582
  177.       AllowCustomize  =   0   'False
  178.       Appearance      =   1
  179.       ImageList       =   "imlToolbarIcons"
  180.       _Version        =   393216
  181.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  182.          NumButtons      =   10
  183.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  184.             Style           =   3
  185.          EndProperty
  186.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  187.             Key             =   "返回"
  188.             Object.ToolTipText     =   "返回"
  189.             ImageKey        =   "xq"
  190.          EndProperty
  191.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  192.             Key             =   "向前"
  193.             Object.ToolTipText     =   "向前"
  194.             ImageKey        =   "xh"
  195.          EndProperty
  196.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  197.             Style           =   3
  198.          EndProperty
  199.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  200.             Style           =   3
  201.          EndProperty
  202.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  203.             Style           =   3
  204.          EndProperty
  205.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  206.             Key             =   "大图标"
  207.             Object.ToolTipText     =   "大图标"
  208.             ImageKey        =   "dtb"
  209.             Style           =   2
  210.             Value           =   1
  211.          EndProperty
  212.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  213.             Key             =   "小图标"
  214.             Object.ToolTipText     =   "小图标"
  215.             ImageKey        =   "xtb"
  216.             Style           =   2
  217.          EndProperty
  218.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  219.             Key             =   "列表"
  220.             Object.ToolTipText     =   "列表"
  221.             ImageKey        =   "lb"
  222.             Style           =   2
  223.          EndProperty
  224.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  225.             Key             =   "详细资料"
  226.             Object.ToolTipText     =   "详细资料"
  227.             ImageKey        =   "xxzl"
  228.             Style           =   2
  229.          EndProperty
  230.       EndProperty
  231.    End
  232.    Begin MSComctlLib.ImageList imlToolbarIcons 
  233.       Left            =   4710
  234.       Top             =   840
  235.       _ExtentX        =   1005
  236.       _ExtentY        =   1005
  237.       BackColor       =   -2147483643
  238.       ImageWidth      =   16
  239.       ImageHeight     =   16
  240.       MaskColor       =   12632256
  241.       _Version        =   393216
  242.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  243.          NumListImages   =   6
  244.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  245.             Picture         =   "系统_主操作桌面.frx":486C
  246.             Key             =   "xq"
  247.          EndProperty
  248.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  249.             Picture         =   "系统_主操作桌面.frx":4C06
  250.             Key             =   "xh"
  251.          EndProperty
  252.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  253.             Picture         =   "系统_主操作桌面.frx":4FA0
  254.             Key             =   "dtb"
  255.          EndProperty
  256.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  257.             Picture         =   "系统_主操作桌面.frx":533A
  258.             Key             =   "xtb"
  259.          EndProperty
  260.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  261.             Picture         =   "系统_主操作桌面.frx":56D4
  262.             Key             =   "lb"
  263.          EndProperty
  264.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  265.             Picture         =   "系统_主操作桌面.frx":5A6E
  266.             Key             =   "xxzl"
  267.          EndProperty
  268.       EndProperty
  269.    End
  270.    Begin MSComctlLib.ImageList ImageList2 
  271.       Left            =   6210
  272.       Top             =   2370
  273.       _ExtentX        =   1005
  274.       _ExtentY        =   1005
  275.       BackColor       =   -2147483643
  276.       ImageWidth      =   32
  277.       ImageHeight     =   32
  278.       MaskColor       =   12632256
  279.       _Version        =   393216
  280.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  281.          NumListImages   =   3
  282.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.             Picture         =   "系统_主操作桌面.frx":5E08
  284.             Key             =   ""
  285.          EndProperty
  286.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  287.             Picture         =   "系统_主操作桌面.frx":6128
  288.             Key             =   "y"
  289.          EndProperty
  290.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  291.             Picture         =   "系统_主操作桌面.frx":6E02
  292.             Key             =   "i"
  293.          EndProperty
  294.       EndProperty
  295.    End
  296.    Begin VB.Image imgSplitter 
  297.       Height          =   4785
  298.       Left            =   4230
  299.       MousePointer    =   9  'Size W E
  300.       Top             =   750
  301.       Width           =   150
  302.    End
  303. End
  304. Attribute VB_Name = "Xt_Control"
  305. Attribute VB_GlobalNameSpace = False
  306. Attribute VB_Creatable = False
  307. Attribute VB_PredeclaredId = True
  308. Attribute VB_Exposed = False
  309. '***********************************************
  310. '*    模 块 名 称 :系统主操作桌面
  311. '*    功 能 描 述 :
  312. '*    程序员姓名  :张建忠
  313. '*    最后修改人  :张建忠
  314. '*    最后修改时间:2001/06/21
  315. '*    备        注:封版
  316. '***********************************************
  317. Const NAME_COLUMN = 0
  318. Const TYPE_COLUMN = 1
  319. Const SIZE_COLUMN = 2
  320. Const DATE_COLUMN = 3
  321. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  322.   
  323. Dim mbMoving As Boolean
  324. Const sglSplitLimit = 1000
  325. Dim nodX As Node
  326. Dim mitem As ListItem
  327. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  328. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  329. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  330. Dim Tsxx As String                           '系统提示信息
  331. Dim gnsyte As String                         '系统功能项索引
  332. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  333. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  334. Dim sjgnbmStr As String                      '上级编码
  335. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  336.     
  337.     If lvListView.ListItems.Count > 0 Then
  338.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  339.         If Not Xtgnbrec.EOF Then
  340.             If Xtgnbrec.Fields("mjbz") = True Then
  341.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  342.                 Call Zxxymk(gnsyte)
  343.             Else
  344.                 '---------------
  345.                 Dim Ssql As String
  346.                 sjgnbmStr = ""
  347.                 lvListView.ColumnHeaders.Clear
  348.                 lvListView.ListItems.Clear
  349.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  350.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  351.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  352.                 Do While Not Xtgnbrec.EOF
  353.                     Set mitem = lvListView.ListItems.Add()
  354.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  355.                     If Xtgnbrec.Fields("mjbz") Then
  356.                         mitem.SmallIcon = "gnqx"
  357.                         mitem.Icon = "y"
  358.                     Else
  359.                         mitem.Icon = "i"
  360.                         mitem.SmallIcon = "stb"
  361.                     End If
  362.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  363.                     Xtgnbrec.MoveNext
  364.                 Loop
  365.                 '---------------
  366.             End If
  367.         End If
  368.     End If
  369. End Sub
  370. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  371.     Dim Ssql As String
  372.     If Node.Tag <> "" Then
  373.         If Node.Tag = False Then
  374.             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"
  375.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  376.                 Exit Sub
  377.             Else
  378.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  379.             End If
  380.         Else
  381.             Ssql = "SELECT * FROM xt_xtgnb a," _
  382.                     & "(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"
  383.         End If
  384.         
  385.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  386.         If Node.Tag = True Then
  387.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  388.                 Exit Sub
  389.             Else
  390.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  391.             End If
  392.         End If
  393.         lvListView.ColumnHeaders.Clear
  394.         lvListView.ListItems.Clear
  395.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  396.         Do While Not Xtgnbrec.EOF
  397.             Set mitem = lvListView.ListItems.Add()
  398.             mitem.Text = Trim(Xtgnbrec!gnmc)
  399.             If Xtgnbrec.Fields("mjbz") Then
  400.                 mitem.SmallIcon = "gnqx"
  401.                 mitem.Icon = "y"
  402.             Else
  403.                 mitem.Icon = "i"
  404.                 mitem.SmallIcon = "stb"
  405.             End If
  406.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  407.             Xtgnbrec.MoveNext
  408.         Loop
  409.     End If
  410. End Sub
  411. Public Sub Cshgns()                                                    '初始化系统功能树
  412.   
  413.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '03%' and MenuList=1 order by gnbm")
  414.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP", "xttb"
  415.     With Xtgnbrec
  416.         Do While Not .EOF
  417.             If .Fields("mjbz") Then
  418.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  419.             Else
  420.                 If Trim(.Fields("sjgnbm")) = "" Then
  421.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  422.                 Else
  423.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  424.                 End If
  425.             End If
  426.             nodX.Tag = Xtgnbrec!mjbz
  427.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  428.                 nodX.EnsureVisible
  429.             End If
  430.             .MoveNext
  431.         Loop
  432.     End With
  433. End Sub
  434. '系统功能树操作
  435. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  436.   Cancel = 1
  437. End Sub
  438. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  439.     
  440.     If Node.Index <> 1 And Node.Key <> "T03" Then
  441.         Node.Image = "stb"
  442.     End If
  443.  
  444. End Sub
  445. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  446.     
  447.     If Node.Index <> 1 And Node.Key <> "T03" Then
  448.         Node.Image = "szk"
  449.     End If
  450. End Sub
  451. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  452.     
  453.     If KeyAscii = vbKeyReturn Then
  454.         Call tvTreeView_DblClick
  455.     End If
  456. End Sub
  457. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  458.     If KeyAscii = vbKeyReturn Then
  459.         Call lvListView_DblClick
  460.     End If
  461. End Sub
  462. Private Sub tvTreeView_DblClick()                                             '选择功能
  463.     
  464.     If tvTreeView.SelectedItem.Children = 0 Then
  465.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  466.         If Not Xtgnbrec.EOF Then
  467.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  468.             Call Zxxymk(gnsyte)
  469.         End If
  470.     End If
  471. End Sub
  472. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  473.   
  474.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  475.     Dim Sqlstr As String                   '临时查询字符串
  476.   
  477.     If Len(Trim(gnsy)) = 0 Then
  478.         Exit Sub
  479.     End If
  480.     
  481.     On Error GoTo Cwcl:
  482.     Select Case gnsy
  483.         '***********文件************
  484.         Case "Ap_Register"                      '用户重新注册
  485.             XT_login.Show 1
  486.         Case "Ap_quit"                          '退出系统
  487.             Unload XT_Main
  488.               
  489.         '**********基础设置***********
  490.         Case "Ap_SystemPara"                    '系统参数设置
  491.             If Not Security_Log("Ap_SystemPara", Xtczybm, 1) Then
  492.                 Exit Sub
  493.             End If
  494.             JC_FrmSystemPara.HelpContextID = 30101
  495.             JC_FrmSystemPara.Show 1
  496.         Case "Ap_BaseAcc"                       '基本科目设置
  497.             If Not Security_Log("Ap_BaseAcc", Xtczybm, 1) Then
  498.                 Exit Sub
  499.             End If
  500.             JC_FrmBaseAcc.HelpContextID = 30102
  501.             JC_FrmBaseAcc.Show 1
  502.         Case "Ap_SupplierAcc"                   '供应商科目设置
  503.             If Not Security_Log("Ap_SupplierAcc", Xtczybm, 1) Then
  504.                 Exit Sub
  505.             End If
  506.             JC_FrmSuppAcc.HelpContextID = 30103
  507.             JC_FrmSuppAcc.Show 1
  508.         Case "Ap_MateAcc"                       '存货科目设置
  509.             If Not Security_Log("Ap_MateAcc", Xtczybm, 1) Then
  510.                 Exit Sub
  511.             End If
  512.             JC_FrmMateAcc.HelpContextID = 30104
  513.             JC_FrmMateAcc.Show 1
  514.         Case "Ap_BillAge"                       '帐龄区间设置
  515.             If Not Security_Log("Ap_BillAge", Xtczybm, 1) Then
  516.                 Exit Sub
  517.             End If
  518.             JC_FrmBillAge.HelpContextID = 30105
  519.             JC_FrmBillAge.Show 1
  520.         Case "Ap_BankAcc"                       '银行帐户设置
  521.             If Not Security_Log("Ap_BankAcc", Xtczybm, 1) Then
  522.                 Exit Sub
  523.             End If
  524.             JC_FrmBankAcc.HelpContextID = 30106
  525.             JC_FrmBankAcc.Show 1
  526.         
  527.         '***********初始化***********
  528.         Case "Ap_QcOtherBill"                   '期初应付单
  529.             If Not Security_Log("Ap_QcOtherBill", Xtczybm, 1) Then
  530.                 Exit Sub
  531.             End If
  532.             Format_FrmOtherBillList.HelpContextID = 30201
  533.             Format_FrmOtherBillList.Show
  534.             Format_FrmOtherBillQuery.HelpContextID = 30201
  535.             Format_FrmOtherBillQuery.Show 1
  536.         Case "Ap_BeginAPNote"                   '期初应付票据
  537.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  538.             If Not Security_Log("Ap_BeginAPNote_Edit", Xtczybm, 1) Then
  539.                 Exit Sub
  540.             End If
  541.             TranPara = "期初"                   '期初票据标志
  542.             Xtcdcs = "1"
  543.             FK_FrmNoteIn.Show 1
  544.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  545.             
  546.         '**********付款处理*********
  547.         Case "Ap_PayBill"                       '付款结算单
  548.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  549.             If Not Security_Log("Ap_PayBill_Edit", Xtczybm, 1) Then
  550.                 Exit Sub
  551.             End If
  552.             Xtcdcs = "1"
  553.             FK_FrmFkdcl.HelpContextID = 30401
  554.             FK_FrmFkdcl.Show 1
  555.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  556.             
  557.         Case "Ap_PayBillList"                   '付款单列表
  558.             If Not Security_Log("Ap_PayBillList", Xtczybm, 1) Then
  559.                 Exit Sub
  560.             End If
  561.             FK_FrmFkdlbCxjg.HelpContextID = 30402
  562.             FK_FrmFkdlbCxjg.Show
  563.             FK_FrmFkdlbcxtj.HelpContextID = 30402
  564.             FK_FrmFkdlbcxtj.Show 1
  565.         Case "Ap_Note"                          '应付票据
  566.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  567.             If Not Security_Log("Ap_Note_Edit", Xtczybm, 1) Then
  568.                 Exit Sub
  569.             End If
  570.             TranPara = ""
  571.             Xtcdcs = "1"
  572.             FK_FrmNoteIn.Show 1
  573.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  574.             
  575.         Case "Ap_NoteList"                      '应付票据列表
  576.             If Not Security_Log("Ap_NoteList", Xtczybm, 1) Then
  577.                 Exit Sub
  578.             End If
  579.             FK_FrmNoteList.HelpContextID = 30404
  580.             FK_FrmNoteList.Show
  581.             FK_FrmNoteQuery.HelpContextID = 30404
  582.             FK_FrmNoteQuery.Show 1
  583.             
  584.         '**************核销处理************
  585.         Case "Ap_BillCancel"                    '单据核销
  586.             If Not Security_Log("Ap_BillCancel", Xtczybm, 1) Then
  587.                 Exit Sub
  588.             End If
  589.             HX_FrmHxgl.HelpContextID = 30501
  590.             HX_FrmHxgl.Show
  591.             HX_FrmHxCxtj.HelpContextID = 30501
  592.             HX_FrmHxCxtj.Show 1
  593.         Case "Ap_CancelQuery"                   '核销查询
  594.             If Not Security_Log("Ap_CancelQuery", Xtczybm, 1) Then
  595.                 Exit Sub
  596.             End If
  597.             HX_FrmHxlbcxjg.HelpContextID = 30502
  598.             HX_FrmHxlbcxjg.Show
  599.             HX_FrmHxlbCxtj.HelpContextID = 30502
  600.             HX_FrmHxlbCxtj.Show 1
  601.             
  602.         '*************应付单据*************
  603.         Case "Ap_InvPostAcc"                    '发票过帐
  604.             If Not Security_Log("Ap_InvPostAcc", Xtczybm, 1) Then
  605.                 Exit Sub
  606.             End If
  607.             ApNote_FrmFpgzCxjg.HelpContextID = 30301
  608.             ApNote_FrmFpgzCxjg.Show
  609.             ApNote_FrmFpgzcxtj.HelpContextID = 30301
  610.             ApNote_FrmFpgzcxtj.Show 1
  611.         Case "Ap_OtherBill"                     '其它应付单录入-陈
  612.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  613.             If Not Security_Log("Ap_OtherBill_Edit", Xtczybm, 1) Then
  614.                 Exit Sub
  615.             End If
  616.             Xtcdcs = "1"
  617.             ApNote_FrmOtherBill.HelpContextID = 30302
  618.             ApNote_FrmOtherBill.Show 1
  619.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  620.         Case "Ap_OtherBillList"                 '其它应付单列表-陈
  621.             If Not Security_Log("Ap_OtherBillList", Xtczybm, 1) Then
  622.                 Exit Sub
  623.             End If
  624.             ApNote_FrmOtherBillList.HelpContextID = 30303
  625.             ApNote_FrmOtherBillList.Show
  626.             ApNote_FrmOtherBillQuery.HelpContextID = 30303
  627.             ApNote_FrmOtherBillQuery.Show 1
  628.                     
  629.         '*****************统计报表****************
  630.         Case "Ap_SuppBalance"                   '供应商余额表-陈
  631.             If Not Security_Log("Ap_SuppBalance", Xtczybm, 1) Then
  632.                 Exit Sub
  633.             End If
  634.             Report_FrmSuppList.HelpContextID = 30703
  635.             Report_FrmSuppList.Show
  636.             Report_FrmSuppQuery.HelpContextID = 30703
  637.             Report_FrmSuppQuery.Show 1
  638.         Case "Ap_AccSum"                        '应收总帐列表-陈
  639.             If Not Security_Log("Ap_AccSum", Xtczybm, 1) Then
  640.                 Exit Sub
  641.             End If
  642.             Report_FrmAccSumList.HelpContextID = 30702
  643.             Report_FrmAccSumList.Show
  644.             Report_FrmAccSumQuery.HelpContextID = 30702
  645.             Report_FrmAccSumQuery.Show 1
  646.         Case "Ap_AccList"                       '应收明细帐列表-陈
  647.             If Not Security_Log("Ap_AccList", Xtczybm, 1) Then
  648.                 Exit Sub
  649.             End If
  650.             Report_FrmAccMxList.HelpContextID = 30701
  651.             Report_FrmAccMxList.Show
  652.             Report_FrmAccMxQuery.HelpContextID = 30701
  653.             Report_FrmAccMxQuery.Show 1
  654.         Case "Ap_AccAgeAnalyse"                 '账龄分析-陈
  655.             If Not Security_Log("Ap_AccAgeAnalyse", Xtczybm, 1) Then
  656.                 Exit Sub
  657.             End If
  658.             Report_FrmAccAgeList.HelpContextID = 30704
  659.             Report_FrmAccAgeList.Show
  660.             Report_FrmAccAgeQuery.HelpContextID = 30704
  661.             Report_FrmAccAgeQuery.Show 1
  662.         
  663.         '***************制作凭证******************
  664.         
  665.         Case "Ap_InvoiceVouch"                  '采购发票制作凭证
  666.             If Not Security_Log("Ar_InvoiceVouch", Xtczybm, 1) Then
  667.                 Exit Sub
  668.             End If
  669.             ItemType = "7"
  670.             PZ_FrmInvoiceList.HelpContextID = 30601
  671.             PZ_FrmInvoiceList.Show
  672.             PZ_FrmInvoiceFilter.HelpContextID = 30601
  673.             PZ_FrmInvoiceFilter.Show 1
  674.           
  675.         Case "Ap_OtherVouch"                    '其它应付单制作凭证
  676.             If Not Security_Log("Ar_OtherVouch", Xtczybm, 1) Then
  677.                 Exit Sub
  678.             End If
  679.             ItemType = "8"                      '其它应付单票据大类型
  680.             PZ_FrmOCBillList.HelpContextID = 30602
  681.             PZ_FrmOCBillList.Show
  682.             PZ_FrmOCBillFilter.HelpContextID = 30602
  683.             PZ_FrmOCBillFilter.Show 1
  684.         Case "Ap_PayVouch"                      '付款单制作凭证
  685.             If Not Security_Log("Ar_CloseVouch", Xtczybm, 1) Then
  686.                 Exit Sub
  687.             End If
  688.             ItemType = "9"                      '付款的票据大类型
  689.             PZ_FrmOCBillList.HelpContextID = 30603
  690.             PZ_FrmOCBillList.Show
  691.             PZ_FrmOCBillFilter.HelpContextID = 30603
  692.             PZ_FrmOCBillFilter.Show 1
  693.         Case "Ap_NoteVouch"                     '应付票据制凭证
  694.             If Not Security_Log("Ar_NoteVouch", Xtczybm, 1) Then
  695.                 Exit Sub
  696.             End If
  697.             ItemType = "B"
  698.             PZ_FrmNoteList.HelpContextID = 30604
  699.             PZ_FrmNoteList.Show
  700.             PZ_FrmNoteFilter.HelpContextID = 30604
  701.             PZ_FrmNoteFilter.Show 1
  702.         Case "Ap_NoteChangeVouch"               '票据变动
  703.             If Not Security_Log("Ar_NoteChangeVouch", Xtczybm, 1) Then
  704.                 Exit Sub
  705.             End If
  706.             ItemType = "C"                      '票据变动的票据大类型
  707.             PZ_FrmNoteChList.HelpContextID = 30605
  708.             PZ_FrmNoteChList.Show
  709.             PZ_FrmNoteChFilter.HelpContextID = 30605
  710.             PZ_FrmNoteChFilter.Show 1
  711.         Case "Ap_CancelVouch"                   '核销制凭证
  712.             If Not Security_Log("Ar_CancelVouch", Xtczybm, 1) Then
  713.                 Exit Sub
  714.             End If
  715.             ItemType = "A2"                     '应付冲应收
  716.             PZ_FrmCancelList.HelpContextID = 30606
  717.             PZ_FrmCancelList.Show
  718.             PZ_FrmCancelFilter.HelpContextID = 30606
  719.             PZ_FrmCancelFilter.Show 1
  720.         
  721.         '**************月末结帐**************
  722.         Case "Ap_EOMMana"                       '月末结帐
  723.             If Not Security_Log("Ap_EOMMana", Xtczybm, 1) Then
  724.                 Exit Sub
  725.             End If
  726.             RP_FrmYmjz.HelpContextID = 30801
  727.             RP_FrmYmjz.Show 1
  728.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  729.         '***************工具****************
  730.         Case "Ap_gnbmkjrl"                      '会计日历
  731.             XT_kjrlFrm.HelpContextID = 30902
  732.             XT_kjrlFrm.Show 1
  733.         Case "Ap_gnbmjsq"                       '计算器
  734.             Shell "calc.exe", vbNormalFocus
  735.         
  736.         '***************帮助****************
  737.         Case "Ap_xtbz"                         '系统帮助
  738.             Call F1bz
  739.         Case "Ap_gy"                           '关于
  740.             XT_frmAbout.Show
  741.         
  742.     End Select
  743.     
  744.     Exit Sub
  745. Cwcl:
  746.     Tsxx = "此项系统功能有待完善!"
  747.     Call Xtxxts(Tsxx, 0, 4)
  748.     Exit Sub
  749. End Sub
  750. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  751.   
  752.     If Unload_TF = False Then
  753.         Cancel = 1
  754.         Me.WindowState = 1
  755.     End If
  756. End Sub
  757. Private Sub Form_Load()
  758.     
  759.     '设置窗体图标
  760.     Me.Icon = XT_Main.Icon
  761.     
  762.     '设置窗体位置大小,并调入系统功能树
  763.     Me.Left = 0
  764.     Me.Top = 0
  765.     Me.Width = XT_Main.Width - 60
  766.     Me.Height = XT_Main.Height - 760 - 690
  767.     Call Cshgns
  768.     
  769.     '启动调入数据等待提示
  770.     Load Xt_Wait
  771.     
  772. End Sub
  773. Private Sub Form_Unload(Cancel As Integer)
  774.     
  775.     On Error Resume Next
  776.     
  777.     Dim i As Integer
  778.     For i = Forms.Count - 1 To 1 Step -1
  779.         Unload Forms(i)
  780.     Next
  781.     If Me.WindowState <> vbMinimized Then
  782.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  783.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  784.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  785.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  786.     End If
  787.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  788. End Sub
  789. Private Sub Form_Resize()
  790.     
  791.     On Error Resume Next
  792.     If Me.Width < 3000 Then Me.Width = 3000
  793.     SizeControls imgSplitter.Left
  794. End Sub
  795. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  796.     
  797.     With imgSplitter
  798.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  799.     End With
  800.     picSplitter.Visible = True
  801.     mbMoving = True
  802. End Sub
  803. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  804.     
  805.     Dim sglPos As Single
  806.     If mbMoving Then
  807.         sglPos = x + imgSplitter.Left
  808.         If sglPos < sglSplitLimit Then
  809.             picSplitter.Left = sglSplitLimit
  810.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  811.             picSplitter.Left = Me.Width - sglSplitLimit
  812.         Else
  813.             picSplitter.Left = sglPos
  814.         End If
  815.     End If
  816. End Sub
  817. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  818.     
  819.     SizeControls picSplitter.Left
  820.     picSplitter.Visible = False
  821.     mbMoving = False
  822.     lvListView.Refresh
  823. End Sub
  824. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  825.     
  826.     If Source = imgSplitter Then
  827.         SizeControls x
  828.     End If
  829. End Sub
  830. Sub SizeControls(x As Single)
  831.     
  832.     On Error Resume Next
  833.     '设置 Width 属性
  834.     If x < 3500 Then x = 3500
  835.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  836.     tvTreeView.Width = x
  837.     imgSplitter.Left = x
  838.     lvListView.Left = x + 40
  839.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  840.     lblTitle(0).Width = tvTreeView.Width
  841.     lblTitle(1).Left = lvListView.Left + 20
  842.     lblTitle(1).Width = lvListView.Width - 40
  843.     '设置 Top 属性
  844.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  845.     lvListView.Top = tvTreeView.Top
  846.     '设置 height 属性
  847.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  848.     
  849.     lvListView.Height = tvTreeView.Height
  850.     imgSplitter.Top = tvTreeView.Top
  851.     imgSplitter.Height = tvTreeView.Height
  852. End Sub
  853. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  854.     
  855.     On Error Resume Next
  856.     
  857.     Select Case Button.Key
  858.         Case "返回"
  859.             tvTreeView.SetFocus
  860.               SendKeys "{up}", True
  861.         Case "向前"
  862.              tvTreeView.SetFocus
  863.               SendKeys "{DOWN}", True
  864.         Case "大图标"
  865.             lvListView.View = lvwIcon
  866.         Case "小图标"
  867.             lvListView.View = lvwSmallIcon
  868.         Case "列表"
  869.             lvListView.View = lvwList
  870.         Case "详细资料"
  871.             lvListView.View = lvwReport
  872.     End Select
  873. End Sub