📄 frmcustomer.frm
字号:
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmCustomer
BackColor = &H00C0C0C0&
Caption = "进货列表"
ClientHeight = 5205
ClientLeft = 60
ClientTop = 630
ClientWidth = 11730
Icon = "frmCustomer.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
LockControls = -1 'True
MDIChild = -1 'True
ScaleHeight = 5205
ScaleWidth = 11730
WindowState = 2 'Maximized
Begin VB.PictureBox picPM
BackColor = &H00808080&
BorderStyle = 0 'None
Height = 4170
Left = 3690
ScaleHeight = 4170
ScaleWidth = 2130
TabIndex = 15
Top = 690
Visible = 0 'False
Width = 2130
Begin MSFlexGridLib.MSFlexGrid Grid1PM
Height = 4125
Left = 0
TabIndex = 17
Top = 0
Width = 2085
_ExtentX = 3678
_ExtentY = 7276
_Version = 393216
Rows = 1
Cols = 1
FixedRows = 0
FixedCols = 0
BackColorBkg = 16777215
AllowBigSelection= 0 'False
FocusRect = 0
ScrollBars = 2
BorderStyle = 0
End
End
Begin VB.PictureBox picCatalog
BackColor = &H00808080&
BorderStyle = 0 'None
Height = 3180
Left = 1245
ScaleHeight = 3180
ScaleWidth = 1410
TabIndex = 10
Top = 705
Visible = 0 'False
Width = 1410
Begin MSFlexGridLib.MSFlexGrid Grid1Type
Height = 3150
Left = 0
TabIndex = 14
Top = -15
Width = 1365
_ExtentX = 2408
_ExtentY = 5556
_Version = 393216
Rows = 1
Cols = 1
FixedRows = 0
FixedCols = 0
BackColorBkg = 16777215
AllowBigSelection= 0 'False
FocusRect = 0
ScrollBars = 2
BorderStyle = 0
End
End
Begin VB.Frame Frame1
BackColor = &H00C0C0C0&
Height = 1320
Left = 60
TabIndex = 3
Top = 15
Width = 11820
Begin Threed.SSPanel SSPanel1
Height = 915
Left = 8070
TabIndex = 24
Top = 225
Width = 3075
_Version = 65536
_ExtentX = 5424
_ExtentY = 1614
_StockProps = 15
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelOuter = 1
Begin VB.CommandButton cmdDel
Enabled = 0 'False
Height = 390
Left = 180
Picture = "frmCustomer.frx":08CA
Style = 1 'Graphical
TabIndex = 21
Top = 465
Width = 1215
End
Begin VB.CommandButton cmdCancel
Height = 390
Left = 1665
Picture = "frmCustomer.frx":2036
Style = 1 'Graphical
TabIndex = 23
ToolTipText = "Esc 退出"
Top = 465
Width = 1215
End
Begin VB.CommandButton cmdPast
BackColor = &H00C0C0C0&
Height = 390
Left = 1665
Picture = "frmCustomer.frx":37A2
Style = 1 'Graphical
TabIndex = 22
ToolTipText = "F12 确认购物"
Top = 75
Width = 1215
End
Begin VB.CommandButton cmdAdd
Enabled = 0 'False
Height = 390
Left = 180
Picture = "frmCustomer.frx":4F0E
Style = 1 'Graphical
TabIndex = 20
ToolTipText = "按 + 添加记录 "
Top = 75
Width = 1215
End
End
Begin MSComCtl2.DTPicker tpDate
Height = 300
Left = 6540
TabIndex = 19
Top = 765
Width = 1290
_ExtentX = 2275
_ExtentY = 529
_Version = 393216
Format = 24510465
CurrentDate = 36847
End
Begin VB.TextBox txtDW
BackColor = &H00E0E0E0&
ForeColor = &H000000FF&
Height = 300
Left = 6540
Locked = -1 'True
TabIndex = 0
TabStop = 0 'False
ToolTipText = "禁止修改"
Top = 375
Width = 1290
End
Begin VB.TextBox txtDJ
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 300
Left = 1185
MaxLength = 8
TabIndex = 1
ToolTipText = "禁止修改"
Top = 750
Width = 1365
End
Begin VB.TextBox txtSL
Height = 300
Left = 3630
MaxLength = 8
TabIndex = 2
Text = "1"
Top = 750
Width = 2085
End
Begin Threed.SSCommand cmdSelectUnit
Height = 270
Left = 2280
TabIndex = 12
Top = 390
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 476
_StockProps = 78
BevelWidth = 1
RoundedCorners = 0 'False
Picture = "frmCustomer.frx":667A
End
Begin VB.TextBox txtCatalog
Height = 300
Left = 1185
TabIndex = 11
Top = 375
Width = 1365
End
Begin Threed.SSCommand SSCommand1
Height = 270
Left = 5445
TabIndex = 13
Top = 390
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 476
_StockProps = 78
BevelWidth = 1
RoundedCorners = 0 'False
Picture = "frmCustomer.frx":6962
End
Begin VB.TextBox cmbPM
Height = 300
Left = 3630
TabIndex = 16
Top = 375
Width = 2085
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "日期:"
Height = 180
Index = 2
Left = 6015
TabIndex = 18
Top = 840
Width = 450
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单位:"
Height = 180
Index = 1
Left = 6015
TabIndex = 8
Top = 420
Width = 450
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "物品分类:"
ForeColor = &H000000FF&
Height = 180
Left = 300
TabIndex = 7
Top = 405
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单价(元):"
Height = 180
Left = 300
TabIndex = 6
Top = 840
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "所购数量:"
Height = 180
Left = 2760
TabIndex = 5
Top = 840
Width = 810
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "物品名称:"
Height = 180
Index = 0
Left = 2760
TabIndex = 4
Top = 420
Width = 810
End
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 3660
Left = 60
TabIndex = 9
Top = 1365
Width = 7290
_ExtentX = 12859
_ExtentY = 6456
_Version = 393216
Cols = 3
BackColorSel = 14737632
ForeColorSel = 0
BackColorBkg = 12632256
AllowBigSelection= 0 'False
FocusRect = 0
SelectionMode = 1
End
Begin VB.Menu mnuOperater
Caption = "操作控制(&C)"
Begin VB.Menu mnuDel
Caption = "删除(&D)"
Shortcut = +{DEL}
End
Begin VB.Menu mnuClose
Caption = "关闭(&X)"
Shortcut = ^X
End
End
End
Attribute VB_Name = "frmCustomer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sDJ As String, sDW As String
Private Sub cmbPM_Change()
If txtCatalog.Text = "" Or cmbPM.Text = "" Or Val(txtDJ.Text) = 0 Or Val(txtSL.Text) = 0 Then
cmdAdd.Enabled = False
Else
cmdAdd.Enabled = True
End If
'查询到名称时
txtDJ = GetDJ(cmbPM, txtCatalog)
sDJ = txtDJ
txtDW = sDW '给出单位
End Sub
Private Sub cmbPM_GotFocus()
SetItFocus cmbPM
'刷新数据
ConfigPM (txtCatalog.Text)
End Sub
Private Sub cmbPM_KeyDown(KeyCode As Integer, Shift As Integer)
DirectFocus txtCatalog, txtDJ, txtCatalog, txtDJ, KeyCode
End Sub
Private Sub cmbPM_KeyPress(KeyAscii As Integer)
On Error GoTo Err_dj
If KeyAscii = 13 And Trim(cmbPM) <> "" Then
KeyAscii = 0
txtDJ.SetFocus
ElseIf KeyAscii = 13 And Trim(cmbPM) = "" Then
SSCommand1.Value = True
Else
Exit Sub
End If
Exit Sub
Err_dj:
MsgBox "给出品名错误! " & vbCrLf & vbCrLf & Err.Description, vbCritical
End Sub
Private Sub cmbPM_LostFocus()
'查询到名称时
If Val(txtDJ) = 0 Then '名称查找
cmbPM = GetPm(cmbPM) '代码查找
txtDJ = GetDJ(cmbPM, txtCatalog)
sDJ = txtDJ
txtDW = sDW '给出单位
End If
End Sub
Private Sub cmdAdd_Click()
On Error GoTo Err_Add
If cmbPM = "" Then
txtDW = ""
txtDJ = ""
cmbPM.SetFocus
Exit Sub ' 名称为空时退出
End If
If Val(txtSL) > 0 And Val(txtDJ) > 0 Then '有值时
'先检查临时库是否已经存在该物品
Dim sReturn As String
sReturn = CheckProduct("tmpEnterList", "代码", GetCode(cmbPM), 2)
If sReturn = "" Then
' 添加记录
AddRecord txtCatalog.Text, "MenuType", GetCode(cmbPM), "代码", cmbPM.Text, "名称", Val(txtDJ), "单价", txtDW.Text, "单位", Val(txtSL), "数量", Val(txtDJ) * Val(txtSL), "金额", Date, "日期", "tmpEnterList"
Else
'合并记录
UpDateIt sReturn, Val(txtSL.Text), Val(txtSL.Text) * Val(txtDJ.Text)
End If
' 刷新
ConfigGrid
' 返回
cmbPM = ""
txtDW = ""
txtDJ = ""
cmbPM.SetFocus
End If
Exit Sub
Err_Add:
MsgBox "添加记录或配置网格错误! " & vbCrLf & vbCrLf & Err.Description, vbCritical
End Sub
Private Sub cmdCancel_Click()
If Grid1.Text <> "" Then
Dim sTmp As Integer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -