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

企业管理

开发平台:

Visual Basic

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