++
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:66k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "VSLIGHT6.OCX"
- Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "tabctl32.ocx"
- Begin VB.Form Khgl_GroupData
- Caption = "考核组考核数据录入"
- ClientHeight = 7020
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10410
- HelpContextID = 2313003
- Icon = "考核组考核数据录入.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form2"
- ScaleHeight = 7020
- ScaleWidth = 10410
- StartUpPosition = 2 '屏幕中心
- Begin VB.Frame Frame2
- Height = 615
- Left = 30
- TabIndex = 15
- Top = 600
- Width = 4300
- Begin MSComctlLib.ImageCombo Imgcbo_Title
- Height = 315
- Left = 1140
- TabIndex = 16
- Top = 180
- Width = 3000
- _ExtentX = 5292
- _ExtentY = 556
- _Version = 393216
- ForeColor = -2147483640
- BackColor = -2147483643
- End
- Begin VB.Label Lbl_CheckCode
- Caption = "考核类别:"
- Height = 195
- Left = 180
- TabIndex = 17
- Top = 240
- Width = 975
- End
- End
- Begin MSComctlLib.ImageList ImageList2
- Left = 840
- Top = 840
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 4
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":1042
- Key = "T"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":191C
- Key = "C"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":21F6
- Key = "Cl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":3248
- Key = "O"
- EndProperty
- EndProperty
- End
- Begin VB.PictureBox picSplitter
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- FillColor = &H00808080&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 6300
- Left = 2850
- ScaleHeight = 2743.291
- ScaleMode = 0 'User
- ScaleWidth = 468
- TabIndex = 9
- Top = 720
- Visible = 0 'False
- Width = 45
- End
- Begin MSComctlLib.TreeView TreeView
- Height = 5685
- Left = 30
- TabIndex = 8
- Top = 1260
- Width = 2775
- _ExtentX = 4895
- _ExtentY = 10028
- _Version = 393217
- Indentation = 617
- LabelEdit = 1
- Style = 7
- ImageList = "ImageList2"
- Appearance = 1
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin TabDlg.SSTab StTab
- Height = 5715
- Left = 2940
- TabIndex = 5
- Top = 1260
- Width = 7425
- _ExtentX = 13097
- _ExtentY = 10081
- _Version = 393216
- Style = 1
- Tabs = 2
- TabHeight = 520
- TabCaption(0) = "列表视图"
- TabPicture(0) = "考核组考核数据录入.frx":35E2
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "CzxsGrid"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).ControlCount= 1
- TabCaption(1) = "单张视图"
- TabPicture(1) = "考核组考核数据录入.frx":35FE
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "TsLabel(7)"
- Tab(1).Control(1)= "TsLabel(4)"
- Tab(1).Control(2)= "TsLabel(5)"
- Tab(1).Control(3)= "LrText(0)"
- Tab(1).Control(4)= "QxCommand"
- Tab(1).Control(5)= "BcCommand"
- Tab(1).Control(6)= "LrText(1)"
- Tab(1).Control(7)= "LrText(2)"
- Tab(1).Control(8)= "Ydcommand1(2)"
- Tab(1).ControlCount= 9
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 2
- Left = -70545
- Picture = "考核组考核数据录入.frx":361A
- Style = 1 'Graphical
- TabIndex = 18
- Top = 1320
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = -73410
- TabIndex = 2
- Text = "2"
- Top = 1305
- Width = 2865
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = -73410
- TabIndex = 1
- Text = "1"
- Top = 930
- Width = 3135
- End
- Begin VB.CommandButton BcCommand
- Caption = "保存(&S)"
- Height = 300
- Left = -72570
- TabIndex = 3
- Top = 1860
- Width = 1120
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = -71370
- TabIndex = 4
- Top = 1860
- Width = 1120
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = -73410
- TabIndex = 0
- Text = "0"
- Top = 540
- Width = 1618
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 5145
- Left = 90
- TabIndex = 14
- Top = 480
- Width = 7245
- _ExtentX = 12779
- _ExtentY = 9075
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = 8421504
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0 'False
- ShowComboButton = -1 'True
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "考核组名称:"
- Height = 180
- Index = 5
- Left = -74445
- TabIndex = 21
- Top = 990
- Width = 990
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "考核组编码:"
- Height = 180
- Index = 4
- Left = -74445
- TabIndex = 20
- Top = 600
- Width = 990
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "测评者:"
- Height = 180
- Index = 7
- Left = -74445
- TabIndex = 19
- Top = 1380
- Width = 690
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "测评者:"
- Height = 180
- Index = 3
- Left = -74550
- TabIndex = 13
- Top = 1980
- Width = 630
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "部门:"
- Height = 180
- Index = 2
- Left = -74550
- TabIndex = 12
- Top = 1530
- Width = 450
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "工号:"
- Height = 180
- Index = 0
- Left = -74550
- TabIndex = 11
- Top = 630
- Width = 450
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "姓名:"
- Height = 180
- Index = 1
- Left = -74550
- TabIndex = 10
- Top = 1080
- Width = 450
- End
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 570
- Left = 0
- TabIndex = 6
- Top = 0
- Width = 10410
- _ExtentX = 18362
- _ExtentY = 1005
- ButtonWidth = 820
- ButtonHeight = 953
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 13
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "ymsz"
- ImageKey = "sz"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- Object.ToolTipText = "点击或按Ctrl+P打印表格"
- ImageKey = "dy"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageKey = "yl"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "增加"
- Key = "zj"
- Object.ToolTipText = "点击或按Ctrl+A增加记录"
- ImageKey = "xz"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "sc"
- Object.ToolTipText = "点击或按Ctrl+D删除当前记录"
- ImageKey = "sc"
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageKey = "sx"
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "考核"
- Key = "kh"
- ImageKey = "zb"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 540
- Left = 7920
- TabIndex = 7
- Top = 0
- Width = 2475
- _ExtentX = 4366
- _ExtentY = 953
- ButtonWidth = 1455
- ButtonHeight = 953
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 1500
- Top = 840
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 34
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":39A4
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":3D3E
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":40D8
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":4472
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":480C
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":4BA6
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":4F40
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":52DA
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":5674
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":5A0E
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":5DA8
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":6142
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":64DC
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":6876
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":6C10
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":6FAA
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":7344
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":76DE
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":7A78
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":7E12
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":81AC
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":8546
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":88E0
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":8C7A
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":9014
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":93AE
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":9748
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":9AE2
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":9E7C
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":A216
- Key = "gb"
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":A5B0
- Key = "cp"
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":A94A
- Key = "dx"
- EndProperty
- BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":ACE4
- Key = "zb"
- EndProperty
- BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "考核组考核数据录入.frx":B07E
- Key = "ys"
- EndProperty
- EndProperty
- End
- Begin VB.Image imgSplitter
- Height = 6465
- Left = 2820
- MousePointer = 9 'Size W E
- Top = 630
- Width = 90
- End
- End
- Attribute VB_Name = "Khgl_GroupData"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模 块 名 称 :考核组考核数据录入
- '* 功 能 描 述 :
- '* 程序员姓名 :张洪军
- '* 最后修改人 :张洪军
- '* 最后修改时间:2001/12/19
- '* 备 注:封版
- '*******************************************************
- Dim str_TitleCode As String '考核类别编码
- Dim str_TitleName As String '考核类别名称
- Dim str_titleRoot As String '考核类别根结点编码
- Dim int_titleRootlen As Integer '考核类别根结点编码长度
- Dim str_GroupCode As String '考核组编码
- Dim mbMoving As Boolean
- Const sglSplitLimit = 1000
- Dim Rec_CodeSet As New ADODB.Recordset '编码设置表
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Lrzt As Integer '录入状态标志(0-非录入状态 1-增加 2-修改)
- Dim ReportTitle As String '报表主标题
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Szzls As Integer '数组总列数(网格列数-1)
- '以下为固定使用变量(文本框)
- Dim Textvar() As Variant '存储变体型文本框信息
- Dim Textboolean() As Boolean '存储布尔型文本框信息
- Dim Textint() As Integer '存储整型文本框信息
- Dim Textstr() As String '存储字符型文本框信息
- Dim Max_Text_Index As Integer '最大录入文本框索引值
- Dim TextGroupCode As String '文本框录入分组编码
- Dim TextValiLock As Boolean '文本框失去焦点是否进行有效性控制判断
- Dim TextValiJudgeLock() As Boolean '文本框录入有效性判断控制锁
- Dim CurTextIndex As Integer '当前文本框索引值
- Dim TextChangeLock As Boolean '文本框内容变换控制锁
- Dim Bln_Cancel As Boolean '取消按钮信息传递
- Dim nodX As Node
- Dim CodSchemeIndex As String '编码方案编码
- Dim CodScheme As String '编码方案
- Dim ParentCode As String '上级编码
- Dim CodeLevel As Integer '编码级次
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- jdzygs = 10
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load()
- SizeControls imgSplitter.Left
- '填充考核类别列表框
- Call AddTitleCode
- str_titleRoot = TitleRoot()
- Add_Tree
- '打印报表标题信息
- ReportTitle = "考核组考核数据录入"
- '调入打印页面设置窗体
- XtReportCode = "Khgl_GroupData"
- Load Dyymctbl
- '以下为文本框处理程序(读入文本框录入信息)
- TextGroupCode = "Khgl_GroupData"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
- Call Wbkcsh
- '调入网格设置信息
- GridCode = "Khgl_GroupData"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- Call Cxnrtcwg
- '初始化toolbar,tab卡状态
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- '显示当前考核类别名称
- Imgcbo_Title.Refresh
- 'Frame1.Enabled = False
- '设置为非录入状态
- Lrzt = 0
- End Sub
- Private Sub Cxnrtcwg() '查询内容填充网格
- Dim Sqlstr As String '查询连接串
- Dim Jsqte As Long '查询临时使用变量
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = False
- '[>>查询连接串
- Sqlstr = " SELECT DISTINCT dbo.Kh_BaseMain.ValListCode , dbo.Kh_ValList.ValListName , " & _
- " dbo.Kh_BaseMain.ValListCodeID , dbo.Kh_BaseMain.GroupCode ," & _
- " dbo.Kh_Group.GroupName " & _
- " FROM dbo.Kh_ValList " & _
- " RIGHT OUTER JOIN dbo.Kh_BaseMain ON " & _
- " dbo.Kh_ValList.ValListCode = dbo.Kh_BaseMain.ValListCode " & _
- " LEFT OUTER JOIN dbo.Kh_Group ON " & _
- " dbo.Kh_BaseMain.GroupCode = dbo.Kh_Group.GroupCode " & _
- " where dbo.Kh_BaseMain.GroupCode='" & str_GroupCode & "'" & _
- " and dbo.Kh_BaseMain.TitleCode='" & str_TitleCode & "'" & _
- " order by dbo.Kh_BaseMain.ValListCode,dbo.Kh_BaseMain.ValListCodeID "
- '<<]
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Cxnrrec
- CzxsGrid.Rows = CzxsGrid.FixedRows
- If .EOF And .BOF Then
- CzxsGrid.Redraw = True
- Exit Sub
- End If
- Jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- CzxsGrid.AddItem ""
- Call Jltcwg(Cxnrrec, Jsqte) '调入填充网格子过程
- CzxsGrid.RowHeight(Jsqte) = Sjhgd '设置网格高度
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- '将网格刷新动作解冻
- CzxsGrid.Redraw = True
- '判断考核数据有效性
- Call IsSuccess
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- '[>>以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("GroupCode") & "") '考核组编码
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("GroupName") & "") '考核组名称
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("ValListCode") & "") '测评者编码
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("ValListName") & "") '测评者
- CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("ValListCodeID") & "") '测评者序号
- End With
- '以上为自定义部分<<]
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- Dim St_tab As Integer
- If Me.Height < 7000 Then Me.Height = 7000
- If Me.Width < 10000 Then Me.Width = 10000
- StTab.Width = Me.Width - (TreeView.Width + 300)
- StTab.Height = Me.Height - (StTab.Top + 400)
- TreeView.Height = Me.Height - (TreeView.Top + 400)
- imgSplitter.Height = TreeView.Height
- St_tab = StTab.Tab
- StTab.Tab = 0
- CzxsGrid.Width = StTab.Width - CzxsGrid.Left * 2
- CzxsGrid.Height = StTab.Height - 600
- StTab.Tab = St_tab
- GsToolbar.Left = Me.Width - GsToolbar.Width - 140
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- Set Cxnrrec = Nothing
- Set Rec_CodeSet = Nothing
- Unload Dyymctbl
- End Sub
- Private Function Bclrsj() As Boolean '判断录入数据有效性,并保存数据
- Dim Jsqte As Integer
- Dim MaxNumber, MaxID As Integer '考核数据最大号,测评者最大号
- Dim rec_temp As New Recordset '临时记录集
- '对文本框录入内容进行为零和为空判断(固定不变)
- With Rec_CodeSet
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 8) = 1 Then '字段不能为空
- If Len(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- Else
- If Textint(Jsqte, 8) = 2 Then '字段不能为零
- If Val(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- Next Jsqte
- '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
- If Not TextYxxpd(Jsqte) Then
- Exit Function
- End If
- End If
- Next Jsqte
- If Lrzt = 1 Then '增 加
- '[>>判断编码是否重复
- If .State = 1 Then .Close
- .Open "SELECT * FROM Kh_BaseMain ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- ' If Not .EOF Then
- ' Tsxx = "类别编码重复!"
- ' Call Xtxxts(Tsxx, 0, 1)
- ' LrText(0).SetFocus
- '
- ' Bclrsj = False
- ' Exit Function
- ' End If
- '判断记录内容无误后,将记录内容写入数据表
- On Error GoTo Swcwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- MaxNumber = MaxNum(0)
- MaxID = MaxNum(1)
- rec_temp.Open "select EmpID from Kh_GroupSub where GroupCode='" & str_GroupCode & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- Do While Not rec_temp.EOF
- .AddNew
- .Fields("BaseMainID") = MaxNumber 'ID号
- .Fields("TitleCode") = str_TitleCode '考核类别
- .Fields("EmpID") = rec_temp.Fields("EmpID") '考核对象id号
- .Fields("GroupCode") = str_GroupCode '考核组编码
- .Fields("ValListCode") = Trim(LrText(2).Tag) '测评者
- .Fields("ValListCodeID") = MaxID '测评者序号
- .Fields("BaseTotal") = 0 '考核总分
- .Update
- MaxNumber = MaxNumber + 1
- rec_temp.MoveNext
- Loop
- Cw_DataEnvi.DataConnect.CommitTrans
- '将记录加入网格
- Call Cxnrtcwg
- Tsxx = "保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Call Cshlrxx(1)
- LrText(2).SetFocus
- '将网格按编码排序
- ' With CzxsGrid
- ' .Col = Sydz("001", GridStr(), Szzls)
- ' CzxsGrid.Sort = flexSortStringAscending
- ' End With
- '<<]
- End If
- '保存记录成功,函数返回真值
- Bclrsj = True
- Exit Function
- End With
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End Function
- Private Function Cshlrxx(lrztxx As Integer) As Boolean '初始化录入字段信息
- TextChangeLock = True '关闭文本框Chang事件
- If lrztxx = 1 Then
- '增加新记录时将文本框清空
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- LrText(Jsqte).Text = ""
- LrText(Jsqte).Tag = ""
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- '[>>
- '在此处可添加新增记录时初始化设置
- With RecTemp
- Sqlstr = "SELECT GroupCode,GroupName FROM Kh_Group Where GroupCode='" & str_GroupCode & "' "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- '记录如存在则读入其内容,否则提示记录已被其他人删除
- If Not RecTemp.EOF Then
- LrText(0).Text = Trim(.Fields("GroupCode") & "") '考核组编码
- LrText(1).Text = Trim(.Fields("GroupName") & "") '考核组名称
- End If
- End With
- LrText(0).Enabled = False
- LrText(1).Enabled = False
- '<<]
- End If
- Cshlrxx = True
- TextChangeLock = False
- End Function
- Private Sub Scdqjl() '删 除 当 前 记 录
- Dim yhAnswer As Integer
- Dim aDo_Rec As New Recordset
- Dim str_sql As String
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log("Khgl_Result_edit", Xtczybm, 1) Then
- Exit Sub
- End If
- '非数据行不能删除
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- '用户确认是否删除记录
- Tsxx = "请确认是否删除当前记录?"
- yhAnswer = Xtxxts(Tsxx, 2, 2)
- If yhAnswer = 2 Then
- Exit Sub
- End If
- On Error GoTo Cwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- '[>>以下需自定义部分
- str_sql = " delete Kh_BaseSub from Kh_BaseSub,Kh_BaseMain " & _
- " where Kh_BaseMain.GroupCode = '" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'" & _
- " and Kh_BaseMain.ValListCode = '" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'" & _
- " and Kh_BaseMain.ValListCodeid = " & Val(Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("005", GridStr(), Szzls)))) & _
- " and Kh_BaseMain.BaseMainID = Kh_BaseSub.BaseMainID "
- Cw_DataEnvi.DataConnect.Execute str_sql
- str_sql = " delete Kh_BaseMain " & _
- " where GroupCode = '" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'" & _
- " and ValListCode = '" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))) & "'" & _
- " and ValListCodeid = " & Val(Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("005", GridStr(), Szzls))))
- Cw_DataEnvi.DataConnect.Execute str_sql
- 'Add_Tree
- '以上为自定义部分<<]
- Cw_DataEnvi.DataConnect.CommitTrans
- '将记录加入网格
- Call Cxnrtcwg
- Exit Sub
- Cwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- If Err.Number = -2147217873 Then '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
- Tsxx = "该测评者已经被使用,不能删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- Else
- Tsxx = "出现未知情况,该测评者不能被删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- End Sub
- '*******************以下区域为编写自定义过程区域**********************
- Private Sub Imgcbo_Title_Click()
- str_GroupCode = ""
- str_TitleCode = GetComboKey(Imgcbo_Title, 0)
- str_titleRoot = Mid(str_TitleCode, 1, int_titleRootlen)
- str_TitleName = Imgcbo_Title.Text
- Add_Tree
- Call Cxnrtcwg
- End Sub
- Private Function AddTitleCode()
- Dim RecExist As New Recordset
- FillImageCombo Imgcbo_Title, "Khgl_TitleCompute", 1
- Sqlstr = "SELECT TitleCode,titleName From Kh_Title where (endflag=1 and CloseFlag=0 and CreateTime=(select max(createTime) from kh_title where endflag=1 and CloseFlag=0 ))"
- Set RecExist = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not RecExist.EOF Then
- If Len(Trim(RecExist.Fields("titleName"))) > 0 Then
- Imgcbo_Title.Text = RecExist.Fields("titleName")
- str_TitleName = RecExist.Fields("titleName")
- End If
- End If
- str_TitleCode = GetComboKey(Imgcbo_Title, 0)
- End Function
- Private Function TitleRoot() As String
- Dim RecTemp As New Recordset '临时记录集
- '取考核类别编码方案
- Sqlstr = "select * from Gy_CodeScheme where ItemCode='" & Trim("Khgl_Title") & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- int_titleRootlen = Mid(RecTemp.Fields("CodeScheme"), 1, 1)
- '取考核类别编码的根结点编码
- TitleRoot = Mid(str_TitleCode, 1, int_titleRootlen)
- RecTemp.Close
- End Function
- '函数dykh,调用考核窗体
- Private Sub dykh()
- Dim str_Temp As String '考核类别编码
- Dim rec_Recordset As New Recordset '临时记录集
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log("Khgl_Result_edit", Xtczybm, 1) Then
- Exit Sub
- End If
- If CzxsGrid.Row <= 0 Then
- Exit Sub
- End If
- '当前测评者
- str_Temp = Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls)))
- If Len(Trim(str_Temp)) = 0 Then
- Tsxx = "请选择测评者!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- '设置考核类别编码
- Khgl_GroupDataSub.str_TitleCode = str_TitleCode
- Khgl_GroupDataSub.str_GroupCode = CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))
- Khgl_GroupDataSub.str_ValListCode = CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))
- Khgl_GroupDataSub.int_ValListCodeID = CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("005", GridStr(), Szzls))
- '设置考核类别名称
- Khgl_GroupDataSub.TsLabel(0).Caption = Khgl_GroupDataSub.TsLabel(0).Caption + str_TitleName
- '设置考核组名称
- Khgl_GroupDataSub.TsLabel(1).Caption = Khgl_GroupDataSub.TsLabel(1).Caption + CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("002", GridStr(), Szzls))
- '设置测评者
- Khgl_GroupDataSub.TsLabel(2).Caption = Khgl_GroupDataSub.TsLabel(2).Caption + CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("004", GridStr(), Szzls))
- '设置测评者序号
- Khgl_GroupDataSub.TsLabel(3).Caption = Khgl_GroupDataSub.TsLabel(3).Caption + CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("005", GridStr(), Szzls))
- Khgl_GroupDataSub.Show 1
- Call Cxnrtcwg
- End Sub
- Private Function MaxNum(Index As Integer) As Integer
- '读取最大号,参数0取单据最大号,1取测评者最大号
- Dim str_sql As String
- Dim rec_temp As New Recordset
- MaxNum = 0
- If Index = 0 Then
- str_sql = "select max(BaseMainID) as MaxNumber from Kh_BaseMain"
- Else
- str_sql = " select max(ValListCodeID) as MaxNumber from Kh_BaseMain " & _
- " where TitleCode = '" & str_TitleCode & "'" & _
- " and ValListCode = '" & Trim(LrText(2).Tag) & "'" & _
- " and GroupCode = '" & Trim(str_GroupCode) & "'"
- End If
- Set rec_temp = Cw_DataEnvi.DataConnect.Execute(str_sql)
- If Not IsNull(Trim(rec_temp.Fields("MaxNumber"))) Then
- MaxNum = Trim(rec_temp.Fields("MaxNumber"))
- Else
- MaxNum = 0
- End If
- MaxNum = MaxNum + 1
- End Function
- Private Sub IsSuccess()
- '判断考核数据有效性
- Dim str_sql As String
- Dim rec_temp As New Recordset
- Dim rec_obj As New Recordset
- Dim int_row, int_col, int_Count, lsjsq As Integer
- Dim str_titleRoot As String '考核类别根结点编码
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = False
- '取考核类别编码方案
- sql_str = "select * from Gy_CodeScheme where ItemCode='" & Trim("Khgl_Title") & "'"
- Set rec_temp = Cw_DataEnvi.DataConnect.Execute(sql_str)
- '取考核类别编码的根结点编码
- str_titleRoot = Mid(str_TitleCode, 1, Mid(rec_temp.Fields("CodeScheme"), 1, 1))
- rec_temp.Close
- '取当前考核类别的考核要素记录数
- Sqlstr = " SELECT FactorCode " & _
- " FROM Kh_v_ValMark where TitleCode='" & str_titleRoot & "'" & _
- " Order By ValMarkID"
- Set rec_temp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- int_Count = rec_temp.RecordCount
- rec_temp.Close
- For int_row = CzxsGrid.Rows - 1 To CzxsGrid.FixedRows Step -1
- '取当前考核组的成员
- Sqlstr = " SELECT 1," & Chr(10) & _
- " RsCount=(select count(1) from Kh_BaseMain LEFT OUTER JOIN Kh_BaseSub " & Chr(10) & _
- " on Kh_BaseMain.BaseMainid=Kh_BaseSub.BaseMainid " & Chr(10) & _
- " where Kh_BaseMain.TitleCode='" & str_TitleCode & "'" & Chr(10) & _
- " and Kh_BaseMain.GroupCode='" & CzxsGrid.TextMatrix(int_row, Sydz("001", GridStr(), Szzls)) & "'" & Chr(10) & _
- " and Kh_BaseMain.ValListCode='" & CzxsGrid.TextMatrix(int_row, Sydz("003", GridStr(), Szzls)) & "'" & Chr(10) & _
- " and Kh_BaseMain.ValListCodeID=" & CzxsGrid.TextMatrix(int_row, Sydz("005", GridStr(), Szzls)) & ")" & Chr(10) & _
- " FROM Kh_BaseMain LEFT OUTER JOIN Kh_BaseSub" & Chr(10) & _
- " on Kh_BaseMain.BaseMainid=Kh_BaseSub.BaseMainid " & Chr(10) & _
- " where Kh_BaseMain.TitleCode='" & str_TitleCode & "'" & Chr(10) & _
- " and Kh_BaseMain.GroupCode='" & CzxsGrid.TextMatrix(int_row, Sydz("001", GridStr(), Szzls)) & "'" & Chr(10) & _
- " and Kh_BaseMain.ValListCode='" & CzxsGrid.TextMatrix(int_row, Sydz("003", GridStr(), Szzls)) & "'" & Chr(10) & _
- " and Kh_BaseMain.ValListCodeID=" & CzxsGrid.TextMatrix(int_row, Sydz("005", GridStr(), Szzls)) & Chr(10) & _
- " group by Kh_BaseMain.empid"
- Set rec_obj = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- '如果(考核要素个数*考核成员个数)与考核数据子表的个数相等,则认为有效,否则无效
- If rec_obj.EOF Then
- '如果没有考核成员,则认为无效
- CzxsGrid.Cell(flexcpBackColor, int_row, Qslz, int_row, CzxsGrid.Cols - 1) = &HE0E0E0
- Else
- If int_Count * rec_obj.RecordCount <> rec_obj.Fields("RsCount") Then
- CzxsGrid.Cell(flexcpBackColor, int_row, Qslz, int_row, CzxsGrid.Cols - 1) = &HE0E0E0
- End If
- End If
- rec_obj.Close
- Next int_row
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = True
- End Sub
- '*******************以上区域为编写自定义过程区域**********************
- '******************以下为基本处理程序(固定不变)************************'
- Private Sub Add_Tree() '添加树项
- Dim aDo_Sort As New Recordset
- Dim Sqlstr As String '临时字符串
- Sqlstr = "SELECT GroupCode,GroupName from Kh_Group where TitleCode='" & str_TitleCode & "' order by TitleCode,GroupCode"
- TreeView.Nodes.Clear
- TreeView.Nodes.Add , 4, "T", "考核组", "T"
- Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With aDo_Sort
- Do While Not .EOF
- Set nodX = TreeView.Nodes.Add("T", 4, "!" & Trim(.Fields("GroupCode")), Trim(.Fields("GroupName")), "C")
- nodX.Tag = Trim(.Fields("GroupCode"))
- nodX.EnsureVisible
- .MoveNext
- Loop
- End With
- End Sub
- '编码方案
- Private Sub Text_CodScheme()
- Dim aDo_Sort As New Recordset
- Dim i As Integer, h As Integer
- Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select * from Gy_CodeScheme where ItemCode='" & Trim(CodSchemeIndex) & "'")
- CodScheme = Trim(aDo_Sort!CodeScheme)
- aDo_Sort.Close
- '-------------
- StTab.Tab = 1
- Lbl_codescheme.Caption = ""
- For i = 1 To Len(CodScheme)
- For h = 1 To Val(Mid(CodScheme, i, 1))
- Lbl_codescheme = Lbl_codescheme & "*"
- Next
- Lbl_codescheme = Lbl_codescheme & " "
- Next i
- Lbl_codescheme = Trim(Lbl_codescheme)
- End Sub
- Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- With imgSplitter
- picSplitter.Move .Left, .Top, .Width 2, .Height - 20
- End With
- picSplitter.Visible = True
- mbMoving = True
- End Sub
- Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim sglPos As Single
- If mbMoving Then
- sglPos = X + imgSplitter.Left
- If sglPos < sglSplitLimit Then
- picSplitter.Left = sglSplitLimit
- ElseIf sglPos > Me.Width - sglSplitLimit Then
- picSplitter.Left = Me.Width - sglSplitLimit
- Else
- picSplitter.Left = sglPos
- End If
- End If
- End Sub
- Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- SizeControls picSplitter.Left
- picSplitter.Visible = False
- mbMoving = False
- ' StTab.Refresh
- End Sub
- Private Sub SizeControls(X As Single)
- On Error Resume Next
- '设置 Width 属性
- If X < 2000 Then X = 2000
- If X > (Me.Width - 5000) Then X = Me.Width - 5000
- TreeView.Width = X - 100
- imgSplitter.Left = X
- StTab.Left = X + 40
- StTab.Width = Me.Width - (TreeView.Width + 300)
- '设置 Top 属性
- TreeView.Top = tbToolBar.Height + picTitles.Height
- StTab.Top = TreeView.Top
- '设置 height 属性
- TreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
- 'Frame1.Width = StTab.Width - Frame1.Left * 2
- Dim St_tab As Integer
- St_tab = StTab.Tab
- StTab.Tab = 0
- CzxsGrid.Width = StTab.Width - CzxsGrid.Left * 2
- StTab.Tab = St_tab
- StTab.Height = TreeView.Height
- imgSplitter.Top = TreeView.Top
- imgSplitter.Height = TreeView.Height
- End Sub
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作
- If Shift = 2 Then
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
- Call bbyl(False)
- End If
- Case "A" 'Ctrl+A 增加
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log("Khgl_Result_edit", Xtczybm, 1) Then
- Exit Sub
- End If
- If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- LrText(0).Enabled = True
- LrText(0).SetFocus
- End If
- Case "D" 'Ctrl+D 删除
- If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
- Call Scdqjl
- End If
- End Select
- End If
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "zj" '增 加
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log("Khgl_Result_edit", Xtczybm, 1) Then
- Exit Sub
- End If
- If Not (Len(str_GroupCode) > 0) Then Exit Sub
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- If CzxsGrid.Row > 0 Then
- LrText(0) = Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls)))
- End If
- LrText(2).Enabled = True
- LrText(2).SetFocus
- Case "sc" '删 除
- Call Scdqjl
- Case "sx" '刷 新
- Call Cxnrtcwg
- 'Add_Tree
- Case "kh" '考核窗体
- Call dykh
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- End Sub
- Private Sub Xgdqjl() '修改当前编码记录
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- Call Toolbjzt
- Lrzt = 2
- If Cshlrxx(Lrzt) Then
- LrText(1).SetFocus
- LrText(0).Enabled = False
- End If
- LrText(2).Enabled = False
- Ydcommand1(2).Enabled = False
- End Sub
- Private Sub Toolbjzt() 'Toolbar状态(编辑状态)
- StTab.TabEnabled(1) = True
- StTab.Tab = 1
- StTab.TabEnabled(0) = False
- CzxsGrid.Enabled = False
- With SzToolbar
- .Buttons("ymsz").Enabled = False
- .Buttons("dy").Enabled = False
- .Buttons("yl").Enabled = False
- .Buttons("zj").Enabled = False
- .Buttons("sc").Enabled = False
- .Buttons("sx").Enabled = False
- .Buttons("kh").Enabled = False
- End With
- TreeView.Enabled = False
- Imgcbo_Title.Enabled = False
- End Sub
- Private Sub Toolfbjzt() 'Toolbar状态(非编辑状态)
- StTab.TabEnabled(0) = True
- StTab.Tab = 0
- CzxsGrid.Enabled = True
- StTab.TabEnabled(1) = False
- Lrzt = 0
- With SzToolbar
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- .Buttons("zj").Enabled = True
- .Buttons("sc").Enabled = True
- .Buttons("sx").Enabled = True
- .Buttons("kh").Enabled = True
- End With
- TreeView.Enabled = True
- Imgcbo_Title.Enabled = True
- End Sub
- Private Sub BcCommand_Click() '保 存
- If Not Bclrsj Then
- Exit Sub
- End If
- If Lrzt = 2 Then
- Call Toolfbjzt
- End If
- End Sub
- Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) '取消
- '避免执行Click程序
- Bln_Cancel = True
- Call Cancel
- End Sub
- Private Sub QxCommand_Click() '取消
- If Bln_Cancel Then
- Bln_Cancel = False
- Exit Sub
- End If
- Call Cancel
- End Sub
- Private Sub Cancel() '取消
- '文本框加锁
- For Jsqte = 0 To Max_Text_Index
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- Call Toolfbjzt
- End Sub
- Private Sub CzxsGrid_AfterMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- FnBln_RefreshArray Col, Position, GridStr(), GridInf()
- End Sub
- Private Sub CzxsGrid_Click()
- Dim count As Integer
- With CzxsGrid
- If Trim(.TextMatrix(.Row, Sydz("002", GridStr(), Szzls))) <> "" And .Rows <> .FixedRows Then
- TreeView.SetFocus
- End If
- End With
- End Sub
- Private Sub CzxsGrid_DblClick()
- Call dykh
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CzxsGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CzxsGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(CzxsGrid, GridCode)
- End Select
- End Sub
- Private Sub bbyl(bbylte As Boolean) '报表打印预览
- Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
- Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
- Bbxbtgs = 2 '报 表 小 标 题 行 数
- Bbbwhgs = 0 '报 表 表 尾 行 数
- ReDim Bbxbt(1 To Bbxbtgs)
- ReDim bbxbtzzxs(1 To Bbxbtgs)
- If Bbbwhgs <> 0 Then
- ReDim Bbbwh(1 To Bbbwhgs)
- ReDim Bbbwhzzxs(1 To Bbbwhgs)
- End If
- Bbzbt = ReportTitle
- Bbxbt(1) = " "
- bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
- Bbxbt(2) = "考核类别:" + Imgcbo_Title.Text
- bbxbtzzxs(2) = 0 '居左
- Call Scyxsjb(CzxsGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- '在此填写文本框录入事后处理程序
- ']以上为依据实际情况自定义部分
- End Sub
- Private Sub LrText_Change(Index As Integer)
- '屏蔽程序改变控制
- If TextChangeLock Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = False '打开有效性判断锁
- '限制字段录入长度
- TextChangeLock = True '加锁(防止执行Lrtext_Change)
- Select Case Textint(Index, 1)
- Case 8, 11 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9, 12 '数量型
- Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
- Case 10 '单价型
- Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
- Case Else '其他小数类型控制
- If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
- Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
- End If
- End Select
- TextChangeLock = False '解锁
- End Sub
- Private Sub LrText_GotFocus(Index As Integer) '文本框得到焦点,显示相应信息
- Call TextShow(Index)
- CurTextIndex = Index
- LrText(Index).SelStart = Len(LrText(Index))
- End Sub
- Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) '字段按F2键提供帮助
- Select Case KeyCode
- Case vbKeyF2
- Call Text_Help(Index)
- End Select
- End Sub
- Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer) '文本框录入事中控制
- Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
- End Sub
- Private Sub LrText_LostFocus(Index As Integer) '文本框失去焦点
- '显示相应信息但不能进行有效性判断
- End Sub
- Private Sub TreeView_Collapse(ByVal Node As MSComctlLib.Node)
- If Node.Index <> 1 And Node.Key <> "T" Then
- Node.Image = "Cl"
- End If
- End Sub
- Private Sub TreeView_Expand(ByVal Node As MSComctlLib.Node)
- If Node.Index <> 1 And Node.Key <> "T" Then
- Node.Image = "O"
- End If
- End Sub
- Private Sub TreeView_NodeClick(ByVal Node As MSComctlLib.Node)
- '填 充 网 格
- str_GroupCode = Trim(Node.Tag)
- Call Cxnrtcwg
- End Sub
- Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) '按钮提供帮助
- Call Text_Help(Index)
- End Sub
- Private Sub Text_Help(Index As Integer) '录入字段帮助
- If Not Textboolean(Index, 1) Then
- Exit Sub
- End If
- '传递当前测评规则
- Xtcdcsfz = str_titleRoot
- '调用帮助
- Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
- '根据设置选择显示编码和名称,并进行存储
- If Len(Xtfhcs) <> 0 Then
- If Textint(Index, 3) = 1 Then
- LrText(Index).Text = Xtfhcsfz
- LrText(Index).Tag = Xtfhcs
- Else
- LrText(Index).Text = Xtfhcs
- LrText(Index).Tag = Xtfhcsfz
- End If
- End If
- LrText(Index).SetFocus
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- '填写文本框得到焦点,进行相应信息处理程序
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- Dim Jsqte As Integer
- '最大录入文本框索引值
- Max_Text_Index = Textvar(1)
- ReDim TextValiJudgeLock(Max_Text_Index)
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- If Textboolean(Jsqte, 1) Then
- If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
- Load Ydcommand1(Jsqte)
- End If
- Ydcommand1(Jsqte).Visible = True
- Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
- End If
- TextChangeLock = True
- LrText(Jsqte).Text = ""
- LrText(Jsqte).Tag = ""
- If Textint(Jsqte, 5) <> 0 Then
- LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
- End If
- TextChangeLock = False
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- End Sub
- Private Function TextYxxpd(Index As Integer) As Boolean '文本框有效性判断
- Dim Sqlstr As String
- Dim Findrec As ADODB.Recordset
- '文本框内容未曾改变不进行有效性判断
- If TextValiJudgeLock(Index) Then
- TextYxxpd = True
- Exit Function
- End If
- '文本框内容为空认为有效,并清空其Tag值
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call Wbklrwbcl(Index)
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- '可在此加入不做有效性判断的理由
- Select Case Textint(Index, 4)
- Case 1 '编码型
- Sqlstr = Trim(Textstr(Index, 5))
- Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
- Sqlstr = Replace(Sqlstr, "#", "'" + str_titleRoot + "'")
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF Then
- Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
- LrText(Index).SetFocus
- Exit Function
- Else
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- End Select
- End If
- Case 2 '日期型
- If IsDate(LrText(Index).Text) Then
- LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
- If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
- LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
- End If
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- If Index = 0 Then
- Dim i As Integer, LevelLeng As Integer, tf As Boolean
- For i = 1 To Len(CodScheme)
- LevelLeng = LevelLeng + Val(Mid(CodScheme, i, 1))
- If Len(Trim(LrText(0))) = LevelLeng Then
- tf = True: Exit For
- Else
- tf = False
- End If
- Next i
- '--------------
- If tf = False Then
- Tsxx = "非法编码方式! "
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- '---------------
- If Len(Trim(LrText(0))) <> Val(Mid(CodScheme, 1, 1)) Then
- With CzxsGrid
- ParentCode = Mid(Trim(LrText(0)), 1, LevelLeng - Val(Mid(CodScheme, i, 1)))
- code_row = .FindRow(ParentCode, , Sydz("001", GridStr(), Szzls))
- If code_row = -1 Then
- ParentCode = ""
- Tsxx = "没有上级编码! "
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- End With
- End If
- CodeLevel = i
- End If
- If Index = 4 Then
- If Val(LrText(Index).Text) > 6 Then
- Tsxx = "保留小数最大值为6!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- End If
- End Select
- '如果有效则加锁,用户不改变内容则不再进行有效性判断
- TextValiJudgeLock(Index) = True
- '调用文本框事后处理程序
- Call Wbklrwbcl(Index)
- '有效性判断通过则返回True
- TextYxxpd = True
- End Function