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

📄 frmbillmanage.frm

📁 自己写的物流管理系统
💻 FRM
📖 第 1 页 / 共 5 页
字号:
                                End If
                        Next
                        If isfind = False Then
                            .Cell(1, 4).Range.Text = ""
                        End If
                        .Cell(2, 1).Width = 80
                        .Cell(2, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(2, 1).Range.Text = "发货人"
                        .Cell(2, 2).Width = 133
                        .Cell(2, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        inum = 0
                        isfind = False
                        For inum = 0 To UBound(arrclient, 2)
                                If arrclient(0, inum) = sys.TextTolong(rs("SENDER")) Then
                                    .Cell(2, 2).Range.Text = sys.StrToText(arrclient(1, inum))
                                    isfind = True
                                    Exit For
                                End If
                        Next
                        If isfind = False Then
                            .Cell(2, 2).Range.Text = ""
                        End If
                        .Cell(2, 3).Width = 80
                        .Cell(2, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(2, 3).Range.Text = "收货人:"
                        .Cell(2, 4).Width = 133
                        .Cell(2, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        inum = 0
                        isfind = False
                        For inum = 0 To UBound(arrclient, 2)
                                If arrclient(0, inum) = sys.TextTolong(rs("RECEIVER")) Then
                                    .Cell(2, 4).Range.Text = sys.StrToText(arrclient(1, inum))
                                    isfind = True
                                    Exit For
                                End If
                        Next
                        If isfind = False Then
                            .Cell(2, 4).Range.Text = ""
                        End If
                        .Cell(3, 1).Width = 80
                        .Cell(3, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(3, 1).Range.Text = "国铁运费:"
                        .Cell(3, 2).Width = 133
                        .Cell(3, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("BASICCARRIAGE")) Then
                            .Cell(3, 2).Range.Text = sys.StrToText(rs("BASICCARRIAGE"))
                        Else
                            .Cell(3, 2).Range.Text = "-"
                        End If
                        .Cell(3, 3).Width = 80
                        .Cell(3, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(3, 3).Range.Text = "地铁运费:"
                        .Cell(3, 4).Width = 133
                        .Cell(3, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("LOCALCARRIAGE")) Then
                            .Cell(3, 4).Range.Text = sys.StrToText(rs("LOCALCARRIAGE"))
                        Else
                            .Cell(3, 4).Range.Text = "-"
                        End If
                        .Cell(4, 1).Width = 80
                        .Cell(4, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(4, 1).Range.Text = "服务费:"
                        .Cell(4, 2).Width = 133
                        .Cell(4, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("SERVECHARGE")) Then
                            .Cell(4, 2).Range.Text = sys.StrToText(rs("SERVECHARGE"))
                        Else
                            .Cell(4, 2).Range.Text = "-"
                        End If
                        .Cell(4, 3).Width = 80
                        .Cell(4, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(4, 3).Range.Text = "装卸费:"
                        .Cell(4, 4).Width = 133
                        .Cell(4, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("LOADCHARGE")) Then
                         .Cell(4, 4).Range.Text = sys.StrToText(rs("LOADCHARGE"))
                        Else
                            .Cell(4, 4).Range.Text = "-"
                        End If
                        .Cell(5, 1).Width = 80
                        .Cell(5, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(5, 1).Range.Text = "短途运费:"
                        .Cell(5, 2).Width = 133
                        .Cell(5, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("SHORTCARRIAGE")) Then
                            .Cell(5, 2).Range.Text = sys.StrToText(rs("SHORTCARRIAGE"))
                        Else
                            .Cell(5, 2).Range.Text = "-"
                        End If
                        .Cell(5, 3).Width = 80
                        .Cell(5, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(5, 3).Range.Text = "仓储费:"
                        .Cell(5, 4).Width = 133
                        .Cell(5, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("STORAGECHARGE")) Then
                            .Cell(5, 4).Range.Text = sys.StrToText(rs("STORAGECHARGE"))
                        Else
                            .Cell(5, 4).Range.Text = "-"
                        End If
                        .Cell(6, 1).Width = 80
                        .Cell(6, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(6, 1).Range.Text = "清扫费:"
                        .Cell(6, 2).Width = 133
                        .Cell(6, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("CLEARCHARGE")) Then
                            .Cell(6, 2).Range.Text = sys.StrToText(rs("CLEARCHARGE"))
                        Else
                            .Cell(6, 2).Range.Text = "-"
                        End If
                        .Cell(6, 3).Width = 80
                        .Cell(6, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(6, 3).Range.Text = "优惠金额:"
                        .Cell(6, 4).Width = 133
                        .Cell(6, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("FAVOURABILE")) Then
                            .Cell(6, 4).Range.Text = sys.StrToText(rs("FAVOURABILE"))
                        Else
                            .Cell(6, 4).Range.Text = "-"
                        End If
                        .Cell(7, 1).Width = 80
                        .Cell(7, 1).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(7, 1).Range.Text = "单价:"
                        .Cell(7, 2).Width = 133
                        .Cell(7, 2).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If (IsNumeric(rs("TOTAL"))) And (IsNumeric(rs("WEIGHT"))) Then
                            .Cell(7, 2).Range.Text = sys.StrToText(FormatNumber(rs("TOTAL") / rs("WEIGHT"), 2))
                        Else
                            .Cell(7, 2).Range.Text = "-"
                        End If
                        .Cell(7, 3).Width = 80
                        .Cell(7, 3).Range.Paragraphs.Alignment = wdAlignParagraphLeft
                        .Cell(7, 3).Range.Text = "运费合计:"
                        .Cell(7, 4).Width = 133
                        .Cell(7, 4).Range.Paragraphs.Alignment = wdAlignParagraphCenter
                        If Not IsNull(rs("TOTAL")) Then
                            .Cell(7, 4).Range.Text = sys.StrToText(rs("TOTAL")) & "元"
                        Else
                            .Cell(7, 4).Range.Text = "-"
                        End If
                    End With
                    .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
                    .MoveDown Unit:=wdLine, Count:=7
                    .TypeText Text:="备注: "
                    .TypeParagraph
                    .TypeParagraph
                    .ParagraphFormat.Alignment = wdAlignParagraphRight
                    .TypeText Text:="宜春市金胜物流有限公司 "
                    .TypeParagraph
                    .TypeText Text:=sys.StrToText(Year(Date)) & " 年 " & sys.StrToText(Month(Date)) & " 月" & sys.StrToText(Day(Date)) & " 日"
                    rs.MoveNext
                Loop
                .TypeBackspace
            End With
            wordApp.PrintOut
            
        Else
            MsgBox "数据错误!"
            Unload Me
        End If

    Else
        MsgBox "请先选择要打印的记录!"
    End If
    
End Sub

Private Sub cmdAllView_Click()
        
        Dim ir As Integer
        Dim strTtaffic As String
        ir = 1
        For ir = 1 To lsvTraffic.ListItems.Count
             If IsNumeric(lsvTraffic.ListItems.Item(ir).Tag) Then
                strTtaffic = strTtaffic & sys.TextTolong(lsvTraffic.ListItems.Item(ir).Tag) & ","
             End If
        Next
        If strTtaffic <> "" Then
        '取得数据
        Dim inum As Integer
        Dim isfind As Boolean
        Dim strTemp As String
        Dim rs As New ADODB.Recordset
        strsql = "SELECT * FROM TRAFFIC WHERE ID in (" & Left(strTtaffic, Len(strTtaffic) - 1) & ")"
        Set rs = sys.DB.OpenRecordSet(strsql)
        If Not rs.EOF Then
            Dim wordApp As New Word.Application
            Dim mysel As Word.Selection
            Dim oTable As Word.Table
            wordApp.Documents.Add
            wordApp.Visible = True
            wordApp.Activate
            Set mysel = wordApp.Selection
            With mysel
                Do While Not rs.EOF
                   .TypeParagraph
                   .TypeParagraph
                   .TypeParagraph
                    .ParagraphFormat.Alignment = wdAlignParagraphRight
                    .Paragraphs.Last.Range.Font.Name = "楷体_GB2312"
                    .Paragraphs.Last.Range.Font.Bold = False
                    .Paragraphs.Last.Range.Font.Size = 10
                    .TypeText Text:="第一联:存根"
                    .TypeParagraph
                    .TypeParagraph
                    .TypeParagraph
                    .ParagraphFormat.Alignment = wdAlignParagraphCenter
                    .Paragraphs.Last.Range.Font.Bold = True
                    .Paragraphs.Last.Range.Font.Size = 20
                    .TypeText Text:="运  输  结  算  单"
                    .TypeParagraph
                    .ParagraphFormat.Alignment = wdAlignParagraphLeft
                    .Paragraphs.Last.Range.Font.Bold = False
                    .Paragraphs.Last.Range.Font.Size = 12
                    '客户
                    inum = 0
                    isfind = False
                    strTemp = ""
                    For inum = 0 To UBound(arrclient, 2)
                            If arrclient(0, inum) = sys.TextTolong(rs("SENDER")) Then
                                strTemp = strTemp & "客户名称:" & sys.StrToText(arrclient(1, inum)) & "                          发货日期:" & sys.StrToText(rs("DATENUM"))
                                isfind = True
                                Exit For
                            End If
                    Next
                    If isfind = False Then
                        strTemp = strTemp & "客户名称:                        " & "                          发货日期:" & sys.StrToText(rs("DATENUM"))
                    End If
                    .TypeText Text:=strTemp
                    .TypeParagraph
                    '发站
                    inum = 0
                    isfind = False
                    strTemp = ""
                    For inum = 0 To UBound(arrstation, 2)
                            If arrstation(0, inum) = sys.TextTolong(rs("SENDSTATION")) Then
                                strTemp = strTemp & "发站:" & arrstation(1, inum) & "        "
                                isfind = True
                                Exit For
                            End If
                    Next
                    If isfind = False Then
                        strTemp = strTemp & "发站:        "
                    End If
                    '到站
                    inum = 0
                    isfind = False
                    For inum = 0 To UBound(arrstation, 2)
                            If arrstation(0, inum) = sys.TextTolong(rs("RECEIVESTATION")) Then
                                strTemp = strTemp & "到站:" & arrstation(1, inum) & "                        重量:" & sys.StrToText(rs("WEIGHT")) & "吨"
                                isfind = True
                                Exit For

⌨️ 快捷键说明

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