📄 frmtakeoutedit.frm
字号:
Width = 720
End
Begin VB.Label Label21
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "凭单编号"
Height = 180
Left = 3240
TabIndex = 13
Top = 420
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出库日期"
Height = 180
Left = 3240
TabIndex = 12
Top = 1860
Width = 720
End
Begin VB.Label Label27
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "经办人"
Height = 180
Left = 240
TabIndex = 11
Top = 1860
Width = 540
End
Begin VB.Label lblOptDate
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "OptDate"
Height = 180
Left = 4320
TabIndex = 10
Top = 1860
Width = 630
End
Begin VB.Label lblEmpName
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "EmpName"
Height = 180
Left = 1320
TabIndex = 9
Top = 1860
Width = 630
End
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 6385
MouseIcon = "FrmTakeoutEdit.frx":0D16
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 2760
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Height = 400
Left = 4225
MouseIcon = "FrmTakeoutEdit.frx":1020
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 0
Top = 2760
Width = 1300
End
End
Attribute VB_Name = "FrmTakeoutEdit"
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
Dim TmpNum As Integer
If Check = False Then
Exit Sub
End If
TmpNum = Val(txtNum)
With MyTakeout
.TakeOutId = Val(ComboId.Text)
.TakeOutType = ComboTakeoutType.Text
.StoreId = MyStore.GetId(ComboStore.Text)
.EmpName = CurUser.EmpName
.OptDate = Format(Now, "yyyy-mm-dd")
If TmpNum > MyProInStore.GetSumPro(.StoreId, MyPro.GetId(ComboPro.Text)) Then
MsgBox "库存数量不足,不能出库"
Exit Sub
End If
.Insert
'更改库存状态
If ComboTakeoutType.ListIndex = 1 Then
MyOrders.Stored = 3
MyOrders.UpdateStored (.TakeOutId)
Else
MySales.Stored = 3
MySales.UpdateStored (.TakeOutId)
End If
'从仓库中提取产品
Call MyProInStore.LoadPro(.StoreId, MyPro.GetId(ComboPro.Text))
i = 0
Do While TmpNum > 0
If Arr_StoreProNum(i) > TmpNum Then
MyProInStore.ProNum = Arr_StoreProNum(i) - TmpNum
TmpNum = 0
Else
MyProInStore.ProNum = 0
TmpNum = TmpNum - Arr_StoreProNum(i)
End If
MyProInStore.Update (Arr_StoreProId(i))
i = i + 1
Loop
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 ComboTakeoutType.ListIndex = 1 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
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 ComboTakeoutType_Click()
If ComboTakeoutType.ListIndex = 0 Then
Call MySales.LoadId("销售", 2)
Else
Call MyOrders.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 + -