上传用户: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 Xs_A_FrameAnalysis 
  5.    Caption         =   "销售结构分析"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   5001
  11.    Icon            =   "销售结构查询结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.Toolbar GsToolbar 
  19.       Height          =   525
  20.       Left            =   10095
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   1710
  24.       _ExtentX        =   3016
  25.       _ExtentY        =   926
  26.       ButtonWidth     =   1455
  27.       ButtonHeight    =   926
  28.       Appearance      =   1
  29.       Style           =   1
  30.       ImageList       =   "ImageList2"
  31.       _Version        =   393216
  32.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  33.          NumButtons      =   3
  34.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  35.             Caption         =   "保存格式"
  36.             Key             =   "bcgs"
  37.             ImageKey        =   "bcgs"
  38.          EndProperty
  39.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  40.             Caption         =   "默认列宽"
  41.             Key             =   "hfmrgs"
  42.             ImageKey        =   "mrlk"
  43.          EndProperty
  44.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  45.             Object.Visible         =   0   'False
  46.             Caption         =   "显示项目"
  47.             Key             =   "szxsxm"
  48.             ImageKey        =   "xsxm"
  49.          EndProperty
  50.       EndProperty
  51.    End
  52.    Begin VB.PictureBox Pic_Title 
  53.       BackColor       =   &H00FFFFFF&
  54.       Height          =   825
  55.       Left            =   -45
  56.       Picture         =   "销售结构查询结果.frx":1042
  57.       ScaleHeight     =   765
  58.       ScaleWidth      =   11715
  59.       TabIndex        =   1
  60.       Top             =   645
  61.       Width           =   11775
  62.       Begin VB.Label Lbl 
  63.          AutoSize        =   -1  'True
  64.          BackStyle       =   0  'Transparent
  65.          Caption         =   "货物编码:"
  66.          Height          =   180
  67.          Index           =   6
  68.          Left            =   7455
  69.          TabIndex        =   11
  70.          Top             =   390
  71.          Width           =   810
  72.       End
  73.       Begin VB.Label Lbl 
  74.          AutoSize        =   -1  'True
  75.          BackStyle       =   0  'Transparent
  76.          Caption         =   "地区:"
  77.          Height          =   180
  78.          Index           =   3
  79.          Left            =   5085
  80.          TabIndex        =   10
  81.          Top             =   390
  82.          Width           =   450
  83.       End
  84.       Begin VB.Label Lbl 
  85.          AutoSize        =   -1  'True
  86.          BackStyle       =   0  'Transparent
  87.          Caption         =   "部门:"
  88.          Height          =   180
  89.          Index           =   0
  90.          Left            =   5085
  91.          TabIndex        =   9
  92.          Top             =   135
  93.          Width           =   450
  94.       End
  95.       Begin VB.Label Lbl 
  96.          AutoSize        =   -1  'True
  97.          BackStyle       =   0  'Transparent
  98.          Caption         =   "行业:"
  99.          Height          =   180
  100.          Index           =   1
  101.          Left            =   2580
  102.          TabIndex        =   8
  103.          Top             =   390
  104.          Width           =   450
  105.       End
  106.       Begin VB.Label Lbl 
  107.          AutoSize        =   -1  'True
  108.          BackStyle       =   0  'Transparent
  109.          Caption         =   "销售员:"
  110.          Height          =   180
  111.          Index           =   2
  112.          Left            =   9450
  113.          TabIndex        =   7
  114.          Top             =   135
  115.          Width           =   630
  116.       End
  117.       Begin VB.Label Lbl 
  118.          AutoSize        =   -1  'True
  119.          BackStyle       =   0  'Transparent
  120.          Caption         =   "日期:"
  121.          Height          =   180
  122.          Index           =   4
  123.          Left            =   2580
  124.          TabIndex        =   6
  125.          Top             =   135
  126.          Width           =   450
  127.       End
  128.       Begin VB.Label Lbl 
  129.          AutoSize        =   -1  'True
  130.          BackStyle       =   0  'Transparent
  131.          Caption         =   "销售类型:"
  132.          Height          =   180
  133.          Index           =   5
  134.          Left            =   7455
  135.          TabIndex        =   5
  136.          Top             =   135
  137.          Width           =   810
  138.       End
  139.       Begin VB.Label Lab_Title 
  140.          AutoSize        =   -1  'True
  141.          BackColor       =   &H80000018&
  142.          BackStyle       =   0  'Transparent
  143.          Caption         =   "销售结构分析"
  144.          BeginProperty Font 
  145.             Name            =   "宋体"
  146.             Size            =   12
  147.             Charset         =   134
  148.             Weight          =   700
  149.             Underline       =   0   'False
  150.             Italic          =   0   'False
  151.             Strikethrough   =   0   'False
  152.          EndProperty
  153.          ForeColor       =   &H00000000&
  154.          Height          =   240
  155.          Index           =   4
  156.          Left            =   480
  157.          TabIndex        =   2
  158.          Top             =   210
  159.          Width           =   1530
  160.       End
  161.    End
  162.    Begin VB.Timer Timer1 
  163.       Enabled         =   0   'False
  164.       Interval        =   1
  165.       Left            =   7620
  166.       Top             =   90
  167.    End
  168.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  169.       Height          =   7545
  170.       Left            =   -15
  171.       TabIndex        =   0
  172.       Top             =   1545
  173.       Width           =   11775
  174.       _cx             =   5080
  175.       _cy             =   5080
  176.       Appearance      =   1
  177.       BorderStyle     =   1
  178.       Enabled         =   -1  'True
  179.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  180.          Name            =   "宋体"
  181.          Size            =   9
  182.          Charset         =   134
  183.          Weight          =   400
  184.          Underline       =   0   'False
  185.          Italic          =   0   'False
  186.          Strikethrough   =   0   'False
  187.       EndProperty
  188.       MousePointer    =   0
  189.       BackColor       =   16777215
  190.       ForeColor       =   -2147483640
  191.       BackColorFixed  =   13826538
  192.       ForeColorFixed  =   -2147483630
  193.       BackColorSel    =   -2147483635
  194.       ForeColorSel    =   -2147483634
  195.       BackColorBkg    =   -2147483636
  196.       BackColorAlternate=   16777215
  197.       GridColor       =   -2147483633
  198.       GridColorFixed  =   -2147483632
  199.       TreeColor       =   -2147483632
  200.       FloodColor      =   192
  201.       SheetBorder     =   -2147483642
  202.       FocusRect       =   1
  203.       HighLight       =   1
  204.       AllowSelection  =   -1  'True
  205.       AllowBigSelection=   -1  'True
  206.       AllowUserResizing=   0
  207.       SelectionMode   =   0
  208.       GridLines       =   1
  209.       GridLinesFixed  =   2
  210.       GridLineWidth   =   1
  211.       Rows            =   50
  212.       Cols            =   10
  213.       FixedRows       =   1
  214.       FixedCols       =   1
  215.       RowHeightMin    =   0
  216.       RowHeightMax    =   0
  217.       ColWidthMin     =   0
  218.       ColWidthMax     =   0
  219.       ExtendLastCol   =   0   'False
  220.       FormatString    =   ""
  221.       ScrollTrack     =   0   'False
  222.       ScrollBars      =   3
  223.       ScrollTips      =   0   'False
  224.       MergeCells      =   0
  225.       MergeCompare    =   0
  226.       AutoResize      =   -1  'True
  227.       AutoSizeMode    =   0
  228.       AutoSearch      =   0
  229.       AutoSearchDelay =   2
  230.       MultiTotals     =   -1  'True
  231.       SubtotalPosition=   1
  232.       OutlineBar      =   0
  233.       OutlineCol      =   0
  234.       Ellipsis        =   0
  235.       ExplorerBar     =   0
  236.       PicturesOver    =   0   'False
  237.       FillStyle       =   0
  238.       RightToLeft     =   0   'False
  239.       PictureType     =   0
  240.       TabBehavior     =   0
  241.       OwnerDraw       =   0
  242.       Editable        =   0
  243.       ShowComboButton =   1
  244.       WordWrap        =   0   'False
  245.       TextStyle       =   0
  246.       TextStyleFixed  =   0
  247.       OleDragMode     =   0
  248.       OleDropMode     =   0
  249.       DataMode        =   0
  250.       VirtualData     =   -1  'True
  251.       DataMember      =   ""
  252.       ComboSearch     =   3
  253.       AutoSizeMouse   =   -1  'True
  254.       FrozenRows      =   0
  255.       FrozenCols      =   0
  256.       AllowUserFreezing=   0
  257.       BackColorFrozen =   0
  258.       ForeColorFrozen =   0
  259.       WallPaperAlignment=   9
  260.       AccessibleName  =   ""
  261.       AccessibleDescription=   ""
  262.       AccessibleValue =   ""
  263.       AccessibleRole  =   24
  264.       Begin MSComctlLib.ImageList ImageList2 
  265.          Left            =   0
  266.          Top             =   0
  267.          _ExtentX        =   1005
  268.          _ExtentY        =   1005
  269.          BackColor       =   -2147483643
  270.          ImageWidth      =   16
  271.          ImageHeight     =   16
  272.          MaskColor       =   12632256
  273.          _Version        =   393216
  274.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  275.             NumListImages   =   40
  276.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  277.                Picture         =   "销售结构查询结果.frx":35106
  278.                Key             =   "sz"
  279.             EndProperty
  280.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  281.                Picture         =   "销售结构查询结果.frx":354A0
  282.                Key             =   "dy"
  283.             EndProperty
  284.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.                Picture         =   "销售结构查询结果.frx":3583A
  286.                Key             =   "yl"
  287.             EndProperty
  288.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.                Picture         =   "销售结构查询结果.frx":35BD4
  290.                Key             =   "xg"
  291.             EndProperty
  292.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.                Picture         =   "销售结构查询结果.frx":35F6E
  294.                Key             =   "zh"
  295.             EndProperty
  296.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.                Picture         =   "销售结构查询结果.frx":36308
  298.                Key             =   "sh"
  299.             EndProperty
  300.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.                Picture         =   "销售结构查询结果.frx":366A2
  302.                Key             =   "bc"
  303.             EndProperty
  304.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "销售结构查询结果.frx":36A3C
  306.                Key             =   "fq"
  307.             EndProperty
  308.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "销售结构查询结果.frx":36DD6
  310.                Key             =   "bz"
  311.             EndProperty
  312.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "销售结构查询结果.frx":37170
  314.                Key             =   "tc"
  315.             EndProperty
  316.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "销售结构查询结果.frx":3750A
  318.                Key             =   "bcgs"
  319.             EndProperty
  320.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "销售结构查询结果.frx":378A4
  322.                Key             =   "mrlk"
  323.             EndProperty
  324.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "销售结构查询结果.frx":37C3E
  326.                Key             =   "xsxm"
  327.             EndProperty
  328.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "销售结构查询结果.frx":37FD8
  330.                Key             =   "first"
  331.             EndProperty
  332.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "销售结构查询结果.frx":38372
  334.                Key             =   "prev"
  335.             EndProperty
  336.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "销售结构查询结果.frx":3870C
  338.                Key             =   "next"
  339.             EndProperty
  340.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "销售结构查询结果.frx":38AA6
  342.                Key             =   "last"
  343.             EndProperty
  344.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "销售结构查询结果.frx":38E40
  346.                Key             =   "xx"
  347.             EndProperty
  348.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "销售结构查询结果.frx":391DA
  350.                Key             =   "define"
  351.             EndProperty
  352.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "销售结构查询结果.frx":39574
  354.                Key             =   "exec"
  355.             EndProperty
  356.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "销售结构查询结果.frx":3990E
  358.                Key             =   "xz"
  359.             EndProperty
  360.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "销售结构查询结果.frx":39CA8
  362.                Key             =   "sc"
  363.             EndProperty
  364.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "销售结构查询结果.frx":3A042
  366.                Key             =   "sx"
  367.             EndProperty
  368.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "销售结构查询结果.frx":3A3DC
  370.                Key             =   "cx"
  371.             EndProperty
  372.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "销售结构查询结果.frx":3A776
  374.                Key             =   "zd"
  375.             EndProperty
  376.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "销售结构查询结果.frx":3AB10
  378.                Key             =   "dz"
  379.             EndProperty
  380.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "销售结构查询结果.frx":3AEAA
  382.                Key             =   "ph"
  383.             EndProperty
  384.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "销售结构查询结果.frx":3B244
  386.                Key             =   "fz"
  387.             EndProperty
  388.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "销售结构查询结果.frx":3B5DE
  390.                Key             =   "dw"
  391.             EndProperty
  392.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "销售结构查询结果.frx":3B978
  394.                Key             =   "hf"
  395.             EndProperty
  396.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "销售结构查询结果.frx":3BD12
  398.                Key             =   "pz"
  399.             EndProperty
  400.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "销售结构查询结果.frx":3C0AC
  402.                Key             =   "check"
  403.             EndProperty
  404.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.                Picture         =   "销售结构查询结果.frx":3C446
  406.                Key             =   "qs"
  407.             EndProperty
  408.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.                Picture         =   "销售结构查询结果.frx":3C7E0
  410.                Key             =   "fullcheck"
  411.             EndProperty
  412.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.                Picture         =   "销售结构查询结果.frx":3CB7A
  414.                Key             =   "qq"
  415.             EndProperty
  416.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.                Picture         =   "销售结构查询结果.frx":3CF14
  418.                Key             =   "bcw"
  419.             EndProperty
  420.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  421.                Picture         =   "销售结构查询结果.frx":3D2AE
  422.                Key             =   "ye"
  423.             EndProperty
  424.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  425.                Picture         =   "销售结构查询结果.frx":3D648
  426.                Key             =   ""
  427.             EndProperty
  428.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  429.                Picture         =   "销售结构查询结果.frx":3D9E2
  430.                Key             =   "frist"
  431.             EndProperty
  432.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  433.                Picture         =   "销售结构查询结果.frx":3DD7C
  434.                Key             =   "dj"
  435.             EndProperty
  436.          EndProperty
  437.       End
  438.    End
  439.    Begin MSComctlLib.Toolbar SzToolbar 
  440.       Align           =   1  'Align Top
  441.       Height          =   555
  442.       Left            =   0
  443.       TabIndex        =   4
  444.       Top             =   0
  445.       Width           =   11820
  446.       _ExtentX        =   20849
  447.       _ExtentY        =   979
  448.       ButtonWidth     =   820
  449.       ButtonHeight    =   926
  450.       AllowCustomize  =   0   'False
  451.       Appearance      =   1
  452.       Style           =   1
  453.       ImageList       =   "ImageList1"
  454.       _Version        =   393216
  455.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  456.          NumButtons      =   12
  457.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  458.             Caption         =   "设置"
  459.             Key             =   "ymsz"
  460.             ImageKey        =   "sz"
  461.          EndProperty
  462.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  463.             Caption         =   "打印"
  464.             Key             =   "dy"
  465.             ImageKey        =   "dy"
  466.          EndProperty
  467.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  468.             Caption         =   "预览"
  469.             Key             =   "yl"
  470.             ImageKey        =   "yl"
  471.          EndProperty
  472.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  473.             Style           =   3
  474.          EndProperty
  475.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  476.             Caption         =   "查询"
  477.             Key             =   "cx"
  478.             ImageKey        =   "cx"
  479.          EndProperty
  480.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  481.             Object.Visible         =   0   'False
  482.             Caption         =   "图形"
  483.             Key             =   "tx"
  484.             ImageKey        =   "tx"
  485.          EndProperty
  486.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  487.             Style           =   3
  488.          EndProperty
  489.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  490.             Object.Visible         =   0   'False
  491.             Caption         =   "新增"
  492.             Key             =   "xz"
  493.             ImageKey        =   "xz"
  494.          EndProperty
  495.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  496.             Object.Visible         =   0   'False
  497.             Caption         =   "删除"
  498.             Key             =   "sc"
  499.             ImageKey        =   "sc"
  500.          EndProperty
  501.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  502.             Object.Visible         =   0   'False
  503.             Style           =   3
  504.          EndProperty
  505.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Caption         =   "帮助"
  507.             Key             =   "bz"
  508.             ImageKey        =   "bz"
  509.          EndProperty
  510.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  511.             Caption         =   "退出"
  512.             Key             =   "fh"
  513.             ImageKey        =   "tc"
  514.          EndProperty
  515.       EndProperty
  516.       BorderStyle     =   1
  517.       Begin MSComctlLib.ImageList ImageList1 
  518.          Left            =   6990
  519.          Top             =   30
  520.          _ExtentX        =   1005
  521.          _ExtentY        =   1005
  522.          BackColor       =   -2147483643
  523.          ImageWidth      =   16
  524.          ImageHeight     =   16
  525.          MaskColor       =   12632256
  526.          _Version        =   393216
  527.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  528.             NumListImages   =   33
  529.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  530.                Picture         =   "销售结构查询结果.frx":3E116
  531.                Key             =   "sz"
  532.             EndProperty
  533.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  534.                Picture         =   "销售结构查询结果.frx":3E4B0
  535.                Key             =   "dy"
  536.             EndProperty
  537.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  538.                Picture         =   "销售结构查询结果.frx":3E84A
  539.                Key             =   "yl"
  540.             EndProperty
  541.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  542.                Picture         =   "销售结构查询结果.frx":3EBE4
  543.                Key             =   "xg"
  544.             EndProperty
  545.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  546.                Picture         =   "销售结构查询结果.frx":3EF7E
  547.                Key             =   "zh"
  548.             EndProperty
  549.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  550.                Picture         =   "销售结构查询结果.frx":3F318
  551.                Key             =   "sh"
  552.             EndProperty
  553.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  554.                Picture         =   "销售结构查询结果.frx":3F6B2
  555.                Key             =   "bc"
  556.             EndProperty
  557.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  558.                Picture         =   "销售结构查询结果.frx":3FA4C
  559.                Key             =   "fq"
  560.             EndProperty
  561.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  562.                Picture         =   "销售结构查询结果.frx":3FDE6
  563.                Key             =   "bz"
  564.             EndProperty
  565.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  566.                Picture         =   "销售结构查询结果.frx":40180
  567.                Key             =   "tc"
  568.             EndProperty
  569.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  570.                Picture         =   "销售结构查询结果.frx":4051A
  571.                Key             =   "bcgs"
  572.             EndProperty
  573.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  574.                Picture         =   "销售结构查询结果.frx":408B4
  575.                Key             =   "mrlk"
  576.             EndProperty
  577.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  578.                Picture         =   "销售结构查询结果.frx":40C4E
  579.                Key             =   "xsxm"
  580.             EndProperty
  581.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  582.                Picture         =   "销售结构查询结果.frx":40FE8
  583.                Key             =   "first"
  584.             EndProperty
  585.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  586.                Picture         =   "销售结构查询结果.frx":41382
  587.                Key             =   "prev"
  588.             EndProperty
  589.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  590.                Picture         =   "销售结构查询结果.frx":4171C
  591.                Key             =   "next"
  592.             EndProperty
  593.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  594.                Picture         =   "销售结构查询结果.frx":41AB6
  595.                Key             =   "last"
  596.             EndProperty
  597.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  598.                Picture         =   "销售结构查询结果.frx":41E50
  599.                Key             =   "xx"
  600.             EndProperty
  601.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  602.                Picture         =   "销售结构查询结果.frx":421EA
  603.                Key             =   "define"
  604.             EndProperty
  605.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  606.                Picture         =   "销售结构查询结果.frx":42584
  607.                Key             =   "exec"
  608.             EndProperty
  609.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  610.                Picture         =   "销售结构查询结果.frx":4291E
  611.                Key             =   "xz"
  612.             EndProperty
  613.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  614.                Picture         =   "销售结构查询结果.frx":42CB8
  615.                Key             =   "sc"
  616.             EndProperty
  617.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  618.                Picture         =   "销售结构查询结果.frx":43052
  619.                Key             =   "sx"
  620.             EndProperty
  621.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  622.                Picture         =   "销售结构查询结果.frx":433EC
  623.                Key             =   "cx"
  624.             EndProperty
  625.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  626.                Picture         =   "销售结构查询结果.frx":43786
  627.                Key             =   "zd"
  628.             EndProperty
  629.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  630.                Picture         =   "销售结构查询结果.frx":43B20
  631.                Key             =   "dz"
  632.             EndProperty
  633.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  634.                Picture         =   "销售结构查询结果.frx":43EBA
  635.                Key             =   "ph"
  636.             EndProperty
  637.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  638.                Picture         =   "销售结构查询结果.frx":44254
  639.                Key             =   "fz"
  640.             EndProperty
  641.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  642.                Picture         =   "销售结构查询结果.frx":445EE
  643.                Key             =   "dw"
  644.             EndProperty
  645.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  646.                Picture         =   "销售结构查询结果.frx":44988
  647.                Key             =   "hf"
  648.             EndProperty
  649.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  650.                Picture         =   "销售结构查询结果.frx":44D22
  651.                Key             =   "pz"
  652.             EndProperty
  653.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  654.                Picture         =   "销售结构查询结果.frx":450BC
  655.                Key             =   "check"
  656.             EndProperty
  657.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  658.                Picture         =   "销售结构查询结果.frx":45456
  659.                Key             =   "tx"
  660.             EndProperty
  661.          EndProperty
  662.       End
  663.    End
  664. End
  665. Attribute VB_Name = "Xs_A_FrameAnalysis"
  666. Attribute VB_GlobalNameSpace = False
  667. Attribute VB_Creatable = False
  668. Attribute VB_PredeclaredId = True
  669. Attribute VB_Exposed = False
  670. '**************************************************************************
  671. '*    模 块 名 称 :销售结构分析
  672. '*    功 能 描 述 :
  673. '*    程序员姓名  :李建伟
  674. '*    最后修改人  :李建伟
  675. '*    最后修改时间:2001/10/06
  676. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  677. '**************************************************************************
  678. Dim ReportTitle As String                '报表主标题
  679. Dim Str_QueryCondi As String             '用户录入查询条件
  680. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  681. Dim TempOrder As String                  '查询排序
  682. '以下为固定使用变量
  683. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  684. Dim GridCode As String                   '显示网格网格代码
  685. Dim GridInf() As Variant                 '整个网格设置信息
  686. Dim Tsxx As String                       '系统提示信息
  687. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  688. Dim Sjhgd As Double                      '网格数据行高度
  689. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  690. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  691. Dim GridStr()  As String                 '网格列信息(字符型)
  692. Dim GridInt() As Integer                 '网格列信息(整型)
  693. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  694. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  695.     On Error Resume Next
  696.     With CxbbGrid
  697.         .Width = Me.Width - 160
  698.         .Height = Me.Height - .Top - 400
  699.     End With
  700.     With Pic_Title
  701.         .Width = Me.Width - 160
  702.     End With
  703.     
  704.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  705. End Sub
  706. Private Sub Form_Load()                                                   '窗体装入
  707.   
  708.     '调入打印页面设置窗体
  709.     ReportTitle = "销售结构分析"
  710.     XtReportCode = "Xs_A_FrameAnalysis"
  711.     Load Dyymctbl
  712.       
  713.     '调整标题栏及网格、格式工具条位置(Fixed)
  714.     Pic_Title.Left = 40
  715.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  716.     CxbbGrid.Left = Pic_Title.Left
  717.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  718.      
  719.     '调 入 网 格(Fixed)
  720.     GridCode = "Xs_A_FrameAnalysis"
  721.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  722.       
  723.     Qslz = GridInf(1)
  724.     Sjhgd = GridInf(2)
  725.     Sfxshjwg = GridInf(7)
  726.     Szzls = CxbbGrid.Cols - 1
  727. End Sub
  728. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  729.     '卸载条件窗体
  730.     Xs_A_FrameAnalysisQuery.UnloadCheck.Value = 1
  731.     Unload Xs_A_FrameAnalysisQuery
  732.     
  733.     '卸载打印页面设置窗体
  734.     Unload Dyymctbl
  735. End Sub
  736. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  737.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  738. End Sub
  739. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  740.   
  741.     Select Case Button.Key
  742.         Case "bcgs"                                          '保存表格格式
  743.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  744.         Case "hfmrgs"                                        '恢复默认格式
  745.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  746.         Case "szxsxm"                                        '设置显示项目
  747.             Call Szxsxm(CxbbGrid, GridCode)
  748.     End Select
  749. End Sub
  750. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  751.     
  752.     Select Case Button.Key
  753.         Case "ymsz"                                          '页面设置
  754.             Dyymctbl.Show 1
  755.         Case "yl"                                            '预 览
  756.             Call bbyl(True)
  757.         Case "dy"                                            '打 印
  758.             Call bbyl(False)
  759.         Case "cx"                                            '查 询
  760.             Xs_A_FrameAnalysisQuery.Show 1
  761.         Case "tx"                                          '单 据
  762.             Call Txfxbb(CxbbGrid, "Xs_CxbbGridjg")
  763.         Case "xz"                                            '新 增
  764.             Call Sub_AddBill
  765.         Case "sc"                                            '删 除
  766.             Call Sub_DeleteBill
  767.         Case "bz"                                            '帮 助
  768.             Call F1bz
  769.         Case "fh"                                            '退 出
  770.            Unload Me
  771.     End Select
  772. End Sub
  773. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  774.     
  775.     Timer1.Enabled = False
  776.     Xt_Wait.Show
  777.     Xt_Wait.Refresh
  778.    
  779.     '加快显示速度
  780.     CxbbGrid.Redraw = False
  781.  
  782.     '生成查询结果
  783.     Call Sub_Query(0)
  784.    
  785.     CxbbGrid.Redraw = True
  786.     
  787.     Xt_Wait.Hide
  788. End Sub
  789. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  790.     
  791.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  792.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  793.     Dim Coljsq As Long                          '网格列计数器
  794.     Dim Jsqte As Long                           '临时动态计数器
  795.     
  796.     Dim TInvDiscount As Single                    '总的销售折扣
  797.     Dim TConDiscount As Single                    '总的发货折扣
  798.     Dim TInvMoney As Single                       '总的销售收入
  799.     Dim TConMoney As Single                       '总的发货额
  800.     Dim TRec_Query As New ADODB.Recordset
  801.     Dim TSqlStr As String
  802.     Dim TInvWholeMoney As Single                  '总的销售额
  803.     Dim TInvTax As Single                         '总的销售税金
  804.     Dim TTConMoney As Single                      '总的退货额
  805.     Dim TTConDiscount As Single                   '总的退货折扣
  806.     Dim TCost As Single                           '总的成本
  807.     Dim TUCost As Single                          '总的毛利
  808.     '以下为自定义部分[
  809.  
  810.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  811.         With Xs_A_FrameAnalysisQuery
  812.             Lbl(0).Caption = "部门:" & Trim(.LrText(2).Text)
  813.             Lbl(1).Caption = "行业:" & Trim(.LrText(3))
  814.             Lbl(2).Caption = "销售员:" & Trim(.LrText(5))
  815.             Lbl(3).Caption = "地区:" & Trim(.LrText(7))
  816.             Lbl(6).Caption = "货物编码:" & Trim(.LrText(4))
  817.             If Trim(.LrText(0)) <> "" Then
  818.                 If Trim(.LrText(1)) <> "" Then
  819.                     Lbl(4).Caption = "日期:" & Trim(.LrText(0)) & "—" & Trim(.LrText(1))
  820.                 Else
  821.                     Lbl(4).Caption = "日期:" & Trim(.LrText(0))
  822.                 End If
  823.             End If
  824.             Lbl(5).Caption = "销售类型:" & Trim(.LrText(6))
  825.             '生成查询条件
  826.             Str_QueryCondi = " where 1=1 "
  827.             For Jsqte = 1 To 9
  828.                 Select Case Jsqte
  829.                     Case 1  '查询日期范围(起始)
  830.                         If Trim(.LrText(0).Text) <> "" Then
  831.                             Str_QueryCondi = Str_QueryCondi & " And AnalysisDate>=' " & Trim(.LrText(0).Text) & "'"
  832.                         End If
  833.                     Case 2  '查询日期范围(终止)
  834.                         If Trim(.LrText(1).Text) <> "" Then
  835.                             Str_QueryCondi = Str_QueryCondi & " And AnalysisDate<= ' " & Trim(.LrText(1).Text) & "'"
  836.                         End If
  837.                     Case 3  '部门名称
  838.                         If Trim(.LrText(2).Text) <> "" Then
  839.                             Str_QueryCondi = Str_QueryCondi & " and DeptCode = '" & Trim(.LrText(2).Tag) & "'"
  840.                         End If
  841.                     Case 4  '行业
  842.                         If Trim(.LrText(3).Text) <> "" Then
  843.                             Str_QueryCondi = Str_QueryCondi & " and TradeCode like  '" & Trim(.LrText(3).Tag) & "%'"
  844.                         End If
  845.                     Case 5  '存货编码
  846.                         If Trim(.LrText(4).Text) <> "" Then
  847.                             Str_QueryCondi = Str_QueryCondi & " and WareCode = '" & Trim(.LrText(4).Text) & "'"
  848.                         End If
  849.                     Case 6  '销售员
  850.                         If Trim(.LrText(5).Text) <> "" Then
  851.                             Str_QueryCondi = Str_QueryCondi & " and PersonCode = '" & Trim(.LrText(5).Tag) & "'"
  852.                         End If
  853.                     Case 7  '销售类型
  854.                         If Trim(.LrText(6).Text) <> "" Then
  855.                             Str_QueryCondi = Str_QueryCondi & " and SellTypeCode = '" & Trim(.LrText(6).Tag) & "'"
  856.                         End If
  857.                     Case 8  '地区
  858.                         If Trim(.LrText(7).Text) <> "" Then
  859.                             Str_QueryCondi = Str_QueryCondi & " and AreaCode like '" & Trim(.LrText(7).Tag) & "%'"
  860.                         End If
  861.                     Case 9   '分析项目
  862.                         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = True
  863.                         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = True
  864.                         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = True
  865.                         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = True
  866.                         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = True
  867.                         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = True
  868.                         TempOrder = ""
  869.                         If .Opt_Check(0).Value Then
  870.                             CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False
  871.                             TempOrder = " DeptName"
  872.                         ElseIf .Opt_Check(1).Value Then
  873.                             CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False
  874.                             TempOrder = " CusName"
  875.                         ElseIf .Opt_Check(2).Value Then
  876.                             CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False
  877.                             TempOrder = " PersonName"
  878.                         ElseIf .Opt_Check(3).Value Then
  879.                             CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False
  880.                             TempOrder = " MName"
  881.                         ElseIf .Opt_Check(4).Value Then
  882.                             CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False
  883.                             TempOrder = " AreaName"
  884.                         ElseIf .Opt_Check(5).Value Then
  885.                             CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False
  886.                             TempOrder = " TradeName"
  887.                         End If
  888.                         Sqlstr = "SELECT " & TempOrder & " ,Sum(InvDiscount) InvDiscount,Sum(InvMoney) InvMoney,Sum(ConDiscount) ConDiscount," & _
  889.                             " Sum(ConMoney) ConMoney,Sum(InvWholeMoney) InvWholeMoney,Sum(InvTax) InvTax,Sum(TConMoney) TConMoney,Sum(TConDiscount) TConDiscount,Sum(Cost) Cost " & _
  890.                             " from Xs_V_FrameAnalysis " & Str_QueryCondi & " Group by " & TempOrder & " Order By " & TempOrder
  891.                 End Select
  892.             Next Jsqte
  893.         End With
  894.     Else
  895.         '1-"刷新"查询
  896.         If Str_QueryCondi = "" Then
  897.             Str_QueryCondi = " where 1=2 "
  898.         End If
  899.     End If
  900.     TSqlStr = "SELECT Sum(InvDiscount) InvDiscount,Sum(InvMoney) InvMoney,Sum(ConDiscount) ConDiscount," & _
  901.             " Sum(ConMoney) ConMoney,Sum(InvWholeMoney) InvWholeMoney,Sum(InvTax) InvTax,Sum(TConMoney) TConMoney,Sum(TConDiscount) TConDiscount,Sum(Cost) Cost " & _
  902.             " from Xs_V_FrameAnalysis " & Str_QueryCondi
  903.     Set TRec_Query = Cw_DataEnvi.DataConnect.Execute(TSqlStr)
  904.     TInvDiscount = Val(Trim(TRec_Query.Fields("InvDiscount") & ""))
  905.     TConDiscount = Val(Trim(TRec_Query.Fields("ConDiscount") & ""))
  906.     TInvMoney = Val(Trim(TRec_Query.Fields("InvMoney") & ""))
  907.     TConMoney = Val(Trim(TRec_Query.Fields("Conmoney") & ""))
  908.     TInvWholeMoney = Val(Trim(TRec_Query.Fields("InvWholeMoney") & ""))
  909.     TInvTax = Val(Trim(TRec_Query.Fields("InvTax") & ""))
  910.     TTConMoney = Val(Trim(TRec_Query.Fields("TConMoney") & ""))
  911.     TTConDiscount = Val(Trim(TRec_Query.Fields("TConDiscount") & ""))
  912.     TCost = Val(Trim(TRec_Query.Fields("Cost") & ""))
  913.     TRec_Query.Close
  914.     TUCost = TInvMoney - TCost
  915.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  916.     With Rec_Query
  917.         CxbbGrid.Rows = CxbbGrid.FixedRows
  918.         Jsqte = CxbbGrid.FixedRows
  919.         Do While Not .EOF
  920.             CxbbGrid.AddItem ""
  921.             '[>>自定义填充内容
  922.             If Xs_A_FrameAnalysisQuery.Opt_Check(0) Then
  923.                 CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "")                                                      '部门
  924.             ElseIf Xs_A_FrameAnalysisQuery.Opt_Check(1) Then
  925.                 CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")                                                       '客户
  926.             ElseIf Xs_A_FrameAnalysisQuery.Opt_Check(2) Then
  927.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("PersonName") & "")                                                    '销售员
  928.             ElseIf Xs_A_FrameAnalysisQuery.Opt_Check(3) Then
  929.                 CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                                                         '货物
  930.             ElseIf Xs_A_FrameAnalysisQuery.Opt_Check(4) Then
  931.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("AreaName") & "")                                                      '地区
  932.             ElseIf Xs_A_FrameAnalysisQuery.Opt_Check(5) Then
  933.                 CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("TradeName") & "")                                                     '行业
  934.             End If
  935.             If Val(Trim(.Fields("Conmoney") & "")) <> 0 Then
  936.                 CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("Conmoney") & "")                                                      '发货金额
  937.                 If TConMoney <> 0 Then
  938.                     CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Format(Val(Trim(.Fields("Conmoney") & "")) / TConMoney * 100, "0.00")           '发货金额%
  939.                 End If
  940.             End If
  941.             If Val(Trim(.Fields("ConDiscount") & "")) <> 0 Then
  942.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("ConDiscount") & "")                                                   '发货折扣
  943.                 If TConDiscount <> 0 Then
  944.                     CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Format(Val(Trim(.Fields("ConDiscount") & "")) / TConDiscount * 100, "0.00")     '发货折扣%
  945.                 End If
  946.             End If
  947.             If Val(Trim(.Fields("TConMoney") & "")) <> 0 Then
  948.                 CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("TConMoney") & "")                                                     '退货金额
  949.                 If TTConMoney <> 0 Then
  950.                     CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Format(Val(Trim(.Fields("TConMoney") & "")) / TTConMoney * 100, "0.00")         '退货金额%
  951.                 End If
  952.             End If
  953.             If Val(Trim(.Fields("InvWholeMoney") & "")) <> 0 Then
  954.                 CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("InvWholeMoney") & "")                                                 '销售金额
  955.                 If TInvWholeMoney <> 0 Then
  956.                     CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvWholeMoney") & "")) / TInvWholeMoney * 100, "0.00") '销售金额%
  957.                 End If
  958.             End If
  959.             If Val(Trim(.Fields("InvDiscount") & "")) <> 0 Then
  960.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("InvDiscount") & "")                                                   '销售折扣
  961.                 If TInvDiscount <> 0 Then
  962.                     CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvDiscount") & "")) / TInvDiscount * 100, "0.00")     '销售折扣%
  963.                 End If
  964.             End If
  965.             If Val(Trim(.Fields("InvMoney") & "")) <> 0 Then
  966.                 CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Trim(.Fields("InvMoney") & "")                                                      '销售收入
  967.                 If TInvMoney <> 0 Then
  968.                     CxbbGrid.TextMatrix(Jsqte, Sydz("018", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvMoney") & "")) / TInvMoney * 100, "0.00")           '销售收入%
  969.                 End If
  970.             End If
  971.             If Val(Trim(.Fields("InvTax") & "")) <> 0 Then
  972.                 CxbbGrid.TextMatrix(Jsqte, Sydz("019", GridStr(), Szzls)) = Trim(.Fields("InvTax") & "")                                                        '销售税金
  973.                 If TInvTax <> 0 Then
  974.                     CxbbGrid.TextMatrix(Jsqte, Sydz("020", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvTax") & "")) / TInvTax * 100, "0.00")               '销售税金%
  975.                 End If
  976.             End If
  977.             If Val(Trim(.Fields("Cost") & "")) <> 0 Then
  978.                 CxbbGrid.TextMatrix(Jsqte, Sydz("021", GridStr(), Szzls)) = Trim(.Fields("Cost") & "")                                                          '成本
  979.                 If TCost <> 0 Then
  980.                     CxbbGrid.TextMatrix(Jsqte, Sydz("022", GridStr(), Szzls)) = Format(Val(Trim(.Fields("Cost") & "")) / TCost * 100, "0.00")                   '成本%
  981.                 End If
  982.             End If
  983.             If Val(Trim(.Fields("InvMoney") & "")) - Val(Trim(.Fields("Cost") & "")) <> 0 Then
  984.                 CxbbGrid.TextMatrix(Jsqte, Sydz("023", GridStr(), Szzls)) = Val(Trim(.Fields("InvMoney") & "")) - Val(Trim(.Fields("Cost") & ""))               '毛利
  985.                 If TUCost <> 0 Then
  986.                     CxbbGrid.TextMatrix(Jsqte, Sydz("024", GridStr(), Szzls)) = Format((Val(Trim(.Fields("InvMoney") & "")) - Val(Trim(.Fields("Cost") & ""))) / TUCost * 100, "0.00")   '毛利%
  987.                 End If
  988.             End If
  989.             '<<]
  990.             '设置数据行高度(Fixed)
  991.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  992.      
  993.             '动态集指针加1,同时将计数器加1(Fixed)
  994.             .MoveNext
  995.             Jsqte = Jsqte + 1
  996.         Loop
  997.     End With
  998.     '合计
  999.     CxbbGrid.AddItem ""
  1000.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("001", GridStr(), Szzls)) = "合计"
  1001.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("002", GridStr(), Szzls)) = "合计"
  1002.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("003", GridStr(), Szzls)) = "合计"
  1003.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("004", GridStr(), Szzls)) = "合计"
  1004.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("005", GridStr(), Szzls)) = "合计"
  1005.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("006", GridStr(), Szzls)) = "合计"
  1006.     For Coljsq = Qslz To CxbbGrid.Cols - 1
  1007.         Call Sjhj(Coljsq)
  1008.     Next Coljsq
  1009.     If CxbbGrid.Rows <> 2 Then
  1010.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("008", GridStr(), Szzls)) <> "" Then
  1011.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("008", GridStr(), Szzls)) = "100.00"
  1012.         End If
  1013.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("010", GridStr(), Szzls)) <> "" Then
  1014.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("010", GridStr(), Szzls)) = "100.00"
  1015.         End If
  1016.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("012", GridStr(), Szzls)) <> "" Then
  1017.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("012", GridStr(), Szzls)) = "100.00"
  1018.         End If
  1019.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("014", GridStr(), Szzls)) <> "" Then
  1020.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("014", GridStr(), Szzls)) = "100.00"
  1021.         End If
  1022.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("016", GridStr(), Szzls)) <> "" Then
  1023.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("016", GridStr(), Szzls)) = "100.00"
  1024.         End If
  1025.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("018", GridStr(), Szzls)) <> "" Then
  1026.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("018", GridStr(), Szzls)) = "100.00"
  1027.         End If
  1028.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("020", GridStr(), Szzls)) <> "" Then
  1029.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("020", GridStr(), Szzls)) = "100.00"
  1030.         End If
  1031.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("022", GridStr(), Szzls)) <> "" Then
  1032.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("022", GridStr(), Szzls)) = "100.00"
  1033.         End If
  1034.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("024", GridStr(), Szzls)) <> "" Then
  1035.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("024", GridStr(), Szzls)) = "100.00"
  1036.         End If
  1037.     End If
  1038.     ']以上为用户自定义部分
  1039. End Sub
  1040. Private Sub Sjhj(Hjwgl As Long)                                         '网格列数据合计
  1041.     
  1042.     Dim Hjjg As Double
  1043.     If Not GridBoolean(Hjwgl, 4) Then
  1044.         Exit Sub
  1045.     End If
  1046.     With CxbbGrid
  1047.         Hjjg = 0
  1048.         For Jsqte = .FixedRows To .Rows - 2
  1049.                 If Trim(.TextMatrix(Jsqte, Hjwgl)) <> "" Then
  1050.                     Hjjg = Hjjg + Val(.TextMatrix(Jsqte, Hjwgl))
  1051.                 End If
  1052.         Next Jsqte
  1053.         If GridBoolean(Hjwgl, 5) And Hjjg = 0 Then
  1054.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = ""
  1055.         Else
  1056.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = Hjjg
  1057.         End If
  1058.     End With
  1059. End Sub
  1060. Private Sub Sub_AddBill()                                              '新增单据
  1061.    
  1062.     With Xs_O_OrderBill
  1063.    
  1064.         '设置单据处理为填制单据状态
  1065. ''        .Lab_Djclzt.Caption = "1"
  1066.          Xtcdcs = "1"
  1067.         .Show 1
  1068.     End With
  1069.        
  1070.     If Xtfhcs = "1" Then
  1071.         Tsxx = "销售订单发生变化,是否刷新销售订单列表?"
  1072.         Yhanswer = Xtxxts(Tsxx, 2, 2)
  1073.         If Yhanswer = 1 Then
  1074.             Xt_Wait.Show
  1075.             Xt_Wait.Refresh
  1076.    
  1077.             '加快显示速度
  1078.             CxbbGrid.Redraw = False
  1079.  
  1080.             '生成查询结果
  1081.             Call Sub_Query(1)
  1082.    
  1083.             CxbbGrid.Redraw = True
  1084.             Xt_Wait.Hide
  1085.         End If
  1086.     End If
  1087.    
  1088. End Sub
  1089. Private Sub Sub_DeleteBill()                                            '删除选中当前销售订单
  1090.     
  1091.     Dim YAnswer As Integer
  1092.     Dim Lng_BillID As Long           '单据标识
  1093.   
  1094.     '非数据行退出
  1095.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1096.         Exit Sub
  1097.     End If
  1098.   
  1099.     Tsxx = "请确认是否删除当前销售订单?"
  1100.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1101.   
  1102.     If Yhanswer = 1 Then
  1103.         '1.判断当前销售订单是否允许删除
  1104.         If Not Fun_AllowDelete Then
  1105.             Exit Sub
  1106.         End If
  1107.   
  1108.         '2.删除单据所有内容
  1109.         Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1110.         On Error GoTo Swcwcl
  1111.         Cw_DataEnvi.DataConnect.BeginTrans
  1112.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID)        '删除单据主表内容
  1113.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillSub Where OrderBillMainId=" & Lng_BillID)         '删除单据子表内容
  1114.         Cw_DataEnvi.DataConnect.CommitTrans
  1115.       
  1116.         '删除网格中单据数据
  1117.         Jsqte = CxbbGrid.FixedRows
  1118.         Do While Jsqte <= CxbbGrid.Rows - 1
  1119.             If Val(CxbbGrid.TextMatrix(Jsqte, 0)) = Lng_BillID Then
  1120.                 CxbbGrid.RemoveItem (CxbbGrid.Row)
  1121.             Else
  1122.                 Jsqte = Jsqte + 1
  1123.             End If
  1124.         Loop
  1125.     Else
  1126.         Exit Sub
  1127.     End If
  1128.     Exit Sub
  1129. Swcwcl:
  1130.     Cw_DataEnvi.DataConnect.RollbackTrans
  1131.     Tsxx = "删除销售订单过程中出现未知错误,程序自动恢复删除前状态!"
  1132.     Call Xtxxts(Tsxx, 0, 1)
  1133.     Exit Sub
  1134.   
  1135. End Sub
  1136. Private Function Fun_AllowDelete() As Boolean                                        '判断当前单据是否允许删除
  1137.   
  1138.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  1139.     Dim Sqlstr As String                   '查询字符串
  1140.     Dim Lng_BillID As Long                 '单据ID
  1141.   
  1142.     Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1143.     Sqlstr = "Select Checker From XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID
  1144.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1145.     With RecTemp
  1146.         If Not .EOF Then
  1147.             If Trim(.Fields("Checker") & "") <> "" Then
  1148.                 Tsxx = "该销售订单已审核确认,不能删除!"
  1149.                 Call Xtxxts(Tsxx, 0, 4)
  1150.                 Exit Function
  1151.             End If
  1152.             End If
  1153.     End With
  1154.     Fun_AllowDelete = True
  1155.   
  1156. End Function
  1157. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1158.     
  1159.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1160.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1161.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1162.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1163.     ReDim Bbxbt(1 To Bbxbtgs)
  1164.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1165.     If Bbbwhgs <> 0 Then
  1166.         ReDim Bbbwh(1 To Bbbwhgs)
  1167.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1168.     End If
  1169.     Bbzbt = ReportTitle
  1170.     Bbxbt(1) = Space(2) + Fun_FormatOutPut(Trim(Lbl(4).Caption), 30)
  1171.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(0).Caption), 25)
  1172.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(5).Caption), 20)
  1173.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(2).Caption), 20)
  1174.     Bbxbt(2) = Space(2) + Fun_FormatOutPut(Trim(Lbl(1).Caption), 30)
  1175.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(3).Caption), 25)
  1176.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(6).Caption), 20)
  1177.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1178.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1179.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1180.     If Not bbylte Then
  1181.         Unload DY_Tybbyldy
  1182.     End If
  1183. End Sub