上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:65k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form DJ_AdjustPlan 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "计划价调整"
  8.    ClientHeight    =   6555
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   9105
  12.    HelpContextID   =   13030503
  13.    Icon            =   "单据调整_计划价调整.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   6555
  19.    ScaleWidth      =   9105
  20.    StartUpPosition =   2  '屏幕中心
  21.    Begin TabDlg.SSTab StTab 
  22.       Height          =   5865
  23.       Left            =   30
  24.       TabIndex        =   0
  25.       Top             =   660
  26.       Width           =   9060
  27.       _ExtentX        =   15981
  28.       _ExtentY        =   10345
  29.       _Version        =   393216
  30.       Style           =   1
  31.       Tabs            =   2
  32.       TabHeight       =   520
  33.       TabCaption(0)   =   "列表视图"
  34.       TabPicture(0)   =   "单据调整_计划价调整.frx":1042
  35.       Tab(0).ControlEnabled=   -1  'True
  36.       Tab(0).Control(0)=   "CzxsGrid"
  37.       Tab(0).Control(0).Enabled=   0   'False
  38.       Tab(0).ControlCount=   1
  39.       TabCaption(1)   =   "单张视图"
  40.       TabPicture(1)   =   "单据调整_计划价调整.frx":105E
  41.       Tab(1).ControlEnabled=   0   'False
  42.       Tab(1).Control(0)=   "Frame1"
  43.       Tab(1).ControlCount=   1
  44.       Begin VB.Frame Frame1 
  45.          Height          =   5325
  46.          Left            =   -74880
  47.          TabIndex        =   1
  48.          Top             =   360
  49.          Width           =   8835
  50.          Begin VB.TextBox LrText 
  51.             Height          =   300
  52.             Index           =   5
  53.             Left            =   1650
  54.             TabIndex        =   17
  55.             Text            =   "5"
  56.             Top             =   2130
  57.             Width           =   6015
  58.          End
  59.          Begin VB.TextBox LrText 
  60.             Height          =   300
  61.             Index           =   4
  62.             Left            =   5190
  63.             TabIndex        =   7
  64.             Text            =   "4"
  65.             Top             =   1710
  66.             Width           =   2475
  67.          End
  68.          Begin VB.TextBox LrText 
  69.             Height          =   300
  70.             Index           =   3
  71.             Left            =   1650
  72.             TabIndex        =   6
  73.             Text            =   "3"
  74.             Top             =   1710
  75.             Width           =   2375
  76.          End
  77.          Begin VB.TextBox LrText 
  78.             Height          =   300
  79.             Index           =   2
  80.             Left            =   1650
  81.             TabIndex        =   5
  82.             Text            =   "2"
  83.             Top             =   1290
  84.             Width           =   6015
  85.          End
  86.          Begin VB.CommandButton Ydcommand1 
  87.             Height          =   300
  88.             Index           =   0
  89.             Left            =   7680
  90.             Picture         =   "单据调整_计划价调整.frx":107A
  91.             Style           =   1  'Graphical
  92.             TabIndex        =   4
  93.             Top             =   840
  94.             Visible         =   0   'False
  95.             Width           =   300
  96.          End
  97.          Begin VB.TextBox LrText 
  98.             Height          =   300
  99.             Index           =   1
  100.             Left            =   5190
  101.             TabIndex        =   3
  102.             Text            =   "1"
  103.             Top             =   840
  104.             Width           =   2475
  105.          End
  106.          Begin VB.TextBox LrText 
  107.             Height          =   300
  108.             Index           =   0
  109.             Left            =   1650
  110.             TabIndex        =   2
  111.             Text            =   "0"
  112.             Top             =   870
  113.             Width           =   2370
  114.          End
  115.          Begin VSFlex8Ctl.VSFlexGrid XsGrid 
  116.             Height          =   2535
  117.             Left            =   150
  118.             TabIndex        =   19
  119.             Top             =   2610
  120.             Width           =   8505
  121.             _cx             =   5080
  122.             _cy             =   5080
  123.             Appearance      =   1
  124.             BorderStyle     =   1
  125.             Enabled         =   -1  'True
  126.             BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  127.                Name            =   "宋体"
  128.                Size            =   9
  129.                Charset         =   134
  130.                Weight          =   400
  131.                Underline       =   0   'False
  132.                Italic          =   0   'False
  133.                Strikethrough   =   0   'False
  134.             EndProperty
  135.             MousePointer    =   0
  136.             BackColor       =   -2147483643
  137.             ForeColor       =   -2147483640
  138.             BackColorFixed  =   -2147483633
  139.             ForeColorFixed  =   -2147483630
  140.             BackColorSel    =   -2147483635
  141.             ForeColorSel    =   -2147483634
  142.             BackColorBkg    =   8421504
  143.             BackColorAlternate=   -2147483643
  144.             GridColor       =   -2147483633
  145.             GridColorFixed  =   -2147483632
  146.             TreeColor       =   -2147483632
  147.             FloodColor      =   192
  148.             SheetBorder     =   -2147483642
  149.             FocusRect       =   1
  150.             HighLight       =   1
  151.             AllowSelection  =   -1  'True
  152.             AllowBigSelection=   -1  'True
  153.             AllowUserResizing=   0
  154.             SelectionMode   =   0
  155.             GridLines       =   1
  156.             GridLinesFixed  =   2
  157.             GridLineWidth   =   1
  158.             Rows            =   5000
  159.             Cols            =   10
  160.             FixedRows       =   1
  161.             FixedCols       =   0
  162.             RowHeightMin    =   0
  163.             RowHeightMax    =   0
  164.             ColWidthMin     =   0
  165.             ColWidthMax     =   0
  166.             ExtendLastCol   =   0   'False
  167.             FormatString    =   ""
  168.             ScrollTrack     =   0   'False
  169.             ScrollBars      =   3
  170.             ScrollTips      =   0   'False
  171.             MergeCells      =   0
  172.             MergeCompare    =   0
  173.             AutoResize      =   -1  'True
  174.             AutoSizeMode    =   0
  175.             AutoSearch      =   0
  176.             AutoSearchDelay =   2
  177.             MultiTotals     =   -1  'True
  178.             SubtotalPosition=   1
  179.             OutlineBar      =   0
  180.             OutlineCol      =   0
  181.             Ellipsis        =   0
  182.             ExplorerBar     =   0
  183.             PicturesOver    =   0   'False
  184.             FillStyle       =   0
  185.             RightToLeft     =   0   'False
  186.             PictureType     =   0
  187.             TabBehavior     =   0
  188.             OwnerDraw       =   0
  189.             Editable        =   0
  190.             ShowComboButton =   1
  191.             WordWrap        =   0   'False
  192.             TextStyle       =   0
  193.             TextStyleFixed  =   0
  194.             OleDragMode     =   0
  195.             OleDropMode     =   0
  196.             DataMode        =   0
  197.             VirtualData     =   -1  'True
  198.             DataMember      =   ""
  199.             ComboSearch     =   3
  200.             AutoSizeMouse   =   -1  'True
  201.             FrozenRows      =   0
  202.             FrozenCols      =   0
  203.             AllowUserFreezing=   0
  204.             BackColorFrozen =   0
  205.             ForeColorFrozen =   0
  206.             WallPaperAlignment=   9
  207.             AccessibleName  =   ""
  208.             AccessibleDescription=   ""
  209.             AccessibleValue =   ""
  210.             AccessibleRole  =   24
  211.          End
  212.          Begin VB.Label TsLabel 
  213.             AutoSize        =   -1  'True
  214.             Caption         =   "备注:"
  215.             Height          =   195
  216.             Index           =   2
  217.             Left            =   1200
  218.             TabIndex        =   18
  219.             Top             =   2160
  220.             Width           =   405
  221.          End
  222.          Begin VB.Label Lab_Title 
  223.             AutoSize        =   -1  'True
  224.             BackColor       =   &H80000018&
  225.             BackStyle       =   0  'Transparent
  226.             Caption         =   "计划价调整"
  227.             BeginProperty Font 
  228.                Name            =   "宋体"
  229.                Size            =   15
  230.                Charset         =   134
  231.                Weight          =   700
  232.                Underline       =   0   'False
  233.                Italic          =   0   'False
  234.                Strikethrough   =   0   'False
  235.             EndProperty
  236.             ForeColor       =   &H00000000&
  237.             Height          =   300
  238.             Left            =   3480
  239.             TabIndex        =   16
  240.             Top             =   360
  241.             Width           =   1575
  242.          End
  243.          Begin VB.Label TsLabel 
  244.             AutoSize        =   -1  'True
  245.             Caption         =   "现计划价:"
  246.             Height          =   195
  247.             Index           =   5
  248.             Left            =   4320
  249.             TabIndex        =   12
  250.             Top             =   1740
  251.             Width           =   765
  252.          End
  253.          Begin VB.Label TsLabel 
  254.             AutoSize        =   -1  'True
  255.             Caption         =   "原计划价:"
  256.             Height          =   195
  257.             Index           =   4
  258.             Left            =   810
  259.             TabIndex        =   11
  260.             Top             =   1740
  261.             Width           =   765
  262.          End
  263.          Begin VB.Label TsLabel 
  264.             AutoSize        =   -1  'True
  265.             Caption         =   "存货名称:"
  266.             Height          =   195
  267.             Index           =   3
  268.             Left            =   810
  269.             TabIndex        =   10
  270.             Top             =   1350
  271.             Width           =   765
  272.          End
  273.          Begin VB.Label TsLabel 
  274.             AutoSize        =   -1  'True
  275.             Caption         =   "存货编码:"
  276.             Height          =   195
  277.             Index           =   1
  278.             Left            =   4320
  279.             TabIndex        =   9
  280.             Top             =   900
  281.             Width           =   765
  282.          End
  283.          Begin VB.Label TsLabel 
  284.             AutoSize        =   -1  'True
  285.             Caption         =   "调整日期:"
  286.             Height          =   195
  287.             Index           =   0
  288.             Left            =   810
  289.             TabIndex        =   8
  290.             Top             =   900
  291.             Width           =   765
  292.          End
  293.       End
  294.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  295.          Height          =   5325
  296.          Left            =   90
  297.          TabIndex        =   13
  298.          Top             =   420
  299.          Width           =   8835
  300.          _cx             =   5080
  301.          _cy             =   5080
  302.          Appearance      =   1
  303.          BorderStyle     =   1
  304.          Enabled         =   -1  'True
  305.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  306.             Name            =   "宋体"
  307.             Size            =   9
  308.             Charset         =   134
  309.             Weight          =   400
  310.             Underline       =   0   'False
  311.             Italic          =   0   'False
  312.             Strikethrough   =   0   'False
  313.          EndProperty
  314.          MousePointer    =   0
  315.          BackColor       =   -2147483643
  316.          ForeColor       =   -2147483640
  317.          BackColorFixed  =   -2147483633
  318.          ForeColorFixed  =   -2147483630
  319.          BackColorSel    =   -2147483635
  320.          ForeColorSel    =   -2147483634
  321.          BackColorBkg    =   8421504
  322.          BackColorAlternate=   -2147483643
  323.          GridColor       =   -2147483633
  324.          GridColorFixed  =   -2147483632
  325.          TreeColor       =   -2147483632
  326.          FloodColor      =   192
  327.          SheetBorder     =   -2147483642
  328.          FocusRect       =   1
  329.          HighLight       =   1
  330.          AllowSelection  =   -1  'True
  331.          AllowBigSelection=   -1  'True
  332.          AllowUserResizing=   0
  333.          SelectionMode   =   0
  334.          GridLines       =   1
  335.          GridLinesFixed  =   2
  336.          GridLineWidth   =   1
  337.          Rows            =   5000
  338.          Cols            =   10
  339.          FixedRows       =   1
  340.          FixedCols       =   0
  341.          RowHeightMin    =   0
  342.          RowHeightMax    =   0
  343.          ColWidthMin     =   0
  344.          ColWidthMax     =   0
  345.          ExtendLastCol   =   0   'False
  346.          FormatString    =   ""
  347.          ScrollTrack     =   0   'False
  348.          ScrollBars      =   3
  349.          ScrollTips      =   0   'False
  350.          MergeCells      =   0
  351.          MergeCompare    =   0
  352.          AutoResize      =   -1  'True
  353.          AutoSizeMode    =   0
  354.          AutoSearch      =   0
  355.          AutoSearchDelay =   2
  356.          MultiTotals     =   -1  'True
  357.          SubtotalPosition=   1
  358.          OutlineBar      =   0
  359.          OutlineCol      =   0
  360.          Ellipsis        =   0
  361.          ExplorerBar     =   0
  362.          PicturesOver    =   0   'False
  363.          FillStyle       =   0
  364.          RightToLeft     =   0   'False
  365.          PictureType     =   0
  366.          TabBehavior     =   0
  367.          OwnerDraw       =   0
  368.          Editable        =   0
  369.          ShowComboButton =   1
  370.          WordWrap        =   0   'False
  371.          TextStyle       =   0
  372.          TextStyleFixed  =   0
  373.          OleDragMode     =   0
  374.          OleDropMode     =   0
  375.          DataMode        =   0
  376.          VirtualData     =   -1  'True
  377.          DataMember      =   ""
  378.          ComboSearch     =   3
  379.          AutoSizeMouse   =   -1  'True
  380.          FrozenRows      =   0
  381.          FrozenCols      =   0
  382.          AllowUserFreezing=   0
  383.          BackColorFrozen =   0
  384.          ForeColorFrozen =   0
  385.          WallPaperAlignment=   9
  386.          AccessibleName  =   ""
  387.          AccessibleDescription=   ""
  388.          AccessibleValue =   ""
  389.          AccessibleRole  =   24
  390.       End
  391.    End
  392.    Begin MSComctlLib.Toolbar SzToolbar 
  393.       Align           =   1  'Align Top
  394.       Height          =   555
  395.       Left            =   0
  396.       TabIndex        =   14
  397.       Top             =   0
  398.       Width           =   9105
  399.       _ExtentX        =   16060
  400.       _ExtentY        =   979
  401.       ButtonWidth     =   820
  402.       ButtonHeight    =   926
  403.       AllowCustomize  =   0   'False
  404.       Appearance      =   1
  405.       Style           =   1
  406.       ImageList       =   "ImageList1"
  407.       _Version        =   393216
  408.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  409.          NumButtons      =   16
  410.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  411.             Caption         =   "设置"
  412.             Key             =   "ymsz"
  413.             ImageKey        =   "sz"
  414.          EndProperty
  415.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  416.             Caption         =   "打印"
  417.             Key             =   "dy"
  418.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  419.             ImageKey        =   "dy"
  420.          EndProperty
  421.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  422.             Caption         =   "预览"
  423.             Key             =   "yl"
  424.             ImageKey        =   "yl"
  425.          EndProperty
  426.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  427.             Style           =   3
  428.          EndProperty
  429.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  430.             Caption         =   "查询"
  431.             Key             =   "cx"
  432.             ImageKey        =   "cx"
  433.          EndProperty
  434.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  435.             Caption         =   "单据"
  436.             Key             =   "Bill"
  437.             ImageKey        =   "Bill"
  438.          EndProperty
  439.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  440.             Style           =   4
  441.          EndProperty
  442.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  443.             Caption         =   "增加"
  444.             Key             =   "zj"
  445.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  446.             ImageKey        =   "xz"
  447.          EndProperty
  448.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  449.             Style           =   4
  450.          EndProperty
  451.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  452.             Caption         =   "保存"
  453.             Key             =   "bc"
  454.             ImageKey        =   "bc"
  455.          EndProperty
  456.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  457.             Caption         =   "放弃"
  458.             Key             =   "fq"
  459.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  460.             ImageKey        =   "fq"
  461.          EndProperty
  462.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  463.             Style           =   3
  464.          EndProperty
  465.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  466.             Caption         =   "刷新"
  467.             Key             =   "sx"
  468.             ImageKey        =   "sx"
  469.          EndProperty
  470.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  471.             Style           =   3
  472.          EndProperty
  473.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  474.             Caption         =   "帮助"
  475.             Key             =   "bz"
  476.             ImageKey        =   "bz"
  477.          EndProperty
  478.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  479.             Caption         =   "退出"
  480.             Key             =   "fh"
  481.             ImageKey        =   "tc"
  482.          EndProperty
  483.       EndProperty
  484.       BorderStyle     =   1
  485.       Begin MSComctlLib.Toolbar GsToolbar 
  486.          Height          =   525
  487.          Left            =   6600
  488.          TabIndex        =   15
  489.          Top             =   0
  490.          Width           =   2475
  491.          _ExtentX        =   4366
  492.          _ExtentY        =   926
  493.          ButtonWidth     =   1455
  494.          ButtonHeight    =   926
  495.          AllowCustomize  =   0   'False
  496.          Appearance      =   1
  497.          Style           =   1
  498.          ImageList       =   "ImageList1"
  499.          _Version        =   393216
  500.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  501.             NumButtons      =   3
  502.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  503.                Caption         =   "保存格式"
  504.                Key             =   "bcgs"
  505.                ImageKey        =   "bcgs"
  506.             EndProperty
  507.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  508.                Caption         =   "默认列宽"
  509.                Key             =   "hfmrgs"
  510.                ImageKey        =   "mrlk"
  511.             EndProperty
  512.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  513.                Caption         =   "显示项目"
  514.                Key             =   "szxsxm"
  515.                ImageKey        =   "xsxm"
  516.             EndProperty
  517.          EndProperty
  518.       End
  519.    End
  520.    Begin MSComctlLib.ImageList ImageList1 
  521.       Left            =   0
  522.       Top             =   420
  523.       _ExtentX        =   1005
  524.       _ExtentY        =   1005
  525.       BackColor       =   -2147483643
  526.       ImageWidth      =   16
  527.       ImageHeight     =   16
  528.       MaskColor       =   12632256
  529.       _Version        =   393216
  530.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  531.          NumListImages   =   30
  532.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  533.             Picture         =   "单据调整_计划价调整.frx":1404
  534.             Key             =   "sz"
  535.          EndProperty
  536.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  537.             Picture         =   "单据调整_计划价调整.frx":179E
  538.             Key             =   "dy"
  539.          EndProperty
  540.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  541.             Picture         =   "单据调整_计划价调整.frx":1B38
  542.             Key             =   "yl"
  543.          EndProperty
  544.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  545.             Picture         =   "单据调整_计划价调整.frx":1ED2
  546.             Key             =   "xg"
  547.          EndProperty
  548.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  549.             Picture         =   "单据调整_计划价调整.frx":226C
  550.             Key             =   "zh"
  551.          EndProperty
  552.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  553.             Picture         =   "单据调整_计划价调整.frx":2606
  554.             Key             =   "sh"
  555.          EndProperty
  556.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  557.             Picture         =   "单据调整_计划价调整.frx":29A0
  558.             Key             =   "bc"
  559.          EndProperty
  560.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  561.             Picture         =   "单据调整_计划价调整.frx":2D3A
  562.             Key             =   "fq"
  563.          EndProperty
  564.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  565.             Picture         =   "单据调整_计划价调整.frx":30D4
  566.             Key             =   "bz"
  567.          EndProperty
  568.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  569.             Picture         =   "单据调整_计划价调整.frx":346E
  570.             Key             =   "tc"
  571.          EndProperty
  572.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  573.             Picture         =   "单据调整_计划价调整.frx":3808
  574.             Key             =   "bcgs"
  575.          EndProperty
  576.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  577.             Picture         =   "单据调整_计划价调整.frx":3BA2
  578.             Key             =   "mrlk"
  579.          EndProperty
  580.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  581.             Picture         =   "单据调整_计划价调整.frx":3F3C
  582.             Key             =   "xsxm"
  583.          EndProperty
  584.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  585.             Picture         =   "单据调整_计划价调整.frx":42D6
  586.             Key             =   "first"
  587.          EndProperty
  588.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  589.             Picture         =   "单据调整_计划价调整.frx":4670
  590.             Key             =   "prev"
  591.          EndProperty
  592.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  593.             Picture         =   "单据调整_计划价调整.frx":4A0A
  594.             Key             =   "next"
  595.          EndProperty
  596.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  597.             Picture         =   "单据调整_计划价调整.frx":4DA4
  598.             Key             =   "last"
  599.          EndProperty
  600.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  601.             Picture         =   "单据调整_计划价调整.frx":513E
  602.             Key             =   "xx"
  603.          EndProperty
  604.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  605.             Picture         =   "单据调整_计划价调整.frx":54D8
  606.             Key             =   "define"
  607.          EndProperty
  608.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  609.             Picture         =   "单据调整_计划价调整.frx":5872
  610.             Key             =   "exec"
  611.          EndProperty
  612.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  613.             Picture         =   "单据调整_计划价调整.frx":5C0C
  614.             Key             =   "xz"
  615.          EndProperty
  616.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  617.             Picture         =   "单据调整_计划价调整.frx":5FA6
  618.             Key             =   "sc"
  619.          EndProperty
  620.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  621.             Picture         =   "单据调整_计划价调整.frx":6340
  622.             Key             =   "sx"
  623.          EndProperty
  624.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  625.             Picture         =   "单据调整_计划价调整.frx":66DA
  626.             Key             =   "cx"
  627.          EndProperty
  628.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  629.             Picture         =   "单据调整_计划价调整.frx":6A74
  630.             Key             =   "zd"
  631.          EndProperty
  632.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  633.             Picture         =   "单据调整_计划价调整.frx":6E0E
  634.             Key             =   "dz"
  635.          EndProperty
  636.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  637.             Picture         =   "单据调整_计划价调整.frx":71A8
  638.             Key             =   "ph"
  639.          EndProperty
  640.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  641.             Picture         =   "单据调整_计划价调整.frx":7542
  642.             Key             =   "fz"
  643.          EndProperty
  644.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  645.             Picture         =   "单据调整_计划价调整.frx":78DC
  646.             Key             =   "dw"
  647.          EndProperty
  648.          BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  649.             Picture         =   "单据调整_计划价调整.frx":7C76
  650.             Key             =   "Bill"
  651.          EndProperty
  652.       EndProperty
  653.    End
  654. End
  655. Attribute VB_Name = "DJ_AdjustPlan"
  656. Attribute VB_GlobalNameSpace = False
  657. Attribute VB_Creatable = False
  658. Attribute VB_PredeclaredId = True
  659. Attribute VB_Exposed = False
  660. '**********************************************************
  661. '*    模 块 名 称 :计划价调整
  662. '*    功 能 描 述 :调整存货的计划单价
  663. '*    程序员姓名  :白凤英
  664. '*    最后修改人  :白凤英
  665. '*    最后修改时间:2001/12/11
  666. '*    备        注:
  667. '**********************************************************
  668. Dim BillCode As String                   '单据设计编码(索引号)
  669. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  670. Dim jdzygs As Integer                    '控件焦点转移个数
  671. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  672. Dim ReportTitle As String                '报表主标题
  673. Public Str_QueryCondi As String          '单据组查询条件(接收查询条件)
  674. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  675.   
  676. '以下为固定使用变量(网格)
  677. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  678. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  679. Dim GridCode As String                   '显示网格网格代码
  680. Dim GridInf() As Variant                 '整个网格设置信息
  681. Dim Tsxx As String                       '系统提示信息
  682. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  683. Dim Sjhgd As Double                      '网格数据行高度
  684. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  685. Dim GridStr()  As String                 '网格列信息(字符型)
  686. Dim GridInt() As Integer                 '网格列信息(整型)
  687. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  688. '以下为固定使用变量(文本框)
  689. Dim Textvar() As Variant                 '存储变体型文本框信息
  690. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  691. Dim Textint() As Integer                 '存储整型文本框信息
  692. Dim Textstr() As String                  '存储字符型文本框信息
  693. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  694. Dim TextGroupCode As String              '文本框录入分组编码
  695. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  696. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  697. Dim CurTextIndex As Integer              '当前文本框索引值
  698. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  699. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  700. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  701.     jdzygs = 10
  702.     
  703.     Select Case KeyAscii
  704.         Case vbKeyReturn
  705.             If Kjjdzy(jdzygs) Then
  706.                 KeyAscii = 0
  707.             End If
  708.         Case 39           '屏蔽"'"
  709.             KeyAscii = 0
  710.     End Select
  711.    
  712. End Sub
  713. Private Sub Form_Load()
  714.   
  715.     '打印报表标题信息
  716.     ReportTitle = "计划价调整列表"
  717.      
  718.     '调入打印页面设置窗体
  719.     XtReportCode = "Chhs_AdjustPlan"
  720.     Load Dyymctbl
  721.     
  722.     BillCode = "1303"
  723.     
  724.     '以下为文本框处理程序(读入文本框录入信息)
  725.     TextGroupCode = "Chhs_AdjustPlan"
  726.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  727.     Call Wbkcsh
  728.     
  729.     '调入显示网格设置信息
  730.     GridCode = "Chhs_AdjustPlan"
  731.     Call BzWgcsh(XsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  732.     XsGridQslz = GridInf(1)
  733.     
  734.     '调入列表网格设置信息
  735.     GridCode = "Chhs_AdjustPlanList"
  736.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  737.     Qslz = GridInf(1)
  738.     Sjhgd = GridInf(2)
  739.     Szzls = CzxsGrid.Cols - 1
  740.     
  741.     '设置查询条件
  742.     Str_QueryCondi = " kjyear=" & PGKjYear & " and period=" & PGNowmon
  743.     
  744.     '填 充 网 格
  745.     Call Cxnrtcwg
  746.        
  747.     If Xtcdcs = "1" Then
  748.         '初始化ToolBar,Tab卡状态
  749.         StTab.Tab = 0
  750.         StTab.TabEnabled(1) = False
  751.         Frame1.Enabled = False
  752.         
  753.         '设置为非录入状态
  754.         Lrzt = 0
  755.         
  756.         '调整工具条状态
  757.         Call Toolfbjzt
  758.     Else
  759.         '初始化ToolBar,Tab卡状态
  760.         StTab.Tab = 1
  761.         StTab.TabEnabled(0) = False
  762.         Frame1.Enabled = True
  763.         Lrzt = 2
  764.         Call Toolbjzt
  765.         Call Cshlrxx(Lrzt, Val(Xtcdcsfz))
  766.         LrText(0).Enabled = False
  767.         LrText(1).Enabled = False
  768.         LrText(2).Enabled = False
  769.         LrText(3).Enabled = False
  770.         LrText(4).Enabled = False
  771.         LrText(5).Enabled = False
  772.         GsToolbar.Visible = False
  773.         SzToolbar.Buttons("fq").Enabled = False
  774.     End If
  775.     
  776.     '编辑(新增、修改、删除)权限索引
  777.     Str_RightEdit = "Chhs_PlanAdjustEdit"
  778.     
  779.  End Sub
  780.  
  781. Private Sub Cxnrtcwg()                               '查询内容填充网格
  782.     Dim SqlStr As String              '查询连接串
  783.     Dim Jsqte As Long                 '查询临时使用变量
  784.   
  785.     '为加快显示速度,将网格刷新动作冻结
  786.     CzxsGrid.Redraw = False
  787.   
  788.     '[>>查询连接串
  789.     SqlStr = "SELECT DISTINCT PlanAdjustMainId, BillDate, MNumber, MName, Model FROM Chhs_V_AdjustPlan a WHERE " & Str_QueryCondi & " order by a.Mnumber,a.billdate"
  790.     '<<]
  791.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  792.     
  793.     With Cxnrrec
  794.         CzxsGrid.Rows = CzxsGrid.FixedRows
  795.         If .EOF And .BOF Then
  796.             CzxsGrid.Redraw = True
  797.             Exit Sub
  798.         End If
  799.         Jsqte = CzxsGrid.FixedRows
  800.         Do While Not .EOF
  801.             CzxsGrid.AddItem ""
  802.             Call Jltcwg(Cxnrrec, Jsqte)                              '调入填充网格子过程
  803.             CzxsGrid.RowHeight(Jsqte) = Sjhgd                        '设置网格高度
  804.             .MoveNext
  805.             Jsqte = Jsqte + 1
  806.         Loop
  807.     End With
  808.   
  809.     '将网格刷新动作解冻
  810.     CzxsGrid.Redraw = True
  811.     
  812. End Sub
  813. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  814.     '[>>以下为自定义部分
  815.     With Jlbrec
  816.        
  817.         CzxsGrid.TextMatrix(Rowjsq, 0) = Trim(.Fields("PlanAdjustMainId") & "")            '主表ID
  818.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("Mnumber") & "")          '存货编码
  819.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Mname") & "")            '存货名称
  820.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Model") & "")            '规格型号
  821.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Format(Trim(.Fields("BillDate") & ""), "yyyy-mm-dd")          '调整日期
  822.        
  823.     End With
  824.     '以上为自定义部分<<]
  825.     
  826. End Sub
  827. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  828.     Set Cxnrrec = Nothing
  829.     Set Rec_CodeSet = Nothing
  830.     Unload Dyymctbl
  831.     
  832.     '用户退出时写上机日志
  833.     Security_Log "Chhs_AdjustPlan", Xtczybm, 2, False
  834.    
  835. End Sub
  836. Private Function Sub_SaveBill() As Boolean                                   '保 存 单 据
  837.   
  838.     Dim Rectemp As New ADODB.Recordset                    '临时使用动态集
  839.     Dim Rec_VouchMain As New ADODB.Recordset              '单据主表动态集
  840.     Dim Rec_VouchSub As New ADODB.Recordset               '单据子表动态集
  841.     Dim Rec_List As New ADODB.Recordset                   '明细帐表动态集
  842.     Dim Rec_Mate As New ADODB.Recordset                   '总帐表动态集
  843.     Dim Rowjsq As Long                                    '网格行计数器
  844.     Dim Coljsq As Long                                    '网格列计数器
  845.     Dim Jsqte As Integer                                  '临时计数器
  846.     Dim Lng_RowCount As Long                              '有效数据行计数器
  847.     Dim Lrywlz As Long                                    '录入有误列值
  848.     Dim NewMainId As Integer                              '主表ID
  849.     Dim mPeriod As Integer                                '当前会计期间
  850.     
  851.     Sub_SaveBill = False
  852.   
  853.     '如果文本框处于编辑状态,则先进性文本框的有效性判断
  854.     If Not TextYxxpd(1) Then
  855.        Sub_SaveBill = False
  856.        Exit Function
  857.     End If
  858.     
  859.     If Not TextYxxpd(4) Then
  860.        Sub_SaveBill = False
  861.        Exit Function
  862.     End If
  863.     
  864.     '一.============先对单据内容进行有效性判断==============='
  865.   
  866.     '先进行字段不能为空或不能为零有效性判断(Fixed)
  867.     For Jsqte = 0 To Max_Text_Index
  868.         If Textint(Jsqte, 8) = 1 Then     '字段不能为空
  869.             If Len(Trim(LrText(Jsqte).Text)) = 0 Then
  870.                 Tsxx = Textstr(Jsqte, 7) & "不能为空!"
  871.                 Call Xtxxts(Tsxx, 0, 1)
  872.                 LrText(Jsqte).SetFocus
  873.                 Exit Function
  874.             End If
  875.         Else
  876.             If Textint(Jsqte, 8) = 2 Then   '字段不能为零
  877.                 If Val(Trim(LrText(Jsqte).Text)) = 0 Then
  878.                     Tsxx = Textstr(Jsqte, 7) & "不能为零!"
  879.                     Call Xtxxts(Tsxx, 0, 1)
  880.                     LrText(Jsqte).SetFocus
  881.                     Exit Function
  882.                 End If
  883.             End If
  884.         End If
  885.     Next Jsqte
  886.     
  887.     '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
  888.     For Jsqte = 0 To Max_Text_Index
  889.         If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
  890.             If Not TextYxxpd(Jsqte) Then
  891.                 Call TextShow(Jsqte)
  892.                 Exit Function
  893.             End If
  894.         End If
  895.     Next Jsqte
  896.   
  897.     '[>>
  898.   
  899.     '可在此区域写入其他对单据表头内容的有效性判断.
  900.     
  901.     '<<]
  902.   
  903.     '[>>下面将对所有有效数据行进行有效性判断
  904.   
  905.     Lng_RowCount = 0
  906.   
  907.     With XsGrid
  908.         For Rowjsq = .FixedRows To .Rows - 1
  909.             
  910.            '1.首先进行为空或为零判断(Fixed)
  911.            For Jsqte = Qslz To .Cols - 1
  912.             
  913.                 '字段不能为空
  914.                 If GridInt(Jsqte, 5) = 1 Then
  915.                     If Len(Trim(.TextMatrix(Rowjsq, Jsqte))) = 0 Then
  916.                         Tsxx = GridStr(Jsqte, 2)
  917.                         Lrywlz = Jsqte
  918.                         GoTo Lrcwcl
  919.                         Exit For
  920.                     End If
  921.                 End If
  922.                 
  923.                 '字段不能为零
  924.                 If GridInt(Jsqte, 5) = 2 Then
  925.                     If Val(Trim(.TextMatrix(Rowjsq, Jsqte))) = 0 Then
  926.                         Tsxx = GridStr(Jsqte, 2)
  927.                         Lrywlz = Jsqte
  928.                         GoTo Lrcwcl
  929.                         Exit For
  930.                     End If
  931.                 End If
  932.             Next Jsqte
  933.            
  934.         Next Rowjsq
  935.         
  936.         '[>>
  937.         '此处可以定义整张单据不能通过有效性检查的理由
  938.         '<<]
  939.     End With  '网格
  940.    
  941.    
  942.     '二.=============如果以上有效性检查均顺利通过,则执行存盘动作============'
  943.    
  944.     mPeriod = PGNowmon
  945.     
  946.     '对存盘进行事务处理(Fixed)
  947.     On Error GoTo Swcwcl
  948.     Cw_DataEnvi.DataConnect.BeginTrans
  949.     
  950.     '判断单据状态以进行不同处理
  951.     
  952.     '1.先对单据主表进行处理
  953.     
  954.     '开始存盘
  955.      
  956.     '打开单据主表动态集
  957.     If Rec_VouchMain.State = 1 Then Rec_VouchMain.Close
  958.     Rec_VouchMain.Open "Select * From Chhs_PlanAdjustMain Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  959.          
  960.     With Rec_VouchMain
  961.         .AddNew
  962.         .Fields("PlanAdjustMainId") = CreatBillID(BillCode)                              'Id号
  963.         .Fields("BillCode") = BillCode                                                   '单据编号
  964.         .Fields("BillDate") = CDate(LrText(0).Text)                                      '日期
  965.         .Fields("Mnumber") = Trim(LrText(1).Text)                                        '仓库
  966.         .Fields("AdjustBeforePrice") = Val(LrText(3).Text)                               '调整前计划单价
  967.         .Fields("AdjustAfterPrice") = Val(LrText(4).Text)                                '调整后计划单价
  968.         .Fields("Remark") = Trim(LrText(5).Text)                                         '备注
  969.         .Fields("kjyear") = Xtyear
  970.         .Fields("period") = mPeriod
  971.         .Update
  972.         
  973.         NewMainId = .Fields("PlanAdjustMainId")
  974.     End With
  975.     Set Rec_VouchMain = Nothing
  976.          
  977.     '2.对单据子表进行处理
  978.          
  979.     '打开单据子表动态集
  980.     If Rec_VouchSub.State = 1 Then Rec_VouchSub.Close
  981.     Rec_VouchSub.Open "Select * From Chhs_PlanAdjustSub Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  982.     
  983.     '将网格中有效数据行写入单据子表
  984.     For Rowjsq = XsGrid.FixedRows To XsGrid.Rows - 1
  985.         
  986.         With Rec_VouchSub
  987.             .AddNew
  988.             .Fields("PlanAdjustSubId") = Rowjsq - XsGrid.FixedRows + 1                           'Id号
  989.             .Fields("PlanAdjustMainId") = NewMainId                                              '主表ID
  990.             .Fields("Whcode") = Trim(XsGrid.TextMatrix(Rowjsq, 0))                               '仓库
  991.             .Fields("Quan") = Val(XsGrid.TextMatrix(Rowjsq, 2)) + 0                                '数量
  992.             .Update
  993.         End With
  994.         
  995.         '期末处理差异,差额入明细帐
  996.         If Qmclcy Then
  997.             
  998.             If Rec_List.State = 1 Then Rec_List.Close
  999.             Rec_List.Open "select * from chhs_list where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1000.             With Rec_List
  1001.                   .AddNew
  1002.                  .Fields("billnum") = CreatBillCode(BillCode, True, , Trim(XsGrid.TextMatrix(Rowjsq, 0)))
  1003.                  .Fields("inoutadjustmainid") = NewMainId
  1004.                  .Fields("inoutadjustsubid") = Rowjsq - XsGrid.FixedRows + 1
  1005.                  .Fields("billdate") = Xtrq
  1006.                  .Fields("chalkdate") = Xtrq
  1007.                  .Fields("kjyear") = Xtyear
  1008.                  .Fields("period") = mPeriod
  1009.                  .Fields("billcode") = BillCode
  1010.                  .Fields("maker") = Xtczy
  1011.                  .Fields("chalkitupman") = Xtczy
  1012.                  .Fields("whcode") = Trim(XsGrid.TextMatrix(Rowjsq, 0))
  1013.                  .Fields("mnumber") = Trim(LrText(1).Text)
  1014.                  .Fields("inoutadjustmainid") = NewMainId
  1015.                  .Fields("inoutadjustsubid") = Rowjsq - XsGrid.FixedRows + 1
  1016.                 '存货科目
  1017.                 Xtfhcs = ""
  1018.                 Xtfhcsfz = ""
  1019.                 Call MaccCode(Trim(.Fields("whcode")), Trim(LrText(1).Text), Trim(LrText(1).Tag))
  1020.                 .Fields("mateacct") = Xtfhcs
  1021.                 .Fields("diffacct") = Xtfhcsfz
  1022.                 
  1023.                 '对方科目
  1024.                 Xtfhcs = ""
  1025.                 Call DfaccCode("", "", Trim(LrText(1).Tag), Trim(LrText(1).Text))
  1026.                 .Fields("dfacct") = Xtfhcs
  1027.                 
  1028.                 
  1029.                 '现价>原价按入库单调整入帐,否则按出库单调整入帐
  1030.                 If Val(LrText(4).Text) > Val(LrText(3).Text) Then
  1031.                     .Fields("inoutflag") = 1
  1032.                     .Fields("inmoney") = Val(XsGrid.TextMatrix(Rowjsq, 5))
  1033.                     .Fields("dfdiff") = Val(XsGrid.TextMatrix(Rowjsq, 5))
  1034.                 Else
  1035.                     .Fields("inoutflag") = 0
  1036.                     .Fields("outmoney") = Abs((XsGrid.TextMatrix(Rowjsq, 5)))
  1037.                     .Fields("jfdiff") = Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
  1038.                 End If
  1039.                 .UpdateBatch
  1040.             End With
  1041.             Set Rec_List = Nothing
  1042.             '调整总帐
  1043.             If Rec_Mate.State = 1 Then Rec_Mate.Close
  1044.             Rec_Mate.Open "select * from chhs_mate where kjyear=" & Xtyear & " and period=" & mPeriod & _
  1045.                     " and whcode='" & Trim(XsGrid.TextMatrix(Rowjsq, 0)) & "'" & _
  1046.                     " and mnumber='" & Trim(LrText(1).Text) & "'", _
  1047.                     Cw_DataEnvi.DataConnect, adOpenDynamic, adLockBatchOptimistic
  1048.             If Not Rec_Mate.EOF Then
  1049.                 If Val(LrText(4).Text) > Val(LrText(3).Text) Then
  1050.                     Rec_Mate.Fields("inmoney") = Rec_Mate.Fields("inmoney") + Val(XsGrid.TextMatrix(Rowjsq, 5))
  1051.                     Rec_Mate.Fields("dfdiff") = Rec_Mate.Fields("dfdiff") + Val(XsGrid.TextMatrix(Rowjsq, 5))
  1052.                     If Rec_Mate.Fields("inquan") <> 0 Then
  1053.                         Rec_Mate.Fields("inprice") = Rec_Mate.Fields("inmoney") / Rec_Mate.Fields("inquan")
  1054.                     End If
  1055.                 Else
  1056.                     Rec_Mate.Fields("outmoney") = Rec_Mate.Fields("outmoney") + Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
  1057.                     Rec_Mate.Fields("jfdiff") = Rec_Mate.Fields("jfdiff") + Abs(Val(XsGrid.TextMatrix(Rowjsq, 5)))
  1058.                     If Rec_Mate.Fields("outquan") <> 0 Then
  1059.                         Rec_Mate.Fields("outprice") = Rec_Mate.Fields("outmoney") / Rec_Mate.Fields("outquan")
  1060.                     End If
  1061.                 End If
  1062.                 Rec_Mate.UpdateBatch
  1063.             End If
  1064.             Set Rec_Mate = Nothing
  1065.         End If
  1066.     Next Rowjsq
  1067.     
  1068.     '修改存货计划单价
  1069.     Cw_DataEnvi.DataConnect.Execute ("update Gy_material set planprice=" & Val(LrText(4).Text) & " where mnumber='" & Trim(LrText(1).Text) & "'")
  1070.     
  1071.     '修改收发记录表中未记帐单据的计划单价
  1072.     SqlStr = "SELECT Gy_InOutMain.InoutFlag,Gy_InOutMain.InOutMainId, Gy_InOutSub.InOutSubId," & _
  1073.         "Gy_InOutSub.FactReceiptQuan,Gy_InOutSub.FactIssueQuan, Gy_InOutSub.PlanPrice, " & _
  1074.         "Gy_InOutSub.PlanMoney,Gy_InOutMain.ChalkitupMan , Gy_InOutMain.KjYear,  " & _
  1075.         "Gy_InOutMain.Period FROM Gy_InOutMain INNER JOIN Gy_InOutSub ON " & _
  1076.         "Gy_InOutMain.InOutMainId = Gy_InOutSub.InOutMainId LEFT OUTER JOIN " & _
  1077.         "Gy_Warehouse ON Gy_InOutMain.WhCode = Gy_Warehouse.WhCode " & _
  1078.         "WHERE (Gy_Warehouse.PriceMode = '计划价法') AND Gy_InOutMain.ChalkitupMan='' " & _
  1079.         "AND Gy_InOutMain.BillCode<>'1211' AND kjYear=" & Xtyear & " and Period>=" & mPeriod & _
  1080.         "AND (Gy_InOutSub.MNumber = '" & Trim(LrText(1).Text) & "' )"
  1081.     Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1082.     Do While Not Rectemp.EOF
  1083.         If Rectemp.Fields("InoutFlag") And Qmclcy Then
  1084.             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")
  1085.         Else
  1086.             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")
  1087.         End If
  1088.         Cw_DataEnvi.DataConnect.Execute (SqlStr)
  1089.         Rectemp.MoveNext
  1090.     Loop
  1091.     
  1092.     Cw_DataEnvi.DataConnect.CommitTrans
  1093.     
  1094.     '将记录加入网格
  1095.     SqlStr = "SELECT top 1 * FROM Chhs_V_AdjustPlan order by planadjustmainid desc"
  1096.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1097.     
  1098.     With CzxsGrid
  1099.         .AddItem ""
  1100.         .RowHeight(.Rows - 1) = Sjhgd
  1101.         .Select .Rows - 1, Qslz
  1102.         Call Jltcwg(Cxnrrec, .Rows - 1)
  1103.     End With
  1104.     
  1105.     Sub_SaveBill = True
  1106.     Tsxx = "单据存盘完毕!"
  1107.     Call Xtxxts(Tsxx, 0, 4)
  1108.     Call Sub_Abandon
  1109.     
  1110.     Exit Function
  1111. Swcwcl:       '数据存盘时出现错误
  1112.     Cw_DataEnvi.DataConnect.RollbackTrans
  1113.     With XsGrid
  1114.         If Err.Number = -2147217887 Then
  1115.             Tsxx = "现计划单价超出允许范围!"
  1116.             Call Xtxxts(Tsxx, 0, 1)
  1117.             Changelock = True
  1118.             LrText(4).SetFocus
  1119.             Changelock = False
  1120.             Exit Function
  1121.         Else
  1122.             Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
  1123.             Call Xtxxts(Tsxx, 0, 1)
  1124.             Exit Function
  1125.         End If
  1126.     End With
  1127. Lrcwcl:        '录入错误处理(存盘前逐行有效性判断)
  1128.     With XsGrid
  1129.         Call Xtxxts("(第 " & Trim(Str(Rowjsq - .FixedRows + 1)) & " 条单据分录)-" & Tsxx, 0, 1)
  1130.         Changelock = True
  1131.         .Select Rowjsq, Lrywlz
  1132.         XsGrid.SetFocus
  1133.         Changelock = False
  1134.         Exit Function
  1135.     End With
  1136. End Function
  1137. Private Function Cshlrxx(lrztxx As Integer, MainId As Integer) As Boolean              '初始化录入字段信息
  1138.     TextChangeLock = True       '关闭文本框Chang事件
  1139.     Dim Rectemp As Recordset
  1140.     
  1141.     If lrztxx = 1 Then
  1142.     
  1143.         '增加新记录时将文本框清空
  1144.         For Jsqte = 0 To Max_Text_Index
  1145.             If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  1146.                 LrText(Jsqte).Text = ""
  1147.                 LrText(Jsqte).Tag = ""
  1148.             End If
  1149.             TextValiJudgeLock(Jsqte) = True
  1150.         Next Jsqte
  1151.        
  1152.         '[>>
  1153.         '在此处可添加新增记录时初始化设置
  1154.         '<<]
  1155.     Else
  1156.     
  1157.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1158.         
  1159.         SqlStr = "SELECT * FROM Chhs_V_AdjustPlan Where PlanAdjustMainId='" & MainId & "'"
  1160.         Set Rectemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1161.        
  1162.          With Rectemp
  1163.            '记录如存在则读入其内容,否则提示记录已被其他人删除
  1164.             If Not .EOF Then
  1165.                 LrText(0).Text = Format(Trim(.Fields("billdate") & ""), "yyyy-mm-dd")               '日期
  1166.                 LrText(1).Text = Trim(.Fields("mnumber") & "")               '存货编码
  1167.                 LrText(2).Text = Trim(.Fields("mname") & "")                 '存货名称
  1168.                 LrText(3).Text = .Fields("adjustbeforeprice")                '调整前计划单价
  1169.                 LrText(4).Text = .Fields("adjustafterprice")                 '调整后计划单价
  1170.                 LrText(5).Text = Trim(.Fields("remark") & "")                '备注
  1171.                 
  1172.                 '填充网格
  1173.                 If Trim(.Fields("whcode")) <> "" Then
  1174.                     Do While Not .EOF
  1175.                         XsGrid.AddItem ""
  1176.                         XsGrid.RowHeight(XsGrid.Rows - 1) = Sjhgd
  1177.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 0) = Trim(.Fields("whcode"))
  1178.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 1) = Trim(.Fields("whname"))
  1179.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 2) = Trim(.Fields("quan"))
  1180.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 3) = Val(.Fields("adjustbeforeprice")) * Val(.Fields("quan"))
  1181.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 4) = Val(.Fields("adjustafterprice")) * Val(.Fields("quan"))
  1182.                         XsGrid.TextMatrix(XsGrid.Rows - 1, 5) = (Val(.Fields("adjustafterprice")) - Val(.Fields("adjustbeforeprice"))) * Val(.Fields("quan"))
  1183.                         .MoveNext
  1184.                     Loop
  1185.                 End If
  1186.             Else
  1187.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1188.                 Call Xtxxts(Tsxx, 0, 1)
  1189.                 TextChangeLock = False
  1190.                 Exit Function
  1191.             End If
  1192.             
  1193.         End With
  1194.         
  1195.     End If
  1196.     
  1197.     Cshlrxx = True
  1198.     TextChangeLock = False
  1199.     
  1200. End Function
  1201. Private Sub Sub_Abandon()                 '放 弃 当 前 记 录
  1202.     '清除文本框内容
  1203.     For Jsqte = LrText.count - 1 To 0 Step -1
  1204.         LrText(Jsqte).Text = ""
  1205.         TextValiJudgeLock(Jsqte) = True
  1206.     Next Jsqte
  1207.     
  1208.     '清除网格内容
  1209.     XsGrid.Rows = XsGrid.FixedRows
  1210.     
  1211.     StTab.Tab = 0
  1212.     StTab.TabEnabled(1) = False
  1213.     
  1214.     '调整工具条
  1215.     Call Toolfbjzt
  1216.     GsToolbar.Visible = True
  1217.     
  1218. End Sub
  1219. '*******************以下区域为编写自定义过程区域**********************
  1220. '*******************以上区域为编写自定义过程区域**********************
  1221. '*******************************以下为基本处理程序(固定不变)*******************************************'
  1222. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1223.     If Shift = 2 Then
  1224.         Select Case UCase(Chr(KeyCode))
  1225.             Case "P"                                                                          'Ctrl+P 打印
  1226.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1227.                     Call bbyl(False)
  1228.                 End If
  1229.             Case "A"                                                                          'Ctrl+A 增加
  1230.                 Call Sub_Add
  1231.         End Select
  1232.     End If
  1233.   
  1234. End Sub
  1235. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1236.     Select Case Button.Key
  1237.         Case "ymsz"                                          '页面设置
  1238.             Dyymctbl.Show 1
  1239.         Case "yl"                                            '预 览
  1240.             Call bbyl(True)
  1241.         Case "dy"                                            '打 印
  1242.              Call bbyl(False)
  1243.         Case "cx"                                            '查 询
  1244.             DJ_AdjustPlanCond.Show 1
  1245.             Call Cxnrtcwg
  1246.             Call Toolfbjzt
  1247.         Case "Bill"                                          '单 据
  1248.            Call CzxsGrid_DblClick
  1249.         Case "zj"                                            '增 加
  1250.             Call Sub_Add
  1251.         Case "bc"                                            '保 存
  1252.             Call Sub_SaveBill
  1253.         Case "fq"                                            '放 弃
  1254.         For Jsqte = LrText.count - 1 To 0
  1255.             TextValiJudgeLock(Jsqte) = True
  1256.         Next Jsqte
  1257.             Call Sub_Abandon
  1258.         Case "sx"                                            '刷 新
  1259.             Call Cxnrtcwg
  1260.         Case "bz"                                            '帮 助
  1261.             Call F1bz
  1262.         Case "fh"                                            '退 出
  1263.             Unload Me
  1264.     End Select
  1265.     
  1266. End Sub
  1267. Private Sub Sub_Add()       '增加
  1268.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1269.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1270.         Exit Sub
  1271.     End If
  1272.     
  1273.     '单据录入日期是否在当前年度
  1274.     If Not Year(CDate(Xtrq)) = PGKjYear Then
  1275.         Tsxx = "操作日期不在当前会计年度(" + Trim(Str(PGKjYear)) + ")之内,请重新登录!"
  1276.         Call Xtxxts(Tsxx, 0, 1)
  1277.         Exit Sub
  1278.     End If
  1279.     
  1280.     '单据日期必须在当前会计期间
  1281.     If Month(Xtrq) <> PGNowmon Then
  1282.         Tsxx = "操作日期不在当前会计期间(" + Trim(Str(PGKjYear)) + "." + Trim(Str(PGNowmon)) + ")之内,请重新登录!"
  1283.         Call Xtxxts(Tsxx, 0, 1)
  1284.         Exit Sub
  1285.     End If
  1286.     
  1287.     Lrzt = 1
  1288.     Call Toolbjzt
  1289.     Call Cshlrxx(Lrzt, 0)
  1290.     LrText(0).Enabled = False
  1291.     LrText(1).Enabled = True
  1292.     LrText(2).Enabled = False
  1293.     LrText(3).Enabled = False
  1294.     LrText(4).Enabled = True
  1295.     LrText(5).Enabled = True
  1296.     LrText(0).Text = Format(Xtrq, "yyyy-mm-dd")
  1297.     LrText(1).SetFocus
  1298.     XsGrid.Rows = XsGrid.FixedRows
  1299.     GsToolbar.Visible = False
  1300. End Sub
  1301. Private Sub CzxsGrid_DblClick()                                         '显示当前编码记录
  1302.     
  1303.     If CzxsGrid.Rows = CzxsGrid.FixedRows Then Exit Sub
  1304.     Lrzt = 2
  1305.     Call Toolbjzt
  1306.     Call Cshlrxx(Lrzt, Val(CzxsGrid.TextMatrix(CzxsGrid.Row, 0)))
  1307.     LrText(0).Enabled = False
  1308.     LrText(1).Enabled = False
  1309.     LrText(2).Enabled = False
  1310.     LrText(3).Enabled = False
  1311.     LrText(4).Enabled = False
  1312.     LrText(5).Enabled = False
  1313.     GsToolbar.Visible = False
  1314.     
  1315. End Sub
  1316. Private Sub Toolbjzt()                                                  'Toolbar状态(编辑状态)
  1317.     StTab.TabEnabled(1) = True
  1318.     StTab.Tab = 1
  1319.     Frame1.Enabled = True
  1320.     StTab.TabEnabled(0) = False
  1321.     CzxsGrid.Enabled = False
  1322.     
  1323.     With SzToolbar
  1324.         .Buttons("ymsz").Enabled = False
  1325.         .Buttons("dy").Enabled = False
  1326.         .Buttons("yl").Enabled = False
  1327.         .Buttons("zj").Enabled = False
  1328.         .Buttons("cx").Enabled = False
  1329.         .Buttons("Bill").Enabled = False
  1330.         .Buttons("sx").Enabled = False
  1331.         .Buttons("fq").Enabled = True
  1332.         If Lrzt = 1 Then
  1333.             .Buttons("bc").Enabled = True
  1334.             Ydcommand1(1).Visible = True
  1335.         Else
  1336.             .Buttons("bc").Enabled = False
  1337.             Ydcommand1(1).Visible = False
  1338.         End If
  1339.     End With
  1340.   
  1341. End Sub
  1342. Private Sub Toolfbjzt()                                                 'Toolbar状态(非编辑状态)
  1343.     StTab.TabEnabled(0) = True
  1344.     StTab.Tab = 0
  1345.     CzxsGrid.Enabled = True
  1346.     Frame1.Enabled = False
  1347.     StTab.TabEnabled(1) = False
  1348.     
  1349.     With SzToolbar
  1350.         If CzxsGrid.Rows = CzxsGrid.FixedRows Then
  1351.             .Buttons("ymsz").Enabled = True
  1352.             .Buttons("dy").Enabled = True
  1353.             .Buttons("yl").Enabled = True
  1354.             .Buttons("cx").Enabled = True
  1355.             .Buttons("Bill").Enabled = False
  1356.             .Buttons("zj").Enabled = True
  1357.             .Buttons("bc").Enabled = False
  1358.             .Buttons("fq").Enabled = False
  1359.             .Buttons("sx").Enabled = True
  1360.         Else
  1361.             .Buttons("ymsz").Enabled = True
  1362.             .Buttons("dy").Enabled = True
  1363.             .Buttons("yl").Enabled = True
  1364.             .Buttons("cx").Enabled = True
  1365.             .Buttons("Bill").Enabled = True
  1366.             .Buttons("zj").Enabled = True
  1367.             .Buttons("bc").Enabled = False
  1368.             .Buttons("fq").Enabled = False
  1369.             .Buttons("sx").Enabled = True
  1370.         End If
  1371.     End With
  1372.   
  1373. End Sub
  1374. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1375.   
  1376.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  1377.   
  1378. End Sub
  1379. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1380.     Select Case Button.Key
  1381.         Case "bcgs"                                       '保存表格格式
  1382.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1383.         Case "hfmrgs"                                     '恢复默认格式
  1384.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1385.         Case "szxsxm"                                     '设置显示项目
  1386.             Call Szxsxm(CzxsGrid, GridCode)
  1387.     End Select
  1388.     
  1389. End Sub
  1390. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1391.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1392.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1393.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1394.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1395.     ReDim Bbxbt(1 To Bbxbtgs)
  1396.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1397.     
  1398.     If Bbbwhgs <> 0 Then
  1399.         ReDim Bbbwh(1 To Bbbwhgs)
  1400.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1401.     End If
  1402.     
  1403.     Bbzbt = ReportTitle
  1404.     Bbxbt(1) = " "
  1405.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1406.   
  1407.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1408.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1409.     
  1410.     If Not bbylte Then
  1411.         Unload DY_Tybbyldy
  1412.     End If
  1413.     
  1414. End Sub
  1415. '************以下为文本框录入处理程序(固定不变部分)*************'
  1416. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1417.   
  1418.     '以下为依据实际情况自定义部分[
  1419.     
  1420.         '在此填写文本框录入事后处理程序
  1421.         Dim Rectemp As Recordset
  1422.         
  1423.         TextChangeLock = True
  1424.         
  1425.         If Index = 1 Then
  1426.             LrText(4).Text = ""
  1427.             XsGrid.Rows = XsGrid.FixedRows
  1428.             If Trim(LrText(Index)) = "" Then
  1429.                 LrText(1).Tag = ""
  1430.                 LrText(2).Text = ""
  1431.                 LrText(2).Tag = ""
  1432.                 LrText(3).Text = ""
  1433.                 LrText(4).Text = ""
  1434.                 XsGrid.Clear 1
  1435.             Else
  1436.                 '显示存货名称、计划单价
  1437.                 Set Rectemp = Cw_DataEnvi.DataConnect.Execute("select mnumber,mname,model,planprice,InvSortCode from gy_material where mnumber ='" & Trim(LrText(1).Text) & "'")
  1438.                 LrText(1).Tag = Trim(Rectemp.Fields("invsortcode") & "")
  1439.                 LrText(2).Text = Trim(Rectemp.Fields("mname") & "")
  1440.                 LrText(2).Tag = Trim(Rectemp.Fields("model") & "")
  1441.                 LrText(3).Text = Rectemp.Fields("planprice")
  1442.                 
  1443.                 With XsGrid
  1444.                     '显示结存
  1445.                     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='计划价法' ")
  1446.                     If Not Rectemp.EOF Then
  1447.                         .Rows = .FixedRows
  1448.                         Do While Not Rectemp.EOF
  1449.                             .AddItem ""
  1450.                             .RowHeight(.Rows - 1) = Sjhgd
  1451.                             .TextMatrix(.Rows - 1, 0) = Trim(Rectemp.Fields("whcode"))
  1452.                             .TextMatrix(.Rows - 1, 1) = Trim(Rectemp.Fields("whname"))
  1453.                             .TextMatrix(.Rows - 1, 2) = Val(Rectemp.Fields("startquan")) + Val(Rectemp.Fields("inquan")) - Val(Rectemp.Fields("Outquan"))
  1454.                             .TextMatrix(.Rows - 1, 3) = Val(Rectemp.Fields("startmoney")) + Val(Rectemp.Fields("inmoney")) - Val(Rectemp.Fields("Outmoney"))
  1455.                             Rectemp.MoveNext
  1456.                         Loop
  1457.                     Else
  1458.                         .Rows = .FixedRows
  1459.                     End If
  1460.                 End With
  1461.             End If
  1462.         End If
  1463.         
  1464.         Set Rectemp = Nothing
  1465.         
  1466.         TextChangeLock = False
  1467.         
  1468.     ']以上为依据实际情况自定义部分
  1469.   
  1470. End Sub
  1471. Private Sub LrText_Change(Index As Integer)
  1472.     '屏蔽程序改变控制
  1473.     If TextChangeLock Then
  1474.         Exit Sub
  1475.     End If
  1476.     
  1477.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1478.     
  1479.     '限制字段录入长度
  1480.           
  1481.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1482.      
  1483.     Select Case Textint(Index, 1)
  1484.         Case 8, 11       '金额型
  1485.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1486.         Case 9, 12       '数量型
  1487.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1488.         Case 10          '单价型
  1489.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1490.         Case Else        '其他小数类型控制
  1491.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1492.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1493.             End If
  1494.     End Select
  1495.         
  1496.     '计算现金额
  1497.     If Index = 4 Then
  1498.         With XsGrid
  1499.             For Jsqte = .FixedRows To .Rows - 1
  1500.                 .TextMatrix(Jsqte, 4) = Format(Val(.TextMatrix(Jsqte, 2)) * Val(LrText(4)), "###0." + String(Xtjexsws, "0"))
  1501.                 .TextMatrix(Jsqte, 5) = Val(.TextMatrix(Jsqte, 4)) - Val(.TextMatrix(Jsqte, 3))
  1502.             Next Jsqte
  1503.         End With
  1504.     End If
  1505.     
  1506.     TextChangeLock = False '解锁
  1507.    
  1508. End Sub
  1509. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1510.    
  1511.     Call TextShow(Index)
  1512.     CurTextIndex = Index
  1513.     LrText(Index).SelStart = Len(LrText(Index))
  1514.    
  1515. End Sub
  1516. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1517.    
  1518.     Select Case KeyCode
  1519.         Case vbKeyF2
  1520.             Call Text_Help(Index)
  1521.     End Select
  1522.    
  1523. End Sub
  1524. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1525.    
  1526.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1527. End Sub
  1528. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1529.     '显示相应信息但不能进行有效性判断
  1530.     If Textint(Index, 9) = 0 Or Textint(Index, 9) = 1 Then '事中判断
  1531.         Call TextYxxpd(Index)
  1532.     End If
  1533.     
  1534. End Sub
  1535. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  1536.    
  1537.     Call Text_Help(Index)
  1538.     
  1539. End Sub
  1540. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1541.   
  1542.     If Not Textboolean(Index, 1) Then
  1543.         Exit Sub
  1544.     End If
  1545.      
  1546.     '调用帮助
  1547.     TextValiJudgeLock(Index) = True
  1548.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1549.   
  1550.     '根据设置选择显示编码和名称,并进行存储
  1551.     If Len(Xtfhcs) <> 0 Then
  1552.         If Textint(Index, 3) = 1 Then
  1553.             LrText(Index).Text = Xtfhcsfz
  1554.             LrText(Index).Tag = Xtfhcs
  1555.         Else
  1556.             LrText(Index).Text = Xtfhcs
  1557.             LrText(Index).Tag = Xtfhcsfz
  1558.         End If
  1559.     End If
  1560.    
  1561.     LrText(Index).SetFocus
  1562.     
  1563. End Sub
  1564. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1565.     '填写文本框得到焦点,进行相应信息处理程序
  1566.    
  1567. End Sub
  1568. Private Sub Wbkcsh()                          '录入文本框初始化
  1569.     Dim Jsqte As Integer
  1570.   
  1571.     '最大录入文本框索引值
  1572.     Max_Text_Index = Textvar(1)
  1573.   
  1574.     ReDim TextValiJudgeLock(Max_Text_Index)
  1575.   
  1576.     For Jsqte = 0 To Max_Text_Index
  1577.         If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  1578.             If Textboolean(Jsqte, 1) Then
  1579.                 If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
  1580.                     Load Ydcommand1(Jsqte)
  1581.                 End If
  1582.                 Ydcommand1(Jsqte).Visible = True
  1583.                 Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
  1584.             End If
  1585.             
  1586.             TextChangeLock = True
  1587.             LrText(Jsqte).Text = ""
  1588.             LrText(Jsqte).Tag = ""
  1589.             
  1590.             If Textint(Jsqte, 5) <> 0 Then
  1591.                 LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
  1592.             End If
  1593.             
  1594.             TextChangeLock = False
  1595.         End If
  1596.        
  1597.         TextValiJudgeLock(Jsqte) = True
  1598.     Next Jsqte
  1599.     
  1600. End Sub
  1601. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  1602.     Dim SqlStr As String
  1603.     Dim Findrec As ADODB.Recordset
  1604.   
  1605.     '文本框内容未曾改变不进行有效性判断
  1606.     If TextValiJudgeLock(Index) Then
  1607.         TextYxxpd = True
  1608.         Exit Function
  1609.     End If
  1610.   
  1611.     '文本框内容为空认为有效,并清空其Tag值
  1612.     If Trim(LrText(Index)) = "" Then
  1613.         LrText(Index).Tag = ""
  1614.         Call Wbklrwbcl(Index)
  1615.         TextValiJudgeLock(Index) = True
  1616.         TextYxxpd = True
  1617.         Exit Function
  1618.     End If
  1619.   
  1620.     '可在此加入不做有效性判断的理由
  1621.     Select Case Textint(Index, 4)
  1622.         Case 1      '编码型
  1623.             SqlStr = Trim(Textstr(Index, 5))
  1624.             SqlStr = Replace(SqlStr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1625.             SqlStr = Replace(SqlStr, "$$", "'" + Trim(Xtczybm) + "'")
  1626.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1627.             
  1628.             If Findrec.EOF Then
  1629.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1630.                 LrText(Index).SetFocus
  1631.                 Exit Function
  1632.             Else
  1633.                 Select Case Textint(Index, 3)
  1634.                     Case 0
  1635.                     
  1636.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1637.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1638.                         End If
  1639.                         
  1640.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1641.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1642.                         End If
  1643.                         
  1644.                     Case 1
  1645.                     
  1646.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1647.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1648.                         End If
  1649.                         
  1650.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1651.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1652.                         End If
  1653.                 End Select
  1654.             End If
  1655.             
  1656.         Case 2      '日期型
  1657.             If IsDate(LrText(Index).Text) Then
  1658.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1659.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  1660.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1661.                 End If
  1662.             Else
  1663.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1664.                 Call Xtxxts(Tsxx, 0, 1)
  1665.                 LrText(Index).SetFocus
  1666.                 Exit Function
  1667.             End If
  1668.             
  1669.         Case 3      '其他类型
  1670.         
  1671.          If Index = 4 Then
  1672.             If Val(LrText(3)) = Val(LrText(4)) Then
  1673.                 Tsxx = "现计划价不能等于原计划价!"
  1674.                 Call Xtxxts(Tsxx, 0, 1)
  1675.                 LrText(Index).SetFocus
  1676.                 Exit Function
  1677.             End If
  1678.         End If
  1679.    End Select
  1680.     
  1681.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1682.     TextValiJudgeLock(Index) = True
  1683.     '调用文本框事后处理程序
  1684.     Call Wbklrwbcl(Index)
  1685.    
  1686.     '有效性判断通过则返回True
  1687.     TextYxxpd = True
  1688.    
  1689. End Function