📄 frm出库审核.frm
字号:
VERSION 5.00
Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "VSLIGHT6.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Frm出库审核
Caption = "出库审核"
ClientHeight = 7680
ClientLeft = 60
ClientTop = 345
ClientWidth = 10275
Icon = "Frm出库审核.frx":0000
LinkTopic = "Form1"
ScaleHeight = 7680
ScaleWidth = 10275
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text1
Appearance = 0 'Flat
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 315
Index = 0
Left = 3720
TabIndex = 7
Top = 6480
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 315
Index = 1
Left = 3720
TabIndex = 6
Top = 6840
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 315
Index = 2
Left = 3720
TabIndex = 5
Top = 7200
Width = 2055
End
Begin VB.OptionButton Option1
Caption = "通过审核"
Height = 375
Left = 6840
TabIndex = 4
Top = 6600
Value = -1 'True
Width = 1215
End
Begin VB.OptionButton Option2
Caption = "未通过审核"
Height = 375
Left = 6840
TabIndex = 3
Top = 7080
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "提交"
Height = 495
Left = 8520
TabIndex = 2
Top = 6720
Width = 1455
End
Begin MSComctlLib.ImageList ImageList1
Left = 1920
Top = 3000
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm出库审核.frx":058A
Key = "Root"
Object.Tag = "Root"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm出库审核.frx":08A4
Key = "Child"
Object.Tag = "Child"
EndProperty
EndProperty
End
Begin MSComctlLib.TreeView tvTreeView
Height = 7440
Left = 120
TabIndex = 0
Top = 120
Width = 2490
_ExtentX = 4392
_ExtentY = 13123
_Version = 393217
Indentation = 564
LineStyle = 1
Style = 7
ImageList = "ImageList1"
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSComctlLib.ListView ListView1
Height = 6255
Left = 2760
TabIndex = 1
Top = 120
Width = 7455
_ExtentX = 13150
_ExtentY = 11033
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin vsElasticLightLibCtl.vsElasticLight vsElasticLight1
Left = 5880
OleObjectBlob = "Frm出库审核.frx":12B6
Top = 6960
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "物资编号:"
Height = 180
Index = 1
Left = 2880
TabIndex = 10
Top = 6600
Width = 810
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "物资名称:"
Height = 180
Index = 3
Left = 2880
TabIndex = 9
Top = 6960
Width = 810
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "物资型号:"
Height = 180
Index = 4
Left = 2880
TabIndex = 8
Top = 7320
Width = 810
End
End
Attribute VB_Name = "Frm出库审核"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim nodX As Node
Dim CmdExe As ADODB.Command
Dim LConRs As ADODB.Recordset
Dim Rstmp As ADODB.Recordset
Dim RsRoot As New ADODB.Recordset
Dim RsChild As New ADODB.Recordset
Dim TxtSqlbj As String
Dim PJBH As String
Dim LSH As String
Dim WZBH As String
Private Sub Command1_Click()
If Option1.Value = True Then
If ListView1.ListItems.Count > 1 Then
If vbYes <> MsgBox("确认要审核全部列表记录么?", vbYesNo, "审核对话框") Then
Exit Sub
End If
End If
For i = 1 To ListView1.ListItems.Count
Set CmdExe = New ADODB.Command
CmdExe.ActiveConnection = Cw_DataEnvi.DataConnect
CmdExe.CommandText = "update FL_辅料出库表 set 审核状态=1 where 流水号='" & ListView1.ListItems(i).Text & "'"
CmdExe.Execute
Next i
Else
If ListView1.ListItems.Count > 1 Then
If vbYes <> MsgBox("确认要审核全部列表记录么?", vbYesNo, "审核对话框") Then
Exit Sub
End If
End If
For i = 1 To ListView1.ListItems.Count
Set CmdExe = New ADODB.Command
CmdExe.ActiveConnection = Cw_DataEnvi.DataConnect
CmdExe.CommandText = "update FL_辅料出库表 set 审核状态=2 ,票据状态=3 where 流水号='" & ListView1.ListItems(i).Text & "'"
CmdExe.Execute
Next i
End If
tvTreeView.Nodes.Clear
ListTree
ListView1.ListItems.Clear
End Sub
Private Sub Form_Load()
DoList
ListTree
End Sub
Public Sub ListTree()
Set RsRoot = Cw_DataEnvi.DataConnect.Execute("SELECT Distinct 票据编号 FROM FL_辅料出库表 where 审核状态=0 order by 票据编号")
With RsRoot
Do While Not .EOF
tvTreeView.Nodes.Add , 4, "T" + Trim(.Fields("票据编号")), Trim(.Fields("票据编号")), "Root"
Cshgns (Trim(.Fields("票据编号")))
.MoveNext
Loop
End With
End Sub
Public Sub Cshgns(RootString As Long)
Set RsChild = Cw_DataEnvi.DataConnect.Execute("SELECT 票据编号,物资编号,流水号 FROM FL_辅料出库表 where 审核状态=0 and 票据编号='" & RootString & "' order by 流水号")
With RsChild
Do While Not .EOF
Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("票据编号")), 4, "L" + Trim(.Fields("流水号")), Trim(.Fields("物资编号")), "Child")
.MoveNext
Loop
End With
End Sub
Public Sub Wzxx(WzbhString As Long)
Set Rstmp = Cw_DataEnvi.DataConnect.Execute("select * from Fl_物资信息表 where 物资编号= " & WzbhString)
Text1(0).Text = Rstmp!物资编号
Text1(1).Text = Rstmp!物资名称
Text1(2).Text = Rstmp!物资型号
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
If ListView1.ListItems.Count > 0 Then Wzxx ListView1.SelectedItem.ListSubItems(3)
End Sub
Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
If Left(Node.Key, 1) = "T" Then
PJBH = Right(Node.Key, Len(Node.Key) - 1) '票据编号
loadTree (PJBH)
ElseIf Left(Node.Key, 1) = "L" Then
PJBH = Right(Node.Parent.Key, Len(Node.Parent.Key) - 1) '票据编号
LSH = Right(Node.Key, Len(Node.Key) - 1) '流水号
WZBH = Node.Text
loadChild PJBH, LSH, WZBH
End If
End Sub
Public Sub loadTree(PjbhString As String)
DoList
Set LConRs = New ADODB.Recordset
LConRs.Open "SELECT * FROM FL_辅料出库表 where 审核状态=0 and 票据编号='" & PjbhString & "' order by 流水号", Cw_DataEnvi.DataConnect, adOpenStatic, adLockReadOnly, adCmdText
If Not LConRs.BOF Then LConRs.MoveFirst
ListView1.ListItems.Clear
Do While Not LConRs.EOF
Set ItmX = ListView1.ListItems.Add(, , LConRs!流水号)
ItmX.SubItems(1) = LConRs!部门名称
ItmX.SubItems(2) = LConRs!类别名称
ItmX.SubItems(3) = LConRs!物资编号
ItmX.SubItems(4) = LConRs!单价
ItmX.SubItems(5) = LConRs!数量
ItmX.SubItems(6) = LConRs!金额
ItmX.SubItems(7) = LConRs!业务员
ItmX.SubItems(8) = LConRs!出库时间
ItmX.SubItems(9) = LConRs!仓库名称
LConRs.MoveNext
Loop
End Sub
Public Sub loadChild(PjbhString As String, LshString As String, WzbhString As String)
DoList
Set LConRs = New ADODB.Recordset
LConRs.Open "SELECT * FROM FL_辅料出库表 where 审核状态=0 and 流水号='" & LshString & "' order by 流水号", Cw_DataEnvi.DataConnect, adOpenStatic, adLockReadOnly, adCmdText
If Not LConRs.BOF Then LConRs.MoveFirst
ListView1.ListItems.Clear
Do While Not LConRs.EOF
Set ItmX = ListView1.ListItems.Add(, , LConRs!流水号)
ItmX.SubItems(1) = LConRs!部门名称
ItmX.SubItems(2) = LConRs!类别名称
ItmX.SubItems(3) = LConRs!物资编号
ItmX.SubItems(4) = LConRs!单价
ItmX.SubItems(5) = LConRs!数量
ItmX.SubItems(6) = LConRs!金额
ItmX.SubItems(7) = LConRs!业务员
ItmX.SubItems(8) = LConRs!出库时间
ItmX.SubItems(9) = LConRs!仓库名称
LConRs.MoveNext
Loop
End Sub
Public Sub DoList()
Dim ItmX As ListItem
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "流水号", Len("流水号") + 550 * 2
ListView1.ColumnHeaders.Add , , "部门名称", Len("部门名称") + 550 * 2
ListView1.ColumnHeaders.Add , , "类别名称", Len("类别名称") * 100 + 550
ListView1.ColumnHeaders.Add , , "物资编号", Len("物资编号") * 100 + 550
ListView1.ColumnHeaders.Add , , "单价", Len("单价") * 100 + 550
ListView1.ColumnHeaders.Add , , "数量", Len("数量") * 100 + 550
ListView1.ColumnHeaders.Add , , "金额", Len("金额") * 100 + 550
ListView1.ColumnHeaders.Add , , "业务员", Len("业务员") * 100 + 500
ListView1.ColumnHeaders.Add , , "出库时间", Len("出库时间") + 550 * 2
ListView1.ColumnHeaders.Add , , "仓库名称", Len("仓库名称") + 550 * 2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -