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

企业管理

开发平台:

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 MRP_TotalDemandList 
  5.    BackColor       =   &H00C0C0C0&
  6.    Caption         =   "汇总需求列表"
  7.    ClientHeight    =   6900
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   11880
  11.    Icon            =   "物料需求计划_汇总需求列表.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   6900
  15.    ScaleWidth      =   11880
  16.    Begin VB.PictureBox Pic_Title 
  17.       BackColor       =   &H00FFFFFF&
  18.       Height          =   825
  19.       Left            =   0
  20.       Picture         =   "物料需求计划_汇总需求列表.frx":1042
  21.       ScaleHeight     =   765
  22.       ScaleWidth      =   11715
  23.       TabIndex        =   3
  24.       Top             =   570
  25.       Width           =   11775
  26.       Begin VB.Label Label1 
  27.          Appearance      =   0  'Flat
  28.          BackColor       =   &H80000005&
  29.          BackStyle       =   0  'Transparent
  30.          Caption         =   "生成"
  31.          ForeColor       =   &H80000008&
  32.          Height          =   195
  33.          Index           =   4
  34.          Left            =   10140
  35.          TabIndex        =   16
  36.          Top             =   120
  37.          Width           =   435
  38.       End
  39.       Begin VB.Label Lab_Color 
  40.          Appearance      =   0  'Flat
  41.          BackColor       =   &H80000018&
  42.          BorderStyle     =   1  'Fixed Single
  43.          ForeColor       =   &H80000008&
  44.          Height          =   195
  45.          Index           =   2
  46.          Left            =   9900
  47.          TabIndex        =   15
  48.          Top             =   120
  49.          Width           =   195
  50.       End
  51.       Begin VB.Label Label1 
  52.          Appearance      =   0  'Flat
  53.          BackColor       =   &H80000005&
  54.          BackStyle       =   0  'Transparent
  55.          Caption         =   "审  核"
  56.          ForeColor       =   &H80000008&
  57.          Height          =   195
  58.          Index           =   8
  59.          Left            =   8940
  60.          TabIndex        =   14
  61.          Top             =   450
  62.          Width           =   795
  63.       End
  64.       Begin VB.Label Lab_Color 
  65.          Appearance      =   0  'Flat
  66.          BackColor       =   &H00C0E0FF&
  67.          BorderStyle     =   1  'Fixed Single
  68.          ForeColor       =   &H80000008&
  69.          Height          =   195
  70.          Index           =   1
  71.          Left            =   8700
  72.          TabIndex        =   13
  73.          Top             =   450
  74.          Width           =   195
  75.       End
  76.       Begin VB.Label Label1 
  77.          Appearance      =   0  'Flat
  78.          BackColor       =   &H80000005&
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "未审核"
  81.          ForeColor       =   &H80000008&
  82.          Height          =   195
  83.          Index           =   7
  84.          Left            =   8940
  85.          TabIndex        =   12
  86.          Top             =   120
  87.          Width           =   795
  88.       End
  89.       Begin VB.Label Lab_Color 
  90.          Appearance      =   0  'Flat
  91.          BackColor       =   &H00FFFFFF&
  92.          BorderStyle     =   1  'Fixed Single
  93.          ForeColor       =   &H80000008&
  94.          Height          =   195
  95.          Index           =   0
  96.          Left            =   8700
  97.          TabIndex        =   11
  98.          Top             =   120
  99.          Width           =   195
  100.       End
  101.       Begin VB.Label Label1 
  102.          Appearance      =   0  'Flat
  103.          BackColor       =   &H80000005&
  104.          BackStyle       =   0  'Transparent
  105.          Caption         =   "完成"
  106.          ForeColor       =   &H80000008&
  107.          Height          =   195
  108.          Index           =   6
  109.          Left            =   10140
  110.          TabIndex        =   10
  111.          Top             =   450
  112.          Width           =   795
  113.       End
  114.       Begin VB.Label Lab_Color 
  115.          Appearance      =   0  'Flat
  116.          BackColor       =   &H00C0FFC0&
  117.          BorderStyle     =   1  'Fixed Single
  118.          ForeColor       =   &H80000008&
  119.          Height          =   195
  120.          Index           =   3
  121.          Left            =   9900
  122.          TabIndex        =   9
  123.          Top             =   450
  124.          Width           =   195
  125.       End
  126.       Begin VB.Label Lab_Content 
  127.          BackStyle       =   0  'Transparent
  128.          Height          =   255
  129.          Index           =   0
  130.          Left            =   3960
  131.          TabIndex        =   8
  132.          Top             =   360
  133.          Width           =   1095
  134.       End
  135.       Begin VB.Label Lab_Title 
  136.          BackStyle       =   0  'Transparent
  137.          Caption         =   "计划周期:"
  138.          Height          =   255
  139.          Index           =   1
  140.          Left            =   3000
  141.          TabIndex        =   7
  142.          Top             =   360
  143.          Width           =   855
  144.       End
  145.       Begin VB.Label Lab_Color 
  146.          Appearance      =   0  'Flat
  147.          BackColor       =   &H008080FF&
  148.          BorderStyle     =   1  'Fixed Single
  149.          ForeColor       =   &H80000008&
  150.          Height          =   195
  151.          Index           =   4
  152.          Left            =   10920
  153.          TabIndex        =   6
  154.          Top             =   120
  155.          Width           =   195
  156.       End
  157.       Begin VB.Label Label1 
  158.          Appearance      =   0  'Flat
  159.          BackColor       =   &H80000005&
  160.          BackStyle       =   0  'Transparent
  161.          Caption         =   "废弃"
  162.          ForeColor       =   &H80000008&
  163.          Height          =   195
  164.          Index           =   5
  165.          Left            =   11160
  166.          TabIndex        =   5
  167.          Top             =   120
  168.          Width           =   795
  169.       End
  170.       Begin VB.Label Lab_Title 
  171.          BackColor       =   &H80000018&
  172.          BackStyle       =   0  'Transparent
  173.          Caption         =   "汇总需求列表"
  174.          BeginProperty Font 
  175.             Name            =   "宋体"
  176.             Size            =   12
  177.             Charset         =   134
  178.             Weight          =   700
  179.             Underline       =   0   'False
  180.             Italic          =   0   'False
  181.             Strikethrough   =   0   'False
  182.          EndProperty
  183.          ForeColor       =   &H00000000&
  184.          Height          =   300
  185.          Index           =   10
  186.          Left            =   480
  187.          TabIndex        =   4
  188.          Top             =   240
  189.          Width           =   2265
  190.       End
  191.    End
  192.    Begin VB.Timer Timer1 
  193.       Enabled         =   0   'False
  194.       Interval        =   1
  195.       Left            =   2880
  196.       Top             =   3240
  197.    End
  198.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  199.       Height          =   7545
  200.       Left            =   0
  201.       TabIndex        =   0
  202.       Top             =   1440
  203.       Width           =   11775
  204.       _cx             =   5080
  205.       _cy             =   5080
  206.       Appearance      =   1
  207.       BorderStyle     =   1
  208.       Enabled         =   -1  'True
  209.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  210.          Name            =   "宋体"
  211.          Size            =   9
  212.          Charset         =   134
  213.          Weight          =   400
  214.          Underline       =   0   'False
  215.          Italic          =   0   'False
  216.          Strikethrough   =   0   'False
  217.       EndProperty
  218.       MousePointer    =   0
  219.       BackColor       =   16777215
  220.       ForeColor       =   -2147483640
  221.       BackColorFixed  =   13826538
  222.       ForeColorFixed  =   -2147483630
  223.       BackColorSel    =   -2147483635
  224.       ForeColorSel    =   -2147483634
  225.       BackColorBkg    =   -2147483636
  226.       BackColorAlternate=   16777215
  227.       GridColor       =   -2147483633
  228.       GridColorFixed  =   -2147483632
  229.       TreeColor       =   -2147483632
  230.       FloodColor      =   192
  231.       SheetBorder     =   -2147483642
  232.       FocusRect       =   1
  233.       HighLight       =   1
  234.       AllowSelection  =   -1  'True
  235.       AllowBigSelection=   -1  'True
  236.       AllowUserResizing=   0
  237.       SelectionMode   =   0
  238.       GridLines       =   1
  239.       GridLinesFixed  =   2
  240.       GridLineWidth   =   1
  241.       Rows            =   50
  242.       Cols            =   10
  243.       FixedRows       =   1
  244.       FixedCols       =   1
  245.       RowHeightMin    =   0
  246.       RowHeightMax    =   0
  247.       ColWidthMin     =   0
  248.       ColWidthMax     =   0
  249.       ExtendLastCol   =   0   'False
  250.       FormatString    =   ""
  251.       ScrollTrack     =   0   'False
  252.       ScrollBars      =   3
  253.       ScrollTips      =   0   'False
  254.       MergeCells      =   0
  255.       MergeCompare    =   0
  256.       AutoResize      =   -1  'True
  257.       AutoSizeMode    =   0
  258.       AutoSearch      =   0
  259.       AutoSearchDelay =   2
  260.       MultiTotals     =   -1  'True
  261.       SubtotalPosition=   1
  262.       OutlineBar      =   0
  263.       OutlineCol      =   0
  264.       Ellipsis        =   0
  265.       ExplorerBar     =   0
  266.       PicturesOver    =   0   'False
  267.       FillStyle       =   0
  268.       RightToLeft     =   0   'False
  269.       PictureType     =   0
  270.       TabBehavior     =   0
  271.       OwnerDraw       =   0
  272.       Editable        =   0
  273.       ShowComboButton =   1
  274.       WordWrap        =   0   'False
  275.       TextStyle       =   0
  276.       TextStyleFixed  =   0
  277.       OleDragMode     =   0
  278.       OleDropMode     =   0
  279.       DataMode        =   0
  280.       VirtualData     =   -1  'True
  281.       DataMember      =   ""
  282.       ComboSearch     =   3
  283.       AutoSizeMouse   =   -1  'True
  284.       FrozenRows      =   0
  285.       FrozenCols      =   0
  286.       AllowUserFreezing=   0
  287.       BackColorFrozen =   0
  288.       ForeColorFrozen =   0
  289.       WallPaperAlignment=   9
  290.       AccessibleName  =   ""
  291.       AccessibleDescription=   ""
  292.       AccessibleValue =   ""
  293.       AccessibleRole  =   24
  294.       Begin MSComctlLib.ImageList ImageList2 
  295.          Left            =   0
  296.          Top             =   0
  297.          _ExtentX        =   1005
  298.          _ExtentY        =   1005
  299.          BackColor       =   -2147483643
  300.          ImageWidth      =   16
  301.          ImageHeight     =   16
  302.          MaskColor       =   12632256
  303.          _Version        =   393216
  304.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  305.             NumListImages   =   40
  306.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  307.                Picture         =   "物料需求计划_汇总需求列表.frx":1DF82
  308.                Key             =   "sz"
  309.             EndProperty
  310.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  311.                Picture         =   "物料需求计划_汇总需求列表.frx":1DFE0
  312.                Key             =   "dy"
  313.             EndProperty
  314.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  315.                Picture         =   "物料需求计划_汇总需求列表.frx":1E03E
  316.                Key             =   "yl"
  317.             EndProperty
  318.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  319.                Picture         =   "物料需求计划_汇总需求列表.frx":1E09C
  320.                Key             =   "xg"
  321.             EndProperty
  322.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  323.                Picture         =   "物料需求计划_汇总需求列表.frx":1E0FA
  324.                Key             =   "zh"
  325.             EndProperty
  326.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  327.                Picture         =   "物料需求计划_汇总需求列表.frx":1E158
  328.                Key             =   "sh"
  329.             EndProperty
  330.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  331.                Picture         =   "物料需求计划_汇总需求列表.frx":1E1B6
  332.                Key             =   "bc"
  333.             EndProperty
  334.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  335.                Picture         =   "物料需求计划_汇总需求列表.frx":1E214
  336.                Key             =   "fq"
  337.             EndProperty
  338.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  339.                Picture         =   "物料需求计划_汇总需求列表.frx":1E272
  340.                Key             =   "bz"
  341.             EndProperty
  342.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  343.                Picture         =   "物料需求计划_汇总需求列表.frx":1E2D0
  344.                Key             =   "tc"
  345.             EndProperty
  346.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  347.                Picture         =   "物料需求计划_汇总需求列表.frx":1E32E
  348.                Key             =   "bcgs"
  349.             EndProperty
  350.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  351.                Picture         =   "物料需求计划_汇总需求列表.frx":1E38C
  352.                Key             =   "mrlk"
  353.             EndProperty
  354.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  355.                Picture         =   "物料需求计划_汇总需求列表.frx":1E3EA
  356.                Key             =   "xsxm"
  357.             EndProperty
  358.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  359.                Picture         =   "物料需求计划_汇总需求列表.frx":1E448
  360.                Key             =   "first"
  361.             EndProperty
  362.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  363.                Picture         =   "物料需求计划_汇总需求列表.frx":1E4A6
  364.                Key             =   "prev"
  365.             EndProperty
  366.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  367.                Picture         =   "物料需求计划_汇总需求列表.frx":1E504
  368.                Key             =   "next"
  369.             EndProperty
  370.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  371.                Picture         =   "物料需求计划_汇总需求列表.frx":1E562
  372.                Key             =   "last"
  373.             EndProperty
  374.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  375.                Picture         =   "物料需求计划_汇总需求列表.frx":1E5C0
  376.                Key             =   "xx"
  377.             EndProperty
  378.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  379.                Picture         =   "物料需求计划_汇总需求列表.frx":1E61E
  380.                Key             =   "define"
  381.             EndProperty
  382.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  383.                Picture         =   "物料需求计划_汇总需求列表.frx":1E67C
  384.                Key             =   "exec"
  385.             EndProperty
  386.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  387.                Picture         =   "物料需求计划_汇总需求列表.frx":1E6DA
  388.                Key             =   "xz"
  389.             EndProperty
  390.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  391.                Picture         =   "物料需求计划_汇总需求列表.frx":1E738
  392.                Key             =   "sc"
  393.             EndProperty
  394.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  395.                Picture         =   "物料需求计划_汇总需求列表.frx":1E796
  396.                Key             =   "sx"
  397.             EndProperty
  398.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  399.                Picture         =   "物料需求计划_汇总需求列表.frx":1E7F4
  400.                Key             =   "cx"
  401.             EndProperty
  402.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.                Picture         =   "物料需求计划_汇总需求列表.frx":1E852
  404.                Key             =   "zd"
  405.             EndProperty
  406.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.                Picture         =   "物料需求计划_汇总需求列表.frx":1E8B0
  408.                Key             =   "dz"
  409.             EndProperty
  410.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.                Picture         =   "物料需求计划_汇总需求列表.frx":1E90E
  412.                Key             =   "ph"
  413.             EndProperty
  414.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.                Picture         =   "物料需求计划_汇总需求列表.frx":1E96C
  416.                Key             =   "fz"
  417.             EndProperty
  418.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.                Picture         =   "物料需求计划_汇总需求列表.frx":1E9CA
  420.                Key             =   "dw"
  421.             EndProperty
  422.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.                Picture         =   "物料需求计划_汇总需求列表.frx":1EA28
  424.                Key             =   "hf"
  425.             EndProperty
  426.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.                Picture         =   "物料需求计划_汇总需求列表.frx":1EA86
  428.                Key             =   "pz"
  429.             EndProperty
  430.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.                Picture         =   "物料需求计划_汇总需求列表.frx":1EAE4
  432.                Key             =   "check"
  433.             EndProperty
  434.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.                Picture         =   "物料需求计划_汇总需求列表.frx":1EB42
  436.                Key             =   "qs"
  437.             EndProperty
  438.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.                Picture         =   "物料需求计划_汇总需求列表.frx":1EBA0
  440.                Key             =   "fullcheck"
  441.             EndProperty
  442.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.                Picture         =   "物料需求计划_汇总需求列表.frx":1EBFE
  444.                Key             =   "qq"
  445.             EndProperty
  446.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.                Picture         =   "物料需求计划_汇总需求列表.frx":1EC5C
  448.                Key             =   "bcw"
  449.             EndProperty
  450.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.                Picture         =   "物料需求计划_汇总需求列表.frx":1ECBA
  452.                Key             =   "ye"
  453.             EndProperty
  454.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.                Picture         =   "物料需求计划_汇总需求列表.frx":1ED18
  456.                Key             =   ""
  457.             EndProperty
  458.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.                Picture         =   "物料需求计划_汇总需求列表.frx":1ED76
  460.                Key             =   "frist"
  461.             EndProperty
  462.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.                Picture         =   "物料需求计划_汇总需求列表.frx":1EDD4
  464.                Key             =   "dj"
  465.             EndProperty
  466.          EndProperty
  467.       End
  468.    End
  469.    Begin MSComctlLib.Toolbar SzToolbar 
  470.       Align           =   1  'Align Top
  471.       Height          =   555
  472.       Left            =   0
  473.       TabIndex        =   1
  474.       Top             =   0
  475.       Width           =   11880
  476.       _ExtentX        =   20955
  477.       _ExtentY        =   979
  478.       ButtonWidth     =   820
  479.       ButtonHeight    =   926
  480.       AllowCustomize  =   0   'False
  481.       Appearance      =   1
  482.       Style           =   1
  483.       ImageList       =   "ImageList1"
  484.       _Version        =   393216
  485.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  486.          NumButtons      =   14
  487.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  488.             Caption         =   "设置"
  489.             Key             =   "ymsz"
  490.             ImageKey        =   "sz"
  491.          EndProperty
  492.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  493.             Caption         =   "打印"
  494.             Key             =   "dy"
  495.             ImageKey        =   "dy"
  496.          EndProperty
  497.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  498.             Caption         =   "预览"
  499.             Key             =   "yl"
  500.             ImageKey        =   "yl"
  501.          EndProperty
  502.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  503.             Style           =   3
  504.          EndProperty
  505.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Caption         =   "查询"
  507.             Key             =   "cx"
  508.             ImageKey        =   "cx"
  509.          EndProperty
  510.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  511.             Style           =   3
  512.          EndProperty
  513.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  514.             Enabled         =   0   'False
  515.             Object.Visible         =   0   'False
  516.             Caption         =   "新增"
  517.             Key             =   "xz"
  518.             ImageKey        =   "xz"
  519.          EndProperty
  520.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  521.             Caption         =   "单据"
  522.             Key             =   "Bill"
  523.             ImageKey        =   "pz"
  524.          EndProperty
  525.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  526.             Caption         =   "删除"
  527.             Key             =   "sc"
  528.             ImageKey        =   "sc"
  529.          EndProperty
  530.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  531.             Style           =   3
  532.          EndProperty
  533.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  534.             Caption         =   "审核"
  535.             Key             =   "shhe"
  536.             ImageKey        =   "check"
  537.          EndProperty
  538.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  539.             Style           =   3
  540.          EndProperty
  541.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  542.             Caption         =   "帮助"
  543.             Key             =   "bz"
  544.             ImageKey        =   "bz"
  545.          EndProperty
  546.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  547.             Caption         =   "退出"
  548.             Key             =   "fh"
  549.             ImageKey        =   "tc"
  550.          EndProperty
  551.       EndProperty
  552.       BorderStyle     =   1
  553.       Begin MSComctlLib.Toolbar GsToolbar 
  554.          Height          =   525
  555.          Left            =   8760
  556.          TabIndex        =   2
  557.          Top             =   0
  558.          Width           =   2475
  559.          _ExtentX        =   4366
  560.          _ExtentY        =   926
  561.          ButtonWidth     =   1455
  562.          ButtonHeight    =   926
  563.          AllowCustomize  =   0   'False
  564.          Appearance      =   1
  565.          Style           =   1
  566.          ImageList       =   "ImageList1"
  567.          _Version        =   393216
  568.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  569.             NumButtons      =   3
  570.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  571.                Caption         =   "保存格式"
  572.                Key             =   "bcgs"
  573.                ImageKey        =   "bcgs"
  574.             EndProperty
  575.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  576.                Caption         =   "默认列宽"
  577.                Key             =   "hfmrgs"
  578.                ImageKey        =   "mrlk"
  579.             EndProperty
  580.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  581.                Caption         =   "显示项目"
  582.                Key             =   "szxsxm"
  583.                ImageKey        =   "xsxm"
  584.             EndProperty
  585.          EndProperty
  586.       End
  587.       Begin MSComctlLib.ImageList ImageList1 
  588.          Left            =   6990
  589.          Top             =   30
  590.          _ExtentX        =   1005
  591.          _ExtentY        =   1005
  592.          BackColor       =   -2147483643
  593.          ImageWidth      =   16
  594.          ImageHeight     =   16
  595.          MaskColor       =   12632256
  596.          _Version        =   393216
  597.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  598.             NumListImages   =   32
  599.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  600.                Picture         =   "物料需求计划_汇总需求列表.frx":1EE32
  601.                Key             =   "sz"
  602.             EndProperty
  603.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  604.                Picture         =   "物料需求计划_汇总需求列表.frx":1F1CC
  605.                Key             =   "dy"
  606.             EndProperty
  607.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  608.                Picture         =   "物料需求计划_汇总需求列表.frx":1F566
  609.                Key             =   "yl"
  610.             EndProperty
  611.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  612.                Picture         =   "物料需求计划_汇总需求列表.frx":1F900
  613.                Key             =   "xg"
  614.             EndProperty
  615.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  616.                Picture         =   "物料需求计划_汇总需求列表.frx":1FC9A
  617.                Key             =   "zh"
  618.             EndProperty
  619.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  620.                Picture         =   "物料需求计划_汇总需求列表.frx":20034
  621.                Key             =   "sh"
  622.             EndProperty
  623.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  624.                Picture         =   "物料需求计划_汇总需求列表.frx":203CE
  625.                Key             =   "bc"
  626.             EndProperty
  627.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  628.                Picture         =   "物料需求计划_汇总需求列表.frx":20768
  629.                Key             =   "fq"
  630.             EndProperty
  631.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  632.                Picture         =   "物料需求计划_汇总需求列表.frx":20B02
  633.                Key             =   "bz"
  634.             EndProperty
  635.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  636.                Picture         =   "物料需求计划_汇总需求列表.frx":20E9C
  637.                Key             =   "tc"
  638.             EndProperty
  639.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  640.                Picture         =   "物料需求计划_汇总需求列表.frx":21236
  641.                Key             =   "bcgs"
  642.             EndProperty
  643.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  644.                Picture         =   "物料需求计划_汇总需求列表.frx":215D0
  645.                Key             =   "mrlk"
  646.             EndProperty
  647.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  648.                Picture         =   "物料需求计划_汇总需求列表.frx":2196A
  649.                Key             =   "xsxm"
  650.             EndProperty
  651.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  652.                Picture         =   "物料需求计划_汇总需求列表.frx":21D04
  653.                Key             =   "first"
  654.             EndProperty
  655.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  656.                Picture         =   "物料需求计划_汇总需求列表.frx":2209E
  657.                Key             =   "prev"
  658.             EndProperty
  659.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  660.                Picture         =   "物料需求计划_汇总需求列表.frx":22438
  661.                Key             =   "next"
  662.             EndProperty
  663.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  664.                Picture         =   "物料需求计划_汇总需求列表.frx":227D2
  665.                Key             =   "last"
  666.             EndProperty
  667.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  668.                Picture         =   "物料需求计划_汇总需求列表.frx":22B6C
  669.                Key             =   "xx"
  670.             EndProperty
  671.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  672.                Picture         =   "物料需求计划_汇总需求列表.frx":22F06
  673.                Key             =   "define"
  674.             EndProperty
  675.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  676.                Picture         =   "物料需求计划_汇总需求列表.frx":232A0
  677.                Key             =   "exec"
  678.             EndProperty
  679.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  680.                Picture         =   "物料需求计划_汇总需求列表.frx":2363A
  681.                Key             =   "xz"
  682.             EndProperty
  683.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  684.                Picture         =   "物料需求计划_汇总需求列表.frx":239D4
  685.                Key             =   "sc"
  686.             EndProperty
  687.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  688.                Picture         =   "物料需求计划_汇总需求列表.frx":23D6E
  689.                Key             =   "sx"
  690.             EndProperty
  691.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  692.                Picture         =   "物料需求计划_汇总需求列表.frx":24108
  693.                Key             =   "cx"
  694.             EndProperty
  695.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  696.                Picture         =   "物料需求计划_汇总需求列表.frx":244A2
  697.                Key             =   "zd"
  698.             EndProperty
  699.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  700.                Picture         =   "物料需求计划_汇总需求列表.frx":2483C
  701.                Key             =   "dz"
  702.             EndProperty
  703.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  704.                Picture         =   "物料需求计划_汇总需求列表.frx":24BD6
  705.                Key             =   "ph"
  706.             EndProperty
  707.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  708.                Picture         =   "物料需求计划_汇总需求列表.frx":24F70
  709.                Key             =   "fz"
  710.             EndProperty
  711.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  712.                Picture         =   "物料需求计划_汇总需求列表.frx":2530A
  713.                Key             =   "dw"
  714.             EndProperty
  715.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  716.                Picture         =   "物料需求计划_汇总需求列表.frx":256A4
  717.                Key             =   "hf"
  718.             EndProperty
  719.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  720.                Picture         =   "物料需求计划_汇总需求列表.frx":25A3E
  721.                Key             =   "pz"
  722.             EndProperty
  723.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  724.                Picture         =   "物料需求计划_汇总需求列表.frx":25DD8
  725.                Key             =   "check"
  726.             EndProperty
  727.          EndProperty
  728.       End
  729.    End
  730. End
  731. Attribute VB_Name = "MRP_TotalDemandList"
  732. Attribute VB_GlobalNameSpace = False
  733. Attribute VB_Creatable = False
  734. Attribute VB_PredeclaredId = True
  735. Attribute VB_Exposed = False
  736. '******************************************************************
  737. '*    模 块 名 称 :物料需求计划--汇总物料需求列表
  738. '*    功 能 描 述 :汇总物料需求列表
  739. '*    程序员姓名  :乔进
  740. '*    最后修改人  :乔进
  741. '*    最后修改时间:2001/12/10
  742. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  743. '******************************************************************
  744. Dim ReportTitle As String                '报表主标题
  745. Dim Str_QueryCondi As String             '用户录入查询条件
  746. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  747. '以下为固定使用变量
  748. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  749. Dim GridCode As String                   '显示网格网格代码
  750. Dim GridInf() As Variant                 '整个网格设置信息
  751. Dim Tsxx As String                       '系统提示信息
  752. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  753. Dim Sjhgd As Double                      '网格数据行高度
  754. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  755. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  756. Dim GridStr()  As String                 '网格列信息(字符型)
  757. Dim GridInt() As Integer                 '网格列信息(整型)
  758. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  759. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  760.     On Error Resume Next
  761.     With CxbbGrid
  762.         .Width = Me.Width - 160
  763.         .Height = Me.Height - .Top - 400
  764.     End With
  765.     With Pic_Title
  766.         .Width = Me.Width - 160
  767.     End With
  768.     
  769.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  770. End Sub
  771. Private Sub Form_Load()                                                   '窗体装入
  772.   
  773.     '调入打印页面设置窗体
  774.     ReportTitle = "汇总需求列表"
  775.     XtReportCode = "MRP_TotalDemandList"
  776.     Load Dyymctbl
  777.       
  778.     '调整标题栏及网格、格式工具条位置(Fixed)
  779.     Pic_Title.Left = 40
  780.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  781.     CxbbGrid.Left = Pic_Title.Left
  782.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  783.      
  784.     '调 入 网 格(Fixed)
  785.     GridCode = "MRP_TotalDemandList"
  786.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  787.       
  788.     Qslz = GridInf(1)
  789.     Sjhgd = GridInf(2)
  790.     Sfxshjwg = GridInf(7)
  791.     Szzls = CxbbGrid.Cols - 1
  792.     MRP_TotalDemandList.HelpContextID = 241400302
  793. End Sub
  794. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  795.     '卸载条件窗体
  796.     MRP_TotalDemandQuery.UnloadCheck.Value = 1
  797.     Unload MRP_TotalDemandQuery
  798.     
  799.     '卸载打印页面设置窗体
  800.     Unload Dyymctbl
  801.     Security_Log "MRP_SumList", Xtczybm, 2, False  '用户退出时写上机日志
  802. End Sub
  803. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  804.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  805. End Sub
  806. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  807.   
  808.     Select Case Button.Key
  809.         Case "bcgs"                                          '保存表格格式
  810.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  811.         Case "hfmrgs"                                        '恢复默认格式
  812.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  813.         Case "szxsxm"                                        '设置显示项目
  814.             Call Szxsxm(CxbbGrid, GridCode)
  815.     End Select
  816. End Sub
  817. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  818.     
  819.     Select Case Button.Key
  820.         Case "ymsz"                                          '页面设置
  821.             Dyymctbl.Show 1
  822.         Case "yl"                                            '预 览
  823.             Call bbyl(True)
  824.         Case "dy"                                            '打 印
  825.             Call bbyl(False)
  826.         Case "cx"                                            '查 询
  827.             MRP_TotalDemandQuery.Show 1
  828.         Case "Bill"                                          '单 据
  829.             If Not Security_Log("MRP_SumList_Edit", Xtczybm, 1) Then
  830.                 Exit Sub
  831.             End If
  832.             Call CxbbGrid_DblClick
  833.         Case "sc"                                            '删 除
  834.             If Not Security_Log("MRP_SumList_Edit", Xtczybm, 1) Then
  835.                 Exit Sub
  836.             End If
  837.             Call Sub_DeleteBill
  838.         Case "bz"                                            '帮 助
  839.             Call F1bz
  840.         Case "fh"                                            '退 出
  841.            Unload Me
  842.         Case "shhe"                                          '审核
  843.             If Not Security_Log("MRP_SumList_Audit", Xtczybm, 1) Then
  844.                 Exit Sub
  845.             End If
  846.             Call Sub_Checkbill
  847.     End Select
  848. End Sub
  849. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  850.     
  851.     Timer1.Enabled = False
  852.     Xt_Wait.Show
  853.     Xt_Wait.Refresh
  854.    
  855.     '加快显示速度
  856.     CxbbGrid.Redraw = False
  857.  
  858.     '生成查询结果
  859.     Call Sub_Query(0)
  860.    
  861.     CxbbGrid.Redraw = True
  862.     
  863.     Xt_Wait.Hide
  864. End Sub
  865. Private Sub Sub_Query(Int_QueryType As Integer)                                     '生成查询结果(Define)
  866.     
  867.     '过程参数:Int_QueryType 0-"点确定按钮"查询  1-"刷新"查询
  868.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  869.     Dim Coljsq As Long                          '网格列计数器
  870.     Dim jsqte As Long                        '临时动态计数器
  871.     Dim iYear As Integer, iMonth As Integer
  872.     '以下为自定义部分[
  873.  
  874.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  875.         With MRP_TotalDemandQuery
  876.          
  877.             '生成查询条件
  878.             Str_QueryCondi = " where 1=1 "
  879.             For jsqte = 1 To 16
  880.                 Select Case jsqte
  881.                     Case 1  '起始周期
  882.                         If Trim(.Combo_Con(0)) <> "" Then
  883.                             Call Sub_DivMonth(Trim(.Combo_Con(0).Text), iYear, iMonth)
  884.                             Str_QueryCondi = Str_QueryCondi & " And kjYear=" & iYear & " And period=" & iMonth
  885.                         End If
  886.                     Case "2" '起始日期
  887.                         If Trim(.LrText(0)) <> "" Then
  888.                             Str_QueryCondi = Str_QueryCondi + " And TotalDate >='" & Format(Trim(.LrText(0)), "yyyy-mm-dd") & "' "
  889.                         End If
  890.                     Case "3" '截止日期
  891.                         If Trim(.LrText(1)) <> "" Then
  892.                             Str_QueryCondi = Str_QueryCondi + " And TotalDate <='" & Format(Trim(.LrText(1)), "yyyy-mm-dd") & "' "
  893.                         End If
  894.                     Case "4" '需求类型
  895.                         If Trim(.LrText(2)) <> "" Then
  896.                             Str_QueryCondi = Str_QueryCondi + " And  Demandtype='" & Trim(.LrText(2).Tag) & "' "
  897.                         End If
  898.                     Case "5" '物料分类
  899.                         If Trim(.LrText(3)) <> "" Then
  900.                             Str_QueryCondi = Str_QueryCondi + " And PurSortCode ='" & .LrText(3).Tag & "' "
  901.                         End If
  902.                     Case "6" '是否追补
  903.                         If Not .Opt_PlanType(0).Value Then
  904.                             If .Opt_PlanType(1).Value Then
  905.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfAdd=0 "
  906.                             Else
  907.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfAdd=1 "
  908.                             End If
  909.                         End If
  910.                     Case 7   '审核
  911.                         If Not .Opt_Check(0).Value Then
  912.                             If .Opt_Check(1).Value Then
  913.                                 Str_QueryCondi = Str_QueryCondi & " And  a.Checker='' "
  914.                             Else
  915.                                 Str_QueryCondi = Str_QueryCondi & " And  a.Checker<>'' "
  916.                             End If
  917.                         End If
  918.                     Case 8   '生成
  919.                         If Not .Opt_Create(0).Value Then
  920.                             If .Opt_Create(1).Value Then
  921.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfTransack=0 "
  922.                             Else
  923.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfTransack=1 "
  924.                             End If
  925.                         End If
  926.                     Case 9   '废弃
  927.                         If Not .Opt_Abandon(0).Value Then
  928.                             If .Opt_Abandon(1).Value Then
  929.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfAbandon=0 "
  930.                             Else
  931.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfAbandon=1  "
  932.                             End If
  933.                         End If
  934.                     Case 10   '完成
  935.                         If Not .Opt_Finish(0).Value Then
  936.                             If .Opt_Finish(1).Value Then
  937.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfComplete=0 "
  938.                             Else
  939.                                 Str_QueryCondi = Str_QueryCondi & " And  a.IfComplete=1  "
  940.                             End If
  941.                         End If
  942.                     Case "11" '物料编码
  943.                         If Trim(.LrText(4)) <> "" Then
  944.                             Str_QueryCondi = Str_QueryCondi + " And MNumber ='" & .LrText(4).Text & "' "
  945.                         End If
  946.                     Case "12" '制单
  947.                         If Trim(.LrText(5)) <> "" Then
  948.                             Str_QueryCondi = Str_QueryCondi + " And TotalMan ='" & .LrText(5).Text & "' "
  949.                         End If
  950.                     Case "13" '审核
  951.                         If Trim(.LrText(6)) <> "" Then
  952.                             Str_QueryCondi = Str_QueryCondi + " And Checker ='" & .LrText(6).Text & "' "
  953.                         End If
  954.                     Case "14" '毛需求
  955.                         If Trim(.Combo_Con(2)) <> "" Then
  956.                             Str_QueryCondi = Str_QueryCondi + " And QuanGross " & Trim(.Combo_Con(2).Text & "") & " " & Val(.LrText(7))
  957.                         End If
  958.                     Case "15" '净需求
  959.                         If Trim(.Combo_Con(3)) <> "" Then
  960.                             Str_QueryCondi = Str_QueryCondi + " And NetNumber " & Trim(.Combo_Con(3).Text & "") & " " & Val(.LrText(8))
  961.                         End If
  962.                     Case "16" '计划来源
  963.                         If Trim(.Combo_Con(1)) <> "" Then
  964.                             Str_QueryCondi = Str_QueryCondi + " And TotalDemandID In ( Select TotalDemandID From MRP_DemandRelation  Where   DemandSource='" & Val(Trim(.Combo_Con(1) & "")) & "'  )  "
  965.                         End If
  966.                 End Select
  967.             Next jsqte
  968.         End With
  969.     Else
  970.         '1-"刷新"查询
  971.         If Str_QueryCondi = "" Then
  972.             Str_QueryCondi = " where 1=1 "
  973.         End If
  974.     End If
  975.     
  976.     Sqlstr = "Select * From MRP_V_TotalDemand a " & Str_QueryCondi & ""
  977.     Sqlstr = Sqlstr + "  Order by TotalDemandID"
  978.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  979.     With Rec_Query
  980.         CxbbGrid.Rows = CxbbGrid.FixedRows
  981.         jsqte = CxbbGrid.FixedRows
  982.         Lab_Content(0) = Trim(MRP_TotalDemandQuery.Combo_Con(0))
  983.         Do While Not .EOF
  984.             CxbbGrid.AddItem ""
  985.             '[>>自定义填充内容
  986.             CxbbGrid.TextMatrix(jsqte, 0) = .Fields("TotalDemandID")                                                            '订单ID(主要用来查询定位用)
  987.             CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(Rec_Query!MNumber & "")                            '物料编码
  988.             CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(Rec_Query!Mname & "")                              '物料名称
  989.             CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(Rec_Query!Model & "")                              '规格型号
  990.             CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(Rec_Query!PrimaryUnitName & "")                    '单位
  991.             CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(Rec_Query!QuanGross & "")                          '毛需求数量
  992.             CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(Rec_Query!QuanWare & "")                           '现存数量
  993.             CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(Rec_Query!QuanAllocated & "")                      '已分配量
  994.             CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(Rec_Query!SafeNumber & "")                         '安全库存
  995.             CxbbGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(Rec_Query!NetNumber & "")                          '净需求数量
  996.             CxbbGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(Rec_Query!StockNumber & "")                        '采购数量
  997.             CxbbGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(Rec_Query!TypeName & "")                           '需求类型
  998.             CxbbGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = Format(Trim(Rec_Query!TotalDate & ""), "yyyy-mm-dd")    '计划到货日期
  999.             CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = IIf(Rec_Query!IfAdd = True, "追补", "正常")             '是否追补
  1000.             CxbbGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Trim(Rec_Query!TotalMan & "")                           '汇总人
  1001.             CxbbGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Trim(Rec_Query!Checker & "")                            '审核人
  1002.             If Rec_Query!IfSum = True Then
  1003.                 CxbbGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = True                                                '是否生成领料单
  1004.             Else
  1005.                  CxbbGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = False
  1006.             End If
  1007.             CxbbGrid.Cell(flexcpBackColor, jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(Fn_GetBillState(Rec_Query)).BackColor     '状态色
  1008.              
  1009.              '<<]
  1010.             '设置数据行高度(Fixed)
  1011.             CxbbGrid.RowHeight(jsqte) = Sjhgd
  1012.      
  1013.             '动态集指针加1,同时将计数器加1(Fixed)
  1014.             .MoveNext
  1015.             jsqte = jsqte + 1
  1016.         Loop
  1017.     End With
  1018.     ']以上为用户自定义部分
  1019. End Sub
  1020. Private Sub CxbbGrid_DblClick()                                              '用户双击网格调入相应单据
  1021.     
  1022.     Dim RecTemp As New ADODB.Recordset               '临时使用动态集
  1023.     '非数据行退出
  1024.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1025.         Exit Sub
  1026.     End If
  1027.     
  1028.     Sqlstr = "Select TotalDemandID From MRP_TotalDemand Where TotalDemandID='" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) & "' "
  1029.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1030.     With RecTemp
  1031.         If .EOF Then
  1032.             Tsxx = "此计划可能已被其他用户删除!"
  1033.             Call Xtxxts(Tsxx, 0, 4)
  1034.             Exit Sub
  1035.         Else
  1036.             '调入单据处理窗体
  1037.             With MRP_TotalDemand
  1038.                 
  1039.                 '填充查询单据标识
  1040.                 XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
  1041.                 Xtcdcsfz = Str_QueryCondi
  1042.                 
  1043.                 '设置单据处理为列表查询(修改)状态
  1044.                 Xtcdcs = "2"
  1045.                 .Show 1
  1046.             End With
  1047.             If Xtfhcs = "1" Then
  1048.                 Tsxx = "计划发生变化,是否刷新计划列表?"
  1049.                 yhAnswer = Xtxxts(Tsxx, 2, 2)
  1050.                 If yhAnswer = 1 Then
  1051.                     Xt_Wait.Show
  1052.                     Xt_Wait.Refresh
  1053.    
  1054.                     '加快显示速度
  1055.                     CxbbGrid.Redraw = False
  1056.  
  1057.                     '生成查询结果
  1058.                     Call Sub_Query(1)
  1059.    
  1060.                     CxbbGrid.Redraw = True
  1061.                     Xt_Wait.Hide
  1062.                 End If
  1063.             End If
  1064.         End If
  1065.     End With
  1066. End Sub
  1067. Private Sub Sub_AddBill()                                              '新增单据
  1068.    
  1069.     With MRP_DependentDemand
  1070.    
  1071.         '设置单据处理为填制单据状态
  1072.         Xtcdcs = "1"
  1073.         .Show 1
  1074.     End With
  1075.        
  1076.     If Xtfhcs = "1" Then
  1077.         Tsxx = "计划发生变化,是否刷新计划列表?"
  1078.         yhAnswer = Xtxxts(Tsxx, 2, 2)
  1079.         If yhAnswer = 1 Then
  1080.             Xt_Wait.Show
  1081.             Xt_Wait.Refresh
  1082.    
  1083.             '加快显示速度
  1084.             CxbbGrid.Redraw = False
  1085.  
  1086.             '生成查询结果
  1087.             Call Sub_Query(1)
  1088.    
  1089.             CxbbGrid.Redraw = True
  1090.             Xt_Wait.Hide
  1091.         End If
  1092.     End If
  1093.    
  1094. End Sub
  1095. Private Sub Sub_DeleteBill()                                            '删除选中当前单据
  1096.     
  1097.     Dim YAnswer As Integer
  1098.     Dim Lng_BillID As Long           '单据标识
  1099.     Dim sPlanMainID As String, kjyear As Integer, Period As Integer, RecTemp As New ADODB.Recordset
  1100.     
  1101.     
  1102.     '非数据行退出
  1103.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1104.         Exit Sub
  1105.     End If
  1106.  
  1107.     
  1108.     
  1109.     Tsxx = "请确认是否删除当前周期物料?"
  1110.     YAnswer = Xtxxts(Tsxx, 2, 2)
  1111.    
  1112.     If YAnswer = 1 Then
  1113.    
  1114.  
  1115.         '2.删除单据所有内容
  1116.         Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1117.         Sqlstr = "Select * From MRP_TotalDemand Where TotalDemandID ='" & Trim(Lng_BillID) & "' "
  1118.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1119.         If RecTemp.EOF Then
  1120.             Tsxx = "没有找到当前单据,可能已被其他用户删除!"
  1121.             Call Xtxxts(Tsxx, 0, 1)
  1122.             Exit Sub
  1123.         End If
  1124.         kjyear = RecTemp!kjyear
  1125.         Period = RecTemp!Period
  1126.         Sqlstr = "Select Count(*) From MRP_TotalDemand Where ( Checker<>'' Or IFAbandon=1)  And kjYear='" & Trim(RecTemp!kjyear & "") & "' And Period='" & Trim(RecTemp!Period & "") & "'"
  1127.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1128.         If RecTemp.Fields(0) > 0 Then
  1129.             Tsxx = "当前周期发现已经审核/废弃物料,物料不能删除!"
  1130.             Call Xtxxts(Tsxx, 0, 1)
  1131.             Exit Sub
  1132.         End If
  1133.         
  1134.         Sqlstr = " Select Max(Convert(Char(1),IfSum)) From  MRP_TotalDemand Where kjYear='" & kjyear & "' And  Period ='" & Period & "' "
  1135.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1136.         If RecTemp.Fields(0) > 0 Then
  1137.             Tsxx = "当前周期物料已经生成领料申请计划,汇总物料不能删除!"
  1138.             Call Xtxxts(Tsxx, 0, 1)
  1139.             Exit Sub
  1140.         End If
  1141.         
  1142.         Sqlstr = "Select Max(Convert(Char(1),d.IfComplete)) From Mrp_V_totaldemand_C  m Left Join  MRP_DependentDemandMain d On m.DemandMainID  =d.DepDemandMainID      Where  DemandSource=0 And m.kjYear='" & kjyear & "' And m.Period='" & Period & "' "
  1143.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1144.         If RecTemp.Fields(0) > 0 Then
  1145.             Tsxx = "当前周期相关需求已经完成, 汇总物料不能删除!"
  1146.             Call Xtxxts(Tsxx, 0, 1)
  1147.             Exit Sub
  1148.         End If
  1149.         Sqlstr = "Select Max(Convert(Char(1),d.IfComplete)) From Mrp_V_totaldemand_C  m Left Join  MRP_IndependentDemandMain d On m.DemandMainID  =d.IndDemandMainID      Where  DemandSource=1 And m.kjYear='" & kjyear & "' And  m.Period='" & Period & "' "
  1150.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1151.         If RecTemp.Fields(0) > 0 Then
  1152.             Tsxx = "当前周期独立需求已经完成, 汇总物料不能删除!"
  1153.             Call Xtxxts(Tsxx, 0, 1)
  1154.             Exit Sub
  1155.         End If
  1156.         
  1157.         '进行事务处理
  1158.         On Error GoTo Swcwcl
  1159.         Cw_DataEnvi.DataConnect.BeginTrans
  1160.    
  1161.         Sqlstr = "Execute MRP_Sp_DeleteTotalCyc " + Str(kjyear) + "  ,  " + Str(Period)
  1162.         Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  1163.         Cw_DataEnvi.DataConnect.CommitTrans
  1164.         
  1165.         '删除网格中单据数据
  1166.         CxbbGrid.Clear 1
  1167.         CxbbGrid.Rows = CxbbGrid.FixedRows
  1168.         Exit Sub
  1169.     Else
  1170.         Exit Sub
  1171.     End If
  1172. Swcwcl:
  1173.     Cw_DataEnvi.DataConnect.RollbackTrans
  1174.     Tsxx = "删除计划过程中出现未知错误,程序自动恢复删除前状态!"
  1175.     Call Xtxxts(Tsxx, 0, 1)
  1176.     Exit Sub
  1177.   
  1178. End Sub
  1179.  
  1180. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1181.     
  1182.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1183.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1184.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1185.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1186.     ReDim Bbxbt(1 To Bbxbtgs)
  1187.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1188.     If Bbbwhgs <> 0 Then
  1189.         ReDim Bbbwh(1 To Bbbwhgs)
  1190.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1191.     End If
  1192.     Bbzbt = ReportTitle
  1193.     Bbxbt(1) = Space(10) + Fun_FormatOutPut("计划周期:   " + Trim(Me.Lab_Content(0)), 30)
  1194.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1195.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1196.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1197.     If Not bbylte Then
  1198.         Unload DY_Tybbyldy
  1199.     End If
  1200. End Sub
  1201. Private Sub Sub_Checkbill()
  1202.     
  1203.     Dim RecTemp As New ADODB.Recordset               '临时使用动态集
  1204.     '非数据行退出
  1205.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1206.         Exit Sub
  1207.     End If
  1208.     
  1209.     Sqlstr = "Select TotalDemandID From MRP_TotalDemand Where TotalDemandID='" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) & "' "
  1210.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1211.     With RecTemp
  1212.         If .EOF Then
  1213.             Tsxx = "此计划已被其他用户删除!"
  1214.             Call Xtxxts(Tsxx, 0, 4)
  1215.             Exit Sub
  1216.         Else
  1217.             '调入单据处理窗体
  1218.             With MRP_TotalDemand
  1219.                 '填充查询单据标识
  1220.                 XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
  1221.                 Xtcdcsfz = Str_QueryCondi
  1222.                 
  1223.                 '设置单据处理为列表查询(修改)状态
  1224.                 Xtcdcs = "3"
  1225.                 .Show 1
  1226.             End With
  1227.             If Xtfhcs = "1" Then
  1228.                 Tsxx = "计划发生变化,是否刷新列表?"
  1229.                 yhAnswer = Xtxxts(Tsxx, 2, 2)
  1230.                 If yhAnswer = 1 Then
  1231.                     Xt_Wait.Show
  1232.                     Xt_Wait.Refresh
  1233.    
  1234.                     '加快显示速度
  1235.                     CxbbGrid.Redraw = False
  1236.  
  1237.                     '生成查询结果
  1238.                     Call Sub_Query(1)
  1239.    
  1240.                     CxbbGrid.Redraw = True
  1241.                     Xt_Wait.Hide
  1242.                 End If
  1243.             End If
  1244.         End If
  1245.     End With
  1246. End Sub
  1247. Private Sub Sub_DivMonth(InPara As String, Out1 As Integer, Out2 As Integer)
  1248.     Dim Pos1 As Integer
  1249.     Pos1 = InStr(1, InPara, ".")
  1250.     Out1 = Val(Left(InPara, Pos1 - 1))
  1251.     Out2 = Right(InPara, Len(InPara) - Pos1)
  1252. End Sub
  1253. 'Return Bill State
  1254. Private Function Fn_GetBillState(Rect As Recordset) As Integer
  1255.     Dim State As Integer
  1256.     
  1257.     State = 0
  1258.     If Not Rect.EOF Then
  1259.         For jsqte = 1 To 3
  1260.             Select Case jsqte
  1261.                 Case 1
  1262.                     If Rect!Checker <> "" Then
  1263.                         State = 1
  1264.                     Else
  1265.                         Exit For
  1266.                     End If
  1267.                 Case 2
  1268.                     If Rect!IfTransack = True Then
  1269.                         State = 2
  1270.                     Else
  1271.                         Exit For
  1272.                     End If
  1273.                     
  1274.                 Case 3
  1275.                     If Rect!IfComplete = True Then
  1276.                         State = 3
  1277.                     Else
  1278.                         Exit For
  1279.                     End If
  1280.                 
  1281.             End Select
  1282.         Next jsqte
  1283.     End If
  1284.     If Rect!IfAbandon = True Then
  1285.         Fn_GetBillState = 4
  1286.     Else
  1287.         Fn_GetBillState = State
  1288.     End If
  1289. End Function
  1290.