资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:18k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Begin VB.Form XT_ItemHelp
- BorderStyle = 3 'Fixed Dialog
- Caption = "核算项目编码参照表"
- ClientHeight = 6015
- ClientLeft = 4275
- ClientTop = 975
- ClientWidth = 6435
- Icon = "系统_项目编码参照.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6015
- ScaleWidth = 6435
- ShowInTaskbar = 0 'False
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 4965
- Left = 0
- TabIndex = 4
- Top = 525
- Width = 6390
- _cx = 11271
- _cy = 8758
- 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 = -2147483636
- 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 = 50
- Cols = 10
- FixedRows = 1
- FixedCols = 1
- 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
- AutoSearchDelay = 2
- 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
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VB.TextBox CodeText
- Height = 300
- Left = 1020
- TabIndex = 0
- Top = 150
- Width = 5355
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 5220
- TabIndex = 2
- Top = 5580
- Width = 1120
- End
- Begin VB.CommandButton QdCommand
- Caption = "确定(&O)"
- Default = -1 'True
- Height = 300
- Left = 4050
- TabIndex = 1
- Top = 5580
- Width = 1120
- End
- Begin VB.Label Label1
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "编码或名称"
- Height = 255
- Index = 0
- Left = 90
- TabIndex = 3
- Top = 210
- Width = 975
- End
- End
- Attribute VB_Name = "XT_ItemHelp"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**************************************************************************
- '* 模 块 名 称 :核算项目编码参照
- '* 功 能 描 述 :
- '* 程序员姓名 : 张建忠
- '* 最后修改人 : 张建忠
- '* 最后修改时间:2000/09/11
- '* 备 注:
- '* 使用说明: Xtcdcs 用来传递用户输入内容; xtbmczdm 用来传递所选编码参照
- ' xtfhcs 用来返回用户所选编码; xtfhcsfz 用来返回用户所选名称
- '**************************************************************************
- Dim Cznr As String '网格首次进入查找内容
- Dim Str_ClassCode As String '项目分类编码
- '以下为固定使用变量
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- 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)
- Private Sub CodeText_Change() '用户可模糊定位编码或名称信息
- Dim DwRow As Long
- Dim Lng_BmCol As Long
- Dim Lng_McCol As Long
- On Error Resume Next
- Lng_BmCol = Sydz("001", GridStr(), Szzls)
- Lng_McCol = Sydz("002", GridStr(), Szzls)
- Cznr = Trim(CodeText.Text)
- With CzxsGrid
- For DwRow = .FixedRows To .Rows - 1
- If Mid(.TextMatrix(DwRow, Lng_BmCol), 1, Len(Cznr)) = Cznr Then
- .Row = DwRow
- .Col = Lng_BmCol
- CzxsGrid.SetFocus
- SendKeys "{LEFT}", True
- CodeText.SetFocus
- .TopRow = DwRow
- Exit Sub
- End If
- Next DwRow
- For DwRow = .FixedRows To .Rows - 1
- If Mid(.TextMatrix(DwRow, Lng_McCol), 1, Len(Cznr)) = Cznr Then
- .Row = DwRow
- .Col = Lng_BmCol
- CzxsGrid.SetFocus
- SendKeys "{LEFT}", True
- CodeText.SetFocus
- .TopRow = DwRow
- Exit Sub
- End If
- Next DwRow
- End With
- End Sub
- Private Sub CzxsGrid_GotFocus()
- SendKeys "{LEFT}", True
- End Sub
- Private Sub Form_Load() '调 入 窗 体
- '传递项目类别代码
- Str_ClassCode = Xtcdcsfz
- '调 入 网 格
- GridCode = "cwzz_item"
- Call Sub_ShowGrid(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- Call Cxnrtcwg
- CodeText.Text = Trim(Xtcdcs)
- End Sub
- Private Sub Cxnrtcwg() '查 询 内 容 填 充 网 格
- Dim Sqlstr As String
- Dim jsqte As Long
- '查询连接串
- Sqlstr = "SELECT * FROM Cwzz_Item Where ItemClassCode='" & Str_ClassCode & "'and EndFlag='1' order by ItemCode"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Cxnrrec
- CzxsGrid.Rows = .RecordCount + CzxsGrid.FixedRows
- If .EOF And .BOF Then
- Exit Sub
- End If
- jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- If jsqte >= CzxsGrid.Rows Then
- CzxsGrid.AddItem ""
- End If
- Call Jltcwg(Cxnrrec, jsqte)
- CzxsGrid.RowHeight(jsqte) = Sjhgd
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- Dim Str_Fzhs As String '辅助核算
- '[以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("ItemCode"))
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("ItemName") & "")
- If .Fields("QuantityFlag") Then
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "√"
- End If
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("Measure") & "")
- End With
- '以上为自定义部分]
- End Sub
- Private Sub CzxsGrid_DblClick() '用户双击网格返回当前选中编码
- Call Fhxzbm
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '退出
- Set Cxnrrec = Nothing
- End Sub
- Private Sub QdCommand_Click() '确 定
- Call Fhxzbm
- End Sub
- Private Sub QxCommand_Click() '取 消
- Xtfhcs = ""
- Xtfhcsfz = ""
- Unload Me
- End Sub
- Private Sub Fhxzbm() '返回用户选中编码并退出
- With CzxsGrid
- If .Row >= .FixedRows Then
- Xtfhcs = Trim(.TextMatrix(.Row, Sydz("001", GridStr(), Szzls)))
- Xtfhcsfz = Trim(.TextMatrix(.Row, Sydz("002", GridStr(), Szzls)))
- Else
- Xtfhcs = ""
- Xtfhcsfz = ""
- End If
- End With
- Unload Me
- End Sub
- Private Sub Sub_ShowGrid(Xsgrid, Wgdmte As String, GridInf() As Variant, GridBoolean() As Boolean, GridInt() As Integer, GridStr() As String) '标准网格初始化模块
- '过程参数为:生成网格对象名称(微软),网格参数编码,返回网格设置信息(返回整体信息)
- '网格列属性(返回布尔型信息),网格列属性(返回整型信息),网格列属性(返回字符型信息)
- Dim wglbt() As String '网格显示列标题
- Dim Wgxsls As Long '网格显示(主操作)列数
- Dim gdls As Long '网格固定列数
- Dim Gdhs As Long '网格固定行数(标题行数)
- Dim Gdhgd As Double '网格固定行高度
- Dim wglkd() As Double '每列默认字符个数
- Dim wglzz() As Integer '网格列组织形式
- Dim zdxsgs() As String '数值字段显示格式
- Dim Sfhide() As Boolean '网格列是否隐藏
- Dim Sfhxz As Boolean '网格列是否行选中
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim Wglsfkydpx As Integer '网格列是否可移动及排序
- Dim wgxsrec As New ADODB.Recordset '网格显示动态集
- ReDim GridInf(1 To 7) '整个网格设置信息
- Set wgxsrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_grid WHERE Grid_Code ='" + Wgdmte + "' ORDER BY ColId")
- With wgxsrec
- If .EOF And .BOF Then
- Exit Sub
- Else
- .MoveFirst
- End If
- Qslz = .Fields("BeginCol") '网格隐藏(非操作显示)列数
- Sjhgd = .Fields("DataRowHeight") '网格数据行高度
- GridInf(1) = Qslz '起始列值
- GridInf(2) = Sjhgd '数据行高度
- GridInf(3) = .Fields("KeepDataRows") '屏幕保持数据行数
- GridInf(4) = .Fields("AssistantRows") '辅助项网格行数(例如:合计行)
- If .Fields("SaveHelpWidth_Flag") Then '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
- GridInf(5) = True
- Else
- GridInf(5) = False
- End If
- If .Fields("DeleteRowAsk_Flag") Then '删除有效记录行是否提示
- GridInf(6) = True
- Else
- GridInf(6) = False
- End If
- If .Fields("ShowSumGrid_Flag") Then '是否显示合计网格
- GridInf(7) = True
- Else
- GridInf(7) = False
- End If
- Wgxsls = .RecordCount - 1 '网格显示(主操作)列数(原.Fields("wgxsls"))
- gdls = .Fields("FixCols") '网格固定列数
- Gdhs = .Fields("FixRows") '网格固定行数(标题行数)
- Gdhgd = .Fields("FixRowHeight") '网格固定行高度
- Wglsfkydpx = .Fields("explorerbar") '网格列是否可移动及排序
- If .Fields("SelectRow_Flag") Then '是否行选中
- Sfhxz = True
- End If
- ReDim wglbt(Gdhs - 1, Wgxsls + Qslz - 1) '网格显示列标题
- ReDim wglkd(Qslz + Wgxsls - 1) '每列默认字符个数
- ReDim zdxsgs(Qslz + Wgxsls - 1) '数值字段标志
- ReDim wglzz(Qslz + Wgxsls - 1) '网格列组织形式
- ReDim Sfhide(Qslz + Wgxsls - 1) '网格列是否显示
- ReDim GridBoolean(Qslz + Wgxsls - 1, 1 To 6) '网格列属性(布尔型)
- ReDim GridStr(Qslz + Wgxsls - 1, 1 To 20) '网格列信息(字符型)
- ReDim GridInt(Qslz + Wgxsls - 1, 1 To 7) '网格列信息(整型)
- .MoveNext
- jsqte = 0
- Do While Not .EOF
- wglkd(Qslz + jsqte) = .Fields("ColWidth") '网格列宽度限制
- If Not IsNull(.Fields("ColTitle1")) Then
- wglbt(0, Qslz + jsqte) = Trim(.Fields("ColTitle1")) '网格列标题1
- End If
- If Not IsNull(.Fields("ColTitle2")) And Gdhs = 2 Then '网格列标题2
- wglbt(1, Qslz + jsqte) = Trim(.Fields("ColTitle2"))
- End If
- If .Fields("ColFormat") Then '字段显示格式(千分符)
- If .Fields("Text_Int_Length") <> 0 Then
- zdxsgs(Qslz + jsqte) = "#,##0." + String(.Fields("Text_deci_Length"), "0")
- Else
- zdxsgs(Qslz + jsqte) = "#,##0.00"
- End If
- Select Case .Fields("Text_Data_Type")
- Case 8 '金额
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtjexsws, "0")
- Case 9 '数量
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtslxsws, "0")
- Case 10 '单价
- zdxsgs(Qslz + jsqte) = "#,##0." + String(Xtdjxsws, "0")
- End Select
- Else
- If .Fields("Text_Int_Length") <> 0 Then
- zdxsgs(Qslz + jsqte) = "##0." + String(.Fields("Text_deci_Length"), "0")
- End If
- End If
- wglzz(Qslz + jsqte) = .Fields("ColAlignment") '网格列组织形式
- If .Fields("ColHidden") Then '网格列是否隐藏
- Sfhide(Qslz + jsqte) = True
- End If
- If .Fields("Edit_Flag") Then '网格列是否可编辑
- GridBoolean(Qslz + jsqte, 1) = True
- End If
- If .Fields("Help_Flag") Then '网格列是否提供帮助
- GridBoolean(Qslz + jsqte, 2) = True
- End If
- If .Fields("Combo_Flag") Then '网格列是否列表框录入
- GridBoolean(Qslz + jsqte, 3) = True
- End If
- If .Fields("ColSum_Flag") Then '网格列是否合计
- GridBoolean(Qslz + jsqte, 4) = True
- End If
- If .Fields("Zero_Empty_Flag") Then '网格内容为零是否清空
- GridBoolean(Qslz + jsqte, 5) = True
- End If
- If .Fields("BooleanFlag") Then '网格列是否为布尔型
- GridBoolean(Qslz + jsqte, 6) = True
- End If
- If Not IsNull(.Fields("Text_Data_Type")) Then '字段数据类型
- GridInt(Qslz + jsqte, 1) = .Fields("Text_Data_Type")
- End If
- If Not IsNull(.Fields("Text_Length")) Then '字段录入长度
- GridInt(Qslz + jsqte, 2) = .Fields("Text_Length")
- End If
- If Not IsNull(.Fields("Text_Int_Length")) Then '字段整数位长度
- GridInt(Qslz + jsqte, 3) = .Fields("Text_Int_Length")
- End If
- If Not IsNull(.Fields("Text_Deci_Length")) Then '字段小数位长度
- GridInt(Qslz + jsqte, 4) = .Fields("Text_Deci_Length")
- End If
- If Not IsNull(.Fields("NotAllowEmpty_Type")) Then '字段不允许为空或为零
- GridInt(Qslz + jsqte, 5) = .Fields("NotAllowEmpty_Type")
- End If
- If Not IsNull(.Fields("Help_Type")) Then '帮助类型
- GridInt(Qslz + jsqte, 6) = .Fields("Help_Type")
- End If
- If Not IsNull(.Fields("HelpReturnValue")) Then '帮助返回值(0-显示返回编码 1-显示返回名称)
- GridInt(Qslz + jsqte, 7) = .Fields("HelpReturnValue")
- End If
- GridStr(Qslz + jsqte, 1) = Trim(.Fields("ColIndex") & "") '网格列索引值
- GridStr(Qslz + jsqte, 2) = Trim(.Fields("EmptyMessage") & "") '字段为空提示信息
- GridStr(Qslz + jsqte, 3) = Trim(.Fields("Help_Code") & "") '通用帮助编码
- GridStr(Qslz + jsqte, 4) = Trim(.Fields("FieldsName") & "") '连接字段(通用帮助)
- GridStr(Qslz + jsqte, 5) = Trim(.Fields("Combo_Code") & "") '列表框编码
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- '网格列组织形式
- With Xsgrid
- .BackColorFixed = &H8000000F '固定行背景色 ('&H80000018)
- .FixedRows = Gdhs '固定行数
- .Rows = Gdhs
- .FixedCols = gdls '固定列数
- .Cols = Qslz + Wgxsls
- .AllowUserResizing = flexResizeBoth
- .SelectionMode = flexSelectionByRow
- .WordWrap = True
- '填 充 网 格 标 题
- For Rowjsq = 0 To .FixedRows - 1
- .MergeRow(Rowjsq) = True
- .RowHeight(Rowjsq) = Gdhgd
- For Coljsq = Qslzte To .Cols - 1
- .TextMatrix(Rowjsq, Coljsq) = wglbt(Rowjsq, Coljsq)
- Next Coljsq
- Next Rowjsq
- '数 据 网 格 高 度
- For Rowjsq = .FixedRows To .Rows - 1
- .RowHeight(Rowjsq) = Sjhgd
- Next Rowjsq
- '定 义 录 入 字 段 属 性
- For Coljsq = 0 To .Cols - 1
- .ColWidth(Coljsq) = wglkd(Coljsq)
- .ColAlignment(Coljsq) = wglzz(Coljsq)
- .FixedAlignment(Coljsq) = 4
- Next Coljsq
- End With
- End Sub