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

企业管理

开发平台:

Visual Basic

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