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

企业管理

开发平台:

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