上传用户: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. Begin VB.Form JS_FrmCostGather 
  5.    Caption         =   "成本费用归集"
  6.    ClientHeight    =   6555
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   8880
  10.    Icon            =   "成本计算_费用归集.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   6555
  14.    ScaleWidth      =   8880
  15.    Begin VB.ComboBox ydcombo 
  16.       Height          =   300
  17.       Left            =   7470
  18.       TabIndex        =   15
  19.       Top             =   150
  20.       Visible         =   0   'False
  21.       Width           =   1275
  22.    End
  23.    Begin VB.CommandButton Yd_Help 
  24.       Height          =   299
  25.       Left            =   6810
  26.       Picture         =   "成本计算_费用归集.frx":1042
  27.       Style           =   1  'Graphical
  28.       TabIndex        =   14
  29.       Top             =   150
  30.       Visible         =   0   'False
  31.       Width           =   300
  32.    End
  33.    Begin VB.CommandButton Ydcommand 
  34.       Height          =   299
  35.       Left            =   7200
  36.       Picture         =   "成本计算_费用归集.frx":13CC
  37.       Style           =   1  'Graphical
  38.       TabIndex        =   13
  39.       Top             =   150
  40.       Visible         =   0   'False
  41.       Width           =   300
  42.    End
  43.    Begin VB.TextBox Ydtext 
  44.       BackColor       =   &H00C0FFFF&
  45.       BorderStyle     =   0  'None
  46.       Height          =   338
  47.       Left            =   6510
  48.       MultiLine       =   -1  'True
  49.       TabIndex        =   12
  50.       Top             =   210
  51.       Visible         =   0   'False
  52.       Width           =   1179
  53.    End
  54.    Begin VB.PictureBox Pic_Title 
  55.       AutoRedraw      =   -1  'True
  56.       BackColor       =   &H00FFFFFF&
  57.       Height          =   1065
  58.       Left            =   30
  59.       Picture         =   "成本计算_费用归集.frx":1756
  60.       ScaleHeight     =   1005
  61.       ScaleWidth      =   11850
  62.       TabIndex        =   3
  63.       Top             =   600
  64.       Width           =   11915
  65.       Begin VB.ComboBox Combo_Center 
  66.          Height          =   300
  67.          Left            =   1800
  68.          Style           =   2  'Dropdown List
  69.          TabIndex        =   17
  70.          Top             =   690
  71.          Width           =   2025
  72.       End
  73.       Begin VB.ComboBox Combo_KJQJ 
  74.          Height          =   300
  75.          Left            =   7830
  76.          Style           =   2  'Dropdown List
  77.          TabIndex        =   4
  78.          Top             =   690
  79.          Width           =   2025
  80.       End
  81.       Begin VB.Label Label1 
  82.          AutoSize        =   -1  'True
  83.          BackStyle       =   0  'Transparent
  84.          Caption         =   "成本中心:"
  85.          Height          =   180
  86.          Left            =   900
  87.          TabIndex        =   16
  88.          Top             =   750
  89.          Width           =   810
  90.       End
  91.       Begin VB.Label tsLabel 
  92.          AutoSize        =   -1  'True
  93.          BackColor       =   &H80000018&
  94.          BackStyle       =   0  'Transparent
  95.          Caption         =   "成本费用归集"
  96.          BeginProperty Font 
  97.             Name            =   "宋体"
  98.             Size            =   12
  99.             Charset         =   134
  100.             Weight          =   700
  101.             Underline       =   0   'False
  102.             Italic          =   0   'False
  103.             Strikethrough   =   0   'False
  104.          EndProperty
  105.          ForeColor       =   &H00000000&
  106.          Height          =   240
  107.          Index           =   7
  108.          Left            =   360
  109.          TabIndex        =   11
  110.          Top             =   240
  111.          Width           =   1530
  112.       End
  113.       Begin VB.Label tsLabel 
  114.          AutoSize        =   -1  'True
  115.          BackStyle       =   0  'Transparent
  116.          Caption         =   "当前记录"
  117.          Height          =   180
  118.          Index           =   5
  119.          Left            =   9795
  120.          TabIndex        =   10
  121.          Top             =   210
  122.          Width           =   720
  123.       End
  124.       Begin VB.Label tsLabel 
  125.          AutoSize        =   -1  'True
  126.          BackStyle       =   0  'Transparent
  127.          Caption         =   "行)"
  128.          Height          =   180
  129.          Index           =   4
  130.          Left            =   11220
  131.          TabIndex        =   9
  132.          Top             =   210
  133.          Width           =   270
  134.       End
  135.       Begin VB.Label tsLabel 
  136.          AutoSize        =   -1  'True
  137.          BackStyle       =   0  'Transparent
  138.          Caption         =   "(第"
  139.          Height          =   180
  140.          Index           =   3
  141.          Left            =   10605
  142.          TabIndex        =   8
  143.          Top             =   210
  144.          Width           =   270
  145.       End
  146.       Begin VB.Label Lab_Row 
  147.          Alignment       =   2  'Center
  148.          Appearance      =   0  'Flat
  149.          AutoSize        =   -1  'True
  150.          BackColor       =   &H80000005&
  151.          BackStyle       =   0  'Transparent
  152.          ForeColor       =   &H00FF0000&
  153.          Height          =   180
  154.          Left            =   11070
  155.          TabIndex        =   7
  156.          Top             =   210
  157.          Width           =   90
  158.       End
  159.       Begin VB.Label Label2 
  160.          AutoSize        =   -1  'True
  161.          BackStyle       =   0  'Transparent
  162.          Caption         =   "会计期间:"
  163.          Height          =   180
  164.          Left            =   6990
  165.          TabIndex        =   6
  166.          Top             =   750
  167.          Width           =   810
  168.       End
  169.       Begin VB.Label Lab_OperStatus 
  170.          BackColor       =   &H000080FF&
  171.          Caption         =   "1"
  172.          Height          =   195
  173.          Left            =   4830
  174.          TabIndex        =   5
  175.          Top             =   1320
  176.          Visible         =   0   'False
  177.          Width           =   345
  178.       End
  179.    End
  180.    Begin MSComctlLib.ImageList ImageList2 
  181.       Left            =   1260
  182.       Top             =   690
  183.       _ExtentX        =   1005
  184.       _ExtentY        =   1005
  185.       BackColor       =   -2147483643
  186.       ImageWidth      =   16
  187.       ImageHeight     =   16
  188.       MaskColor       =   12632256
  189.       _Version        =   393216
  190.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  191.          NumListImages   =   8
  192.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  193.             Picture         =   "成本计算_费用归集.frx":1E696
  194.             Key             =   "stb"
  195.          EndProperty
  196.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  197.             Picture         =   "成本计算_费用归集.frx":1EAEA
  198.             Key             =   "xttb"
  199.          EndProperty
  200.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  201.             Picture         =   "成本计算_费用归集.frx":1EF42
  202.             Key             =   "qx"
  203.          EndProperty
  204.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  205.             Picture         =   "成本计算_费用归集.frx":1F3A2
  206.             Key             =   "kplr"
  207.          EndProperty
  208.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  209.             Picture         =   "成本计算_费用归集.frx":1F7F6
  210.             Key             =   "kpgl"
  211.          EndProperty
  212.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  213.             Picture         =   "成本计算_费用归集.frx":1FC56
  214.             Key             =   "tcxt"
  215.          EndProperty
  216.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  217.             Picture         =   "成本计算_费用归集.frx":1FF72
  218.             Key             =   "szk"
  219.          EndProperty
  220.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  221.             Picture         =   "成本计算_费用归集.frx":203CA
  222.             Key             =   "gnqx"
  223.          EndProperty
  224.       EndProperty
  225.    End
  226.    Begin MSComctlLib.Toolbar SzToolbar 
  227.       Align           =   1  'Align Top
  228.       Height          =   555
  229.       Left            =   0
  230.       TabIndex        =   0
  231.       Top             =   0
  232.       Width           =   8880
  233.       _ExtentX        =   15663
  234.       _ExtentY        =   979
  235.       ButtonWidth     =   820
  236.       ButtonHeight    =   926
  237.       AllowCustomize  =   0   'False
  238.       Appearance      =   1
  239.       Style           =   1
  240.       ImageList       =   "Imagelist1"
  241.       _Version        =   393216
  242.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  243.          NumButtons      =   12
  244.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  245.             Caption         =   "设置"
  246.             Key             =   "ymsz"
  247.             ImageKey        =   "sz"
  248.          EndProperty
  249.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  250.             Caption         =   "打印"
  251.             Key             =   "dy"
  252.             ImageKey        =   "dy"
  253.          EndProperty
  254.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  255.             Caption         =   "预览"
  256.             Key             =   "yl"
  257.             ImageKey        =   "yl"
  258.          EndProperty
  259.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  260.             Style           =   3
  261.          EndProperty
  262.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  263.             Caption         =   "编辑"
  264.             Key             =   "xg"
  265.             ImageKey        =   "xg"
  266.          EndProperty
  267.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  268.             Caption         =   "保存"
  269.             Key             =   "bc"
  270.             ImageKey        =   "bc"
  271.          EndProperty
  272.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  273.             Caption         =   "放弃"
  274.             Key             =   "fq"
  275.             ImageKey        =   "fq"
  276.          EndProperty
  277.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  278.             Style           =   3
  279.          EndProperty
  280.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  281.             Caption         =   "计算"
  282.             Key             =   "sum"
  283.             ImageKey        =   "hz"
  284.          EndProperty
  285.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  286.             Style           =   3
  287.          EndProperty
  288.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  289.             Caption         =   "帮助"
  290.             Key             =   "bz"
  291.             ImageKey        =   "bz"
  292.          EndProperty
  293.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  294.             Caption         =   "退出"
  295.             Key             =   "fh"
  296.             ImageKey        =   "tc"
  297.          EndProperty
  298.       EndProperty
  299.       BorderStyle     =   1
  300.       Begin MSComctlLib.Toolbar GsToolbar 
  301.          Height          =   540
  302.          Left            =   10200
  303.          TabIndex        =   1
  304.          Top             =   0
  305.          Width           =   1665
  306.          _ExtentX        =   2937
  307.          _ExtentY        =   953
  308.          ButtonWidth     =   1455
  309.          ButtonHeight    =   953
  310.          AllowCustomize  =   0   'False
  311.          Appearance      =   1
  312.          Style           =   1
  313.          ImageList       =   "Imagelist1"
  314.          _Version        =   393216
  315.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  316.             NumButtons      =   2
  317.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  318.                Caption         =   "保存格式"
  319.                Key             =   "bcgs"
  320.                ImageKey        =   "bcgs"
  321.             EndProperty
  322.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  323.                Caption         =   "默认列宽"
  324.                Key             =   "hfmrgs"
  325.                ImageKey        =   "mrlk"
  326.             EndProperty
  327.          EndProperty
  328.       End
  329.       Begin MSComctlLib.ImageList Imagelist1 
  330.          Left            =   5400
  331.          Top             =   0
  332.          _ExtentX        =   1005
  333.          _ExtentY        =   1005
  334.          BackColor       =   -2147483643
  335.          ImageWidth      =   16
  336.          ImageHeight     =   16
  337.          MaskColor       =   12632256
  338.          _Version        =   393216
  339.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  340.             NumListImages   =   30
  341.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  342.                Picture         =   "成本计算_费用归集.frx":20822
  343.                Key             =   "sz"
  344.             EndProperty
  345.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  346.                Picture         =   "成本计算_费用归集.frx":20BBC
  347.                Key             =   "dy"
  348.             EndProperty
  349.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  350.                Picture         =   "成本计算_费用归集.frx":20F56
  351.                Key             =   "yl"
  352.             EndProperty
  353.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  354.                Picture         =   "成本计算_费用归集.frx":212F0
  355.                Key             =   "xz"
  356.             EndProperty
  357.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  358.                Picture         =   "成本计算_费用归集.frx":2168A
  359.                Key             =   "xg"
  360.             EndProperty
  361.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  362.                Picture         =   "成本计算_费用归集.frx":21A24
  363.                Key             =   "sc"
  364.             EndProperty
  365.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  366.                Picture         =   "成本计算_费用归集.frx":21DBE
  367.                Key             =   "zh"
  368.             EndProperty
  369.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  370.                Picture         =   "成本计算_费用归集.frx":22158
  371.                Key             =   "sh"
  372.             EndProperty
  373.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  374.                Picture         =   "成本计算_费用归集.frx":224F2
  375.                Key             =   "bc"
  376.             EndProperty
  377.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  378.                Picture         =   "成本计算_费用归集.frx":2288C
  379.                Key             =   "fq"
  380.             EndProperty
  381.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  382.                Picture         =   "成本计算_费用归集.frx":22C26
  383.                Key             =   "check"
  384.             EndProperty
  385.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  386.                Picture         =   "成本计算_费用归集.frx":22FC0
  387.                Key             =   "qs"
  388.             EndProperty
  389.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  390.                Picture         =   "成本计算_费用归集.frx":2335A
  391.                Key             =   "fullcheck"
  392.             EndProperty
  393.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  394.                Picture         =   "成本计算_费用归集.frx":236F4
  395.                Key             =   "qq"
  396.             EndProperty
  397.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  398.                Picture         =   "成本计算_费用归集.frx":23A8E
  399.                Key             =   "first"
  400.             EndProperty
  401.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  402.                Picture         =   "成本计算_费用归集.frx":23E28
  403.                Key             =   "prev"
  404.             EndProperty
  405.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  406.                Picture         =   "成本计算_费用归集.frx":241C2
  407.                Key             =   "next"
  408.             EndProperty
  409.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  410.                Picture         =   "成本计算_费用归集.frx":2455C
  411.                Key             =   "last"
  412.             EndProperty
  413.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  414.                Picture         =   "成本计算_费用归集.frx":248F6
  415.                Key             =   "bz"
  416.             EndProperty
  417.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  418.                Picture         =   "成本计算_费用归集.frx":24C90
  419.                Key             =   "tc"
  420.             EndProperty
  421.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  422.                Picture         =   "成本计算_费用归集.frx":2502A
  423.                Key             =   "bcgs"
  424.             EndProperty
  425.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  426.                Picture         =   "成本计算_费用归集.frx":253C4
  427.                Key             =   "mrlk"
  428.             EndProperty
  429.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  430.                Picture         =   "成本计算_费用归集.frx":2575E
  431.                Key             =   "xsxm"
  432.             EndProperty
  433.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  434.                Picture         =   "成本计算_费用归集.frx":25AF8
  435.                Key             =   "hz"
  436.             EndProperty
  437.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  438.                Picture         =   "成本计算_费用归集.frx":25E92
  439.                Key             =   "dw"
  440.             EndProperty
  441.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  442.                Picture         =   "成本计算_费用归集.frx":2622C
  443.                Key             =   "zx"
  444.             EndProperty
  445.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  446.                Picture         =   "成本计算_费用归集.frx":265C6
  447.                Key             =   "mx"
  448.             EndProperty
  449.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  450.                Picture         =   "成本计算_费用归集.frx":26960
  451.                Key             =   "hf"
  452.             EndProperty
  453.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  454.                Picture         =   "成本计算_费用归集.frx":26CFA
  455.                Key             =   "cx"
  456.             EndProperty
  457.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  458.                Picture         =   "成本计算_费用归集.frx":27094
  459.                Key             =   "sx"
  460.             EndProperty
  461.          EndProperty
  462.       End
  463.    End
  464.    Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  465.       Height          =   6270
  466.       Left            =   30
  467.       TabIndex        =   2
  468.       Top             =   1710
  469.       Width           =   11910
  470.       _cx             =   5080
  471.       _cy             =   5080
  472.       Appearance      =   1
  473.       BorderStyle     =   1
  474.       Enabled         =   -1  'True
  475.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  476.          Name            =   "宋体"
  477.          Size            =   9
  478.          Charset         =   134
  479.          Weight          =   400
  480.          Underline       =   0   'False
  481.          Italic          =   0   'False
  482.          Strikethrough   =   0   'False
  483.       EndProperty
  484.       MousePointer    =   0
  485.       BackColor       =   -2147483643
  486.       ForeColor       =   -2147483640
  487.       BackColorFixed  =   -2147483633
  488.       ForeColorFixed  =   -2147483630
  489.       BackColorSel    =   -2147483635
  490.       ForeColorSel    =   -2147483634
  491.       BackColorBkg    =   8421504
  492.       BackColorAlternate=   -2147483643
  493.       GridColor       =   -2147483633
  494.       GridColorFixed  =   -2147483632
  495.       TreeColor       =   -2147483632
  496.       FloodColor      =   192
  497.       SheetBorder     =   -2147483642
  498.       FocusRect       =   1
  499.       HighLight       =   1
  500.       AllowSelection  =   -1  'True
  501.       AllowBigSelection=   -1  'True
  502.       AllowUserResizing=   0
  503.       SelectionMode   =   0
  504.       GridLines       =   1
  505.       GridLinesFixed  =   2
  506.       GridLineWidth   =   1
  507.       Rows            =   5000
  508.       Cols            =   10
  509.       FixedRows       =   1
  510.       FixedCols       =   0
  511.       RowHeightMin    =   0
  512.       RowHeightMax    =   0
  513.       ColWidthMin     =   0
  514.       ColWidthMax     =   0
  515.       ExtendLastCol   =   0   'False
  516.       FormatString    =   ""
  517.       ScrollTrack     =   0   'False
  518.       ScrollBars      =   3
  519.       ScrollTips      =   0   'False
  520.       MergeCells      =   0
  521.       MergeCompare    =   0
  522.       AutoResize      =   -1  'True
  523.       AutoSizeMode    =   0
  524.       AutoSearch      =   0
  525.       AutoSearchDelay =   2
  526.       MultiTotals     =   -1  'True
  527.       SubtotalPosition=   1
  528.       OutlineBar      =   0
  529.       OutlineCol      =   0
  530.       Ellipsis        =   0
  531.       ExplorerBar     =   0
  532.       PicturesOver    =   0   'False
  533.       FillStyle       =   0
  534.       RightToLeft     =   0   'False
  535.       PictureType     =   0
  536.       TabBehavior     =   0
  537.       OwnerDraw       =   0
  538.       Editable        =   0
  539.       ShowComboButton =   1
  540.       WordWrap        =   0   'False
  541.       TextStyle       =   0
  542.       TextStyleFixed  =   0
  543.       OleDragMode     =   0
  544.       OleDropMode     =   0
  545.       DataMode        =   0
  546.       VirtualData     =   -1  'True
  547.       DataMember      =   ""
  548.       ComboSearch     =   3
  549.       AutoSizeMouse   =   -1  'True
  550.       FrozenRows      =   0
  551.       FrozenCols      =   0
  552.       AllowUserFreezing=   0
  553.       BackColorFrozen =   0
  554.       ForeColorFrozen =   0
  555.       WallPaperAlignment=   9
  556.       AccessibleName  =   ""
  557.       AccessibleDescription=   ""
  558.       AccessibleValue =   ""
  559.       AccessibleRole  =   24
  560.    End
  561. End
  562. Attribute VB_Name = "JS_FrmCostGather"
  563. Attribute VB_GlobalNameSpace = False
  564. Attribute VB_Creatable = False
  565. Attribute VB_PredeclaredId = True
  566. Attribute VB_Exposed = False
  567. '*******************************************************
  568. '*    模 块 名 称 :费用归集
  569. '*    功 能 描 述 :费用归集
  570. '*    程序员姓名  :xjl
  571. '*    最后修改人  :xjl
  572. '*    最后修改时间:2002/1/22
  573. '*    备        注:
  574. '*******************************************************
  575. Dim RecDigest As New ADODB.Recordset     '常用摘要表
  576. Dim jdzygs As Integer                    '控件焦点转移个数
  577. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  578. Dim ShowBillLock As Boolean              '是否显示
  579. Dim PrivateYear As Integer               '年
  580. Dim PrivateMm As Integer                 '月
  581. Dim Combo_CenterCode() As String         '成本中心编码
  582. Dim Str_RightEdit As String              '编辑权限索引
  583. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  584. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  585. Dim GridCode As String                   '显示网格网格代码
  586. Dim GridInf() As Variant                 '整个网格设置信息
  587. Dim ReportTitle As String                '报表主标题
  588. Dim Tsxx As String                       '系统提示信息
  589. Dim Pmbcsjhs As Long                     '屏幕网格保持数据行数(大于等于1)
  590. Dim Fzxwghs As Integer                   '辅助项网格行数(包括合计行)
  591. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  592. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  593. Dim Sjhgd As Double                      '网格数据行高度
  594. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  595. Dim GridStr()  As String                 '网格列信息(字符型)
  596. Dim GridInt() As Integer                 '网格列信息(整型)
  597. Dim Sfblbzkd As Boolean                  '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
  598. Dim Dqlrwgh As Long                      '当前录入数据网格行
  599. Dim Dqlrwgl As Long                      '当前录入数据网格列
  600. Dim Dqlkwgh As Long                      '刚刚离开网格行(不一定为录入行)
  601. Dim Dqlkwgl As Long                      '刚刚离开网格列
  602. Dim Dqtoprow As Long                     '当前录入状态时最上端可视行
  603. Dim Dqleftcol As Long                    '当前录入状态时最左端可视列
  604. Dim Zdlrqnr As String                    '字段录入修改前内容(用来判断内容是否修改)
  605. Dim Wbkbhlock As Boolean                 '文本框改变值锁
  606. Dim Changelock As Boolean                '网格行列改变控制锁(用来区别用户改变.程序改变)
  607. Dim Gdtlock As Boolean                   '滚动条滚动控制(用来区别用户改变.程序改变)
  608. Dim Yxxpdlock As Boolean                 '字段有效性判断锁(内容不修改不需进行字段有效性判断)
  609. Dim Hyxxpdlock As Boolean                '行有效性判断锁(字段内容不修改不需进行行有效性判断)
  610. Dim Valilock As Boolean                  '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
  611. Dim Shsfts As Boolean                    '删除记录行是否提示
  612. Dim Szzls As Integer                     '网格信息数组最大下标值(网格列数-1)
  613. Private Sub Combo_Center_Click()            '选择成本中心
  614.     If ShowBillLock = True Then
  615.         Call Sub_Query
  616.     End If
  617. End Sub
  618. Private Sub Combo_KJQJ_Click()              '选择会计日历
  619.     PrivateYear = Mid(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 1, 4)
  620.     PrivateMm = Right(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 2)
  621.     If Combo_Center.ListCount <= 0 Then
  622.         Exit Sub
  623.     End If
  624.     '会计日历
  625.     SqlStr = "Select Count(*) From gy_kjrlb where kjyear='" + Trim(Str(PrivateYear)) + "' And Period='" + CStr(PrivateMm) + "' " _
  626.                     & "And CwzzJzbz='1'"
  627.                     
  628.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  629.     If RecTemp.Fields(0) > 0 Then
  630.         Call Sub_OperStatus("10")
  631.     Else
  632.         Call Sub_OperStatus("11")
  633.     End If
  634.     Lab_OperStatus.Caption = "1"
  635.     If ShowBillLock = False Then
  636.         Exit Sub
  637.     End If
  638.     '显示数据
  639.     Call Sub_Query
  640.     
  641. End Sub
  642. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)
  643.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  644. End Sub
  645. Private Sub CzxsGrid_EnterCell()
  646.     With CzxsGrid
  647.         If .Row >= .FixedRows Then
  648.             Lab_Row = Trim(Str(.Row - .FixedRows + 1))
  649.         End If
  650.     End With
  651.     
  652. End Sub
  653. Private Sub CzxsGrid_GotFocus()
  654.     '网格得到焦点,如果当前选择行为非数据行
  655.     '则调整当前焦点至有效数据行
  656.     With CzxsGrid
  657.         If .Row < .FixedRows And .Rows > .FixedRows Then
  658.             Changelock = True
  659.             .Select .FixedRows, .Col
  660.             Changelock = False
  661.         End If
  662.         If .Col < Qslz Then
  663.             Changelock = True
  664.             .Select .Row, Qslz
  665.             Changelock = False
  666.         End If
  667.     End With
  668. End Sub
  669. Private Sub CzxsGrid_KeyDown(KeyCode As Integer, Shift As Integer)
  670.     '如果单据操作状态为浏览状态则不能显示录入载体
  671.     If Trim(Lab_OperStatus.Caption) = "1" Then
  672.         Exit Sub
  673.     End If
  674.     Select Case KeyCode
  675.         Case vbKeyF2                   '按F2键参照
  676.             Call xswbk
  677.             Call Lrzdbz
  678.     End Select
  679. End Sub
  680. Private Sub CzxsGrid_KeyPress(KeyAscii As Integer)
  681.     '当某种条件成立时禁止文本框激活使单据处于录入状态
  682.     If Not Fun_AllowInput Then
  683.         Exit Sub
  684.     End If
  685.   
  686.     With CzxsGrid
  687.   
  688.         '屏 蔽 回 车 键
  689.         If KeyAscii = vbKeyReturn Then
  690.             KeyAscii = 0
  691.             Rowjsq = .Row
  692.             Coljsq = .Col + 1
  693.             If Coljsq > .Cols - 1 Then
  694.                 If Rowjsq < .Rows - 1 Then
  695.                     Rowjsq = Rowjsq + 1
  696.                 End If
  697.                 Coljsq = Qslz
  698.             End If
  699.             Do While Rowjsq <= .Rows - 1
  700.                 If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  701.                     Coljsq = Coljsq + 1
  702.                     If Coljsq > .Cols - 1 Then
  703.                         Rowjsq = Rowjsq + 1
  704.                         Coljsq = Qslz
  705.                     End If
  706.                 Else
  707.                     Exit Do
  708.                 End If
  709.             Loop
  710.           
  711.             If Rowjsq <= .Rows - 1 Then
  712.                 .Select Rowjsq, Coljsq
  713.             End If
  714.        
  715.             Exit Sub
  716.        
  717.         End If
  718.      
  719.         '接受用户录入
  720.         Select Case KeyAscii
  721.             Case 0 To 32             '用户输入KeyAscii为0-32的键 如空格
  722.                 '显示录入载体
  723.                 Call xswbk
  724.             Case Else
  725.                 
  726.                 '防止非编辑字段SendKeys()出现死循环
  727.                 If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then
  728.                     Exit Sub
  729.                 End If
  730.                 
  731.                 '如果此字段为列表框录入则调入相应列表框
  732.                 If GridBoolean(.Col, 3) Then
  733.                    '列表框录入
  734.                     Call xswbk
  735.                 Else
  736.                     Ydtext.Text = ""
  737.             
  738.                     '录入限制
  739.                     Call InputFieldLimit(Ydtext, GridInt(CzxsGrid.Col, 1), KeyAscii)
  740.                     If KeyAscii = 0 Then
  741.                         Exit Sub
  742.                     End If
  743.                     Call xswbk
  744.                     Ydtext.Text = ""
  745.                     Valilock = True
  746.                     SendKeys Chr(KeyAscii), True
  747.                     DoEvents
  748.                     Valilock = False
  749.                 End If
  750.         End Select
  751.     End With
  752. End Sub
  753. Private Sub CzxsGrid_LeaveCell()
  754.     If Changelock Then
  755.         Exit Sub
  756.     End If
  757.     '记录刚刚离开网格单元的行列值
  758.     Dqlkwgh = CzxsGrid.Row
  759.     Dqlkwgl = CzxsGrid.Col
  760.     '判断是否需要录入数据回写
  761.     If Not (Ydtext.Visible Or YdCombo.Visible) Then
  762.         Exit Sub
  763.     End If
  764.     Call Lrsjhx
  765. End Sub
  766. Private Sub CzxsGrid_LostFocus()
  767.     '网格内部原因:网格单元内需要录入信息过程中,(程序控制)本单元内的文本框或下拉列表框显露并获得焦点时引发该事件发生;
  768.     '网格外部原因:网格之外的控件获得焦点造成网格失去焦点,比如网格外的文本框。
  769.     '用以屏蔽调用其它窗体时发生网格失去焦点事件
  770.     If Changelock Then
  771.         Exit Sub
  772.     End If
  773.     '在每个单元输入均合法,但整行输入有可能不合法,在文本框不可编辑状态,这时网格外的某控件获得焦点时,网格失去焦点,必须人为引发RowColChange事件
  774.     '故意引发网格RowcolChange事件
  775.     With CzxsGrid
  776.         If Not (Ydtext.Visible Or YdCombo.Visible) Then
  777.             .Select 0, 0
  778.         End If
  779.     End With
  780. End Sub
  781. Private Sub CzxsGrid_RowColChange()
  782.     Valilock = True       '屏蔽文本框失去焦点进行有效性判断
  783.     With CzxsGrid
  784.         If Changelock Then
  785.             Exit Sub
  786.         End If
  787.         If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  788.             Exit Sub
  789.         End If
  790.         If .Row <> Dqlkwgh Then     '若刚刚进入行《》刚刚离开行,进行行有效性判断
  791.             If Not Sjhzyxxpd(Dqlkwgh) Then
  792.                 Exit Sub
  793.             End If
  794.         End If
  795.     End With
  796.     Call fhyxh      '返回有效行
  797.     Call Xldql
  798. End Sub
  799. Private Sub CzxsGrid_AfterScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)
  800.     If Gdtlock Then
  801.         Exit Sub
  802.     End If
  803.     With CzxsGrid
  804.         If Ydtext.Visible Or YdCombo.Visible Then
  805.             Gdtlock = True
  806.             .TopRow = Dqtoprow
  807.             .LeftCol = Dqleftcol
  808.             Gdtlock = False
  809.             Exit Sub
  810.         End If
  811.     End With
  812. End Sub
  813. '控制焦点转移
  814. Private Sub Form_KeyPress(KeyAscii As Integer)
  815.     jdzygs = 3
  816.     Select Case KeyAscii
  817.         Case vbKeyReturn
  818.             If Kjjdzy(jdzygs) Then
  819.                 KeyAscii = 0
  820.             End If
  821.         Case 39           '屏蔽"'"
  822.             KeyAscii = 0
  823.     End Select
  824. End Sub
  825. Private Sub Form_Load()
  826.     
  827.     '初始化各种锁值
  828.     Changelock = False             '网格行列改变控制锁
  829.     Gdtlock = False                '滚动条滚动控制
  830.     Yxxpdlock = True               '字段有效性判断锁
  831.     Hyxxpdlock = True              '行有效性判断锁
  832.     Wbkbhlock = False              '文本框内容改变锁
  833.     ShowBillLock = False           '是否显示查询信息控制
  834.     
  835.     PrivateYear = Xtyear
  836.     PrivateMm = Xtmm
  837.     
  838.     '定义可变部分变量
  839.     ReportTitle = "成本费用归集"
  840.     '调入打印页面设置窗体
  841.     XtReportCode = "Cb_CostGather"
  842.     Load Dyymctbl
  843.     
  844.     '调入网格
  845.     GridCode = "Cb_CostGather"
  846.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  847.     
  848.     Qslz = GridInf(1)
  849.     Sjhgd = GridInf(2)
  850.     Pmbcsjhs = GridInf(3)
  851.     Fzxwghs = GridInf(4)
  852.     Sfblbzkd = GridInf(5)
  853.     Shsfts = GridInf(6)
  854.     Sfxshjwg = GridInf(7)
  855.     Szzls = CzxsGrid.Cols - 1
  856.     
  857.     '会计期间
  858.     Call Sub_FillPeriod(Combo_KJQJ, PrivateYear, PrivateMm)
  859.     '成本中心
  860.     Call CshCostCenter
  861.     
  862.     '会计日历
  863.     SqlStr = "Select Count(*) From gy_kjrlb where kjyear='" + Trim(Str(PrivateYear)) + "' And Period='" + CStr(PrivateMm) + "' " _
  864.                     & "And CwzzJzbz='1'"
  865.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  866.     If RecTemp.Fields(0) > 0 Then
  867.         '设置工具条状态
  868.         Call Sub_OperStatus("10")
  869.     Else
  870.         '设置工具条状态
  871.         Call Sub_OperStatus("11")
  872.     End If
  873.     If Combo_Center.ListCount > 0 Then
  874.         '显示数据
  875.         Call Sub_Query
  876.         ShowBillLock = True
  877.     Else
  878.         Call Sub_OperStatus("10")
  879.     End If
  880.     Lab_OperStatus.Caption = "1"
  881.     
  882.     Str_RightEdit = "Cb_CostGather_Edit"
  883. End Sub
  884. Private Sub Sub_Query()                                    '查询内容填充网格
  885.     Dim SqlStr As String
  886.     Dim jsqte As Long
  887.     
  888.     '禁止网格刷新动作,为加快网格显示速度(Fixed)
  889.     CzxsGrid.Redraw = False
  890.     
  891.     '查询连接串
  892.     SqlStr = "Select A.ItemCode,B.ItemName,B.UnitName,B.PlanUnitPrice,A.GatherQuantity,A.GatherMoney " _
  893.                 & "From Cb_CostGather A " _
  894.                 & "Left Outer Join (Select A.ItemCode,A.ItemName,B.UnitName,PlanUnitPrice From Cb_CostItem A " _
  895.                 & "Left Outer Join Gy_UnitSet B On A.MeasureUnit=B.UnitCode) B On A.ItemCode=B.ItemCode " _
  896.                 & "Where CenterCode='" & Combo_CenterCode(Combo_Center.ListIndex) & "'  " _
  897.                 & "And Year='" & PrivateYear & "' And Period='" & PrivateMm & "'"
  898.                 
  899.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  900.     With Cxnrrec
  901.         CzxsGrid.Rows = CzxsGrid.FixedRows
  902.      
  903.         If .EOF Then
  904.             CzxsGrid.Redraw = True
  905.             Exit Sub
  906.         End If
  907.      
  908.         jsqte = CzxsGrid.FixedRows
  909.         Do While Not .EOF
  910.             CzxsGrid.AddItem ""
  911.             '[>>显示
  912.             CzxsGrid.TextMatrix(jsqte, 0) = "*" '行标识
  913.             CzxsGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("ItemCode") & "")          '项目编码
  914.             CzxsGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("ItemName") & "")          '项目名称
  915.             CzxsGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("UnitName") & "")          '计量单位
  916.             CzxsGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("PlanUnitPrice")) & ""     '计划单价
  917.             CzxsGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("GatherQuantity") & "")    '归集数量
  918.             CzxsGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("GatherMoney") & "")       '归集金额
  919.             '<<]
  920.             CzxsGrid.RowHeight(jsqte) = Sjhgd
  921.             .MoveNext
  922.             jsqte = jsqte + 1
  923.         Loop
  924.     End With
  925.     
  926.     '将网格刷新解禁(Fixed)
  927.     CzxsGrid.Redraw = True
  928.     
  929. End Sub
  930. Private Sub Form_Resize()                                     '调否网格
  931.     On Error Resume Next
  932.     With CzxsGrid
  933.         .Width = Me.Width - 160
  934.         .Height = Me.Height - .Top - 400
  935.     End With
  936.     With Pic_Title
  937.         .Width = Me.Width - 160
  938.     End With
  939.     
  940.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  941.     Call Cxxswbk
  942.     
  943. End Sub
  944. Private Sub Form_Unload(Cancel As Integer)                    '窗体卸载
  945.     Set Cxnrrec = Nothing
  946.     Unload Dyymctbl
  947. End Sub
  948. Private Function Sub_SaveBill() As Boolean                    '保存数据
  949.     Dim Recfind As New ADODB.Recordset     '有效性判断动态集
  950.     Dim Rowjsq As Long                     '网格行计数器
  951.     Dim Coljsq As Long                     '网格列计数器
  952.     Dim Int_RowCount As Integer            '有效数据行计数器
  953.     Dim Lrywlz As Long                     '录入有误列值
  954.     
  955.     '下面将对所有有效数据行进行有效性判断
  956.     Int_RowCount = 0
  957.     With CzxsGrid
  958.         For Rowjsq = .FixedRows To .Rows - 1
  959.             '带*号者为有效数据行
  960.             If .TextMatrix(Rowjsq, 0) <> "*" Then
  961.                 Exit Function
  962.             Else
  963.                 Int_RowCount = Int_RowCount + 1
  964.             End If
  965.                
  966.             '2.[自定义判断(补丁)
  967.             '首先进行为空判断(固定不变)
  968.             For jsqte = Qslz To .Cols - 1
  969.                 If (GridInt(jsqte, 5) = 1 And Len(Trim(.TextMatrix(Rowjsq, jsqte))) = 0) Or (GridInt(jsqte, 5) = 2 And Val(Trim(.TextMatrix(Rowjsq, jsqte))) = 0) Then
  970.                     Tsxx = GridStr(jsqte, 2)
  971.                     Lrywlz = jsqte
  972.                     GoTo Lrcwcl
  973.                     Exit For
  974.                 End If
  975.             Next jsqte
  976.         Next
  977.         If Int_RowCount = 0 Then
  978.             Tsxx = "有效行数为零,不能存盘!"
  979.             Call Xtxxts(Tsxx, 0, 1)
  980.             Exit Function
  981.         End If
  982.     End With  '网格
  983.     
  984.     '如果以上有效性检查均顺利通过,则执行存盘动作
  985.     
  986.     On Error GoTo Swcwcl
  987.     
  988.     Cw_DataEnvi.DataConnect.BeginTrans
  989.     
  990.     For Rowjsq = CzxsGrid.FixedRows To CzxsGrid.Rows - 1
  991.     
  992.         SqlStr = "Delete From Cb_CostGather Where Year='" & PrivateYear & "' And Period='" & PrivateMm & "' And CenterCode='" + Combo_CenterCode(Combo_Center.ListIndex) + "' And ItemCode='" + Trim(CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls))) + "'"
  993.         Cw_DataEnvi.DataConnect.Execute (SqlStr)
  994.         If RecDigest.State = 1 Then RecDigest.Close
  995.         RecDigest.Open "Select * From Cb_CostGather Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockPessimistic
  996.         If RecDigest.EOF Then
  997.             
  998.             If CzxsGrid.TextMatrix(Rowjsq, 0) <> "*" Then
  999.                 Exit Function
  1000.             End If
  1001.             
  1002.             With RecDigest
  1003.                 
  1004.                 .AddNew
  1005.                 .Fields("CenterCode") = Trim(Combo_CenterCode(Combo_Center.ListIndex))                          '成本中心编码
  1006.                 .Fields("ItemCode") = Trim(CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)))          '成本项目编码
  1007.                 .Fields("Year") = PrivateYear                                                                   '会计年度
  1008.                 .Fields("Period") = PrivateMm                                                                   '会计期间
  1009.                 .Fields("GatherQuantity") = Trim(CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)))    '归集数量
  1010.                 .Fields("GatherMoney") = Trim(CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)))       '归集金额
  1011.                 .Update
  1012.                     
  1013.             End With
  1014.         End If
  1015.     Next
  1016.         
  1017.     Cw_DataEnvi.DataConnect.CommitTrans
  1018.     Tsxx = "存盘完毕! "
  1019.     Call Xtxxts(Tsxx, 0, 4)
  1020.     Sub_SaveBill = True
  1021.     Lab_OperStatus = "1"
  1022.     Call Sub_OperStatus("11")
  1023.     Exit Function
  1024.     
  1025. Swcwcl:
  1026.      Cw_DataEnvi.DataConnect.RollbackTrans
  1027.      If Err.Number = -2147217873 Then
  1028.         Tsxx = "不能有重复的对象!"
  1029.      Else
  1030.         Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
  1031.      End If
  1032.      Call Xtxxts(Tsxx, 0, 1)
  1033.      Exit Function
  1034.      
  1035. Lrcwcl:        '录入错误处理
  1036.     Cw_DataEnvi.DataConnect.RollbackTrans
  1037.     With CzxsGrid
  1038.         Call Xtxxts("(第 " + Trim(Str(Int_RowCount)) + " 条记录)-" + Tsxx, 0, 1)
  1039.         Changelock = True
  1040.         .Select Rowjsq, Lrywlz
  1041.         CzxsGrid.SetFocus
  1042.         Changelock = False
  1043.         Exit Function
  1044.     End With
  1045.     
  1046. End Function
  1047. '******************以下为基本处理程序(固定不变)************************'
  1048. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1049.     If Shift = 2 Then
  1050.      Select Case UCase(Chr(KeyCode))
  1051.          Case "P"                   'Ctrl+P 打印
  1052.             Call bbyl(False)
  1053.      End Select
  1054.   End If
  1055. End Sub
  1056. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1057.     Select Case Button.Key
  1058.         Case "ymsz"                                          '页面设置
  1059.             Dyymctbl.Show 1
  1060.         Case "yl"                                            '预 览
  1061.             Call bbyl(True)
  1062.         Case "dy"                                            '打 印
  1063.             Call bbyl(False)
  1064.         Case "xg"                                            '编 辑
  1065.             
  1066.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1067.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1068.                 Exit Sub
  1069.             End If
  1070.         
  1071.             '设置状态
  1072.             Lab_OperStatus.Caption = "3"
  1073.             '设置工具条状态
  1074.             Call Sub_OperStatus("30")
  1075.         Case "bc"                                            '保 存
  1076.             If Fun_Drfrmyxxpd Then Call Sub_SaveBill
  1077.         Case "fq"                                            '放 弃
  1078.             Call Sub_AbandonBill
  1079.         Case "sum"                                           '归 集
  1080.         
  1081.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1082.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1083.                 Exit Sub
  1084.             End If
  1085.             
  1086.             Glo_Year = PrivateYear
  1087.             Glo_Period = PrivateMm
  1088.             Load JS_FrmSelectObject
  1089.             JS_FrmSelectObject.Combo_CostObject.Tag = "Gather"
  1090.             JS_FrmSelectObject.HelpContextID = "0703003"
  1091.             JS_FrmSelectObject.Show 1
  1092.             Glo_Year = 0
  1093.             Glo_Period = 0
  1094.             Call Sub_Query
  1095.         Case "bz"                                            '帮 助
  1096.             Call F1bz
  1097.         Case "fh"                                            '退 出
  1098.             Unload Me
  1099.     End Select
  1100. End Sub
  1101. Private Sub CzxsGrid_DblClick()                            '修改当前编码记录
  1102.     With CzxsGrid
  1103.         Call xswbk
  1104.     End With
  1105. End Sub
  1106. Private Sub Sub_OperStatus(Str_Status As String)           '工具条依据不同状态所进行的变化
  1107.     With SzToolbar
  1108.         Select Case Str_Status
  1109.             Case "10"   '浏览
  1110.                 '工具条
  1111.                 .Buttons("xg").Enabled = False    '修改
  1112.                 .Buttons("bc").Enabled = False
  1113.                 .Buttons("fq").Enabled = False
  1114.                 .Buttons("sum").Enabled = False
  1115.             Case "11"   '浏览
  1116.                  '工具条
  1117.                 .Buttons("xg").Enabled = True     '修改
  1118.                 .Buttons("bc").Enabled = False
  1119.                 .Buttons("fq").Enabled = False
  1120.                 .Buttons("sum").Enabled = True
  1121.             Case "30"   '修改
  1122.                 '工具条
  1123.                 .Buttons("xg").Enabled = False    '修改
  1124.                 .Buttons("bc").Enabled = True
  1125.                 .Buttons("fq").Enabled = True
  1126.                 .Buttons("sum").Enabled = False
  1127.         End Select
  1128.     End With
  1129. End Sub
  1130. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1131.     Select Case Button.Key
  1132.         Case "bcgs"                              '保存表格格式
  1133.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1134.         Case "hfmrgs"                            '恢复默认格式
  1135.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1136.     End Select
  1137. End Sub
  1138. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1139.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1140.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1141.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1142.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1143.     ReDim Bbxbt(1 To Bbxbtgs)
  1144.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1145.     If Bbbwhgs <> 0 Then
  1146.         ReDim Bbbwh(1 To Bbbwhgs)
  1147.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1148.     End If
  1149.     Bbzbt = ReportTitle
  1150.     
  1151.     If Combo_Center.ListCount > 0 Then
  1152.         Bbxbt(1) = Space(2) + Fun_FormatOutPut("成本中心:" + Right(Trim(Combo_Center.List(Combo_Center.ListIndex)), Len(Trim(Combo_Center.List(Combo_Center.ListIndex))) - 4), 42)
  1153.         Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Mid(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex)), 1, 4) + "年" + Right(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex)), 2) + "月", 35)
  1154.     Else
  1155.         Bbxbt(1) = Space(2) + "成本中心:"
  1156.     End If
  1157.     
  1158.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1159.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1160.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1161.     If Not bbylte Then
  1162.         Unload DY_Tybbyldy
  1163.     End If
  1164. End Sub
  1165. '************以下为文本框录入处理程序(固定不变部分)*************'
  1166. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1167.   '以下为依据实际情况自定义部分[
  1168.   
  1169.       '在此填写文本框录入事后处理程序
  1170.    
  1171.   ']以上为依据实际情况自定义部分
  1172. End Sub
  1173. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1174.    '填写文本框得到焦点,进行相应信息处理程序
  1175. End Sub
  1176. Private Sub Lrsjhx()                                     '文本框录入数据回写
  1177.     With CzxsGrid
  1178.         If YdCombo.Visible Then .Text = Trim(YdCombo.Text)
  1179.         If Ydtext.Visible Then .Text = Trim(Ydtext.Text)
  1180.         
  1181.         '(如果字段录入内容发生变化,则打开有效性判断锁)
  1182.         If Zdlrqnr <> Trim(.Text) Then
  1183.             Yxxpdlock = False
  1184.             Hyxxpdlock = False
  1185.         End If
  1186.         '如果字段录入内容不为空则写数据行有效性标志
  1187.         If Len(Trim(.Text)) <> 0 Then
  1188.             Call Xyxhbz(.Row)
  1189.         End If
  1190.         '隐藏文本框,帮助按钮,列表组合框
  1191.         Call Ycwbk
  1192.     End With
  1193. End Sub
  1194. Private Function Sjhzyxxpd(ByVal Yxxpdh As Long) As Boolean                  '录入数据行有效性判断,同时进行行处理
  1195.     Dim Lrywlz As Long
  1196.     With CzxsGrid
  1197.     
  1198.         '判断行是否为空和无效数据行清除
  1199.         If Yxxpdh > (.Rows - .FixedRows) Then Exit Function
  1200.         If .TextMatrix(Yxxpdh, 0) <> "*" Then
  1201.             Sjhzyxxpd = True
  1202.             Exit Function
  1203.         Else
  1204.             If pdhwk(Yxxpdh) And Yxxpdh + 1 <= .Rows - 1 Then
  1205.                 If .TextMatrix(Yxxpdh + 1, 0) <> "*" Then
  1206.                     Changelock = True
  1207.                     .RemoveItem Yxxpdh
  1208.                     If .Rows < Pmbcsjhs + .FixedRows + Fzxwghs + 1 Then
  1209.                     .AddItem ""
  1210.                     .RowHeight(.Rows - 1) = Sjhgd
  1211.                     End If
  1212.                     Changelock = False
  1213.                     Sjhzyxxpd = True
  1214.                     Exit Function
  1215.                 End If
  1216.             End If
  1217.         End If
  1218.         
  1219.         '行没有发生变化则不进行有效性判断
  1220.         If Hyxxpdlock Then
  1221.             Sjhzyxxpd = True
  1222.             Exit Function
  1223.         End If
  1224.   
  1225.         '以下为自定义部分[
  1226.         '1.放置行有效性判断程序
  1227.         '首先进行为空判断(固定不变)
  1228.         For jsqte = Qslz To .Cols - 1
  1229.             If (GridInt(jsqte, 5) = 1 And Len(Trim(.TextMatrix(Yxxpdh, jsqte))) = 0) Or (GridInt(jsqte, 5) = 2 And Val(Trim(.TextMatrix(Yxxpdh, jsqte))) = 0) Then
  1230.                 Tsxx = GridStr(jsqte, 2)
  1231.                 Lrywlz = jsqte
  1232.                 GoTo Lrcwcl
  1233.                 Exit For
  1234.             End If
  1235.         Next jsqte
  1236.     End With
  1237.     Sjhzyxxpd = True
  1238.     Hyxxpdlock = True
  1239.     Exit Function
  1240. Lrcwcl:      '录入错误处理
  1241.     With CzxsGrid
  1242.         Call Xtxxts(Tsxx, 0, 1)
  1243.         Changelock = True
  1244.         .Select Yxxpdh, Lrywlz
  1245.         Changelock = False
  1246.         Call xswbk
  1247.         Sjhzyxxpd = False
  1248.         Exit Function
  1249.     End With
  1250. End Function
  1251. Private Function sjzdyxxpd(Dqpdwgh As Long, Dqpdwgl As Long)        '录入数据字段有效性判断,同时进行字段录入事后处理
  1252.     Dim Str_JudgeText As String  '临时有效性判断字段内容
  1253.     Dim Coljsq As Long           '临时列计数器
  1254.     With CzxsGrid
  1255.         '非录入状态有效性为合法
  1256.         If Yxxpdlock Or .Row < .FixedRows Then
  1257.             sjzdyxxpd = True
  1258.             Exit Function
  1259.         End If
  1260.         Str_JudgeText = Trim(.TextMatrix(Dqpdwgh, Dqpdwgl))
  1261.     End With
  1262.     
  1263.     Select Case GridStr(Dqpdwgl, 1)
  1264.         '以下为自定义部分[
  1265.         Case "005"         '实际数量
  1266.             If Len(Str_JudgeText) <> 0 Then
  1267.                 If Trim(CzxsGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls))) <> "" Then
  1268.                     CzxsGrid.TextMatrix(Dqpdwgh, Sydz("006", GridStr(), Szzls)) = CStr(Format(Val(CzxsGrid.TextMatrix(Dqpdwgh, Sydz("004", GridStr(), Szzls))) * Val(CzxsGrid.TextMatrix(Dqpdwgh, Sydz("005", GridStr(), Szzls))), "0.00"))
  1269.                 Else
  1270.                     CzxsGrid.TextMatrix(Dqpdwgh, Sydz("006", GridStr(), Szzls)) = ""
  1271.                 End If
  1272.             End If
  1273.         
  1274.     End Select
  1275.     
  1276.      '根据转帐性质,判断按转帐科目号取项目大类还是按来源科目取项目大类
  1277.     '字段录入正确后为零字段清空
  1278.     Call Qkwlzd(Dqpdwgh, Dqpdwgl)
  1279.     sjzdyxxpd = True
  1280.     Yxxpdlock = True
  1281.     Exit Function
  1282. Lrcwcl:    '录入错误处理
  1283.     With CzxsGrid
  1284.         Call Xtxxts(Tsxx, 0, 1)
  1285.         Changelock = True
  1286.         .Select Dqpdwgh, Dqpdwgl
  1287.         If GridBoolean(.Col, 1) = True Then
  1288.             Changelock = False
  1289.             Call xswbk
  1290.             sjzdyxxpd = False
  1291.         End If
  1292.     End With
  1293.     Exit Function
  1294. End Function
  1295. Private Sub xswbk()                       '在当前选中单元显示文本框,列表框,帮助按钮(通用)
  1296.     Dim Wbkpy As Integer, Wbkpy1 As Integer '文本框偏移量
  1297.     
  1298.     If Lab_OperStatus.Caption = "1" Then
  1299.         Exit Sub
  1300.     End If
  1301.     '显示文本框前返回有效行列(解决滚动条问题)
  1302.     Call Xldqh
  1303.     Call Xldql
  1304.     
  1305.     '隐藏文本框,帮助按钮,列表组合框  ?何用
  1306.     Call Ycwbk
  1307.     
  1308.     With CzxsGrid
  1309.         Dqlrwgh = .Row
  1310.         Dqlrwgl = .Col
  1311.         If Not GridBoolean(.Col, 1) Or .Row < .FixedRows Then Exit Sub
  1312.         Wbkpy = 30
  1313.         Wbkpy1 = 15
  1314.         If GridBoolean(.Col, 3) Then        '若是下拉列表录入
  1315.             YdCombo.Left = .CellLeft + .Left + Wbkpy
  1316.             YdCombo.Top = .CellTop + .Top + Wbkpy
  1317.             YdCombo.Width = .CellWidth - Wbkpy1
  1318.             Call Wbkcl                          '主要是在下拉列表框可用之前填充下拉列表框
  1319.             YdCombo.Visible = True
  1320.             YdCombo.SetFocus
  1321.             Ydcommand.Visible = False
  1322.             Ydtext.Visible = False
  1323.         Else
  1324.             If GridBoolean(.Col, 2) Then        '是否提供帮助
  1325.                 Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
  1326.                 Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
  1327.                 Ydcommand.Visible = True
  1328.             Else
  1329.                 Ydcommand.Visible = False
  1330.             End If
  1331.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1332.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1333.             If Ydcommand.Visible Then
  1334.                 If Sfblbzkd Then
  1335.                     Ydtext.Width = .CellWidth - Ydcommand.Width
  1336.                 Else
  1337.                     Ydtext.Width = .CellWidth - Wbkpy1
  1338.                 End If
  1339.             Else
  1340.                 Ydtext.Width = .CellWidth - Wbkpy1
  1341.             End If
  1342.             Ydtext.Height = .CellHeight - Wbkpy1
  1343.             If GridInt(.Col, 2) <> 0 Then
  1344.                 Ydtext.MaxLength = GridInt(.Col, 2)
  1345.             Else
  1346.                 Ydtext.MaxLength = 3000
  1347.             End If
  1348.             ' 主要是Zdlrqnr = Trim(.Text)即将网格单元的内容赋予文本框,并且记录网格编辑之前的内容
  1349.             '为是否对该单元的内容进行字段有效判断加锁Yxxpdlock = False
  1350.             Call Wbkcl
  1351.             Ydtext.Visible = True
  1352.             Ydtext.SetFocus
  1353.         End If
  1354.         Dqtoprow = .TopRow
  1355.         Dqleftcol = .LeftCol
  1356.         
  1357.         '重置锁值
  1358.         Valilock = False
  1359.         Wbkbhlock = False
  1360.     End With
  1361. End Sub
  1362. Private Function Fun_AllowInput() As Boolean                           '当某种条件成立时禁止文本框激活使单据处于录入状态
  1363.    
  1364.     '如果单据操作状态为浏览状态则不能显示录入载体(通用)
  1365.     If Trim(Lab_OperStatus.Caption) = "1" Then
  1366.         Exit Function
  1367.     End If
  1368.    
  1369.     '[>>
  1370.     
  1371.         '此处可以填写禁止文本框激活使单据处于录入状态的理由
  1372.    
  1373.     '<<]
  1374.    
  1375.     Fun_AllowInput = True
  1376.     
  1377. End Function
  1378. Private Sub fhyxh()                                                     '返回录入数据有效行,同时让得到焦点网格可见
  1379.     With CzxsGrid
  1380.         If .Row >= .FixedRows Then
  1381.             If .TextMatrix(.Row, 0) <> "*" Then     '点击网格空区域时执行此语句
  1382.                 For Rowjsq = .FixedRows To .Rows - 1        '为找到最后一数据行的下一行
  1383.                     If .TextMatrix(Rowjsq, 0) <> "*" Then
  1384.                     Exit For
  1385.                     End If
  1386.                 Next Rowjsq
  1387.                 If Rowjsq <= .Rows - 1 Then
  1388.                     Changelock = True
  1389.                     .Select Rowjsq, .Col
  1390.                     Changelock = False
  1391.                 Else
  1392.                     Changelock = True
  1393.                     .Select .Rows - 1, .Col
  1394.                     Changelock = False
  1395.                 End If
  1396.             End If
  1397.             Call Xldqh
  1398.         End If
  1399.     End With
  1400. End Sub
  1401. Private Sub Xldql()                                                     '显露当前列
  1402.     Dim Leftcolte As Long
  1403.     With CzxsGrid
  1404.         If .Col >= Qslz Then
  1405.             If .LeftCol > .Col Then
  1406.                 .LeftCol = .Col
  1407.             End If
  1408.             Leftcolte = 0
  1409.             Do While .CellLeft + .CellWidth > .Width And .LeftCol <> Leftcolte
  1410.                 Leftcolte = .LeftCol
  1411.                 .LeftCol = .LeftCol + 1
  1412.             Loop
  1413.         End If
  1414.     End With
  1415. End Sub
  1416. Private Sub Qkwlzd(sjh As Long, Sjl As Long)                            '清空为零字段
  1417.     If Not GridBoolean(Sjl, 5) Then Exit Sub
  1418.     With CzxsGrid
  1419.         If Val(Trim(.TextMatrix(sjh, Sjl))) = 0 Then .TextMatrix(sjh, Sjl) = ""
  1420.     End With
  1421. End Sub
  1422. Private Sub Xldqh()                                                     '显露当前行
  1423.     Dim Toprowte As Long
  1424.     With CzxsGrid
  1425.         Toprowte = 0
  1426.         Do While .CellTop + .RowHeight(.Row) + Fzxwghs * Sjhgd > .Height And .TopRow <> Toprowte
  1427.             Toprowte = .TopRow
  1428.             .TopRow = .TopRow + 1
  1429.         Loop
  1430.         Toprowte = 0
  1431.         Do While .CellTop < .FixedRows * .RowHeight(0) And .TopRow <> Toprowte
  1432.             Toprowte = .TopRow
  1433.             .TopRow = .TopRow - 1
  1434.         Loop
  1435.     End With
  1436. End Sub
  1437. Private Sub Ycwbk()                                                    '隐藏文本框,帮助按钮,列表组合框
  1438.     Valilock = True
  1439.     Ydtext.Visible = False
  1440.     YdCombo.Visible = False
  1441.     Ydcommand.Visible = False
  1442. End Sub
  1443. Private Sub Wbkcl()                                                    '文本框录入之前处理(根据实际情况)
  1444.     Dim xswbrr As String
  1445.     With CzxsGrid
  1446.         Zdlrqnr = Trim(.Text)
  1447.         xswbrr = Trim(.Text)
  1448.         If GridBoolean(.Col, 3) Then   '列表框录入
  1449.             
  1450.             '填充列表框程序
  1451.             Call FillCombo(YdCombo, GridStr(.Col, 5), xswbrr, 0)
  1452.         Else
  1453.             Wbkbhlock = True
  1454.             
  1455.             '====以下为用户自定义
  1456.             Ydtext.Text = xswbrr
  1457.             '====以上为用户自定义
  1458.             
  1459.             Wbkbhlock = False
  1460.             Ydtext.SelStart = Len(Ydtext.Text)
  1461.         End If
  1462.     End With
  1463. End Sub
  1464. Private Sub Xyxhbz(sjh As Long)                                         '写行有效性标志,并判断是否增行
  1465.     With CzxsGrid
  1466.         If .TextMatrix(sjh, 0) = "*" Then
  1467.             Exit Sub
  1468.         End If
  1469.         .TextMatrix(sjh, 0) = "*"
  1470.         If sjh >= .Rows - Fzxwghs - 1 Then
  1471.             .AddItem ""
  1472.             .RowHeight(.Rows - 1) = Sjhgd
  1473.         End If
  1474.     End With
  1475. End Sub
  1476. Private Function pdhwk(sjh As Long)                                     '判断网格行是否为空行(所有录入字段均为空*非录入字段除外)
  1477.     With CzxsGrid
  1478.         For Coljsq = Qslz To .Cols - 1
  1479.             If Len(Trim(.TextMatrix(sjh, Coljsq))) <> 0 And GridBoolean(Coljsq, 1) Then
  1480.                 pdhwk = False
  1481.                 Exit Function
  1482.             End If
  1483.         Next Coljsq
  1484.         pdhwk = True
  1485.     End With
  1486. End Function
  1487. Private Sub Cxxswbk()                                                  'Formresize中重新显示文本框,列表框,帮助按钮(通用)
  1488.     Dim Wbkpy As Integer, Wbkpy1 As Integer
  1489.     Wbkpy = 30
  1490.     Wbkpy1 = 15
  1491.     With CzxsGrid
  1492.         If Ydcommand.Visible Then
  1493.             Ydcommand.Left = .Left + .CellLeft + .CellWidth - Ydcommand.Width + Wbkpy
  1494.             Ydcommand.Top = .Top + .CellTop + .CellHeight - Ydcommand.Height + Wbkpy
  1495.         End If
  1496.         If Ydtext.Visible Then
  1497.             If Ydcommand.Visible Then
  1498.                 If Sfblbzkd Then
  1499.                     Ydtext.Width = .CellWidth - Ydcommand.Width
  1500.                 Else
  1501.                     Ydtext.Width = .CellWidth - Wbkpy1
  1502.                 End If
  1503.             Else
  1504.                 Ydtext.Width = .CellWidth - Wbkpy1
  1505.             End If
  1506.             Ydtext.Left = .CellLeft + .Left + Wbkpy
  1507.             Ydtext.Top = .CellTop + .Top + Wbkpy
  1508.             Ydtext.Height = .CellHeight - Wbkpy1
  1509.         End If
  1510.     End With
  1511. End Sub
  1512. Private Function Fun_Drfrmyxxpd() As Boolean                             '调入其它窗体或功能产生的有效性判断(包括数据回写)
  1513.     '因为点工具栏的按纽时文本框或网格均没有失去焦点事件发生,为保证该操作之前进行录入数据的有效性判断而设。
  1514.     Fun_Drfrmyxxpd = True
  1515.     With CzxsGrid
  1516.         '如果当前网格处于编辑状态,则先进行数据回写再进行有效性判断
  1517.         If Ydtext.Visible Or YdCombo.Visible Then
  1518.             Call Lrsjhx
  1519.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1520.                 Fun_Drfrmyxxpd = False
  1521.                 Exit Function
  1522.             End If
  1523.         End If
  1524.         '进行行有效性判断
  1525.         If Not Sjhzyxxpd(.Row) Then
  1526.             Fun_Drfrmyxxpd = False
  1527.             Exit Function
  1528.         End If
  1529.     End With
  1530. End Function
  1531. Private Sub Sub_AbandonBill()                                              '放弃对当前的操作
  1532.     '先关闭录入载体
  1533.     Changelock = True
  1534.     Valilock = True
  1535.     Call Ycwbk
  1536.     Changelock = False
  1537.     Valilock = False
  1538.     Call Sub_Query
  1539.     '设置操作状态为浏览
  1540.     Lab_OperStatus = "1"
  1541.     Call Sub_OperStatus("11")
  1542. End Sub
  1543. Private Sub ydtext_Change()
  1544.     If Wbkbhlock Then
  1545.          Exit Sub
  1546.     End If
  1547.     With CzxsGrid
  1548.         '限制字段录入长度
  1549.         Wbkbhlock = True
  1550.         
  1551.         Select Case GridInt(.Col, 1)
  1552.             Case 8, 11   '金额型
  1553.                 Call Sjgskz(Ydtext, Xtjezws - Xtjexsws - 1, Xtjexsws)
  1554.             Case 9, 12   '数量型
  1555.                 Call Sjgskz(Ydtext, Xtslzws - Xtslxsws - 1, Xtslxsws)
  1556.             Case 10      '单价型
  1557.                 Call Sjgskz(Ydtext, Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1558.             Case Else    '其他类型
  1559.                 If GridInt(.Col, 3) <> 0 Or GridInt(.Col, 4) <> 0 Then
  1560.                     Call Sjgskz(Ydtext, GridInt(.Col, 3), GridInt(.Col, 4))
  1561.                 End If
  1562.         End Select
  1563.         
  1564.         Wbkbhlock = False
  1565.     End With
  1566. End Sub
  1567. Private Sub ydtext_KeyDown(KeyCode As Integer, Shift As Integer)
  1568.     Dim Rowjsq As Long, Coljsq As Long
  1569.    
  1570.     With CzxsGrid
  1571.         Select Case KeyCode
  1572.             Case vbKeyF2
  1573.                 Call Lrzdbz
  1574.             Case vbKeyEscape                'ESC 键放弃录入
  1575.                 Valilock = True
  1576.                 Call Ycwbk
  1577.                 .SetFocus
  1578.             Case vbKeyReturn                '回 车 键 =13
  1579.                 KeyCode = 0
  1580.                 .SetFocus
  1581.                 Call Lrsjhx
  1582.                 Rowjsq = .Row
  1583.                 Coljsq = .Col + 1
  1584.                 If Coljsq > .Cols - 1 Then
  1585.                     If Rowjsq < .Rows - 1 Then
  1586.                         Rowjsq = Rowjsq + 1
  1587.                     End If
  1588.                     Coljsq = Qslz
  1589.                 End If
  1590.                 Do While Rowjsq <= .Rows - 1
  1591.                     If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1592.                         Coljsq = Coljsq + 1
  1593.                         If Coljsq > .Cols - 1 Then
  1594.                             Rowjsq = Rowjsq + 1
  1595.                             Coljsq = Qslz
  1596.                         End If
  1597.                     Else
  1598.                         Exit Do
  1599.                     End If
  1600.                 Loop
  1601.                 If Rowjsq <= .Rows - 1 Then
  1602.                     .Select Rowjsq, Coljsq
  1603.                 End If
  1604.                 
  1605.             Case vbKeyUp                    '上 箭 头 =38
  1606.                 KeyCode = 0
  1607.                 .SetFocus
  1608.                 Call Lrsjhx
  1609.                 If .Row > .FixedRows Then
  1610.                     .Row = .Row - 1
  1611.                 End If
  1612.                 
  1613.             Case vbKeyDown                  '下 箭 头 =40
  1614.                 KeyCode = 0
  1615.                 .SetFocus
  1616.                 Call Lrsjhx
  1617.                 If .Row < .Rows - 1 Then
  1618.                     .Row = .Row + 1
  1619.                 End If
  1620.             Case vbKeyLeft                  '左 箭 头 =37
  1621.                 If .Col - 1 = Qslz Then
  1622.                     If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1623.                         GoTo jzzx
  1624.                     End If
  1625.                 End If
  1626.                 If Ydtext.SelStart = 0 And .Col > Qslz Then
  1627.                     KeyCode = 0
  1628.                     .SetFocus
  1629.                     Call Lrsjhx
  1630.                     Coljsq = .Col - 1
  1631.                     Do While Coljsq > Qslz
  1632.                         If Coljsq - 1 = Qslz Then
  1633.                             If .ColHidden(Qslz) Or (Not GridBoolean(Qslz, 1)) Then
  1634.                                 GoTo jzzx
  1635.                             End If
  1636.                         End If
  1637.                         If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1638.                             Coljsq = Coljsq - 1
  1639.                         Else
  1640.                             Exit Do
  1641.                         End If
  1642.                     Loop
  1643.                     .Select .Row, Coljsq
  1644.                 End If
  1645. jzzx:
  1646.            
  1647.            
  1648.             Case vbKeyRight                 '右 箭 头 =39
  1649.                 wblong = Len(Ydtext.Text)
  1650.                 If (Ydtext.SelStart = wblong Or Ydtext.SelLength = wblong) Then
  1651.                     KeyCode = 0
  1652.                     .SetFocus
  1653.                     Call Lrsjhx
  1654.                     Rowjsq = .Row
  1655.                     Coljsq = .Col + 1
  1656.                     If Coljsq > .Cols - 1 Then
  1657.                         If Rowjsq < .Rows - 1 Then
  1658.                             Rowjsq = Rowjsq + 1
  1659.                         End If
  1660.                         Coljsq = Qslz
  1661.                     End If
  1662.                     Do While Rowjsq <= .Rows - 1
  1663.                         If .ColHidden(Coljsq) Or (Not GridBoolean(Coljsq, 1)) Then
  1664.                             Coljsq = Coljsq + 1
  1665.                             If Coljsq > .Cols - 1 Then
  1666.                                 Rowjsq = Rowjsq + 1
  1667.                                 Coljsq = Qslz
  1668.                             End If
  1669.                         Else
  1670.                             Exit Do
  1671.                         End If
  1672.                     Loop
  1673.                     .Select Rowjsq, Coljsq
  1674.                 End If
  1675.             Case Else
  1676.         End Select
  1677.     End With
  1678. End Sub
  1679. Private Sub ydtext_KeyPress(KeyAscii As Integer)
  1680.     Call InputFieldLimit(Ydtext, GridInt(CzxsGrid.Col, 1), KeyAscii)
  1681. End Sub
  1682. Private Sub ydtext_LostFocus()
  1683.     With CzxsGrid
  1684.         If Not Valilock Then
  1685.             Call Lrsjhx
  1686.             If Not sjzdyxxpd(Dqlrwgh, Dqlrwgl) Then
  1687.                 Exit Sub
  1688.             End If
  1689.             If Not Sjhzyxxpd(Dqlrwgh) Then
  1690.                 Exit Sub
  1691.             End If
  1692.         End If
  1693.     End With
  1694. End Sub
  1695. Private Sub Lrzdbz()                                                      '录入字段帮助
  1696.     If Not Ydcommand.Visible Then
  1697.         Exit Sub
  1698.     End If
  1699.     Valilock = True         '为防止按ydText中帮助按纽时,引起ydText的LostFocus事件。
  1700.     With CzxsGrid
  1701.         '[>>会计科目编码帮助单独处理
  1702.         Select Case .Col
  1703.             Case Sydz("004", GridStr(), Szzls)
  1704.                 Xtcdcs = Trim(Ydtext.Text)
  1705.                 PZ_FrmKjkmcz.Show 1
  1706.                 If Len(Xtfhcs) <> 0 Then
  1707.                     Ydtext.Text = Xtfhcs
  1708.                 End If
  1709.             Case Else
  1710.                 '处理通用部分
  1711.                 Changelock = True        '调入另外窗体必须加锁,为不必执行网格的离开焦点造成的RowColChange事件
  1712.                                         '?没有必要,因为,文本框和命令按纽之间转换焦点,不会执行RowColChange
  1713.                 Call Drbmhelp(GridInt(.Col, 6), GridStr(.Col, 3), Trim(Ydtext.Text))
  1714.                 Changelock = False
  1715.                 If Len(Xtfhcs) <> 0 Then
  1716.                     If GridInt(.Col, 7) = 0 Then
  1717.                         Ydtext.Text = Xtfhcs
  1718.                     Else
  1719.                         Ydtext.Text = Xtfhcsfz
  1720.                     End If
  1721.                 End If
  1722.         End Select
  1723.         '[>>处理完毕
  1724.         Valilock = False
  1725.         If Ydtext.Visible Then
  1726.             Ydtext.SetFocus
  1727.         End If
  1728.     End With
  1729. End Sub
  1730. '==========================以下为自定义部分========================
  1731. '初始化成本中心
  1732. Sub CshCostCenter()
  1733.     Dim RecTemp As New ADODB.Recordset
  1734.     SqlStr = "Select CenterCode,CenterName From Cb_CostCenter Order By CenterCode"
  1735.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1736.     ReDim Combo_CenterCode(RecTemp.RecordCount)
  1737.     Do Until RecTemp.EOF
  1738.         Combo_Center.AddItem "(" + Trim(RecTemp.Fields("CenterCode")) + ")" + RecTemp.Fields("CenterName")
  1739.         Combo_CenterCode(Combo_Center.NewIndex) = RecTemp.Fields("CenterCode")
  1740.         RecTemp.MoveNext
  1741.     Loop
  1742.     If Combo_Center.ListCount >= 1 Then
  1743.         Combo_Center.ListIndex = 0
  1744.     End If
  1745. End Sub