📄 frmpz_searchresult.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmPZ_SearchResult
Caption = "当前凭证"
ClientHeight = 6000
ClientLeft = 60
ClientTop = 630
ClientWidth = 8925
Icon = "frmPZ_SearchResult.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MDIChild = -1 'True
ScaleHeight = 6000
ScaleWidth = 8925
ShowInTaskbar = 0 'False
WindowState = 2 'Maximized
Begin VB.TextBox txtEdit
Height = 285
Left = 2160
MaxLength = 4
MultiLine = -1 'True
TabIndex = 9
Top = 1800
Visible = 0 'False
Width = 1065
End
Begin MSFlexGridLib.MSFlexGrid mFg
Height = 5355
Left = 0
TabIndex = 1
Top = 630
Width = 8925
_ExtentX = 15743
_ExtentY = 9446
_Version = 393216
BackColorFixed = -2147483624
ForeColorFixed = 128
WordWrap = -1 'True
TextStyleFixed = 4
AllowUserResizing= 3
FormatString = "w "
End
Begin MSComctlLib.Toolbar tBr
Align = 1 'Align Top
Height = 555
Left = 0
TabIndex = 0
Top = 0
Width = 8925
_ExtentX = 15743
_ExtentY = 979
ButtonWidth = 820
ButtonHeight = 926
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ilsTbr"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 7
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "打印"
Key = "Print"
ImageKey = "Print"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "预览"
Key = "Preview"
ImageKey = "Preview"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Caption = "改号"
Key = "Renumber"
ImageKey = "Edit"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Caption = "删除"
Key = "Delete"
ImageKey = "Delete"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Key = "t1"
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "返回"
Key = "Quit"
ImageKey = "Quit"
EndProperty
EndProperty
BorderStyle = 1
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000004&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 435
Left = 3210
ScaleHeight = 435
ScaleWidth = 5535
TabIndex = 2
Top = 30
Width = 5535
Begin VB.TextBox Text3
Appearance = 0 'Flat
BackColor = &H80000013&
Enabled = 0 'False
Height = 270
Left = 3720
TabIndex = 7
Top = 120
Width = 525
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H0000FF00&
Enabled = 0 'False
Height = 270
Left = 1950
TabIndex = 5
Top = 120
Width = 525
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H000000FF&
Enabled = 0 'False
Height = 270
Left = 210
TabIndex = 3
Top = 120
Width = 525
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "已记账凭证"
Height = 180
Left = 4320
TabIndex = 8
Top = 165
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "已复核凭证"
Height = 180
Left = 2520
TabIndex = 6
Top = 165
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "有错凭证"
Height = 180
Left = 780
TabIndex = 4
Top = 165
Width = 720
End
End
End
Begin MSComctlLib.ImageList ilsTbr
Left = 2400
Top = 300
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPZ_SearchResult.frx":014A
Key = "Print"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPZ_SearchResult.frx":068E
Key = "Preview"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPZ_SearchResult.frx":0BD2
Key = "Quit"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPZ_SearchResult.frx":102E
Key = "Edit"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPZ_SearchResult.frx":1482
Key = "Delete"
EndProperty
EndProperty
End
Begin VB.Menu mnuFile
Caption = "文件(&F)"
Begin VB.Menu mnuFilePaperSet
Caption = "页面设置"
Enabled = 0 'False
Visible = 0 'False
End
Begin VB.Menu mnuFilePreview
Caption = "打印预览(&P)"
End
Begin VB.Menu mnuFilePrint
Caption = "打印"
Shortcut = ^P
End
Begin VB.Menu mnuFileBar1
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "退出(&X)"
End
End
Begin VB.Menu mnuOperate
Caption = "操作(&O)"
Visible = 0 'False
Begin VB.Menu mnuOperateRenumber
Caption = "修改凭证编号(&R)"
End
Begin VB.Menu mnuOperateDelete
Caption = "删除凭证(&D)"
End
End
End
Attribute VB_Name = "frmPZ_SearchResult"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
'凭证查询结果
Public Enum SearchResultFunctionUD
pzsrForSearchOnly = 1
pzsrForCheck = 2
pzsrForupdate = 3
End Enum
Private m_sFunction As SearchResultFunctionUD
Dim sSQLdis As String
'Dim sSQL As String
Dim aryTag() As String
Dim rstMain As ADODB.Recordset
Dim m_OldNumber As String
Dim m_OldLong As Long
Dim CGrid As clsGrid
Dim lID As Integer
Dim iID As Long
Dim sFunctionName As String
Dim WithEvents frmV As frmVoucher
Attribute frmV.VB_VarHelpID = -1
Public Property Let SearchResultFunction(ByVal NewSRfunc As SearchResultFunctionUD)
m_sFunction = NewSRfunc
End Property
Public Property Get SearchResultFunction() As SearchResultFunctionUD
SearchResultFunction = m_sFunction
End Property
Public Property Let sQueryDistinct(ByVal s As String)
sSQLdis = s
End Property
'
Private Sub Form_Initialize()
Set rstMain = New ADODB.Recordset
rstMain.CursorLocation = adUseClient
Set CGrid = New clsGrid
End Sub
Private Sub form_load()
Dim j As Long
With CGrid
.FormatString = "序号|<会计期间|<凭证种类|<凭证编号|<凭证日期|<凭证摘要|>附件张数" & _
"|<制单人|<复核人|<主管人"
.Rows = 1
.SetRowHeight 0, 350
.SetColAlignment 0, gcacenter
.SetColAlignment 1, gcacenter
.SetColAlignment 5, gcaRight
.WidthString = "600,1000,1000,1000,1200,4000,1000,900,900,0"
.SetHeadCenter
End With
Me.HelpContextID = 202
Select Case Me.SearchResultFunction
Case 3
tbr.Buttons("t1").Visible = True
tbr.Buttons("Renumber").Visible = True
tbr.Buttons("Delete").Visible = True
End Select
End Sub
Private Sub Form_Resize()
If Me.ScaleWidth < 2000 Or Me.ScaleHeight < 3000 Then
Exit Sub
Else
CGrid.Width = Me.ScaleWidth
CGrid.Height = Me.ScaleHeight - tbr.Height - 100
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
m_Mutex.DeleteMutexID gloSys.sSubSysId, glo.sAccountID, sFunctionName, iID
On Error Resume Next
rstMain.Close
Set CGrid = Nothing
End Sub
Public Sub FillData(Optional lCount As Long, Optional ByVal IsShowMessage As Boolean = True)
Dim FontColor As Long
Dim i As Long, j As Long
With rstMain
If .State = 1 Then .Close
.Open sSQLdis, glo.cnnMain, adOpenStatic, adLockReadOnly
If .RecordCount = 0 Then
If IsShowMessage Then
If Me.SearchResultFunction = 3 Then
MsgBox "没有尚未复核的凭证。", vbInformation
Else
MsgBox "没有符合要求的凭证。", vbInformation
End If
End If
m_Mutex.DeleteMutexID gloSys.sSubSysId, glo.sAccountID, sFunctionName, iID
.Close
lCount = 0
Unload Me
Else
lCount = .RecordCount
If CGrid Is Nothing Then
Set CGrid = New clsGrid
End If
CGrid.Init mFg
ReDim aryTag(.RecordCount)
CGrid.Redraw = False
CGrid.Rows = .RecordCount + 1
.MoveFirst
For i = 1 To .RecordCount
aryTag(i) = .Fields("xgbz").value
Select Case .Fields("xgbz").value
Case "0"
FontColor = vbBlack
Case "1"
FontColor = &H8000&
Case "2"
FontColor = vbGrayText
Case "9"
FontColor = vbRed
Case Else
FontColor = vbBlack
End Select
CGrid.SetRowForeColor i, FontColor
CGrid.SetRowHeight i, 300
CGrid.SetCellText i, 0, i
CGrid.SetCellText i, 1, .Fields("kjqj").value
CGrid.SetCellText i, 2, .Fields("pzzl").value
CGrid.SetCellText i, 3, .Fields("pzbh").value
CGrid.SetCellText i, 4, Format(.Fields("pzrq").value, "yyyy-mm-dd")
CGrid.SetCellText i, 5, Trim$(FormatToString(.Fields("pzzy").value))
CGrid.SetCellText i, 6, .Fields("fjzs").value
CGrid.SetCellText i, 7, .Fields("zdrm").value
CGrid.SetCellText i, 8, .Fields("fhrm").value
CGrid.SetCellText i, 9, .Fields("zgrm").value
.MoveNext
Next i
CGrid.Redraw = True
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -