📄 frmstoreinedit.frm
字号:
Enabled = 0 'False
Height = 300
ItemData = "FrmStoreinEdit.frx":1326
Left = 2880
List = "FrmStoreinEdit.frx":1328
TabIndex = 2
Top = 360
Width = 1455
End
Begin VB.TextBox txtMax
Enabled = 0 'False
Height = 270
Left = 4320
MaxLength = 20
TabIndex = 1
Top = 1845
Width = 1455
End
Begin VB.Label Label18
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数量下限"
Height = 180
Left = 240
TabIndex = 12
Top = 1890
Width = 720
End
Begin VB.Label Label16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品类目"
Height = 180
Left = 240
TabIndex = 11
Top = 420
Width = 720
End
Begin VB.Label Label15
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品名称"
Height = 180
Left = 240
TabIndex = 10
Top = 915
Width = 720
End
Begin VB.Label Label14
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品型号"
Height = 180
Left = 240
TabIndex = 9
Top = 1365
Width = 720
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "计量单位"
Height = 180
Left = 3240
TabIndex = 8
Top = 1365
Width = 720
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数量上限"
Height = 180
Left = 3240
TabIndex = 7
Top = 1890
Width = 720
End
End
End
Attribute VB_Name = "FrmStoreinEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriId As Long
'产品信息
Public OriType1, OriType2 As String
Public OriPro As String
'仓库信息
Public OriStore As String
Private Sub Fill_Pro()
If ComboPro.Text = "" Then
txtStyle = ""
txtUnit = ""
txtMin = ""
txtMax = ""
ComboType1.Text = ""
ComboType2.Text = ""
ComboPro.Text = ""
Else
MyPro.GetInfo (MyPro.GetId(ComboPro.Text))
txtStyle = MyPro.ProStyle
txtUnit = MyPro.ProUnit
txtMin = MyPro.ProLow
txtMax = MyPro.ProHigh
End If
End Sub
Private Function Check() As Boolean
If Trim(ComboPro.Text) = "" Then
MsgBox "请选择产品名称"
Check = False
Exit Function
End If
If txtNum = "" Then
MsgBox "请输入产品数量"
txtNum.SetFocus
Check = False
Exit Function
End If
If ComboStore.Text = "" Then
MsgBox "请选择存储的仓库"
Check = False
Exit Function
End If
Check = True
End Function
Private Sub Cmd_OK_Click()
Dim TmpId As Long
If Check = False Then
Exit Sub
End If
With MyStorein
.StoreinId = Val(ComboId.Text)
.StoreinType = ComboStoreinType.Text
.StoreId = MyStore.GetId(ComboStore.Text)
.EmpName = CurUser.EmpName
.OptDate = Format(Now, "yyyy-mm-dd")
.Insert
'更改库存状态
If ComboStoreinType.ListIndex = 0 Then
MyOrders.Stored = 3
MyOrders.UpdateStored (.StoreinId)
Else
MySales.Stored = 3
MySales.UpdateStored (.StoreinId)
End If
'将产品保存到仓库中
MyProInStore.ProId = MyPro.GetId(ComboPro.Text)
MyProInStore.ProPrice = Val(txtPrice)
MyProInStore.ProNum = Val(txtNum)
MyProInStore.StoreId = .StoreId
If MyProInStore.In_DB(MyPro.GetId(ComboPro.Text), Val(txtPrice), .StoreId) = False Then
MyProInStore.Insert
Else
TmpId = MyProInStore.GetId(MyPro.GetId(ComboPro.Text), Val(txtPrice), .StoreId)
MyProInStore.UpdateDiff (TmpId)
End If
MsgBox "完成入库操作"
End With
Unload Me
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub ComboId_Click()
If ComboId.Text = "" Then
Exit Sub
End If
If ComboStoreinType.ListIndex = 0 Then
MyOrders.GetInfo (Val(ComboId.Text))
txtPrice = MyOrders.ProPrice
txtNum = MyOrders.ProNum
txtAmount = MyOrders.ProAmount
MyOrders.GetInfo (Val(ComboId))
MyPro.GetInfo (MyOrders.ProId)
Else
MySales.GetInfo (Val(ComboId.Text))
txtPrice = MySales.ProPrice
txtNum = MySales.ProNum
txtAmount = MySales.ProAmount
MySales.GetInfo (Val(ComboId))
MyPro.GetInfo (MySales.ProId)
End If
'读取产品名称和类目
MyOrders.GetInfo (Val(ComboId))
MyPro.GetInfo (Val(MyOrders.ProId))
OriPro = MyPro.ProName
OriType2 = MyProType.GetName(MyPro.TypeId)
MyProType.GetInfo (MyPro.TypeId)
OriType1 = MyProType.GetName(MyProType.UpperId)
'装入产品信息
'装入一级类目
ComboType1.Text = OriType1
'装入二级类目
ComboType2.Text = OriType2
'装入产品名称
ComboPro.Text = OriPro
Fill_Pro
End Sub
Private Sub ComboStoreinType_Click()
If ComboStoreinType.ListIndex = 0 Then
Call MyOrders.LoadId("采购", 2)
Else
Call MySales.LoadId("销售退货", 2)
End If
ComboId.Clear
i = 0
Do While ArrId(i) > 0
ComboId.AddItem ArrId(i)
i = i + 1
Loop
If OriId > 0 Then
ComboId.ListIndex = Trim(OriId)
Else
If ComboId.ListCount > 0 Then
ComboId.ListIndex = 0
End If
End If
End Sub
Private Sub Form_Load()
Dim TmpType As Long
Dim i As Integer
'入库信息
MyStore.Load_Store
i = 0
ComboStore.Clear
Do While Arr_Store(i) <> ""
ComboStore.AddItem Arr_Store(i)
i = i + 1
Loop
If OriStore = "" Then
If ComboStore.ListCount > 0 Then
ComboStore.ListIndex = 0
End If
Else
If InCombo(OriStore, ComboStore) = True Then
ComboStore.Text = OriStore
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -