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

企业管理

开发平台:

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     =   8880
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   8880
  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":1042
  53.             Key             =   "stb"
  54.          EndProperty
  55.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "系统_主操作桌面.frx":2094
  57.             Key             =   "xttb"
  58.          EndProperty
  59.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "系统_主操作桌面.frx":30E6
  61.             Key             =   "szk"
  62.          EndProperty
  63.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "系统_主操作桌面.frx":3480
  65.             Key             =   "gnqx"
  66.          EndProperty
  67.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "系统_主操作桌面.frx":381A
  69.             Key             =   "kpgl"
  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.       LabelWrap       =   -1  'True
  83.       HideSelection   =   -1  'True
  84.       OLEDragMode     =   1
  85.       OLEDropMode     =   1
  86.       PictureAlignment=   1
  87.       _Version        =   393217
  88.       Icons           =   "ImageList2"
  89.       SmallIcons      =   "ImageList1"
  90.       ColHdrIcons     =   "ImageList1"
  91.       ForeColor       =   -2147483640
  92.       BackColor       =   -2147483643
  93.       BorderStyle     =   1
  94.       Appearance      =   1
  95.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  96.          Name            =   "宋体"
  97.          Size            =   9
  98.          Charset         =   134
  99.          Weight          =   400
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       OLEDragMode     =   1
  105.       OLEDropMode     =   1
  106.       NumItems        =   0
  107.    End
  108.    Begin VB.PictureBox picTitles 
  109.       Align           =   1  'Align Top
  110.       Appearance      =   0  'Flat
  111.       BorderStyle     =   0  'None
  112.       BeginProperty Font 
  113.          Name            =   "MS Sans Serif"
  114.          Size            =   8.25
  115.          Charset         =   0
  116.          Weight          =   400
  117.          Underline       =   0   'False
  118.          Italic          =   0   'False
  119.          Strikethrough   =   0   'False
  120.       EndProperty
  121.       ForeColor       =   &H80000008&
  122.       Height          =   300
  123.       Left            =   0
  124.       ScaleHeight     =   300
  125.       ScaleWidth      =   8880
  126.       TabIndex        =   1
  127.       TabStop         =   0   'False
  128.       Top             =   420
  129.       Width           =   8880
  130.       Begin VB.Label lblTitle 
  131.          BorderStyle     =   1  'Fixed Single
  132.          Caption         =   "百利/ERP5.0"
  133.          Height          =   270
  134.          Index           =   0
  135.          Left            =   0
  136.          TabIndex        =   3
  137.          Tag             =   " 树形视图:"
  138.          Top             =   12
  139.          Width           =   2016
  140.       End
  141.       Begin VB.Label lblTitle 
  142.          BorderStyle     =   1  'Fixed Single
  143.          Caption         =   " 列表视图:"
  144.          Height          =   270
  145.          Index           =   1
  146.          Left            =   2078
  147.          TabIndex        =   2
  148.          Tag             =   " 列表视图:"
  149.          Top             =   12
  150.          Width           =   3216
  151.       End
  152.    End
  153.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  154.       Left            =   3360
  155.       Top             =   2160
  156.       _ExtentX        =   847
  157.       _ExtentY        =   847
  158.       _Version        =   393216
  159.    End
  160.    Begin MSComctlLib.TreeView tvTreeView 
  161.       Height          =   4800
  162.       Left            =   0
  163.       TabIndex        =   4
  164.       Top             =   705
  165.       Width           =   2010
  166.       _ExtentX        =   3545
  167.       _ExtentY        =   8467
  168.       _Version        =   393217
  169.       Indentation     =   564
  170.       Style           =   7
  171.       ImageList       =   "ImageList1"
  172.       Appearance      =   1
  173.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  174.          Name            =   "宋体"
  175.          Size            =   9
  176.          Charset         =   134
  177.          Weight          =   400
  178.          Underline       =   0   'False
  179.          Italic          =   0   'False
  180.          Strikethrough   =   0   'False
  181.       EndProperty
  182.    End
  183.    Begin MSComctlLib.Toolbar tbToolBar 
  184.       Align           =   1  'Align Top
  185.       Height          =   420
  186.       Left            =   0
  187.       TabIndex        =   6
  188.       Top             =   0
  189.       Width           =   8880
  190.       _ExtentX        =   15663
  191.       _ExtentY        =   741
  192.       ButtonWidth     =   609
  193.       ButtonHeight    =   582
  194.       AllowCustomize  =   0   'False
  195.       Appearance      =   1
  196.       ImageList       =   "imlToolbarIcons"
  197.       _Version        =   393216
  198.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  199.          NumButtons      =   10
  200.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  201.             Style           =   3
  202.          EndProperty
  203.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  204.             Key             =   "返回"
  205.             Object.ToolTipText     =   "返回"
  206.             ImageKey        =   "xq"
  207.          EndProperty
  208.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  209.             Key             =   "向前"
  210.             Object.ToolTipText     =   "向前"
  211.             ImageKey        =   "xh"
  212.          EndProperty
  213.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  214.             Style           =   3
  215.          EndProperty
  216.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  217.             Style           =   3
  218.          EndProperty
  219.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  220.             Style           =   3
  221.          EndProperty
  222.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Key             =   "大图标"
  224.             Object.ToolTipText     =   "大图标"
  225.             ImageKey        =   "dtb"
  226.             Style           =   2
  227.             Value           =   1
  228.          EndProperty
  229.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  230.             Key             =   "小图标"
  231.             Object.ToolTipText     =   "小图标"
  232.             ImageKey        =   "xtb"
  233.             Style           =   2
  234.          EndProperty
  235.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  236.             Key             =   "列表"
  237.             Object.ToolTipText     =   "列表"
  238.             ImageKey        =   "lb"
  239.             Style           =   2
  240.          EndProperty
  241.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  242.             Key             =   "详细资料"
  243.             Object.ToolTipText     =   "详细资料"
  244.             ImageKey        =   "xxzl"
  245.             Style           =   2
  246.          EndProperty
  247.       EndProperty
  248.    End
  249.    Begin MSComctlLib.ImageList imlToolbarIcons 
  250.       Left            =   4710
  251.       Top             =   840
  252.       _ExtentX        =   1005
  253.       _ExtentY        =   1005
  254.       BackColor       =   -2147483643
  255.       ImageWidth      =   16
  256.       ImageHeight     =   16
  257.       MaskColor       =   12632256
  258.       _Version        =   393216
  259.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  260.          NumListImages   =   6
  261.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  262.             Picture         =   "系统_主操作桌面.frx":486C
  263.             Key             =   "xq"
  264.          EndProperty
  265.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  266.             Picture         =   "系统_主操作桌面.frx":4C06
  267.             Key             =   "xh"
  268.          EndProperty
  269.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  270.             Picture         =   "系统_主操作桌面.frx":4FA0
  271.             Key             =   "dtb"
  272.          EndProperty
  273.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  274.             Picture         =   "系统_主操作桌面.frx":533A
  275.             Key             =   "xtb"
  276.          EndProperty
  277.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  278.             Picture         =   "系统_主操作桌面.frx":56D4
  279.             Key             =   "lb"
  280.          EndProperty
  281.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  282.             Picture         =   "系统_主操作桌面.frx":5A6E
  283.             Key             =   "xxzl"
  284.          EndProperty
  285.       EndProperty
  286.    End
  287.    Begin MSComctlLib.ImageList ImageList2 
  288.       Left            =   6210
  289.       Top             =   2370
  290.       _ExtentX        =   1005
  291.       _ExtentY        =   1005
  292.       BackColor       =   -2147483643
  293.       ImageWidth      =   32
  294.       ImageHeight     =   32
  295.       MaskColor       =   12632256
  296.       _Version        =   393216
  297.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  298.          NumListImages   =   3
  299.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  300.             Picture         =   "系统_主操作桌面.frx":5E08
  301.             Key             =   ""
  302.          EndProperty
  303.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  304.             Picture         =   "系统_主操作桌面.frx":6128
  305.             Key             =   "y"
  306.          EndProperty
  307.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.             Picture         =   "系统_主操作桌面.frx":6E02
  309.             Key             =   "i"
  310.          EndProperty
  311.       EndProperty
  312.    End
  313.    Begin VB.Image imgSplitter 
  314.       Height          =   4785
  315.       Left            =   4230
  316.       MousePointer    =   9  'Size W E
  317.       Top             =   750
  318.       Width           =   150
  319.    End
  320. End
  321. Attribute VB_Name = "Xt_Control"
  322. Attribute VB_GlobalNameSpace = False
  323. Attribute VB_Creatable = False
  324. Attribute VB_PredeclaredId = True
  325. Attribute VB_Exposed = False
  326. '***********************************************
  327. '*    模 块 名 称 :系统主操作桌面
  328. '*    功 能 描 述 :
  329. '*    程序员姓名  :张建忠
  330. '*    最后修改人  :张晶石
  331. '*    最后修改时间:2002/01/03
  332. '*    备        注:封版
  333. '***********************************************
  334. Const NAME_COLUMN = 0
  335. Const TYPE_COLUMN = 1
  336. Const SIZE_COLUMN = 2
  337. Const DATE_COLUMN = 3
  338. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  339. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  340. Dim mbMoving As Boolean
  341. Const sglSplitLimit = 1000
  342. Dim nodX As Node
  343. Dim mitem As ListItem
  344. Dim sjgnbmStr As String                      '上级编码
  345. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  346. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  347. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  348. Dim Tsxx As String                           '系统提示信息
  349. Dim gnsyte As String                         '系统功能项索引
  350. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  351. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  352. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  353.     If lvListView.ListItems.Count > 0 Then
  354.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  355.         If Not Xtgnbrec.EOF Then
  356.             If Xtgnbrec.Fields("mjbz") = True Then
  357.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  358.                 Call Zxxymk(gnsyte)
  359.             Else
  360.                 '---------------
  361.                 Dim Ssql As String
  362.                 sjgnbmStr = ""
  363.                 lvListView.ColumnHeaders.Clear
  364.                 lvListView.ListItems.Clear
  365.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  366.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  367.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  368.                 Do While Not Xtgnbrec.EOF
  369.                     Set mitem = lvListView.ListItems.Add()
  370.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  371.                     If Xtgnbrec.Fields("mjbz") Then
  372.                         mitem.SmallIcon = "gnqx"
  373.                         mitem.Icon = "y"
  374.                     Else
  375.                         mitem.Icon = "i"
  376.                         mitem.SmallIcon = "stb"
  377.                     End If
  378.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  379.                     Xtgnbrec.MoveNext
  380.                 Loop
  381.                 '---------------
  382.             End If
  383.         End If
  384.     End If
  385. End Sub
  386. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  387.     If KeyAscii = vbKeyReturn Then
  388.         Call lvListView_DblClick
  389.     End If
  390. End Sub
  391. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  392.     Dim Ssql As String
  393.     If Node.Tag <> "" Then
  394.         If Node.Tag = False Then
  395.             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"
  396.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  397.                 Exit Sub
  398.             Else
  399.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  400.             End If
  401.         Else
  402.             Ssql = "SELECT * FROM xt_xtgnb a," _
  403.                     & "(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"
  404.         End If
  405.         
  406.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  407.         If Node.Tag = True Then
  408.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  409.                 Exit Sub
  410.             Else
  411.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  412.             End If
  413.         End If
  414.         lvListView.ColumnHeaders.Clear
  415.         lvListView.ListItems.Clear
  416.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  417.         Do While Not Xtgnbrec.EOF
  418.             Set mitem = lvListView.ListItems.Add()
  419.             mitem.Text = Trim(Xtgnbrec!gnmc)
  420.             If Xtgnbrec.Fields("mjbz") Then
  421.                 mitem.SmallIcon = "gnqx"
  422.                 mitem.Icon = "y"
  423.             Else
  424.                 mitem.Icon = "i"
  425.                 mitem.SmallIcon = "stb"
  426.             End If
  427.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  428.             Xtgnbrec.MoveNext
  429.         Loop
  430.     End If
  431. End Sub
  432. Public Sub Cshgns()                                                    '初始化系统功能树
  433.   
  434.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '15%' and MenuList=1 order by gnbm")
  435.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  436.     With Xtgnbrec
  437.         Do While Not .EOF
  438.             If .Fields("mjbz") Then
  439.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  440.             Else
  441.                 If Trim(.Fields("sjgnbm")) = "" Then
  442.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  443.                 Else
  444.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  445.                 End If
  446.             End If
  447.             nodX.Tag = Xtgnbrec!mjbz
  448.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  449.                 nodX.EnsureVisible
  450.             End If
  451.             .MoveNext
  452.         Loop
  453.     End With
  454. End Sub
  455. '系统功能树操作
  456. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  457.   Cancel = 1
  458. End Sub
  459. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  460.     
  461.     If Node.Index <> 1 And Node.Key <> "T15" Then
  462.         Node.Image = "stb"
  463.     End If
  464.  
  465. End Sub
  466. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  467.     
  468.     If Node.Index <> 1 And Node.Key <> "T15" Then
  469.         Node.Image = "szk"
  470.     End If
  471. End Sub
  472. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  473.     
  474.     If KeyAscii = vbKeyReturn Then
  475.         Call tvTreeView_DblClick
  476.     End If
  477. End Sub
  478. Private Sub tvTreeView_DblClick()                                             '选择功能
  479.     
  480.     If tvTreeView.SelectedItem.Children = 0 Then
  481.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  482.         If Not Xtgnbrec.EOF Then
  483.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  484.             Call Zxxymk(gnsyte)
  485.         End If
  486.     End If
  487. End Sub
  488. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  489.   
  490.     Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  491.     Dim Sqlstr As String                   '临时查询字符串
  492.   
  493.     If Len(Trim(gnsy)) = 0 Then
  494.         Exit Sub
  495.     End If
  496.     
  497.     On Error GoTo Cwcl:
  498.     Select Case gnsy
  499.         
  500.         '******************************* 文  件 *********************************
  501.         
  502.         Case "QC_Register"                               '用户重新注册
  503.            XT_login.Show 1
  504.         Case "QC_Quit"                                   '退出系统
  505.            Unload XT_Main
  506.         
  507.         '******************************* 基础设置 *******************************
  508.         
  509.         Case "QC_CheckParaSet"                           '检验管理
  510.             FrmJcsz_CheckParaSet.HelpContextID = 1502001
  511.             FrmJcsz_CheckParaSet.Show 1
  512.         Case "QC_CheckItem"                              '检验项目
  513.             FrmJcsz_CheckItem.HelpContextID = 1502002
  514.             FrmJcsz_CheckItem.Show 1
  515.         Case "QC_CheckSort"                              '检验类别
  516.             FrmJcsz_CheckSort.HelpContextID = 1502003
  517.             FrmJcsz_CheckSort.Show 1
  518.         Case "QC_Grade"                                  '质量等级
  519.             FrmJcsz_Grade.HelpContextID = 1502004
  520.             FrmJcsz_Grade.Show 1
  521.         Case "QC_MaterialSort"                           '物料大类
  522.             FrmJcsz_MaterialSort.HelpContextID = 1502005
  523.             FrmJcsz_MaterialSort.Show 1
  524.         Case "QC_Material"                               '物料编码
  525.             FrmJcsz_Material.HelpContextID = 1502006
  526.             FrmJcsz_Material.Show 1
  527.         Case "QC_StoMaterArea"                           '物料产地
  528.             FrmJcsz_Wlcd.HelpContextID = 150200701
  529.             FrmJcsz_Wlcd.Show 1
  530.         Case "QC_StockMaterial"                          '进料物料编码
  531.             FrmJcsz_StockMaterial.HelpContextID = 150200702
  532.             FrmJcsz_StockMaterial.Show 1
  533.         Case "QC_StoCheckStand"                          '进料检验标准
  534.             
  535.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  536.             If Not Security_Log("QC_StoCheckStand_edit", Xtczybm, 1) Then
  537.                 Exit Sub
  538.             End If
  539.             
  540.             Xtcdcs = "1"
  541.             FrmJcsz_StoCheckStand.HelpContextID = 150200703
  542.             FrmJcsz_StoCheckStand.Show 1
  543.             
  544.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  545.         
  546.         Case "QC_ProductMaterial"                        '成品物料编码
  547.             FrmJcsz_ProductMaterial.HelpContextID = 150200801
  548.             FrmJcsz_ProductMaterial.Show 1
  549.         Case "QC_ProCheckStand"                          '成品检验标准
  550.             
  551.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  552.             If Not Security_Log("QC_ProCheckStand_edit", Xtczybm, 1) Then
  553.                 Exit Sub
  554.             End If
  555.             
  556.             Xtcdcs = "1"
  557.             FrmJcsz_ProCheckStand.HelpContextID = 150200802
  558.             FrmJcsz_ProCheckStand.Show 1
  559.             
  560.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  561.         
  562.         Case "Qc_ProductLine"                            '生产线
  563.             FrmJcsz_ProductLine.HelpContextID = 150200901
  564.             FrmJcsz_ProductLine.Show 1
  565.         Case "Qc_MidMaterial"                            '中控物料编码
  566.             FrmJcsz_MidMaterial.HelpContextID = 150200902
  567.             FrmJcsz_MidMaterial.Show 1
  568.         Case "Qc_SamplingSite"                           '取样点
  569.             FrmJcsz_SamplingSite.HelpContextID = 150200903
  570.             FrmJcsz_SamplingSite.Show 1
  571.         Case "QC_MidCheckStand"                          '中控检验标准
  572.             
  573.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  574.             If Not Security_Log("QC_MidCheckStand_edit", Xtczybm, 1) Then
  575.                 Exit Sub
  576.             End If
  577.             
  578.             Xtcdcs = "1"
  579.             FrmJcsz_MidCheckStand.HelpContextID = 150200904
  580.             FrmJcsz_MidCheckStand.Show 1
  581.              
  582.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  583.         
  584.        Case "Qc_WorkEnvirItem"                           '工作环境采样点
  585.             FrmJcsz_WorkEnvirItem.HelpContextID = 1502010
  586.             FrmJcsz_WorkEnvirItem.Show 1
  587.         '******************************* 进料检验 *******************************
  588.         
  589.         Case "QC_StockCheck"                             '进料检验分析单
  590.             
  591.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  592.             If Not Security_Log("QC_StockCheck_edit", Xtczybm, 1) Then
  593.                 Exit Sub
  594.             End If
  595.             
  596.             Xtcdcs = "1"
  597.             If GBln_IfLinkStock = True Then
  598.                FrmJljy_StockCheckCg.HelpContextID = 1503001
  599.                 FrmJljy_StockCheckCg.Show 1
  600.             Else
  601.                FrmJljy_StockCheck.HelpContextID = 1503001
  602.                 FrmJljy_StockCheck.Show 1
  603.             End If
  604.             
  605.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  606.         
  607.         Case "QC_StockCheckQuery"                        '产成品检验单列表
  608.             If GBln_IfLinkStock = True Then
  609.                 FrmJljy_StockCheckListCg.HelpContextID = 1503002
  610.                 FrmJljy_StockCheckListCg.Show
  611.                 FrmJljy_StockCheckListQueryCg.Show 1
  612.             Else
  613.                 FrmJljy_StockCheckList.HelpContextID = 1503002
  614.                 FrmJljy_StockCheckList.Show
  615.                 FrmJljy_StockCheckListQuery.Show 1
  616.             End If
  617.         Case "Qc_StoDemotion"                            '降等使用报告单
  618.             
  619.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  620.             If Not Security_Log("Qc_StoDemotion_edit", Xtczybm, 1) Then
  621.                 Exit Sub
  622.             End If
  623.             
  624.             Xtcdcs = "1"
  625.             If GBln_IfLinkStock = True Then
  626.                 FrmJljy_SDemotionListCg.HelpContextID = 1503003
  627.                 FrmJljy_SDemotionListCg.Show
  628.             Else
  629.                 FrmJljy_SDemotionList.HelpContextID = 1503003
  630.                 FrmJljy_SDemotionList.Show
  631.             End If
  632.              
  633.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  634.         
  635.        Case "Qc_StoDemotionQuery"                        '降等使用报告单列表
  636.             If GBln_IfLinkStock = True Then
  637.                 FrmJljy_StoDemotionListCg.HelpContextID = 1503004
  638.                 FrmJljy_StoDemotionListCg.Show
  639.                 FrmJljy_StoDemotionListQueryCg.Show 1
  640.             Else
  641.                 FrmJljy_StoDemotionList.HelpContextID = 1503004
  642.                 FrmJljy_StoDemotionList.Show
  643.                 FrmJljy_StoDemotionListQuery.Show 1
  644.             End If
  645.         '******************************* 成品检验 *******************************
  646.         
  647.         Case "Qc_ProductCheck"                           '成品检验分析单
  648.             
  649.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  650.             If Not Security_Log("Qc_ProductCheck_edit", Xtczybm, 1) Then
  651.                 Exit Sub
  652.             End If
  653.             
  654.             Xtcdcs = "1"
  655.             FrmCpjy_ProductCheck.HelpContextID = 1504001
  656.             FrmCpjy_ProductCheck.Show 1
  657.             
  658.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  659.         
  660.         Case "Qc_ProductCheckQuery"                      '成品检验分析单列表
  661.             FrmCpjy_ProductCheckList.HelpContextID = 1504002
  662.             FrmCpjy_ProductCheckList.Show
  663.             FrmCpjy_ProductCheckListQuery.Show 1
  664.         Case "Qc_ProductDemotion"                        '成品质量降等
  665.             
  666.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  667.             If Not Security_Log("Qc_ProductDemotion_edit", Xtczybm, 1) Then
  668.                 Exit Sub
  669.             End If
  670.             
  671.             FrmCpjy_PDemotionList.HelpContextID = 1504003
  672.             FrmCpjy_PDemotionList.Show
  673.             
  674.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  675.         
  676.         Case "Qc_ProductDemotionQuery"                   '成品质量降等列表
  677.             FrmCpjy_ProductDemotionList.HelpContextID = 1504004
  678.             FrmCpjy_ProductDemotionList.Show
  679.             FrmCpjy_ProductDemotionListQuery.Show 1
  680.         Case "QC_ProGraphZxt"                            '成品指标折线图
  681.             FrmProGraph_Zxt.HelpContextID = 150400501
  682.             FrmProGraph_Zxt.Show
  683.             FrmProGraph_ZxtQuery.Show 1
  684.         Case "QC_ProGraphZst"                            '成品等级走势图
  685.             FrmProGraph_Zst.HelpContextID = 150400502
  686.             FrmProGraph_Zst.Show
  687.             FrmProGraph_ZstQuery.Show 1
  688.         Case "QC_ProGraphPlt"                            '成品降等排列图
  689.             FrmProGraph_Plt.HelpContextID = 150400503
  690.             FrmProGraph_Plt.Show
  691.             FrmProGraph_PltQuery.Show 1
  692.        
  693.         
  694.         '******************************* 中控检验 *******************************
  695.         
  696.         Case "QC_MidCheck"                               '中控检验分析单
  697.             
  698.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  699.             If Not Security_Log("QC_MidCheck_edit", Xtczybm, 1) Then
  700.                 Exit Sub
  701.             End If
  702.             
  703.             Xtcdcs = "1"
  704.             Qc_MidAnaBill.HelpContextID = 1505001
  705.             Qc_MidAnaBill.Show 1
  706.              
  707.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  708.         
  709.        Case "QC_MidCheckQuery"                           '中控检验分析单查询
  710.             Qc_MidAnaBillList.HelpContextID = 1505002
  711.             Qc_MidAnaBillList.Show
  712.             Qc_MidAnaBillListQuery.Show 1
  713.         Case "QC_MidGraphZxt"                            '中控图形分析折线图
  714.             QC_MidGraphZxt.HelpContextID = 150500301
  715.             QC_MidGraphZxt.Show 1
  716.         Case "QC_MidGraphKzt"                            '中控图形分析控制图
  717.             QC_MidGraphKzt.HelpContextID = 150500302
  718.             QC_MidGraphKzt.Show 1
  719.          
  720.          
  721.         '******************************* 工作环境 *******************************
  722.        Case "QC_WaterReport"                             '废水监测报告
  723.              
  724.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  725.             If Not Security_Log("QC_StockCheck_edit", Xtczybm, 1) Then
  726.                 Exit Sub
  727.             End If
  728.             
  729.            If Not ReportItem(1) Then
  730.                 Exit Sub
  731.             End If
  732.             Xtcdcs = "1"
  733.            QC_WaterReport.HelpContextID = 1506001
  734.            QC_WaterReport.Show 1
  735.             
  736.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  737.         
  738.         Case "QC_GasReport"                              '废气监测报告
  739.             
  740.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  741.             If Not Security_Log("QC_StockCheck_edit", Xtczybm, 1) Then
  742.                 Exit Sub
  743.             End If
  744.             
  745.             If Not ReportItem(2) Then
  746.                 Exit Sub
  747.             End If
  748.             Xtcdcs = "1"
  749.             QC_GasReport.HelpContextID = 1506002
  750.             QC_GasReport.Show 1
  751.             
  752.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  753.         
  754.         Case "QC_EnvironmentReport"                      '工作环境检测报告
  755.             
  756.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  757.             If Not Security_Log("QC_StockCheck_edit", Xtczybm, 1) Then
  758.                 Exit Sub
  759.             End If
  760.             
  761.             If Not ReportItem(3) Then
  762.                 Exit Sub
  763.             End If
  764.             Xtcdcs = "1"
  765.             Qc_EnviReport.HelpContextID = 1506003
  766.             Qc_EnviReport.Show 1
  767.             
  768.             Security_Log gnsy, Xtczybm, 2, False         '用户退出时写上机日志
  769.         
  770.         
  771.         '******************************* 工 具 *********************************
  772.           
  773.         Case "Qc_jsq"                                    '计算器
  774.             Shell App.Path & "calc.exe", vbNormalFocus
  775.         Case "Qc_kjrl"                                   '会计日历
  776.             XT_kjrlFrm.HelpContextID = 1507001
  777.             XT_kjrlFrm.Show 1
  778.         
  779.         '******************************* 帮  助 *********************************
  780.           
  781.         Case "Qc_wshxxd"                                 '网上华夏新达
  782.             ShellExecute 0, "open", "www.hxxd.com", "", "", 0
  783.         Case "Qc_xtbz"                                   '系统帮助
  784.             Call F1bz
  785.         Case "Qc_gy"                                     '关于
  786.             XT_frmAbout.Show
  787.         
  788.     End Select
  789.     
  790.     '用户退出时写上机日志
  791.    Security_Log gnsy, Xtczybm, 2, False
  792.    
  793.    
  794.     Exit Sub
  795. Cwcl:
  796.     Tsxx = "此项系统功能有待完善!"
  797.     Call Xtxxts(Tsxx, 0, 4)
  798.     Exit Sub
  799. End Sub
  800. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  801.   
  802.     If Unload_TF = False Then
  803.         Cancel = 1
  804.         Me.WindowState = 1
  805.     End If
  806. End Sub
  807. Private Sub Form_Load()
  808.     
  809.     '设置窗体图标
  810.     Me.Icon = XT_Main.Icon
  811.     
  812.     '设置窗体位置大小,并调入系统功能树
  813.     Me.Left = 0
  814.     Me.Top = 0
  815.     Me.Width = XT_Main.Width - 60
  816.     Me.Height = XT_Main.Height - 760 - 690
  817.     Call Cshgns
  818.     
  819.     '启动调入数据等待提示
  820.     Load Xt_Wait
  821.     
  822. End Sub
  823. Private Sub Form_Unload(Cancel As Integer)
  824.     
  825.     On Error Resume Next
  826.     
  827.     Dim i As Integer
  828.     For i = Forms.Count - 1 To 1 Step -1
  829.         Unload Forms(i)
  830.     Next
  831.     If Me.WindowState <> vbMinimized Then
  832.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  833.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  834.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  835.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  836.     End If
  837.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  838. End Sub
  839. Private Sub Form_Resize()
  840.     
  841.     On Error Resume Next
  842.     If Me.Width < 3000 Then Me.Width = 3000
  843.     SizeControls imgSplitter.Left
  844. End Sub
  845. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  846.     
  847.     With imgSplitter
  848.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  849.     End With
  850.     picSplitter.Visible = True
  851.     mbMoving = True
  852. End Sub
  853. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  854.     
  855.     Dim sglPos As Single
  856.     If mbMoving Then
  857.         sglPos = X + imgSplitter.Left
  858.         If sglPos < sglSplitLimit Then
  859.             picSplitter.Left = sglSplitLimit
  860.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  861.             picSplitter.Left = Me.Width - sglSplitLimit
  862.         Else
  863.             picSplitter.Left = sglPos
  864.         End If
  865.     End If
  866. End Sub
  867. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  868.     
  869.     SizeControls picSplitter.Left
  870.     picSplitter.Visible = False
  871.     mbMoving = False
  872.     lvListView.Refresh
  873. End Sub
  874. Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
  875.     
  876.     If Source = imgSplitter Then
  877.         SizeControls X
  878.     End If
  879. End Sub
  880. Sub SizeControls(X As Single)
  881.     
  882.     On Error Resume Next
  883.     '设置 Width 属性
  884.     If X < 3500 Then X = 3500
  885.     If X > (Me.Width - 1500) Then X = Me.Width - 1500
  886.     tvTreeView.Width = X
  887.     imgSplitter.Left = X
  888.     lvListView.Left = X + 40
  889.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  890.     lblTitle(0).Width = tvTreeView.Width
  891.     lblTitle(1).Left = lvListView.Left + 20
  892.     lblTitle(1).Width = lvListView.Width - 40
  893.     '设置 Top 属性
  894.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  895.     lvListView.Top = tvTreeView.Top
  896.     '设置 height 属性
  897.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  898.     
  899.     lvListView.Height = tvTreeView.Height
  900.     imgSplitter.Top = tvTreeView.Top
  901.     imgSplitter.Height = tvTreeView.Height
  902. End Sub
  903. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  904.     
  905.     On Error Resume Next
  906.     
  907.     Select Case Button.Key
  908.         Case "返回"
  909.             tvTreeView.SetFocus
  910.               SendKeys "{up}", True
  911.         Case "向前"
  912.              tvTreeView.SetFocus
  913.               SendKeys "{DOWN}", True
  914.         Case "大图标"
  915.             lvListView.View = lvwIcon
  916.         Case "小图标"
  917.             lvListView.View = lvwSmallIcon
  918.         Case "列表"
  919.             lvListView.View = lvwList
  920.         Case "详细资料"
  921.             lvListView.View = lvwReport
  922.     End Select
  923. End Sub