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