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

企业管理

开发平台:

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      =   60
  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 picTitles 
  17.       Align           =   1  'Align Top
  18.       Appearance      =   0  'Flat
  19.       BorderStyle     =   0  'None
  20.       ForeColor       =   &H80000008&
  21.       Height          =   300
  22.       Left            =   0
  23.       ScaleHeight     =   300
  24.       ScaleWidth      =   9240
  25.       TabIndex        =   2
  26.       TabStop         =   0   'False
  27.       Top             =   420
  28.       Width           =   9240
  29.       Begin VB.Label lblTitle 
  30.          BorderStyle     =   1  'Fixed Single
  31.          Caption         =   " 列表视图:"
  32.          Height          =   270
  33.          Index           =   1
  34.          Left            =   2078
  35.          TabIndex        =   4
  36.          Tag             =   " 列表视图:"
  37.          Top             =   12
  38.          Width           =   3216
  39.       End
  40.       Begin VB.Label lblTitle 
  41.          BorderStyle     =   1  'Fixed Single
  42.          Caption         =   "百利/ERP5.0"
  43.          Height          =   270
  44.          Index           =   0
  45.          Left            =   0
  46.          TabIndex        =   3
  47.          Tag             =   " 树形视图:"
  48.          Top             =   12
  49.          Width           =   2016
  50.       End
  51.    End
  52.    Begin VB.PictureBox picSplitter 
  53.       BackColor       =   &H00808080&
  54.       BorderStyle     =   0  'None
  55.       FillColor       =   &H00808080&
  56.       Height          =   4800
  57.       Left            =   4740
  58.       ScaleHeight     =   2090.126
  59.       ScaleMode       =   0  'User
  60.       ScaleWidth      =   780
  61.       TabIndex        =   0
  62.       Top             =   780
  63.       Visible         =   0   'False
  64.       Width           =   72
  65.    End
  66.    Begin MSComctlLib.ImageList ImageList1 
  67.       Left            =   5220
  68.       Top             =   2340
  69.       _ExtentX        =   1005
  70.       _ExtentY        =   1005
  71.       BackColor       =   -2147483643
  72.       ImageWidth      =   16
  73.       ImageHeight     =   16
  74.       MaskColor       =   12632256
  75.       _Version        =   393216
  76.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  77.          NumListImages   =   8
  78.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  79.             Picture         =   "系统_主操作桌面.frx":1042
  80.             Key             =   "stb"
  81.          EndProperty
  82.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  83.             Picture         =   "系统_主操作桌面.frx":2094
  84.             Key             =   "xttb"
  85.          EndProperty
  86.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  87.             Picture         =   "系统_主操作桌面.frx":30E6
  88.             Key             =   "szk"
  89.          EndProperty
  90.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  91.             Picture         =   "系统_主操作桌面.frx":3480
  92.             Key             =   "gnqx1"
  93.          EndProperty
  94.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  95.             Picture         =   "系统_主操作桌面.frx":38D2
  96.             Key             =   "kpgl"
  97.          EndProperty
  98.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  99.             Picture         =   "系统_主操作桌面.frx":41AC
  100.             Key             =   "kftb"
  101.          EndProperty
  102.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  103.             Picture         =   "系统_主操作桌面.frx":51FE
  104.             Key             =   "gnqx"
  105.          EndProperty
  106.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  107.             Picture         =   "系统_主操作桌面.frx":5598
  108.             Key             =   "chhs"
  109.          EndProperty
  110.       EndProperty
  111.    End
  112.    Begin MSComctlLib.ListView lvListView 
  113.       Height          =   3375
  114.       Left            =   2160
  115.       TabIndex        =   1
  116.       Top             =   705
  117.       Width           =   2295
  118.       _ExtentX        =   4048
  119.       _ExtentY        =   5953
  120.       Arrange         =   2
  121.       LabelEdit       =   1
  122.       LabelWrap       =   -1  'True
  123.       HideSelection   =   -1  'True
  124.       OLEDragMode     =   1
  125.       OLEDropMode     =   1
  126.       PictureAlignment=   1
  127.       _Version        =   393217
  128.       Icons           =   "ImageList2"
  129.       SmallIcons      =   "ImageList1"
  130.       ColHdrIcons     =   "ImageList1"
  131.       ForeColor       =   -2147483640
  132.       BackColor       =   -2147483643
  133.       BorderStyle     =   1
  134.       Appearance      =   1
  135.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  136.          Name            =   "宋体"
  137.          Size            =   9
  138.          Charset         =   134
  139.          Weight          =   400
  140.          Underline       =   0   'False
  141.          Italic          =   0   'False
  142.          Strikethrough   =   0   'False
  143.       EndProperty
  144.       OLEDragMode     =   1
  145.       OLEDropMode     =   1
  146.       NumItems        =   0
  147.    End
  148.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  149.       Left            =   3360
  150.       Top             =   2160
  151.       _ExtentX        =   847
  152.       _ExtentY        =   847
  153.       _Version        =   393216
  154.    End
  155.    Begin MSComctlLib.TreeView tvTreeView 
  156.       Height          =   4800
  157.       Left            =   0
  158.       TabIndex        =   5
  159.       Top             =   705
  160.       Width           =   2010
  161.       _ExtentX        =   3545
  162.       _ExtentY        =   8467
  163.       _Version        =   393217
  164.       Indentation     =   564
  165.       Style           =   7
  166.       ImageList       =   "ImageList1"
  167.       Appearance      =   1
  168.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  169.          Name            =   "宋体"
  170.          Size            =   9
  171.          Charset         =   134
  172.          Weight          =   400
  173.          Underline       =   0   'False
  174.          Italic          =   0   'False
  175.          Strikethrough   =   0   'False
  176.       EndProperty
  177.    End
  178.    Begin MSComctlLib.Toolbar tbToolBar 
  179.       Align           =   1  'Align Top
  180.       Height          =   420
  181.       Left            =   0
  182.       TabIndex        =   6
  183.       Top             =   0
  184.       Width           =   9240
  185.       _ExtentX        =   16298
  186.       _ExtentY        =   741
  187.       ButtonWidth     =   609
  188.       ButtonHeight    =   582
  189.       AllowCustomize  =   0   'False
  190.       Appearance      =   1
  191.       ImageList       =   "imlToolbarIcons"
  192.       _Version        =   393216
  193.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  194.          NumButtons      =   10
  195.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  196.             Style           =   3
  197.          EndProperty
  198.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  199.             Key             =   "返回"
  200.             Object.ToolTipText     =   "返回"
  201.             ImageKey        =   "xq"
  202.          EndProperty
  203.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  204.             Key             =   "向前"
  205.             Object.ToolTipText     =   "向前"
  206.             ImageKey        =   "xh"
  207.          EndProperty
  208.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  209.             Style           =   3
  210.          EndProperty
  211.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  212.             Style           =   3
  213.          EndProperty
  214.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  215.             Style           =   3
  216.          EndProperty
  217.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  218.             Key             =   "大图标"
  219.             Object.ToolTipText     =   "大图标"
  220.             ImageKey        =   "dtb"
  221.             Style           =   2
  222.             Value           =   1
  223.          EndProperty
  224.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  225.             Key             =   "小图标"
  226.             Object.ToolTipText     =   "小图标"
  227.             ImageKey        =   "xtb"
  228.             Style           =   2
  229.          EndProperty
  230.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  231.             Key             =   "列表"
  232.             Object.ToolTipText     =   "列表"
  233.             ImageKey        =   "lb"
  234.             Style           =   2
  235.          EndProperty
  236.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  237.             Key             =   "详细资料"
  238.             Object.ToolTipText     =   "详细资料"
  239.             ImageKey        =   "xxzl"
  240.             Style           =   2
  241.          EndProperty
  242.       EndProperty
  243.    End
  244.    Begin MSComctlLib.ImageList imlToolbarIcons 
  245.       Left            =   5220
  246.       Top             =   930
  247.       _ExtentX        =   1005
  248.       _ExtentY        =   1005
  249.       BackColor       =   -2147483643
  250.       ImageWidth      =   16
  251.       ImageHeight     =   16
  252.       MaskColor       =   12632256
  253.       _Version        =   393216
  254.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  255.          NumListImages   =   6
  256.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  257.             Picture         =   "系统_主操作桌面.frx":65EA
  258.             Key             =   "xq"
  259.          EndProperty
  260.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  261.             Picture         =   "系统_主操作桌面.frx":6984
  262.             Key             =   "xh"
  263.          EndProperty
  264.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  265.             Picture         =   "系统_主操作桌面.frx":6D1E
  266.             Key             =   "dtb"
  267.          EndProperty
  268.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  269.             Picture         =   "系统_主操作桌面.frx":70B8
  270.             Key             =   "xtb"
  271.          EndProperty
  272.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  273.             Picture         =   "系统_主操作桌面.frx":7452
  274.             Key             =   "lb"
  275.          EndProperty
  276.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  277.             Picture         =   "系统_主操作桌面.frx":77EC
  278.             Key             =   "xxzl"
  279.          EndProperty
  280.       EndProperty
  281.    End
  282.    Begin MSComctlLib.ImageList ImageList2 
  283.       Left            =   6750
  284.       Top             =   2940
  285.       _ExtentX        =   1005
  286.       _ExtentY        =   1005
  287.       BackColor       =   -2147483643
  288.       ImageWidth      =   32
  289.       ImageHeight     =   32
  290.       MaskColor       =   12632256
  291.       _Version        =   393216
  292.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  293.          NumListImages   =   4
  294.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  295.             Picture         =   "系统_主操作桌面.frx":7B86
  296.             Key             =   "y1"
  297.          EndProperty
  298.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  299.             Picture         =   "系统_主操作桌面.frx":7FDA
  300.             Key             =   ""
  301.          EndProperty
  302.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  303.             Picture         =   "系统_主操作桌面.frx":82FA
  304.             Key             =   "i"
  305.          EndProperty
  306.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  307.             Picture         =   "系统_主操作桌面.frx":934C
  308.             Key             =   "y"
  309.          EndProperty
  310.       EndProperty
  311.    End
  312.    Begin VB.Image imgSplitter 
  313.       Height          =   4785
  314.       Left            =   4230
  315.       MousePointer    =   9  'Size W E
  316.       Top             =   750
  317.       Width           =   150
  318.    End
  319. End
  320. Attribute VB_Name = "Xt_Control"
  321. Attribute VB_GlobalNameSpace = False
  322. Attribute VB_Creatable = False
  323. Attribute VB_PredeclaredId = True
  324. Attribute VB_Exposed = False
  325. '***********************************************
  326. '*    模 块 名 称 :系统主操作桌面
  327. '*    功 能 描 述 :
  328. '*    程序员姓名  :白凤英
  329. '*    最后修改人  :白凤英
  330. '*    最后修改时间:2001/12/21
  331. '*    备        注:
  332. '***********************************************
  333. Const NAME_COLUMN = 0
  334. Const TYPE_COLUMN = 1
  335. Const SIZE_COLUMN = 2
  336. Const DATE_COLUMN = 3
  337. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  338.   
  339. Dim sjgnbmStr As String                      '上级编码
  340. Dim mbMoving As Boolean
  341. Const sglSplitLimit = 1000
  342. Dim nodX As Node
  343. Dim mitem As ListItem
  344. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  345. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  346. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  347. Dim Tsxx As String                           '系统提示信息
  348. Dim gnsyte As String                         '系统功能项索引
  349. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  350. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  351. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  352.     If lvListView.ListItems.count > 0 Then
  353.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  354.         If Not Xtgnbrec.EOF Then
  355.             If Xtgnbrec.Fields("mjbz") = True Then
  356.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  357.                 Call Zxxymk(gnsyte)
  358.             Else
  359.                 '---------------
  360.                 Dim Ssql As String
  361.                 sjgnbmStr = ""
  362.                 lvListView.ColumnHeaders.Clear
  363.                 lvListView.ListItems.Clear
  364.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  365.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  366.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  367.                 Do While Not Xtgnbrec.EOF
  368.                     Set mitem = lvListView.ListItems.Add()
  369.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  370.                     If Xtgnbrec.Fields("mjbz") Then
  371.                         mitem.SmallIcon = "gnqx"
  372.                         mitem.Icon = "y"
  373.                     Else
  374.                         mitem.Icon = "i"
  375.                         mitem.SmallIcon = "stb"
  376.                     End If
  377.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  378.                     Xtgnbrec.MoveNext
  379.                 Loop
  380.                 '---------------
  381.             End If
  382.         End If
  383.     End If
  384. End Sub
  385. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  386.     If KeyAscii = vbKeyReturn Then
  387.         Call lvListView_DblClick
  388.     End If
  389. End Sub
  390. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  391.     Dim Ssql As String
  392.     If Node.Tag <> "" Then
  393.         If Node.Tag = False Then
  394.             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"
  395.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  396.                 Exit Sub
  397.             Else
  398.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  399.             End If
  400.         Else
  401.             Ssql = "SELECT * FROM xt_xtgnb a," _
  402.                     & "(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"
  403.         End If
  404.         
  405.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  406.         If Node.Tag = True Then
  407.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  408.                 Exit Sub
  409.             Else
  410.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  411.             End If
  412.         End If
  413.         lvListView.ColumnHeaders.Clear
  414.         lvListView.ListItems.Clear
  415.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  416.         Do While Not Xtgnbrec.EOF
  417.             Set mitem = lvListView.ListItems.Add()
  418.             mitem.Text = Trim(Xtgnbrec!gnmc)
  419.             If Xtgnbrec.Fields("mjbz") Then
  420.                 mitem.SmallIcon = "gnqx"
  421.                 mitem.Icon = "y"
  422.             Else
  423.                 mitem.Icon = "i"
  424.                 mitem.SmallIcon = "stb"
  425.             End If
  426.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  427.             Xtgnbrec.MoveNext
  428.         Loop
  429.     End If
  430. End Sub
  431. Public Sub Cshgns()                                                    '初始化系统功能树
  432.   
  433.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '13%' and MenuList=1 order by gnbm")
  434.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  435.     With Xtgnbrec
  436.         Do While Not .EOF
  437.             If .Fields("mjbz") Then
  438.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  439.             Else
  440.                 If Trim(.Fields("sjgnbm")) = "" Then
  441.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "chhs")
  442.                 Else
  443.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  444.                 End If
  445.             End If
  446.             nodX.Tag = Xtgnbrec!mjbz
  447.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  448.                 nodX.EnsureVisible
  449.             End If
  450.             .MoveNext
  451.         Loop
  452.     End With
  453. End Sub
  454. '系统功能树操作
  455. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  456.   Cancel = 1
  457. End Sub
  458. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  459.     
  460.     If Node.Index <> 1 And Node.Key <> "T13" Then
  461.         Node.Image = "stb"
  462.     End If
  463.  
  464. End Sub
  465. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  466.     
  467.     If Node.Index <> 1 And Node.Key <> "T13" Then
  468.         Node.Image = "szk"
  469.     End If
  470. End Sub
  471. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  472.     
  473.     If KeyAscii = vbKeyReturn Then
  474.         Call tvTreeView_DblClick
  475.     End If
  476. End Sub
  477. Private Sub tvTreeView_DblClick()                                             '选择功能
  478.     If tvTreeView.SelectedItem.Children = 0 Then
  479.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  480.         If Not Xtgnbrec.EOF Then
  481.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  482.             Call Zxxymk(gnsyte)
  483.         End If
  484.     End If
  485. End Sub
  486. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  487.   
  488.     Dim Rectemp As New ADODB.Recordset     '临时使用动态集
  489.     Dim SqlStr As String                   '临时查询字符串
  490.   
  491.     If Len(Trim(gnsy)) = 0 Then
  492.         Exit Sub
  493.     End If
  494.     
  495.     On Error GoTo Cwcl:
  496.     Select Case gnsy
  497.         
  498.         '基础设置
  499.         Case "Chhs_Ywfw"                        '业务范围
  500.             Jcsz_Ywfw.Show 1
  501.         Case "Chhs_Macc"                        '存货科目
  502.             Jcsz_Macc.Show 1
  503.         Case "Chhs_Dfacc"                       '对方科目
  504.             Jcsz_Dfacc.Show 1
  505.         Case "Chhs_EvalCond"                    '暂估存货设置
  506.             If Xtclzg Then
  507.                 Jcsz_InterimMaterial.Show 1
  508.             Else
  509.                 Tsxx = "系统不处理暂估!"
  510.                 Call Xtxxts(Tsxx, 0, 4)
  511.             End If
  512.         Case "Chhs_StartBill"                   '期初单据录入
  513.             
  514.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  515.             If Not Security_Log("Chhs_StartBillEdit", Xtczybm, 1) Then
  516.                 Exit Sub
  517.             End If
  518.             
  519.             If Xtyear <> PGKjYear() Then
  520.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + "),请重新登录!"
  521.                 Call Xtxxts(Tsxx, 0, 1)
  522.                 Exit Sub
  523.             End If
  524.             
  525.             Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select * from gy_kjrlb where beginflag=1")
  526.             If Rectemp.Fields("chhsjzbz") Then
  527.                 Tsxx = "期初月份已结帐,不允许期初单据录入!"
  528.                 Call Xtxxts(Tsxx, 0, 1)
  529.                 Exit Sub
  530.             End If
  531.             
  532.             Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "'")
  533.             If Rectemp.EOF Then
  534.                 Tsxx = "没有进行仓库设置!"
  535.                 Call Xtxxts(Tsxx, 0, 4)
  536.                 Exit Sub
  537.             Else
  538.                 Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "' and Gy_WareHouse.EndDealFlagChhs=0")
  539.                 If Rectemp.EOF Then
  540.                     Tsxx = "仓库已全部期末处理,不允许期初单据录入!"
  541.                     Call Xtxxts(Tsxx, 0, 4)
  542.                     Exit Sub
  543.                 End If
  544.             End If
  545.             Set Rectemp = Nothing
  546.             
  547.             Xtcdcs = "1"
  548.             Start_BillInput.Show 1
  549.             Security_Log "Chhs_StartBillEdit", Xtczybm, 2, False  '用户退出时写上机日志
  550.         Case "Chhs_StartBillList"               '期初单据列表
  551.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  552.             If Not Security_Log("Chhs_StartBillList", Xtczybm, 1) Then
  553.                 Exit Sub
  554.             End If
  555.             Start_BillInputList.Show
  556.             Start_BillListCond.Show 1
  557.             Security_Log "Chhs_StartBillList", Xtczybm, 2, False  '用户退出时写上机日志
  558.         Case "Chhs_Qcjz"                        '期初单据记帐
  559.             
  560.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  561.             If Not Security_Log("Chhs_Qcjz", Xtczybm, 1) Then
  562.                 Exit Sub
  563.             End If
  564.             
  565.             If Xtyear <> PGKjYear Then
  566.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + "),请重新登录!"
  567.                 Call Xtxxts(Tsxx, 0, 1)
  568.                 Exit Sub
  569.             End If
  570.             
  571.             Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select * from gy_kjrlb where beginflag=1")
  572.             If Rectemp.Fields("chhsjzbz") Then
  573.                 Tsxx = "期初月份已结帐,不允许期初记帐或恢复记帐操作!"
  574.                 Call Xtxxts(Tsxx, 0, 1)
  575.                 Exit Sub
  576.             End If
  577.             
  578.             Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "' ")
  579.             If Rectemp.EOF Then
  580.                 Tsxx = "没有进行仓库设置!"
  581.                 Call Xtxxts(Tsxx, 0, 4)
  582.                 Exit Sub
  583.             Else
  584.                 Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "' and Gy_WareHouse.EndDealFlagChhs=0")
  585.                 If Rectemp.EOF Then
  586.                     Tsxx = "仓库已全部期末处理,不允许进行记帐或恢复记帐操作!"
  587.                     Call Xtxxts(Tsxx, 0, 4)
  588.                     Exit Sub
  589.                 End If
  590.             End If
  591.             Set Rectemp = Nothing
  592.             
  593.             Start_BillChalkitup.Show
  594.             Start_BillChalkitupCond.Show 1
  595.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  596.         
  597.         
  598.         '日常单据
  599.         Case "Chhs_MateBill"                        '材料入库单
  600.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  601.             If Not Security_Log("Chhs_MateInEdit", Xtczybm, 1) Then
  602.                 Exit Sub
  603.             End If
  604.             
  605.             If ClrkdKfsc Then
  606.                 If Not Sub_Records(Xtrq, "Chhs_V_MateInBill") Then
  607.                     Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  608.                     Call Xtxxts(Tsxx, 0, 4)
  609.                 Else
  610.                     Xtcdcs = "1"
  611.                     DJ_MateInBill.Show 1
  612.                     Security_Log "Chhs_MateInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  613.                 End If
  614.             Else
  615.                 Xtcdcs = "1"
  616.                 DJ_MateInBill.Show 1
  617.                 Security_Log "Chhs_MateInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  618.             End If
  619.         Case "Chhs_ProdInBill"                      '产品入库单
  620.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  621.             If Not Security_Log("Chhs_ProdInEdit", Xtczybm, 1) Then
  622.                 Exit Sub
  623.             End If
  624.             
  625.             If Xt_XtJc Then
  626.                 If Not Sub_Records(Xtrq, "chhs_V_ProductInBill") Then
  627.                     Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  628.                     Call Xtxxts(Tsxx, 0, 4)
  629.                 Else
  630.                     Xtcdcs = "1"
  631.                     DJ_ProdInBill.Show 1
  632.                     Security_Log "Chhs_ProdInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  633.                 End If
  634.             Else
  635.                 Xtcdcs = "1"
  636.                 DJ_ProdInBill.Show 1
  637.                 Security_Log "Chhs_ProdInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  638.             End If
  639.         Case "Chhs_OtherInBill"                     '其它入库单
  640.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  641.             If Not Security_Log("Chhs_OtherInEdit", Xtczybm, 1) Then
  642.                 Exit Sub
  643.             End If
  644.             If Xt_XtJc Then
  645.                 If Not Sub_Records(Xtrq, "Chhs_V_OtherInBill") Then
  646.                     Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  647.                     Call Xtxxts(Tsxx, 0, 4)
  648.                 Else
  649.                     Xtcdcs = "1"
  650.                     DJ_OtherInBill.Show 1
  651.                     Security_Log "Chhs_OtherInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  652.                 End If
  653.             Else
  654.                 Xtcdcs = "1"
  655.                 DJ_OtherInBill.Show 1
  656.                 Security_Log "Chhs_OtherInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  657.             End If
  658.         Case "Chhs_MateOutBill"                     '材料出库单
  659.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  660.             If Not Security_Log("Chhs_MateOutEdit", Xtczybm, 1) Then
  661.                 Exit Sub
  662.             End If
  663.             
  664.             If Xt_XtJc Then
  665.                 If Not Sub_Records(Xtrq, "Chhs_V_MateOutBill") Then
  666.                     Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  667.                     Call Xtxxts(Tsxx, 0, 4)
  668.                 Else
  669.                     Xtcdcs = "1"
  670.                     DJ_MateOutBill.Show 1
  671.                     Security_Log "Chhs_MateOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  672.                 End If
  673.             Else
  674.                 Xtcdcs = "1"
  675.                 DJ_MateOutBill.Show 1
  676.                 Security_Log "Chhs_MateOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  677.             End If
  678.         Case "Chhs_SellOutBill"                     '销售出库单
  679.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  680.             If Not Security_Log("Chhs_SellOutEdit", Xtczybm, 1) Then
  681.                 Exit Sub
  682.             End If
  683.             
  684.             If Xt_XtJc Then
  685.                If Not Sub_Records(Xtrq, "Chhs_V_SellOutBill") Then
  686.                    Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  687.                    Call Xtxxts(Tsxx, 0, 4)
  688.                Else
  689.                    Xtcdcs = "1"
  690.                    DJ_SellOutBill.Show 1
  691.                    Security_Log "Chhs_SellOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  692.                End If
  693.             Else
  694.                Xtcdcs = "1"
  695.                DJ_SellOutBill.Show 1
  696.                Security_Log "Chhs_SellOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  697.             End If
  698.         Case "Chhs_OtherOutBill"                    '其它出库单
  699.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  700.             If Not Security_Log("Chhs_OtherOutEdit", Xtczybm, 1) Then
  701.                 Exit Sub
  702.             End If
  703.             If Xt_XtJc Then
  704.                 If Not Sub_Records(Xtrq, "Chhs_V_OtherOutBill") Then
  705.                     Tsxx = CStr(Format(Xtrq, "yyyy-mm-dd")) + " 无单据!"
  706.                     Call Xtxxts(Tsxx, 0, 4)
  707.                 Else
  708.                     Xtcdcs = "1"
  709.                     DJ_OtherOutBill.Show 1
  710.                     Security_Log "Chhs_OtherOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  711.                 End If
  712.             Else
  713.                 Xtcdcs = "1"
  714.                 DJ_OtherOutBill.Show 1
  715.                 Security_Log "Chhs_OtherOutEdit", Xtczybm, 2, False  '用户退出时写上机日志
  716.             End If
  717.             
  718.             
  719.         '单据列表
  720.         Case "Chhs_MateInBillList"                  '材料入库单列表
  721.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  722.             If Not Security_Log("Chhs_MateInBillList", Xtczybm, 1) Then
  723.                 Exit Sub
  724.             End If
  725.             LB_MateInBillList.Show
  726.             LBCX_MateInBillListFind.Show 1
  727.             Security_Log "Chhs_MateInBillList", Xtczybm, 2, False  '用户退出时写上机日志
  728.         Case "Chhs_ProdInBillList"                  '产品入库单列表
  729.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  730.             If Not Security_Log("Chhs_ProdInBillList", Xtczybm, 1) Then
  731.                 Exit Sub
  732.             End If
  733.             LB_ProdInBillList.Show
  734.             LBCX_ProdInBillListFind.Show 1
  735.             Security_Log "Chhs_ProdInBillList", Xtczybm, 2, False  '用户退出时写上机日志
  736.         Case "Chhs_OtherInBillList"                 '其它入库单列表
  737.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  738.             If Not Security_Log("Chhs_OtherInBillList", Xtczybm, 1) Then
  739.                 Exit Sub
  740.             End If
  741.             LB_OtherInBillList.Show
  742.             LBCX_OtherInBillListFind.Show 1
  743.             Security_Log "Chhs_OtherInBillList", Xtczybm, 2, False  '用户退出时写上机日志
  744.         Case "Chhs_MateOutBillList"                 '材料出库单列表
  745.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  746.             If Not Security_Log("Chhs_MateOutBillList", Xtczybm, 1) Then
  747.                 Exit Sub
  748.             End If
  749.             LB_MateOutBillList.Show
  750.             LBCX_MateOutBillListFind.Show 1
  751.             Security_Log "Chhs_MateOutBillList", Xtczybm, 2, False  '用户退出时写上机日志
  752.         Case "Chhs_SellOutBillList"                 '销售出库单列表
  753.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  754.             If Not Security_Log("Chhs_SellOutBillList", Xtczybm, 1) Then
  755.                 Exit Sub
  756.             End If
  757.             LB_SellOutBillList.Show
  758.             LBCX_SellOutBillListFind.Show 1
  759.             Security_Log "Chhs_SellOutBillList", Xtczybm, 2, False  '用户退出时写上机日志
  760.         Case "Chhs_OtheOutBillList"                '其它出库单列表
  761.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  762.             If Not Security_Log("Chhs_OtheOutBillList", Xtczybm, 1) Then
  763.                 Exit Sub
  764.             End If
  765.             LB_OtherOutBillList.Show
  766.             LBCX_OtherOutBillListFind.Show 1
  767.             Security_Log "Chhs_OtheOutBillList", Xtczybm, 2, False  '用户退出时写上机日志
  768.         Case "Chhs_AdjustInBill"                     '入库单调整
  769.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  770.             If Not Security_Log("Chhs_AdjustInEdit", Xtczybm, 1) Then
  771.                 Exit Sub
  772.             End If
  773.             If Xtyear <> PGKjYear Then
  774.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  775.                 Call Xtxxts(Tsxx, 0, 1)
  776.             Else
  777.                 If Xtmm <> PGNowmon Then
  778.                     Tsxx = "操作日期不在当前会计期间(" + Trim(Str(Xtyear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
  779.                     Call Xtxxts(Tsxx, 0, 1)
  780.                 Else
  781.                     Xtcdcs = "1"
  782.                     DJ_AdjustInbill.Show 1
  783.                     Security_Log "Chhs_AdjustInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  784.                 End If
  785.             End If
  786.         Case "Chhs_AdjustOutBill"                    '出库单调整
  787.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  788.             If Not Security_Log("Chhs_AdjustInEdit", Xtczybm, 1) Then
  789.                 Exit Sub
  790.             End If
  791.             If Xtyear <> PGKjYear Then
  792.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  793.                 Call Xtxxts(Tsxx, 0, 1)
  794.             Else
  795.                 If Xtmm <> PGNowmon Then
  796.                     Tsxx = "操作日期不在当前会计期间(" + Trim(Str(Xtyear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
  797.                     Call Xtxxts(Tsxx, 0, 1)
  798.                 Else
  799.                     Xtcdcs = "1"
  800.                     DJ_AdjustOutBill.Show 1
  801.                     Security_Log "Chhs_AdjustInEdit", Xtczybm, 2, False  '用户退出时写上机日志
  802.                 End If
  803.             End If
  804.         Case "Chhs_AdjustPlan"                       '计划价调整
  805.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  806.             If Not Security_Log("Chhs_AdjustPlan", Xtczybm, 1) Then
  807.                 Exit Sub
  808.             End If
  809.             Xtcdcs = "1"
  810.             DJ_AdjustPlan.Show 1
  811.             Security_Log "Chhs_AdjustPlan", Xtczybm, 2, False  '用户退出时写上机日志
  812.         Case "Chhs_AdjustInList"                     '入库单调整列表
  813.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  814.             If Not Security_Log("Chhs_AdjustInList", Xtczybm, 1) Then
  815.                 Exit Sub
  816.             End If
  817.             LB_AdjustInBillList.Show
  818.             LB_AdjustInBillCond.Show 1
  819.             Security_Log "Chhs_AdjustInList", Xtczybm, 2, False  '用户退出时写上机日志
  820.         Case "Chhs_AdjustOutList"                    '出库单调整列表
  821.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  822.             If Not Security_Log("Chhs_AdjustOutList", Xtczybm, 1) Then
  823.                 Exit Sub
  824.             End If
  825.             LB_AdjustOutBillList.Show
  826.             LB_AdjustOutBillCond.Show 1
  827.             Security_Log "Chhs_AdjustOutList", Xtczybm, 2, False  '用户退出时写上机日志
  828.         
  829.         '处理
  830.         Case "Chhs_Djjz"                             '单据记帐
  831.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  832.             If Not Security_Log("Chhs_Djjz", Xtczybm, 1) Then
  833.                 Exit Sub
  834.             End If
  835.             If Xtyear <> PGKjYear Then
  836.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  837.                 Call Xtxxts(Tsxx, 0, 1)
  838.             Else
  839.                 If Xtmm <> PGNowmon Then
  840.                     Tsxx = "操作日期不在当前会计期间(" + Trim(Str(Xtyear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
  841.                     Call Xtxxts(Tsxx, 0, 1)
  842.                 Else
  843.                     Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "' ")
  844.                     If Rectemp.EOF Then
  845.                         Tsxx = "没有进行仓库设置!"
  846.                         Call Xtxxts(Tsxx, 0, 4)
  847.                         Exit Sub
  848.                     Else
  849.                         Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select Gy_WareHouse.whcode from Gy_WareHouse left outer join Gy_Whlimit on Gy_WareHouse.whcode=Gy_Whlimit.whcode where Gy_Whlimit.czybm='" & Xtczybm & "' and Gy_WareHouse.EndDealFlagChhs=0")
  850.                         If Rectemp.EOF Then
  851.                             Tsxx = "仓库已全部期末处理,不允许进行记帐或恢复记帐操作!"
  852.                             Call Xtxxts(Tsxx, 0, 4)
  853.                             Exit Sub
  854.                         End If
  855.                     End If
  856.                     Set Rectemp = Nothing
  857.                     CL_BillChalkitup.Show
  858.                     CL_BillChalkitupCond.Show 1
  859.                     Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  860.                 End If
  861.             End If
  862.         Case "Chhs_Cyl"                              '差异率列表
  863.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  864.             If Not Security_Log("Chhs_Cyl", Xtczybm, 1) Then
  865.                 Exit Sub
  866.             End If
  867.             If Qmclcy Then
  868.                 CL_Discrepancy.Show
  869.                 CL_DiscrepancyFind.Show 1
  870.                 Security_Log "Chhs_Cyl", Xtczybm, 2, False  '用户退出时写上机日志
  871.             Else
  872.                 Tsxx = "系统期末不处理差异!"
  873.                 Call Xtxxts(Tsxx, 0, 4)
  874.             End If
  875.         Case "Chhs_AvgPrice"                         '平均单价列表
  876.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  877.             If Not Security_Log("Chhs_AvgPrice", Xtczybm, 1) Then
  878.                 Exit Sub
  879.             End If
  880.             CL_AveragePrice.Show
  881.             CL_AveragePriceFind.Show 1
  882.             Security_Log "Chhs_AvgPrice", Xtczybm, 2, False  '用户退出时写上机日志
  883.         Case "Chhs_ProdPrice"                        '产品成本调整
  884.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  885.             If Not Security_Log("Chhs_ProdPrice", Xtczybm, 1) Then
  886.                 Exit Sub
  887.             End If
  888.             Cl_ProdPrice.Show
  889.             Cl_ProdPriceCond.Show 1
  890.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  891.         Case "Chhs_EvalPrice"                        '暂估单价处理
  892.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  893.             If Not Security_Log("Chhs_EvalPrice", Xtczybm, 1) Then
  894.                 Exit Sub
  895.             End If
  896.             CL_InterimMaterialPrice.Show
  897.             CL_InterimMaterialFind.Show 1
  898.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  899.         Case "Chhs_Qmcl"                             '期末处理
  900.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  901.             If Not Security_Log("Chhs_Qmcl", Xtczybm, 1) Then
  902.                 Exit Sub
  903.             End If
  904.             If Xtyear <> PGKjYear Then
  905.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  906.                 Call Xtxxts(Tsxx, 0, 1)
  907.             Else
  908.                 CL_EndDispose.Show 1
  909.                 Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  910.             End If
  911.         Case "Chhs_Scpz"                             '生成凭证
  912.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  913.             If Not Security_Log("Chhs_Scpz", Xtczybm, 1) Then
  914.                 Exit Sub
  915.             End If
  916.             If Xtyear <> PGKjYear Then
  917.                 Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  918.                 Call Xtxxts(Tsxx, 0, 1)
  919.             Else
  920.                 If Xtmm <> PGNowmon Then
  921.                     Tsxx = "操作日期不在当前会计期间(" + Trim(Str(Xtyear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
  922.                     Call Xtxxts(Tsxx, 0, 1)
  923.                 Else
  924.                     CL_MakeVoucher.Show
  925.                     CL_MakeVoucherFind.Show 1
  926.                     Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  927.                 End If
  928.             End If
  929.         Case "Chhs_Qmjz"                             '期末结帐
  930.              '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  931.             If Not Security_Log("Chhs_Qmjz", Xtczybm, 1) Then
  932.                 Exit Sub
  933.             End If
  934.             If Xtyear <> PGKjYear Then
  935.                 Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select * from gy_kjrlb where kjyear=" & PGKjYear - 1 & " order by period desc")
  936.                 If Not Rectemp.EOF Then
  937.                     If Xtmm = Rectemp.Fields("period") Then
  938.                         CL_EndCheckOut.Dyear = PGKjYear - 1
  939.                         CL_EndCheckOut.Dmonth = Xtmm
  940.                         CL_EndCheckOut.Timer1 = True
  941.                         CL_EndCheckOut.Opt_Qmjz.Enabled = False
  942.                         CL_EndCheckOut.Opt_Hfqmjz.Value = True
  943.                         CL_EndCheckOut.Show 1
  944.                         Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  945.                     Else
  946.                         Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  947.                         Call Xtxxts(Tsxx, 0, 1)
  948.                     End If
  949.                 Else
  950.                     Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  951.                     Call Xtxxts(Tsxx, 0, 1)
  952.                 End If
  953.             Else
  954.                 CL_EndCheckOut.Dyear = PGKjYear
  955.                 CL_EndCheckOut.Dmonth = PGNowmon
  956.                 CL_EndCheckOut.Timer1 = True
  957.                 CL_EndCheckOut.Show 1
  958.                 Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  959.             End If
  960.         
  961.         '帐簿分析
  962.         Case "Chhs_Mxz"                              '明细帐
  963.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  964.             If Not Security_Log("Chhs_Mxz", Xtczybm, 1) Then
  965.                 Exit Sub
  966.             End If
  967.             Zbfx_List.Show
  968.             Zbfx_ListCond.Show 1
  969.             Security_Log "Chhs_Mxz", Xtczybm, 2, False  '用户退出时写上机日志
  970.         Case "Chhs_Zz"                               '总帐
  971.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  972.             If Not Security_Log("Chhs_Zz", Xtczybm, 1) Then
  973.                 Exit Sub
  974.             End If
  975.             Zbfx_Mate.Show
  976.             Zbfx_MateCond.Show 1
  977.             Security_Log "Chhs_Zz", Xtczybm, 2, False  '用户退出时写上机日志
  978.         Case "Chhs_Lsz"                              '流水帐
  979.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  980.             If Not Security_Log("Chhs_Lsz", Xtczybm, 1) Then
  981.                 Exit Sub
  982.             End If
  983.             Zbfx_InOut.Show
  984.             Zbfx_InOutCond.Show 1
  985.             Security_Log "Chhs_Lsz", Xtczybm, 2, False  '用户退出时写上机日志
  986.         
  987.         
  988.         '统计分析
  989.         Case "Chhs_InbillSum"                        '入库单汇总表
  990.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  991.             If Not Security_Log("Chhs_InbillSum", Xtczybm, 1) Then
  992.                 Exit Sub
  993.             End If
  994.             Tjfx_InBillSum.Show
  995.             Tjfx_InBillSumCond.Show 1
  996.             Security_Log "Chhs_InbillSum", Xtczybm, 2, False  '用户退出时写上机日志
  997.         Case "Chhs_OutBillSum"                       '出库单汇总表
  998.              '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  999.             If Not Security_Log("Chhs_OutBillSum", Xtczybm, 1) Then
  1000.                 Exit Sub
  1001.             End If
  1002.             Tjfx_OutBillSum.Show
  1003.             Tjfx_OutBillSumCond.Show 1
  1004.             Security_Log "Chhs_OutBillSum", Xtczybm, 2, False  '用户退出时写上机日志
  1005.         Case "Chhs_Sfchz"                            '收发存汇总表
  1006.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1007.             If Not Security_Log("Chhs_Sfchz", Xtczybm, 1) Then
  1008.                 Exit Sub
  1009.             End If
  1010.             Tjfx_Sfchz.Show
  1011.             Tjfx_SfchzCond.Show 1
  1012.             Security_Log "Chhs_Sfchz", Xtczybm, 2, False  '用户退出时写上机日志
  1013.         Case "Chhs_InOutClassSum"                    '收发类别汇总表
  1014.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1015.             If Not Security_Log("Chhs_InOutClassSum", Xtczybm, 1) Then
  1016.                 Exit Sub
  1017.             End If
  1018.             Tjfx_InOutClassSum.Show
  1019.             Tjfx_InOutClassSumCond.Show 1
  1020.             Security_Log "Chhs_InOutClassSum", Xtczybm, 2, False  '用户退出时写上机日志
  1021.         Case "Chhs_Cyft"                             '差异分摊
  1022.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1023.             If Not Security_Log("Chhs_Cyft", Xtczybm, 1) Then
  1024.                 Exit Sub
  1025.             End If
  1026.             If Qmclcy Then
  1027.                 Tjfx_Diff.Show
  1028.                 Tjfx_DiffCond.Show 1
  1029.                 Security_Log "Chhs_Cyft", Xtczybm, 2, False  '用户退出时写上机日志
  1030.             Else
  1031.                 Tsxx = "系统期末不处理差异!"
  1032.                 Call Xtxxts(Tsxx, 0, 4)
  1033.             End If
  1034.         Case "Chhs_Abcfl"                            'Abc分类
  1035.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1036.             If Not Security_Log("Chhs_Abcfl", Xtczybm, 1) Then
  1037.                 Exit Sub
  1038.             End If
  1039.             Tjfx_AbcFx.Show
  1040.             Tjfx_AbcFxCond.Show 1
  1041.             Security_Log "Chhs_Abcfl", Xtczybm, 2, False  '用户退出时写上机日志
  1042.         Case "Chhs_EvalFx"                           '暂估成本分析
  1043.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1044.             If Not Security_Log("Chhs_EvalFx", Xtczybm, 1) Then
  1045.                 Exit Sub
  1046.             End If
  1047.             If Xtclzg Then
  1048.                 Tjfx_EvalFx.Show
  1049.                 Tjfx_EvalFxCond.Show 1
  1050.                 Security_Log "Chhs_EvalFx", Xtczybm, 2, False  '用户退出时写上机日志
  1051.             Else
  1052.                 Tsxx = "系统不处理暂估!"
  1053.                 Call Xtxxts(Tsxx, 0, 4)
  1054.             End If
  1055.         Case "Chhs_InCbfx"                           '入库成本分析
  1056.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1057.             If Not Security_Log("Chhs_InCbfx", Xtczybm, 1) Then
  1058.                 Exit Sub
  1059.             End If
  1060.             Tjfx_IncbFx.Show
  1061.             Tjfx_IncbFxCond.Show 1
  1062.             Security_Log "Chhs_InCbfx", Xtczybm, 2, False  '用户退出时写上机日志
  1063.         Case "Chhs_gnbmkmrl"
  1064.             XT_kjrlFrm.Show 1
  1065.             
  1066.         Case "Chhs_gnbmjsq"
  1067.             Shell App.Path & "calc.exe", vbNormalFocus
  1068.             
  1069.         Case "Chhs_xtbz"
  1070.             Call F1bz
  1071.             
  1072.         Case "Chhs_gy"
  1073.             XT_frmAbout.Show
  1074.         
  1075.     End Select
  1076.     
  1077.     Exit Sub
  1078. Cwcl:
  1079.     Tsxx = "此项系统功能有待完善!"
  1080.     Call Xtxxts(Tsxx, 0, 4)
  1081.     Exit Sub
  1082. End Sub
  1083. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  1084.   
  1085.     If Unload_TF = False Then
  1086.         Cancel = 1
  1087.         Me.WindowState = 1
  1088.     End If
  1089. End Sub
  1090. Private Sub Form_Load()
  1091.     
  1092.     '设置窗体图标
  1093.     Me.Icon = XT_Main.Icon
  1094.     
  1095.     '设置窗体位置大小,并调入系统功能树
  1096.     Me.Left = 0
  1097.     Me.Top = 0
  1098.     Me.Width = XT_Main.Width - 60
  1099.     Me.Height = XT_Main.Height - 760 - 690
  1100.     Call Cshgns
  1101.     
  1102.     '启动调入数据等待提示
  1103.     Load Xt_Wait
  1104.     
  1105. End Sub
  1106. Private Sub Form_Unload(Cancel As Integer)
  1107.     
  1108.     On Error Resume Next
  1109.     
  1110.     Dim i As Integer
  1111.     For i = Forms.count - 1 To 1 Step -1
  1112.         Unload Forms(i)
  1113.     Next
  1114.     If Me.WindowState <> vbMinimized Then
  1115.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  1116.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  1117.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  1118.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  1119.     End If
  1120.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  1121. End Sub
  1122. Private Sub Form_Resize()
  1123.     
  1124.     On Error Resume Next
  1125.     If Me.Width < 3000 Then Me.Width = 3000
  1126.     SizeControls imgSplitter.Left
  1127. End Sub
  1128. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  1129.     
  1130.     With imgSplitter
  1131.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  1132.     End With
  1133.     picSplitter.Visible = True
  1134.     mbMoving = True
  1135. End Sub
  1136. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  1137.     
  1138.     Dim sglPos As Single
  1139.     If mbMoving Then
  1140.         sglPos = x + imgSplitter.Left
  1141.         If sglPos < sglSplitLimit Then
  1142.             picSplitter.Left = sglSplitLimit
  1143.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  1144.             picSplitter.Left = Me.Width - sglSplitLimit
  1145.         Else
  1146.             picSplitter.Left = sglPos
  1147.         End If
  1148.     End If
  1149. End Sub
  1150. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  1151.     
  1152.     SizeControls picSplitter.Left
  1153.     picSplitter.Visible = False
  1154.     mbMoving = False
  1155.     lvListView.Refresh
  1156. End Sub
  1157. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  1158.     
  1159.     If Source = imgSplitter Then
  1160.         SizeControls x
  1161.     End If
  1162. End Sub
  1163. Sub SizeControls(x As Single)
  1164.     
  1165.     On Error Resume Next
  1166.     '设置 Width 属性
  1167.     If x < 3500 Then x = 3500
  1168.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  1169.     tvTreeView.Width = x
  1170.     imgSplitter.Left = x
  1171.     lvListView.Left = x + 40
  1172.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  1173.     lblTitle(0).Width = tvTreeView.Width
  1174.     lblTitle(1).Left = lvListView.Left + 20
  1175.     lblTitle(1).Width = lvListView.Width - 40
  1176.     '设置 Top 属性
  1177.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  1178.     lvListView.Top = tvTreeView.Top
  1179.     '设置 height 属性
  1180.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  1181.     
  1182.     lvListView.Height = tvTreeView.Height
  1183.     imgSplitter.Top = tvTreeView.Top
  1184.     imgSplitter.Height = tvTreeView.Height
  1185. End Sub
  1186. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1187.     
  1188.     On Error Resume Next
  1189.     
  1190.     Select Case Button.Key
  1191.         Case "返回"
  1192.             tvTreeView.SetFocus
  1193.               SendKeys "{up}", True
  1194.         Case "向前"
  1195.              tvTreeView.SetFocus
  1196.               SendKeys "{DOWN}", True
  1197.         Case "大图标"
  1198.             lvListView.View = lvwIcon
  1199.         Case "小图标"
  1200.             lvListView.View = lvwSmallIcon
  1201.         Case "列表"
  1202.             lvListView.View = lvwList
  1203.         Case "详细资料"
  1204.             lvListView.View = lvwReport
  1205.     End Select
  1206. End Sub