⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 业务受理.frm

📁 可以帮助交通部门管理车辆肇事后的相关事宜
💻 FRM
📖 第 1 页 / 共 3 页
字号:
Attribute VB_Name = "业务受理"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text10.Text = "" Then
MsgBox "请输入相关数据", vbOKOnly, "提示框"
Else
    If Combo2.ListIndex = 0 Then
    Data1.Recordset.FindFirst "Num='" & Text10.Text & " '"
    If (Data1.Recordset.NoMatch) Then
        MsgBox "你要找的内容未找到!", vbCritical, "提示框"
           Text10.Text = ""
           Text10.SetFocus
    End If
    ElseIf Combo2.ListIndex = 1 Then
    Data1.Recordset.FindFirst "CarNum='" & Text10.Text & " '"
    If (Data1.Recordset.NoMatch) Then
        MsgBox "你要找的内容未找到!", vbCritical, "提示框"
           Text10.Text = ""
           Text10.SetFocus
    End If
    ElseIf Combo2.ListIndex = 2 Then
    Data1.Recordset.FindFirst "Driver='" & Text10.Text & " '"
    If (Data1.Recordset.NoMatch) Then
        MsgBox "你要找的内容未找到!", vbCritical, "提示框"
           Text10.Text = ""
           Text10.SetFocus
    End If
    Else
    Data1.Recordset.FindFirst "Action='" & Text10.Text & " '"
    If (Data1.Recordset.NoMatch) Then
        MsgBox "你要找的内容未找到!", vbCritical, "提示框"
           Text10.Text = ""
           Text10.SetFocus
    End If
    
    End If
End If
Text15.Text = Text10.Text
End Sub


Function printFun()
    'Printer.Line (0, 0)-(1000, 0)
    'Printer.FontSize = 10
    'Printer.Print "hello"
    'Printer.EndDoc
    'printTypeOne
    titleOne$ = "交警大队扣车审核单"
    titleTwo$ = "交警大队扣证处理单"
    Static col(5) As Integer '定义打印的列数
    Static row(5) As Integer '定义打印的行数
    Dim rows As Variant
    rows = Array(23, 12, 4, 2)
    rows(0) = Array("驾驶人姓名", Data1.Recordset.Fields("Driver"), "违法行为", Data1.Recordset.Fields("Action"))
    rows(1) = Array("车牌号", Data1.Recordset.Fields("CarNum"), "值勤民警", Data1.Recordset.Fields("roster"))
    rows(2) = Array("暂扣", Data1.Recordset.Fields("certificate"), "时间", Data1.Recordset.Fields("Time"))
    rows(3) = Array("处罚金额", Data1.Recordset.Fields("money"), "受理时间", Data1.Recordset.Fields("PressTime"))
    If 1 = 1 Then
        '判断为扣证
    Else
        '判断为扣车
    End If
    
   
    Dim i As Integer
    For i = 0 To 4
        Flag = printVerticalLine(2000, 1500, i)
        Flag = printHorizonalLine(2000, 1500, i)
    Next
    Dim rowIdx As Integer
    Dim colIdx As Integer
     Dim Advise As Variant
    For rowIdx = 0 To 3
        For colIdx = 0 To 3
            'content = rows(0, 0)
             Flag = printCell(2000, 2000, rowIdx, colIdx, 12, rows(rowIdx)(colIdx), 2000, 1000)
        Next
    Next
    
    Dim S As String
    Dim Id As Integer
     S = Data1.Recordset.Fields("certificate")
    If S = "机动车" Or S = "证件和机动车" Then
         Flag = printTitle(4500, 1000, 15, titleOne$)
        Flag = printTable(2000, 8000, 10000, 5500)
         
        Advise = Array("车管所(207室)审核意见:______________________________", "秩序一中队(203室)处理意见:_______________________________", "违法大厅处理结果:____________________________________", "领导审批:____________________________________", "秩序一中队(203室)开具放车单。")
      
        For Id = 0 To 4
        Flag = printCell(0, 5500, Id, 1, 12, Advise(Id), 2000, 500)
        Next
    Else
        
        Flag = printTitle(4500, 1000, 15, titleTwo$)
        Flag = printTable(2000, 6500, 10000, 5500)
        
        Advise = Array("违法大厅处罚:____________________________________", "秩序一中队(203室)交还证件。")
        
        For Id = 0 To 1
        Flag = printCell(0, 5500, Id, 1, 12, Advise(Id), 2000, 500)
        Next
    End If
    
    Printer.EndDoc
End Function

Function printTitle(x As Integer, y As Integer, font As Single, title As String)
   '定义表头
    Printer.CurrentX = x + 200
    Printer.CurrentY = y + 50
    Printer.FontBold = False
    Printer.FontSize = font
    Printer.Print title
End Function
Function printVerticalLine(x As Integer, y As Integer, col As Integer)
    Printer.Line (x + col * 2000, y)-(x + col * 2000, y + 4000)
End Function

Function printHorizonalLine(x As Integer, y As Integer, row As Integer)
    Printer.Line (x, y + row * 1000)-(x + 8000, y + row * 1000)
End Function
'
Function printCell(x As Integer, y As Integer, row As Integer, col As Integer, font As Integer, txt As Variant, numX As Integer, numY As Integer)
    Printer.CurrentX = x + 50 + col * numX
    Printer.CurrentY = y + 50 + row * numY
    Printer.FontBold = False
    Printer.FontSize = font
    Printer.Print txt
End Function

Function printTable(x As Integer, y As Integer, z As Integer, t As Integer)
    Printer.Line (x, t)-(x, y)
    Printer.Line (x, y)-(z, y)
    Printer.Line (z, t)-(z, y)
   
End Function


Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command5_Click()
If Combo2.ListIndex = 0 Then
    Data1.Recordset.FindNext "Num='" & Text10.Text & " '"
ElseIf Combo2.ListIndex = 1 Then
    Data1.Recordset.FindNext "CarNum='" & Text10.Text & " '"
ElseIf Combo2.ListIndex = 2 Then
    Data1.Recordset.FindNext "Driver='" & Text10.Text & " '"
Else
    Data1.Recordset.FindNext "Action='" & Text10.Text & " '"
End If
If Text10.Text = Text15.Text Then
        MsgBox "这是最后一条相关记录!", vbOKOnly, "提示框"
    Else
        
        
        Command5.SetFocus
        Text15.Text = Text10.Text
    End If
End Sub

Private Sub Command6_Click()
Dim ianswer As String

If Text4.Text = "" Then
MsgBox "请输入处罚金额", vbOKOnly, "提示框"
Text4.SetFocus
ElseIf Text5.Text = "" Then
MsgBox "请输入受理时间", vbOKOnly, "提示框"
Text5.SetFocus
ElseIf Text9.Text = "" Then
MsgBox "请输入受理人姓名", vbOKOnly, "提示框"
Text9.SetFocus

ElseIf Text4.Text < 199 & Option2.Value = True Then
MsgBox "处罚金额不得小于200元!", vbOKOnly, "提示框"
Text4.SetFocus
Else
ianswer = MsgBox("确定处理此业务吗?", vbYesNo, "提示框")
If ianswer = vbYes Then
Data1.Recordset.Edit
Data1.Recordset.Fields("money") = Text4.Text
Data1.Recordset.Fields("PressTime") = Text5.Text
Data1.Recordset.Fields("PressName") = Text9.Text
Data1.Recordset.Fields("state") = 1
Data1.Recordset.Update
Data2.Refresh
        
        
        Num = Data2.Recordset.RecordCount
        StatusBar1.Panels(2).Text = "未受理记录:" & Num
        A = MsgBox("需要打印业务单吗?", vbYesNo, "提示框")
If A = vbYes Then
    printFun
End If
    If Option1.Value = True Then
    Data1.Recordset.Edit
    Data1.Recordset.Fields("BossName") = Text16.Text
    Data1.Recordset.Fields("Other") = Text17.Text
    Data1.Recordset.Update
    
Data1.Recordset.FindFirst "state=0"
Text4.Text = ""
Text9.Text = ""
Text10.Text = ""
Text10.SetFocus


End If
End If
End If
End Sub

Private Sub Data1_Reposition()
Dim Query As String

Query = "select * from jjdd where state = 0"
Data2.RecordSource = Query

If Text14.Text <> 1 Then
Text12.Text = "未受理"
Text4.Locked = False

Label9.Enabled = True
Label10.Enabled = True
Label11.Enabled = True
Label12.Enabled = True
Text5.Text = Format(Now, "yyyy-mm-dd")

Else
Text12.Text = "已受理"
End If
End Sub

Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\" + "jjdd.mdb"
Data1.Refresh
Data2.DatabaseName = App.Path + "\" + "jjdd.mdb"
Data2.Refresh
Data3.DatabaseName = App.Path + "\" + "jjdd.mdb"
Data3.Refresh


Option2.Value = True

Dim n As Long
If Data1.Recordset.EOF Then
StatusBar1.Panels(1).Text = "资料共有记录:0"
Else
Data1.Recordset.MoveLast


n = Data1.Recordset.RecordCount
StatusBar1.Panels(1).Text = "资料共有记录:" & n
End If
Dim m As Long
If Data2.Recordset.EOF Then
StatusBar1.Panels(2).Text = "未受理记录:0"
Else
Data2.Recordset.MoveLast


m = Data2.Recordset.RecordCount
StatusBar1.Panels(2).Text = "未受理记录:" & m
End If
Data2.Recordset.FindFirst "state=0"
Data1.Recordset.FindFirst "state=0"
Data3.Recordset.FindFirst "State=1"
Text9.Text = Data3.Recordset.Fields("TrueName").Value
Combo2.AddItem ("编号")
Combo2.AddItem ("车牌号")
Combo2.AddItem ("驾驶人")
Combo2.AddItem ("违法行为")

Text5.Text = Format(Now, "yyyy-mm-dd")
End Sub

Private Sub Option1_Click()
Label16.Enabled = True
Label17.Enabled = True
Text16.Enabled = True
Text17.Enabled = True

Text16.SetFocus
End Sub

Private Sub Option2_Click()
Label16.Enabled = False
Label17.Enabled = False
Text16.Enabled = False
Text17.Enabled = False
End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
If Text10 = "" Then
MsgBox "请输入数据!"
Text10.SetFocus
Else
Command1.SetFocus
End If
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
If Text4.Text = "" Then
MsgBox "请输入处罚金额", vbOKOnly, "提示框"
Text4.SetFocus
Else
Text5.SetFocus
End If
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text5.Text = "" Then
MsgBox "请输入日期", vbOKOnly, "提示框"
Text5.SetFocus
Else
Text9.SetFocus
End If
End If
End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text9.Text = "" Then
MsgBox "请输入受理人姓名", vbOKOnly, "提示框"
Text9.SetFocus
Else

Command6.SetFocus
End If
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -