📄 月盘点.frm
字号:
Y2 = 4200
End
Begin VB.Line Line2
BorderWidth = 2
X1 = 240
X2 = 240
Y1 = 1260
Y2 = 4200
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 240
X2 = 8820
Y1 = 1260
Y2 = 1260
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "报损单"
Height = 195
Index = 5
Left = 360
TabIndex = 12
Top = 3900
Width = 615
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "调拔单"
Height = 195
Index = 4
Left = 360
TabIndex = 11
Top = 3480
Width = 615
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "借出单"
Height = 195
Index = 3
Left = 360
TabIndex = 10
Top = 3060
Width = 615
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "借入单"
Height = 195
Index = 2
Left = 360
TabIndex = 9
Top = 2640
Width = 615
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "出库单"
Height = 195
Index = 1
Left = 360
TabIndex = 8
Top = 2220
Width = 615
End
Begin VB.Label row
BackStyle = 0 'Transparent
Caption = "入库单"
Height = 195
Index = 0
Left = 360
TabIndex = 7
Top = 1800
Width = 615
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "单据类别"
Height = 195
Left = 360
TabIndex = 6
Top = 1380
Width = 735
End
Begin VB.Label col
BackStyle = 0 'Transparent
Caption = "处理单数"
Height = 195
Index = 0
Left = 1380
TabIndex = 5
Top = 1380
Width = 735
End
Begin VB.Label col
BackStyle = 0 'Transparent
Caption = "其它金额总数"
Height = 195
Index = 3
Left = 5880
TabIndex = 4
Top = 1380
Width = 1095
End
Begin VB.Label col
BackStyle = 0 'Transparent
Caption = "货物总量"
Height = 195
Index = 2
Left = 4500
TabIndex = 3
Top = 1380
Width = 735
End
Begin VB.Label col
BackStyle = 0 'Transparent
Caption = "退出(还出,还入)单数"
Height = 195
Index = 1
Left = 2340
TabIndex = 2
Top = 1380
Width = 1755
End
Begin VB.Label col
BackStyle = 0 'Transparent
Caption = "货物金额总数"
Height = 195
Index = 4
Left = 7500
TabIndex = 1
Top = 1380
Width = 1095
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "盘 点 单"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 3540
TabIndex = 0
Top = 180
Width = 1935
End
End
Attribute VB_Name = "月盘点"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private 仓库编号 As String
Private 经办人编号 As String
Private m_data(5, 4) As String
Private m_otherdata(5) As String
Option Explicit
Private Sub printdata(i, j)
Dim x, y As Long
x = col(j).left / 15 + 5
y = row(i).Top / 15
TextOut Me.hdc, x, y, m_data(i, j), Len(m_data(i, j))
End Sub
Private Sub printotherdata(i)
Dim x, y As Long
If i = 0 Then
x = (other1.left + other1.Width) / 15 + 5
y = other1.Top / 15
ElseIf i = 1 Then
x = (other2.left + other2.Width) / 15 + 5
y = other2.Top / 15
ElseIf i = 2 Then
x = (other3.left + other3.Width) / 15 + 5
y = other3.Top / 15
ElseIf i = 3 Then
x = (other4.left + other4.Width) / 15 + 5
y = other4.Top / 15
ElseIf i = 4 Then
x = (other5.left + other5.Width) / 15 + 5
y = other5.Top / 15
Else
x = (other6.left + other6.Width) / 15 + 5
y = other6.Top / 15
End If
TextOut Me.hdc, x, y, m_otherdata(i), Len(m_otherdata(i))
End Sub
Private Sub printalldata()
Dim i, j As Integer
For i = 0 To 5
For j = 0 To 4
printdata i, j
Next j
Next i
For i = 0 To 5
printotherdata i
Next i
End Sub
Private Function GetMinDate()
Dim t As Date
t = Date
t = DateAdd("m", -1, t)
GetMinDate = Str(t)
End Function
Private Sub ChangeBackColor()
Dim bkcolor As Long
bkcolor = Me.BackColor
编号.BackColor = bkcolor
日期.BackColor = bkcolor
经办人.BackColor = bkcolor
仓库名称.BackColor = bkcolor
进行月盘点.BackColor = bkcolor
更改背景.BackColor = bkcolor
打印月盘点单.BackColor = bkcolor
保存月盘点.BackColor = bkcolor
End Sub
Private Sub lockcontrol()
编号.Locked = True
仓库名称.Locked = True
经办人.Locked = True
End Sub
Private Sub Form_Paint()
printalldata
End Sub
Private Sub Form_Resize()
ChangeBackColor
'新增盘点单
If 编号.Text = "" Then
日期.Text = Date
打印月盘点单.Visible = False
更改背景.Visible = False
'初始化编号
fMainForm.m_checkado.RecordSource = "select 编号 from 盘点单"
fMainForm.m_checkado.Refresh
If fMainForm.m_checkado.Recordset.RecordCount > 0 Then
fMainForm.m_checkado.Recordset.MoveLast
编号.Text = fMainForm.m_checkado.Recordset.Fields("编号").Value + 1
Else
编号.Text = 1
End If
Else '打印盘点单
'初始化数据
fMainForm.m_checkado.RecordSource = "select 仓库.仓库名称,职员信息.姓名 as 经办人,盘点单.盘点数据,盘点单.盘点时间 from 仓库,职员信息,盘点单 where 仓库.编号=盘点单.仓库编号 and 职员信息.编号=盘点单.经办人编号 and 盘点单.编号=" + 编号.Text + " and 盘点时间>" + GetMinDate
fMainForm.m_checkado.Refresh
If fMainForm.m_checkado.Recordset.RecordCount > 0 Then
仓库名称.Text = fMainForm.m_checkado.Recordset.Fields("仓库名称").Value
经办人.Text = fMainForm.m_checkado.Recordset.Fields("经办人").Value
日期.Text = fMainForm.m_checkado.Recordset.Fields("盘点时间").Value
Dim data As String
data = fMainForm.m_checkado.Recordset.Fields("盘点数据").Value
Dim i, j, n As Long
i = 1: n = 1
j = InStr(i, data, ";")
While (j <> 0)
If n <= 30 Then
m_data(n / 5, (n - 1) Mod 5) = Mid(data, i, j - i)
Else
m_otherdata(n - 31) = Mid(data, i, j - i)
End If
On Error Resume Next
n = n + 1
i = j + 1
j = InStr(i, data, ";")
Wend
End If
进行月盘点.Visible = False
lockcontrol
End If
End Sub
Private Sub 保存月盘点_Click()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -