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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form Gy_BaseSortSet 
  6.    Caption         =   "分级设置"
  7.    ClientHeight    =   7110
  8.    ClientLeft      =   825
  9.    ClientTop       =   1980
  10.    ClientWidth     =   10290
  11.    HelpContextID   =   2001
  12.    Icon            =   "公用_基础分类设置.frx":0000
  13.    KeyPreview      =   -1  'True
  14.    LinkTopic       =   "Form2"
  15.    ScaleHeight     =   7110
  16.    ScaleWidth      =   10290
  17.    Begin TabDlg.SSTab StTab 
  18.       Height          =   6435
  19.       Left            =   2880
  20.       TabIndex        =   5
  21.       Top             =   660
  22.       Width           =   7380
  23.       _ExtentX        =   13018
  24.       _ExtentY        =   11351
  25.       _Version        =   393216
  26.       Style           =   1
  27.       Tabs            =   2
  28.       TabHeight       =   520
  29.       TabCaption(0)   =   "列表视图"
  30.       TabPicture(0)   =   "公用_基础分类设置.frx":08CA
  31.       Tab(0).ControlEnabled=   -1  'True
  32.       Tab(0).Control(0)=   "CzxsGrid"
  33.       Tab(0).Control(0).Enabled=   0   'False
  34.       Tab(0).ControlCount=   1
  35.       TabCaption(1)   =   "单张视图"
  36.       TabPicture(1)   =   "公用_基础分类设置.frx":08E6
  37.       Tab(1).ControlEnabled=   0   'False
  38.       Tab(1).Control(0)=   "Label1"
  39.       Tab(1).Control(1)=   "Lbl_codescheme"
  40.       Tab(1).Control(2)=   "TsLabel(0)"
  41.       Tab(1).Control(3)=   "TsLabel(1)"
  42.       Tab(1).Control(4)=   "LrText(0)"
  43.       Tab(1).Control(5)=   "LrText(1)"
  44.       Tab(1).Control(6)=   "QxCommand"
  45.       Tab(1).Control(7)=   "BcCommand"
  46.       Tab(1).Control(8)=   "Ydcommand1(0)"
  47.       Tab(1).ControlCount=   9
  48.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  49.          Height          =   5955
  50.          Left            =   90
  51.          TabIndex        =   4
  52.          Top             =   450
  53.          Width           =   7155
  54.          _cx             =   5080
  55.          _cy             =   5080
  56.          Appearance      =   1
  57.          BorderStyle     =   1
  58.          Enabled         =   -1  'True
  59.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  60.             Name            =   "宋体"
  61.             Size            =   9
  62.             Charset         =   134
  63.             Weight          =   400
  64.             Underline       =   0   'False
  65.             Italic          =   0   'False
  66.             Strikethrough   =   0   'False
  67.          EndProperty
  68.          MousePointer    =   0
  69.          BackColor       =   -2147483643
  70.          ForeColor       =   -2147483640
  71.          BackColorFixed  =   -2147483633
  72.          ForeColorFixed  =   -2147483630
  73.          BackColorSel    =   -2147483635
  74.          ForeColorSel    =   -2147483634
  75.          BackColorBkg    =   8421504
  76.          BackColorAlternate=   -2147483643
  77.          GridColor       =   -2147483633
  78.          GridColorFixed  =   -2147483632
  79.          TreeColor       =   -2147483632
  80.          FloodColor      =   192
  81.          SheetBorder     =   -2147483642
  82.          FocusRect       =   1
  83.          HighLight       =   1
  84.          AllowSelection  =   -1  'True
  85.          AllowBigSelection=   -1  'True
  86.          AllowUserResizing=   0
  87.          SelectionMode   =   0
  88.          GridLines       =   1
  89.          GridLinesFixed  =   2
  90.          GridLineWidth   =   1
  91.          Rows            =   5000
  92.          Cols            =   10
  93.          FixedRows       =   1
  94.          FixedCols       =   0
  95.          RowHeightMin    =   0
  96.          RowHeightMax    =   0
  97.          ColWidthMin     =   0
  98.          ColWidthMax     =   0
  99.          ExtendLastCol   =   0   'False
  100.          FormatString    =   ""
  101.          ScrollTrack     =   0   'False
  102.          ScrollBars      =   3
  103.          ScrollTips      =   0   'False
  104.          MergeCells      =   0
  105.          MergeCompare    =   0
  106.          AutoResize      =   -1  'True
  107.          AutoSizeMode    =   0
  108.          AutoSearch      =   0
  109.          AutoSearchDelay =   2
  110.          MultiTotals     =   -1  'True
  111.          SubtotalPosition=   1
  112.          OutlineBar      =   0
  113.          OutlineCol      =   0
  114.          Ellipsis        =   0
  115.          ExplorerBar     =   0
  116.          PicturesOver    =   0   'False
  117.          FillStyle       =   0
  118.          RightToLeft     =   0   'False
  119.          PictureType     =   0
  120.          TabBehavior     =   0
  121.          OwnerDraw       =   0
  122.          Editable        =   0
  123.          ShowComboButton =   1
  124.          WordWrap        =   0   'False
  125.          TextStyle       =   0
  126.          TextStyleFixed  =   0
  127.          OleDragMode     =   0
  128.          OleDropMode     =   0
  129.          DataMode        =   0
  130.          VirtualData     =   -1  'True
  131.          DataMember      =   ""
  132.          ComboSearch     =   3
  133.          AutoSizeMouse   =   -1  'True
  134.          FrozenRows      =   0
  135.          FrozenCols      =   0
  136.          AllowUserFreezing=   0
  137.          BackColorFrozen =   0
  138.          ForeColorFrozen =   0
  139.          WallPaperAlignment=   9
  140.          AccessibleName  =   ""
  141.          AccessibleDescription=   ""
  142.          AccessibleValue =   ""
  143.          AccessibleRole  =   24
  144.       End
  145.       Begin VB.CommandButton Ydcommand1 
  146.          Height          =   300
  147.          Index           =   0
  148.          Left            =   -71160
  149.          Picture         =   "公用_基础分类设置.frx":0902
  150.          Style           =   1  'Graphical
  151.          TabIndex        =   10
  152.          Top             =   3780
  153.          Visible         =   0   'False
  154.          Width           =   300
  155.       End
  156.       Begin VB.CommandButton BcCommand 
  157.          Caption         =   "保存(&S)"
  158.          Height          =   300
  159.          Left            =   -72195
  160.          TabIndex        =   2
  161.          Top             =   1980
  162.          Width           =   1120
  163.       End
  164.       Begin VB.CommandButton QxCommand 
  165.          Cancel          =   -1  'True
  166.          Caption         =   "取消(&C)"
  167.          Height          =   300
  168.          Left            =   -70995
  169.          TabIndex        =   3
  170.          Top             =   1980
  171.          Width           =   1120
  172.       End
  173.       Begin VB.TextBox LrText 
  174.          Height          =   300
  175.          Index           =   1
  176.          Left            =   -72615
  177.          TabIndex        =   1
  178.          Text            =   "1"
  179.          Top             =   960
  180.          Width           =   2745
  181.       End
  182.       Begin VB.TextBox LrText 
  183.          Height          =   300
  184.          Index           =   0
  185.          Left            =   -72615
  186.          TabIndex        =   0
  187.          Text            =   "0"
  188.          Top             =   570
  189.          Width           =   1980
  190.       End
  191.       Begin VB.Label TsLabel 
  192.          AutoSize        =   -1  'True
  193.          Caption         =   "分类名称:"
  194.          Height          =   180
  195.          Index           =   1
  196.          Left            =   -74355
  197.          TabIndex        =   14
  198.          Top             =   1020
  199.          Width           =   810
  200.       End
  201.       Begin VB.Label TsLabel 
  202.          AutoSize        =   -1  'True
  203.          Caption         =   "分类编码:"
  204.          Height          =   180
  205.          Index           =   0
  206.          Left            =   -74355
  207.          TabIndex        =   13
  208.          Top             =   630
  209.          Width           =   810
  210.       End
  211.       Begin VB.Label Lbl_codescheme 
  212.          AutoSize        =   -1  'True
  213.          Height          =   180
  214.          Left            =   -72585
  215.          TabIndex        =   12
  216.          Top             =   1410
  217.          Width           =   810
  218.       End
  219.       Begin VB.Label Label1 
  220.          AutoSize        =   -1  'True
  221.          Caption         =   "编码方案:"
  222.          Height          =   180
  223.          Left            =   -74355
  224.          TabIndex        =   11
  225.          Top             =   1410
  226.          Width           =   810
  227.       End
  228.    End
  229.    Begin MSComctlLib.ImageList ImageList2 
  230.       Left            =   780
  231.       Top             =   750
  232.       _ExtentX        =   1005
  233.       _ExtentY        =   1005
  234.       BackColor       =   -2147483643
  235.       ImageWidth      =   16
  236.       ImageHeight     =   16
  237.       MaskColor       =   12632256
  238.       _Version        =   393216
  239.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  240.          NumListImages   =   4
  241.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  242.             Picture         =   "公用_基础分类设置.frx":0C8C
  243.             Key             =   "T"
  244.          EndProperty
  245.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  246.             Picture         =   "公用_基础分类设置.frx":1566
  247.             Key             =   "C"
  248.          EndProperty
  249.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  250.             Picture         =   "公用_基础分类设置.frx":1E40
  251.             Key             =   "Cl"
  252.          EndProperty
  253.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  254.             Picture         =   "公用_基础分类设置.frx":2E92
  255.             Key             =   "O"
  256.          EndProperty
  257.       EndProperty
  258.    End
  259.    Begin VB.PictureBox picSplitter 
  260.       BackColor       =   &H00C0C0C0&
  261.       BorderStyle     =   0  'None
  262.       FillColor       =   &H00808080&
  263.       Height          =   6360
  264.       Left            =   2850
  265.       ScaleHeight     =   2769.417
  266.       ScaleMode       =   0  'User
  267.       ScaleWidth      =   468
  268.       TabIndex        =   9
  269.       Top             =   660
  270.       Visible         =   0   'False
  271.       Width           =   45
  272.    End
  273.    Begin MSComctlLib.TreeView TreeView 
  274.       Height          =   6435
  275.       Left            =   30
  276.       TabIndex        =   8
  277.       Top             =   660
  278.       Width           =   2775
  279.       _ExtentX        =   4895
  280.       _ExtentY        =   11351
  281.       _Version        =   393217
  282.       Indentation     =   617
  283.       LabelEdit       =   1
  284.       Style           =   7
  285.       ImageList       =   "ImageList2"
  286.       Appearance      =   1
  287.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  288.          Name            =   "宋体"
  289.          Size            =   9
  290.          Charset         =   134
  291.          Weight          =   400
  292.          Underline       =   0   'False
  293.          Italic          =   0   'False
  294.          Strikethrough   =   0   'False
  295.       EndProperty
  296.    End
  297.    Begin MSComctlLib.Toolbar SzToolbar 
  298.       Align           =   1  'Align Top
  299.       Height          =   555
  300.       Left            =   0
  301.       TabIndex        =   6
  302.       Top             =   0
  303.       Width           =   10290
  304.       _ExtentX        =   18150
  305.       _ExtentY        =   979
  306.       ButtonWidth     =   820
  307.       ButtonHeight    =   926
  308.       AllowCustomize  =   0   'False
  309.       Appearance      =   1
  310.       Style           =   1
  311.       ImageList       =   "ImageList1"
  312.       _Version        =   393216
  313.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  314.          NumButtons      =   12
  315.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  316.             Caption         =   "设置"
  317.             Key             =   "ymsz"
  318.             ImageKey        =   "sz"
  319.          EndProperty
  320.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  321.             Caption         =   "打印"
  322.             Key             =   "dy"
  323.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  324.             ImageKey        =   "dy"
  325.          EndProperty
  326.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  327.             Caption         =   "预览"
  328.             Key             =   "yl"
  329.             ImageKey        =   "yl"
  330.          EndProperty
  331.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  332.             Style           =   3
  333.          EndProperty
  334.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  335.             Caption         =   "增加"
  336.             Key             =   "zj"
  337.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  338.             ImageKey        =   "xz"
  339.          EndProperty
  340.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  341.             Caption         =   "修改"
  342.             Key             =   "xg"
  343.             ImageKey        =   "xg"
  344.          EndProperty
  345.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  346.             Caption         =   "删除"
  347.             Key             =   "sc"
  348.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  349.             ImageKey        =   "sc"
  350.          EndProperty
  351.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  352.             Style           =   3
  353.          EndProperty
  354.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  355.             Caption         =   "刷新"
  356.             Key             =   "sx"
  357.             ImageKey        =   "sx"
  358.          EndProperty
  359.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  360.             Style           =   3
  361.          EndProperty
  362.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  363.             Caption         =   "帮助"
  364.             Key             =   "bz"
  365.             ImageKey        =   "bz"
  366.          EndProperty
  367.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  368.             Caption         =   "退出"
  369.             Key             =   "fh"
  370.             ImageKey        =   "tc"
  371.          EndProperty
  372.       EndProperty
  373.       BorderStyle     =   1
  374.       Begin MSComctlLib.Toolbar GsToolbar 
  375.          Height          =   525
  376.          Left            =   7800
  377.          TabIndex        =   7
  378.          Top             =   0
  379.          Width           =   2475
  380.          _ExtentX        =   4366
  381.          _ExtentY        =   926
  382.          ButtonWidth     =   1455
  383.          ButtonHeight    =   926
  384.          AllowCustomize  =   0   'False
  385.          Appearance      =   1
  386.          Style           =   1
  387.          ImageList       =   "ImageList1"
  388.          _Version        =   393216
  389.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  390.             NumButtons      =   3
  391.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  392.                Caption         =   "保存格式"
  393.                Key             =   "bcgs"
  394.                ImageKey        =   "bcgs"
  395.             EndProperty
  396.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  397.                Caption         =   "默认列宽"
  398.                Key             =   "hfmrgs"
  399.                ImageKey        =   "mrlk"
  400.             EndProperty
  401.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  402.                Caption         =   "显示项目"
  403.                Key             =   "szxsxm"
  404.                ImageKey        =   "xsxm"
  405.             EndProperty
  406.          EndProperty
  407.       End
  408.    End
  409.    Begin MSComctlLib.ImageList ImageList1 
  410.       Left            =   2070
  411.       Top             =   480
  412.       _ExtentX        =   1005
  413.       _ExtentY        =   1005
  414.       BackColor       =   -2147483643
  415.       ImageWidth      =   16
  416.       ImageHeight     =   16
  417.       MaskColor       =   12632256
  418.       _Version        =   393216
  419.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  420.          NumListImages   =   29
  421.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  422.             Picture         =   "公用_基础分类设置.frx":322C
  423.             Key             =   "sz"
  424.          EndProperty
  425.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  426.             Picture         =   "公用_基础分类设置.frx":35C6
  427.             Key             =   "dy"
  428.          EndProperty
  429.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  430.             Picture         =   "公用_基础分类设置.frx":3960
  431.             Key             =   "yl"
  432.          EndProperty
  433.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  434.             Picture         =   "公用_基础分类设置.frx":3CFA
  435.             Key             =   "xg"
  436.          EndProperty
  437.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  438.             Picture         =   "公用_基础分类设置.frx":4094
  439.             Key             =   "zh"
  440.          EndProperty
  441.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  442.             Picture         =   "公用_基础分类设置.frx":442E
  443.             Key             =   "sh"
  444.          EndProperty
  445.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  446.             Picture         =   "公用_基础分类设置.frx":47C8
  447.             Key             =   "bc"
  448.          EndProperty
  449.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  450.             Picture         =   "公用_基础分类设置.frx":4B62
  451.             Key             =   "fq"
  452.          EndProperty
  453.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  454.             Picture         =   "公用_基础分类设置.frx":4EFC
  455.             Key             =   "bz"
  456.          EndProperty
  457.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  458.             Picture         =   "公用_基础分类设置.frx":5296
  459.             Key             =   "tc"
  460.          EndProperty
  461.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  462.             Picture         =   "公用_基础分类设置.frx":5630
  463.             Key             =   "bcgs"
  464.          EndProperty
  465.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  466.             Picture         =   "公用_基础分类设置.frx":59CA
  467.             Key             =   "mrlk"
  468.          EndProperty
  469.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  470.             Picture         =   "公用_基础分类设置.frx":5D64
  471.             Key             =   "xsxm"
  472.          EndProperty
  473.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  474.             Picture         =   "公用_基础分类设置.frx":60FE
  475.             Key             =   "first"
  476.          EndProperty
  477.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  478.             Picture         =   "公用_基础分类设置.frx":6498
  479.             Key             =   "prev"
  480.          EndProperty
  481.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  482.             Picture         =   "公用_基础分类设置.frx":6832
  483.             Key             =   "next"
  484.          EndProperty
  485.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  486.             Picture         =   "公用_基础分类设置.frx":6BCC
  487.             Key             =   "last"
  488.          EndProperty
  489.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  490.             Picture         =   "公用_基础分类设置.frx":6F66
  491.             Key             =   "xx"
  492.          EndProperty
  493.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  494.             Picture         =   "公用_基础分类设置.frx":7300
  495.             Key             =   "define"
  496.          EndProperty
  497.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  498.             Picture         =   "公用_基础分类设置.frx":769A
  499.             Key             =   "exec"
  500.          EndProperty
  501.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  502.             Picture         =   "公用_基础分类设置.frx":7A34
  503.             Key             =   "xz"
  504.          EndProperty
  505.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  506.             Picture         =   "公用_基础分类设置.frx":7DCE
  507.             Key             =   "sc"
  508.          EndProperty
  509.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  510.             Picture         =   "公用_基础分类设置.frx":8168
  511.             Key             =   "sx"
  512.          EndProperty
  513.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  514.             Picture         =   "公用_基础分类设置.frx":8502
  515.             Key             =   "cx"
  516.          EndProperty
  517.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  518.             Picture         =   "公用_基础分类设置.frx":889C
  519.             Key             =   "zd"
  520.          EndProperty
  521.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  522.             Picture         =   "公用_基础分类设置.frx":8C36
  523.             Key             =   "dz"
  524.          EndProperty
  525.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  526.             Picture         =   "公用_基础分类设置.frx":8FD0
  527.             Key             =   "ph"
  528.          EndProperty
  529.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  530.             Picture         =   "公用_基础分类设置.frx":936A
  531.             Key             =   "fz"
  532.          EndProperty
  533.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  534.             Picture         =   "公用_基础分类设置.frx":9704
  535.             Key             =   "dw"
  536.          EndProperty
  537.       EndProperty
  538.    End
  539.    Begin VB.Image imgSplitter 
  540.       Height          =   6465
  541.       Left            =   2820
  542.       MousePointer    =   9  'Size W E
  543.       Top             =   630
  544.       Width           =   90
  545.    End
  546. End
  547. Attribute VB_Name = "Gy_BaseSortSet"
  548. Attribute VB_GlobalNameSpace = False
  549. Attribute VB_Creatable = False
  550. Attribute VB_PredeclaredId = True
  551. Attribute VB_Exposed = False
  552. '*******************************************************
  553. '*    模 块 名 称 :基础分类设置
  554. '*    功 能 描 述 :分级设置(字段只有编码和名称)
  555. '*    程序员姓名  :徐强
  556. '*    最后修改人  :徐强
  557. '*    最后修改时间:2001/10/15
  558. '*    备        注:
  559. '*******************************************************
  560. Dim mbMoving As Boolean
  561. Const sglSplitLimit = 1000
  562. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  563. Dim jdzygs As Integer                    '控件焦点转移个数
  564. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  565. Public ReportTitle As String                '报表主标题
  566. Public Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  567. '以下为固定使用变量(网格)
  568. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  569. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  570. Public GridCode As String                   '显示网格网格代码
  571. Dim GridInf() As Variant                 '整个网格设置信息
  572. Dim Tsxx As String                       '系统提示信息
  573. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  574. Dim Sjhgd As Double                      '网格数据行高度
  575. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  576. Dim GridStr()  As String                 '网格列信息(字符型)
  577. Dim GridInt() As Integer                 '网格列信息(整型)
  578. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  579. '以下为固定使用变量(文本框)
  580. Dim Textvar() As Variant                 '存储变体型文本框信息
  581. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  582. Dim Textint() As Integer                 '存储整型文本框信息
  583. Dim Textstr() As String                  '存储字符型文本框信息
  584. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  585. Public TextGroupCode As String              '文本框录入分组编码
  586. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  587. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  588. Dim CurTextIndex As Integer              '当前文本框索引值
  589. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  590. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  591. Dim nodX As Node
  592. Public CodSchemeIndex As String             '编码方案编码
  593. Dim CodScheme As String                  '编码方案
  594. Dim ParentCode As String                 '上级编码
  595. Dim CodeLevel As Integer                 '编码级次
  596. Public str_TableName As String           '表名
  597. Public str_SortCode As String            '编码字段
  598. Public str_SortName As String            '名称字段
  599. Public str_Label As String               '标签名称
  600. Private Sub CzxsGrid_Click()
  601.     Dim count As Integer
  602.     With CzxsGrid
  603.         If Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls))) <> "" And .Rows <> .FixedRows Then
  604.             TreeView.Nodes("T" & Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls)))).Selected = True
  605.             TreeView.SetFocus
  606.         End If
  607.     End With
  608. End Sub
  609. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  610.     
  611.     jdzygs = 5
  612.     Select Case KeyAscii
  613.         Case vbKeyReturn
  614.             If Kjjdzy(jdzygs) Then
  615.                 KeyAscii = 0
  616.             End If
  617.         Case 39           '屏蔽"'"
  618.             KeyAscii = 0
  619.     End Select
  620. End Sub
  621. Private Sub Form_Load()
  622.     
  623.     SizeControls imgSplitter.Left
  624.     Add_Tree
  625.     Text_CodScheme
  626.     '调入打印页面设置窗体
  627.     Load Dyymctbl
  628.   
  629.     '以下为文本框处理程序(读入文本框录入信息)
  630.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  631.     Call Wbkcsh
  632.   
  633.     '调入网格设置信息
  634.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  635.     Qslz = GridInf(1)
  636.     Sjhgd = GridInf(2)
  637.     Szzls = CzxsGrid.Cols - 1
  638.   
  639.     '填 充 网 格
  640.     Call Cxnrtcwg
  641.      
  642.     '初始化toolbar,tab卡状态
  643.     StTab.Tab = 0
  644.     StTab.TabEnabled(1) = False
  645.    
  646.     '设置为非录入状态
  647.     Lrzt = 0
  648.     TsLabel(0).Caption = str_Label & "编码:"
  649.     TsLabel(1).Caption = str_Label & "名称:"
  650.     LrText(0).Left = TsLabel(0).Left + TsLabel(0).Width + 60
  651.     LrText(1).Left = LrText(0).Left
  652.     Lbl_codescheme.Left = LrText(0).Left
  653. End Sub
  654. Private Sub Cxnrtcwg()                               '查询内容填充网格
  655.     
  656.     Dim Sqlstr As String              '查询连接串
  657.     Dim jsqte As Long                 '查询临时使用变量
  658.   
  659.     '为加快显示速度,将网格刷新动作冻结
  660.     CzxsGrid.Redraw = False
  661.   
  662.     '[>>查询连接串
  663.     Sqlstr = "SELECT * FROM " & str_TableName & " order by " & str_SortCode
  664.   
  665.     '<<]
  666.   
  667.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  668.     With Cxnrrec
  669.         CzxsGrid.Rows = CzxsGrid.FixedRows
  670.         If .EOF And .BOF Then
  671.             CzxsGrid.Redraw = True
  672.             Exit Sub
  673.         End If
  674.         jsqte = CzxsGrid.FixedRows
  675.         Do While Not .EOF
  676.             CzxsGrid.AddItem ""
  677.             Call Jltcwg(Cxnrrec, jsqte)                              '调入填充网格子过程
  678.             CzxsGrid.RowHeight(jsqte) = Sjhgd                        '设置网格高度
  679.             .MoveNext
  680.             jsqte = jsqte + 1
  681.         Loop
  682.     End With
  683.   
  684.     '将网格刷新动作解冻
  685.     CzxsGrid.Redraw = True
  686. End Sub
  687. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  688.     '[>>以下为自定义部分
  689.     With Jlbrec
  690.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields(str_SortCode))       '分类设置编码
  691.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields(str_SortName))       '分类设置名称
  692.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("CodeLevel") & "")   '级次
  693.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("EndFlag") & "")     '末级标志
  694.     End With
  695.     '以上为自定义部分<<]
  696. End Sub
  697. Private Sub Form_Resize()
  698.     
  699.     On Error Resume Next
  700.     Dim St_tab As Integer
  701.     If Me.Height < 7000 Then Me.Height = 7000
  702.     If Me.Width < 10000 Then Me.Width = 10000
  703.     StTab.Width = Me.Width - (TreeView.Width + 300)
  704.     StTab.Height = Me.Height - (StTab.Top + 400)
  705.     TreeView.Height = Me.Height - (TreeView.Top + 400)
  706.     imgSplitter.Height = TreeView.Height
  707.     St_tab = StTab.Tab
  708.     StTab.Tab = 0
  709.     CzxsGrid.Width = StTab.Width - CzxsGrid.Left * 2
  710.     CzxsGrid.Height = StTab.Height - 500
  711.     StTab.Tab = St_tab
  712.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  713. End Sub
  714. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  715.     
  716.     Set Cxnrrec = Nothing
  717.     Set Rec_CodeSet = Nothing
  718.     Unload Dyymctbl
  719. End Sub
  720. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  721.     
  722.     Dim jsqte As Integer
  723.   
  724.     '对文本框录入内容进行为零和为空判断(固定不变)
  725.     With Rec_CodeSet
  726.         For jsqte = 0 To Max_Text_Index
  727.             If Textint(jsqte, 8) = 1 Then     '字段不能为空
  728.                 If Len(Trim(LrText(jsqte).Text)) = 0 Then
  729.                     Tsxx = Textstr(jsqte, 7) & "不能为空!"
  730.                     Call Xtxxts(Tsxx, 0, 1)
  731.                     LrText(jsqte).SetFocus
  732.                     Bclrsj = False
  733.                     Exit Function
  734.                 End If
  735.             Else
  736.                 If Textint(jsqte, 8) = 2 Then   '字段不能为零
  737.                     If Val(Trim(LrText(jsqte).Text)) = 0 Then
  738.                         Tsxx = Textstr(jsqte, 7) & "不能为零!"
  739.                         Call Xtxxts(Tsxx, 0, 1)
  740.                         LrText(jsqte).SetFocus
  741.                         Bclrsj = False
  742.                         Exit Function
  743.                     End If
  744.                 End If
  745.             End If
  746.         Next jsqte
  747.     
  748.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  749.         For jsqte = 0 To Max_Text_Index
  750.             If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  751.                 If Not TextYxxpd(jsqte) Then
  752.                     Exit Function
  753.                 End If
  754.             End If
  755.         Next jsqte
  756.    
  757.         If Lrzt = 1 Then  '增 加
  758.         
  759.             '[>>判断编码是否重复
  760.             If .State = 1 Then .Close
  761.             .Open "SELECT * FROM " & str_TableName & " WHERE " & str_SortCode & "= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  762.             If Not .EOF Then
  763.                 Tsxx = str_Label & "编码重复!"
  764.                 Call Xtxxts(Tsxx, 0, 1)
  765.                 LrText(0).SetFocus
  766.                 Bclrsj = False
  767.                 Exit Function
  768.             End If
  769.     
  770.             '判断名称是否重复
  771.             If .State = 1 Then .Close
  772.             .Open "SELECT * FROM " & str_TableName & " WHERE " & str_SortName & "= '" + Trim(LrText(1).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  773.             If Not .EOF Then
  774.                 Tsxx = str_Label & "名称重复!"
  775.                 Call Xtxxts(Tsxx, 0, 1)
  776.                 LrText(1).SetFocus
  777.                 Bclrsj = False
  778.                 Exit Function
  779.             End If
  780.             '判断记录内容无误后,将记录内容写入数据表
  781.             On Error GoTo Swcwcl
  782.     
  783.             Cw_DataEnvi.DataConnect.BeginTrans
  784.    
  785.             .AddNew
  786.             .Fields(str_SortCode) = Trim(LrText(0).Text)    '分类设置编码
  787.             .Fields(str_SortName) = Trim(LrText(1).Text)    '分类设置名称
  788.             .Fields("ParentCode") = ParentCode              '上级编码
  789.             .Fields("CodeLevel") = CodeLevel                '编码级次
  790.             .Fields("EndFlag") = 1                          '末级标志
  791.             .Update
  792.             Cw_DataEnvi.DataConnect.Execute "update " & str_TableName & " set EndFlag=0  where " & str_SortCode & "='" & ParentCode & "'"
  793.     
  794.             Cw_DataEnvi.DataConnect.CommitTrans
  795.             If CodeLevel <> 1 Then
  796.                 Set nodX = TreeView.Nodes.Add("T" & ParentCode, 4, "T" & LrText(0).Text, "(" & Trim(LrText(0).Text) & ")" & Trim(LrText(1).Text), "C")
  797.                 nodX.EnsureVisible
  798.             Else
  799.                 Set nodX = TreeView.Nodes.Add("T", 4, "T" & LrText(0).Text, "(" & Trim(LrText(0).Text) & ")" & Trim(LrText(1).Text), "C")
  800.             End If
  801.             ParentCode = "": CodeLevel = 0
  802.    
  803.    
  804.             '将记录加入网格
  805.             Call Cxnrtcwg
  806.             Tsxx = "保存完毕!"
  807.             Call Xtxxts(Tsxx, 0, 4)
  808.             Call Cshlrxx(1)
  809.             LrText(0).SetFocus
  810.             '将网格按编码排序
  811.             With CzxsGrid
  812.                 .Col = Sydz("001", GridStr(), Szzls)
  813.                 CzxsGrid.Sort = flexSortStringAscending
  814.             End With
  815.             '<<]
  816.     
  817.         Else  '否则为修改记录
  818.  
  819.             If .State = 1 Then .Close
  820.             .Open "SELECT * FROM " & str_TableName & " WHERE " & str_SortName & "= '" + Trim(LrText(1).Text) + "' and " & str_SortCode & "<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  821.             If Not .EOF Then
  822.                 Tsxx = str_Label & "名称重复!"
  823.                 Call Xtxxts(Tsxx, 0, 1)
  824.                 LrText(1).SetFocus
  825.                 Bclrsj = False
  826.                 Exit Function
  827.             End If
  828.             On Error GoTo Swcwcl
  829.             Cw_DataEnvi.DataConnect.BeginTrans
  830.             If .State = 1 Then .Close
  831.             .Open "SELECT * FROM " & str_TableName & " WHERE " & str_SortCode & "= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  832.             If Not .EOF Then
  833.                 .Fields(str_SortName) = Trim(LrText(1).Text)    '类别名称
  834.                 .Update
  835.             End If
  836.             TreeView.Nodes("T" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls)))).Text = "(" & Trim(LrText(0).Text) & ")" & Trim(LrText(1).Text)
  837.             Cw_DataEnvi.DataConnect.CommitTrans
  838.    
  839.             '刷新当前网格
  840.             Sqlstr = "SELECT * FROM " & str_TableName & " WHERE " & str_SortCode & "= '" + Trim(LrText(0).Text) + "'"
  841.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  842.             With CzxsGrid
  843.                 Call Jltcwg(Cxnrrec, .Row)
  844.             End With
  845.    
  846.         End If
  847.      
  848.         '保存记录成功,函数返回真值
  849.         Bclrsj = True
  850.         Exit Function
  851.     End With
  852.  
  853. Swcwcl:
  854.     Cw_DataEnvi.DataConnect.RollbackTrans
  855.     Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  856.     Call Xtxxts(Tsxx, 0, 1)
  857.     Exit Function
  858. End Function
  859. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  860.     
  861.     TextChangeLock = True       '关闭文本框Chang事件
  862.     If lrztxx = 1 Then
  863.         '增加新记录时将文本框清空
  864.         For jsqte = 0 To Max_Text_Index
  865.             If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  866.                 LrText(jsqte).Text = ""
  867.                 LrText(jsqte).Tag = ""
  868.             End If
  869.             TextValiJudgeLock(jsqte) = True
  870.         Next jsqte
  871.         '[>>
  872.         '在此处可添加新增记录时初始化设置
  873.         '<<]
  874.     Else
  875.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  876.         With RecTemp
  877.             Sqlstr = "SELECT * FROM " & str_TableName & " Where " & str_SortCode & "='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'"
  878.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  879.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  880.             If Not RecTemp.EOF Then
  881.                 LrText(0).Text = Trim(.Fields("" & str_SortCode) & "")            '分类设置编码
  882.                 LrText(1).Text = Trim(.Fields(str_SortName) & "")            '分类设置名称
  883.             Else
  884.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  885.                 Call Xtxxts(Tsxx, 0, 4)
  886.                 Call Cancel
  887.                 TextChangeLock = False
  888.                 Exit Function
  889.             End If
  890.         End With
  891.     End If
  892.     Cshlrxx = True
  893.     TextChangeLock = False
  894. End Function
  895. Private Sub Scdqjl()                 '删 除 当 前 记 录
  896.     
  897.     Dim Yhanswer As Integer
  898.     Dim aDo_Rec As New Recordset
  899.     
  900.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  901.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  902.         Exit Sub
  903.     End If
  904.             
  905.     '非数据行不能删除
  906.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  907.         Exit Sub
  908.     End If
  909.   
  910.     '用户确认是否删除记录
  911.     Tsxx = "请确认是否删除当前记录?"
  912.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  913.     If Yhanswer = 2 Then
  914.         Exit Sub
  915.     End If
  916.   
  917.     Set aDo_Rec = Cw_DataEnvi.DataConnect.Execute("select * from " & str_TableName & " where ParentCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'")
  918.     If aDo_Rec.RecordCount > 0 Then
  919.         aDo_Rec.Close
  920.         Tsxx = "该项有下级,不能删除!"
  921.         Call Xtxxts(Tsxx, 0, 1)
  922.         Exit Sub
  923.     End If
  924.     aDo_Rec.Close
  925.   
  926.     On Error GoTo Cwcl
  927.   
  928.     Cw_DataEnvi.DataConnect.BeginTrans
  929.  
  930.     '[>>以下需自定义部分
  931.     Cw_DataEnvi.DataConnect.Execute "delete " & str_TableName & " where " & str_SortCode & "= '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  932.     
  933.     Dim i As Integer, LevelLeng As Integer
  934.     For i = 1 To Len(CodScheme)
  935.         LevelLeng = LevelLeng + Val(Mid(CodScheme, i, 1))
  936.         If Len(Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls)))) = LevelLeng Then
  937.             If i = 1 Then Exit For
  938.             
  939.             Set aDo_Rec = Cw_DataEnvi.DataConnect.Execute("select * from " & str_TableName & " where ParentCode='" & Mid(Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))), 1, LevelLeng - Val(Mid(CodScheme, i, 1))) & "'")
  940.             If aDo_Rec.RecordCount = 0 Then
  941.                 Cw_DataEnvi.DataConnect.Execute ("update " & str_TableName & " set EndFlag=1 where " & str_SortCode & "='" & Mid(Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))), 1, LevelLeng - Val(Mid(CodScheme, i, 1))) & "'")
  942.             End If
  943.             Exit For
  944.         End If
  945.     Next i
  946.     
  947.     Add_Tree
  948.     '以上为自定义部分<<]
  949.   
  950.     Cw_DataEnvi.DataConnect.CommitTrans
  951.   
  952.     '将记录加入网格
  953.     Call Cxnrtcwg
  954.     Exit Sub
  955.   
  956. Cwcl:
  957.     Cw_DataEnvi.DataConnect.RollbackTrans
  958.     If Err.Number = -2147217873 Then                '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  959.         Tsxx = "该" & str_Label & "已经被使用,不能删除!"
  960.         Call Xtxxts(Tsxx, 0, 1)
  961.         Exit Sub
  962.     Else
  963.         Tsxx = "出现未知情况,该" & str_Label & "不能被删除!"
  964.         Call Xtxxts(Tsxx, 0, 1)
  965.         Exit Sub
  966.     End If
  967. End Sub
  968. '*******************以下区域为编写自定义过程区域**********************
  969. '*******************以上区域为编写自定义过程区域**********************
  970. '******************以下为基本处理程序(固定不变)************************'
  971. Private Sub Add_Tree() '添加树项
  972.     
  973.     Dim aDo_Sort As New Recordset
  974.     TreeView.Nodes.Clear
  975.     TreeView.Nodes.Add , 4, "T", str_Label, "T"
  976.     
  977.     Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select a.*,mj=(select count(*) from " & str_TableName & " where " & str_TableName & ".ParentCode=a." & str_SortCode & ") from " & str_TableName & " a order by a." & str_SortCode)
  978.     With aDo_Sort
  979.         Do While Not .EOF
  980.             If Trim("" & aDo_Sort!ParentCode) = "" Then
  981.                 If !mj < 1 Then
  982.                     Set nodX = TreeView.Nodes.Add("T", 4, "T" & Trim(.Fields("" & str_SortCode)), "(" & Trim(.Fields("" & str_SortCode)) & ")" & Trim(.Fields("" & str_SortName)), "C")
  983.                 Else
  984.                     Set nodX = TreeView.Nodes.Add("T", 4, "T" & Trim(.Fields("" & str_SortCode)), "(" & Trim(.Fields("" & str_SortCode)) & ")" & Trim(.Fields("" & str_SortName)), "Cl")
  985.                 End If
  986.                 nodX.EnsureVisible
  987.             Else
  988.                 If !mj < 1 Then
  989.                     Set nodX = TreeView.Nodes.Add("T" & Trim(!ParentCode), 4, "T" & Trim(.Fields("" & str_SortCode)), "(" & Trim(.Fields("" & str_SortCode)) & ")" & Trim(.Fields("" & str_SortName)), "C")
  990.                 Else
  991.                     Set nodX = TreeView.Nodes.Add("T" & Trim(!ParentCode), 4, "T" & Trim(.Fields("" & str_SortCode)), "(" & Trim(.Fields("" & str_SortCode)) & ")" & Trim(.Fields("" & str_SortName)), "Cl")
  992.                 End If
  993.             End If
  994.             .MoveNext
  995.         Loop
  996.     End With
  997. End Sub
  998.  
  999. '编码方案
  1000. Private Sub Text_CodScheme()
  1001.     
  1002.     Dim aDo_Sort As New Recordset
  1003.     Dim i As Integer, h As Integer
  1004.     Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select * from Gy_CodeScheme where ItemCode='" & Trim(CodSchemeIndex) & "'")
  1005.     CodScheme = Trim(aDo_Sort!codescheme)
  1006.     aDo_Sort.Close
  1007.     StTab.Tab = 1
  1008.     Lbl_codescheme.Caption = ""
  1009.     For i = 1 To Len(CodScheme)
  1010.         For h = 1 To Val(Mid(CodScheme, i, 1))
  1011.             Lbl_codescheme = Lbl_codescheme & "*"
  1012.         Next
  1013.         Lbl_codescheme = Lbl_codescheme & " "
  1014.     Next i
  1015.     Lbl_codescheme = Trim(Lbl_codescheme)
  1016. End Sub
  1017. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1018.     
  1019.     With imgSplitter
  1020.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  1021.     End With
  1022.     picSplitter.Visible = True
  1023.     mbMoving = True
  1024. End Sub
  1025. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1026.     
  1027.     Dim sglPos As Single
  1028.     If mbMoving Then
  1029.         sglPos = X + imgSplitter.Left
  1030.         If sglPos < sglSplitLimit Then
  1031.             picSplitter.Left = sglSplitLimit
  1032.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  1033.             picSplitter.Left = Me.Width - sglSplitLimit
  1034.         Else
  1035.             picSplitter.Left = sglPos
  1036.         End If
  1037.     End If
  1038. End Sub
  1039. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1040.     
  1041.     SizeControls picSplitter.Left
  1042.     picSplitter.Visible = False
  1043.     mbMoving = False
  1044.    ' StTab.Refresh
  1045. End Sub
  1046. Private Sub SizeControls(X As Single)
  1047.     
  1048.     On Error Resume Next
  1049.     '设置 Width 属性
  1050.     If X < 2000 Then X = 2000
  1051.     If X > (Me.Width - 5000) Then X = Me.Width - 5000
  1052.     TreeView.Width = X - 100
  1053.     imgSplitter.Left = X
  1054.     StTab.Left = X + 40
  1055.     StTab.Width = Me.Width - (TreeView.Width + 300)
  1056.     '设置 Top 属性
  1057. '    TreeView.Top = tbToolBar.Height + picTitles.Height
  1058.     StTab.Top = TreeView.Top
  1059.     '设置 height 属性
  1060. '    TreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  1061.     'Frame1.Width = StTab.Width - Frame1.Left * 2
  1062.     Dim St_tab As Integer
  1063.     St_tab = StTab.Tab
  1064.     StTab.Tab = 0
  1065.     CzxsGrid.Width = StTab.Width - CzxsGrid.Left * 2
  1066.     StTab.Tab = St_tab
  1067.     StTab.Height = TreeView.Height
  1068.     imgSplitter.Top = TreeView.Top
  1069.     imgSplitter.Height = TreeView.Height
  1070. End Sub
  1071. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1072.     
  1073.     If Shift = 2 Then
  1074.         Select Case UCase(Chr(KeyCode))
  1075.             Case "P"                                                                          'Ctrl+P 打印
  1076.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1077.                     Call bbyl(False)
  1078.                 End If
  1079.             Case "A"                                                                          'Ctrl+A 增加
  1080.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1081.                 If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1082.                     Exit Sub
  1083.                 End If
  1084.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1085.                     Call Toolbjzt
  1086.                     Lrzt = 1
  1087.                     Call Cshlrxx(Lrzt)
  1088.                     LrText(0).Enabled = True
  1089.                     LrText(0).SetFocus
  1090.                 End If
  1091.             Case "D"                                                                          'Ctrl+D 删除
  1092.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1093.                     Call Scdqjl
  1094.                 End If
  1095.         End Select
  1096.     End If
  1097. End Sub
  1098. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1099.     
  1100.     Select Case Button.Key
  1101.         Case "ymsz"                                          '页面设置
  1102.             Dyymctbl.Show 1
  1103.         Case "yl"                                            '预 览
  1104.             Call bbyl(True)
  1105.         Case "dy"                                            '打 印
  1106.             Call bbyl(False)
  1107.         Case "zj"                                            '增 加
  1108.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1109.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1110.                 Exit Sub
  1111.             End If
  1112.             Call Toolbjzt
  1113.             Lrzt = 1
  1114.             Call Cshlrxx(Lrzt)
  1115.             LrText(0).Enabled = True
  1116.             LrText(0).SetFocus
  1117.         Case "xg"                                            '修 改
  1118.             Call Xgdqjl
  1119.         Case "sc"                                            '删 除
  1120.             
  1121.             Call Scdqjl
  1122.         Case "sx"                                            '刷 新
  1123.             Call Cxnrtcwg
  1124.             Add_Tree
  1125.         Case "bz"                                            '帮 助
  1126.             Call F1bz
  1127.         Case "fh"                                            '退 出
  1128.             Unload Me
  1129.     End Select
  1130. End Sub
  1131. Private Sub CzxsGrid_DblClick()                            '修改当前编码记录
  1132.     Call Xgdqjl
  1133. End Sub
  1134. Private Sub Xgdqjl()                                       '修改当前编码记录
  1135.     
  1136.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1137.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  1138.         BcCommand.Enabled = False
  1139.     End If
  1140.     
  1141.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1142.         Exit Sub
  1143.     End If
  1144.     Call Toolbjzt
  1145.     Lrzt = 2
  1146.     If Cshlrxx(Lrzt) Then
  1147.         LrText(1).SetFocus
  1148.         LrText(0).Enabled = False
  1149.     End If
  1150. End Sub
  1151. Private Sub Toolbjzt()                                     'Toolbar状态(编辑状态)
  1152.     
  1153.     StTab.TabEnabled(1) = True
  1154.     StTab.Tab = 1
  1155.     StTab.TabEnabled(0) = False
  1156.     CzxsGrid.Enabled = False
  1157.     With SzToolbar
  1158.         .Buttons("ymsz").Enabled = False
  1159.         .Buttons("dy").Enabled = False
  1160.         .Buttons("yl").Enabled = False
  1161.         .Buttons("zj").Enabled = False
  1162.         .Buttons("xg").Enabled = False
  1163.         .Buttons("sc").Enabled = False
  1164.         .Buttons("sx").Enabled = False
  1165.     End With
  1166.     TreeView.Enabled = False
  1167. End Sub
  1168. Private Sub Toolfbjzt()                                    'Toolbar状态(非编辑状态)
  1169.     
  1170.     StTab.TabEnabled(0) = True
  1171.     StTab.Tab = 0
  1172.     CzxsGrid.Enabled = True
  1173.     StTab.TabEnabled(1) = False
  1174.     Lrzt = 0
  1175.     With SzToolbar
  1176.         .Buttons("ymsz").Enabled = True
  1177.         .Buttons("dy").Enabled = True
  1178.         .Buttons("yl").Enabled = True
  1179.         .Buttons("zj").Enabled = True
  1180.         .Buttons("xg").Enabled = True
  1181.         .Buttons("sc").Enabled = True
  1182.         .Buttons("sx").Enabled = True
  1183.     End With
  1184.     TreeView.Enabled = True
  1185. End Sub
  1186. Private Sub BcCommand_Click()                                           '保 存
  1187.     
  1188.     If Not Bclrsj Then
  1189.         Exit Sub
  1190.     End If
  1191.     If Lrzt = 2 Then
  1192.         Call Toolfbjzt
  1193.     End If
  1194.     
  1195. End Sub
  1196. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)       '取消
  1197.     
  1198.     '避免执行Click程序
  1199.     Bln_Cancel = True
  1200.   
  1201.     Call Cancel
  1202.     
  1203. End Sub
  1204. Private Sub QxCommand_Click()                                                                         '取消
  1205.     
  1206.     If Bln_Cancel Then
  1207.         Bln_Cancel = False
  1208.         Exit Sub
  1209.     End If
  1210.  
  1211.     Call Cancel
  1212. End Sub
  1213. Private Sub Cancel()                                                                                  '取消
  1214.     
  1215.     '文本框加锁
  1216.     For jsqte = 0 To Max_Text_Index
  1217.         TextValiJudgeLock(jsqte) = True
  1218.     Next jsqte
  1219.   
  1220.     Call Toolfbjzt
  1221.     
  1222. End Sub
  1223. Private Sub CzxsGrid_AfterMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1224.     FnBln_RefreshArray Col, Position, GridStr(), GridInf()
  1225. End Sub
  1226. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1227.     
  1228.     Select Case Button.Key
  1229.         Case "bcgs"                                       '保存表格格式
  1230.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1231.         Case "hfmrgs"                                     '恢复默认格式
  1232.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1233.         Case "szxsxm"                                     '设置显示项目
  1234.             Call Szxsxm(CzxsGrid, GridCode)
  1235.     End Select
  1236. End Sub
  1237. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1238.   
  1239.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1240.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1241.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1242.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1243.     ReDim Bbxbt(1 To Bbxbtgs)
  1244.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1245.     If Bbbwhgs <> 0 Then
  1246.         ReDim Bbbwh(1 To Bbbwhgs)
  1247.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1248.     End If
  1249.     Bbzbt = ReportTitle
  1250.     Bbxbt(1) = " "
  1251.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1252.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1253.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1254.     If Not bbylte Then
  1255.         Unload DY_Tybbyldy
  1256.     End If
  1257. End Sub
  1258. '************以下为文本框录入处理程序(固定不变部分)*************'
  1259. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1260.     '以下为依据实际情况自定义部分[
  1261.     
  1262.     '在此填写文本框录入事后处理程序
  1263.     
  1264.     ']以上为依据实际情况自定义部分
  1265. End Sub
  1266. Private Sub LrText_Change(Index As Integer)
  1267.     '屏蔽程序改变控制
  1268.     If TextChangeLock Then
  1269.         Exit Sub
  1270.     End If
  1271.     
  1272.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1273.         
  1274.     '限制字段录入长度
  1275.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1276.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  1277.     Select Case Textint(Index, 1)
  1278.         Case 8, 11      '金额型
  1279.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1280.         Case 9, 12      '数量型
  1281.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1282.         Case 10          '单价型
  1283.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1284.         Case Else        '其他小数类型控制
  1285.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1286.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1287.             End If
  1288.     End Select
  1289.         
  1290.     TextChangeLock = False '解锁
  1291. End Sub
  1292. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1293.     
  1294.     Call TextShow(Index)
  1295.     CurTextIndex = Index
  1296.     LrText(Index).SelStart = Len(LrText(Index))
  1297. End Sub
  1298. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1299.     
  1300.     Select Case KeyCode
  1301.         Case vbKeyF2
  1302.             Call Text_Help(Index)
  1303.     End Select
  1304. End Sub
  1305. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1306.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1307. End Sub
  1308. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1309.     '显示相应信息但不能进行有效性判断
  1310. End Sub
  1311. Private Sub TreeView_Collapse(ByVal Node As MSComctlLib.Node)
  1312.     
  1313.     If Node.Index <> 1 And Node.Key <> "T" Then
  1314.         Node.Image = "Cl"
  1315.     End If
  1316. End Sub
  1317. Private Sub TreeView_Expand(ByVal Node As MSComctlLib.Node)
  1318.     
  1319.     If Node.Index <> 1 And Node.Key <> "T" Then
  1320.         Node.Image = "O"
  1321.     End If
  1322. End Sub
  1323. Private Sub TreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  1324.     
  1325.     Dim code_row As Integer
  1326.     With CzxsGrid
  1327.         code_row = .FindRow(Trim(Mid(TreeView.SelectedItem.Key, 2)), , Sydz("001", GridStr(), Szzls))
  1328.         If code_row <> -1 Then
  1329.             .Select code_row, 0
  1330.         End If
  1331.     End With
  1332. End Sub
  1333. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)     '按钮提供帮助
  1334.     Call Text_Help(Index)
  1335. End Sub
  1336. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1337.     
  1338.     If Not Textboolean(Index, 1) Then
  1339.         Exit Sub
  1340.     End If
  1341.    
  1342.     '调用帮助
  1343.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1344.   
  1345.     '根据设置选择显示编码和名称,并进行存储
  1346.     If Len(Xtfhcs) <> 0 Then
  1347.         If Textint(Index, 3) = 1 Then
  1348.             LrText(Index).Text = Xtfhcsfz
  1349.             LrText(Index).Tag = Xtfhcs
  1350.         Else
  1351.             LrText(Index).Text = Xtfhcs
  1352.             LrText(Index).Tag = Xtfhcsfz
  1353.         End If
  1354.     End If
  1355.    
  1356.     LrText(Index).SetFocus
  1357.     
  1358. End Sub
  1359. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1360.     '填写文本框得到焦点,进行相应信息处理程序
  1361. End Sub
  1362. Private Sub Wbkcsh()                          '录入文本框初始化
  1363.     
  1364.     Dim jsqte As Integer
  1365.     '最大录入文本框索引值
  1366.     Max_Text_Index = Textvar(1)
  1367.   
  1368.     ReDim TextValiJudgeLock(Max_Text_Index)
  1369.     For jsqte = 0 To Max_Text_Index
  1370.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1371.             If Textboolean(jsqte, 1) Then
  1372.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  1373.                     Load Ydcommand1(jsqte)
  1374.                 End If
  1375.                 Ydcommand1(jsqte).Visible = True
  1376.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  1377.             End If
  1378.             TextChangeLock = True
  1379.             LrText(jsqte).Text = ""
  1380.             LrText(jsqte).Tag = ""
  1381.             If Textint(jsqte, 5) <> 0 Then
  1382.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  1383.             End If
  1384.             TextChangeLock = False
  1385.         End If
  1386.         TextValiJudgeLock(jsqte) = True
  1387.     Next jsqte
  1388. End Sub
  1389. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  1390.     
  1391.     Dim Sqlstr As String
  1392.     Dim Findrec As ADODB.Recordset
  1393.   
  1394.     '文本框内容未曾改变不进行有效性判断
  1395.     If TextValiJudgeLock(Index) Then
  1396.         TextYxxpd = True
  1397.         Exit Function
  1398.     End If
  1399.   
  1400.     '文本框内容为空认为有效,并清空其Tag值
  1401.     If Trim(LrText(Index)) = "" Then
  1402.         LrText(Index).Tag = ""
  1403.         Call Wbklrwbcl(Index)
  1404.         TextValiJudgeLock(Index) = True
  1405.         TextYxxpd = True
  1406.         Exit Function
  1407.     End If
  1408.   
  1409.     '可在此加入不做有效性判断的理由
  1410.   
  1411.     Select Case Textint(Index, 4)
  1412.         Case 1      '编码型
  1413.             Sqlstr = Trim(Textstr(Index, 5))
  1414.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1415.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1416.             If Findrec.EOF Then
  1417.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1418.                 LrText(Index).SetFocus
  1419.                 Exit Function
  1420.             Else
  1421.                 Select Case Textint(Index, 3)
  1422.                     Case 0
  1423.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1424.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1425.                         End If
  1426.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1427.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1428.                         End If
  1429.                     Case 1
  1430.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1431.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1432.                         End If
  1433.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1434.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1435.                         End If
  1436.                 End Select
  1437.             End If
  1438.         Case 2      '日期型
  1439.             If IsDate(LrText(Index).Text) Then
  1440.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1441.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  1442.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1443.                 End If
  1444.             Else
  1445.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1446.                 Call Xtxxts(Tsxx, 0, 1)
  1447.                 LrText(Index).SetFocus
  1448.                 Exit Function
  1449.             End If
  1450.         Case 3      '其他类型
  1451.             If Index = 0 Then
  1452.                 Dim i As Integer, LevelLeng As Integer, tf As Boolean
  1453.                 For i = 1 To Len(CodScheme)
  1454.                     LevelLeng = LevelLeng + Val(Mid(CodScheme, i, 1))
  1455.                     If Len(Trim(LrText(0))) = LevelLeng Then
  1456.                         tf = True: Exit For
  1457.                     Else
  1458.                         tf = False
  1459.                     End If
  1460.                 Next i
  1461.                 '--------------
  1462.                 If tf = False Then
  1463.                     Tsxx = "非法编码方式!  "
  1464.                     Call Xtxxts(Tsxx, 0, 1)
  1465.                     LrText(Index).SetFocus
  1466.                     Exit Function
  1467.                 End If
  1468.                 '---------------
  1469.                 If Len(Trim(LrText(0))) <> Val(Mid(CodScheme, 1, 1)) Then
  1470.                     With CzxsGrid
  1471.                         ParentCode = Mid(Trim(LrText(0)), 1, LevelLeng - Val(Mid(CodScheme, i, 1)))
  1472.                         code_row = .FindRow(ParentCode, , Sydz("001", GridStr(), Szzls))
  1473.                         If code_row = -1 Then
  1474.                             ParentCode = ""
  1475.                             Tsxx = "没有上级编码!  "
  1476.                             Call Xtxxts(Tsxx, 0, 1)
  1477.                             LrText(Index).SetFocus
  1478.                             Exit Function
  1479.                         End If
  1480.                     End With
  1481.                 End If
  1482.                 CodeLevel = i
  1483.             End If
  1484.     End Select
  1485.     
  1486.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1487.     TextValiJudgeLock(Index) = True
  1488.     '调用文本框事后处理程序
  1489.     Call Wbklrwbcl(Index)
  1490.    
  1491.     '有效性判断通过则返回True
  1492.     TextYxxpd = True
  1493.        
  1494. End Function