📄 +
字号:
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 = 9150
TabIndex = 6
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 VB.Label Lab_OperStatus
BackColor = &H000080FF&
Caption = "1"
Height = 345
Left = 10500
TabIndex = 5
Top = 1440
Visible = 0 'False
Width = 345
End
End
Attribute VB_Name = "Stand_FrmData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************************************************************
'* 模 块 名 称 :标准表数据内容录入
'* 功 能 描 述 :录入标准表的内容,采用固定行式录入方法,并手工填写几个数组。
'* 程序员姓名 :田建秀
'* 最后修改人 :田建秀
'* 最后修改时间:2001/12/21
'* 备 注:程序中所有依实际情况自定义部分均用[>> <<]括起
'*
'* 1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
'*
'* 3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) 1-浏览 2-修改
'*
'***************************************************************************************
'以下为自定义变量
'其它固定使用变量
Dim Tsxx As String '系统信息提示(Fixed)
Dim ReportTitle As String '报表主标题(Fixed)
Dim Rsc As New ADODB.Recordset
Dim Sql As String
Dim i As Long
Dim j As Long
Dim HxList() As Long '横向项目的listid
Dim VxList() As Long '纵向项目的listid
Dim Length As Integer '结果项目的整个数据长度
Dim DotLen As Integer '结果项目的小数位数
Dim BzbNO As Integer
'以下为固定使用变量(网格)
Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
Dim GridCode As String '显示网格网格代码
Dim GridInf() As Variant '整个网格设置信息
Dim Pmbcsjhs As Long '屏幕网格保持数据行数(大于等于1)
Dim Fzxwghs As Integer '辅助项网格行数(包括合计行)
Dim Sfxshjwg As Boolean '是否显示合计网格
Dim Qslz As Long '网格隐藏(非操作显示)列数
Dim Sjhgd As Double '网格数据行高度
Dim GridBoolean() As Boolean '网格列信息(布尔型)
Dim GridStr() As String '网格列信息(字符型)
Dim GridInt() As Integer '网格列信息(整型)
Dim Sfblbzkd As Boolean '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
Dim Dqlrwgh As Long '当前录入数据网格行
Dim Dqlrwgl As Long '当前录入数据网格列
Dim Dqlkwgh As Long '刚刚离开网格行(不一定为录入行)
Dim Dqlkwgl As Long '刚刚离开网格列
Dim Dqtoprow As Long '当前录入状态时最上端可视行
Dim Dqleftcol As Long '当前录入状态时最左端可视列
Dim Zdlrqnr As String '字段录入修改前内容(用来判断内容是否修改)
Dim Wbkbhlock As Boolean '文本框改变值锁
Dim Changelock As Boolean '网格行列改变控制锁(用来区别用户改变.程序改变)
Dim Gdtlock As Boolean '滚动条滚动控制(用来区别用户改变.程序改变)
Dim Yxxpdlock As Boolean '字段有效性判断锁(内容不修改不需进行字段有效性判断)
Dim Hyxxpdlock As Boolean '行有效性判断锁(字段内容不修改不需进行行有效性判断)
Dim Valilock As Boolean '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
Dim Shsfts As Boolean '删除记录行是否提示
Dim Szzls As Integer '网格信息数组最大下标值(网格列数-1)
Private Sub Form_KeyPress(KeyAscii As Integer) '限制录入字符"'"
Select Case KeyAscii
Case 39 '屏蔽字符"'"
KeyAscii = 0
End Select
End Sub
Private Sub Form_Load() '窗 体 装 入
'初始化各种锁值(Fixed)
Changelock = False '网格行列改变控制锁
Gdtlock = False '滚动条滚动控制
Yxxpdlock = True '字段有效性判断锁
Hyxxpdlock = True '行有效性判断锁
Wbkbhlock = False '文本框内容改变锁
GsToolbar.Visible = False
'报表主标题及报表编码(Fixed)
ReportTitle = "标准表数据内容"
XtReportCode = "Pm_StandData"
Load Dyymctbl
With Stand_FrmFirst.CzxsGrid
TsLabel(4) = Trim(.TextMatrix(.Row, 4))
End With
'调 入 网 格(Fixed)
GridCode = "Pm_StandData" '网格属性编码
Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
WglrGrid.TextMatrix(0, 0) = "ID"
Qslz = GridInf(1)
Sjhgd = GridInf(2)
Pmbcsjhs = GridInf(3)
Fzxwghs = GridInf(4)
Sfblbzkd = GridInf(5)
Shsfts = GridInf(6)
Sfxshjwg = GridInf(7)
With Stand_FrmFirst.CzxsGrid
BzbNO = Val(.TextMatrix(.Row, 0))
TsLabel(4).Caption = Trim(.TextMatrix(.Row, 4))
'求结果项目的小数位数、整数位数
If Rsc.State = 1 Then Rsc.Close
Sql = "select * from Rs_Items where FieldName='" & .TextMatrix(.Row, 3) & "'"
Set Rsc = Cw_DataEnvi.DataConnect.Execute(Sql)
If Not Rsc.EOF Then
Length = Rsc!FieldLength
DotLen = Rsc!FieldDotL
End If
'横向项目,列
Call RowCol(Trim(.TextMatrix(.Row, 1)), Rsc)
End With
With Me.WglrGrid
.Cols = .FixedCols + Rsc.RecordCount
ReDim GridInt(.Cols - 1, 1 To 7)
ReDim GridBoolean(.Cols - 1, 1 To 7)
ReDim GridStr(.Cols - 1, 1 To 7)
ReDim HxList(.Cols - 1)
For i = 0 To .FixedCols
HxList(i) = 0
Next
For i = .FixedCols To .Cols - 1
.TextMatrix(0, i) = Trim(Rsc!ListName)
HxList(i) = Val(Trim(Rsc!ListID))
.ColAlignment(i) = 6
.FixedAlignment(i) = 4
GridInt(i, 1) = 5
GridInt(i, 2) = Length + 1
GridInt(i, 3) = Length - DotLen
GridInt(i, 4) = DotLen
GridInt(i, 5) = 0
GridInt(i, 6) = 0
GridInt(i, 7) = 0
GridBoolean(i, 1) = True
GridBoolean(i, 2) = False
GridBoolean(i, 3) = False
GridBoolean(i, 4) = False
GridBoolean(i, 5) = False
GridBoolean(i, 6) = False
GridStr(i, 1) = "00" & i
GridStr(i, 2) = ""
GridStr(i, 3) = ""
GridStr(i, 4) = ""
GridStr(i, 5) = ""
Rsc.MoveNext
Next
End With
With Stand_FrmFirst.CzxsGrid
'纵向项目,行
If Trim(.TextMatrix(.Row, 2)) <> "" Then
Call RowCol(Trim(.TextMatrix(.Row, 2)), Rsc)
With Me.WglrGrid
.Rows = .FixedRows + Rsc.RecordCount
ReDim VxList(.Rows - 1)
VxList(0) = 0
For i = .FixedRows To .Rows - 1
.TextMatrix(i, .FixedCols - 1) = Trim(Rsc!ListName)
VxList(i) = Trim(Rsc!ListID)
.RowHeight(i) = 270
.FixedAlignment(i) = 4
Rsc.MoveNext
Next
.TextMatrix(0, .FixedCols - 1) = Stand_FrmFirst.CzxsGrid.TextMatrix(Stand_FrmFirst.CzxsGrid.Row, 7)
End With
Else
With Me.WglrGrid
.Rows = 2
.RowHeight(1) = 270
.FixedAlignment(1) = 4
.TextMatrix(0, .FixedCols - 1) = ""
.TextMatrix(1, .FixedCols - 1) = Stand_FrmFirst.CzxsGrid.TextMatrix(Stand_FrmFirst.CzxsGrid.Row, 7)
End With
End If
End With
Szzls = WglrGrid.Cols - 1
'设置标题栏宽度、网格宽度高度(Fixed)
Pic_Title.Move 50, Pic_Title.Top, Me.Width - 150, Pic_Title.Height
WglrGrid.Move 50, Pic_Title.Top + Pic_Title.Height, Me.Width - 150
WglrGrid.Height = Me.Height - WglrGrid.Top - 380
'生成查询结果
Call Sub_Query
'设置状态为修改状态
Lab_OperStatus = "2"
End Sub
Private Sub RowCol(FieldName As String, Rsc As ADODB.Recordset)
'用一函数,判断是否是部门。并返回列数、行数、结果项目的小数位数、整数位数。
If LCase(Trim(FieldName)) = "rs_basicinfo.deptcode" Then
Sql = "select DeptCode as ListId,DeptName as ListName from Gy_Department where CodeLevel=" & _
Val(Stand_FrmFirst.CzxsGrid.TextMatrix(Stand_FrmFirst.CzxsGrid.Row, 9)) & _
" and RsPmFlag=1 order by Deptcode"
Else
Sql = "select ListName,ListId from Rs_CorMain c inner join Rs_CorSub s " & _
" on c.SortId=s.SortId inner join Rs_Items i on " & _
" i.correlation=c.sortid and ltriM(rtrim(tablename)) + '.' + ltrim(rtrim(fieldname))='" & _
FieldName & "' order by s.listid "
End If
If Rsc.State = 1 Then Rsc.Close
Set Rsc = Cw_DataEnvi.DataConnect.Execute(Sql)
End Sub
Private Sub Form_Unload(Cancel As Integer) '窗体卸载
If Not Fun_Drfrmyxxpd Then
Cancel = True
Exit Sub
End If
'卸载打印页面窗体
Unload Dyymctbl
Set Rsc = Nothing
End Sub
Private Sub Sub_Query() '生成查询结果
Dim Sqlstr As String '临时使用字符串
Dim RecTemp As New ADODB.Recordset '临时使用动态集
Dim jsqte As Long '临时计数器
'禁止网格刷新动作,为加快网格显示速度(Fixed)
WglrGrid.Redraw = False
'查询字符串'
Sqlstr = "select * from PM_StandTblData where BzbNo=" & BzbNO
Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
With RecTemp
With WglrGrid
Do While Not RecTemp.EOF
If Trim(Stand_FrmFirst.CzxsGrid.TextMatrix(Stand_FrmFirst.CzxsGrid.Row, 2)) <> "" Then
'有纵向项目
For i = .FixedRows To .Rows - 1
For j = .FixedCols To .Cols - 1
If VxList(i) = RecTemp!VxData And HxList(j) = RecTemp!HxData Then
.TextMatrix(i, j) = RecTemp!ResuData
Exit For
End If
Next
Next
Else
'无纵向项目
For j = .FixedCols To .Cols - 1
If HxList(j) = Trim(RecTemp!HxData) Then
.TextMatrix(.FixedRows, j) = RecTemp!ResuData
Exit For
End If
Next
End If
RecTemp.MoveNext
Loop
End With
End With
'将网格刷新解禁(Fixed)
WglrGrid.Redraw = True
End Sub
Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button) '用户点击工具条
'屏蔽文本框,下拉组合框有效性判断
Valilock = True
'屏蔽网格失去焦点产生的有效性判断
Changelock = True
Select Case Button.Key
Case "ymsz" '页面设置
Dyymctbl.Show 1
Case "yl" '预 览
If Fun_Drfrmyxxpd Then
Call bbyl(True)
End If
Case "dy" '打 印
If Fun_Drfrmyxxpd Then
Call bbyl(False)
End If
Case "bc"
Call Bclrsj
Case "bz" '帮 助
Call F1bz
Case "fh" '退 出
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -