📄 frmsell.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSell
Caption = "商品销售"
ClientHeight = 8175
ClientLeft = 165
ClientTop = 555
ClientWidth = 11880
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmSell.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 8175
ScaleWidth = 11880
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox cobUnit
Appearance = 0 'Flat
Height = 330
Left = 5760
Style = 2 'Dropdown List
TabIndex = 23
Top = 2340
Width = 825
End
Begin VB.Frame fra
Height = 855
Left = 810
TabIndex = 16
Top = 6960
Width = 10275
Begin VB.TextBox txtName
Enabled = 0 'False
Height = 345
Left = 4980
Locked = -1 'True
TabIndex = 20
Top = 300
Width = 1905
End
Begin VB.TextBox txtTM
Height = 345
Left = 1410
TabIndex = 18
Top = 300
Width = 2145
End
Begin VB.Label Label7
Caption = "商品名称"
Height = 210
Left = 4050
TabIndex = 19
Top = 390
Width = 840
End
Begin VB.Label Label2
Caption = "商品条码"
Height = 210
Left = 480
TabIndex = 17
Top = 390
Width = 840
End
End
Begin VB.TextBox txtZK
Appearance = 0 'Flat
Height = 315
Left = 3930
TabIndex = 15
Text = "txtzk"
Top = 4500
Width = 1965
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 14
Top = 7920
Width = 11880
_ExtentX = 20955
_ExtentY = 450
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 19403
MinWidth = 19403
Text = "结算-Enter 取消交易-F3 数量变更-F4 商品打折-F5 手工输入-F6 删除商品-Del、← 整单打折-F8 退货-F9"
TextSave = "结算-Enter 取消交易-F3 数量变更-F4 商品打折-F5 手工输入-F6 删除商品-Del、← 整单打折-F8 退货-F9"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Style = 2
Alignment = 1
Object.Width = 970
MinWidth = 970
TextSave = "NUM"
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 706
MinWidth = 706
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Timer tmr
Enabled = 0 'False
Left = 3780
Top = 60
End
Begin VB.TextBox txtZ
Alignment = 1 'Right Justify
Height = 315
Left = 5070
TabIndex = 10
Text = "1"
Top = 900
Width = 525
End
Begin VB.TextBox txtNum
Appearance = 0 'Flat
Height = 315
Left = 5040
TabIndex = 5
Text = "txtnum"
Top = 5730
Width = 1965
End
Begin MSFlexGridLib.MSFlexGrid Grid
Height = 5205
Left = 60
TabIndex = 0
Top = 1500
Width = 11775
_ExtentX = 20770
_ExtentY = 9181
_Version = 393216
Cols = 11
FixedCols = 0
RowHeightMin = 315
BackColorBkg = -2147483633
AllowBigSelection= 0 'False
SelectionMode = 1
Appearance = 0
FormatString = "序号|^ 商 品 编 号 |^ 商 品 名 称 |^ 规 格|^ 生产企业 |^ 单 位|^ 单 价 |^ 数 量 |^ 折 扣 |^ 折后单价|^ 合计金额"
End
Begin VB.Timer tmrTime
Enabled = 0 'False
Left = 4410
Top = 60
End
Begin VB.Label lbl
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "030312#0001"
ForeColor = &H80000008&
Height = 255
Left = 930
TabIndex = 22
Top = 180
Width = 1575
End
Begin VB.Label Label4
Caption = "单据号"
Height = 210
Left = 180
TabIndex = 21
Top = 210
Width = 630
End
Begin VB.Line Line6
BorderColor = &H80000010&
X1 = 0
X2 = 11880
Y1 = 6870
Y2 = 6870
End
Begin VB.Label lblSums
Caption = "0.00"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 8220
TabIndex = 13
Top = 930
Width = 1515
End
Begin VB.Label Label10
Caption = "¥"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 7860
TabIndex = 12
Top = 930
Width = 255
End
Begin VB.Label Label9
Caption = "合计应付:"
Height = 210
Left = 6840
TabIndex = 11
Top = 960
Width = 945
End
Begin VB.Label Label8
Caption = "整单折扣"
Height = 210
Left = 4050
TabIndex = 9
Top = 960
Width = 840
End
Begin VB.Label lblSum
Caption = "0.00"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 2190
TabIndex = 8
Top = 930
Width = 1515
End
Begin VB.Label Label6
Caption = "¥"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 1830
TabIndex = 7
Top = 930
Width = 255
End
Begin VB.Label Label5
Caption = "合计金额:"
Height = 210
Left = 840
TabIndex = 6
Top = 960
Width = 945
End
Begin VB.Line Line5
BorderColor = &H00C0C0C0&
X1 = 11430
X2 = 11430
Y1 = 780
Y2 = 1290
End
Begin VB.Line Line4
BorderColor = &H00C0C0C0&
X1 = 360
X2 = 11430
Y1 = 1290
Y2 = 1290
End
Begin VB.Line Line3
BorderColor = &H00FFFFFF&
X1 = 360
X2 = 360
Y1 = 780
Y2 = 1290
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
X1 = 360
X2 = 11430
Y1 = 750
Y2 = 750
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
X1 = 0
X2 = 11880
Y1 = 555
Y2 = 555
End
Begin VB.Label lblUserName
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "张皓"
ForeColor = &H80000008&
Height = 255
Left = 10410
TabIndex = 4
Top = 180
Width = 1185
End
Begin VB.Label Label1
Caption = "当前时间"
Height = 210
Left = 5640
TabIndex = 3
Top = 210
Width = 840
End
Begin VB.Label lblTime
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 255
Left = 6600
TabIndex = 2
Top = 180
Width = 2685
End
Begin VB.Label Label3
Caption = "收银员"
Height = 210
Left = 9690
TabIndex = 1
Top = 210
Width = 630
End
End
Attribute VB_Name = "frmSell"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Id As String
Dim IDList As Collection
Dim Number As Integer
Private Sub cobUnit_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyReturn
Dim Rst As ADODB.Recordset
Dim SQL As String
Dim SumCash As Currency
Dim I As Integer
If cobUnit.ListIndex = -1 Then Exit Sub
SQL = "select price from yaopin_unit where id='" & _
Grid.TextMatrix(Grid.RowSel, 1) & "' and unit='" & cobUnit.Text & "'"
Set Rst = New ADODB.Recordset
Rst.Open SQL, Conn, adOpenStatic, adLockReadOnly, adCmdText
If Rst.EOF Then Exit Sub
Grid.TextMatrix(Grid.RowSel, 5) = cobUnit.Text
Grid.TextMatrix(Grid.RowSel, 6) = CStr(Rst.Fields(0))
Grid.TextMatrix(Grid.RowSel, 9) = CStr(Val(Rst.Fields(0)) * _
Val(Grid.TextMatrix(Grid.RowSel, 8)))
Grid.TextMatrix(Grid.RowSel, 10) = CStr(Val(Grid.TextMatrix _
(Grid.RowSel, 7)) * Val(Grid.TextMatrix(Grid.RowSel, 9)))
For I = 1 To Grid.Rows - 1
SumCash = SumCash + Val(Grid.TextMatrix(I, 10))
Next
lblSum.Caption = Format(CStr(SumCash), ".00")
lblsums.Caption = Format(CStr(SumCash) * IIf(Val(txtZ.Text) = 1, 1, Val(txtZ.Text) / 10), ".00")
KeyCode = 0
cobUnit.Visible = False
cobUnit.Clear
Grid.Enabled = True
Grid.SetFocus
Case vbKeyEscape
cobUnit.Visible = False
cobUnit.Clear
Grid.Enabled = True
Grid.SetFocus
End Select
End Sub
Private Sub Form_Load()
Dim Rst As ADODB.Recordset
Dim SQL As String
Me.Left = 0
Me.Top = 0
Me.Height = 8685
Me.Width = 12000
lblUserName.Caption = UserName
lblTime.Caption = Format(Date$, "yyyy年mm月dd日") & " " & Time$
tmrTime.Interval = 1000
tmrTime.Enabled = True
Call ReSet
txtZ.Enabled = False
txtNum.Visible = False
txtNum.Text = ""
txtNum.Width = 800 + 10
txtNum.Left = Grid.Left + 7700 + 10
txtZK.Visible = False
txtZK.Text = ""
txtZK.Width = 600 + 10
txtZK.Left = Grid.Left + 8500 + 10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -