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

📄 +

📁 VB开发的ERP系统
💻
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form KF_FrmMateChoice 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "物料选择"
   ClientHeight    =   6915
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10320
   Icon            =   "物料选择.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6915
   ScaleWidth      =   10320
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VSFlex8Ctl.VSFlexGrid vs 
      Height          =   6285
      Left            =   4440
      TabIndex        =   3
      Top             =   90
      Width           =   5835
      _ExtentX        =   10292
      _ExtentY        =   11086
      Appearance      =   1
      BorderStyle     =   1
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      MousePointer    =   0
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      BackColorFixed  =   -2147483633
      ForeColorFixed  =   -2147483630
      BackColorSel    =   -2147483635
      ForeColorSel    =   -2147483634
      BackColorBkg    =   -2147483636
      BackColorAlternate=   -2147483643
      GridColor       =   -2147483633
      GridColorFixed  =   -2147483632
      TreeColor       =   -2147483632
      FloodColor      =   192
      SheetBorder     =   -2147483642
      FocusRect       =   1
      HighLight       =   1
      AllowSelection  =   -1  'True
      AllowBigSelection=   -1  'True
      AllowUserResizing=   0
      SelectionMode   =   0
      GridLines       =   1
      GridLinesFixed  =   2
      GridLineWidth   =   1
      Rows            =   50
      Cols            =   10
      FixedRows       =   1
      FixedCols       =   1
      RowHeightMin    =   0
      RowHeightMax    =   0
      ColWidthMin     =   0
      ColWidthMax     =   0
      ExtendLastCol   =   0   'False
      FormatString    =   ""
      ScrollTrack     =   0   'False
      ScrollBars      =   3
      ScrollTips      =   0   'False
      MergeCells      =   0
      MergeCompare    =   0
      AutoResize      =   -1  'True
      AutoSizeMode    =   0
      AutoSearch      =   0
      MultiTotals     =   -1  'True
      SubtotalPosition=   1
      OutlineBar      =   0
      OutlineCol      =   0
      Ellipsis        =   0
      ExplorerBar     =   0
      PicturesOver    =   0   'False
      FillStyle       =   0
      RightToLeft     =   0   'False
      PictureType     =   0
      TabBehavior     =   0
      OwnerDraw       =   0
      Editable        =   0   'False
      ShowComboButton =   -1  'True
      WordWrap        =   0   'False
      TextStyle       =   0
      TextStyleFixed  =   0
      OleDragMode     =   0
      OleDropMode     =   0
      DataMode        =   0
      VirtualData     =   -1  'True
   End
   Begin VB.CommandButton CmdExit 
      Caption         =   "退出"
      Height          =   315
      Left            =   2520
      TabIndex        =   2
      Top             =   6540
      Width           =   1245
   End
   Begin VB.CommandButton CmdChoice 
      Caption         =   "选定"
      Height          =   315
      Left            =   5130
      TabIndex        =   1
      Top             =   6570
      Width           =   1245
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   2460
      Top             =   2550
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "物料选择.frx":1042
            Key             =   "T"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "物料选择.frx":13DC
            Key             =   "cl"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "物料选择.frx":1776
            Key             =   "wl"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TreeView TreeView 
      Height          =   6315
      Left            =   60
      TabIndex        =   0
      Top             =   90
      Width           =   4305
      _ExtentX        =   7594
      _ExtentY        =   11139
      _Version        =   393217
      Style           =   7
      Checkboxes      =   -1  'True
      SingleSel       =   -1  'True
      ImageList       =   "ImageList1"
      Appearance      =   1
   End
End
Attribute VB_Name = "KF_FrmMateChoice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************************************************
'*    模 块 名 称 :物料选择
'*    功 能 描 述 :
'*    程序员姓名  :张万成
'*    最后修改人  :张万成
'*    最后修改时间:2001/12/06
'*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
'**************************************************************************

Dim LstItem As ListItem
Dim strSort As String
Dim B_F As Boolean

Dim GridCode As String                   '显示网格网格代码
Dim GridInf() As Variant                 '整个网格设置信息
Dim Tsxx As String                       '系统提示信息
Dim Qslz As Long                         '网格隐藏(非操作显示)列数
Dim Sjhgd As Double                      '网格数据行高度
Dim Sfxshjwg As Boolean                  '是否显示合计网格
Dim GridBoolean() As Boolean             '网格列信息(布尔型)
Dim GridStr()  As String                 '网格列信息(字符型)
Dim GridInt() As Integer                 '网格列信息(整型)
Dim Szzls As Integer                     '数组总列数(网格列数-1)


Private Sub CmdChoice_Click()   '选中
 Dim Item As MSComctlLib.ListItem
 Dim jsq As Long
 strM = ""
    For jsq = vs.FixedRows To vs.Rows - 1
        If vs.IsSelected(jsq) Then
            strM = strM + "'" + Trim(vs.TextMatrix(jsq, Sydz("001", GridStr(), Szzls))) + "',"
        End If
    Next jsq
    B_F = True
    Unload Me
End Sub

Private Sub CmdExit_Click()
 strM = ""
 Unload Me
End Sub

Private Sub Form_Load()
 Call AddTree
 B_F = False
 
GridCode = "KF_MateChoice"
Call BzWgcsh(vs, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  
Qslz = GridInf(1)
Sjhgd = GridInf(2)
Sfxshjwg = GridInf(7)
Szzls = vs.Cols - 1
vs.Left = TreeView.Width + 200
vs.Top = TreeView.Top
vs.Width = Me.Width - TreeView.Width - 300
vs.Height = TreeView.Height
vs.ExplorerBar = flexExNone
vs.SelectionMode = flexSelectionByRow
End Sub

Private Sub AddTree()           '填加物料分类

    Dim aDo_Sort As New Recordset
    TreeView.Nodes.Clear
    TreeView.Nodes.Add , 4, "T", "物料选择", "T"
    Set aDo_Sort = Cw_DataEnvi.DataConnect.Execute("select * from Kf_InvSort  order by InvSortCode")
    
    With aDo_Sort
        Do While Not .EOF
          If .Fields("ParentCode") = "" Then
              Set nodX = TreeView.Nodes.Add("T", 4, "T" & Trim(.Fields("InvSortCode")), "(" & Trim(.Fields("InvSortCode")) & ")" & Trim(.Fields("InvSortName")), "cl", "T")
          Else
              Set nodX = TreeView.Nodes.Add("T" & Trim(.Fields("ParentCode")), 4, "T" & Trim(.Fields("InvSortCode")), "(" & Trim(.Fields("InvSortCode")) & ")" & Trim(.Fields("InvSortName")), "cl", "T")
          End If
            nodX.EnsureVisible
            .MoveNext
        Loop
    End With

End Sub


Private Sub Form_Unload(Cancel As Integer)
    If Not B_F Then
        strM = ""
    End If
End Sub

Private Sub TreeView_NodeCheck(ByVal Node As MSComctlLib.Node)
 Dim Int_Index As Integer
 Int_Index = Node.Index
 strSort = ""
 
    Call Fill(Mid(Node.Key, 2), Node.Checked)
    For Each Node In TreeView.Nodes
        If Node.Checked Then
            strSort = strSort & "'" & Trim(Mid(Node.Key, 2)) & "',"
        End If
    Next
    If strSort <> "" Then
        strSort = Mid(strSort, 1, Len(strSort) - 1)
        Call mate
    Else
        vs.Clear 1
    End If
End Sub



Private Sub Fill(str As String, b As Boolean)       '查找分类
  Dim adoTemp As New ADODB.Recordset
  Dim Node As MSComctlLib.Node

  Set adoTemp = Cw_DataEnvi.DataConnect.Execute("select InvSortCode from Kf_InvSort where InvSortCode like '" & Trim(str) & "%'  order by InvSortCode")
     For Each Node In TreeView.Nodes

            Do While Not adoTemp.EOF
                If Node.Key = "T" & Trim(adoTemp.Fields("InvSortCode")) Then
                    Node.Checked = b
                End If
                adoTemp.MoveNext
            Loop
      adoTemp.MoveFirst
    Next Node

End Sub

Private Sub mate()              '填加物料
 Dim adoMate As New ADODB.Recordset
 Dim jsq As Long
    vs.SelectionMode = flexSelectionListBox
    vs.Rows = vs.FixedRows
    jsq = vs.FixedRows
    If strSort <> "" Then
        Set adoMate = Cw_DataEnvi.DataConnect.Execute("select distinct mnumber,mname,model,primaryunitname from KF_V_NowQuan where InvSortCode in (" & Trim(strSort) & ") and whcode='" & Trim(KF_FrmPDD.LrText(1).Tag) & "' order by MNumber")
        With adoMate
            If Not .EOF Then
                Do While Not .EOF
                        vs.AddItem ""
                        vs.TextMatrix(jsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("mnumber"))
                        vs.TextMatrix(jsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("mname"))
                        vs.TextMatrix(jsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("model"))
                        vs.TextMatrix(jsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("primaryunitname"))
                        vs.IsSelected(jsq) = True
                    .MoveNext
                    jsq = jsq + 1
                Loop
                
            End If
        End With
    End If
End Sub


⌨️ 快捷键说明

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