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

企业管理

开发平台:

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