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

📄 frmstoreinman.frm

📁 主要是基本的办公用品管理操作界面, 包含基本信息管理、办公用品管理
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmStoreInMan 
   Caption         =   "办公用品入库管理"
   ClientHeight    =   5595
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8880
   LinkTopic       =   "Form1"
   ScaleHeight     =   5595
   ScaleWidth      =   8880
   StartUpPosition =   2  'CenterScreen
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   4215
      Left            =   120
      TabIndex        =   9
      Top             =   600
      Width           =   8535
      _ExtentX        =   15055
      _ExtentY        =   7435
      _Version        =   393216
      AllowUpdate     =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Cmd_Check 
      Caption         =   "审 核"
      Height          =   495
      Left            =   5520
      TabIndex        =   8
      Top             =   4920
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Ado_Type 
      Height          =   375
      Left            =   6480
      Top             =   120
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Ado_Type"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataListLib.DataCombo dco_Type 
      Height          =   315
      Left            =   3480
      TabIndex        =   6
      Top             =   120
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin VB.CheckBox Check1 
      Caption         =   "全部"
      Height          =   255
      Left            =   5160
      TabIndex        =   5
      Top             =   150
      Width           =   855
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   120
      Top             =   4680
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Modi 
      Caption         =   "修 改"
      Height          =   495
      Left            =   2160
      TabIndex        =   4
      Top             =   4920
      Width           =   1335
   End
   Begin VB.CommandButton Cmd_Del 
      Caption         =   "删 除"
      Height          =   495
      Left            =   3840
      TabIndex        =   3
      Top             =   4920
      Width           =   1335
   End
   Begin VB.CommandButton Cmd_Back 
      Caption         =   "返 回"
      Height          =   495
      Left            =   7080
      TabIndex        =   2
      Top             =   4920
      Width           =   1335
   End
   Begin VB.CommandButton Cmd_Add 
      Caption         =   "添 加"
      Height          =   495
      Left            =   480
      TabIndex        =   1
      Top             =   4920
      Width           =   1335
   End
   Begin MSDataListLib.DataCombo dco_UType 
      Height          =   315
      Left            =   1560
      TabIndex        =   7
      Top             =   120
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      Text            =   ""
   End
   Begin MSAdodcLib.Adodc Ado_UType 
      Height          =   375
      Left            =   0
      Top             =   5040
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Ado_UType"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "选择分类名称"
      Height          =   195
      Left            =   240
      TabIndex        =   0
      Top             =   180
      Width           =   1080
   End
End
Attribute VB_Name = "FrmStoreInMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Check1_Click()
  If Check1.Value = 1 Then
    dco_UType.Enabled = False
    dco_Type.Enabled = False
    dco_UType.Text = ""
    dco_Type.Text = ""
  Else
    dco_UType.Enabled = True
    dco_Type.Enabled = True
  End If
  DataRefresh
End Sub

Private Sub Cmd_Add_Click()
  FrmStoreInEdit.Modify = False
  FrmStoreInEdit.txtDate = Date
  FrmStoreInEdit.Show 1
  DataRefresh
End Sub

Private Sub Cmd_Back_Click()
  Unload Me
End Sub

Private Sub DataRefresh()
  Dim StrSearch As String
  StrSearch = ""
  If Check1.Value <> 1 Then
    If Len(Trim(dco_UType.Text)) > 0 Then   '设置一级分类
      StrSearch = " And t.UpperId=" + Trim(dco_UType.BoundText)
    End If
    If Len(Trim(dco_Type.Text)) > 0 Then   '设置二级分类
      StrSearch = " And s.TypeId=" + Trim(dco_Type.BoundText)
    End If
  End If
  Adodc1.ConnectionString = Conn
  Adodc1.RecordSource = "Select i.InId,s.OName AS 办公用品名称,t1.TypeName AS 一级分类名称," _
    + "t.TypeName AS 二级分类名称,i.InDate AS 入库日期,l.SName AS 供货商名称," _
    + "i.InAmount AS 入库数量,i.inSum AS 入库总金额,i.Memos AS 备注,i.Flag," _
    + " IIF(i.Flag=0,'创建','入库') AS 状态,i.OId" _
    + " From StoreIn i,Store s,Types t,Types t1,Supplier l Where i.OId=s.OId " _
    + " And i.SId=l.SId And s.TypeId=t.TypeId " _
    + " And t.UpperId=t1.TypeId" + StrSearch + " Order By i.InDate Desc"
  Adodc1.Refresh
  Set DataGrid1.DataSource = Adodc1
  DataGrid1.Columns(0).Width = 0
  DataGrid1.Columns(1).Width = 1200
  DataGrid1.Columns(2).Width = 1200
  DataGrid1.Columns(3).Width = 1200
  DataGrid1.Columns(4).Width = 1200
  DataGrid1.Columns(5).Width = 1400
  DataGrid1.Columns(6).Width = 1200
  DataGrid1.Columns(7).Width = 1200
  DataGrid1.Columns(8).Width = 1200
  DataGrid1.Columns(9).Width = 0
  DataGrid1.Columns(10).Width = 800
  DataGrid1.Columns(11).Width = 0
End Sub

Private Sub Cmd_Check_Click()
  If Adodc1.Recordset.EOF Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '审核后不允许更改入库信息,并更新库存数量
  If Adodc1.Recordset.Fields(9) = 0 Then
    MyIn.UpdateFlag (Adodc1.Recordset.Fields(0))
    '更新库存数量
    MyStore.OAmount = Adodc1.Recordset.Fields(6)
    MyStore.UpdateAmount (Adodc1.Recordset.Fields(11))
    MsgBox "入库成功"
    Cmd_Modi.Enabled = False
    Cmd_Del.Enabled = False
    Cmd_Check.Enabled = False
    DataRefresh
  End If
End Sub

Private Sub Cmd_Modi_Click()
  If Adodc1.Recordset.EOF Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  FrmStoreInEdit.Modify = True
  FrmStoreInEdit.OriInId = Adodc1.Recordset.Fields(0)
  FrmStoreInEdit.dco_Store.Text = Trim(Adodc1.Recordset.Fields(1))
  FrmStoreInEdit.dco_UType.Text = Trim(Adodc1.Recordset.Fields(2))
  FrmStoreInEdit.dco_Type.Text = Trim(Adodc1.Recordset.Fields(3))
  FrmStoreInEdit.txtDate = Trim(Adodc1.Recordset.Fields(4))
  FrmStoreInEdit.dco_Supplier.Text = Trim(Adodc1.Recordset.Fields(5))
  FrmStoreInEdit.txtAmount = Adodc1.Recordset.Fields(6)
  FrmStoreInEdit.txtSum = Adodc1.Recordset.Fields(7)
  FrmStoreInEdit.txtMemo = Trim(Adodc1.Recordset.Fields(8))
  FrmStoreInEdit.Show 1
  Cmd_Modi.Enabled = False
  Cmd_Del.Enabled = False
  Cmd_Check.Enabled = False
  DataRefresh
End Sub

Private Sub Cmd_Search_Click()
  DataRefresh
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  '根据状态更改按钮
  If Adodc1.Recordset.EOF Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  If Adodc1.Recordset.Fields(9) = 0 Then
    Cmd_Modi.Enabled = True
    Cmd_Del.Enabled = True
    Cmd_Check.Enabled = True
  Else
    Cmd_Modi.Enabled = False
    Cmd_Del.Enabled = False
    Cmd_Check.Enabled = False
  End If
End Sub

Private Sub dco_Type_Click(Area As Integer)
  DataRefresh
End Sub

Private Sub dco_UType_Click(Area As Integer)
  If Len(Trim(dco_UType.Text)) > 0 Then
    Ado_Type.ConnectionString = Conn
    Ado_Type.RecordSource = "Select * From Types Where UpperId=" + Trim(dco_UType.BoundText()) + " Order By TypeId"
    Ado_Type.Refresh
    Set dco_Type.RowSource = Ado_Type
    dco_Type.ListField = "TypeName"
    dco_Type.BoundColumn = "TypeId"
    dco_Type.Text = ""
    DataRefresh
  End If
End Sub

Private Sub Form_Load()
  '装入分类信息
  Ado_UType.ConnectionString = Conn
  Ado_UType.RecordSource = "Select * From Types Where UpperId=0 Order By TypeId"
  Ado_UType.Refresh
  Set dco_UType.RowSource = Ado_UType
  dco_UType.ListField = "TypeName"
  dco_UType.BoundColumn = "TypeId"
  dco_UType.Enabled = False
  dco_Type.Enabled = False
  Check1.Value = 1
  Cmd_Modi.Enabled = False
  Cmd_Del.Enabled = False
  Cmd_Check.Enabled = False
  DataRefresh
End Sub

⌨️ 快捷键说明

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