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

📄

📁 VB开发的ERP系统
💻
📖 第 1 页 / 共 5 页
字号:
               Key             =   "tz"
            EndProperty
         EndProperty
      End
   End
   Begin MSComctlLib.Toolbar Tlb_Action 
      Align           =   1  'Align Top
      Height          =   555
      Left            =   0
      TabIndex        =   6
      Top             =   0
      Width           =   11805
      _ExtentX        =   20823
      _ExtentY        =   979
      ButtonWidth     =   820
      ButtonHeight    =   926
      AllowCustomize  =   0   'False
      Wrappable       =   0   'False
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   10
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "设置"
            Key             =   "ymsz"
            Object.ToolTipText     =   "打印页面设置"
            ImageKey        =   "sz"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "打印"
            Key             =   "dy"
            Object.ToolTipText     =   "打印当前单据或Ctrl+P"
            ImageKey        =   "dy"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "预览"
            Key             =   "yl"
            ImageKey        =   "yl"
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "查询"
            Key             =   "cx"
            ImageKey        =   "cx"
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   4
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "调整"
            Key             =   "tz"
            ImageKey        =   "tz"
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   4
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "帮助"
            Key             =   "bz"
            ImageKey        =   "bz"
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            Key             =   "fh"
            ImageKey        =   "tc"
         EndProperty
      EndProperty
      BorderStyle     =   1
      Begin MSComctlLib.Toolbar GsToolbar 
         Height          =   525
         Left            =   9150
         TabIndex        =   7
         Top             =   0
         Width           =   1755
         _ExtentX        =   3096
         _ExtentY        =   926
         ButtonWidth     =   1455
         ButtonHeight    =   926
         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        =   8
      Top             =   1440
      Visible         =   0   'False
      Width           =   345
   End
End
Attribute VB_Name = "Cl_ProdPrice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************************************************************
'*    模 块 名 称 :产品成本调整
'*    功 能 描 述 :
'*    程序员姓名  :白凤英
'*    最后修改人  :白凤英
'*    最后修改时间:2001/12/24
'*    备        注:程序中所有依实际情况自定义部分均用[>> <<]括起
'*
'*    1.每次调入外部功能窗体,均要加锁ChangeLock=True,窗体关闭后解锁ChangeLock=false
'*
'*    3.Lab_OperStatus 用此标签来标识单据录入状态(默认值为1) 1-浏览 2-修改
'*
'***************************************************************************************
 
'以下为自定义变量
 
'其它固定使用变量
Dim Tsxx As String                              '系统信息提示(Fixed)
Dim ReportTitle As String                       '报表主标题(Fixed)
Dim Str_QueryCondi As String                    '用户录入查询条件
   
'以下为固定使用变量(网格)
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              '文本框内容改变锁
     
    '报表主标题及报表编码(Fixed)
    ReportTitle = "产品成本调整"
    XtReportCode = "Chhs_ProdPrice"
    Load Dyymctbl
    
    '调整标题栏及网格、格式工具条位置(Fixed)
    Pic_Title.Left = 40
    Pic_Title.Top = Tlb_Action.Top + Tlb_Action.Height - 10
    WglrGrid.Left = Pic_Title.Left
    WglrGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
    
    '调 入 网 格(Fixed)
    GridCode = "Chhs_ProdPrice"      '网格属性编码
    Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
    
    Qslz = GridInf(1)
    Sjhgd = GridInf(2)
    Pmbcsjhs = GridInf(3)
    Fzxwghs = GridInf(4)
    Sfblbzkd = GridInf(5)
    Shsfts = GridInf(6)
    Sfxshjwg = GridInf(7)
    Szzls = WglrGrid.Cols - 1
    
    '清除表头内容
    Lbl_TitleText(1) = CStr(Xtyear) + "." + CStr(PGNowmon)
    Lbl_TitleText(0) = ""
    
    '设置状态为修改状态
    Lab_OperStatus = "2"
 
End Sub

Private Sub Form_Unload(Cancel As Integer)           '窗体卸载
    If Not Fun_Drfrmyxxpd Then
       Cancel = True
       Exit Sub
    End If

    '卸载条件窗体
    Cl_ProdPriceCond.UnloadCheck.Value = 1
    Unload Cl_ProdPriceCond
    
    '卸载打印页面窗体
    Unload Dyymctbl

End Sub

Private Sub Sub_Query()                              '生成查询结果(Define)

    Dim Rec_Query As Recordset                  '查询结果动态集
    Dim Coljsq As Long                          '网格列计数器
    Dim Jsqte As Long                        '临时动态计数器
    Dim Str1 As String
    Dim NewCombox As ComboItem
    Dim mPeriod As Integer
    
    '以下为自定义部分[
    mPeriod = PGNowmon
    
    With Cl_ProdPriceCond

        '生成查询条件
        Str_QueryCondi = " where a.billcode='1202' and a.inoutflag=1 and chalkitupman='' and  a.kjyear= " & Xtyear & " and period=" & mPeriod
        For Jsqte = 0 To 4
            Select Case Jsqte
                Case 0  '仓库
                    Str_QueryCondi = Str_QueryCondi & " And a.whcode='" & Trim(.LrText(0).Tag) & "'"
                 Case 1  '存货分类(Like)
                    If Trim(.LrText(1).Text) <> "" Then
                        Str_QueryCondi = Str_QueryCondi & " And a.invsortcode like '" & Trim(.LrText(1).Tag) & "%'"
                    End If
                Case 2  '查询存货范围(起始)
                    If Trim(.LrText(2).Text) <> "" Then
                        Str_QueryCondi = Str_QueryCondi & " And a.mnumber>='" & Trim(.LrText(2).Text) & "'"
                    End If
                Case 3  '查询存货范围(终止)
                    If Trim(.LrText(3).Text) <> "" Then
                        Str_QueryCondi = Str_QueryCondi & " And a.mnumber<= '" & Trim(.LrText(3).Text) & "'"
                    End If
                Case 4  '调整范围
                    If .Opt_Part.Value = True Then
                        Str_QueryCondi = Str_QueryCondi & " And a.price<=0"
                    End If
            End Select
        Next Jsqte
    End With

    WglrGrid.Rows = WglrGrid.FixedRows

    SqlStr = "SELECT Mnumber,Mname,Model,PrimaryUnitName,Sum(FactReceiptQuan) as Quan,Sum(Emoney) as Money FROM Chhs_V_InOut a " & Trim(Str_QueryCondi) & _
              " Group by a.Mnumber,a.Mname,a.Model,a.PrimaryUnitName Order By a.Mnumber"
    Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
    With Rec_Query

        Do While Not .EOF

            WglrGrid.AddItem ""
            Jsqte = WglrGrid.Rows - 1
            '[>>自定义填充内容
            WglrGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")
            WglrGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Mname") & "")
            WglrGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Model") & "")
            WglrGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")

            If Not IsNull(.Fields("Quan")) Then
                If .Fields("Quan") <> 0 Then                                                                            '数量
                    WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = .Fields("Quan")
                End If
            End If
            If Not IsNull(.Fields("Money")) Then
                If .Fields("Money") <> 0 Then                                                                            '数量
                    WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = .Fields("Money")
                End If
            End If
            If Val(WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))) <> 0 And Val(WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls))) <> 0 Then
                WglrGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Format(Val(WglrGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls))) / Val(WglrGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls))), "###0." + String(Xtdjxsws, "0"))
            End If
            '<<]
            '设置数据行高度(Fixed)
            WglrGrid.RowHeight(Jsqte) = Sjhgd

            '动态集指针加1,同时将计数器加1(Fixed)
            .MoveNext
            Jsqte = Jsqte + 1
        Loop
    End With


    ']以上为用户自定义部分

    Set Rec_Query = Nothing

End Sub

Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)             '用户点击工具条
     
    WglrGrid.SetFocus
    '屏蔽文本框,下拉组合框有效性判断
     
    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 "cx"                                            '查 询
            '调入其它窗体或功能产生的有效性判断(包括数据回写)
            If Not Fun_Drfrmyxxpd Then
                Exit Sub
            End If
            
            Cl_ProdPriceCond.Show 1
        Case "tz"                                            '调 整
            '调入其它窗体或功能产生的有效性判断(包括数据回写)
            If Not Fun_Drfrmyxxpd Then
                Exit Sub
            End If
                

⌨️ 快捷键说明

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