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

企业管理

开发平台:

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 FX_FrmCostReport 
  5.    Caption         =   "生产成本明细表"
  6.    ClientHeight    =   7320
  7.    ClientLeft      =   690
  8.    ClientTop       =   735
  9.    ClientWidth     =   10230
  10.    Icon            =   "成本分析_对象明细表.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form4"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   7320
  15.    ScaleWidth      =   10230
  16.    Begin VB.PictureBox Pic_Title 
  17.       AutoRedraw      =   -1  'True
  18.       BackColor       =   &H00FFFFFF&
  19.       Height          =   1065
  20.       Left            =   30
  21.       Picture         =   "成本分析_对象明细表.frx":1042
  22.       ScaleHeight     =   1005
  23.       ScaleWidth      =   11835
  24.       TabIndex        =   0
  25.       Top             =   555
  26.       Width           =   11895
  27.       Begin VB.ComboBox Combo_ReportType 
  28.          Height          =   300
  29.          ItemData        =   "成本分析_对象明细表.frx":35106
  30.          Left            =   9600
  31.          List            =   "成本分析_对象明细表.frx":35113
  32.          Style           =   2  'Dropdown List
  33.          TabIndex        =   23
  34.          Top             =   690
  35.          Width           =   1845
  36.       End
  37.       Begin VB.ComboBox Combo_Kjqj 
  38.          Height          =   300
  39.          Left            =   6090
  40.          Style           =   2  'Dropdown List
  41.          TabIndex        =   21
  42.          Top             =   690
  43.          Width           =   1875
  44.       End
  45.       Begin VB.ComboBox Cbo_Object 
  46.          Height          =   300
  47.          Left            =   1800
  48.          Style           =   2  'Dropdown List
  49.          TabIndex        =   11
  50.          Top             =   690
  51.          Width           =   2925
  52.       End
  53.       Begin VB.Label Label5 
  54.          AutoSize        =   -1  'True
  55.          BackStyle       =   0  'Transparent
  56.          Caption         =   "报表类型:"
  57.          Height          =   180
  58.          Left            =   8760
  59.          TabIndex        =   22
  60.          Top             =   750
  61.          Width           =   810
  62.       End
  63.       Begin VB.Label Lab_DW 
  64.          AutoSize        =   -1  'True
  65.          BackStyle       =   0  'Transparent
  66.          Height          =   180
  67.          Left            =   9210
  68.          TabIndex        =   18
  69.          Top             =   210
  70.          Width           =   90
  71.       End
  72.       Begin VB.Label Label8 
  73.          AutoSize        =   -1  'True
  74.          BackStyle       =   0  'Transparent
  75.          Caption         =   "单位:"
  76.          Height          =   180
  77.          Left            =   8670
  78.          TabIndex        =   17
  79.          Top             =   217
  80.          Width           =   450
  81.       End
  82.       Begin VB.Label Lab_LJCL 
  83.          AutoSize        =   -1  'True
  84.          BackStyle       =   0  'Transparent
  85.          Height          =   180
  86.          Left            =   7740
  87.          TabIndex        =   16
  88.          Top             =   210
  89.          Width           =   90
  90.       End
  91.       Begin VB.Label Label6 
  92.          AutoSize        =   -1  'True
  93.          BackStyle       =   0  'Transparent
  94.          Caption         =   "累计产量:"
  95.          Height          =   180
  96.          Left            =   6870
  97.          TabIndex        =   15
  98.          Top             =   210
  99.          Width           =   810
  100.       End
  101.       Begin VB.Label Lab_YCL 
  102.          AutoSize        =   -1  'True
  103.          BackStyle       =   0  'Transparent
  104.          Height          =   180
  105.          Left            =   5970
  106.          TabIndex        =   14
  107.          Top             =   210
  108.          Width           =   90
  109.       End
  110.       Begin VB.Label Label4 
  111.          AutoSize        =   -1  'True
  112.          BackStyle       =   0  'Transparent
  113.          Caption         =   "月产量:"
  114.          Height          =   180
  115.          Left            =   5220
  116.          TabIndex        =   13
  117.          Top             =   210
  118.          Width           =   630
  119.       End
  120.       Begin VB.Label Label2 
  121.          AutoSize        =   -1  'True
  122.          BackStyle       =   0  'Transparent
  123.          Caption         =   "会计期间:"
  124.          Height          =   180
  125.          Left            =   5220
  126.          TabIndex        =   12
  127.          Top             =   750
  128.          Width           =   810
  129.       End
  130.       Begin VB.Label Label1 
  131.          AutoSize        =   -1  'True
  132.          BackStyle       =   0  'Transparent
  133.          Caption         =   "核算对象:"
  134.          Height          =   180
  135.          Left            =   930
  136.          TabIndex        =   10
  137.          Top             =   750
  138.          Width           =   810
  139.       End
  140.       Begin VB.Label Lab_Row 
  141.          Alignment       =   2  'Center
  142.          Appearance      =   0  'Flat
  143.          AutoSize        =   -1  'True
  144.          BackColor       =   &H80000005&
  145.          BackStyle       =   0  'Transparent
  146.          ForeColor       =   &H00FF0000&
  147.          Height          =   180
  148.          Left            =   11010
  149.          TabIndex        =   5
  150.          Top             =   210
  151.          Width           =   90
  152.       End
  153.       Begin VB.Label tsLabel 
  154.          AutoSize        =   -1  'True
  155.          BackStyle       =   0  'Transparent
  156.          Caption         =   "(第"
  157.          Height          =   180
  158.          Index           =   3
  159.          Left            =   10545
  160.          TabIndex        =   4
  161.          Top             =   210
  162.          Width           =   270
  163.       End
  164.       Begin VB.Label tsLabel 
  165.          AutoSize        =   -1  'True
  166.          BackStyle       =   0  'Transparent
  167.          Caption         =   "行)"
  168.          Height          =   180
  169.          Index           =   4
  170.          Left            =   11160
  171.          TabIndex        =   3
  172.          Top             =   210
  173.          Width           =   270
  174.       End
  175.       Begin VB.Label tsLabel 
  176.          AutoSize        =   -1  'True
  177.          BackStyle       =   0  'Transparent
  178.          Caption         =   "当前记录"
  179.          Height          =   180
  180.          Index           =   5
  181.          Left            =   9735
  182.          TabIndex        =   2
  183.          Top             =   210
  184.          Width           =   720
  185.       End
  186.       Begin VB.Label tsLabel 
  187.          AutoSize        =   -1  'True
  188.          BackColor       =   &H80000018&
  189.          BackStyle       =   0  'Transparent
  190.          Caption         =   "生产成本明细表"
  191.          BeginProperty Font 
  192.             Name            =   "宋体"
  193.             Size            =   12
  194.             Charset         =   134
  195.             Weight          =   700
  196.             Underline       =   0   'False
  197.             Italic          =   0   'False
  198.             Strikethrough   =   0   'False
  199.          EndProperty
  200.          ForeColor       =   &H00000000&
  201.          Height          =   240
  202.          Index           =   7
  203.          Left            =   360
  204.          TabIndex        =   1
  205.          Top             =   240
  206.          Width           =   1785
  207.       End
  208.       Begin VB.Label Lab_Color 
  209.          Appearance      =   0  'Flat
  210.          BackColor       =   &H00DFDFDF&
  211.          BorderStyle     =   1  'Fixed Single
  212.          ForeColor       =   &H80000008&
  213.          Height          =   195
  214.          Index           =   1
  215.          Left            =   8520
  216.          TabIndex        =   20
  217.          Top             =   990
  218.          Visible         =   0   'False
  219.          Width           =   345
  220.       End
  221.       Begin VB.Label Lab_Color 
  222.          Appearance      =   0  'Flat
  223.          BackColor       =   &H00FFFFC0&
  224.          BorderStyle     =   1  'Fixed Single
  225.          ForeColor       =   &H80000008&
  226.          Height          =   195
  227.          Index           =   0
  228.          Left            =   8070
  229.          TabIndex        =   19
  230.          Top             =   990
  231.          Visible         =   0   'False
  232.          Width           =   345
  233.       End
  234.    End
  235.    Begin VSFlex8Ctl.VSFlexGrid WglrGrid 
  236.       Height          =   5925
  237.       Left            =   0
  238.       TabIndex        =   6
  239.       Top             =   1650
  240.       Width           =   11910
  241.       _cx             =   5080
  242.       _cy             =   5080
  243.       Appearance      =   1
  244.       BorderStyle     =   1
  245.       Enabled         =   -1  'True
  246.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  247.          Name            =   "宋体"
  248.          Size            =   9
  249.          Charset         =   134
  250.          Weight          =   400
  251.          Underline       =   0   'False
  252.          Italic          =   0   'False
  253.          Strikethrough   =   0   'False
  254.       EndProperty
  255.       MousePointer    =   0
  256.       BackColor       =   -2147483643
  257.       ForeColor       =   -2147483640
  258.       BackColorFixed  =   -2147483633
  259.       ForeColorFixed  =   -2147483630
  260.       BackColorSel    =   -2147483635
  261.       ForeColorSel    =   -2147483634
  262.       BackColorBkg    =   -2147483632
  263.       BackColorAlternate=   -2147483643
  264.       GridColor       =   -2147483633
  265.       GridColorFixed  =   -2147483632
  266.       TreeColor       =   -2147483632
  267.       FloodColor      =   192
  268.       SheetBorder     =   -2147483642
  269.       FocusRect       =   1
  270.       HighLight       =   1
  271.       AllowSelection  =   -1  'True
  272.       AllowBigSelection=   -1  'True
  273.       AllowUserResizing=   0
  274.       SelectionMode   =   0
  275.       GridLines       =   1
  276.       GridLinesFixed  =   2
  277.       GridLineWidth   =   1
  278.       Rows            =   5000
  279.       Cols            =   10
  280.       FixedRows       =   1
  281.       FixedCols       =   0
  282.       RowHeightMin    =   0
  283.       RowHeightMax    =   0
  284.       ColWidthMin     =   0
  285.       ColWidthMax     =   0
  286.       ExtendLastCol   =   0   'False
  287.       FormatString    =   ""
  288.       ScrollTrack     =   0   'False
  289.       ScrollBars      =   3
  290.       ScrollTips      =   0   'False
  291.       MergeCells      =   0
  292.       MergeCompare    =   0
  293.       AutoResize      =   -1  'True
  294.       AutoSizeMode    =   0
  295.       AutoSearch      =   0
  296.       AutoSearchDelay =   2
  297.       MultiTotals     =   -1  'True
  298.       SubtotalPosition=   1
  299.       OutlineBar      =   0
  300.       OutlineCol      =   0
  301.       Ellipsis        =   0
  302.       ExplorerBar     =   0
  303.       PicturesOver    =   0   'False
  304.       FillStyle       =   0
  305.       RightToLeft     =   0   'False
  306.       PictureType     =   0
  307.       TabBehavior     =   0
  308.       OwnerDraw       =   0
  309.       Editable        =   0
  310.       ShowComboButton =   1
  311.       WordWrap        =   0   'False
  312.       TextStyle       =   0
  313.       TextStyleFixed  =   0
  314.       OleDragMode     =   0
  315.       OleDropMode     =   0
  316.       DataMode        =   0
  317.       VirtualData     =   -1  'True
  318.       DataMember      =   ""
  319.       ComboSearch     =   3
  320.       AutoSizeMouse   =   -1  'True
  321.       FrozenRows      =   0
  322.       FrozenCols      =   0
  323.       AllowUserFreezing=   0
  324.       BackColorFrozen =   0
  325.       ForeColorFrozen =   0
  326.       WallPaperAlignment=   9
  327.       AccessibleName  =   ""
  328.       AccessibleDescription=   ""
  329.       AccessibleValue =   ""
  330.       AccessibleRole  =   24
  331.    End
  332.    Begin MSComctlLib.ImageList ImageList1 
  333.       Left            =   5280
  334.       Top             =   720
  335.       _ExtentX        =   1005
  336.       _ExtentY        =   1005
  337.       BackColor       =   -2147483643
  338.       ImageWidth      =   16
  339.       ImageHeight     =   16
  340.       MaskColor       =   12632256
  341.       _Version        =   393216
  342.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  343.          NumListImages   =   38
  344.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.             Picture         =   "成本分析_对象明细表.frx":35143
  346.             Key             =   "sz"
  347.          EndProperty
  348.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.             Picture         =   "成本分析_对象明细表.frx":354DD
  350.             Key             =   "dy"
  351.          EndProperty
  352.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.             Picture         =   "成本分析_对象明细表.frx":35877
  354.             Key             =   "yl"
  355.          EndProperty
  356.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.             Picture         =   "成本分析_对象明细表.frx":35C11
  358.             Key             =   "xg"
  359.          EndProperty
  360.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.             Picture         =   "成本分析_对象明细表.frx":35FAB
  362.             Key             =   "zh"
  363.          EndProperty
  364.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.             Picture         =   "成本分析_对象明细表.frx":36345
  366.             Key             =   "sh"
  367.          EndProperty
  368.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.             Picture         =   "成本分析_对象明细表.frx":366DF
  370.             Key             =   "bc"
  371.          EndProperty
  372.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.             Picture         =   "成本分析_对象明细表.frx":36A79
  374.             Key             =   "fq"
  375.          EndProperty
  376.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.             Picture         =   "成本分析_对象明细表.frx":36E13
  378.             Key             =   "bz"
  379.          EndProperty
  380.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.             Picture         =   "成本分析_对象明细表.frx":371AD
  382.             Key             =   "tc"
  383.          EndProperty
  384.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.             Picture         =   "成本分析_对象明细表.frx":37547
  386.             Key             =   "bcgs"
  387.          EndProperty
  388.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.             Picture         =   "成本分析_对象明细表.frx":378E1
  390.             Key             =   "mrlk"
  391.          EndProperty
  392.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.             Picture         =   "成本分析_对象明细表.frx":37C7B
  394.             Key             =   "xsxm"
  395.          EndProperty
  396.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.             Picture         =   "成本分析_对象明细表.frx":38015
  398.             Key             =   "first"
  399.          EndProperty
  400.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.             Picture         =   "成本分析_对象明细表.frx":383AF
  402.             Key             =   "prev"
  403.          EndProperty
  404.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.             Picture         =   "成本分析_对象明细表.frx":38749
  406.             Key             =   "next"
  407.          EndProperty
  408.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.             Picture         =   "成本分析_对象明细表.frx":38AE3
  410.             Key             =   "last"
  411.          EndProperty
  412.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.             Picture         =   "成本分析_对象明细表.frx":38E7D
  414.             Key             =   "xx"
  415.          EndProperty
  416.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.             Picture         =   "成本分析_对象明细表.frx":39217
  418.             Key             =   "define"
  419.          EndProperty
  420.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  421.             Picture         =   "成本分析_对象明细表.frx":395B1
  422.             Key             =   "exec"
  423.          EndProperty
  424.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  425.             Picture         =   "成本分析_对象明细表.frx":3994B
  426.             Key             =   "xz"
  427.          EndProperty
  428.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  429.             Picture         =   "成本分析_对象明细表.frx":39CE5
  430.             Key             =   "sc"
  431.          EndProperty
  432.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  433.             Picture         =   "成本分析_对象明细表.frx":3A07F
  434.             Key             =   "sx"
  435.          EndProperty
  436.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  437.             Picture         =   "成本分析_对象明细表.frx":3A419
  438.             Key             =   "cx"
  439.          EndProperty
  440.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  441.             Picture         =   "成本分析_对象明细表.frx":3A7B3
  442.             Key             =   "zd"
  443.          EndProperty
  444.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  445.             Picture         =   "成本分析_对象明细表.frx":3AB4D
  446.             Key             =   "dz"
  447.          EndProperty
  448.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  449.             Picture         =   "成本分析_对象明细表.frx":3AEE7
  450.             Key             =   "ph"
  451.          EndProperty
  452.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  453.             Picture         =   "成本分析_对象明细表.frx":3B281
  454.             Key             =   "fz"
  455.          EndProperty
  456.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  457.             Picture         =   "成本分析_对象明细表.frx":3B61B
  458.             Key             =   "dw"
  459.          EndProperty
  460.          BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  461.             Picture         =   "成本分析_对象明细表.frx":3B9B5
  462.             Key             =   "hf"
  463.          EndProperty
  464.          BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  465.             Picture         =   "成本分析_对象明细表.frx":3BD4F
  466.             Key             =   "pz"
  467.          EndProperty
  468.          BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  469.             Picture         =   "成本分析_对象明细表.frx":3C0E9
  470.             Key             =   "check"
  471.          EndProperty
  472.          BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  473.             Picture         =   "成本分析_对象明细表.frx":3C483
  474.             Key             =   "qs"
  475.          EndProperty
  476.          BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  477.             Picture         =   "成本分析_对象明细表.frx":3C81D
  478.             Key             =   "fullcheck"
  479.          EndProperty
  480.          BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  481.             Picture         =   "成本分析_对象明细表.frx":3CBB7
  482.             Key             =   "qq"
  483.          EndProperty
  484.          BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  485.             Picture         =   "成本分析_对象明细表.frx":3CF51
  486.             Key             =   "bcw"
  487.          EndProperty
  488.          BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  489.             Picture         =   "成本分析_对象明细表.frx":3D2EB
  490.             Key             =   "ye"
  491.          EndProperty
  492.          BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  493.             Picture         =   "成本分析_对象明细表.frx":3D685
  494.             Key             =   "Auto"
  495.          EndProperty
  496.       EndProperty
  497.    End
  498.    Begin MSComctlLib.Toolbar Tlb_Action 
  499.       Align           =   1  'Align Top
  500.       Height          =   555
  501.       Left            =   0
  502.       TabIndex        =   9
  503.       Top             =   0
  504.       Width           =   10230
  505.       _ExtentX        =   18045
  506.       _ExtentY        =   979
  507.       ButtonWidth     =   820
  508.       ButtonHeight    =   926
  509.       AllowCustomize  =   0   'False
  510.       Wrappable       =   0   'False
  511.       Appearance      =   1
  512.       Style           =   1
  513.       ImageList       =   "ImageList1"
  514.       _Version        =   393216
  515.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  516.          NumButtons      =   7
  517.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  518.             Caption         =   "设置"
  519.             Key             =   "ymsz"
  520.             Object.ToolTipText     =   "打印页面设置"
  521.             ImageIndex      =   1
  522.          EndProperty
  523.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  524.             Caption         =   "打印"
  525.             Key             =   "dy"
  526.             Object.ToolTipText     =   "打印当前单据或Ctrl+P"
  527.             ImageIndex      =   2
  528.          EndProperty
  529.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  530.             Caption         =   "预览"
  531.             Key             =   "yl"
  532.             ImageIndex      =   3
  533.          EndProperty
  534.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  535.             Style           =   3
  536.          EndProperty
  537.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  538.             Caption         =   "帮助"
  539.             Key             =   "bz"
  540.             ImageIndex      =   9
  541.          EndProperty
  542.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  543.             Style           =   3
  544.          EndProperty
  545.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  546.             Caption         =   "退出"
  547.             Key             =   "fh"
  548.             ImageIndex      =   10
  549.          EndProperty
  550.       EndProperty
  551.       BorderStyle     =   1
  552.       Begin MSComctlLib.Toolbar GsToolbar 
  553.          Height          =   525
  554.          Left            =   9270
  555.          TabIndex        =   8
  556.          Top             =   0
  557.          Width           =   2595
  558.          _ExtentX        =   4577
  559.          _ExtentY        =   926
  560.          ButtonWidth     =   1455
  561.          ButtonHeight    =   926
  562.          AllowCustomize  =   0   'False
  563.          Appearance      =   1
  564.          Style           =   1
  565.          ImageList       =   "ImageList1"
  566.          _Version        =   393216
  567.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  568.             NumButtons      =   3
  569.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  570.                Caption         =   "保存格式"
  571.                Key             =   "bcgs"
  572.                ImageKey        =   "bcgs"
  573.             EndProperty
  574.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  575.                Caption         =   "默认列宽"
  576.                Key             =   "hfmrgs"
  577.                ImageKey        =   "mrlk"
  578.             EndProperty
  579.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  580.                Caption         =   "显示项目"
  581.                Key             =   "szxsxm"
  582.                ImageKey        =   "xsxm"
  583.             EndProperty
  584.          EndProperty
  585.       End
  586.    End
  587.    Begin VB.Label Lab_Pzclzt 
  588.       BackColor       =   &H0000FFFF&
  589.       Caption         =   "2"
  590.       ForeColor       =   &H00808080&
  591.       Height          =   322
  592.       Left            =   9012
  593.       TabIndex        =   7
  594.       Top             =   553
  595.       Visible         =   0   'False
  596.       Width           =   403
  597.    End
  598. End
  599. Attribute VB_Name = "FX_FrmCostReport"
  600. Attribute VB_GlobalNameSpace = False
  601. Attribute VB_Creatable = False
  602. Attribute VB_PredeclaredId = True
  603. Attribute VB_Exposed = False
  604. '*********************************************************************************************************
  605. '*    模 块 名 称 :生产成本明细表
  606. '*    功 能 描 述 :生产成本明细表
  607. '*    程序员姓名  :xjl
  608. '*    最后修改人  :xjl
  609. '*    最后修改时间:2002/1/22
  610. '*    备        注:
  611. '*********************************************************************************************************
  612.  
  613.  '[以下为根据实际情况设置变量
  614.     Dim Rec_Defi As New ADODB.Recordset             '定义表
  615.     Dim Bln_BillChange As Boolean                   '标识单据是否发生改动
  616.     Dim jsqte  As Long                              '临时计数器
  617.     Dim SqlStr As String                            '临时的SQL字符串
  618.     Dim RecTemp As New ADODB.Recordset              '临时使用动态集
  619.     Dim Pr_ObjectCode() As String                   '归集对象编码
  620.     Dim ShowBillLock As Boolean                     '显示数据锁
  621.     Dim KJQJLock As Boolean                         '会计期间锁
  622.     Dim PrivateYear As Integer                      '当前年
  623.     Dim PrivateMm As Integer                        '当前月
  624.  ']
  625.  
  626.  '以下为固定使用变量(网格)
  627.     Dim Cxnrrec As New ADODB.Recordset              '显示查询内容动态集
  628.     Dim Dyymctbl As New DY_Dyymsz                   '打印页面窗体变量
  629.     Dim GridCode As String                          '显示网格网格代码
  630.     Dim GridInf() As Variant                        '整个网格设置信息
  631.     Dim ReportTitle As String                       '报表主标题
  632.     Dim Tsxx As String                              '系统提示信息
  633.     Dim Pmbcsjhs As Long                            '屏幕网格保持数据行数(大于等于1)
  634.     Dim Fzxwghs As Integer                          '辅助项网格行数(包括合计行)
  635.     Dim Sfxshjwg As Boolean                         '是否显示合计网格
  636.     Dim Qslz As Long                                '网格隐藏(非操作显示)列数
  637.     Dim Sjhgd As Double                             '网格数据行高度
  638.     Dim GridBoolean() As Boolean                    '网格列信息(布尔型)
  639.     Dim GridStr()  As String                        '网格列信息(字符型)
  640.     Dim GridInt() As Integer                        '网格列信息(整型)
  641.     Dim Sfblbzkd As Boolean                         '是否保留帮助宽度(字段提供帮助时,是否为按钮保留空间)
  642.     Dim Dqlrwgh As Long                             '当前录入数据网格行
  643.     Dim Dqlrwgl As Long                             '当前录入数据网格列
  644.     Dim Dqlkwgh As Long                             '刚刚离开网格行(不一定为录入行)
  645.     Dim Dqlkwgl As Long                             '刚刚离开网格列
  646.     Dim Dqtoprow As Long                            '当前录入状态时最上端可视行
  647.     Dim Dqleftcol As Long                           '当前录入状态时最左端可视列
  648.     Dim Zdlrqnr As String                           '字段录入修改前内容(用来判断内容是否修改)
  649.     Dim Wbkbhlock As Boolean                        '文本框改变值锁
  650.     Dim Changelock As Boolean                       '网格行列改变控制锁(用来区别用户改变.程序改变)
  651.     Dim Gdtlock As Boolean                          '滚动条滚动控制(用来区别用户改变.程序改变)
  652.     Dim Yxxpdlock As Boolean                        '字段有效性判断锁(内容不修改不需进行字段有效性判断)
  653.     Dim Hyxxpdlock As Boolean                       '行有效性判断锁(字段内容不修改不需进行行有效性判断)
  654.     Dim Valilock As Boolean                         '文本框失去焦点是否进行有效性控制(TRUE 为锁定*限用网格录入)
  655.     Dim Shsfts As Boolean                           '删除记录行是否提示
  656.     Dim Szzls As Integer                            '网格信息数组最大下标值(网格列数-1)
  657. Private Sub Cbo_Object_Click()                  '选择成本对象显示数据
  658.     If ShowBillLock = False Then Exit Sub
  659.     Call Lab_List               '显示LAB数据
  660.     Call ShowCostReport         '显示明细数据
  661. End Sub
  662. Private Sub Combo_KJQJ_Click()                  '选择会计科目显示数据
  663.     If KJQJLock = False Then
  664.         Exit Sub
  665.     End If
  666.     PrivateYear = Mid(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 1, 4)
  667.     PrivateMm = Right(Trim(CStr(Combo_KJQJ.List(Combo_KJQJ.ListIndex))), 2)
  668.     Call Lab_List               '显示LAB数据
  669.     Call ShowCostReport         '显示明细数据
  670. End Sub
  671. Private Sub Combo_ReportType_Click()            '选择报表类型
  672.     Call GridHidden(Combo_ReportType.ListIndex)
  673. End Sub
  674. Private Sub Form_KeyPress(KeyAscii As Integer)  '控制焦点转移
  675.     Dim jdzygs As Integer
  676.     jdzygs = 3
  677.     Select Case KeyAscii
  678.         Case vbKeyReturn
  679.             If Kjjdzy(jdzygs) Then
  680.             KeyAscii = 0
  681.             End If
  682.         Case 39           '屏蔽字符"'"
  683.             KeyAscii = 0
  684.     End Select
  685. End Sub
  686. Private Sub Form_Load()                         '窗体装入
  687.     '初始化各种锁值
  688.     Changelock = False             '网格行列改变控制锁
  689.     Gdtlock = False                '滚动条滚动控制
  690.     Yxxpdlock = True               '字段有效性判断锁
  691.     Hyxxpdlock = True              '行有效性判断锁
  692.     Wbkbhlock = False              '文本框内容改变锁
  693.     KJQJLock = False
  694.     ShowBillLock = False
  695.     PrivateYear = Xtyear
  696.     PrivateMm = Xtmm
  697.     
  698.     '报表主标题及报表编码
  699.     ReportTitle = "生产成本明细表"
  700.     XtReportCode = "Cb_CostReport"
  701.     Load Dyymctbl
  702.     '调入网格
  703.     GridCode = "Cb_CostReport"                                  '网格属性编码
  704.     Call BzWgcsh(WglrGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  705.     
  706.     Qslz = GridInf(1)
  707.     Sjhgd = GridInf(2)
  708.     Pmbcsjhs = GridInf(3)
  709.     Fzxwghs = GridInf(4)
  710.     Sfblbzkd = GridInf(5)
  711.     Shsfts = GridInf(6)
  712.     Sfxshjwg = GridInf(7)
  713.     Szzls = WglrGrid.Cols - 1
  714.     For jsqte = WglrGrid.FixedRows To WglrGrid.Rows - 1
  715.         WglrGrid.RowHeight(jsqte) = Sjhgd
  716.     Next jsqte
  717.     
  718.     Call Sub_CostObject                                         '显示成本对象
  719.     Call Sub_FillPeriod(Combo_KJQJ, PrivateYear, PrivateMm)     '会计期间
  720.     Combo_ReportType.ListIndex = 0                              '报表类型
  721.     
  722.     If Cbo_Object.ListCount > 0 Then
  723.         Call Lab_List                                               '显示LAB数据
  724.         Call ShowCostReport                                         '显示明细数据
  725.         KJQJLock = True
  726.     Else
  727.         Call Sub_OperStatus("10")
  728.     End If
  729.     ShowBillLock = True
  730. End Sub
  731. Private Sub Form_Resize()                           '调整窗体
  732.     On Error Resume Next
  733.     With WglrGrid
  734.         .Width = Me.Width - 160
  735.         .Height = Me.Height - .Top - 400
  736.     End With
  737.     With Pic_Title
  738.         .Width = Me.Width - 160
  739.     End With
  740.     
  741.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  742. End Sub
  743. Private Sub Form_Unload(Cancel As Integer)           '窗体卸载
  744.     '卸载打印页面窗体
  745.     Unload Dyymctbl
  746.         
  747.     '判断凭证是否发生变化
  748.     If Bln_BillChange Then
  749.         Xtfhcs = "1"
  750.     Else
  751.         Xtfhcs = "0"
  752.     End If
  753.     Set RecTemp = Nothing
  754. End Sub
  755. Private Sub Sub_ShowBill(Index As Integer)          '查找当前期间需盘存的项目
  756.     Dim DimYear As Integer
  757.     Dim DimMM As Integer
  758.     DimMM = PrivateMm - 1
  759.     If DimMM = 0 Then
  760.         DimYear = PrivateYear - 1
  761.         DimMM = 12
  762.     Else
  763.         DimYear = PrivateYear
  764.     End If
  765.     If Index = 0 Then   '未结帐
  766.         SqlStr = "Select * From (Select Objectcode,ItemCode,Substring(ParentCode,3,3) as ParentCode,Year,Period,ItemName,UnitCode,UnitName,PlanUnitPrice,PlanQuantity,PlanMoney," _
  767.                 & "PreMonAmount,PreMonMoney,ScatterQuantity As ThmonAmount,ScatterMoney AS ThmonMoney,InvQuantity As ThmonInvAmount,InvValue As ThmonInvMoney,ThmonConsumeAmount, " _
  768.                 & "ThmonConsumeMoney,ThMonFactUnAmount,ThMonFactUnMoney,TotalConsumeAmount,TotalConsumeMoney, " _
  769.                 & "TotalConsumeUnAmount,TotalConsumeUnMoney,ThMonRatioAmount,ThMonRatioMoney,TotalRationAmount As TotalRatioAmount, " _
  770.                 & "TotalRationMoney As TotalRatioMoney,IsShow,IsSum From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "', " _
  771.                 & "" + CStr(PrivateYear) + "," + CStr(PrivateMm) + "," + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ") " _
  772.                 & "Union " _
  773.                 & "Select '','',Substring(ParentCode,3,3),'','','小计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0, " _
  774.                 & "Sum(ScatterMoney),0,Sum(InvValue),0,Sum(ThmonConsumeMoney), " _
  775.                 & "0,Sum(ThMonFactUnMoney),0,Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThMonRatioMoney), " _
  776.                 & "0,Sum(TotalRationMoney),'','' " _
  777.                 & "From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "'," + CStr(PrivateYear) + "," + CStr(PrivateMm) + ", " _
  778.                 & "" + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ") Group By Substring(ParentCode,3,3) " _
  779.                 & "Union " _
  780.                 & "Select '','','总计','','','总计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0,Sum(ScatterMoney),0,Sum(InvValue),0,Sum(ThmonConsumeMoney), " _
  781.                 & "0,Sum(ThMonFactUnMoney),0,Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThMonRatioMoney), " _
  782.                 & "0,Sum(TotalRationMoney),'','' " _
  783.                 & "From Cb_Fn_Sccb('" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "'," + CStr(PrivateYear) + "," + CStr(PrivateMm) + ", " _
  784.                 & "" + CStr(DimYear) + "," + CStr(DimMM) + "," + CStr(Val(Lab_YCL.Caption)) + "," + CStr(Val(Lab_LJCL.Caption)) + ")) A Order By ParentCode ,ObjectCode desc"
  785.                 
  786.     Else                '已结帐
  787.         SqlStr = "Select * From (Select Objectcode,ItemCode,ParentCode,Year,Period,ItemName,UnitCode,UnitName,PlanUnitPrice,PlanQuantity," _
  788.                 & "PlanMoney,PreMonAmount,PreMonMoney,ThmonAmount,ThmonMoney,ThmonInvAmount,ThmonInvMoney, " _
  789.                 & "ThmonConsumeAmount,ThmonConsumeMoney,ThmonFactunAmount,ThmonFactunMoney,TotalConsumeAmount, " _
  790.                 & "TotalConsumeMoney,TotalConsumeUnAmount,TotalConsumeUnMoney,ThmonRatioAmount,ThmonRatioMoney, " _
  791.                 & "TotalRatioAmount,TotalRatioMoney,IsSum,IsShow From Cb_V_CostReprot " _
  792.                 & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
  793.                 & "Union " _
  794.                 & "Select '','',ParentCode,'','','小计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0, " _
  795.                 & "Sum(ThmonMoney),0,Sum(ThmonInvMoney),0,Sum(ThmonConsumeMoney), 0,Sum(ThmonFactunMoney),0, " _
  796.                 & "Sum(TotalConsumeMoney),0,Sum(TotalConsumeUnMoney),0,Sum(ThmonRatioMoney), 0,Sum(TotalRatioMoney),'','' " _
  797.                 & "From Cb_V_CostReprot " _
  798.                 & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
  799.                 & "Group By ParentCode " _
  800.                 & "Union " _
  801.                 & "Select '','','总计','','','总计','','元',0,0,Sum(PlanMoney),0,Sum(PreMonMoney),0,Sum(ThmonMoney),0, " _
  802.                 & "Sum(ThmonInvMoney),0,Sum(ThmonConsumeMoney), 0,Sum(ThmonFactunMoney),0,Sum(TotalConsumeMoney),0, " _
  803.                 & "Sum(TotalConsumeUnMoney),0,Sum(ThmonRatioMoney), 0,Sum(TotalRatioMoney),'','' " _
  804.                 & "From Cb_V_CostReprot " _
  805.                 & "Where ObjectCode='" + CStr(Pr_ObjectCode(Cbo_Object.ListIndex)) + "' And Year=" + CStr(PrivateYear) + " And Period=" + CStr(PrivateMm) + " " _
  806.                 & ") A Order By ParentCode ,ObjectCode Desc"
  807.     End If
  808.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  809.     With RecTemp
  810.         WglrGrid.Clear 1
  811.         If .EOF Then
  812.             Exit Sub
  813.         Else
  814.             WglrGrid.Rows = .RecordCount + WglrGrid.FixedRows
  815.             '[>>显示单据头
  816.             jsqte = WglrGrid.FixedRows
  817.             
  818.             Do While Not .EOF
  819.                 If jsqte >= WglrGrid.Rows Then
  820.                     WglrGrid.AddItem ""
  821.                 End If
  822.                 '[>>显示分录
  823.                 If Index = 0 Then
  824.                     Call Jltcwg(RecTemp, jsqte)     '写网格
  825.                     Call WriteCostData(RecTemp)     '写入成本数据
  826.                 Else
  827.                     Call Jltcwg(RecTemp, jsqte)     '写网格
  828.                 End If
  829.                 If Trim(.Fields("Itemcode")) = "" Then
  830.                     WglrGrid.Cell(flexcpBackColor, jsqte, 0, jsqte, WglrGrid.Cols - 1) = Lab_Color(1).BackColor
  831.                 End If
  832.                 If Trim(.Fields("ParentCode")) = "总计" Then
  833.                     WglrGrid.Cell(flexcpBackColor, jsqte, 0, jsqte, WglrGrid.Cols - 1) = Lab_Color(0).BackColor
  834.                 End If
  835.                 
  836.                 '<<]
  837.                 WglrGrid.RowHeight(jsqte) = Sjhgd
  838.                 .MoveNext
  839.                 jsqte = jsqte + 1
  840.             Loop
  841.         End If
  842.     End With
  843. End Sub
  844. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, jsqte As Long)                                     '记录内容填充网格
  845.     With Jlbrec
  846.         WglrGrid.TextMatrix(jsqte, 0) = "*"                                                                         '行标识
  847.         WglrGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("ItemCode") & "")                  '项目编码
  848.         WglrGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("ItemName") & "")                  '项目名称
  849.         WglrGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("UnitName") & "")                  '计量单位
  850.         WglrGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("PlanUnitPrice") & "")             '单位定额
  851.         WglrGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("PlanQuantity") & "")              '单位定额
  852.         WglrGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PlanMoney") & "")                 '单位定额
  853.         WglrGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("PreMonAmount") & "")              '本月实耗
  854.         WglrGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("PreMonMoney") & "")               '本月实耗
  855.         WglrGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("ThmonAmount") & "")               '本月实耗
  856.         WglrGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("ThmonMoney") & "")                '本月实耗
  857.         WglrGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("ThmonInvAmount") & "")            '本月实耗
  858.         WglrGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("ThmonInvMoney") & "")             '本月实耗
  859.         WglrGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("ThmonConsumeAmount") & "")        '本月实耗
  860.         WglrGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("ThmonConsumeMoney") & "")         '本月实耗
  861.         WglrGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("ThMonFactUnAmount") & "")         '实单耗
  862.         WglrGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("ThMonFactUnMoney") & "")          '实单耗
  863.         WglrGrid.TextMatrix(jsqte, Sydz("017", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeAmount") & "")        '累计成本
  864.         WglrGrid.TextMatrix(jsqte, Sydz("018", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeMoney") & "")         '累计成本
  865.         WglrGrid.TextMatrix(jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeUnAmount") & "")      '累计成本
  866.         WglrGrid.TextMatrix(jsqte, Sydz("020", GridStr(), Szzls)) = Trim(.Fields("TotalConsumeUnMoney") & "")       '累计成本
  867.         WglrGrid.TextMatrix(jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("ThMonRatioAmount") & "")          '月份与计划比(+/-)
  868.         WglrGrid.TextMatrix(jsqte, Sydz("022", GridStr(), Szzls)) = Trim(.Fields("ThMonRatioMoney") & "")           '月份与计划比(+/-)
  869.         WglrGrid.TextMatrix(jsqte, Sydz("023", GridStr(), Szzls)) = Trim(.Fields("TotalRatioAmount") & "")         '累计与计划比(+/-)
  870.         WglrGrid.TextMatrix(jsqte, Sydz("024", GridStr(), Szzls)) = Trim(.Fields("TotalRatioMoney") & "")          '累计与计划比(+/-)
  871.     End With
  872. End Sub
  873. Private Sub Tlb_Action_ButtonClick(ByVal Button As MSComctlLib.Button)             '用户点击工具条
  874.      
  875.     '屏蔽文本框,下拉组合框有效性判断,即在网格单元内录入数据时,点帮助信息等,不执行文本框等验证,即不执行YdText或YdCombo的LostFocus事件.
  876.     Valilock = True
  877.     
  878.     '屏蔽网格失去焦点产生的有效性判断
  879.     Changelock = True
  880.     Select Case Button.Key
  881.         Case "ymsz"                                          '页面设置
  882.             Dyymctbl.Show 1
  883.         Case "yl"                                            '预 览
  884.             Call bbyl(True)
  885.         Case "dy"                                            '打 印
  886.             Call bbyl(False)
  887.         Case "bz"                                            '帮 助
  888.             Call F1bz
  889.         Case "fh"                                            '退 出
  890.             Unload Me
  891.     End Select
  892.     '解 锁
  893.     Valilock = False
  894.     Changelock = False
  895. End Sub
  896. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)                        '支持热键操作,更确切地讲,是工具栏热键
  897.     If Shift = 2 Then   'Ctrl的位屏蔽值=2
  898.         Select Case UCase(Chr(KeyCode))
  899.             Case "P"                   'Ctrl+P 打印
  900.                 If Tlb_Action.Buttons("dy").Enabled Then Call bbyl(False)
  901.         End Select
  902.     End If
  903. End Sub
  904. Private Sub Sub_OperStatus(Str_Status As String)                                    '工具条依据不同状态所进行的变化
  905.     With Tlb_Action
  906.         Select Case Str_Status
  907.             Case "10"   '浏览(系统进入、放弃新增单据、填制凭证时删除单据,凭证审核)
  908.                 '工具条
  909.                 '.Buttons("dy").Enabled = False      '打印
  910.                 '.Buttons("yl").Enabled = False      '预览
  911.             Case "11"   '浏览(放弃修改单据,查询单据)
  912.                  '工具条
  913.                 .Buttons("dy").Enabled = True      '打印
  914.                 .Buttons("yl").Enabled = True      '预览
  915.                 .Buttons("xg").Enabled = True      '修改
  916.                 .Buttons("Auto").Enabled = True    '自动填充
  917.                 
  918.             Case "30"   '修改
  919.                 '工具条
  920.                 .Buttons("dy").Enabled = False      '打印
  921.                 .Buttons("yl").Enabled = False      '预览
  922.                 .Buttons("xg").Enabled = False      '修改
  923.                 .Buttons("Auto").Enabled = False    '自动填充
  924.         End Select
  925.     End With
  926. End Sub
  927. Private Sub WglrGrid_EnterCell()                                        '显示当前数据行相关信息
  928.     With WglrGrid
  929.         If .Row >= .FixedRows Then
  930.             Lab_Row = Trim(Str(.Row - .FixedRows + 1))
  931.         End If
  932.     End With
  933. End Sub
  934. Private Sub WglrGrid_GotFocus()                                         '网格得到焦点
  935.     '网格得到焦点,如果当前选择行为非数据行
  936.     '则调整当前焦点至有效数据行
  937.     With WglrGrid
  938.         If .Row < .FixedRows And .Rows > .FixedRows Then
  939.             Changelock = True
  940.             .Select .FixedRows, .Col
  941.             Changelock = False
  942.         End If
  943.         If .Col < Qslz Then
  944.             Changelock = True
  945.             .Select .Row, Qslz
  946.             Changelock = False
  947.         End If
  948.     End With
  949. End Sub
  950. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  951.     Select Case Button.Key
  952.         Case "bcgs"                              '保存表格格式
  953.             Call Bcwggs(WglrGrid, GridCode, GridStr())
  954.         Case "hfmrgs"                            '恢复默认格式
  955.             Call Hfmrgs(WglrGrid, GridCode, GridStr())
  956.         Case "szxsxm"                            '设置显示项目
  957.             Call Szxsxm(WglrGrid, GridCode)
  958.     End Select
  959. End Sub
  960. Private Sub bbyl(bbylte As Boolean)                                     '打印预览(通用)
  961.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  962.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  963.     Bbxbtgs = 1                                  '报 表 小 标 题 行 数
  964.     Bbbwhgs = 1                                  '报 表 表 尾 行 数
  965.     ReDim Bbxbt(1 To Bbxbtgs)
  966.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  967.     If Bbbwhgs <> 0 Then
  968.         ReDim Bbbwh(1 To Bbbwhgs)
  969.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  970.     End If
  971.     Bbzbt = ReportTitle
  972.     '报表行组织形式(0-居左 1-居中 2-居右)
  973.     bbxbtzzxs(1) = 0
  974.     '报表行组织形式(0-居左 1-居中 2-居右)
  975.     If Cbo_Object.ListCount > 0 Then
  976.         Bbxbt(1) = Space(2) + Fun_FormatOutPut("成本对象:" + Right(Trim(Cbo_Object.List(Cbo_Object.ListIndex)), Len(Trim(Cbo_Object.List(Cbo_Object.ListIndex))) - 2), 95)
  977.         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)
  978.         Bbxbt(1) = Bbxbt(1) + "月产量:" + Lab_YCL.Caption + Space(3) + "累计产量:" + Lab_LJCL.Caption + Space(3) + "单位:" + Lab_DW.Caption
  979.     Else
  980.         Bbxbt(1) = Space(2) + "成本对象:"
  981.     End If
  982.     Call Scyxsjb(WglrGrid)                               '生成报表数据
  983.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  984.     If Not bbylte Then
  985.         Unload DY_Tybbyldy
  986.     End If
  987. End Sub
  988. Sub Sub_CostObject()                                                    '显示对象
  989.     SqlStr = " Select Objectcode,ObjectName From Cb_CostObject"
  990.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  991.     Cbo_Object.Clear
  992.     If Not RecTemp.EOF Then
  993.         ReDim Pr_ObjectCode(RecTemp.RecordCount - 1)
  994.         Do Until RecTemp.EOF
  995.             Cbo_Object.AddItem Trim(RecTemp(0)) + Trim(RecTemp(1))
  996.             Pr_ObjectCode(Cbo_Object.NewIndex) = Trim(RecTemp(0))
  997.             RecTemp.MoveNext
  998.         Loop
  999.     End If
  1000.     If Cbo_Object.ListCount >= 1 Then
  1001.         Cbo_Object.ListIndex = 0
  1002.     End If
  1003. End Sub
  1004. Sub GridHidden(Bz As Integer)                                          '调整网格
  1005.     For Int_Coljsq = 0 To WglrGrid.Cols - 1
  1006.         WglrGrid.ColHidden(Int_Coljsq) = True
  1007.     Next Int_Coljsq
  1008.     Select Case Bz
  1009.         Case 0
  1010.             'ReportTitle = "生 产 费 用 表(股份分司)"
  1011.             WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
  1012.             WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
  1013.             WglrGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
  1014.             WglrGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
  1015.             WglrGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
  1016.             WglrGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False
  1017.             WglrGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False
  1018.             WglrGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False
  1019.             WglrGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False
  1020.             WglrGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False
  1021.             WglrGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False
  1022.             WglrGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False
  1023.             WglrGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False
  1024.             WglrGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False
  1025.             WglrGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False
  1026.             WglrGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False
  1027.             WglrGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False
  1028.             WglrGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False
  1029.             WglrGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False
  1030.             WglrGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False
  1031.             WglrGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False
  1032.             WglrGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False
  1033.             WglrGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False
  1034.         Case 1
  1035.             'ReportTitle = "生 产 费 用 核 算 表(股份分司)"
  1036.             WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
  1037.             WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
  1038.             WglrGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
  1039.             WglrGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
  1040.             WglrGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
  1041.             WglrGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False
  1042.             WglrGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False
  1043.             WglrGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False
  1044.             WglrGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False
  1045.             WglrGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False
  1046.             WglrGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False
  1047.             WglrGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False
  1048.             WglrGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False
  1049.             WglrGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False
  1050.             WglrGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False
  1051.         Case 2
  1052.             'ReportTitle = "生 产 费 用 分 析 表(股份分司)"
  1053.             WglrGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
  1054.             WglrGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
  1055.             WglrGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False
  1056.             WglrGrid.ColHidden(Sydz("018", GridStr(), Szzls)) = False
  1057.             WglrGrid.ColHidden(Sydz("019", GridStr(), Szzls)) = False
  1058.             WglrGrid.ColHidden(Sydz("020", GridStr(), Szzls)) = False
  1059.             WglrGrid.ColHidden(Sydz("021", GridStr(), Szzls)) = False
  1060.             WglrGrid.ColHidden(Sydz("022", GridStr(), Szzls)) = False
  1061.             WglrGrid.ColHidden(Sydz("023", GridStr(), Szzls)) = False
  1062.             WglrGrid.ColHidden(Sydz("024", GridStr(), Szzls)) = False
  1063.         End Select
  1064. End Sub
  1065. Sub Lab_List()                                                          'Lab数据
  1066.     '单位
  1067.     SqlStr = "Select UnitName From Cb_CostObject A " _
  1068.                 & "Left Outer Join Gy_UnitSet B On A.MeasureUnitCode=B.UnitCode " _
  1069.                 & "Where A.ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "'"
  1070.                 
  1071.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1072.     If Not RecTemp.EOF Then
  1073.         Lab_DW = RecTemp.Fields("UnitName") & ""
  1074.     Else
  1075.         Lab_DW = ""
  1076.     End If
  1077.     
  1078.     '月产量
  1079.     SqlStr = "Select Quantity From Cb_ObjectComplete Where ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "'  " _
  1080.                 & "And Year='" + CStr(PrivateYear) + "' And Period='" + CStr(PrivateMm) + "'"
  1081.                 
  1082.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1083.     If Not RecTemp.EOF Then
  1084.         Lab_YCL = Format(RecTemp.Fields("Quantity"), "0.0000")
  1085.     Else
  1086.         Lab_YCL = "0.0000"
  1087.     End If
  1088.     
  1089.     '累计产量
  1090.     SqlStr = "Select Sum(Quantity) As CL From Cb_ObjectComplete Where ObjectCode='" + Pr_ObjectCode(Cbo_Object.ListIndex) + "'  " _
  1091.                     & "And Year='" + CStr(PrivateYear) + "' And Period<='" + CStr(PrivateMm) + "'"
  1092.                     
  1093.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1094.     If Not RecTemp.EOF Then
  1095.         Lab_LJCL.Caption = Format(RecTemp.Fields("CL"), "0.0000")
  1096.     Else
  1097.         Lab_LJCL.Caption = "0.0000"
  1098.     End If
  1099.     
  1100. End Sub
  1101. Sub WriteCostData(RecTemp As ADODB.Recordset)                       '写入成本数据
  1102.     If Trim(RecTemp.Fields("ObjectCode")) & "" <> "" Then
  1103.         With Cxnrrec
  1104.             Cw_DataEnvi.DataConnect.Execute ("Delete From Cb_Sccbb Where ObjectCode='" & Trim(RecTemp.Fields("ObjectCode")) & "' And ItemCode='" & RecTemp.Fields("ItemCode") & "' And Year='" & PrivateYear & "' And Period='" & PrivateMm & "'")
  1105.             If .State = 1 Then .Close
  1106.             .Open "Select * From Cb_Sccbb Where 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1107.             .AddNew
  1108.             .Fields("Objectcode") = Trim(RecTemp.Fields("Objectcode"))                       '对象编码
  1109.             .Fields("ItemCode") = Trim(RecTemp.Fields("ItemCode"))                           '项目编码
  1110.             .Fields("ParentCode") = Trim(RecTemp.Fields("ParentCode"))                       '一级编码
  1111.             .Fields("Year") = Trim(RecTemp.Fields("Year"))                                   '会计年度
  1112.             .Fields("Period") = Trim(RecTemp.Fields("Period"))                               '会计期间
  1113.             .Fields("UnitCode") = Trim(RecTemp.Fields("UnitCode"))                           '单位编码
  1114.             .Fields("PlanUnitPrice") = Trim(RecTemp.Fields("PlanUnitPrice"))                 '计划单价
  1115.             .Fields("PlanQuantity") = Trim(RecTemp.Fields("PlanQuantity"))                   '计划数量
  1116.             .Fields("PlanMoney") = Trim(RecTemp.Fields("PlanMoney"))                         '计划成本
  1117.             .Fields("PreMonAmount") = Trim(RecTemp.Fields("PreMonAmount"))                   '本月实耗
  1118.             .Fields("PreMonMoney") = Trim(RecTemp.Fields("PreMonMoney"))                     '本月实耗
  1119.             .Fields("ThmonAmount") = Trim(RecTemp.Fields("ThmonAmount"))                     '本月实耗
  1120.             .Fields("ThmonMoney") = Trim(RecTemp.Fields("ThmonMoney"))                       '本月实耗
  1121.             .Fields("ThmonInvAmount") = Trim(RecTemp.Fields("ThmonInvAmount"))               '本月实耗
  1122.             .Fields("ThmonInvMoney") = Trim(RecTemp.Fields("ThmonInvMoney"))                 '本月实耗
  1123.             .Fields("ThmonConsumeAmount") = Trim(RecTemp.Fields("ThmonConsumeAmount"))       '本月实耗
  1124.             .Fields("ThmonConsumeMoney") = Trim(RecTemp.Fields("ThmonConsumeMoney"))         '本月实耗
  1125.             .Fields("ThmonFactunAmount") = Trim(RecTemp.Fields("ThMonFactUnAmount"))         '实单耗
  1126.             .Fields("ThmonFactunMoney") = Trim(RecTemp.Fields("ThMonFactUnMoney"))           '实单耗
  1127.             .Fields("TotalConsumeAmount") = Trim(RecTemp.Fields("TotalConsumeAmount"))       '累计成本
  1128.             .Fields("TotalConsumeMoney") = Trim(RecTemp.Fields("TotalConsumeMoney"))         '累计成本
  1129.             .Fields("TotalConsumeUnAmount") = Trim(RecTemp.Fields("TotalConsumeUnAmount"))   '单位成本
  1130.             .Fields("TotalConsumeUnMoney") = Trim(RecTemp.Fields("TotalConsumeUnMoney"))     '单位成本
  1131.             .Fields("ThmonRatioAmount") = Trim(RecTemp.Fields("ThMonRatioAmount"))           '月份与计划比
  1132.             .Fields("ThmonRatioMoney") = Trim(RecTemp.Fields("ThMonRatioMoney"))             '月份与计划比
  1133.             .Fields("TotalRatioAmount") = Trim(RecTemp.Fields("TotalRatioAmount"))           '累计与计划比
  1134.             .Fields("TotalRatioMoney") = Trim(RecTemp.Fields("TotalRatioMoney"))             '累计与计划比
  1135.             .Fields("IsSum") = RecTemp.Fields("IsShow")                                      '显示否
  1136.             .Fields("IsShow") = RecTemp.Fields("IsSum")                                      '计算否
  1137.             .Update
  1138.         End With
  1139.     End If
  1140. End Sub
  1141. Sub ShowCostReport()                                        '显示报表明细数据
  1142.     '会计日历
  1143.     SqlStr = "Select Count(*) From gy_kjrlb where kjyear='" + Trim(Str(PrivateYear)) + "' And Period='" + CStr(PrivateMm) + "' " _
  1144.                     & "And CwzzJzbz='1'"
  1145.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  1146.     If RecTemp.Fields(0) > 0 Then
  1147.         '显示数据
  1148.         Call Sub_ShowBill(1)
  1149.     Else
  1150.         '显示数据
  1151.         Call Sub_ShowBill(0)
  1152.     End If
  1153. End Sub