📄 frmwx1.frm
字号:
VERSION 5.00
Begin VB.Form frmWX1
BorderStyle = 3 'Fixed Dialog
Caption = "维修单配件信息"
ClientHeight = 2484
ClientLeft = 48
ClientTop = 336
ClientWidth = 5616
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2484
ScaleWidth = 5616
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.Frame Frame1
Caption = "配件信息:"
Height = 1812
Index = 2
Left = 120
TabIndex = 4
Top = 120
Width = 5412
Begin VB.TextBox txtItem
Enabled = 0 'False
Height = 270
Index = 5
Left = 3720
MaxLength = 20
TabIndex = 18
Top = 1440
Width = 1572
End
Begin VB.ComboBox Combo1
Height = 288
Index = 1
Left = 3720
Style = 2 'Dropdown List
TabIndex = 17
Top = 720
Width = 1572
End
Begin VB.TextBox txtItem
Enabled = 0 'False
Height = 270
Index = 2
Left = 1080
MaxLength = 20
TabIndex = 14
Top = 1080
Width = 1572
End
Begin VB.TextBox txtItem
Height = 270
Index = 1
Left = 1080
MaxLength = 20
TabIndex = 13
Top = 720
Width = 1572
End
Begin VB.TextBox txtItem
Height = 270
Index = 0
Left = 1080
MaxLength = 20
TabIndex = 12
Top = 360
Width = 1572
End
Begin VB.ComboBox Combo1
Height = 288
Index = 0
Left = 3720
Style = 2 'Dropdown List
TabIndex = 11
Top = 360
Width = 1572
End
Begin VB.TextBox txtItem
Height = 270
Index = 4
Left = 1080
MaxLength = 20
TabIndex = 1
Top = 1440
Width = 1572
End
Begin VB.TextBox txtItem
Enabled = 0 'False
Height = 270
Index = 3
Left = 3720
MaxLength = 20
TabIndex = 0
Top = 1080
Width = 1572
End
Begin VB.Label Label2
Caption = "总 金 额:"
Height = 252
Index = 1
Left = 2880
TabIndex = 16
Top = 1440
Width = 1092
End
Begin VB.Label Label2
Caption = "数 量:"
Height = 252
Index = 0
Left = 360
TabIndex = 15
Top = 1440
Width = 1092
End
Begin VB.Label Label2
Caption = "单 价:"
Height = 252
Index = 2
Left = 2880
TabIndex = 10
Top = 1080
Width = 1092
End
Begin VB.Label Label2
Caption = "型 号:"
Height = 252
Index = 11
Left = 360
TabIndex = 9
Top = 1080
Width = 1092
End
Begin VB.Label Label2
Caption = "配件名称:"
Height = 252
Index = 10
Left = 2880
TabIndex = 8
Top = 720
Width = 1092
End
Begin VB.Label Label2
Caption = "仓库编号:"
Height = 252
Index = 9
Left = 360
TabIndex = 7
Top = 360
Width = 1092
End
Begin VB.Label Label2
Caption = "仓库名称:"
Height = 252
Index = 8
Left = 2880
TabIndex = 6
Top = 360
Width = 1092
End
Begin VB.Label Label2
Caption = "配件编号:"
Height = 252
Index = 3
Left = 360
TabIndex = 5
Top = 720
Width = 1092
End
End
Begin VB.CommandButton cmdExit
Caption = "返回 (&X)"
Height = 375
Left = 3000
TabIndex = 3
Top = 2040
Width = 1215
End
Begin VB.CommandButton cmdSave
Caption = "保存 (&S)"
Height = 375
Left = 1560
TabIndex = 2
Top = 2040
Width = 1215
End
End
Attribute VB_Name = "frmWX1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'是否改动过记录,ture为改过
Dim mblChange As Boolean
Dim mrc As ADODB.Recordset
Public txtSQL As String
Public txtM_NO As String '
Public txtM_DATE As String '
Public txtKHDM As String '
Public txtYWDM As String '
Public txtREB As Integer
Public txtLB As String
Public txtCKDM As String
Public txtWZDM As String
Public txtQIHAO As String
Public txtSL As String
Public txtZKE As String
Private Sub cmdExit_Click()
If mblChange And cmdSave.Enabled Then
If MsgBox("保存当前记录的变化吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
'保存
Call cmdSave_Click
End If
End If
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim intCount As Integer
Dim sMeg As String
Dim MsgText As String
For intCount = 0 To 4
If Trim(txtItem(intCount) & " ") = "" Then
Select Case intCount
Case 0
sMeg = "仓库编号"
Case 1
sMeg = "配件编号"
Case 2
sMeg = "型 号"
Case 3
sMeg = "进货单价"
Case 4
sMeg = "数量"
Case 5
sMeg = "总金额"
End Select
sMeg = sMeg & "不能为空!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
txtItem(intCount).SetFocus
Exit Sub
End If
Next intCount
'添加判断是否有相同的ID记录
If gintPLmode = 1 Then
txtSQL = "select * from outh where outh_no ='" & Trim(txtM_NO) & "' and wzdm = '" & Trim(txtItem(1)) & "' and ckdm = '" & Trim(txtItem(0)) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = False Then
MsgBox "已经存在相同配件!", vbOKOnly + vbExclamation, "警告"
Combo1(0).SetFocus
mrc.Close
Exit Sub
End If
End If
If gintPLmode = 1 Then
txtSQL = "select update_date,sl,total_je from kucun where ckdm = '" & txtItem(0) & "'"
txtSQL = txtSQL & " and wzdm = '" & txtItem(1) & "'"
txtSQL = txtSQL & " and qihao = '" & txtItem(2) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
If mrc.Fields(1) < CDbl(txtItem(4)) Then
mrc.Close
sMeg = "库存商品数量不够,请首先从其他仓库调拨!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
Else
sMeg = "仓库没有指定商品,请首先从其他仓库调拨!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
ElseIf gintPLmode = 2 Then
If (txtCKDM = txtItem(0)) And (txtWZDM = txtItem(1)) And (txtQIHAO = txtItem(2)) Then
txtSQL = "select update_date,sl,total_je from kucun where ckdm = '" & txtCKDM & "'"
txtSQL = txtSQL & " and wzdm = '" & txtWZDM & "'"
txtSQL = txtSQL & " and qihao = '" & txtQIHAO & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
If (mrc.Fields(1) + CDbl(txtSL)) >= CDbl(txtItem(4)) Then
mrc.Close
Else
mrc.Close
sMeg = "库存商品数量不够,请首先从其他仓库调拨!"
MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -