+
上传用户: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_DependentDemandList 
  5.    Caption         =   "相关需求列表"
  6.    ClientHeight    =   6945
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   10755
  10.    Icon            =   "物料需求计划_相关需求列表.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   6945
  14.    ScaleWidth      =   10755
  15.    Begin VB.Timer Timer1 
  16.       Enabled         =   0   'False
  17.       Interval        =   1
  18.       Left            =   2880
  19.       Top             =   3240
  20.    End
  21.    Begin VB.PictureBox Pic_Title 
  22.       BackColor       =   &H00FFFFFF&
  23.       Height          =   825
  24.       Left            =   30
  25.       Picture         =   "物料需求计划_相关需求列表.frx":1042
  26.       ScaleHeight     =   765
  27.       ScaleWidth      =   11715
  28.       TabIndex        =   0
  29.       Top             =   570
  30.       Width           =   11775
  31.       Begin VB.Label Lab_Color 
  32.          Appearance      =   0  'Flat
  33.          BackColor       =   &H00C0FFC0&
  34.          BorderStyle     =   1  'Fixed Single
  35.          ForeColor       =   &H80000008&
  36.          Height          =   195
  37.          Index           =   3
  38.          Left            =   9480
  39.          TabIndex        =   12
  40.          Top             =   450
  41.          Width           =   195
  42.       End
  43.       Begin VB.Label Label1 
  44.          Appearance      =   0  'Flat
  45.          BackColor       =   &H80000005&
  46.          BackStyle       =   0  'Transparent
  47.          Caption         =   "完成"
  48.          ForeColor       =   &H80000008&
  49.          Height          =   195
  50.          Index           =   2
  51.          Left            =   9720
  52.          TabIndex        =   11
  53.          Top             =   450
  54.          Width           =   795
  55.       End
  56.       Begin VB.Label Lab_Color 
  57.          Appearance      =   0  'Flat
  58.          BackColor       =   &H00FFFFFF&
  59.          BorderStyle     =   1  'Fixed Single
  60.          ForeColor       =   &H80000008&
  61.          Height          =   195
  62.          Index           =   0
  63.          Left            =   8280
  64.          TabIndex        =   10
  65.          Top             =   120
  66.          Width           =   195
  67.       End
  68.       Begin VB.Label Label1 
  69.          Appearance      =   0  'Flat
  70.          BackColor       =   &H80000005&
  71.          BackStyle       =   0  'Transparent
  72.          Caption         =   "未审核"
  73.          ForeColor       =   &H80000008&
  74.          Height          =   195
  75.          Index           =   1
  76.          Left            =   8520
  77.          TabIndex        =   9
  78.          Top             =   120
  79.          Width           =   795
  80.       End
  81.       Begin VB.Label Lab_Color 
  82.          Appearance      =   0  'Flat
  83.          BackColor       =   &H00C0E0FF&
  84.          BorderStyle     =   1  'Fixed Single
  85.          ForeColor       =   &H80000008&
  86.          Height          =   195
  87.          Index           =   1
  88.          Left            =   8280
  89.          TabIndex        =   8
  90.          Top             =   450
  91.          Width           =   195
  92.       End
  93.       Begin VB.Label Label1 
  94.          Appearance      =   0  'Flat
  95.          BackColor       =   &H80000005&
  96.          BackStyle       =   0  'Transparent
  97.          Caption         =   "审  核"
  98.          ForeColor       =   &H80000008&
  99.          Height          =   195
  100.          Index           =   3
  101.          Left            =   8520
  102.          TabIndex        =   7
  103.          Top             =   450
  104.          Width           =   795
  105.       End
  106.       Begin VB.Label Lab_Color 
  107.          Appearance      =   0  'Flat
  108.          BackColor       =   &H80000018&
  109.          BorderStyle     =   1  'Fixed Single
  110.          ForeColor       =   &H80000008&
  111.          Height          =   195
  112.          Index           =   2
  113.          Left            =   9480
  114.          TabIndex        =   6
  115.          Top             =   120
  116.          Width           =   195
  117.       End
  118.       Begin VB.Label Label1 
  119.          Appearance      =   0  'Flat
  120.          BackColor       =   &H80000005&
  121.          BackStyle       =   0  'Transparent
  122.          Caption         =   "汇总"
  123.          ForeColor       =   &H80000008&
  124.          Height          =   195
  125.          Index           =   0
  126.          Left            =   9720
  127.          TabIndex        =   5
  128.          Top             =   120
  129.          Width           =   795
  130.       End
  131.       Begin VB.Label Lab_Title 
  132.          BackColor       =   &H80000018&
  133.          BackStyle       =   0  'Transparent
  134.          Caption         =   "相关需求列表"
  135.          BeginProperty Font 
  136.             Name            =   "宋体"
  137.             Size            =   12
  138.             Charset         =   134
  139.             Weight          =   700
  140.             Underline       =   0   'False
  141.             Italic          =   0   'False
  142.             Strikethrough   =   0   'False
  143.          EndProperty
  144.          ForeColor       =   &H00000000&
  145.          Height          =   300
  146.          Index           =   10
  147.          Left            =   480
  148.          TabIndex        =   1
  149.          Top             =   240
  150.          Width           =   2595
  151.       End
  152.    End
  153.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  154.       Height          =   7545
  155.       Left            =   0
  156.       TabIndex        =   2
  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          =   555
  413.       Left            =   0
  414.       TabIndex        =   3
  415.       Top             =   0
  416.       Width           =   10755
  417.       _ExtentX        =   18971
  418.       _ExtentY        =   979
  419.       ButtonWidth     =   820
  420.       ButtonHeight    =   926
  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.             Enabled         =   0   'False
  456.             Object.Visible         =   0   'False
  457.             Caption         =   "新增"
  458.             Key             =   "xz"
  459.             ImageKey        =   "xz"
  460.          EndProperty
  461.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  462.             Caption         =   "单据"
  463.             Key             =   "Bill"
  464.             ImageKey        =   "pz"
  465.          EndProperty
  466.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  467.             Caption         =   "删除"
  468.             Key             =   "sc"
  469.             ImageKey        =   "sc"
  470.          EndProperty
  471.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  472.             Style           =   3
  473.          EndProperty
  474.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  475.             Caption         =   "审核"
  476.             Key             =   "shhe"
  477.             ImageKey        =   "check"
  478.          EndProperty
  479.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  480.             Style           =   3
  481.          EndProperty
  482.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  483.             Caption         =   "帮助"
  484.             Key             =   "bz"
  485.             ImageKey        =   "bz"
  486.          EndProperty
  487.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  488.             Caption         =   "退出"
  489.             Key             =   "fh"
  490.             ImageKey        =   "tc"
  491.          EndProperty
  492.       EndProperty
  493.       BorderStyle     =   1
  494.       Begin MSComctlLib.Toolbar GsToolbar 
  495.          Height          =   525
  496.          Left            =   8280
  497.          TabIndex        =   4
  498.          Top             =   0
  499.          Width           =   2475
  500.          _ExtentX        =   4366
  501.          _ExtentY        =   926
  502.          ButtonWidth     =   1455
  503.          ButtonHeight    =   926
  504.          AllowCustomize  =   0   'False
  505.          Appearance      =   1
  506.          Style           =   1
  507.          ImageList       =   "ImageList1"
  508.          _Version        =   393216
  509.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  510.             NumButtons      =   3
  511.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  512.                Caption         =   "保存格式"
  513.                Key             =   "bcgs"
  514.                ImageKey        =   "bcgs"
  515.             EndProperty
  516.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  517.                Caption         =   "默认列宽"
  518.                Key             =   "hfmrgs"
  519.                ImageKey        =   "mrlk"
  520.             EndProperty
  521.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  522.                Caption         =   "显示项目"
  523.                Key             =   "szxsxm"
  524.                ImageKey        =   "xsxm"
  525.             EndProperty
  526.          EndProperty
  527.       End
  528.       Begin MSComctlLib.ImageList ImageList1 
  529.          Left            =   6990
  530.          Top             =   30
  531.          _ExtentX        =   1005
  532.          _ExtentY        =   1005
  533.          BackColor       =   -2147483643
  534.          ImageWidth      =   16
  535.          ImageHeight     =   16
  536.          MaskColor       =   12632256
  537.          _Version        =   393216
  538.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  539.             NumListImages   =   32
  540.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  541.                Picture         =   "物料需求计划_相关需求列表.frx":26F92
  542.                Key             =   "sz"
  543.             EndProperty
  544.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  545.                Picture         =   "物料需求计划_相关需求列表.frx":2732C
  546.                Key             =   "dy"
  547.             EndProperty
  548.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  549.                Picture         =   "物料需求计划_相关需求列表.frx":276C6
  550.                Key             =   "yl"
  551.             EndProperty
  552.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  553.                Picture         =   "物料需求计划_相关需求列表.frx":27A60
  554.                Key             =   "xg"
  555.             EndProperty
  556.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  557.                Picture         =   "物料需求计划_相关需求列表.frx":27DFA
  558.                Key             =   "zh"
  559.             EndProperty
  560.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  561.                Picture         =   "物料需求计划_相关需求列表.frx":28194
  562.                Key             =   "sh"
  563.             EndProperty
  564.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  565.                Picture         =   "物料需求计划_相关需求列表.frx":2852E
  566.                Key             =   "bc"
  567.             EndProperty
  568.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  569.                Picture         =   "物料需求计划_相关需求列表.frx":288C8
  570.                Key             =   "fq"
  571.             EndProperty
  572.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  573.                Picture         =   "物料需求计划_相关需求列表.frx":28C62
  574.                Key             =   "bz"
  575.             EndProperty
  576.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  577.                Picture         =   "物料需求计划_相关需求列表.frx":28FFC
  578.                Key             =   "tc"
  579.             EndProperty
  580.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  581.                Picture         =   "物料需求计划_相关需求列表.frx":29396
  582.                Key             =   "bcgs"
  583.             EndProperty
  584.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  585.                Picture         =   "物料需求计划_相关需求列表.frx":29730
  586.                Key             =   "mrlk"
  587.             EndProperty
  588.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  589.                Picture         =   "物料需求计划_相关需求列表.frx":29ACA
  590.                Key             =   "xsxm"
  591.             EndProperty
  592.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  593.                Picture         =   "物料需求计划_相关需求列表.frx":29E64
  594.                Key             =   "first"
  595.             EndProperty
  596.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  597.                Picture         =   "物料需求计划_相关需求列表.frx":2A1FE
  598.                Key             =   "prev"
  599.             EndProperty
  600.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  601.                Picture         =   "物料需求计划_相关需求列表.frx":2A598
  602.                Key             =   "next"
  603.             EndProperty
  604.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  605.                Picture         =   "物料需求计划_相关需求列表.frx":2A932
  606.                Key             =   "last"
  607.             EndProperty
  608.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  609.                Picture         =   "物料需求计划_相关需求列表.frx":2ACCC
  610.                Key             =   "xx"
  611.             EndProperty
  612.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  613.                Picture         =   "物料需求计划_相关需求列表.frx":2B066
  614.                Key             =   "define"
  615.             EndProperty
  616.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  617.                Picture         =   "物料需求计划_相关需求列表.frx":2B400
  618.                Key             =   "exec"
  619.             EndProperty
  620.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  621.                Picture         =   "物料需求计划_相关需求列表.frx":2B79A
  622.                Key             =   "xz"
  623.             EndProperty
  624.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  625.                Picture         =   "物料需求计划_相关需求列表.frx":2BB34
  626.                Key             =   "sc"
  627.             EndProperty
  628.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  629.                Picture         =   "物料需求计划_相关需求列表.frx":2BECE
  630.                Key             =   "sx"
  631.             EndProperty
  632.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  633.                Picture         =   "物料需求计划_相关需求列表.frx":2C268
  634.                Key             =   "cx"
  635.             EndProperty
  636.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  637.                Picture         =   "物料需求计划_相关需求列表.frx":2C602
  638.                Key             =   "zd"
  639.             EndProperty
  640.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  641.                Picture         =   "物料需求计划_相关需求列表.frx":2C99C
  642.                Key             =   "dz"
  643.             EndProperty
  644.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  645.                Picture         =   "物料需求计划_相关需求列表.frx":2CD36
  646.                Key             =   "ph"
  647.             EndProperty
  648.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  649.                Picture         =   "物料需求计划_相关需求列表.frx":2D0D0
  650.                Key             =   "fz"
  651.             EndProperty
  652.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  653.                Picture         =   "物料需求计划_相关需求列表.frx":2D46A
  654.                Key             =   "dw"
  655.             EndProperty
  656.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  657.                Picture         =   "物料需求计划_相关需求列表.frx":2D804
  658.                Key             =   "hf"
  659.             EndProperty
  660.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  661.                Picture         =   "物料需求计划_相关需求列表.frx":2DB9E
  662.                Key             =   "pz"
  663.             EndProperty
  664.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  665.                Picture         =   "物料需求计划_相关需求列表.frx":2DF38
  666.                Key             =   "check"
  667.             EndProperty
  668.          EndProperty
  669.       End
  670.    End
  671. End
  672. Attribute VB_Name = "MRP_DependentDemandList"
  673. Attribute VB_GlobalNameSpace = False
  674. Attribute VB_Creatable = False
  675. Attribute VB_PredeclaredId = True
  676. Attribute VB_Exposed = False
  677. '******************************************************************
  678. '*    模 块 名 称 :物料需求--相关物料需求列表
  679. '*    功 能 描 述 :相关物料需求列表
  680. '*    程序员姓名  :乔进
  681. '*    最后修改人  :乔进
  682. '*    最后修改时间:2001/12/03
  683. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  684. '******************************************************************
  685. Dim ReportTitle As String                '报表主标题
  686. Dim Str_QueryCondi As String             '用户录入查询条件
  687. Dim Rec_BillID As New ADODB.Recordset    '用户查询单据ID动态集
  688. '以下为固定使用变量
  689. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  690. Dim GridCode As String                   '显示网格网格代码
  691. Dim GridInf() As Variant                 '整个网格设置信息
  692. Dim Tsxx As String                       '系统提示信息
  693. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  694. Dim Sjhgd As Double                      '网格数据行高度
  695. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  696. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  697. Dim GridStr()  As String                 '网格列信息(字符型)
  698. Dim GridInt() As Integer                 '网格列信息(整型)
  699. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  700. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  701.     On Error Resume Next
  702.     With CxbbGrid
  703.         .Width = Me.Width - 160
  704.         .Height = Me.Height - .Top - 400
  705.     End With
  706.     With Pic_Title
  707.         .Width = Me.Width - 160
  708.     End With
  709.     
  710.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  711. End Sub
  712. Private Sub Form_Load()                                                   '窗体装入
  713.   
  714.     '调入打印页面设置窗体
  715.     ReportTitle = "相关需求列表"
  716.     XtReportCode = "MRP_DepDemandList"
  717.     Load Dyymctbl
  718.       
  719.     '调整标题栏及网格、格式工具条位置(Fixed)
  720.     Pic_Title.Left = 40
  721.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  722.     CxbbGrid.Left = Pic_Title.Left
  723.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  724.      
  725.     '调 入 网 格(Fixed)
  726.     GridCode = "MRP_DepDemandList"
  727.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  728.       
  729.     Qslz = GridInf(1)
  730.     Sjhgd = GridInf(2)
  731.     Sfxshjwg = GridInf(7)
  732.     Szzls = CxbbGrid.Cols - 1
  733.     MRP_DependentDemandList.HelpContextID = 241400102
  734. End Sub
  735. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  736.     '卸载条件窗体
  737.     MRP_DependentDemandQuery.UnloadCheck.Value = 1
  738.     Unload MRP_DependentDemandQuery
  739.     
  740.     '卸载打印页面设置窗体
  741.     Unload Dyymctbl
  742.     Security_Log "MRP_DependentDemandList", Xtczybm, 2, False   '用户退出时写上机日志
  743. End Sub
  744. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  745.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  746. End Sub
  747. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  748.   
  749.     Select Case Button.Key
  750.         Case "bcgs"                                          '保存表格格式
  751.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  752.         Case "hfmrgs"                                        '恢复默认格式
  753.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  754.         Case "szxsxm"                                        '设置显示项目
  755.             Call Szxsxm(CxbbGrid, GridCode)
  756.     End Select
  757. End Sub
  758. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  759.     
  760.     Select Case Button.Key
  761.         Case "ymsz"                                          '页面设置
  762.             Dyymctbl.Show 1
  763.         Case "yl"                                            '预 览
  764.             Call bbyl(True)
  765.         Case "dy"                                            '打 印
  766.             Call bbyl(False)
  767.         Case "cx"                                            '查 询
  768.             MRP_DependentDemandQuery.Show 1
  769.         Case "Bill"                                          '单 据
  770.             If Not Security_Log("MRP_DependentDemandList_Edit", Xtczybm, 1) Then
  771.                 Exit Sub
  772.             End If
  773.             Call CxbbGrid_DblClick
  774.         Case "xz"                                            '新 增
  775.             If Not Security_Log("MRP_DependentDemandList_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_DependentDemandList_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_DependentDemandList_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
  819.     
  820.     
  821.     '以下为自定义部分[
  822.  
  823.     If Int_QueryType = 0 Then   '0-"点确定按钮"查询
  824.         With MRP_DependentDemandQuery
  825.          
  826.             '生成查询条件
  827.             Str_QueryCondi = " where 1=1 "
  828.             For jsqte = 1 To 8
  829.                 Select Case jsqte
  830.                     Case 1  '起始周期
  831.                         If Trim(.Combo_PlanCyc(0)) <> "" Then
  832.                             Call Sub_DivMonth(Trim(.Combo_PlanCyc(0).Text), iYear, iMonth)
  833.                             Str_QueryCondi = Str_QueryCondi & " And kjYear=" & iYear & " And period=" & iMonth
  834.                         End If
  835.                     Case 3  '生产部门
  836.                         If Trim(.LrText(0).Text) <> "" Then
  837.                             Str_QueryCondi = Str_QueryCondi & " And a.DeptCode = '" & Trim(.LrText(0).Tag) & "'"
  838.                         End If
  839.                     Case 4   '物料编码
  840.                         If Trim(.LrText(1).Text) <> "" Then
  841.                             Str_QueryCondi = Str_QueryCondi & " And a.MNumber_C = '" & Trim(.LrText(1).Text) & "'"
  842.                         End If
  843.                     Case 5   '审核
  844.                         If Not .Opt_Check(0).Value Then
  845.                             If .Opt_Check(1).Value Then
  846.                                 Str_QueryCondi = Str_QueryCondi & " and  a.Checker='' "
  847.                             Else
  848.                                 Str_QueryCondi = Str_QueryCondi & " and  a.Checker<>'' "
  849.                             End If
  850.                         End If
  851.                     Case 6   '生成
  852.                         If Not .Opt_Create(0).Value Then
  853.                             If .Opt_Create(1).Value Then
  854.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfTotal=0 "
  855.                             Else
  856.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfTotal=1 "
  857.                             End If
  858.                         End If
  859.                     Case 7   '完成
  860.                         If Not .Opt_Finish(0).Value Then
  861.                             If .Opt_Finish(1).Value Then
  862.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfComplete=0 "
  863.                             Else
  864.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfComplete=1  "
  865.                             End If
  866.                         End If
  867.                     Case 8   '状态
  868.                         If Not .Opt_State(0).Value Then
  869.                             If .Opt_State(1).Value Then
  870.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfAdd=0 "
  871.                             Else
  872.                                 Str_QueryCondi = Str_QueryCondi & " and  a.IfAdd=1 "
  873.                             End If
  874.                         End If
  875.                 End Select
  876.             Next jsqte
  877.         End With
  878.     Else
  879.         '1-"刷新"查询
  880.         If Str_QueryCondi = "" Then
  881.             Str_QueryCondi = " where 1=1 "
  882.         End If
  883.     End If
  884.     
  885.     Sqlstr = "Select * From MRP_V_DepDemandList a " & Str_QueryCondi & ""
  886.     Sqlstr = Sqlstr + "  Order by DepDemandMainID"
  887.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  888.     With Rec_Query
  889.         CxbbGrid.Rows = CxbbGrid.FixedRows
  890.         jsqte = CxbbGrid.FixedRows
  891.         Do While Not .EOF
  892.             CxbbGrid.AddItem ""
  893.             '[>>自定义填充内容
  894.             CxbbGrid.TextMatrix(jsqte, 0) = .Fields("DepDemandMainID")                                                                      '订单ID(主要用来查询定位用)
  895.             CxbbGrid.TextMatrix(jsqte, Sydz("017", GridStr(), Szzls)) = .Fields("PlanMainID")                                               '主生产计划单编码
  896.             CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("kjYear") & "") + "." + Trim(.Fields("Period") & "")   '计划周期
  897.             CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "")                                      '计划周期
  898.             CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("MNumber") & "")                                       '产品编码
  899.             CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("MName") & "")                                         '产品名称
  900.             CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                                         '规格型号
  901.             CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName") & "")                               '单位
  902.             CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("MNumber_C") & "")                                     '物料编码
  903.             CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("MName_C") & "")                                       '物料名称
  904.             CxbbGrid.TextMatrix(jsqte, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("Model_C") & "")                                       '规格型号
  905.             CxbbGrid.TextMatrix(jsqte, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName_C") & "")                             '单位
  906.             CxbbGrid.TextMatrix(jsqte, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("DemandNumber") & "")                                  '需求数量
  907.             CxbbGrid.TextMatrix(jsqte, Sydz("012", GridStr(), Szzls)) = Format(Trim(.Fields("DemandDate")), "yyyy-mm-dd")                   '需求日期
  908.             CxbbGrid.TextMatrix(jsqte, Sydz("013", GridStr(), Szzls)) = IIf(.Fields("IfAdd"), "追补", "正常")                               '是否追补
  909.             CxbbGrid.TextMatrix(jsqte, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("Maker") & "")                                         '制单
  910.             CxbbGrid.TextMatrix(jsqte, Sydz("015", GridStr(), Szzls)) = Format(Trim(.Fields("MakeDate")), "yyyy-mm-dd")                     '制单日期
  911.             CxbbGrid.TextMatrix(jsqte, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("Checker") & "")                                       '审核
  912.             CxbbGrid.Cell(flexcpBackColor, jsqte, 0, , CxbbGrid.Cols - 1) = Lab_Color(Fn_GetBillState(Rec_Query)).BackColor                 '计划状态颜色控制
  913.              
  914.              '<<]
  915.             '设置数据行高度(Fixed)
  916.             CxbbGrid.RowHeight(jsqte) = Sjhgd
  917.      
  918.             '动态集指针加1,同时将计数器加1(Fixed)
  919.             .MoveNext
  920.             jsqte = jsqte + 1
  921.         Loop
  922.     End With
  923.     ']以上为用户自定义部分
  924. End Sub
  925. Private Sub CxbbGrid_DblClick()                                              '用户双击网格调入相应单据
  926.     
  927.     Dim RecTemp As New ADODB.Recordset               '临时使用动态集
  928.     '非数据行退出
  929.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  930.         Exit Sub
  931.     End If
  932.     
  933.     Sqlstr = "Select DepDemandMainID From MRP_DependentDemandMain Where DepDemandMainID='" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) & "' "
  934.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  935.     With RecTemp
  936.         If .EOF Then
  937.             Tsxx = "此计划可能已被其他用户删除!"
  938.             Call Xtxxts(Tsxx, 0, 4)
  939.             Exit Sub
  940.         Else
  941.             '调入单据处理窗体
  942.             With MRP_DependentDemand
  943.                 
  944.                 '填充查询单据标识
  945.                 XT_BillID = CxbbGrid.TextMatrix(CxbbGrid.Row, 0)
  946.                 Xtcdcsfz = Str_QueryCondi
  947.                 
  948.                 '设置单据处理为列表查询(修改)状态
  949.                 Xtcdcs = "2"
  950.                 .Show 1
  951.             End With
  952.             If Xtfhcs = "1" Then
  953.                 Tsxx = "计划发生变化,是否刷新计划列表?"
  954.                 yhAnswer = Xtxxts(Tsxx, 2, 2)
  955.                 If yhAnswer = 1 Then
  956.                     Xt_Wait.Show
  957.                     Xt_Wait.Refresh
  958.    
  959.                     '加快显示速度
  960.                     CxbbGrid.Redraw = False
  961.  
  962.                     '生成查询结果
  963.                     Call Sub_Query(1)
  964.    
  965.                     CxbbGrid.Redraw = True
  966.                     Xt_Wait.Hide
  967.                 End If
  968.             End If
  969.         End If
  970.     End With
  971. End Sub
  972. Private Sub Sub_AddBill()                                              '新增单据
  973.    
  974.     With MRP_DependentDemand
  975.    
  976.         '设置单据处理为填制单据状态
  977.         Xtcdcs = "1"
  978.         .Show 1
  979.     End With
  980.        
  981.     If Xtfhcs = "1" Then
  982.         Tsxx = "计划发生变化,是否刷新计划列表?"
  983.         yhAnswer = Xtxxts(Tsxx, 2, 2)
  984.         If yhAnswer = 1 Then
  985.             Xt_Wait.Show
  986.             Xt_Wait.Refresh
  987.    
  988.             '加快显示速度
  989.             CxbbGrid.Redraw = False
  990.  
  991.             '生成查询结果
  992.             Call Sub_Query(1)
  993.    
  994.             CxbbGrid.Redraw = True
  995.             Xt_Wait.Hide
  996.         End If
  997.     End If
  998.    
  999. End Sub
  1000. Private Sub Sub_DeleteBill()                                            '删除选中当前单据
  1001.     
  1002.     Dim YAnswer As Integer
  1003.     Dim Lng_BillID As Long           '单据标识
  1004.     Dim sPlanMainID
  1005.     '非数据行退出
  1006.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1007.         Exit Sub
  1008.     End If
  1009.  
  1010.     Tsxx = "请确认是否删除当前单据?"
  1011.     YAnswer = Xtxxts(Tsxx, 2, 2)
  1012.    
  1013.     If YAnswer = 1 Then
  1014.         
  1015.         '2.删除单据所有内容
  1016.         Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1017.         Sqlstr = "Select PlanmainID From MRP_DependentDemandMain Where DepDemandMainID ='" & Trim(Lng_BillID) & "' "
  1018.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1019.         If RecTemp.EOF Then
  1020.             Tsxx = "没有找到当前单据,可能已被其他用户删除!"
  1021.             Call Xtxxts(Tsxx, 0, 1)
  1022.             Exit Sub
  1023.         End If
  1024.         
  1025.         sPlanMainID = Trim(RecTemp!PlanMainID & "")
  1026.         Sqlstr = "Select Count(*) From MRP_DependentDemandMain where Checker<>'' And  PlanMainID='" & sPlanMainID & "' "
  1027.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1028.         
  1029.         If RecTemp.Fields(0) > 0 Then
  1030.             Tsxx = "主生产计划[" & sPlanMainID & "]生成的相关需求没有都处于未审核状态,不能删除当前相关需求!"
  1031.             Call Xtxxts(Tsxx, 0, 1)
  1032.             Exit Sub
  1033.         End If
  1034.         
  1035.         Sqlstr = "Select IfComplete From MRP_PlanMain Where MPSNumber ='" & Trim(sPlanMainID) & "'"
  1036.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1037.         If Not RecTemp.EOF Then
  1038.             If RecTemp!IfComplete = True Then
  1039.                 Tsxx = "主生产计划[" & sPlanMainID & "]已经完成,当前计划不能删除!"
  1040.                 Call Xtxxts(Tsxx, 0, 1)
  1041.                 Exit Sub
  1042.             End If
  1043.         End If
  1044.         
  1045.         '进行事务处理
  1046.         On Error GoTo Swcwcl
  1047.         Cw_DataEnvi.DataConnect.BeginTrans
  1048.    
  1049.         '1.删除单据所有内容
  1050.         Sqlstr = "Delete MRP_DependentDemandSub where DepdemandMainID In ( Select DepDemandMainID From MRP_DependentDemandMain Where PlanMainID='" & sPlanMainID & "'  ) "
  1051.         Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  1052.         Sqlstr = "Delete MRP_DependentDemandMain Where  PlanMainID='" & sPlanMainID & "' "
  1053.         Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  1054.         Sqlstr = "Update MRP_PlanMain Set IfBuildDemand=0 where MPSNumber='" & sPlanMainID & "'"
  1055.         Cw_DataEnvi.DataConnect.Execute (Sqlstr)
  1056.         
  1057.         Cw_DataEnvi.DataConnect.CommitTrans
  1058.         
  1059.         '删除网格中单据数据
  1060.         jsqte = CxbbGrid.Rows - 1
  1061.         Do While jsqte >= CxbbGrid.FixedRows
  1062.             If Trim(CxbbGrid.TextMatrix(jsqte, Sydz("017", GridStr(), Szzls))) = sPlanMainID Then
  1063.                 CxbbGrid.RemoveItem (CxbbGrid.Row)
  1064.                 jsqte = jsqte - 1
  1065.             Else
  1066.                 jsqte = jsqte - 1
  1067.             End If
  1068.         Loop
  1069.         Exit Sub
  1070.     Else
  1071.         Exit Sub
  1072.     End If
  1073. Swcwcl:
  1074.     Cw_DataEnvi.DataConnect.RollbackTrans
  1075.     Tsxx = "删除计划过程中出现未知错误,程序自动恢复删除前状态!"
  1076.     Call Xtxxts(Tsxx, 0, 1)
  1077.     Exit Sub
  1078.   
  1079. End Sub
  1080. Private Function Fun_AllowDelete() As Boolean                                        '判断当前单据是否允许删除
  1081.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  1082.     Dim Sqlstr As String                   '查询字符串
  1083.     Dim Lng_BillID As Long                 '单据ID
  1084.   
  1085.     Lng_BillID = Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0))
  1086.     Sqlstr = "Select Checker From MRP_DependentDemandMain Where DepDemandMainID=" & Lng_BillID
  1087.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1088.     With RecTemp
  1089.         If Not .EOF Then
  1090.             If Trim(.Fields("Checker") & "") <> "" Then
  1091.                 Tsxx = "当前计划已经审核,不能修改/删除!"
  1092.                 Call Xtxxts(Tsxx, 0, 4)
  1093.                 Exit Function
  1094.             End If
  1095.         Else
  1096.             Tsxx = "没有找到当前计划,可能已被删除!"
  1097.             Call Xtxxts(Tsxx, 0, 4)
  1098.             Exit Function
  1099.         End If
  1100.     End With
  1101.     Fun_AllowDelete = True
  1102. End Function
  1103.  
  1104. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1105.     
  1106.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1107.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1108.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1109.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1110.     ReDim Bbxbt(1 To Bbxbtgs)
  1111.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1112.     If Bbbwhgs <> 0 Then
  1113.         ReDim Bbbwh(1 To Bbbwhgs)
  1114.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1115.     End If
  1116.     Bbzbt = ReportTitle
  1117.     Bbxbt(1) = ""
  1118.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1119.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1120.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1121.     If Not bbylte Then
  1122.         Unload DY_Tybbyldy
  1123.     End If
  1124. End Sub
  1125. Private Sub Sub_Checkbill()
  1126.     
  1127.     Dim RecTemp As New ADODB.Recordset               '临时使用动态集
  1128.     '非数据行退出
  1129.     If CxbbGrid.Row < CxbbGrid.FixedRows Or Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) = 0 Then
  1130.         Exit Sub
  1131.     End If
  1132.     
  1133.     Sqlstr = "Select DepDemandMainID From MRP_DependentDemandMain Where DepDemandMainID='" & Val(CxbbGrid.TextMatrix(CxbbGrid.Row, 0)) & "' "
  1134.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1135.     With RecTemp
  1136.         If .EOF Then
  1137.             Tsxx = "此计划已被其他用户删除!"
  1138.             Call Xtxxts(Tsxx, 0, 4)
  1139.             Exit Sub
  1140.         Else
  1141.             '调入单据处理窗体
  1142.             With MRP_DependentDemand
  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. 'Return Bill State
  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
  1209.  '==========================================自定义程序完成===============================================