资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:65k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
- Begin VB.Form DJ_AdjustPlan
- BorderStyle = 1 'Fixed Single
- Caption = "计划价调整"
- ClientHeight = 6555
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 9105
- HelpContextID = 13030503
- Icon = "单据调整_计划价调整.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6555
- ScaleWidth = 9105
- StartUpPosition = 2 '屏幕中心
- Begin TabDlg.SSTab StTab
- Height = 5865
- Left = 30
- TabIndex = 0
- Top = 660
- Width = 9060
- _ExtentX = 15981
- _ExtentY = 10345
- _Version = 393216
- Style = 1
- Tabs = 2
- TabHeight = 520
- TabCaption(0) = "列表视图"
- TabPicture(0) = "单据调整_计划价调整.frx":1042
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "CzxsGrid"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).ControlCount= 1
- TabCaption(1) = "单张视图"
- TabPicture(1) = "单据调整_计划价调整.frx":105E
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Frame1"
- Tab(1).ControlCount= 1
- Begin VB.Frame Frame1
- Height = 5325
- Left = -74880
- TabIndex = 1
- Top = 360
- Width = 8835
- Begin VB.TextBox LrText
- Height = 300
- Index = 5
- Left = 1650
- TabIndex = 17
- Text = "5"
- Top = 2130
- Width = 6015
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 4
- Left = 5190
- TabIndex = 7
- Text = "4"
- Top = 1710
- Width = 2475
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 3
- Left = 1650
- TabIndex = 6
- Text = "3"
- Top = 1710
- Width = 2375
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 1650
- TabIndex = 5
- Text = "2"
- Top = 1290
- Width = 6015
- End
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 0
- Left = 7680
- Picture = "单据调整_计划价调整.frx":107A
- Style = 1 'Graphical
- TabIndex = 4
- Top = 840
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 5190
- TabIndex = 3
- Text = "1"
- Top = 840
- Width = 2475
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 1650
- TabIndex = 2
- Text = "0"
- Top = 870
- Width = 2370
- End
- Begin VSFlex8Ctl.VSFlexGrid XsGrid
- Height = 2535
- Left = 150
- TabIndex = 19
- Top = 2610
- Width = 8505
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = 8421504
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "备注:"
- Height = 195
- Index = 2
- Left = 1200
- TabIndex = 18
- Top = 2160
- Width = 405
- End
- Begin VB.Label Lab_Title
- AutoSize = -1 'True
- BackColor = &H80000018&
- BackStyle = 0 'Transparent
- Caption = "计划价调整"
- BeginProperty Font
- Name = "宋体"
- Size = 15
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 300
- Left = 3480
- TabIndex = 16
- Top = 360
- Width = 1575
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "现计划价:"
- Height = 195
- Index = 5
- Left = 4320
- TabIndex = 12
- Top = 1740
- Width = 765
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "原计划价:"
- Height = 195
- Index = 4
- Left = 810
- TabIndex = 11
- Top = 1740
- Width = 765
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "存货名称:"
- Height = 195
- Index = 3
- Left = 810
- TabIndex = 10
- Top = 1350
- Width = 765
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "存货编码:"
- Height = 195
- Index = 1
- Left = 4320
- TabIndex = 9
- Top = 900
- Width = 765
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "调整日期:"
- Height = 195
- Index = 0
- Left = 810
- TabIndex = 8
- Top = 900
- Width = 765
- End
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 5325
- Left = 90
- TabIndex = 13
- Top = 420
- Width = 8835
- _cx = 5080
- _cy = 5080
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = 8421504
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 14
- Top = 0
- Width = 9105
- _ExtentX = 16060
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 16
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "ymsz"
- ImageKey = "sz"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- Object.ToolTipText = "点击或按Ctrl+P打印表格"
- ImageKey = "dy"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageKey = "yl"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查询"
- Key = "cx"
- ImageKey = "cx"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "单据"
- Key = "Bill"
- ImageKey = "Bill"
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 4
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "增加"
- Key = "zj"
- Object.ToolTipText = "点击或按Ctrl+A增加记录"
- ImageKey = "xz"
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 4
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存"
- Key = "bc"
- ImageKey = "bc"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "放弃"
- Key = "fq"
- Object.ToolTipText = "点击或按Ctrl+D删除当前记录"
- ImageKey = "fq"
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageKey = "sx"
- EndProperty
- BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 525
- Left = 6600
- TabIndex = 15
- Top = 0
- Width = 2475
- _ExtentX = 4366
- _ExtentY = 926
- ButtonWidth = 1455
- ButtonHeight = 926
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 0
- Top = 420
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 30
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":1404
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":179E
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":1B38
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":1ED2
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":226C
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":2606
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":29A0
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":2D3A
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":30D4
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":346E
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":3808
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":3BA2
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":3F3C
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":42D6
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":4670
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":4A0A
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":4DA4
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":513E
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":54D8
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":5872
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":5C0C
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":5FA6
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":6340
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":66DA
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":6A74
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":6E0E
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":71A8
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":7542
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":78DC
- Key = "dw"
- EndProperty
- BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "单据调整_计划价调整.frx":7C76
- Key = "Bill"
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "DJ_AdjustPlan"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**********************************************************
- '* 模 块 名 称 :计划价调整
- '* 功 能 描 述 :调整存货的计划单价
- '* 程序员姓名 :白凤英
- '* 最后修改人 :白凤英
- '* 最后修改时间:2001/12/11
- '* 备 注:
- '**********************************************************
- Dim BillCode As String '单据设计编码(索引号)
- Dim Rec_CodeSet As New ADODB.Recordset '编码设置表
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Lrzt As Integer '录入状态标志(0-非录入状态 1-增加 2-修改)
- Dim ReportTitle As String '报表主标题
- Public Str_QueryCondi As String '单据组查询条件(接收查询条件)
- Dim Str_RightEdit As String '编辑(新增、修改、删除)权限索引
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Szzls As Integer '数组总列数(网格列数-1)
- '以下为固定使用变量(文本框)
- 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 '取消按钮信息传递
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- jdzygs = 10
- 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()
- '打印报表标题信息
- ReportTitle = "计划价调整列表"
- '调入打印页面设置窗体
- XtReportCode = "Chhs_AdjustPlan"
- Load Dyymctbl
- BillCode = "1303"
- '以下为文本框处理程序(读入文本框录入信息)
- TextGroupCode = "Chhs_AdjustPlan"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
- Call Wbkcsh
- '调入显示网格设置信息
- GridCode = "Chhs_AdjustPlan"
- Call BzWgcsh(XsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- XsGridQslz = GridInf(1)
- '调入列表网格设置信息
- GridCode = "Chhs_AdjustPlanList"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '设置查询条件
- Str_QueryCondi = " kjyear=" & PGKjYear & " and period=" & PGNowmon
- '填 充 网 格
- Call Cxnrtcwg
- If Xtcdcs = "1" Then
- '初始化ToolBar,Tab卡状态
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- Frame1.Enabled = False
- '设置为非录入状态
- Lrzt = 0
- '调整工具条状态
- Call Toolfbjzt
- Else
- '初始化ToolBar,Tab卡状态
- StTab.Tab = 1
- StTab.TabEnabled(0) = False
- Frame1.Enabled = True
- Lrzt = 2
- Call Toolbjzt
- Call Cshlrxx(Lrzt, Val(Xtcdcsfz))
- LrText(0).Enabled = False
- LrText(1).Enabled = False
- LrText(2).Enabled = False
- LrText(3).Enabled = False
- LrText(4).Enabled = False
- LrText(5).Enabled = False
- GsToolbar.Visible = False
- SzToolbar.Buttons("fq").Enabled = False
- End If
- '编辑(新增、修改、删除)权限索引
- Str_RightEdit = "Chhs_PlanAdjustEdit"
- End Sub
- Private Sub Cxnrtcwg() '查询内容填充网格
- Dim SqlStr As String '查询连接串
- Dim Jsqte As Long '查询临时使用变量
- '为加快显示速度,将网格刷新动作冻结
- CzxsGrid.Redraw = False
- '[>>查询连接串
- SqlStr = "SELECT DISTINCT PlanAdjustMainId, BillDate, MNumber, MName, Model FROM Chhs_V_AdjustPlan a WHERE " & Str_QueryCondi & " order by a.Mnumber,a.billdate"
- '<<]
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With Cxnrrec
- CzxsGrid.Rows = CzxsGrid.FixedRows
- If .EOF And .BOF Then
- CzxsGrid.Redraw = True
- Exit Sub
- End If
- Jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- CzxsGrid.AddItem ""
- Call Jltcwg(Cxnrrec, Jsqte) '调入填充网格子过程
- CzxsGrid.RowHeight(Jsqte) = Sjhgd '设置网格高度
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- '将网格刷新动作解冻
- CzxsGrid.Redraw = True
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- '[>>以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, 0) = Trim(.Fields("PlanAdjustMainId") & "") '主表ID
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "") '存货编码
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Mname") & "") '存货名称
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Model") & "") '规格型号
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Format(Trim(.Fields("BillDate") & ""), "yyyy-mm-dd") '调整日期
- End With
- '以上为自定义部分<<]
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- Set Cxnrrec = Nothing
- Set Rec_CodeSet = Nothing
- Unload Dyymctbl
- '用户退出时写上机日志
- Security_Log "Chhs_AdjustPlan", Xtczybm, 2, False
- End Sub
- Private Function Sub_SaveBill() As Boolean '保 存 单 据
- Dim Rectemp As New ADODB.Recordset '临时使用动态集
- Dim Rec_VouchMain As New ADODB.Recordset '单据主表动态集
- Dim Rec_VouchSub As New ADODB.Recordset '单据子表动态集
- Dim Rec_List As New ADODB.Recordset '明细帐表动态集
- Dim Rec_Mate As New ADODB.Recordset '总帐表动态集
- Dim Rowjsq As Long '网格行计数器
- Dim Coljsq As Long '网格列计数器
- Dim Jsqte As Integer '临时计数器
- Dim Lng_RowCount As Long '有效数据行计数器
- Dim Lrywlz As Long '录入有误列值
- Dim NewMainId As Integer '主表ID
- Dim mPeriod As Integer '当前会计期间
- Sub_SaveBill = False
- '如果文本框处于编辑状态,则先进性文本框的有效性判断
- If Not TextYxxpd(1) Then
- Sub_SaveBill = False
- Exit Function
- End If
- If Not TextYxxpd(4) Then
- Sub_SaveBill = False
- Exit Function
- End If
- '一.============先对单据内容进行有效性判断==============='
- '先进行字段不能为空或不能为零有效性判断(Fixed)
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 8) = 1 Then '字段不能为空
- If Len(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Exit Function
- End If
- Else
- If Textint(Jsqte, 8) = 2 Then '字段不能为零
- If Val(Trim(LrText(Jsqte).Text)) = 0 Then
- Tsxx = Textstr(Jsqte, 7) & "不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Jsqte).SetFocus
- Exit Function
- End If
- End If
- End If
- Next Jsqte
- '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
- For Jsqte = 0 To Max_Text_Index
- If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
- If Not TextYxxpd(Jsqte) Then
- Call TextShow(Jsqte)
- Exit Function
- End If
- End If
- Next Jsqte
- '[>>
- '可在此区域写入其他对单据表头内容的有效性判断.
- '<<]
- '[>>下面将对所有有效数据行进行有效性判断
- Lng_RowCount = 0
- With XsGrid
- For Rowjsq = .FixedRows To .Rows - 1
- '1.首先进行为空或为零判断(Fixed)
- For Jsqte = Qslz To .Cols - 1
- '字段不能为空
- If GridInt(Jsqte, 5) = 1 Then
- If Len(Trim(.TextMatrix(Rowjsq, Jsqte))) = 0 Then
- Tsxx = GridStr(Jsqte, 2)
- Lrywlz = Jsqte
- GoTo Lrcwcl
- Exit For
- End If
- End If
- '字段不能为零
- If GridInt(Jsqte, 5) = 2 Then
- If Val(Trim(.TextMatrix(Rowjsq, Jsqte))) = 0 Then
- Tsxx = GridStr(Jsqte, 2)
- Lrywlz = Jsqte
- GoTo Lrcwcl
- Exit For
- End If
- End If
- Next Jsqte
- Next Rowjsq
- '[>>
- '此处可以定义整张单据不能通过有效性检查的理由
- '<<]
- End With '网格
- '二.=============如果以上有效性检查均顺利通过,则执行存盘动作============'
- mPeriod = PGNowmon
- '对存盘进行事务处理(Fixed)
- On Error GoTo Swcwcl
- Cw_DataEnvi.DataConnect.BeginTrans
- '判断单据状态以进行不同处理
- '1.先对单据主表进行处理
- '开始存盘
- '打开单据主表动态集
- If Rec_VouchMain.State = 1 Then Rec_VouchMain.Close
- Rec_VouchMain.Open "Select * From Chhs_PlanAdjustMain Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- With Rec_VouchMain
- .AddNew
- .Fields("PlanAdjustMainId") = CreatBillID(BillCode) 'Id号
- .Fields("BillCode") = BillCode '单据编号
- .Fields("BillDate") = CDate(LrText(0).Text) '日期
- .Fields("Mnumber") = Trim(LrText(1).Text) '仓库
- .Fields("AdjustBeforePrice") = Val(LrText(3).Text) '调整前计划单价
- .Fields("AdjustAfterPrice") = Val(LrText(4).Text) '调整后计划单价
- .Fields("Remark") = Trim(LrText(5).Text) '备注
- .Fields("kjyear") = Xtyear
- .Fields("period") = mPeriod
- .Update
- NewMainId = .Fields("PlanAdjustMainId")
- End With
- Set Rec_VouchMain = Nothing
- '2.对单据子表进行处理
- '打开单据子表动态集
- If Rec_VouchSub.State = 1 Then Rec_VouchSub.Close
- Rec_VouchSub.Open "Select * From Chhs_PlanAdjustSub Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- '将网格中有效数据行写入单据子表
- For Rowjsq = XsGrid.FixedRows To XsGrid.Rows - 1
- With Rec_VouchSub
- .AddNew
- .Fields("PlanAdjustSubId") = Rowjsq - XsGrid.FixedRows + 1 'Id号
- .Fields("PlanAdjustMainId") = NewMainId '主表ID
- .Fields("Whcode") = Trim(XsGrid.TextMatrix(Rowjsq, 0)) '仓库
- .Fields("Quan") = Val(XsGrid.TextMatrix(Rowjsq, 2)) + 0 '数量
- .Update
- End With
- '期末处理差异,差额入明细帐
- If Qmclcy Then
- If Rec_List.State = 1 Then Rec_List.Close
- Rec_List.Open "select * from chhs_list where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
- With Rec_List
- .AddNew
- .Fields("billnum") = CreatBillCode(BillCode, True, , Trim(XsGrid.TextMatrix(Rowjsq, 0)))
- .Fields("inoutadjustmainid") = NewMainId
- .Fields("inoutadjustsubid") = Rowjsq - XsGrid.FixedRows + 1
- .Fields("billdate") = Xtrq
- .Fields("chalkdate") = Xtrq
- .Fields("kjyear") = Xtyear
- .Fields("period") = mPeriod
- .Fields("billcode") = BillCode
- .Fields("maker") = Xtczy
- .Fields("chalkitupman") = Xtczy
- .Fields("whcode") = Trim(XsGrid.TextMatrix(Rowjsq, 0))
- .Fields("mnumber") = Trim(LrText(1).Text)
- .Fields("inoutadjustmainid") = NewMainId
- .Fields("inoutadjustsubid") = Rowjsq - XsGrid.FixedRows + 1
- '存货科目
- Xtfhcs = ""
- Xtfhcsfz = ""
- Call MaccCode(Trim(.Fields("whcode")), Trim(LrText(1).Text), Trim(LrText(1).Tag))
- .Fields("mateacct") = Xtfhcs
- .Fields("diffacct") = Xtfhcsfz
- '对方科目
- Xtfhcs = ""
- Call DfaccCode("", "", Trim(LrText(1).Tag), Trim(LrText(1).Text))
- .Fields("dfacct") = Xtfhcs
- '现价>原价按入库单调整入帐,否则按出库单调整入帐
- If Val(LrText(4).Text) > Val(LrText(3).Text) Then
- .Fields("inoutflag") = 1
- .Fields("inmoney") = Val(XsGrid.TextMatrix(Rowjsq, 5))
- .Fields("dfdiff") = Val(XsGrid.TextMatrix(Rowjsq, 5))
- Else
- .Fields("inoutflag") = 0
- .Fields("outmoney") = Abs((XsGrid.TextMatrix(Rowjsq, 5)))
- .Fields("jfdiff") = Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
- End If
- .UpdateBatch
- End With
- Set Rec_List = Nothing
- '调整总帐
- If Rec_Mate.State = 1 Then Rec_Mate.Close
- Rec_Mate.Open "select * from chhs_mate where kjyear=" & Xtyear & " and period=" & mPeriod & _
- " and whcode='" & Trim(XsGrid.TextMatrix(Rowjsq, 0)) & "'" & _
- " and mnumber='" & Trim(LrText(1).Text) & "'", _
- Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
- If Not Rec_Mate.EOF Then
- If Val(LrText(4).Text) > Val(LrText(3).Text) Then
- Rec_Mate.Fields("inmoney") = Rec_Mate.Fields("inmoney") + Val(XsGrid.TextMatrix(Rowjsq, 5))
- Rec_Mate.Fields("dfdiff") = Rec_Mate.Fields("dfdiff") + Val(XsGrid.TextMatrix(Rowjsq, 5))
- If Rec_Mate.Fields("inquan") <> 0 Then
- Rec_Mate.Fields("inprice") = Rec_Mate.Fields("inmoney") / Rec_Mate.Fields("inquan")
- End If
- Else
- Rec_Mate.Fields("outmoney") = Rec_Mate.Fields("outmoney") + Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
- Rec_Mate.Fields("jfdiff") = Rec_Mate.Fields("jfdiff") + Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
- If Rec_Mate.Fields("outquan") <> 0 Then
- Rec_Mate.Fields("outprice") = Rec_Mate.Fields("outmoney") / Rec_Mate.Fields("outquan")
- End If
- End If
- Rec_Mate.UpdateBatch
- End If
- Set Rec_Mate = Nothing
- End If
- Next Rowjsq
- '修改存货计划单价
- Cw_DataEnvi.DataConnect.Execute ("update Gy_material set planprice=" & Val(LrText(4).Text) & " where mnumber='" & Trim(LrText(1).Text) & "'")
- '修改收发记录表中未记帐单据的计划单价
- SqlStr = "SELECT Gy_InOutMain.InoutFlag,Gy_InOutMain.InOutMainId, Gy_InOutSub.InOutSubId," & _
- "Gy_InOutSub.FactReceiptQuan,Gy_InOutSub.FactIssueQuan, Gy_InOutSub.PlanPrice, " & _
- "Gy_InOutSub.PlanMoney,Gy_InOutMain.ChalkitupMan , Gy_InOutMain.KjYear, " & _
- "Gy_InOutMain.Period FROM Gy_InOutMain INNER JOIN Gy_InOutSub ON " & _
- "Gy_InOutMain.InOutMainId = Gy_InOutSub.InOutMainId LEFT OUTER JOIN " & _
- "Gy_Warehouse ON Gy_InOutMain.WhCode = Gy_Warehouse.WhCode " & _
- "WHERE (Gy_Warehouse.PriceMode = '计划价法') AND Gy_InOutMain.ChalkitupMan='' " & _
- "AND Gy_InOutMain.BillCode<>'1211' AND kjYear=" & Xtyear & " and Period>=" & mPeriod & _
- "AND (Gy_InOutSub.MNumber = '" & Trim(LrText(1).Text) & "' )"
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- Do While Not Rectemp.EOF
- If Rectemp.Fields("InoutFlag") And Qmclcy Then
- SqlStr = "Update Gy_InOutSub set PlanPrice=" & Val(LrText(4).Text) & ",PlanMoney=" & Val(Rectemp.Fields("FactReceiptQuan")) * Val(LrText(4).Text) & " where InOutMainId=" & Rectemp.Fields("InOutMainId") & " and InOutSubId=" & Rectemp.Fields("InOutSubId")
- Else
- SqlStr = "Update Gy_InOutSub set PlanPrice=" & Val(LrText(4).Text) & ",PlanMoney=" & Val(Rectemp.Fields("FactIssueQuan")) * Val(LrText(4).Text) & " where InOutMainId=" & Rectemp.Fields("InOutMainId") & " and InOutSubId=" & Rectemp.Fields("InOutSubId")
- End If
- Cw_DataEnvi.DataConnect.Execute (SqlStr)
- Rectemp.MoveNext
- Loop
- Cw_DataEnvi.DataConnect.CommitTrans
- '将记录加入网格
- SqlStr = "SELECT top 1 * FROM Chhs_V_AdjustPlan order by planadjustmainid desc"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With CzxsGrid
- .AddItem ""
- .RowHeight(.Rows - 1) = Sjhgd
- .Select .Rows - 1, Qslz
- Call Jltcwg(Cxnrrec, .Rows - 1)
- End With
- Sub_SaveBill = True
- Tsxx = "单据存盘完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Call Sub_Abandon
- Exit Function
- Swcwcl: '数据存盘时出现错误
- Cw_DataEnvi.DataConnect.RollbackTrans
- With XsGrid
- If Err.Number = -2147217887 Then
- Tsxx = "现计划单价超出允许范围!"
- Call Xtxxts(Tsxx, 0, 1)
- Changelock = True
- LrText(4).SetFocus
- Changelock = False
- Exit Function
- Else
- Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End If
- End With
- Lrcwcl: '录入错误处理(存盘前逐行有效性判断)
- With XsGrid
- Call Xtxxts("(第 " & Trim(Str(Rowjsq - .FixedRows + 1)) & " 条单据分录)-" & Tsxx, 0, 1)
- Changelock = True
- .Select Rowjsq, Lrywlz
- XsGrid.SetFocus
- Changelock = False
- Exit Function
- End With
- End Function
- Private Function Cshlrxx(lrztxx As Integer, MainId As Integer) As Boolean '初始化录入字段信息
- TextChangeLock = True '关闭文本框Chang事件
- Dim Rectemp As Recordset
- If lrztxx = 1 Then
- '增加新记录时将文本框清空
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- LrText(Jsqte).Text = ""
- LrText(Jsqte).Tag = ""
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- '[>>
- '在此处可添加新增记录时初始化设置
- '<<]
- Else
- '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
- SqlStr = "SELECT * FROM Chhs_V_AdjustPlan Where PlanAdjustMainId='" & MainId & "'"
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With Rectemp
- '记录如存在则读入其内容,否则提示记录已被其他人删除
- If Not .EOF Then
- LrText(0).Text = Format(Trim(.Fields("billdate") & ""), "yyyy-mm-dd") '日期
- LrText(1).Text = Trim(.Fields("mnumber") & "") '存货编码
- LrText(2).Text = Trim(.Fields("mname") & "") '存货名称
- LrText(3).Text = .Fields("adjustbeforeprice") '调整前计划单价
- LrText(4).Text = .Fields("adjustafterprice") '调整后计划单价
- LrText(5).Text = Trim(.Fields("remark") & "") '备注
- '填充网格
- If Trim(.Fields("whcode")) <> "" Then
- Do While Not .EOF
- XsGrid.AddItem ""
- XsGrid.RowHeight(XsGrid.Rows - 1) = Sjhgd
- XsGrid.TextMatrix(XsGrid.Rows - 1, 0) = Trim(.Fields("whcode"))
- XsGrid.TextMatrix(XsGrid.Rows - 1, 1) = Trim(.Fields("whname"))
- XsGrid.TextMatrix(XsGrid.Rows - 1, 2) = Trim(.Fields("quan"))
- XsGrid.TextMatrix(XsGrid.Rows - 1, 3) = Val(.Fields("adjustbeforeprice")) * Val(.Fields("quan"))
- XsGrid.TextMatrix(XsGrid.Rows - 1, 4) = Val(.Fields("adjustafterprice")) * Val(.Fields("quan"))
- XsGrid.TextMatrix(XsGrid.Rows - 1, 5) = (Val(.Fields("adjustafterprice")) - Val(.Fields("adjustbeforeprice"))) * Val(.Fields("quan"))
- .MoveNext
- Loop
- End If
- Else
- Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
- Call Xtxxts(Tsxx, 0, 1)
- TextChangeLock = False
- Exit Function
- End If
- End With
- End If
- Cshlrxx = True
- TextChangeLock = False
- End Function
- Private Sub Sub_Abandon() '放 弃 当 前 记 录
- '清除文本框内容
- For Jsqte = LrText.count - 1 To 0 Step -1
- LrText(Jsqte).Text = ""
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- '清除网格内容
- XsGrid.Rows = XsGrid.FixedRows
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- '调整工具条
- Call Toolfbjzt
- GsToolbar.Visible = True
- End Sub
- '*******************以下区域为编写自定义过程区域**********************
- '*******************以上区域为编写自定义过程区域**********************
- '*******************************以下为基本处理程序(固定不变)*******************************************'
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作
- If Shift = 2 Then
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
- Call bbyl(False)
- End If
- Case "A" 'Ctrl+A 增加
- Call Sub_Add
- End Select
- End If
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "cx" '查 询
- DJ_AdjustPlanCond.Show 1
- Call Cxnrtcwg
- Call Toolfbjzt
- Case "Bill" '单 据
- Call CzxsGrid_DblClick
- Case "zj" '增 加
- Call Sub_Add
- Case "bc" '保 存
- Call Sub_SaveBill
- Case "fq" '放 弃
- For Jsqte = LrText.count - 1 To 0
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- Call Sub_Abandon
- Case "sx" '刷 新
- Call Cxnrtcwg
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- End Sub
- Private Sub Sub_Add() '增加
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- '单据录入日期是否在当前年度
- If Not Year(CDate(Xtrq)) = PGKjYear Then
- Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- '单据日期必须在当前会计期间
- If Month(Xtrq) <> PGNowmon Then
- Tsxx = "操作日期不在当前会计期间(" + Trim(Str(PGKjYear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- Lrzt = 1
- Call Toolbjzt
- Call Cshlrxx(Lrzt, 0)
- LrText(0).Enabled = False
- LrText(1).Enabled = True
- LrText(2).Enabled = False
- LrText(3).Enabled = False
- LrText(4).Enabled = True
- LrText(5).Enabled = True
- LrText(0).Text = Format(Xtrq, "yyyy-mm-dd")
- LrText(1).SetFocus
- XsGrid.Rows = XsGrid.FixedRows
- GsToolbar.Visible = False
- End Sub
- Private Sub CzxsGrid_DblClick() '显示当前编码记录
- If CzxsGrid.Rows = CzxsGrid.FixedRows Then Exit Sub
- Lrzt = 2
- Call Toolbjzt
- Call Cshlrxx(Lrzt, Val(CzxsGrid.TextMatrix(CzxsGrid.Row, 0)))
- LrText(0).Enabled = False
- LrText(1).Enabled = False
- LrText(2).Enabled = False
- LrText(3).Enabled = False
- LrText(4).Enabled = False
- LrText(5).Enabled = False
- GsToolbar.Visible = False
- End Sub
- Private Sub Toolbjzt() 'Toolbar状态(编辑状态)
- StTab.TabEnabled(1) = True
- StTab.Tab = 1
- Frame1.Enabled = True
- StTab.TabEnabled(0) = False
- CzxsGrid.Enabled = False
- With SzToolbar
- .Buttons("ymsz").Enabled = False
- .Buttons("dy").Enabled = False
- .Buttons("yl").Enabled = False
- .Buttons("zj").Enabled = False
- .Buttons("cx").Enabled = False
- .Buttons("Bill").Enabled = False
- .Buttons("sx").Enabled = False
- .Buttons("fq").Enabled = True
- If Lrzt = 1 Then
- .Buttons("bc").Enabled = True
- Ydcommand1(1).Visible = True
- Else
- .Buttons("bc").Enabled = False
- Ydcommand1(1).Visible = False
- End If
- End With
- End Sub
- Private Sub Toolfbjzt() 'Toolbar状态(非编辑状态)
- StTab.TabEnabled(0) = True
- StTab.Tab = 0
- CzxsGrid.Enabled = True
- Frame1.Enabled = False
- StTab.TabEnabled(1) = False
- With SzToolbar
- If CzxsGrid.Rows = CzxsGrid.FixedRows Then
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- .Buttons("cx").Enabled = True
- .Buttons("Bill").Enabled = False
- .Buttons("zj").Enabled = True
- .Buttons("bc").Enabled = False
- .Buttons("fq").Enabled = False
- .Buttons("sx").Enabled = True
- Else
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- .Buttons("cx").Enabled = True
- .Buttons("Bill").Enabled = True
- .Buttons("zj").Enabled = True
- .Buttons("bc").Enabled = False
- .Buttons("fq").Enabled = False
- .Buttons("sx").Enabled = True
- End If
- End With
- End Sub
- Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CzxsGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CzxsGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(CzxsGrid, GridCode)
- End Select
- End Sub
- Private Sub bbyl(bbylte As Boolean) '报表打印预览
- Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
- Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
- Bbxbtgs = 1 '报 表 小 标 题 行 数
- Bbbwhgs = 0 '报 表 表 尾 行 数
- ReDim Bbxbt(1 To Bbxbtgs)
- ReDim bbxbtzzxs(1 To Bbxbtgs)
- If Bbbwhgs <> 0 Then
- ReDim Bbbwh(1 To Bbbwhgs)
- ReDim Bbbwhzzxs(1 To Bbbwhgs)
- End If
- Bbzbt = ReportTitle
- Bbxbt(1) = " "
- bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
- Call Scyxsjb(CzxsGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- '在此填写文本框录入事后处理程序
- Dim Rectemp As Recordset
- TextChangeLock = True
- If Index = 1 Then
- LrText(4).Text = ""
- XsGrid.Rows = XsGrid.FixedRows
- If Trim(LrText(Index)) = "" Then
- LrText(1).Tag = ""
- LrText(2).Text = ""
- LrText(2).Tag = ""
- LrText(3).Text = ""
- LrText(4).Text = ""
- XsGrid.Clear 1
- Else
- '显示存货名称、计划单价
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select mnumber,mname,model,planprice,InvSortCode from gy_material where mnumber ='" & Trim(LrText(1).Text) & "'")
- LrText(1).Tag = Trim(Rectemp.Fields("invsortcode") & "")
- LrText(2).Text = Trim(Rectemp.Fields("mname") & "")
- LrText(2).Tag = Trim(Rectemp.Fields("model") & "")
- LrText(3).Text = Rectemp.Fields("planprice")
- With XsGrid
- '显示结存
- Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select * from chhs_v_mate where kjyear=" & Xtyear & " and period=" & Xtmm & " and mnumber='" & Trim(LrText(1).Text) & "' and pricemode='计划价法' ")
- If Not Rectemp.EOF Then
- .Rows = .FixedRows
- Do While Not Rectemp.EOF
- .AddItem ""
- .RowHeight(.Rows - 1) = Sjhgd
- .TextMatrix(.Rows - 1, 0) = Trim(Rectemp.Fields("whcode"))
- .TextMatrix(.Rows - 1, 1) = Trim(Rectemp.Fields("whname"))
- .TextMatrix(.Rows - 1, 2) = Val(Rectemp.Fields("startquan")) + Val(Rectemp.Fields("inquan")) - Val(Rectemp.Fields("Outquan"))
- .TextMatrix(.Rows - 1, 3) = Val(Rectemp.Fields("startmoney")) + Val(Rectemp.Fields("inmoney")) - Val(Rectemp.Fields("Outmoney"))
- Rectemp.MoveNext
- Loop
- Else
- .Rows = .FixedRows
- End If
- End With
- End If
- End If
- Set Rectemp = Nothing
- TextChangeLock = False
- ']以上为依据实际情况自定义部分
- 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, 11 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9, 12 '数量型
- 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
- '计算现金额
- If Index = 4 Then
- With XsGrid
- For Jsqte = .FixedRows To .Rows - 1
- .TextMatrix(Jsqte, 4) = Format(Val(.TextMatrix(Jsqte, 2)) * Val(LrText(4)), "###0." + String(Xtjexsws, "0"))
- .TextMatrix(Jsqte, 5) = Val(.TextMatrix(Jsqte, 4)) - Val(.TextMatrix(Jsqte, 3))
- Next Jsqte
- End With
- End If
- 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
- 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
- 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
- '文本框内容为空认为有效,并清空其Tag值
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call Wbklrwbcl(Index)
- 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 '其他类型
- If Index = 4 Then
- If Val(LrText(3)) = Val(LrText(4)) Then
- Tsxx = "现计划价不能等于原计划价!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- End If
- End Select
- '如果有效则加锁,用户不改变内容则不再进行有效性判断
- TextValiJudgeLock(Index) = True
- '调用文本框事后处理程序
- Call Wbklrwbcl(Index)
- '有效性判断通过则返回True
- TextYxxpd = True
- End Function