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

📄 modulebase

📁 医院管理方面的例子
💻
📖 第 1 页 / 共 2 页
字号:
            End If
        
            '其他二(用户设置)
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100015" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0:     .CurrentY = Y0 + 7 * Yc
                    Printer.Print SendMhFlexFp.TextMatrix(IntRow, 1) & Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
            
            '输氧费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100008" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
            
            '手术费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100009" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + Yc
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
            
            '治疗费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100010" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + 2 * Yc
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
        
            '放射费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100011" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + 3 * Yc
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
            
            '化验费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100012" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + 4 * Yc
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
        
            '输血费
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100013" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + 5 * Yc
                    Printer.Print Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If

            '其他一(用户设定)
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100014" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc: .CurrentY = Y0 + 6 * Yc
                    Printer.Print SendMhFlexFp.TextMatrix(IntRow, 1) & Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
    
            '其他三(用户设定)
            If SendMhFlexFp.TextMatrix(IntRow, 0) = "100016" Then
                
                If Val(SendMhFlexFp.TextMatrix(IntRow, 2)) <> 0 Then
                    .CurrentX = X0 + Xc - 1: .CurrentY = Y0 + 7 * Yc
                    Printer.Print SendMhFlexFp.TextMatrix(IntRow, 1) & Format(SendMhFlexFp.TextMatrix(IntRow, 2), "0.00")
                End If
            End If
        Next IntRow
        
        '合计
        .CurrentX = X0:      .CurrentY = Y0 + 8 * Yc
        If Val(SendStrFyHj) <> 0 Then Printer.Print "¥" & Format(SendStrFyHj, "0.00")
         
        'No:
        .CurrentX = X0 + Xc - 0.5: .CurrentY = Y0 + 8 * Yc
        If SendStrBrBh <> "" Then Printer.Print SendStrBrBh
        
        '人民币(大写)
        .CurrentX = X0 + 0.3: .CurrentY = Y0 + 9 * Yc
        If Val(SendStrFyHj) <> "0" Then Printer.Print Get_Chinese(Val(SendStrFyHj))
        
        '收费员
        .CurrentX = X0: .CurrentY = Y0 + 10 * Yc
        Printer.Print Trim(PStrUserID)
    
        '日期
        .CurrentX = X0 + Xc - 0.4: .CurrentY = Y0 + 10 * Yc
        Printer.Print Format(CStr(SendStrDySj), "yyyy-mm-dd")
        
        
    '-------------------------------<付联>------------------------------
        '标识
        .CurrentX = X0 + 8.5: .CurrentY = Y0 - 1.9 - 0.75
        Select Case SendStrBs
            Case "0": Printer.Print "----正常打印----"
            Case "1": Printer.Print "----补打发票----"
            Case "2": Printer.Print "----退费发票----"
        End Select
                
        '编号
        .CurrentX = X0 + 8.5: .CurrentY = Y0 - 1.9
        If SendStrBrBh <> "" Then Printer.Print Trim(SendStrBrBh)
        
        '姓名
        .CurrentX = X0 + 8.5: .CurrentY = Y0 - 1.9 + 0.6
        If SendStrBrXm <> "" Then Printer.Print Trim(SendStrBrXm)
        
        '合计(小写)
        .CurrentX = X0 + 8.5: .CurrentY = Y0 - 0.75
        If Val(SendStrFyHj) <> 0 Then Printer.Print "¥" & Format(SendStrFyHj, "0.00")
        
        '合计(大写)
        .CurrentX = X0 + 8.5: .CurrentY = Y0
        If Val(SendStrFyHj) <> 0 Then Printer.Print Get_Chinese(Val(SendStrFyHj))
        
        '日期
        .CurrentX = X0 + 8.5: .CurrentY = Y0 + 0.75
        Printer.Print Format(CStr(SendStrDySj), "yyyy-mm-dd hh:mm:ss")
        
        '收费员
        .CurrentX = X0 + 8.5: .CurrentY = Y0 + 1.5
        Printer.Print Trim(PStrUserName)
        
    End With
    Printer.EndDoc
    
End Sub

Public Sub PrintCzyJzd(SendMhFlexJzxx As MSHFlexGrid, SendStrQsfph As String, _
                       SendStrJsfph As String, SendStrYxfps As String, _
                       SendStrZffps As String, SendStrGjfps As String, _
                       SendStrJzsj As String, _
                       SendStrJzQsSj As String, SendStrJzJsSj As String, _
                       SendStrHj As String)
                           
    Dim X0     As Single, Y0      As Single
    Dim X1     As Single, Y1      As Single
    Dim X2     As Single, Y2      As Single
    Dim X3     As Single, Y3      As Single
    Dim IntRow As Integer, IntTmp As Integer, SingFyhj As Single
    
    X0 = 1: Y0 = 1
    Printer.ScaleMode = 7: Printer.FontSize = 15: Printer.FontBold = True
    Printer.CurrentX = X0 + 5.2:   Printer.CurrentY = Y0
    Printer.Print PStrSqzMC & "(结帐单)"
    
    X1 = X0: Y1 = Y0 + 1.5
    
    
    'H=7  W=17.8
    Printer.Line (X1, Y1)-(X1 + 17.8, Y1)
    Printer.Line (X1, Y1)-(X1, Y1 + 6.5)
    Printer.Line (X1, Y1 + 6.5)-(X1 + 17.8, Y1 + 6.5)
    Printer.Line (X1 + 17.8, Y1)-(X1 + 17.8, Y1 + 6.5)
    
    For IntTmp = 1 To 9
        Printer.Line (X1, Y1 + IntTmp * 0.5)-(X1 + 17.8, Y1 + IntTmp * 0.5)
    Next IntTmp
    
'    'line_1
    Printer.Line (X1 + 1.9, Y1)-(X1 + 1.9, Y1 + 3.5)
    Printer.Line (X1 + 1.9, Y1 + 4)-(X1 + 1.9, Y1 + 4.5)
'    'line_2
    Printer.Line (X1 + 4.6, Y1)-(X1 + 4.6, Y1 + 3.5)
'    Printer.Line (X1 + 4.6, Y1 + 4)-(X1 + 4.6, Y1 + 6.5)
'    'line_3
    Printer.Line (X1 + 6.4, Y1)-(X1 + 6.4, Y1 + 3.5)
'    'line_4
    Printer.Line (X1 + 8.4, Y1)-(X1 + 8.4, Y1 + 3.5)
'    Printer.Line (X1 + 8.4, Y1 + 4)-(X1 + 8.4, Y1 + 6.5)
'    'line_5
    Printer.Line (X1 + 10.3, Y1)-(X1 + 10.3, Y1 + 3.5)
'    Printer.Line (X1 + 10.3, Y1 + 4)-(X1 + 10.3, Y1 + 4.5)
'    'line_6
    Printer.Line (X1 + 13, Y1)-(X1 + 13, Y1 + 3.5)
'    Printer.Line (X1 + 13, Y1 + 4)-(X1 + 13, Y1 + 6.5)
'    'line_7
    Printer.Line (X1 + 15.7, Y1)-(X1 + 15.7, Y1 + 3.5)
'    Printer.Line (X1 + 15.7, Y1 + 4)-(X1 + 15.7, Y1 + 4.5)

    Printer.ScaleMode = 7: Printer.FontSize = 10: Printer.FontBold = False
    Printer.CurrentX = X0 + 16: Printer.CurrentY = Y0 + 1
    Printer.Print "单位:元"
    Printer.CurrentX = X0 + 5.2:   Printer.CurrentY = Y0

    IntTmp = 1
    With SendMhFlexJzxx
        For IntRow = 1 To .Rows - 1
            If IntRow <= 6 Then
                Printer.CurrentX = X1 + 0.5: Printer.CurrentY = Y1 + 0.1
                Printer.Print "项目"                  '项目
                Printer.CurrentX = X1 + 2.9: Printer.CurrentY = Y1 + 0.1
                Printer.Print "金额"
            
                Printer.CurrentX = X1 + 0.4: Printer.CurrentY = Y1 + IntTmp * 0.5 + 0.1
                Printer.Print Trim(.TextMatrix(IntRow, 1))                  '项目
                Printer.CurrentX = X1 + 2.1: Printer.CurrentY = Y1 + IntTmp * 0.5 + 0.1
                .Col = 1: Printer.Print Dq(Trim(.TextMatrix(IntRow, 2)))      '金额
            End If
            
            If IntRow > 6 And IntRow <= 12 Then
                Printer.CurrentX = X1 + 5.1: Printer.CurrentY = Y1 + 0.1
                Printer.Print "项目"
                Printer.CurrentX = X1 + 7.1: Printer.CurrentY = Y1 + 0.1
                Printer.Print "金额"
                
                Printer.CurrentX = X1 + 5:   Printer.CurrentY = Y1 + (IntTmp - 6) * 0.5 + 0.1
                Printer.Print Trim(.TextMatrix(IntRow, 1))       '项目
                Printer.CurrentX = X1 + 6.6: Printer.CurrentY = Y1 + (IntTmp - 6) * 0.5 + 0.1
                .Col = 1: Printer.Print Dq(Trim(.TextMatrix(IntRow, 2)))         '金额
            End If
            
            If IntRow > 12 And IntRow <= 18 Then
                Printer.CurrentX = X1 + 9:    Printer.CurrentY = Y1 + 0.1
                Printer.Print "项目"
                Printer.CurrentX = X1 + 11.4: Printer.CurrentY = Y1 + 0.1
                Printer.Print "金额"
                
                Printer.CurrentX = X1 + 8.8:  Printer.CurrentY = Y1 + (IntTmp - 12) * 0.5 + 0.1
                Printer.Print Trim(.TextMatrix(IntRow, 1))                      '项目
                
                Printer.CurrentX = X1 + 10.7: Printer.CurrentY = Y1 + (IntTmp - 12) * 0.5 + 0.1
                Printer.Print Dq(Trim(.TextMatrix(IntRow, 2)))         '金额
            End If
            
            If IntRow > 18 And IntRow <= 24 Then
                Printer.CurrentX = X1 + 14.1: Printer.CurrentY = Y1 + 0.1
                Printer.Print "项目"
                Printer.CurrentX = X1 + 16.5: Printer.CurrentY = Y1 + 0.1
                Printer.Print "金额"
                
                Printer.CurrentX = X1 + 13.4: Printer.CurrentY = Y1 + (IntTmp - 18) * 0.5 + 0.1
                Printer.Print Trim(.TextMatrix(IntRow, 1))             '项目
                Printer.CurrentX = X1 + 15.8: Printer.CurrentY = Y1 + (IntTmp - 18) * 0.5 + 0.1
                Printer.Print Dq(Trim(.TextMatrix(IntRow, 2)))         '金额
            End If
            IntTmp = IntTmp + 1
            SingFyhj = SingFyhj + Val(.TextMatrix(IntRow, 2))
        Next IntRow
    End With
    
    '-------------------------------------合计
    X2 = X0: Y2 = Y1 + 3.6
    Printer.CurrentX = X2 + 0.1: Printer.CurrentY = Y2
    Printer.Print "合计(小写):" & Format(SendStrHj, "0.00")
    
    Printer.CurrentX = X2 + 6.5: Printer.CurrentY = Y2
    Printer.Print "合计(大写):" & Get_Chinese(Val(SendStrHj))

    '-------------------------------------结帐时间
    Printer.CurrentX = X2 + 0.1:  Printer.CurrentY = Y2 + 0.5
    Printer.Print "结帐时间:"
    Printer.CurrentX = X2 + 2.1:  Printer.CurrentY = Y2 + 0.5
    Printer.Print SendStrJzQsSj & "至" & SendStrJzJsSj
'
    Y3 = Y2 + 1
    '-------------------------------------
    Printer.CurrentX = X3 + 2:  Printer.CurrentY = Y3
    Printer.Print "    发票号:" & SendStrQsfph & "至" & SendStrJsfph
    Printer.CurrentX = X3 + 2:  Printer.CurrentY = Y3 + 0.5
    Printer.Print "共计发票数:" & SendStrGjfps
    Printer.CurrentX = X3 + 2:  Printer.CurrentY = Y3 + 1
    Printer.Print "有效发票数:" & SendStrYxfps
    Printer.CurrentX = X3 + 2:  Printer.CurrentY = Y3 + 1.5
    Printer.Print "作废发票数:" & SendStrZffps
    
    X3 = X0: Y3 = Y1 + 4.6
    Printer.CurrentX = X3:      Printer.CurrentY = Y3 + 2.2
    Printer.Print "操作员姓名:" & PStrUserName
    Printer.CurrentX = X3 + 11: Printer.CurrentY = Y3 + 2.2
    Printer.Print "卫生站盖章:            " & Format(SendStrJzsj, "yyyy年mm月dd日")
    Printer.EndDoc
End Sub

Public Function Dq(MStr As String) As String
    Select Case Len(Trim(MStr))
        Case 0:  Dq = ""
        Case 3:  Dq = "      " & MStr
        Case 4:  Dq = "     " & MStr
        Case 5:  Dq = "    " & MStr
        Case 6:  Dq = "   " & MStr
        Case 7:  Dq = "  " & MStr
        Case 8:  Dq = " " & MStr
        Case 9:  Dq = "" & MStr
        Case Else
        Dq = MStr
    End Select
End Function

Public Sub ProTxtGetFocus(TxtSend As TextBox)
     TxtSend.BackColor = &HFFC0C0
End Sub
Public Sub ProTxtLostFocus(TxtSend As TextBox)
     TxtSend.BackColor = &HFFFFFF
End Sub

Public Sub ProCmbGetFocus(CmbSend As ComboBox)
     CmbSend.BackColor = &HFFC0C0
End Sub
Public Sub ProCmbLostFocus(CmbSend As ComboBox)
     CmbSend.BackColor = &HFFFFFF
End Sub

Public Sub ProcAdoRsToMsFlex(SAdoRs As ADODB.Recordset, MsFlex As MSFlexGrid)
    
    Dim IntRow  As Integer, IntCol  As Integer
    
    With MsFlex
        .Clear
        If Not (SAdoRs.EOF Or SAdoRs.BOF) Then SAdoRs.MoveLast: SAdoRs.MoveFirst
        
        '字段
        .Rows = SAdoRs.Fields.Count
        .Cols = SAdoRs.RecordCount + 1
        For IntRow = 0 To SAdoRs.Fields.Count - 1
            .TextMatrix(IntRow, 0) = IIf(IsNull(SAdoRs.Fields(IntRow).Name), "", Trim(SAdoRs.Fields(IntRow).Name))
        Next IntRow
        .ColWidth(0) = 1500
        
        '记录
        IntCol = 1
        Do While Not SAdoRs.EOF
            For IntRow = 0 To SAdoRs.Fields.Count - 1
                .TextMatrix(IntRow, IntCol) = IIf(IsNull(SAdoRs.Fields(IntRow)), "", Trim(SAdoRs.Fields(IntRow)))
            Next IntRow
            IntCol = IntCol + 1
            SAdoRs.MoveNext
        Loop
    
        '行编辑
        For IntRow = 0 To .Rows - 1
            .RowHeight(IntRow) = 300
        Next IntRow
        
        '列编辑
        For IntCol = 0 To .Cols - 1
            .ColWidth(IntCol) = 1200
            .ColAlignment(IntCol) = 4
        Next IntCol
    End With
End Sub

⌨️ 快捷键说明

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