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

企业管理

开发平台:

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_MarketAnalysis 
  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            =   10110
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   1695
  24.       _ExtentX        =   2990
  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           =   1020
  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            =   0
  171.       TabIndex        =   0
  172.       Top             =   1470
  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             =   "Bill"
  484.             ImageKey        =   "pz"
  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   =   32
  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.          EndProperty
  658.       End
  659.    End
  660. End
  661. Attribute VB_Name = "Xs_A_MarketAnalysis"
  662. Attribute VB_GlobalNameSpace = False
  663. Attribute VB_Creatable = False
  664. Attribute VB_PredeclaredId = True
  665. Attribute VB_Exposed = False
  666. '**************************************************************************
  667. '*    模 块 名 称 :市场分析
  668. '*    功 能 描 述 :
  669. '*    程序员姓名  :李建伟
  670. '*    最后修改人  :李建伟
  671. '*    最后修改时间:2001/10/06
  672. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  673. '**************************************************************************
  674. Dim ReportTitle As String                '报表主标题
  675. Dim Str_QueryCondi As String             '用户录入查询条件
  676. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  677. Dim TempOrder As String                  '查询排序
  678. '以下为固定使用变量
  679. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  680. Dim GridCode As String                   '显示网格网格代码
  681. Dim GridInf() As Variant                 '整个网格设置信息
  682. Dim Tsxx As String                       '系统提示信息
  683. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  684. Dim Sjhgd As Double                      '网格数据行高度
  685. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  686. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  687. Dim GridStr()  As String                 '网格列信息(字符型)
  688. Dim GridInt() As Integer                 '网格列信息(整型)
  689. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  690. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  691.     On Error Resume Next
  692.     With CxbbGrid
  693.         .Width = Me.Width - 160
  694.         .Height = Me.Height - .Top - 400
  695.     End With
  696.     With Pic_Title
  697.         .Width = Me.Width - 160
  698.     End With
  699.     
  700.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  701. End Sub
  702. Private Sub Form_Load()                                                   '窗体装入
  703.   
  704.     '调入打印页面设置窗体
  705.     ReportTitle = "市场分析"
  706.     XtReportCode = "Xs_A_MarketAnalysis"
  707.     Load Dyymctbl
  708.       
  709.     '调整标题栏及网格、格式工具条位置(Fixed)
  710.     Pic_Title.Left = 40
  711.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  712.     CxbbGrid.Left = Pic_Title.Left
  713.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  714.      
  715.     '调 入 网 格(Fixed)
  716.     GridCode = "Xs_A_MarketAnalysis"
  717.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  718.       
  719.     Qslz = GridInf(1)
  720.     Sjhgd = GridInf(2)
  721.     Sfxshjwg = GridInf(7)
  722.     Szzls = CxbbGrid.Cols - 1
  723. End Sub
  724. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  725.     '卸载条件窗体
  726.     Xs_A_MarketAnalysisQuery.UnloadCheck.Value = 1
  727.     Unload Xs_A_MarketAnalysisQuery
  728.     
  729.     '卸载打印页面设置窗体
  730.     Unload Dyymctbl
  731. End Sub
  732. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  733.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  734. End Sub
  735. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  736.   
  737.     Select Case Button.Key
  738.         Case "bcgs"                                          '保存表格格式
  739.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  740.         Case "hfmrgs"                                        '恢复默认格式
  741.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  742.         Case "szxsxm"                                        '设置显示项目
  743.             Call Szxsxm(CxbbGrid, GridCode)
  744.     End Select
  745. End Sub
  746. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  747.     
  748.     Select Case Button.Key
  749.         Case "ymsz"                                          '页面设置
  750.             Dyymctbl.Show 1
  751.         Case "yl"                                            '预 览
  752.             Call bbyl(True)
  753.         Case "dy"                                            '打 印
  754.             Call bbyl(False)
  755.         Case "cx"                                            '查 询
  756.             Xs_A_MarketAnalysisQuery.Show 1
  757.         Case "Bill"                                          '单 据
  758.         Case "xz"                                            '新 增
  759.             Call Sub_AddBill
  760.         Case "sc"                                            '删 除
  761.             Call Sub_DeleteBill
  762.         Case "bz"                                            '帮 助
  763.             Call F1bz
  764.         Case "fh"                                            '退 出
  765.            Unload Me
  766.     End Select
  767. End Sub
  768. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  769.     
  770.     Timer1.Enabled = False
  771.     Xt_Wait.Show
  772.     Xt_Wait.Refresh
  773.    
  774.     '加快显示速度
  775.     CxbbGrid.Redraw = False
  776.  
  777.     '生成查询结果
  778.     Call Sub_Query(0)
  779.    
  780.     CxbbGrid.Redraw = True
  781.     
  782.     Xt_Wait.Hide
  783. End Sub
  784. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  785.     
  786.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  787.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  788.     Dim Coljsq As Long                          '网格列计数器
  789.     Dim Jsqte As Long                           '临时动态计数器
  790.     
  791.     Dim TInvMoney As Single                     '总的销售额(无税)
  792.     Dim TConMoney As Single                     '总的发货额(无税)
  793.     Dim TRec_Query As New ADODB.Recordset
  794.     Dim TSqlStr As String
  795.     Dim TInvWholeMoney As Single                '总的销售额(含税)
  796.     Dim TConWholeMoney As Single                '总的发货额(含税)
  797.     Dim TUCost As Single                        '总的未开票金额
  798.     '以下为自定义部分[
  799.  
  800.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  801.         With Xs_A_MarketAnalysisQuery
  802.             Lbl(0).Caption = "部门:" & Trim(.LrText(2).Text)
  803.             Lbl(1).Caption = "行业:" & Trim(.LrText(3))
  804.             Lbl(2).Caption = "销售员:" & Trim(.LrText(5))
  805.             Lbl(3).Caption = "地区:" & Trim(.LrText(7))
  806.             Lbl(6).Caption = "货物编码:" & Trim(.LrText(4))
  807.             If Trim(.LrText(0)) <> "" Then
  808.                 If Trim(.LrText(1)) <> "" Then
  809.                     Lbl(4).Caption = "日期:" & Trim(.LrText(0)) & "—" & Trim(.LrText(1))
  810.                 Else
  811.                     Lbl(4).Caption = "日期:" & Trim(.LrText(0))
  812.                 End If
  813.             End If
  814.             Lbl(5).Caption = "销售类型:" & Trim(.LrText(6))
  815.             '生成查询条件
  816.             Str_QueryCondi = " where 1=1 "
  817.             For Jsqte = 1 To 9
  818.                 Select Case Jsqte
  819.                     Case 1  '查询日期范围(起始)
  820.                         If Trim(.LrText(0).Text) <> "" Then
  821.                             Str_QueryCondi = Str_QueryCondi & " And AnalysisDate>=' " & Trim(.LrText(0).Text) & "'"
  822.                         End If
  823.                     Case 2  '查询日期范围(终止)
  824.                         If Trim(.LrText(1).Text) <> "" Then
  825.                             Str_QueryCondi = Str_QueryCondi & " And AnalysisDate<= ' " & Trim(.LrText(1).Text) & "'"
  826.                         End If
  827.                     Case 3  '部门名称
  828.                         If Trim(.LrText(2).Text) <> "" Then
  829.                             Str_QueryCondi = Str_QueryCondi & " and DeptCode = '" & Trim(.LrText(2).Tag) & "'"
  830.                         End If
  831.                     Case 4  '行业
  832.                         If Trim(.LrText(3).Text) <> "" Then
  833.                             Str_QueryCondi = Str_QueryCondi & " and TradeCode like  '" & Trim(.LrText(3).Tag) & "%'"
  834.                         End If
  835.                     Case 5  '存货编码
  836.                         If Trim(.LrText(4).Text) <> "" Then
  837.                             Str_QueryCondi = Str_QueryCondi & " and WareCode = '" & Trim(.LrText(4).Text) & "'"
  838.                         End If
  839.                     Case 6  '销售员
  840.                         If Trim(.LrText(5).Text) <> "" Then
  841.                             Str_QueryCondi = Str_QueryCondi & " and PersonCode = '" & Trim(.LrText(5).Tag) & "'"
  842.                         End If
  843.                     Case 7  '销售类型
  844.                         If Trim(.LrText(6).Text) <> "" Then
  845.                             Str_QueryCondi = Str_QueryCondi & " and SellTypeCode = '" & Trim(.LrText(6).Tag) & "'"
  846.                         End If
  847.                     Case 8  '地区
  848.                         If Trim(.LrText(7).Text) <> "" Then
  849.                             Str_QueryCondi = Str_QueryCondi & " and AreaCode like '" & Trim(.LrText(7).Tag) & "%'"
  850.                         End If
  851.                         Sqlstr = "SELECT CusName,Sum(InvMoney) InvMoney, Sum(ConMoney) ConMoney,Sum(InvWholeMoney) InvWholeMoney,Sum(ConWholeMoney) ConWholeMoney " & _
  852.                             " from Xs_V_MarketAnalysis " & Str_QueryCondi & " Group by CusName Order By Cusname"
  853.                 End Select
  854.             Next Jsqte
  855.         End With
  856.     Else
  857.         '1-"刷新"查询
  858.         If Str_QueryCondi = "" Then
  859.             Str_QueryCondi = " where 1=2 "
  860.         End If
  861.     End If
  862.     TSqlStr = "SELECT Sum(InvMoney) InvMoney, Sum(ConMoney) ConMoney,Sum(InvWholeMoney) InvWholeMoney,Sum(ConWholeMoney) ConWholeMoney from Xs_V_MarketAnalysis " & Str_QueryCondi
  863.     Set TRec_Query = Cw_DataEnvi.DataConnect.Execute(TSqlStr)
  864.     TInvMoney = Val(Trim(TRec_Query.Fields("InvMoney") & ""))
  865.     TConMoney = Val(Trim(TRec_Query.Fields("Conmoney") & ""))
  866.     TInvWholeMoney = Val(Trim(TRec_Query.Fields("InvWholeMoney") & ""))
  867.     TConWholeMoney = Val(Trim(TRec_Query.Fields("ConWholeMoney") & ""))
  868.     TRec_Query.Close
  869.     TUCost = TConWholeMoney - TInvWholeMoney
  870.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  871.     With Rec_Query
  872.         CxbbGrid.Rows = CxbbGrid.FixedRows
  873.         Jsqte = CxbbGrid.FixedRows
  874.         Do While Not .EOF
  875.             CxbbGrid.AddItem ""
  876.             '[>>自定义填充内容
  877.                 CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")                                                           '客户
  878.             If Val(Trim(.Fields("Conmoney") & "")) <> 0 Then
  879.                 CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("Conmoney") & "")                                                          '发货金额
  880.                 If TConMoney <> 0 Then
  881.                     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Format(Val(Trim(.Fields("Conmoney") & "")) / TConMoney * 100, "0.00")               '发货金额%
  882.                 End If
  883.             End If
  884.             If Val(Trim(.Fields("ConWholeMoney") & "")) <> 0 Then
  885.                 CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("ConWholeMoney") & "")                                                     '发货折扣
  886.                 If TConDiscount <> 0 Then
  887.                     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Format(Val(Trim(.Fields("ConWholeMoney") & "")) / TConWholeMoney * 100, "0.00")     '发货折扣%
  888.                 End If
  889.             End If
  890.             If Val(Trim(.Fields("InvMoney") & "")) <> 0 Then
  891.                 CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("InvMoney") & "")                                                          '退货金额
  892.                 If TTConMoney <> 0 Then
  893.                     CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvMoney") & "")) / TInvMoney * 100, "0.00")               '退货金额%
  894.                 End If
  895.             End If
  896.             If Val(Trim(.Fields("InvWholeMoney") & "")) <> 0 Then
  897.                 CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("InvWholeMoney") & "")                                                     '销售金额
  898.                 If TInvWholeMoney <> 0 Then
  899.                     CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Format(Val(Trim(.Fields("InvWholeMoney") & "")) / TInvWholeMoney * 100, "0.00")     '销售金额%
  900.                 End If
  901.             End If
  902.             If Val(Trim(.Fields("ConWholeMoney") & "")) - Val(Trim(.Fields("InvWholeMoney") & "")) <> 0 Then
  903.                 CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Val(Trim(.Fields("ConWholeMoney") & "")) - Val(Trim(.Fields("InvWholeMoney") & ""))     '毛利
  904.                 If TUCost <> 0 Then
  905.                     CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Format((Val(Trim(.Fields("ConWholeMoney") & "")) - Val(Trim(.Fields("InvWholeMoney") & ""))) / TUCost * 100, "0.00")   '毛利%
  906.                 End If
  907.             End If
  908.             '<<]
  909.             '设置数据行高度(Fixed)
  910.             CxbbGrid.RowHeight(Jsqte) = Sjhgd
  911.      
  912.             '动态集指针加1,同时将计数器加1(Fixed)
  913.             .MoveNext
  914.             Jsqte = Jsqte + 1
  915.         Loop
  916.     End With
  917.     '合计
  918.     CxbbGrid.AddItem ""
  919.     CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("001", GridStr(), Szzls)) = "合计"
  920.     For Coljsq = Qslz To CxbbGrid.Cols - 1
  921.         Call Sjhj(Coljsq)
  922.     Next Coljsq
  923.     If CxbbGrid.Rows <> 2 Then
  924.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("003", GridStr(), Szzls)) <> "" Then
  925.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("003", GridStr(), Szzls)) = "100.00"
  926.         End If
  927.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("005", GridStr(), Szzls)) <> "" Then
  928.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("005", GridStr(), Szzls)) = "100.00"
  929.         End If
  930.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("007", GridStr(), Szzls)) <> "" Then
  931.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("007", GridStr(), Szzls)) = "100.00"
  932.         End If
  933.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("009", GridStr(), Szzls)) <> "" Then
  934.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("009", GridStr(), Szzls)) = "100.00"
  935.         End If
  936.         If CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("011", GridStr(), Szzls)) <> "" Then
  937.             CxbbGrid.TextMatrix(CxbbGrid.Rows - 1, Sydz("011", GridStr(), Szzls)) = "100.00"
  938.         End If
  939.     End If
  940.     ']以上为用户自定义部分
  941. End Sub
  942. Private Sub Sjhj(Hjwgl As Long)                                         '网格列数据合计
  943.     
  944.     Dim Hjjg As Double
  945.     If Not GridBoolean(Hjwgl, 4) Then
  946.         Exit Sub
  947.     End If
  948.     With CxbbGrid
  949.         Hjjg = 0
  950.         For Jsqte = .FixedRows To .Rows - 2
  951.                 If Trim(.TextMatrix(Jsqte, Hjwgl)) <> "" Then
  952.                     Hjjg = Hjjg + Val(.TextMatrix(Jsqte, Hjwgl))
  953.                 End If
  954.         Next Jsqte
  955.         If GridBoolean(Hjwgl, 5) And Hjjg = 0 Then
  956.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = ""
  957.         Else
  958.             CxbbGrid.TextMatrix(.Rows - 1, Hjwgl) = Hjjg
  959.         End If
  960.     End With
  961. End Sub
  962. Private Sub Sub_AddBill()                                              '新增单据
  963.    
  964.     With Xs_O_OrderBill
  965.    
  966.         '设置单据处理为填制单据状态
  967. ''        .Lab_Djclzt.Caption = "1"
  968.          Xtcdcs = "1"
  969.         .Show 1
  970.     End With
  971.        
  972.     If Xtfhcs = "1" Then
  973.         Tsxx = "销售订单发生变化,是否刷新销售订单列表?"
  974.         Yhanswer = Xtxxts(Tsxx, 2, 2)
  975.         If Yhanswer = 1 Then
  976.             Xt_Wait.Show
  977.             Xt_Wait.Refresh
  978.    
  979.             '加快显示速度
  980.             CxbbGrid.Redraw = False
  981.  
  982.             '生成查询结果
  983.             Call Sub_Query(1)
  984.    
  985.             CxbbGrid.Redraw = True
  986.             Xt_Wait.Hide
  987.         End If
  988.     End If
  989.    
  990. End Sub
  991. Private Sub Sub_DeleteBill()                                            '删除选中当前销售订单
  992.     
  993.     Dim YAnswer As Integer
  994.     Dim Lng_BillID As Long           '单据标识
  995.   
  996.     '非数据行退出
  997.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  998.         Exit Sub
  999.     End If
  1000.   
  1001.     Tsxx = "请确认是否删除当前销售订单?"
  1002.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1003.   
  1004.     If Yhanswer = 1 Then
  1005.         '1.判断当前销售订单是否允许删除
  1006.         If Not Fun_AllowDelete Then
  1007.             Exit Sub
  1008.         End If
  1009.   
  1010.         '2.删除单据所有内容
  1011.         Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1012.         On Error GoTo Swcwcl
  1013.         Cw_DataEnvi.DataConnect.BeginTrans
  1014.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID)        '删除单据主表内容
  1015.         Cw_DataEnvi.DataConnect.Execute ("Delete XS_OrderBillSub Where OrderBillMainId=" & Lng_BillID)         '删除单据子表内容
  1016.         Cw_DataEnvi.DataConnect.CommitTrans
  1017.       
  1018.         '删除网格中单据数据
  1019.         Jsqte = CxbbGrid.FixedRows
  1020.         Do While Jsqte <= CxbbGrid.Rows - 1
  1021.             If Val(CxbbGrid.TextMatrix(Jsqte, 0)) = Lng_BillID Then
  1022.                 CxbbGrid.RemoveItem (CxbbGrid.Row)
  1023.             Else
  1024.                 Jsqte = Jsqte + 1
  1025.             End If
  1026.         Loop
  1027.     Else
  1028.         Exit Sub
  1029.     End If
  1030.     Exit Sub
  1031. Swcwcl:
  1032.     Cw_DataEnvi.DataConnect.RollbackTrans
  1033.     Tsxx = "删除销售订单过程中出现未知错误,程序自动恢复删除前状态!"
  1034.     Call Xtxxts(Tsxx, 0, 1)
  1035.     Exit Sub
  1036.   
  1037. End Sub
  1038. Private Function Fun_AllowDelete() As Boolean                                        '判断当前单据是否允许删除
  1039.   
  1040.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  1041.     Dim Sqlstr As String                   '查询字符串
  1042.     Dim Lng_BillID As Long                 '单据ID
  1043.   
  1044.     Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1045.     Sqlstr = "Select Checker From XS_OrderBillMain Where OrderBillMainId=" & Lng_BillID
  1046.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1047.     With RecTemp
  1048.         If Not .EOF Then
  1049.             If Trim(.Fields("Checker") & "") <> "" Then
  1050.                 Tsxx = "该销售订单已审核确认,不能删除!"
  1051.                 Call Xtxxts(Tsxx, 0, 4)
  1052.                 Exit Function
  1053.             End If
  1054.             End If
  1055.     End With
  1056.     Fun_AllowDelete = True
  1057.   
  1058. End Function
  1059. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1060.     
  1061.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1062.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1063.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1064.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1065.     ReDim Bbxbt(1 To Bbxbtgs)
  1066.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1067.     If Bbbwhgs <> 0 Then
  1068.         ReDim Bbbwh(1 To Bbbwhgs)
  1069.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1070.     End If
  1071.     Bbzbt = ReportTitle
  1072.     Bbxbt(1) = Space(2) + Fun_FormatOutPut(Trim(Lbl(4).Caption), 30)
  1073.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(0).Caption), 25)
  1074.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(5).Caption), 20)
  1075.     Bbxbt(1) = Bbxbt(1) + Fun_FormatOutPut(Trim(Lbl(2).Caption), 20)
  1076.     Bbxbt(2) = Space(2) + Fun_FormatOutPut(Trim(Lbl(1).Caption), 30)
  1077.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(3).Caption), 25)
  1078.     Bbxbt(2) = Bbxbt(2) + Fun_FormatOutPut(Trim(Lbl(6).Caption), 20)
  1079.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1080.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1081.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1082.     If Not bbylte Then
  1083.         Unload DY_Tybbyldy
  1084.     End If
  1085. End Sub