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

企业管理

开发平台:

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.       BeginProperty Font 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   400
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   4800
  30.       Left            =   4740
  31.       ScaleHeight     =   2090.126
  32.       ScaleMode       =   0  'User
  33.       ScaleWidth      =   780
  34.       TabIndex        =   0
  35.       Top             =   780
  36.       Visible         =   0   'False
  37.       Width           =   72
  38.    End
  39.    Begin MSComctlLib.ImageList ImageList1 
  40.       Left            =   5220
  41.       Top             =   2340
  42.       _ExtentX        =   1005
  43.       _ExtentY        =   1005
  44.       BackColor       =   -2147483643
  45.       ImageWidth      =   16
  46.       ImageHeight     =   16
  47.       MaskColor       =   12632256
  48.       _Version        =   393216
  49.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  50.          NumListImages   =   5
  51.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.             Picture         =   "系统_主操作桌面.frx":08CA
  53.             Key             =   "stb"
  54.          EndProperty
  55.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "系统_主操作桌面.frx":191C
  57.             Key             =   "xttb"
  58.          EndProperty
  59.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "系统_主操作桌面.frx":296E
  61.             Key             =   "szk"
  62.          EndProperty
  63.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "系统_主操作桌面.frx":2D08
  65.             Key             =   "kpgl"
  66.          EndProperty
  67.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "系统_主操作桌面.frx":3D5A
  69.             Key             =   "gnqx"
  70.          EndProperty
  71.       EndProperty
  72.    End
  73.    Begin MSComctlLib.ListView lvListView 
  74.       Height          =   3375
  75.       Left            =   2160
  76.       TabIndex        =   5
  77.       Top             =   705
  78.       Width           =   2295
  79.       _ExtentX        =   4048
  80.       _ExtentY        =   5953
  81.       Arrange         =   2
  82.       LabelEdit       =   1
  83.       LabelWrap       =   -1  'True
  84.       HideSelection   =   -1  'True
  85.       OLEDragMode     =   1
  86.       OLEDropMode     =   1
  87.       PictureAlignment=   1
  88.       _Version        =   393217
  89.       Icons           =   "ImageList2"
  90.       SmallIcons      =   "ImageList1"
  91.       ColHdrIcons     =   "ImageList1"
  92.       ForeColor       =   -2147483640
  93.       BackColor       =   -2147483643
  94.       BorderStyle     =   1
  95.       Appearance      =   1
  96.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  97.          Name            =   "宋体"
  98.          Size            =   9
  99.          Charset         =   134
  100.          Weight          =   400
  101.          Underline       =   0   'False
  102.          Italic          =   0   'False
  103.          Strikethrough   =   0   'False
  104.       EndProperty
  105.       OLEDragMode     =   1
  106.       OLEDropMode     =   1
  107.       NumItems        =   0
  108.    End
  109.    Begin VB.PictureBox picTitles 
  110.       Align           =   1  'Align Top
  111.       Appearance      =   0  'Flat
  112.       BorderStyle     =   0  'None
  113.       BeginProperty Font 
  114.          Name            =   "MS Sans Serif"
  115.          Size            =   8.25
  116.          Charset         =   0
  117.          Weight          =   400
  118.          Underline       =   0   'False
  119.          Italic          =   0   'False
  120.          Strikethrough   =   0   'False
  121.       EndProperty
  122.       ForeColor       =   &H80000008&
  123.       Height          =   300
  124.       Left            =   0
  125.       ScaleHeight     =   300
  126.       ScaleWidth      =   9240
  127.       TabIndex        =   1
  128.       TabStop         =   0   'False
  129.       Top             =   420
  130.       Width           =   9240
  131.       Begin VB.Label lblTitle 
  132.          BorderStyle     =   1  'Fixed Single
  133.          Caption         =   "百利/ERP5.0"
  134.          Height          =   270
  135.          Index           =   0
  136.          Left            =   0
  137.          TabIndex        =   3
  138.          Tag             =   " 树形视图:"
  139.          Top             =   12
  140.          Width           =   2016
  141.       End
  142.       Begin VB.Label lblTitle 
  143.          BorderStyle     =   1  'Fixed Single
  144.          Caption         =   " 列表视图:"
  145.          Height          =   270
  146.          Index           =   1
  147.          Left            =   2078
  148.          TabIndex        =   2
  149.          Tag             =   " 列表视图:"
  150.          Top             =   12
  151.          Width           =   3216
  152.       End
  153.    End
  154.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  155.       Left            =   3360
  156.       Top             =   2160
  157.       _ExtentX        =   847
  158.       _ExtentY        =   847
  159.       _Version        =   393216
  160.    End
  161.    Begin MSComctlLib.TreeView tvTreeView 
  162.       Height          =   4800
  163.       Left            =   0
  164.       TabIndex        =   4
  165.       Top             =   705
  166.       Width           =   2010
  167.       _ExtentX        =   3545
  168.       _ExtentY        =   8467
  169.       _Version        =   393217
  170.       Indentation     =   564
  171.       LabelEdit       =   1
  172.       Style           =   7
  173.       ImageList       =   "ImageList1"
  174.       Appearance      =   1
  175.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  176.          Name            =   "宋体"
  177.          Size            =   9
  178.          Charset         =   134
  179.          Weight          =   400
  180.          Underline       =   0   'False
  181.          Italic          =   0   'False
  182.          Strikethrough   =   0   'False
  183.       EndProperty
  184.    End
  185.    Begin MSComctlLib.Toolbar tbToolBar 
  186.       Align           =   1  'Align Top
  187.       Height          =   420
  188.       Left            =   0
  189.       TabIndex        =   6
  190.       Top             =   0
  191.       Width           =   9240
  192.       _ExtentX        =   16298
  193.       _ExtentY        =   741
  194.       ButtonWidth     =   609
  195.       ButtonHeight    =   582
  196.       AllowCustomize  =   0   'False
  197.       Appearance      =   1
  198.       ImageList       =   "imlToolbarIcons"
  199.       _Version        =   393216
  200.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  201.          NumButtons      =   10
  202.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  203.             Style           =   3
  204.          EndProperty
  205.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  206.             Key             =   "返回"
  207.             Object.ToolTipText     =   "返回"
  208.             ImageKey        =   "xq"
  209.          EndProperty
  210.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  211.             Key             =   "向前"
  212.             Object.ToolTipText     =   "向前"
  213.             ImageKey        =   "xh"
  214.          EndProperty
  215.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  216.             Style           =   3
  217.          EndProperty
  218.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  219.             Style           =   3
  220.          EndProperty
  221.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  222.             Style           =   3
  223.          EndProperty
  224.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  225.             Key             =   "大图标"
  226.             Object.ToolTipText     =   "大图标"
  227.             ImageKey        =   "dtb"
  228.             Style           =   2
  229.             Value           =   1
  230.          EndProperty
  231.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  232.             Key             =   "小图标"
  233.             Object.ToolTipText     =   "小图标"
  234.             ImageKey        =   "xtb"
  235.             Style           =   2
  236.          EndProperty
  237.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  238.             Key             =   "列表"
  239.             Object.ToolTipText     =   "列表"
  240.             ImageKey        =   "lb"
  241.             Style           =   2
  242.          EndProperty
  243.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  244.             Key             =   "详细资料"
  245.             Object.ToolTipText     =   "详细资料"
  246.             ImageKey        =   "xxzl"
  247.             Style           =   2
  248.          EndProperty
  249.       EndProperty
  250.    End
  251.    Begin MSComctlLib.ImageList imlToolbarIcons 
  252.       Left            =   4710
  253.       Top             =   840
  254.       _ExtentX        =   1005
  255.       _ExtentY        =   1005
  256.       BackColor       =   -2147483643
  257.       ImageWidth      =   16
  258.       ImageHeight     =   16
  259.       MaskColor       =   12632256
  260.       _Version        =   393216
  261.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  262.          NumListImages   =   6
  263.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  264.             Picture         =   "系统_主操作桌面.frx":40F4
  265.             Key             =   "xq"
  266.          EndProperty
  267.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.             Picture         =   "系统_主操作桌面.frx":448E
  269.             Key             =   "xh"
  270.          EndProperty
  271.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  272.             Picture         =   "系统_主操作桌面.frx":4828
  273.             Key             =   "dtb"
  274.          EndProperty
  275.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  276.             Picture         =   "系统_主操作桌面.frx":4BC2
  277.             Key             =   "xtb"
  278.          EndProperty
  279.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  280.             Picture         =   "系统_主操作桌面.frx":4F5C
  281.             Key             =   "lb"
  282.          EndProperty
  283.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  284.             Picture         =   "系统_主操作桌面.frx":52F6
  285.             Key             =   "xxzl"
  286.          EndProperty
  287.       EndProperty
  288.    End
  289.    Begin MSComctlLib.ImageList ImageList2 
  290.       Left            =   6210
  291.       Top             =   2370
  292.       _ExtentX        =   1005
  293.       _ExtentY        =   1005
  294.       BackColor       =   -2147483643
  295.       ImageWidth      =   32
  296.       ImageHeight     =   32
  297.       MaskColor       =   12632256
  298.       _Version        =   393216
  299.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  300.          NumListImages   =   3
  301.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  302.             Picture         =   "系统_主操作桌面.frx":5690
  303.             Key             =   ""
  304.          EndProperty
  305.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  306.             Picture         =   "系统_主操作桌面.frx":59B0
  307.             Key             =   "y"
  308.          EndProperty
  309.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  310.             Picture         =   "系统_主操作桌面.frx":668A
  311.             Key             =   "i"
  312.          EndProperty
  313.       EndProperty
  314.    End
  315.    Begin VB.Image imgSplitter 
  316.       Height          =   4785
  317.       Left            =   4230
  318.       MousePointer    =   9  'Size W E
  319.       Top             =   750
  320.       Width           =   150
  321.    End
  322. End
  323. Attribute VB_Name = "Xt_Control"
  324. Attribute VB_GlobalNameSpace = False
  325. Attribute VB_Creatable = False
  326. Attribute VB_PredeclaredId = True
  327. Attribute VB_Exposed = False
  328. '***********************************************
  329. '*    模 块 名 称 :系统主操作桌面
  330. '*    功 能 描 述 :
  331. '*    程序员姓名  :张建忠
  332. '*    最后修改人  :张建忠
  333. '*    最后修改时间:2001/06/21
  334. '*    备        注:封版
  335. '***********************************************
  336. Const NAME_COLUMN = 0
  337. Const TYPE_COLUMN = 1
  338. Const SIZE_COLUMN = 2
  339. Const DATE_COLUMN = 3
  340. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  341.   
  342. Dim mbMoving As Boolean
  343. Const sglSplitLimit = 1000
  344. Dim nodX As Node
  345. Dim mitem As ListItem
  346. Dim sjgnbmStr As String                      '上级编码
  347. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  348. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  349. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  350. Dim Tsxx As String                           '系统提示信息
  351. Dim gnsyte As String                         '系统功能项索引
  352. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  353. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  354. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  355.     If lvListView.ListItems.count > 0 Then
  356.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  357.         If Not Xtgnbrec.EOF Then
  358.             If Xtgnbrec.Fields("mjbz") = True Then
  359.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  360.                 Call Zxxymk(gnsyte)
  361.             Else
  362.                 '---------------
  363.                 Dim Ssql As String
  364.                 sjgnbmStr = ""
  365.                 lvListView.ColumnHeaders.Clear
  366.                 lvListView.ListItems.Clear
  367.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  368.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  369.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  370.                 Do While Not Xtgnbrec.EOF
  371.                     Set mitem = lvListView.ListItems.Add()
  372.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  373.                     If Xtgnbrec.Fields("mjbz") Then
  374.                         mitem.SmallIcon = "gnqx"
  375.                         mitem.Icon = "y"
  376.                     Else
  377.                         mitem.Icon = "i"
  378.                         mitem.SmallIcon = "stb"
  379.                     End If
  380.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  381.                     Xtgnbrec.MoveNext
  382.                 Loop
  383.                 '---------------
  384.             End If
  385.         End If
  386.     End If
  387. End Sub
  388. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  389.     If KeyAscii = vbKeyReturn Then
  390.         Call lvListView_DblClick
  391.     End If
  392. End Sub
  393. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  394.     Dim Ssql As String
  395.     If Node.Tag <> "" Then
  396.         If Node.Tag = False Then
  397.             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"
  398.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  399.                 Exit Sub
  400.             Else
  401.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  402.             End If
  403.         Else
  404.             Ssql = "SELECT * FROM xt_xtgnb a," _
  405.                     & "(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"
  406.         End If
  407.         
  408.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  409.         If Node.Tag = True Then
  410.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  411.                 Exit Sub
  412.             Else
  413.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  414.             End If
  415.         End If
  416.         lvListView.ColumnHeaders.Clear
  417.         lvListView.ListItems.Clear
  418.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  419.         Do While Not Xtgnbrec.EOF
  420.             Set mitem = lvListView.ListItems.Add()
  421.             mitem.Text = Trim(Xtgnbrec!gnmc)
  422.             If Xtgnbrec.Fields("mjbz") Then
  423.                 mitem.SmallIcon = "gnqx"
  424.                 mitem.Icon = "y"
  425.             Else
  426.                 mitem.Icon = "i"
  427.                 mitem.SmallIcon = "stb"
  428.             End If
  429.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  430.             Xtgnbrec.MoveNext
  431.         Loop
  432.     End If
  433. End Sub
  434. Public Sub Cshgns()                                                    '初始化系统功能树
  435.   
  436.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '11%' and MenuList=1 order by gnbm")
  437.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  438.     With Xtgnbrec
  439.         Do While Not .EOF
  440.             If .Fields("mjbz") Then
  441.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  442.             Else
  443.                 If Trim(.Fields("sjgnbm")) = "" Then
  444.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  445.                 Else
  446.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  447.                 End If
  448.             End If
  449.             nodX.Tag = Xtgnbrec!mjbz
  450.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  451.                 nodX.EnsureVisible
  452.             End If
  453.             .MoveNext
  454.         Loop
  455.     End With
  456. End Sub
  457. '系统功能树操作
  458. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  459.   Cancel = 1
  460. End Sub
  461. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  462.     
  463.     If Node.Index <> 1 And Node.Key <> "T11" Then
  464.         Node.Image = "stb"
  465.     End If
  466.  
  467. End Sub
  468. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  469.     
  470.     If Node.Index <> 1 And Node.Key <> "T11" Then
  471.         Node.Image = "szk"
  472.     End If
  473. End Sub
  474. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  475.     
  476.     If KeyAscii = vbKeyReturn Then
  477.         Call tvTreeView_DblClick
  478.     End If
  479. End Sub
  480. Private Sub tvTreeView_DblClick()                                             '选择功能
  481.     
  482.     If tvTreeView.SelectedItem.Children = 0 Then
  483.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  484.         If Not Xtgnbrec.EOF Then
  485.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  486.             Call Zxxymk(gnsyte)
  487.         End If
  488.     End If
  489. End Sub
  490. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  491.   
  492.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  493.     Dim Sqlstr As String                   '临时查询字符串
  494.   
  495.     If Len(Trim(gnsy)) = 0 Then
  496.         Exit Sub
  497.     End If
  498.     
  499.     
  500.     On Error GoTo Cwcl:
  501.     Select Case gnsy
  502.         
  503.         Case "Cg_wlsort"                        '采购物料分类设置
  504.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  505.             If Not Security_Log("Cg_wlsort", Xtczybm, 1) Then
  506.                 Exit Sub
  507.             End If
  508.             Cg_CgwlflSet.Show 1
  509.         Case "Cg_PurTypeSet"                    '采购类型设置
  510.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  511.             If Not Security_Log("Cg_PurTypeSet", Xtczybm, 1) Then
  512.                 Exit Sub
  513.             End If
  514.             Cg_PurTypeSet.Show 1
  515.         Case "Cg_ordertype"                     '订单类型设置
  516.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  517.             If Not Security_Log("Cg_ordertype", Xtczybm, 1) Then
  518.                 Exit Sub
  519.             End If
  520.             Cg_OrderTypeSet.Show 1
  521.         Case "Cg_Invoicetype"                   '发票类型设置
  522.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  523.             If Not Security_Log("Cg_Invoicetype", Xtczybm, 1) Then
  524.                 Exit Sub
  525.             End If
  526.             Cg_InvoiceTypeSet.Show 1
  527.         Case "Cg_Supplier"                      '供应商
  528.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  529.             If Not Security_Log("Cg_Supplier", Xtczybm, 1) Then
  530.                 Exit Sub
  531.             End If
  532.             
  533.             Gy_Supplier.Show
  534.             Gy_SupplierQuery.Show 1
  535.         Case "Cg_Material"                      '物料档案
  536.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  537.             If Not Security_Log("Cg_Material", Xtczybm, 1) Then
  538.                 Exit Sub
  539.             End If
  540.             Gy_Material.Show
  541.             Gy_MaterialQuery.Show 1
  542.             
  543.         Case "Cg_SupplierSort"                  '供应商分类设置
  544.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  545.             If Not Security_Log("Cg_SupplierSort", Xtczybm, 1) Then
  546.                 Exit Sub
  547.             End If
  548.             
  549.             With Gy_BaseSortSet
  550.                 XtReportCode = "Gy_SupplierSort"
  551.                 .ReportTitle = "供应商分类设置"
  552.                 
  553.                 .TextGroupCode = "Gy_SupplierSort"
  554.                 .GridCode = "Gy_SupplierSort"
  555.                 .CodSchemeIndex = "Gy_SupplierSort"
  556.                 
  557.                 .str_TableName = "Gy_SupplierSort"
  558.                 .str_SortCode = "SupplierSortCode"
  559.                 .str_SortName = "SupplierSortName"
  560.                 .str_Label = "供应商分类"
  561.                 .Caption = "供应商分类设置"
  562.                 .HelpContextID = "1101009"
  563.                 .Show 1
  564.             End With
  565.             
  566.         Case "Cg_areasort"                       '供应商地区分类设置
  567.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  568.             If Not Security_Log("Cg_areasort", Xtczybm, 1) Then
  569.                 Exit Sub
  570.             End If
  571.             
  572.             With Gy_BaseSortSet
  573.                 XtReportCode = "Cg_AreaSet"
  574.                 .ReportTitle = "供应商地区分类设置"
  575.                 
  576.                 .TextGroupCode = "Cg_AreaSet"
  577.                 .GridCode = "gy_AreaSet"
  578.                 .CodSchemeIndex = "Cg_AreaSet"
  579.                 .str_TableName = "Cg_AreaSet"
  580.                 .str_SortCode = "AreaCode"
  581.                 .str_SortName = "AreaName"
  582.                 .str_Label = "供应商地区分类"
  583.                 .Caption = "供应商地区分类设置"
  584.                 .HelpContextID = "1101001"
  585.                 .Show 1
  586.             End With
  587.         Case "Cg_Tradesort"                      '供应商行业分类设置
  588.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  589.             If Not Security_Log("Cg_Tradesort", Xtczybm, 1) Then
  590.                 Exit Sub
  591.             End If
  592.             
  593.             With Gy_BaseSortSet
  594.                 XtReportCode = "Cg_TradeSet"
  595.                 .ReportTitle = "供应商行业分类设置"
  596.                 
  597.                 .TextGroupCode = "Cg_TradeSet"
  598.                 .GridCode = "gy_TradeSet"
  599.                 .CodSchemeIndex = "Cg_TradeSet"
  600.                 .str_TableName = "Cg_TradeSet"
  601.                 .str_SortCode = "TradeCode"
  602.                 .str_SortName = "TradeName"
  603.                 .str_Label = "供应商行业分类"
  604.                 .Caption = "供应商行业分类设置"
  605.                 .HelpContextID = "1101002"
  606.                 .Show 1
  607.             End With
  608.             
  609.         Case "Cg_account"                       '期初结账
  610.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  611.             If Not Security_Log("Cg_account", Xtczybm, 1) Then
  612.                 Exit Sub
  613.             End If
  614.             Call Cg_Startaccount(1)
  615.         Case "Cg_cancelaccount"                 '回复期初结账
  616.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  617.             If Not Security_Log("Cg_cancelaccount", Xtczybm, 3) Then
  618.                 Exit Sub
  619.             End If
  620.             Call Cg_Startaccount(0)
  621.         Case "Cg_planinput"                     '采购计划录入
  622.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  623.             If Not Security_Log("Cg_planinput_edit", Xtczybm, 1) Then
  624.                 Exit Sub
  625.             End If
  626.             Xtcdcs = "1"
  627.             Cg_planinput.Show 1
  628.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  629.         Case "Cg_planch"                        '采购计划拆合
  630.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  631.             If Not Security_Log("Cg_planch", Xtczybm, 1) Then
  632.                 Exit Sub
  633.             End If
  634.             Cg_PlanUnitSplit.Show
  635.             Cg_PlanUnitSplitQuery.Show 1
  636.         Case "Cg_planlist"                      '采购计划列表
  637.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  638.             If Not Security_Log("Cg_planlist", Xtczybm, 1) Then
  639.                 Exit Sub
  640.             End If
  641.             Cg_planlist.Show
  642.             Cg_PlanListQuery.Show 1
  643.         Case "Cg_scxqcx"                        '采购计划(MRP生成)查询
  644.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  645.             If Not Security_Log("Cg_scxqcx", Xtczybm, 1) Then
  646.                 Exit Sub
  647.             End If
  648.             Cg_ScxqList.Show
  649.             Cg_ScxqListQuery.Show 1
  650.         Case "Cg_zjys"                          '采购资金预算
  651.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  652.             If Not Security_Log("Cg_zjys", Xtczybm, 1) Then
  653.                 Exit Sub
  654.             End If
  655.             Cg_FundCmptList.Show
  656.             Cg_FundCmptListQuery.Show 1
  657.         Case "Cg_hzgl"                          '采购计划执行情况—汇总(关联)
  658.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  659.             If Not Security_Log("Cg_hzgl", Xtczybm, 1) Then
  660.                 Exit Sub
  661.             End If
  662.             Cg_PurPlanExecThingSum.Show
  663.             Int_PlanQueryType = 1
  664.             Cg_PlanExecThingQuery.Show 1
  665.         Case "Cg_mxgl"                          '采购计划执行情况—明细(关联)
  666.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  667.             If Not Security_Log("Cg_mxgl", Xtczybm, 1) Then
  668.                 Exit Sub
  669.             End If
  670.             Cg_PurPlanExecThing.Show
  671.             Int_PlanQueryType = 2
  672.             Cg_PlanExecThingQuery.Show 1
  673.         Case "Cg_hzcx"                          '采购计划执行情况汇总
  674.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  675.             If Not Security_Log("Cg_hzcx", Xtczybm, 1) Then
  676.                 Exit Sub
  677.             End If
  678.             Cg_PurPlanExecTotal.Show
  679.             Cg_PlanExecTotalQuery.Show 1
  680.         Case "Cg_qkfk"                          '采购情况反馈单
  681.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  682.             If Not Security_Log("Cg_qkfk", Xtczybm, 1) Then
  683.                 Exit Sub
  684.             End If
  685.             Cg_PlanFeedback.Show 1
  686.         Case "Cg_xjlr"                          '采购询价单录入
  687.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  688.             If Not Security_Log("Cg_xjlr_edit", Xtczybm, 1) Then
  689.                 Exit Sub
  690.             End If
  691.             Xtcdcs = 1
  692.             Cg_AskPriceInput.Show 1
  693.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  694.         Case "Cg_xjlb"                          '询价单列表
  695.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  696.             If Not Security_Log("Cg_xjlb", Xtczybm, 1) Then
  697.                 Exit Sub
  698.             End If
  699.             Cg_AskPriceList.Show
  700.             Cg_AskPriceListQuery.Show 1
  701.         Case "Cg_bjfx"                          '采购比价分析
  702.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  703.             If Not Security_Log("Cg_bjfx", Xtczybm, 1) Then
  704.                 Exit Sub
  705.             End If
  706.             Cg_CmpPriceList.Show
  707.             Cg_CmpPriceListQuery.Show 1
  708.         Case "Cg_orderinput"                    '订单录入
  709.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  710.             If Not Security_Log("Cg_orderinput_edit", Xtczybm, 1) Then
  711.                 Exit Sub
  712.             End If
  713.             Xtcdcs = "1"
  714.             Cg_orderinput.Show 1
  715.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  716.         Case "Cg_orderlist"                     '订单列表
  717.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  718.             If Not Security_Log("Cg_orderlist", Xtczybm, 1) Then
  719.                 Exit Sub
  720.             End If
  721.             Cg_orderlist.Show
  722.             Cg_OrderListQuery.Show 1
  723.         Case "Cg_orderhzcx"                     '采购订单执行情况汇总
  724.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  725.             If Not Security_Log("Cg_orderhzcx", Xtczybm, 1) Then
  726.                 Exit Sub
  727.             End If
  728.             Cg_OrderExecTotal.Show
  729.             Cg_OrderExecTotalQuery.Show 1
  730.         Case "Cg_ordermxcx"                     '采购订单执行情况明细
  731.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  732.             If Not Security_Log("Cg_ordermxcx", Xtczybm, 1) Then
  733.                 Exit Sub
  734.             End If
  735.             Cg_OrderExecThing.Show
  736.             Cg_OrderExecThingQuery.Show 1
  737.         Case "Cg_sllr"                          '收料通知单
  738.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  739.             If Not Security_Log("Cg_sllr_edit", Xtczybm, 1) Then
  740.                 Exit Sub
  741.             End If
  742.             Xtcdcs = "1"
  743.             Cg_GoodsInput.Show 1
  744.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  745.         Case "Cg_xllb"                           '收料通知单列表
  746.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  747.             If Not Security_Log("Cg_xllb", Xtczybm, 1) Then
  748.                 Exit Sub
  749.             End If
  750.             Cg_GoodsInputList.Show
  751.             Cg_GoodsInputQuery.Show 1
  752.         Case "Cg_thlr"                          '退货通知单
  753.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  754.             If Not Security_Log("Cg_thlr_edit", Xtczybm, 1) Then
  755.                 Exit Sub
  756.             End If
  757.             Xtcdcs = "1"
  758.             Cg_GoodsOutput.Show 1
  759.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  760.         Case "Cg_thlb"                           '退货通知单列表
  761.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  762.             If Not Security_Log("Cg_thlb", Xtczybm, 1) Then
  763.                 Exit Sub
  764.             End If
  765.             Cg_GoodsOutputList.Show
  766.             Cg_GoodsOutputQuery.Show 1
  767.         Case "Cg_spinvoice"                      '期初普通发票录入
  768.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  769.             If Not Security_Log("Cg_spinvoice_edit", Xtczybm, 1) Then
  770.                 Exit Sub
  771.             End If
  772.             If CG_StartAccountCheck = True Then
  773.                 
  774.                 Xtcdcs = "1"
  775.                 Cg_InvoiceBill.InvoiceType = 1
  776.                 Cg_InvoiceBill.Show 1
  777.                 Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  778.             End If
  779.         Case "Cg_szinvoice"                      '期初专用发票录入
  780.             If CG_StartAccountCheck = True Then
  781.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  782.                 If Not Security_Log("Cg_szinvoice_edit", Xtczybm, 1) Then
  783.                     Exit Sub
  784.                 End If
  785.                 Xtcdcs = "1"
  786.                 Cg_InvoiceBill.InvoiceType = 2
  787.                 Cg_InvoiceBill.Show 1
  788.                 Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  789.             End If
  790.         Case "Cg_pfpinput"                      '蓝字普通发票录入
  791.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  792.             If Not Security_Log("Cg_pfpinput_edit", Xtczybm, 1) Then
  793.                 Exit Sub
  794.             End If
  795.             Xtcdcs = "1"
  796.             Cg_InvoiceBill.InvoiceType = 3
  797.             Cg_InvoiceBill.Show 1
  798.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  799.         Case "Cg_hfpinput"                      '红字普通发票录入
  800.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  801.             If Not Security_Log("Cg_hfpinput_edit", Xtczybm, 1) Then
  802.                 Exit Sub
  803.             End If
  804.             Xtcdcs = "1"
  805.             Cg_InvoiceBill.InvoiceType = 5
  806.             Cg_InvoiceBill.Show 1
  807.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  808.         Case "Cg_zfpinput"                      '蓝字专用发票录入
  809.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  810.             If Not Security_Log("Cg_zfpinput_edit", Xtczybm, 1) Then
  811.                 Exit Sub
  812.             End If
  813.             Xtcdcs = "1"
  814.             Cg_InvoiceBill.InvoiceType = 4
  815.             Cg_InvoiceBill.Show 1
  816.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  817.         Case "Cg_hzfpinput"                      '红字专用发票录入
  818.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  819.             If Not Security_Log("Cg_hzfpinput_edit", Xtczybm, 1) Then
  820.                 Exit Sub
  821.             End If
  822.             Xtcdcs = "1"
  823.             Cg_InvoiceBill.InvoiceType = 6
  824.             Cg_InvoiceBill.Show 1
  825.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  826.         Case "Cg_spinvoicelist"                 ' 期初普通发票列表
  827.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  828.             If Not Security_Log("Cg_spinvoicelist", Xtczybm, 1) Then
  829.                 Exit Sub
  830.             End If
  831.             Cg_InvoiceQuery.InvoiceType = 1
  832.             Cg_InvoiceQCPT_List.Show
  833.             Cg_InvoiceQuery.Show 1
  834.         Case "Cg_szinvoicelist"                 '期初增值税发票列表
  835.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  836.             If Not Security_Log("Cg_szinvoicelist", Xtczybm, 1) Then
  837.                 Exit Sub
  838.             End If
  839.             Cg_InvoiceQuery.InvoiceType = 2
  840.            
  841.             Cg_InvoiceQCZy_List.Show
  842.             Cg_InvoiceQuery.Show 1
  843.         Case "Cg_pfplist"                       '普通发票列表
  844.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  845.             If Not Security_Log("Cg_pfplist", Xtczybm, 1) Then
  846.                 Exit Sub
  847.             End If
  848.             Cg_InvoiceQuery.InvoiceType = 3
  849.            
  850.             Cg_InvoicePt_list.Show
  851.             Cg_InvoiceQuery.Show 1
  852.         Case "Cg_zfplist"                       '增值税发票列表
  853.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  854.             If Not Security_Log("Cg_zfplist", Xtczybm, 1) Then
  855.                 Exit Sub
  856.             End If
  857.             Cg_InvoiceQuery.InvoiceType = 4
  858.           
  859.             Cg_InvoiceZy_List.Show
  860.             Cg_InvoiceQuery.Show 1
  861.         Case "Cg_slmxb"                         '采购收料明细表
  862.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  863.             If Not Security_Log("Cg_slmxb", Xtczybm, 1) Then
  864.                 Exit Sub
  865.             End If
  866.             Cg_PaymentList.Show
  867.             Cg_PaymentQuery.Show 1
  868.         Case "Cg_fpmxb"                         '采购发票明细表
  869.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  870.             If Not Security_Log("Cg_fpmxb", Xtczybm, 1) Then
  871.                 Exit Sub
  872.             End If
  873.             Cg_InvoiceDevList.Show
  874.             Cg_InvoiceDevQuery.Show 1
  875.         Case "Cg_zthwyeb"                       '在途余额表
  876.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  877.             If Not Security_Log("Cg_zthwyeb", Xtczybm, 1) Then
  878.                 Exit Sub
  879.             End If
  880.             Cg_OnRoadList.Show
  881.             Cg_OnRoadListQuery.Show 1
  882.         Case "Cg_sltjb"                         '采购收料统计表
  883.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  884.             If Not Security_Log("Cg_sltjb", Xtczybm, 1) Then
  885.                 Exit Sub
  886.             End If
  887.             Cg_ReceiptTotalList.Show
  888.             Cg_ReciptTotalQuery.Show 1
  889.         Case "Cg_fptjb"                         '采购发票统计表
  890.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  891.             If Not Security_Log("Cg_fptjb", Xtczybm, 1) Then
  892.                 Exit Sub
  893.             End If
  894.             Cg_InvoiceTotalList.Show
  895.             Cg_InvoiceTotalQuery.Show 1
  896.         Case "Cg_zttjb"                         '在途统计表
  897.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  898.             If Not Security_Log("Cg_zttjb", Xtczybm, 1) Then
  899.                 Exit Sub
  900.             End If
  901.             Cg_OnRoadTotalList.Show
  902.             Cg_OnRoadTotalQuery.Show 1
  903.         Case "Cg_zhtjfx"                        '综合统计分析
  904.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  905.             If Not Security_Log("Cg_zhtjfx", Xtczybm, 1) Then
  906.                 Exit Sub
  907.             End If
  908.             Cg_IntegrationList.Show
  909.             Cg_IntegrationQuery.Show 1
  910.         Case "Cg_ddwlfx"                        '订单物料分析
  911.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  912.             If Not Security_Log("Cg_ddwlfx", Xtczybm, 1) Then
  913.                 Exit Sub
  914.             End If
  915.             Cg_OrderAnalyseList.Show
  916.             Cg_OrderAnalyseQuery.Show 1
  917.         Case "Cg_gysjgdbfx"                     '供应商价格对比分析
  918.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  919.             If Not Security_Log("Cg_gysjgdbfx", Xtczybm, 1) Then
  920.                 Exit Sub
  921.             End If
  922.             Cg_SuppAnalyseList.Show
  923.             Cg_SuppAnalyseQuery.Show 1
  924.         Case "Cg_zjbzfx"                        '采购资金比重分析
  925.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  926.             If Not Security_Log("Cg_zjbzfx", Xtczybm, 1) Then
  927.                 Exit Sub
  928.             End If
  929.             Cg_FundAnalyseList.Show
  930.             Cg_FundAnalyseQuery.Show 1
  931.         Case "Cg_wljgdbfx"                      '物料价格对比分析
  932.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  933.             If Not Security_Log("Cg_wljgdbfx", Xtczybm, 1) Then
  934.                 Exit Sub
  935.             End If
  936.             Cg_PriceAnalyseList.Show
  937.             Cg_PriceAnalyseQuery.Show 1
  938.         Case "Cg_fyfx"                          '采购费用分析
  939.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  940.             If Not Security_Log("Cg_fyfx", Xtczybm, 1) Then
  941.                 Exit Sub
  942.             End If
  943.             Cg_ChargeAnalyseList.Show
  944.             Cg_ChargeAnalyseQuery.Show 1
  945.        
  946.         
  947.         Case "Cg_ymjz"                          '月末结帐
  948.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  949.             If Not Security_Log("Cg_ymjz", Xtczybm, 1) Then
  950.                 Exit Sub
  951.             End If
  952.             If Bln_IsStartChalk() Then
  953.                 Cg_account.Show 1
  954.             Else
  955.                 Tsxx = "期初尚未结帐,不能进行月末结帐!"
  956.                 Call Xtxxts(Tsxx, 0, 4)
  957.             End If
  958.         Case "Cg_jsq"                           '计算器
  959.             Shell App.Path & "calc.exe"
  960.         Case "Cg_kjrl"                          '会计日历
  961.             XT_kjrlFrm.Show
  962.         Case "Cg_syshelp"                       '系统帮助
  963.             Call F1bz
  964.         Case "Cg_about"                         '关于
  965.             XT_frmAbout.Show
  966.     End Select
  967.     
  968.     '用户退出时写上机日志
  969.    Security_Log gnsy, Xtczybm, 2, False
  970.    
  971.    
  972.     Exit Sub
  973. Cwcl:
  974.     Tsxx = "此项系统功能有待完善!"
  975.     Call Xtxxts(Tsxx, 0, 4)
  976.     Exit Sub
  977. End Sub
  978. Private Sub Cg_Startaccount(Cancel As Integer)  '采购期初结账
  979. Dim int_Answer As Integer
  980. On Error GoTo Err_Execute
  981.  If Cancel = 1 Then
  982.     If Cg_startCheck = False Then Exit Sub
  983.     If CG_StartAccountCheck = False Then Exit Sub
  984.     If Xtxxts("是否期初结账?", 1, 2) = vbYes Then
  985.         Me.MousePointer = 11
  986.         Cw_DataEnvi.DataConnect.Execute ("Cg_Sp_StartAccount " & "1," & Xtczy)
  987.         Me.MousePointer = 0
  988.         Call Xtxxts("期初结账完成!", 0, 4)
  989.     End If
  990.  Else
  991.     
  992.     If Cg_startCheck(True) = False Then Exit Sub
  993.     If CG_StartAccountCheck(True) = False Then Exit Sub
  994.     If Xtxxts("是否取消期初结账?", 1, 2) = vbYes Then
  995.         Me.MousePointer = 11
  996.         Cw_DataEnvi.DataConnect.Execute ("Cg_Sp_StartAccount ")
  997.         Me.MousePointer = 0
  998.         Call Xtxxts("取消期初结账完成!", 0, 4)
  999.     End If
  1000.  End If
  1001.  Exit Sub
  1002. Err_Execute:
  1003.         Tsxx = Err.Description
  1004.         Me.MousePointer = 0
  1005.         Call Xtxxts(Tsxx, 0, 4)
  1006.         Exit Sub
  1007. End Sub
  1008. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  1009.   
  1010.     If Unload_TF = False Then
  1011.         Cancel = 1
  1012.         Me.WindowState = 1
  1013.     End If
  1014. End Sub
  1015. Private Sub Form_Load()
  1016.     
  1017.     '设置窗体图标
  1018.     Me.Icon = XT_Main.Icon
  1019.     
  1020.     '设置窗体位置大小,并调入系统功能树
  1021.     Me.Left = 0
  1022.     Me.Top = 0
  1023.     Me.Width = XT_Main.Width - 60
  1024.     Me.Height = XT_Main.Height - 760 - 690
  1025.     Call Cshgns
  1026.     
  1027.     '启动调入数据等待提示
  1028.     Load Xt_Wait
  1029.     
  1030. End Sub
  1031. Private Sub Form_Unload(Cancel As Integer)
  1032.     
  1033.     On Error Resume Next
  1034.     
  1035.     Dim i As Integer
  1036.     For i = Forms.count - 1 To 1 Step -1
  1037.         Unload Forms(i)
  1038.     Next
  1039.     If Me.WindowState <> vbMinimized Then
  1040.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  1041.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  1042.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  1043.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  1044.     End If
  1045.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  1046. End Sub
  1047. Private Sub Form_Resize()
  1048.     
  1049.     On Error Resume Next
  1050.     If Me.Width < 3000 Then Me.Width = 3000
  1051.     SizeControls imgSplitter.Left
  1052. End Sub
  1053. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  1054.     
  1055.     With imgSplitter
  1056.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  1057.     End With
  1058.     picSplitter.Visible = True
  1059.     mbMoving = True
  1060. End Sub
  1061. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  1062.     
  1063.     Dim sglPos As Single
  1064.     If mbMoving Then
  1065.         sglPos = x + imgSplitter.Left
  1066.         If sglPos < sglSplitLimit Then
  1067.             picSplitter.Left = sglSplitLimit
  1068.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  1069.             picSplitter.Left = Me.Width - sglSplitLimit
  1070.         Else
  1071.             picSplitter.Left = sglPos
  1072.         End If
  1073.     End If
  1074. End Sub
  1075. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  1076.     
  1077.     SizeControls picSplitter.Left
  1078.     picSplitter.Visible = False
  1079.     mbMoving = False
  1080.     lvListView.Refresh
  1081. End Sub
  1082. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  1083.     
  1084.     If Source = imgSplitter Then
  1085.         SizeControls x
  1086.     End If
  1087. End Sub
  1088. Sub SizeControls(x As Single)
  1089.     
  1090.     On Error Resume Next
  1091.     '设置 Width 属性
  1092.     If x < 3500 Then x = 3500
  1093.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  1094.     tvTreeView.Width = x
  1095.     imgSplitter.Left = x
  1096.     lvListView.Left = x + 40
  1097.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  1098.     lblTitle(0).Width = tvTreeView.Width
  1099.     lblTitle(1).Left = lvListView.Left + 20
  1100.     lblTitle(1).Width = lvListView.Width - 40
  1101.     '设置 Top 属性
  1102.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  1103.     lvListView.Top = tvTreeView.Top
  1104.     '设置 height 属性
  1105.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  1106.     
  1107.     lvListView.Height = tvTreeView.Height
  1108.     imgSplitter.Top = tvTreeView.Top
  1109.     imgSplitter.Height = tvTreeView.Height
  1110. End Sub
  1111. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1112.     
  1113.     On Error Resume Next
  1114.     
  1115.     Select Case Button.Key
  1116.         Case "返回"
  1117.             tvTreeView.SetFocus
  1118.               SendKeys "{up}", True
  1119.         Case "向前"
  1120.              tvTreeView.SetFocus
  1121.               SendKeys "{DOWN}", True
  1122.         Case "大图标"
  1123.             lvListView.View = lvwIcon
  1124.         Case "小图标"
  1125.             lvListView.View = lvwSmallIcon
  1126.         Case "列表"
  1127.             lvListView.View = lvwList
  1128.         Case "详细资料"
  1129.             lvListView.View = lvwReport
  1130.     End Select
  1131. End Sub