-
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:38k
源码类别:
企业管理
开发平台:
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"
- Begin VB.Form Khgl_FactorAnalyze
- Caption = "他评要素分析"
- ClientHeight = 7020
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 11820
- HelpContextID = 2314002
- Icon = "他评要素分析.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form2"
- MDIChild = -1 'True
- ScaleHeight = 7020
- ScaleWidth = 11820
- Begin VB.PictureBox Pic_Title
- Height = 825
- Left = 0
- Picture = "他评要素分析.frx":1042
- ScaleHeight = 765
- ScaleWidth = 11715
- TabIndex = 4
- Top = 540
- Width = 11775
- Begin MSComctlLib.ImageCombo Imgcbo_Title
- Height = 315
- Left = 1200
- TabIndex = 5
- Top = 180
- Width = 3000
- _ExtentX = 5292
- _ExtentY = 556
- _Version = 393216
- ForeColor = -2147483640
- BackColor = -2147483643
- End
- Begin VB.Label tsLabel
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "被考核对象:"
- ForeColor = &H00000000&
- Height = 195
- Index = 1
- Left = 4860
- TabIndex = 8
- Top = 240
- Width = 2775
- End
- Begin VB.Label tsLabel
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "考核类别:"
- ForeColor = &H00000000&
- Height = 195
- Index = 0
- Left = 240
- TabIndex = 6
- 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":1FAC4
- Key = "T"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2039E
- Key = "C"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":20C78
- Key = "Cl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":21CCA
- 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 = 5580
- Left = 2790
- ScaleHeight = 2429.772
- ScaleMode = 0 'User
- ScaleWidth = 468
- TabIndex = 2
- Top = 1380
- Visible = 0 'False
- Width = 45
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 570
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 11820
- _ExtentX = 20849
- _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 = 8
- 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 = "tx"
- Object.ToolTipText = "点击或按Ctrl+A增加记录"
- ImageKey = "tx"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 540
- Left = 10140
- TabIndex = 1
- Top = 0
- Width = 1695
- _ExtentX = 2990
- _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 = 2
- 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
- EndProperty
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 1500
- Top = 1020
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 35
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":22064
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":223FE
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":22798
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":22B32
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":22ECC
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":23266
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":23600
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2399A
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":23D34
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":240CE
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":24468
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":24802
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":24B9C
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":24F36
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":252D0
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2566A
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":25A04
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":25D9E
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":26138
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":264D2
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2686C
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":26C06
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":26FA0
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2733A
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":276D4
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":27A6E
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":27E08
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":281A2
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2853C
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":288D6
- Key = "gb"
- EndProperty
- BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":28C70
- Key = "cp"
- EndProperty
- BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2900A
- Key = "dx"
- EndProperty
- BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":293A4
- Key = "zb"
- EndProperty
- BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":2973E
- Key = "ys"
- EndProperty
- BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "他评要素分析.frx":29AD8
- Key = "tx"
- EndProperty
- EndProperty
- End
- Begin VSFlex8Ctl.VSFlexGrid CxbbGrid
- Height = 5595
- Left = 2820
- TabIndex = 3
- Top = 1380
- Width = 8235
- _ExtentX = 14526
- _ExtentY = 9869
- 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 = 13826538
- 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 MSComctlLib.TreeView TreeView
- Height = 5595
- Left = 0
- TabIndex = 7
- Top = 1380
- Width = 2775
- _ExtentX = 4895
- _ExtentY = 9869
- _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 VB.Image imgSplitter
- Height = 6465
- Left = 2820
- MousePointer = 9 'Size W E
- Top = 630
- Width = 90
- End
- End
- Attribute VB_Name = "Khgl_FactorAnalyze"
- 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_titleRoot As String '考核类别根结点编码
- Dim str_format As String '考核数据显示格式
- Dim int_EmpID As Integer '职工id号
- Dim int_titleRootlen As Integer '考核类别根结点长度
- Dim CheckFactor() As New CCheckFactor '考核指标、考核要素、指标权重、要素权重、考核得分
- 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 nodX As Node
- 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
- str_format = "########"
- '填充考核类别列表框
- Call AddTitleCode
- Call ShowFormat
- int_EmpID = -1
- Add_Tree
- '打印报表标题信息
- ReportTitle = "他评要素分析"
- '调入打印页面设置窗体
- XtReportCode = "Khgl_FactorAnalyze"
- Load Dyymctbl
- '调 入 网 格
- GridCode = "Khgl_FactorAnalyze"
- Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Sfxshjwg = GridInf(7)
- Szzls = CxbbGrid.Cols - 1
- '加快显示速度
- CxbbGrid.Redraw = False
- '添加列标题
- Call Sub_AddCol
- If int_EmpID > 0 Then
- '填 充 网 格
- Call Sub_Query
- End If
- Imgcbo_Title.Refresh
- End Sub
- Private Sub Sub_AddCol() '添加列标题
- Dim Rec_Query As New ADODB.Recordset '查询结果动态集
- Dim Sqlstr As String '查询字符串
- Dim Jsqte As Integer '临时动态计数器
- '以下为自定义部分[
- CxbbGrid.Redraw = False
- '填 充 网 格 标 题
- CxbbGrid.Cols = Sydz("001", GridStr(), Szzls) + 2
- CxbbGrid.TextMatrix(0, Sydz("001", GridStr(), Szzls)) = "测评规则编码"
- CxbbGrid.TextMatrix(0, Sydz("002", GridStr(), Szzls)) = "测评规则名称"
- CxbbGrid.TextMatrix(1, Sydz("001", GridStr(), Szzls)) = "测评规则编码"
- CxbbGrid.TextMatrix(1, Sydz("002", GridStr(), Szzls)) = "测评规则名称"
- '取考核类别编码方案
- Sqlstr = "select * from Gy_CodeScheme where ItemCode='" & Trim("Khgl_Title") & "'"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- '取考核类别编码的根结点编码
- int_titleRootlen = Val(Mid(Rec_Query.Fields("CodeScheme"), 1, 1))
- str_titleRoot = Mid(str_TitleCode, 1, int_titleRootlen)
- Rec_Query.Close
- '添加列标题
- ReDim CheckFactor(2)
- '本张单据查询字符串,填充考核要素编码、考核指标、考核要素名称
- Sqlstr = " SELECT FactorCode,FactorName,CheckName" & _
- " FROM Kh_v_ValMark where TitleCode='" & str_titleRoot & "'" & _
- " Order By ValMarkID"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With CxbbGrid
- .Cols = .FixedCols + Rec_Query.RecordCount
- For Jsqte = .FixedCols To .Cols - 1
- ReDim Preserve CheckFactor(UBound(CheckFactor) + 1)
- CheckFactor(Jsqte).FactorCode = Trim("" & Rec_Query!FactorCode)
- CheckFactor(Jsqte).FactorValues = 0
- .TextMatrix(0, Jsqte) = Trim("" & Rec_Query!CheckName)
- .TextMatrix(1, Jsqte) = Trim("" & Rec_Query!FactorName)
- .ColWidth(Jsqte) = 1000
- .ColAlignment(Jsqte) = flexAlignRightCenter
- Rec_Query.MoveNext
- Next Jsqte
- End With
- CxbbGrid.Cols = CxbbGrid.Cols + 2
- CxbbGrid.TextMatrix(0, CxbbGrid.Cols - 2) = "有效票数"
- CxbbGrid.TextMatrix(1, CxbbGrid.Cols - 2) = "有效票数"
- CxbbGrid.TextMatrix(0, CxbbGrid.Cols - 1) = "合 计"
- CxbbGrid.TextMatrix(1, CxbbGrid.Cols - 1) = "合 计"
- For Jsqte = 0 To CxbbGrid.Cols - 1
- CxbbGrid.FixedAlignment(Jsqte) = 4 '列标题居中
- Next Jsqte
- '查询测评规则,添加行标题
- Sqlstr = " SELECT Kh_Appraise.ValListCode , Kh_ValList.ValListName " & _
- " From Kh_Appraise" & _
- " left outer join Kh_ValList on Kh_Appraise.ValListCode = Kh_ValList.ValListCode " & _
- " where Kh_Appraise.TitleCode='" & str_titleRoot & "'" & _
- " order by Kh_Appraise.ValListCode"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Rec_Query
- CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
- For Jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
- CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim("" & !ValListCode) '测评规则编码
- CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim("" & !ValListName) '测评规则名称
- CxbbGrid.RowHeight(Jsqte) = Sjhgd
- .MoveNext
- Next Jsqte
- End With
- '添加合计行
- CxbbGrid.Rows = CxbbGrid.Rows + 1
- CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("002", GridStr(), Szzls)) = "合计"
- CxbbGrid.Redraw = True
- End Sub
- Private Sub Sub_Query() '生成查询结果
- Dim Rec_Query As New ADODB.Recordset '查询结果动态集
- Dim Sqlstr As String '查询字符串
- Dim Jsqte As Integer '临时动态计数器
- Dim int_row As Integer '临时动态计数器,实际网格行
- '以下为自定义部分[
- Xt_Wait.Show
- Xt_Wait.Refresh
- CxbbGrid.Redraw = False
- '清空表格数据
- CxbbGrid.Clear 1
- For int_row = CxbbGrid.FixedRows To CxbbGrid.Rows - 2
- For Jsqte = CxbbGrid.FixedCols To CxbbGrid.Cols - 1 - 2
- '读取考核要素分值
- Sqlstr = " SELECT sum(ObjectTotal) as ObjectTotal From Kh_BaseTotal " & _
- " Where TitleCode='" & str_TitleCode & "'" & _
- " and FactorCode='" & CheckFactor(Jsqte).FactorCode & "'" & _
- " and ValListCode='" & Trim(CxbbGrid.TextMatrix(int_row, Sydz("001", GridStr(), Szzls))) & "'" & _
- " and Empid= " & int_EmpID & _
- " and TotalType=2"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not Rec_Query.EOF Then
- '填充考核要素分值
- If Rec_Query.Fields("ObjectTotal") > 0 Then
- CxbbGrid.TextMatrix(int_row, Jsqte) = Format(Rec_Query.Fields("ObjectTotal"), str_format)
- End If
- End If
- Next Jsqte
- '读取有效票数和合计分值
- Sqlstr = " SELECT ObjectBallot,ObjectTotal From Kh_BaseTotal " & _
- " Where TitleCode='" & str_TitleCode & "'" & _
- " and ValListCode='" & Trim(CxbbGrid.TextMatrix(int_row, Sydz("001", GridStr(), Szzls))) & "'" & _
- " and Empid= " & int_EmpID & _
- " and TotalType=4"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not Rec_Query.EOF Then
- If (Rec_Query.Fields("ObjectBallot")) > 0 Then
- CxbbGrid.TextMatrix(int_row, CxbbGrid.Cols - 1 - 1) = Rec_Query.Fields("ObjectBallot") '有效票数
- End If
- If (Rec_Query.Fields("ObjectTotal")) > 0 Then
- CxbbGrid.TextMatrix(int_row, CxbbGrid.Cols - 1 - 0) = Format(Rec_Query.Fields("ObjectTotal"), str_format) '合计
- End If
- End If
- Next int_row
- '填充合计行数据
- For Jsqte = CxbbGrid.FixedCols To CxbbGrid.Cols - 1 - 2
- CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Rows - 1, Jsqte) = &HF7F3EC
- '读取考核要素分值
- Sqlstr = " SELECT ObjectTotal From Kh_BaseTotal " & _
- " Where TitleCode='" & str_TitleCode & "'" & _
- " and FactorCode='" & CheckFactor(Jsqte).FactorCode & "'" & _
- " and Empid= " & int_EmpID & _
- " and TotalType=1"
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not Rec_Query.EOF Then
- '填充考核要素分值
- If Rec_Query.Fields("ObjectTotal") > 0 Then
- CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Jsqte) = Format(Rec_Query.Fields("ObjectTotal"), str_format)
- End If
- End If
- Next Jsqte
- CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Rows - 1, CxbbGrid.Cols - 1 - 1) = &HF7F3EC
- CxbbGrid.Cell(flexcpBackColor, CxbbGrid.Rows - 1, CxbbGrid.Cols - 1 - 0) = &HF7F3EC
- '读取有效票数和合计分值
- Sqlstr = " SELECT ObjectTotal , ObjectBallot " & _
- " From Kh_Object " & _
- " where Kh_Object.TitleCode='" & str_TitleCode & "'" & _
- " and EmpID=" & int_EmpID
- Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not Rec_Query.EOF Then
- If (Rec_Query.Fields("ObjectBallot")) > 0 Then
- CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, CxbbGrid.Cols - 1 - 1) = Rec_Query.Fields("ObjectBallot") '有效票数
- End If
- If (Rec_Query.Fields("ObjectTotal")) > 0 Then
- CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, CxbbGrid.Cols - 1 - 0) = Format(Rec_Query.Fields("ObjectTotal"), str_format) '合计
- End If
- End If
- CxbbGrid.Redraw = True
- Xt_Wait.Hide
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- With Pic_Title
- .Width = Me.Width - 160
- End With
- '设置 height 属性
- TreeView.Height = Me.Height - TreeView.Top - 400
- imgSplitter.Top = TreeView.Top
- imgSplitter.Left = TreeView.Left + TreeView.Width
- imgSplitter.Height = TreeView.Height
- With CxbbGrid
- .Left = imgSplitter.Left + 40
- .Width = Me.Width - (imgSplitter.Left + 160) 'Me.Width - 160
- .Height = Me.Height - .Top - 400
- End With
- GsToolbar.Left = Me.Width - GsToolbar.Width - 160
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- Set Cxnrrec = Nothing
- Set Rec_CodeSet = Nothing
- Unload Dyymctbl
- End Sub
- '*******************以下区域为编写自定义过程区域**********************
- Private Sub Imgcbo_Title_Click()
- int_EmpID = -1
- str_TitleCode = GetComboKey(Imgcbo_Title, 0)
- Call ShowFormat
- str_titleRoot = Mid(str_TitleCode, 1, int_titleRootlen)
- Add_Tree
- '添加列标题
- Call Sub_AddCol
- End Sub
- Private Function AddTitleCode()
- Dim RecExist As New Recordset
- FillImageCombo Imgcbo_Title, "Khgl_TitleAnalyze", 1
- Sqlstr = "SELECT TitleCode,titleName From Kh_Title where (endflag=1 and ComputeFlag=1 and CreateTime=(select max(createTime) from kh_title where endflag=1 and ComputeFlag=1))"
- 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")
- End If
- End If
- str_TitleCode = GetComboKey(Imgcbo_Title, 0)
- End Function
- Private Sub ShowFormat()
- '设置考核数据显示格式
- Dim rec_format As New Recordset
- Dim str_sql As String
- str_sql = "select TitleDigit from Kh_Title where TitleCode='" & str_TitleCode & "'"
- Set rec_format = Cw_DataEnvi.DataConnect.Execute(str_sql)
- If Not rec_format.EOF Then
- str_format = "########" + "." + String(rec_format.Fields("TitleDigit"), "0")
- End If
- rec_format.Close
- End Sub
- '*******************以上区域为编写自定义过程区域**********************
- '******************以下为基本处理程序(固定不变)************************'
- Private Sub Add_Tree() '添加树项
- Dim aDo_Sort As New Recordset
- Dim str_DeptCode As String '加入接点时的部门号
- Dim Sqlstr As String '临时字符串
- Sqlstr = "SELECT TitleCode, EmpID, EmpNo,EmpName,DeptCode,DeptName from Kh_v_Object where TitleCode='" & str_TitleCode & "' order by TitleCode,DeptCode"
- TreeView.Nodes.Clear
- TreeView.Nodes.Add , 4, "T", "被考核对象", "T"
- Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With aDo_Sort
- str_DeptCode = ""
- Do While Not .EOF
- If Trim(str_DeptCode) <> Trim(.Fields("DeptCode")) Then
- Set nodX = TreeView.Nodes.Add("T", 4, "!" & Trim(.Fields("DeptCode")) & "", Trim(.Fields("DeptName")) & "", "Cl")
- nodX.Tag = "-1"
- '树形是否展开
- nodX.EnsureVisible
- Set nodX = TreeView.Nodes.Add("!" & Trim(.Fields("DeptCode")) & "", 4, "@" & Trim(.Fields("EmpNo")) & "", Trim(.Fields("EmpName")) & "", "C")
- nodX.Tag = Trim(.Fields("EmpID"))
- Else
- Set nodX = TreeView.Nodes.Add("!" & Trim(.Fields("DeptCode")) & "", 4, "@" & Trim(.Fields("EmpNo")) & "", Trim(.Fields("EmpName")) & "", "C")
- nodX.Tag = Trim(.Fields("EmpID"))
- End If
- str_DeptCode = .Fields("DeptCode")
- .MoveNext
- Loop
- End With
- 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
- 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
- imgSplitter.Left = X
- CxbbGrid.Left = X + 40
- CxbbGrid.Width = Me.Width - (X + 40 + 160)
- 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
- 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 "tx" '图形
- Call Txfxbb(CxbbGrid, "Khgl_FactorAnalyze")
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- End Sub
- Private Sub CxbbGrid_AfterMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- FnBln_RefreshArray Col, Position, GridStr(), GridInf()
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CxbbGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CxbbGrid, GridCode, GridStr())
- 'Case "szxsxm" '设置显示项目
- 'Call Szxsxm(CxbbGrid, 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) = Fun_FormatOutPut("考核类别:" + Imgcbo_Title.Text, 30) + Fun_FormatOutPut(TsLabel(1).Caption, 30)
- bbxbtzzxs(2) = 0 '居左
- Call Scyxsjb(CxbbGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- 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)
- int_EmpID = Val(Node.Tag)
- If int_EmpID > 0 Then
- TsLabel(1).Caption = "被考核对象:" + Node.Text
- '填 充 网 格
- Call Sub_Query
- Else
- TsLabel(1).Caption = "被考核对象:"
- End If
- End Sub