资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:33k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form PZ_FrmAss
- BackColor = &H00C0C0C0&
- Caption = "辅助核算项目"
- ClientHeight = 7290
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6435
- Icon = "凭证处理_辅助核算项目.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form3"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 7290
- ScaleWidth = 6435
- StartUpPosition = 1 '所有者中心
- Begin VB.TextBox LrText
- Height = 300
- Index = 8
- Left = 930
- TabIndex = 8
- Text = "8"
- Top = 3930
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 9
- Left = 930
- TabIndex = 9
- Text = "9"
- Top = 4380
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 10
- Left = 930
- TabIndex = 10
- Text = "10"
- Top = 4920
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 12
- Left = 930
- TabIndex = 12
- Text = "12"
- Top = 5880
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 13
- Left = 930
- TabIndex = 13
- Text = "13"
- Top = 6390
- Width = 3315
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 13
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":1042
- Style = 1 'Graphical
- TabIndex = 41
- Top = 6420
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 12
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":13CC
- Style = 1 'Graphical
- TabIndex = 40
- Top = 5910
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 10
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":1756
- Style = 1 'Graphical
- TabIndex = 32
- Top = 4920
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 9
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":1AE0
- Style = 1 'Graphical
- TabIndex = 31
- Top = 4410
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 8
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":1E6A
- Style = 1 'Graphical
- TabIndex = 30
- Top = 3960
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 7
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":21F4
- Style = 1 'Graphical
- TabIndex = 29
- Top = 3450
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 2
- Left = 4200
- Picture = "凭证处理_辅助核算项目.frx":257E
- Style = 1 'Graphical
- TabIndex = 28
- Top = 1080
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 0
- Left = 4260
- Picture = "凭证处理_辅助核算项目.frx":2908
- Style = 1 'Graphical
- TabIndex = 16
- Top = 60
- Visible = 0 'False
- Width = 285
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 5220
- TabIndex = 15
- Top = 660
- Width = 1120
- End
- Begin VB.CommandButton BcCommand
- Caption = "确定(&O)"
- Height = 300
- Left = 5220
- TabIndex = 14
- Top = 180
- Width = 1120
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 930
- TabIndex = 0
- Text = "0"
- Top = 60
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 930
- TabIndex = 1
- Text = "1"
- Top = 555
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 930
- TabIndex = 2
- Text = "2"
- Top = 1050
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 3
- Left = 930
- TabIndex = 3
- Text = "3"
- Top = 1515
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 4
- Left = 930
- TabIndex = 4
- Text = "4"
- Top = 1995
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 5
- Left = 930
- TabIndex = 5
- Text = "5"
- Top = 2460
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 6
- Left = 930
- TabIndex = 6
- Text = "6"
- Top = 2940
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 7
- Left = 930
- TabIndex = 7
- Text = "7"
- Top = 3450
- Width = 3315
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 11
- Left = 930
- TabIndex = 11
- Text = "11"
- Top = 5370
- Width = 3315
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "经办人:"
- Height = 180
- Index = 13
- Left = 90
- TabIndex = 42
- Top = 6450
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "供应商:"
- Height = 180
- Index = 12
- Left = 90
- TabIndex = 39
- Top = 5940
- Width = 810
- End
- Begin VB.Label Lab_ForeignName
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- ForeColor = &H00404040&
- Height = 180
- Left = 4260
- TabIndex = 38
- Top = 2490
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label Lab_ItemMeasure
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- ForeColor = &H00404040&
- Height = 180
- Left = 4260
- TabIndex = 37
- Top = 5400
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "项目数量:"
- Height = 180
- Index = 11
- Left = 90
- TabIndex = 36
- Top = 5430
- Width = 810
- End
- Begin VB.Label Lab_Measure
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- ForeColor = &H00404040&
- Height = 180
- Left = 4260
- TabIndex = 35
- Top = 1530
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label lab_GridRow
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 180
- Left = 7980
- TabIndex = 34
- Top = 1080
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label Lab_ItemClass
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- ForeColor = &H00404040&
- Height = 180
- Left = 4260
- TabIndex = 33
- Top = 4890
- Visible = 0 'False
- Width = 90
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "项目:"
- Height = 180
- Index = 10
- Left = 90
- TabIndex = 27
- Top = 4920
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "个人:"
- Height = 180
- Index = 9
- Left = 60
- TabIndex = 26
- Top = 4440
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "往来客户:"
- Height = 180
- Index = 8
- Left = 90
- TabIndex = 25
- Top = 3960
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "部门:"
- Height = 180
- Index = 7
- Left = 90
- TabIndex = 24
- Top = 3540
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "汇率:"
- Height = 180
- Index = 6
- Left = 90
- TabIndex = 23
- Top = 2970
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "外币金额:"
- Height = 180
- Index = 5
- Left = 90
- TabIndex = 22
- Top = 2535
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "单价:"
- Height = 180
- Index = 4
- Left = 90
- TabIndex = 21
- Top = 2055
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "数量:"
- Height = 180
- Index = 3
- Left = 90
- TabIndex = 20
- Top = 1590
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "发生日期:"
- Height = 180
- Index = 2
- Left = 90
- TabIndex = 19
- Top = 1095
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "结算方式:"
- Height = 180
- Index = 0
- Left = 90
- TabIndex = 18
- Top = 120
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "票号:"
- Height = 180
- Index = 1
- Left = 90
- TabIndex = 17
- Top = 585
- Width = 810
- End
- End
- Attribute VB_Name = "PZ_FrmAss"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '************************************************************************************
- '* 模 块 名 称 :辅助核算项目录入
- '* 功 能 描 述 :能够根据科目辅助核算项,自动出现辅助核算项目,并自动调整
- '* 录入项目位置及窗体大小
- '* 程序员姓名 : 张建忠
- '* 最后修改人 : 张建忠
- '* 最后修改时间:2000/09/07
- '* 备 注:
- '*
- '* 1.对于网格列存储内容
- '* 0-行有效标识 1-结算方式编码 2-结算方式名称 3-票号 4-发生日期 5-数量 6-单价
- '* 7-计量单位 8-外币编码 9-外币名称 10-汇率 11-部门编码 12-部门名称 13-单位编码
- '* 14-单位名称 15-职员编码 16-职员名称 17-项目大类编码 18-项目大类名称
- '* 19-项目编码 20-项目名称 21-项目数量 22-项目计量单位
- '************************************************************************************
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Tsxx As String '系统提示信息
- Dim Bln_FirstTab As Boolean '是否首此产生Tab键(主要用来判断Tab键是否由填置凭证窗体引起)
- '以下为固定使用变量(文本框)
- 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 CurTextIndex As Integer '当前文本框索引值
- Dim TextChangeLock As Boolean '文本框内容变换控制锁
- Dim Bln_Cancel As Boolean '取消按钮信息传递
- '[ZJZ Begin 改进由填制凭证窗体引发的焦点转移 2001-06-16
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = 144 And Bln_FirstTab Then
- For Jsqte = 0 To Max_Text_Index
- If LrText(Jsqte).Visible And LrText(Jsqte).Enabled Then
- LrText(Jsqte).SetFocus
- Exit For
- End If
- Next Jsqte
- End If
- Bln_FirstTab = False
- End Sub
- '[ZJZ End
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- jdzygs = 20
- 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()
- '以下为文本框处理程序
- TextGroupCode = "Cwzz_Ass"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- '判断是否由填制凭证窗体引发Tab
- Bln_FirstTab = True
- End Sub
- Private Function Bclrsj() As Boolean '判断录入数据有效性,并保存数据
- Dim Jsqte As Integer
- Dim RecTemp As New ADODB.Recordset
- Dim Int_GridRow As Integer '数据回写网格行
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 8) = 1 And LrText(Jsqte).Visible Then '字段不能为空
- If Len(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- Else
- If Textint(Jsqte, 8) = 2 And LrText(Jsqte).Visible Then '字段不能为零
- If Val(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- Next Jsqte
- '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
- For Jsqte = 0 To Max_Text_Index
- If (Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2) And LrText(Jsqte).Visible Then
- If Not TextYxxpd(Jsqte) Then
- Exit Function
- End If
- End If
- Next Jsqte
- '如项目核算数量,则项目数量不能为零
- If Len(Trim(Lab_ItemMeasure)) <> 0 And Val(LrText(11)) = 0 Then
- Tsxx = "此项目核算数量,则项目数量不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(11).SetFocus
- Exit Function
- End If
- Int_GridRow = Val(lab_GridRow)
- With PZ_JzpzclFrm
- For Jsqte = 0 To Max_Text_Index
- If LrText(Jsqte).Visible Then
- Select Case Jsqte
- Case 0 '结算方式
- .WglrGrid.TextMatrix(Int_GridRow, 1) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 2) = Trim(LrText(Jsqte).Text)
- Case 1 '票号
- .WglrGrid.TextMatrix(Int_GridRow, 3) = Trim(LrText(Jsqte).Text)
- Case 2 '发生日期
- .WglrGrid.TextMatrix(Int_GridRow, 4) = Trim(LrText(Jsqte).Text)
- Case 3 '数量
- .WglrGrid.TextMatrix(Int_GridRow, 5) = Val(LrText(Jsqte).Text)
- Case 4 '单价
- .WglrGrid.TextMatrix(Int_GridRow, 6) = Val(LrText(Jsqte).Text)
- Case 5 '外币金额
- .WglrGrid.TextMatrix(Int_GridRow, 10) = Trim(LrText(Jsqte).Text)
- Case 6 '汇率
- .WglrGrid.TextMatrix(Int_GridRow, 11) = Trim(LrText(Jsqte).Text)
- Case 7 '部门
- .WglrGrid.TextMatrix(Int_GridRow, 12) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 13) = Trim(LrText(Jsqte).Text)
- Case 8 '客户
- .WglrGrid.TextMatrix(Int_GridRow, 14) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 15) = Trim(LrText(Jsqte).Text)
- Case 9 '个人
- .WglrGrid.TextMatrix(Int_GridRow, 16) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 17) = Trim(LrText(Jsqte).Text)
- If Trim(LrText(Jsqte).Tag) <> "" Then
- Sqlstr = "SELECT Gy_Department.DeptCode, Gy_Department.DeptName FROM Gy_Person LEFT OUTER JOIN" & _
- " Gy_Department ON Gy_Person.DeptCode = Gy_Department.DeptCode Where Gy_Person.PersonCode='" & Trim(LrText(Jsqte).Tag) & "'"
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not RecTemp.EOF Then
- .WglrGrid.TextMatrix(Int_GridRow, 12) = Trim(RecTemp.Fields("DeptCode"))
- .WglrGrid.TextMatrix(Int_GridRow, 13) = Trim(RecTemp.Fields("DeptName"))
- End If
- End If
- Case 10 '项目
- .WglrGrid.TextMatrix(Int_GridRow, 20) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 21) = Trim(LrText(Jsqte).Text)
- Case 11 '项目数量
- If Len(Trim(Lab_ItemMeasure)) <> 0 Then
- .WglrGrid.TextMatrix(Int_GridRow, 22) = Trim(LrText(Jsqte).Text)
- .WglrGrid.TextMatrix(Int_GridRow, 23) = Trim(Lab_ItemMeasure)
- Else
- .WglrGrid.TextMatrix(Int_GridRow, 22) = ""
- .WglrGrid.TextMatrix(Int_GridRow, 23) = ""
- End If
- Case 12 '供应商
- .WglrGrid.TextMatrix(Int_GridRow, 25) = Trim(LrText(Jsqte).Tag)
- .WglrGrid.TextMatrix(Int_GridRow, 26) = Trim(LrText(Jsqte).Text)
- Case 13 '经办人
- .WglrGrid.TextMatrix(Int_GridRow, 24) = Trim(LrText(Jsqte).Text)
- End Select
- End If
- Next Jsqte
- End With
- Bclrsj = True
- End Function
- Private Sub BcCommand_Click() '保 存
- If Not Bclrsj Then
- Exit Sub
- End If
- Unload Me
- End Sub
- Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) '取消
- '避免执行Click程序
- Bln_Cancel = True
- Call Sub_Cancel
- End Sub
- Private Sub QxCommand_Click() '取消
- If Bln_Cancel Then
- Bln_Cancel = False
- Exit Sub
- End If
- Call Sub_Cancel
- End Sub
- Private Sub Sub_Cancel() '取消
- '文本框加锁
- For Jsqte = 0 To Max_Text_Index
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- Unload Me
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- '在此填写文本框录入事后处理程序
- ']以上为依据实际情况自定义部分
- End Sub
- Private Sub LrText_Change(Index As Integer)
- '屏蔽程序改变控制
- If TextChangeLock Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = False '打开有效性判断锁
- '限制字段录入长度
- TextChangeLock = True '加锁(防止执行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)
- CurTextIndex = 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 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
- TextValiJudgeLock(Index) = True
- '先进行有效性判断
- If Not TextYxxpd(CurTextIndex) Then
- Exit Sub
- End If
- If Index = 10 Then '核算项目特殊处理
- Xtcdcs = Trim(LrText(Index).Text)
- Xtcdcsfz = Lab_ItemClass.Tag
- XT_ItemHelp.Show 1
- Else
- Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
- End If
- 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
- TextValiJudgeLock(Index) = False
- LrText(Index).SetFocus
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- '填写文本框得到焦点,进行相应信息处理程序
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- Dim Jsqte As Integer
- '最大录入文本框索引值
- 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 TextValiJudgeLock(Index) Then '文本框内容未曾改变不进行有效性判断
- TextYxxpd = True
- Exit Function
- End If
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call Wbklrwbcl(Index)
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- Select Case Index
- Case 7
- Dim tDeptCode As String
- Dim tDeptName As String
- tDeptCode = Trim(LrText(Index).Text)
- Sqlstr = "select deptcode,deptname from gy_department where cwzzflag=1 and deptcode='" & tDeptCode & "' or deptname='" & tDeptCode & "'"
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF Then
- Call Xtxxts("此部门不存在!", 0, 1)
- Exit Function
- Else
- tDeptCode = Trim(Findrec("DeptCode"))
- tDeptName = Trim(Findrec("DeptName"))
- Sqlstr = "select * from gy_department where cwzzflag=1 and parentcode='" & tDeptCode & "'"
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF Then
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = tDeptCode
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = tDeptName
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = tDeptName
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = tDeptCode
- End If
- End Select
- Else
- Call Xtxxts("非末级部门!", 0, 1)
- Exit Function
- End If
- End If
- Case Else
- Select Case Textint(Index, 4)
- Case 1 '编码型
- Sqlstr = Trim(Textstr(Index, 5))
- Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
- 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")
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- Select Case Index
- Case 10 '项目
- Sqlstr = "select * from Cwzz_item where ItemClassCode='" & Lab_ItemClass.Tag & "' and (ItemCode='" & Trim(LrText(10).Text) & "' or ItemName='" & Trim(LrText(10).Text) & "')"
- 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
- If Findrec.Fields("QuantityFlag") Then '数量核算显示单位
- Lab_ItemMeasure = Trim(Findrec.Fields("Measure"))
- Else
- LrText(11).Text = ""
- Lab_ItemMeasure = ""
- End If
- End If
- End Select
- End Select
- End Select
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- End Function