资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:24k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form CL_MakeVoucherFind
- BorderStyle = 1 'Fixed Single
- Caption = "生成凭证查询条件"
- ClientHeight = 4170
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7350
- HelpContextID = 130407
- Icon = "处理_生成凭证查询条件.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4170
- ScaleWidth = 7350
- StartUpPosition = 2 'CenterScreen
- Visible = 0 'False
- Begin VB.CommandButton Cmd_Clear
- Caption = "全清(&L)"
- Height = 300
- Left = 120
- TabIndex = 32
- Top = 3720
- Width = 1120
- End
- Begin VB.CheckBox UnloadCheck
- Caption = "Check1"
- Height = 255
- Left = 1620
- TabIndex = 24
- Top = 3870
- Visible = 0 'False
- Width = 975
- End
- Begin VB.Frame Frame1
- Height = 3615
- Left = 2880
- TabIndex = 14
- Top = 0
- Width = 4365
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 6
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":1042
- Style = 1 'Graphical
- TabIndex = 31
- Top = 2190
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 5
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":13CC
- Style = 1 'Graphical
- TabIndex = 30
- Top = 1800
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 2
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":1756
- Style = 1 'Graphical
- TabIndex = 29
- Top = 1050
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 1
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":1AE0
- Style = 1 'Graphical
- TabIndex = 28
- Top = 690
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 4
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":1E6A
- Style = 1 'Graphical
- TabIndex = 27
- Top = 1440
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 3
- Left = 2190
- Picture = "处理_生成凭证查询条件.frx":21F4
- Style = 1 'Graphical
- TabIndex = 26
- Top = 1440
- Visible = 0 'False
- Width = 300
- End
- Begin VB.CommandButton YDCommand1
- Height = 300
- Index = 0
- Left = 3930
- Picture = "处理_生成凭证查询条件.frx":257E
- Style = 1 'Graphical
- TabIndex = 25
- Top = 300
- Visible = 0 'False
- Width = 300
- End
- Begin VB.OptionButton Opti_pz
- Caption = "已生成的凭证"
- Height = 195
- Left = 180
- TabIndex = 23
- Top = 3240
- Visible = 0 'False
- Width = 2055
- End
- Begin VB.OptionButton Opti_bill2
- Caption = "已生成凭证的单据"
- Height = 255
- Left = 2250
- TabIndex = 22
- Top = 2760
- Width = 1815
- End
- Begin VB.OptionButton Opti_bill1
- Caption = "未生成凭证的单据"
- Height = 255
- Left = 150
- TabIndex = 21
- Top = 2760
- Value = -1 'True
- Width = 1935
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 6
- Left = 1020
- TabIndex = 6
- Text = "6"
- Top = 2190
- Width = 2925
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 4
- Left = 2730
- TabIndex = 4
- Text = "4"
- Top = 1440
- Width = 1215
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 5
- Left = 1020
- TabIndex = 5
- Text = "5"
- Top = 1815
- Width = 2925
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 1020
- TabIndex = 2
- Text = "2"
- Top = 1050
- Width = 2925
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 3
- Left = 1020
- TabIndex = 3
- Text = "3"
- Top = 1440
- Width = 1185
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 1020
- TabIndex = 1
- Text = "1"
- Top = 675
- Width = 2925
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 1020
- TabIndex = 0
- Text = "0"
- Top = 300
- Width = 2925
- End
- Begin VB.Line Line1
- X1 = 2520
- X2 = 2670
- Y1 = 1590
- Y2 = 1590
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "部门:"
- Height = 195
- Index = 3
- Left = 150
- TabIndex = 20
- Top = 1860
- Width = 405
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "记帐人:"
- Height = 195
- Index = 14
- Left = 150
- TabIndex = 19
- Top = 2250
- Width = 585
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "仓库:"
- Height = 195
- Index = 2
- Left = 150
- TabIndex = 18
- Top = 360
- Width = 405
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "单据日期:"
- Height = 195
- Index = 11
- Left = 150
- TabIndex = 17
- Top = 1500
- Width = 765
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "存货:"
- Height = 195
- Index = 12
- Left = 150
- TabIndex = 16
- Top = 1140
- Width = 405
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "存货分类:"
- Height = 195
- Index = 1
- Left = 150
- TabIndex = 15
- Top = 750
- Width = 765
- End
- End
- Begin VB.CommandButton QdCommand
- Caption = "确定(&O)"
- Height = 300
- Left = 4890
- TabIndex = 7
- Top = 3750
- Width = 1120
- End
- Begin VB.CommandButton QxCommand
- Caption = "取消(&C)"
- Height = 300
- Left = 6120
- TabIndex = 13
- Top = 3750
- Width = 1120
- End
- Begin VB.Frame Frame3
- Height = 3615
- Left = 90
- TabIndex = 8
- Top = 0
- Width = 2685
- Begin VB.ListBox Lst_BillCode
- Height = 2310
- Left = 120
- Style = 1 'Checkbox
- TabIndex = 11
- Top = 510
- Width = 2445
- End
- Begin VB.CommandButton Com_Qbfd
- Caption = "全消"
- Height = 300
- Left = 180
- TabIndex = 10
- Top = 3180
- Width = 1120
- End
- Begin VB.CommandButton Com_Qbxz
- Caption = "全选"
- Height = 300
- Left = 1410
- TabIndex = 9
- Top = 3180
- Width = 1120
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "单据名称:"
- Height = 195
- Index = 0
- Left = 150
- TabIndex = 12
- Top = 210
- Width = 765
- End
- End
- End
- Attribute VB_Name = "CL_MakeVoucherFind"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '**************************************************************************
- '* 模 块 名 称 :生成凭证列表查询条件
- '* 功 能 描 述 :
- '* 程序员姓名 :杨波
- '* 最后修改人 :杨波
- '* 最后修改时间:2001/12/18
- '* 备 注:程序中所有依实际情况自定义部分均用[>> <<]括起
- '**************************************************************************
- Dim SaveTxt() As String '保留文本内容
- Dim SaveLst() As Boolean '保留列表内容
- Dim SaveOption() As Boolean '保留option内容
- '以下为固定使用变量(文本框)
- Dim Tsxx As String '提示信息
- Dim Textvar() As Variant '存储变体型文本框信息
- Dim Textboolean() As Boolean '存储布尔型文本框信息
- Dim Textint() As Integer '存储整型文本框信息
- Dim Textstr() As String '存储字符型文本框信息
- Dim Max_Text_Index As Integer '最大录入文本框索引值
- Dim TextGroupCode As String '文本框录入分组编码
- Dim TextValiLock As Boolean '文本框失去焦点是否进行有效性控制判断
- Dim TextValiJudgeLock() As Boolean '文本框录入有效性判断控制锁
- Dim TextChangeLock As Boolean '文本框内容变换控制锁
- Dim Bln_Cancel As Boolean '取消按钮信息传递
- Dim Jsqte As Integer
- Dim BillCode(11) As String '单据类型编码
- Dim MSQLStr As String
- Private Sub Cmd_Clear_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) '将用户输入条件全部清除(可选)
- '清除文本框(Fixed)
- For Jsqte = 0 To Max_Text_Index
- LrText(Jsqte).Tag = ""
- LrText(Jsqte).Text = ""
- Next Jsqte
- End Sub
- Private Sub Com_Qbxz_Click() '全选
- Dim i As Integer
- For i = 0 To Lst_BillCode.ListCount - 1
- Lst_BillCode.Selected(i) = True
- Next i
- End Sub
- Private Sub Com_Qbfd_Click() '不选
- Dim i As Integer
- For i = 0 To Lst_BillCode.ListCount - 1
- Lst_BillCode.Selected(i) = False
- Next i
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- Dim jdzygs As Integer
- jdzygs = 7
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽字符"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load() '窗 体 装 入
- Dim count As Integer
- '以下为文本框处理程序
- TextGroupCode = "Chhs_MakeVoucherFind"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- '添加仓库 汇总方式
- Call Add_BillType
- '初始定义
- ReDim SaveLst(Lst_BillCode.ListCount - 1)
- ReDim SaveTxt(LrText.count - 1)
- ReDim SaveOption(2)
- For count = 0 To Lst_BillCode.ListCount - 1
- SaveLst(count) = False
- Next count
- For count = 0 To LrText.count - 1
- SaveTxt(count) = ""
- Next count
- SaveOption(0) = True
- SaveOption(1) = False
- SaveOption(2) = False
- End Sub
- Private Sub Add_BillType() '添加内容
- Dim Rectemp As Recordset
- With Lst_BillCode
- .AddItem "材料入库单"
- BillCode(0) = "1212"
- .AddItem "产品入库单"
- BillCode(1) = "1202"
- .AddItem "其他入库单"
- BillCode(2) = "1203"
- .AddItem "材料出库单"
- BillCode(3) = "1204"
- .AddItem "销售出库单"
- BillCode(4) = "1205"
- .AddItem "其他出库单"
- BillCode(5) = "1206"
- .AddItem "入库单调整"
- BillCode(6) = "1301"
- .AddItem "出库单调整"
- BillCode(7) = "1302"
- .AddItem "计划价调整单"
- BillCode(8) = "1303"
- .AddItem "蓝字暂估单"
- BillCode(9) = "1304"
- .AddItem "红字回冲单"
- BillCode(10) = "1305"
- .AddItem "差异结转单"
- BillCode(11) = "1307"
- End With
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- ']以上为依据实际情况自定义部分
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- If UnloadCheck.Value <> 1 Then
- Cancel = 1
- Call QxCommand_Click
- End If
- End Sub
- Private Sub LrText_Change(Index As Integer)
- '屏蔽程序改变控制
- If TextChangeLock Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = False '打开有效性判断锁
- '限制字段录入长度
- TextChangeLock = True '加锁(防止执行Txt_LrText_Change)
- Select Case Textint(Index, 1)
- Case 8 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9 '数量型
- Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
- Case 10 '单价型
- Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
- Case Else '其他小数类型控制
- If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
- Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
- End If
- End Select
- TextChangeLock = False '解锁
- End Sub
- Private Sub LrText_GotFocus(Index As Integer) '文本框得到焦点,显示相应信息
- Call TextShow(Index)
- LrText(Index).SelStart = Len(LrText(Index))
- End Sub
- Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) '字段按F2键提供帮助
- Select Case KeyCode
- Case vbKeyF2
- Call Text_Help(Index)
- End Select
- End Sub
- Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer) '文本框录入事中控制
- Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
- End Sub
- Private Sub LrText_LostFocus(Index As Integer) '文本框失去焦点进行有效性判断及相应处理
- If Textint(Index, 9) = 0 Or Textint(Index, 9) = 1 Then '事中判断
- Call TextYxxpd(Index)
- End If
- End Sub
- Private Sub QdCommand_Click() '确认
- Dim count As Integer
- Dim BillTypeFlag As Boolean
- '录入条件有效性判断
- If Not Lrtjyxxpd Then
- Exit Sub
- End If
- '判断是否选中单据
- For count = 0 To Lst_BillCode.ListCount - 1
- If Lst_BillCode.Selected(count) Then
- BillTypeFlag = True
- Exit For
- End If
- BillTypeFlag = False
- Next
- If Not BillTypeFlag Then
- Tsxx = "请选择至少一种单据"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- End If
- '选择单据
- MSQLStr = ""
- For count = 0 To Lst_BillCode.ListCount - 1
- If Lst_BillCode.Selected(count) And MSQLStr = "" Then
- MSQLStr = "AND (BillCode='" & BillCode(count) & "'"
- Else
- If Lst_BillCode.Selected(count) Then
- MSQLStr = MSQLStr + " OR " & " BillCode='" & BillCode(count) & "'"
- End If
- End If
- Next
- MSQLStr = MSQLStr + ")"
- '激活查询过程
- CL_MakeVoucher.Timer1.Enabled = True
- '保存查询条件设置
- For count = 0 To Lst_BillCode.ListCount - 1
- SaveLst(count) = Lst_BillCode.Selected(count)
- Next count
- For count = 0 To LrText.count - 1
- SaveTxt(count) = LrText(count)
- Next count
- SaveOption(0) = Opti_bill1.Value
- SaveOption(1) = Opti_bill2.Value
- SaveOption(2) = Opti_pz.Value
- Me.Hide
- End Sub
- Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
- Call Text_Help(Index)
- End Sub
- Private Sub Text_Help(Index As Integer) '录入字段帮助
- If Not Textboolean(Index, 1) Then
- Exit Sub
- End If
- TextValiLock = True
- Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
- If Len(Xtfhcs) <> 0 Then
- If Textint(Index, 3) = 1 Then
- LrText(Index).Text = Xtfhcsfz
- LrText(Index).Tag = Xtfhcs
- Else
- LrText(Index).Text = Xtfhcs
- LrText(Index).Tag = Xtfhcsfz
- End If
- End If
- TextValiLock = False
- LrText(Index).SetFocus
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- '填写文本框得到焦点,进行相应信息处理程序
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- '最大录入文本框索引值
- Max_Text_Index = Textvar(1)
- ReDim TextValiJudgeLock(Max_Text_Index)
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- If Textboolean(Jsqte, 1) Then
- If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
- Load YDCommand1(Jsqte)
- End If
- YDCommand1(Jsqte).Visible = True
- YDCommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
- End If
- TextChangeLock = True
- LrText(Jsqte).Text = ""
- LrText(Jsqte).Tag = ""
- If Textint(Jsqte, 5) <> 0 Then
- LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
- End If
- TextChangeLock = False
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- End Sub
- Private Function TextYxxpd(Index As Integer) As Boolean '文本框有效性判断
- Dim SqlStr As String
- Dim Findrec As ADODB.Recordset
- '按帮助不进行有效性判断
- If TextValiLock Then
- TextValiLock = False
- TextYxxpd = True
- Exit Function
- End If
- '文本框内容未曾改变不进行有效性判断
- If TextValiJudgeLock(Index) Then
- TextYxxpd = True
- Exit Function
- End If
- Call Wbklrwbcl(Index)
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- Select Case Textint(Index, 4)
- Case 1 '编码型
- SqlStr = Trim(Textstr(Index, 5))
- SqlStr = Replace(SqlStr, "@", "'" + Trim(LrText(Index).Text) + "'")
- SqlStr = Replace(SqlStr, "$$", "'" + Trim(Xtczybm) + "'")
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- If Findrec.EOF Then
- Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
- LrText(Index).SetFocus
- Exit Function
- Else
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- End Select
- End If
- Case 2 '日期型
- If IsDate(LrText(Index).Text) Then
- LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
- If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
- LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
- End If
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- End Select
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- End Function
- Private Sub QxCommand_Click()
- '恢复查询设置
- For Jsqte = 0 To Lst_BillCode.ListCount - 1
- Lst_BillCode.Selected(Jsqte) = SaveLst(Jsqte)
- Next Jsqte
- For Jsqte = 0 To LrText.count - 1
- LrText(Jsqte) = SaveTxt(Jsqte)
- Next Jsqte
- Opti_bill1 = SaveOption(0)
- Opti_bill2 = SaveOption(1)
- Opti_pz = SaveOption(2)
- Me.Hide
- End Sub
- Private Function Lrtjyxxpd() As Boolean '用户录入条件有效性判断
- Dim Jsqte As Integer
- Lrtjyxxpd = False
- '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
- If Not TextYxxpd(Jsqte) Then
- Exit Function
- End If
- End If
- Next Jsqte
- '[>>以下为依据实际情况自定义部分
- If LrText(3).Text > LrText(4).Text And LrText(4).Text <> "" Then
- Tsxx = "日期范围应由小到大!"
- Call Xtxxts(Tsxx, 0, 4)
- LrText(3).SetFocus
- Exit Function
- End If
- '<<]以上为依据实际情况自定义部分
- Lrtjyxxpd = True
- End Function
- Public Property Get SqlStr() As Variant
- SqlStr = MSQLStr
- End Property