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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form MRP_TotalDemandQuery 
  4.    BackColor       =   &H8000000A&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "汇总需求列表查询条件"
  7.    ClientHeight    =   5760
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   4470
  11.    Icon            =   "物料需求计划_汇总需求查询条件.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5760
  17.    ScaleWidth      =   4470
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  '屏幕中心
  20.    Begin VB.CheckBox UnloadCheck 
  21.       Caption         =   "IfUnload"
  22.       Height          =   255
  23.       Left            =   -1080
  24.       TabIndex        =   16
  25.       Top             =   1920
  26.       Visible         =   0   'False
  27.       Width           =   1095
  28.    End
  29.    Begin VB.CommandButton QdCommand 
  30.       Caption         =   "确定(&O)"
  31.       Height          =   300
  32.       Left            =   2100
  33.       TabIndex        =   5
  34.       Top             =   5400
  35.       Width           =   1120
  36.    End
  37.    Begin VB.CommandButton QxCommand 
  38.       Caption         =   "取消(&C)"
  39.       Height          =   300
  40.       Left            =   3300
  41.       TabIndex        =   6
  42.       Top             =   5400
  43.       Width           =   1120
  44.    End
  45.    Begin VB.CommandButton Cmd_Clear 
  46.       Caption         =   "全清"
  47.       Height          =   300
  48.       Left            =   60
  49.       TabIndex        =   7
  50.       Top             =   5400
  51.       Width           =   1120
  52.    End
  53.    Begin TabDlg.SSTab SSTab1 
  54.       Height          =   5235
  55.       Left            =   60
  56.       TabIndex        =   20
  57.       TabStop         =   0   'False
  58.       Top             =   60
  59.       Width           =   4365
  60.       _ExtentX        =   7699
  61.       _ExtentY        =   9234
  62.       _Version        =   393216
  63.       Style           =   1
  64.       Tabs            =   2
  65.       TabsPerRow      =   2
  66.       TabHeight       =   520
  67.       TabCaption(0)   =   "基本条件"
  68.       TabPicture(0)   =   "物料需求计划_汇总需求查询条件.frx":1042
  69.       Tab(0).ControlEnabled=   -1  'True
  70.       Tab(0).Control(0)=   "Frame9"
  71.       Tab(0).Control(0).Enabled=   0   'False
  72.       Tab(0).ControlCount=   1
  73.       TabCaption(1)   =   "辅助条件"
  74.       TabPicture(1)   =   "物料需求计划_汇总需求查询条件.frx":105E
  75.       Tab(1).ControlEnabled=   0   'False
  76.       Tab(1).Control(0)=   "Frame10"
  77.       Tab(1).ControlCount=   1
  78.       Begin VB.Frame Frame9 
  79.          Height          =   4785
  80.          Left            =   60
  81.          TabIndex        =   28
  82.          Top             =   360
  83.          Width           =   4215
  84.          Begin VB.Frame Frame12 
  85.             Caption         =   "完成状态"
  86.             Height          =   525
  87.             Left            =   150
  88.             TabIndex        =   32
  89.             Top             =   3576
  90.             Width           =   3960
  91.             Begin VB.OptionButton Opt_Finish 
  92.                Caption         =   "已完成"
  93.                Height          =   195
  94.                Index           =   2
  95.                Left            =   2880
  96.                TabIndex        =   35
  97.                Top             =   240
  98.                Width           =   885
  99.             End
  100.             Begin VB.OptionButton Opt_Finish 
  101.                Caption         =   "未完成"
  102.                Height          =   195
  103.                Index           =   1
  104.                Left            =   1600
  105.                TabIndex        =   34
  106.                Top             =   240
  107.                Width           =   915
  108.             End
  109.             Begin VB.OptionButton Opt_Finish 
  110.                Caption         =   "全部"
  111.                Height          =   195
  112.                Index           =   0
  113.                Left            =   360
  114.                TabIndex        =   33
  115.                Top             =   210
  116.                Value           =   -1  'True
  117.                Width           =   855
  118.             End
  119.          End
  120.          Begin VB.Frame Frame13 
  121.             Caption         =   "生成状态"
  122.             Height          =   525
  123.             Left            =   150
  124.             TabIndex        =   36
  125.             Top             =   2984
  126.             Width           =   3960
  127.             Begin VB.OptionButton Opt_Create 
  128.                Caption         =   "已生成"
  129.                Height          =   195
  130.                Index           =   2
  131.                Left            =   2880
  132.                TabIndex        =   39
  133.                Top             =   240
  134.                Width           =   885
  135.             End
  136.             Begin VB.OptionButton Opt_Create 
  137.                Caption         =   "未生成"
  138.                Height          =   195
  139.                Index           =   1
  140.                Left            =   1600
  141.                TabIndex        =   38
  142.                Top             =   240
  143.                Width           =   915
  144.             End
  145.             Begin VB.OptionButton Opt_Create 
  146.                Caption         =   "全部"
  147.                Height          =   195
  148.                Index           =   0
  149.                Left            =   360
  150.                TabIndex        =   37
  151.                Top             =   240
  152.                Value           =   -1  'True
  153.                Width           =   855
  154.             End
  155.          End
  156.          Begin VB.Frame Frame15 
  157.             Caption         =   "废弃状态"
  158.             Height          =   525
  159.             Left            =   150
  160.             TabIndex        =   44
  161.             Top             =   4170
  162.             Width           =   3960
  163.             Begin VB.OptionButton Opt_Abandon 
  164.                Caption         =   "已废弃"
  165.                Height          =   195
  166.                Index           =   2
  167.                Left            =   2880
  168.                TabIndex        =   47
  169.                Top             =   210
  170.                Width           =   945
  171.             End
  172.             Begin VB.OptionButton Opt_Abandon 
  173.                Caption         =   "正常"
  174.                Height          =   195
  175.                Index           =   1
  176.                Left            =   1600
  177.                TabIndex        =   46
  178.                Top             =   225
  179.                Width           =   975
  180.             End
  181.             Begin VB.OptionButton Opt_Abandon 
  182.                Caption         =   "全部"
  183.                Height          =   195
  184.                Index           =   0
  185.                Left            =   360
  186.                TabIndex        =   45
  187.                Top             =   225
  188.                Value           =   -1  'True
  189.                Width           =   915
  190.             End
  191.          End
  192.          Begin VB.CommandButton Ydcommand1 
  193.             Height          =   300
  194.             Index           =   2
  195.             Left            =   3780
  196.             Picture         =   "物料需求计划_汇总需求查询条件.frx":107A
  197.             Style           =   1  'Graphical
  198.             TabIndex        =   55
  199.             TabStop         =   0   'False
  200.             Top             =   1020
  201.             Visible         =   0   'False
  202.             Width           =   300
  203.          End
  204.          Begin VB.TextBox LrText 
  205.             Height          =   300
  206.             Index           =   2
  207.             Left            =   975
  208.             TabIndex        =   3
  209.             Text            =   "2"
  210.             Top             =   1020
  211.             Width           =   2800
  212.          End
  213.          Begin VB.CommandButton Ydcommand1 
  214.             Height          =   300
  215.             Index           =   3
  216.             Left            =   3780
  217.             Picture         =   "物料需求计划_汇总需求查询条件.frx":1404
  218.             Style           =   1  'Graphical
  219.             TabIndex        =   29
  220.             TabStop         =   0   'False
  221.             Top             =   1380
  222.             Visible         =   0   'False
  223.             Width           =   300
  224.          End
  225.          Begin VB.Frame Frame16 
  226.             Caption         =   "计划类型"
  227.             Height          =   525
  228.             Left            =   150
  229.             TabIndex        =   48
  230.             Top             =   1800
  231.             Width           =   3960
  232.             Begin VB.OptionButton Opt_PlanType 
  233.                Caption         =   "全部"
  234.                Height          =   255
  235.                Index           =   0
  236.                Left            =   360
  237.                TabIndex        =   51
  238.                Top             =   210
  239.                Value           =   -1  'True
  240.                Width           =   675
  241.             End
  242.             Begin VB.OptionButton Opt_PlanType 
  243.                Caption         =   "正常"
  244.                Height          =   255
  245.                Index           =   1
  246.                Left            =   1600
  247.                TabIndex        =   50
  248.                Top             =   210
  249.                Width           =   675
  250.             End
  251.             Begin VB.OptionButton Opt_PlanType 
  252.                Caption         =   "追补"
  253.                Height          =   255
  254.                Index           =   2
  255.                Left            =   2880
  256.                TabIndex        =   49
  257.                Top             =   210
  258.                Width           =   795
  259.             End
  260.          End
  261.          Begin VB.Frame Frame14 
  262.             Caption         =   "审核状态"
  263.             Height          =   525
  264.             Left            =   150
  265.             TabIndex        =   40
  266.             Top             =   2392
  267.             Width           =   3960
  268.             Begin VB.OptionButton Opt_Check 
  269.                Caption         =   "全部"
  270.                Height          =   195
  271.                Index           =   0
  272.                Left            =   360
  273.                TabIndex        =   43
  274.                Top             =   240
  275.                Value           =   -1  'True
  276.                Width           =   855
  277.             End
  278.             Begin VB.OptionButton Opt_Check 
  279.                Caption         =   "未审核"
  280.                Height          =   195
  281.                Index           =   1
  282.                Left            =   1600
  283.                TabIndex        =   42
  284.                Top             =   240
  285.                Width           =   915
  286.             End
  287.             Begin VB.OptionButton Opt_Check 
  288.                Caption         =   "已审核"
  289.                Height          =   195
  290.                Index           =   2
  291.                Left            =   2880
  292.                TabIndex        =   41
  293.                Top             =   240
  294.                Width           =   885
  295.             End
  296.          End
  297.          Begin VB.TextBox LrText 
  298.             Height          =   300
  299.             Index           =   3
  300.             Left            =   975
  301.             TabIndex        =   4
  302.             Text            =   "3"
  303.             Top             =   1380
  304.             Width           =   2800
  305.          End
  306.          Begin VB.ComboBox Combo_Con 
  307.             Height          =   300
  308.             Index           =   0
  309.             Left            =   975
  310.             Style           =   2  'Dropdown List
  311.             TabIndex        =   0
  312.             Top             =   240
  313.             Width           =   3105
  314.          End
  315.          Begin VB.CommandButton Ydcommand1 
  316.             Height          =   300
  317.             Index           =   1
  318.             Left            =   3780
  319.             Picture         =   "物料需求计划_汇总需求查询条件.frx":178E
  320.             Style           =   1  'Graphical
  321.             TabIndex        =   31
  322.             TabStop         =   0   'False
  323.             Top             =   615
  324.             Visible         =   0   'False
  325.             Width           =   300
  326.          End
  327.          Begin VB.TextBox LrText 
  328.             Height          =   300
  329.             Index           =   1
  330.             Left            =   2700
  331.             TabIndex        =   2
  332.             Text            =   "1"
  333.             Top             =   615
  334.             Width           =   1065
  335.          End
  336.          Begin VB.TextBox LrText 
  337.             Height          =   300
  338.             Index           =   0
  339.             Left            =   975
  340.             TabIndex        =   1
  341.             Text            =   "0"
  342.             Top             =   615
  343.             Width           =   1065
  344.          End
  345.          Begin VB.CommandButton Ydcommand1 
  346.             Height          =   300
  347.             Index           =   0
  348.             Left            =   2040
  349.             Picture         =   "物料需求计划_汇总需求查询条件.frx":1B18
  350.             Style           =   1  'Graphical
  351.             TabIndex        =   30
  352.             TabStop         =   0   'False
  353.             Top             =   615
  354.             Visible         =   0   'False
  355.             Width           =   300
  356.          End
  357.          Begin VB.Label Label1 
  358.             AutoSize        =   -1  'True
  359.             Caption         =   "需求类型:"
  360.             Height          =   180
  361.             Index           =   1
  362.             Left            =   120
  363.             TabIndex        =   56
  364.             Top             =   1080
  365.             Width           =   810
  366.          End
  367.          Begin VB.Label Label1 
  368.             AutoSize        =   -1  'True
  369.             Caption         =   "计划周期:"
  370.             Height          =   180
  371.             Index           =   3
  372.             Left            =   120
  373.             TabIndex        =   54
  374.             Top             =   300
  375.             Width           =   810
  376.          End
  377.          Begin VB.Label Label1 
  378.             AutoSize        =   -1  'True
  379.             Caption         =   "制单日期:"
  380.             Height          =   180
  381.             Index           =   12
  382.             Left            =   120
  383.             TabIndex        =   53
  384.             Top             =   675
  385.             Width           =   810
  386.          End
  387.          Begin VB.Label Label1 
  388.             AutoSize        =   -1  'True
  389.             Caption         =   "物料分类:"
  390.             Height          =   180
  391.             Index           =   4
  392.             Left            =   120
  393.             TabIndex        =   52
  394.             Top             =   1440
  395.             Width           =   810
  396.          End
  397.          Begin VB.Line Line1 
  398.             X1              =   2400
  399.             X2              =   2640
  400.             Y1              =   765
  401.             Y2              =   765
  402.          End
  403.       End
  404.       Begin VB.Frame Frame10 
  405.          Height          =   4800
  406.          Left            =   -74940
  407.          TabIndex        =   17
  408.          Top             =   360
  409.          Width           =   4215
  410.          Begin VB.CommandButton Ydcommand1 
  411.             Height          =   300
  412.             Index           =   5
  413.             Left            =   3780
  414.             Picture         =   "物料需求计划_汇总需求查询条件.frx":1EA2
  415.             Style           =   1  'Graphical
  416.             TabIndex        =   23
  417.             TabStop         =   0   'False
  418.             Top             =   645
  419.             Visible         =   0   'False
  420.             Width           =   300
  421.          End
  422.          Begin VB.CommandButton Ydcommand1 
  423.             Height          =   300
  424.             Index           =   4
  425.             Left            =   3780
  426.             Picture         =   "物料需求计划_汇总需求查询条件.frx":222C
  427.             Style           =   1  'Graphical
  428.             TabIndex        =   24
  429.             TabStop         =   0   'False
  430.             Top             =   240
  431.             Visible         =   0   'False
  432.             Width           =   300
  433.          End
  434.          Begin VB.CommandButton Ydcommand1 
  435.             Height          =   300
  436.             Index           =   6
  437.             Left            =   3780
  438.             Picture         =   "物料需求计划_汇总需求查询条件.frx":25B6
  439.             Style           =   1  'Graphical
  440.             TabIndex        =   18
  441.             TabStop         =   0   'False
  442.             Top             =   1050
  443.             Visible         =   0   'False
  444.             Width           =   300
  445.          End
  446.          Begin VB.ComboBox Combo_Con 
  447.             Height          =   300
  448.             Index           =   1
  449.             Left            =   960
  450.             Style           =   2  'Dropdown List
  451.             TabIndex        =   11
  452.             Top             =   1410
  453.             Width           =   3135
  454.          End
  455.          Begin VB.TextBox LrText 
  456.             Height          =   330
  457.             Index           =   5
  458.             Left            =   975
  459.             TabIndex        =   9
  460.             Text            =   "5"
  461.             Top             =   630
  462.             Width           =   2800
  463.          End
  464.          Begin VB.TextBox LrText 
  465.             BackColor       =   &H00FFFFFF&
  466.             Height          =   300
  467.             Index           =   4
  468.             Left            =   975
  469.             TabIndex        =   8
  470.             Text            =   "4"
  471.             Top             =   240
  472.             Width           =   2800
  473.          End
  474.          Begin VB.Frame Frame11 
  475.             Caption         =   "需求数量"
  476.             Height          =   1065
  477.             Left            =   120
  478.             TabIndex        =   19
  479.             Top             =   1860
  480.             Width           =   3975
  481.             Begin VB.ComboBox Combo_Con 
  482.                Height          =   300
  483.                Index           =   2
  484.                Left            =   840
  485.                Style           =   2  'Dropdown List
  486.                TabIndex        =   12
  487.                Top             =   225
  488.                Width           =   915
  489.             End
  490.             Begin VB.ComboBox Combo_Con 
  491.                Height          =   300
  492.                Index           =   3
  493.                Left            =   840
  494.                Style           =   2  'Dropdown List
  495.                TabIndex        =   14
  496.                Top             =   585
  497.                Width           =   915
  498.             End
  499.             Begin VB.TextBox LrText 
  500.                Height          =   300
  501.                Index           =   7
  502.                Left            =   1860
  503.                TabIndex        =   13
  504.                Text            =   "7"
  505.                Top             =   210
  506.                Width           =   1995
  507.             End
  508.             Begin VB.TextBox LrText 
  509.                Height          =   300
  510.                Index           =   8
  511.                Left            =   1860
  512.                TabIndex        =   15
  513.                Text            =   "8"
  514.                Top             =   600
  515.                Width           =   1995
  516.             End
  517.             Begin VB.Label Label4 
  518.                AutoSize        =   -1  'True
  519.                Caption         =   "毛需求:"
  520.                Height          =   180
  521.                Left            =   150
  522.                TabIndex        =   22
  523.                Top             =   285
  524.                Width           =   630
  525.             End
  526.             Begin VB.Label Label2 
  527.                AutoSize        =   -1  'True
  528.                Caption         =   "净需求:"
  529.                Height          =   180
  530.                Left            =   150
  531.                TabIndex        =   21
  532.                Top             =   645
  533.                Width           =   630
  534.             End
  535.          End
  536.          Begin VB.TextBox LrText 
  537.             Height          =   300
  538.             Index           =   6
  539.             Left            =   975
  540.             TabIndex        =   10
  541.             Text            =   "6"
  542.             Top             =   1050
  543.             Width           =   2800
  544.          End
  545.          Begin VB.Label Label1 
  546.             AutoSize        =   -1  'True
  547.             Caption         =   "计划来源:"
  548.             Height          =   180
  549.             Index           =   2
  550.             Left            =   120
  551.             TabIndex        =   57
  552.             Top             =   1470
  553.             Width           =   810
  554.          End
  555.          Begin VB.Label Label1 
  556.             AutoSize        =   -1  'True
  557.             Caption         =   "制    单:"
  558.             Height          =   180
  559.             Index           =   15
  560.             Left            =   120
  561.             TabIndex        =   27
  562.             Top             =   705
  563.             Width           =   810
  564.          End
  565.          Begin VB.Label Label1 
  566.             AutoSize        =   -1  'True
  567.             Caption         =   "物料编码:"
  568.             Height          =   180
  569.             Index           =   5
  570.             Left            =   120
  571.             TabIndex        =   26
  572.             Top             =   300
  573.             Width           =   810
  574.          End
  575.          Begin VB.Label Label1 
  576.             AutoSize        =   -1  'True
  577.             Caption         =   "审    核:"
  578.             Height          =   180
  579.             Index           =   0
  580.             Left            =   120
  581.             TabIndex        =   25
  582.             Top             =   1110
  583.             Width           =   810
  584.          End
  585.       End
  586.    End
  587. End
  588. Attribute VB_Name = "MRP_TotalDemandQuery"
  589. Attribute VB_GlobalNameSpace = False
  590. Attribute VB_Creatable = False
  591. Attribute VB_PredeclaredId = True
  592. Attribute VB_Exposed = False
  593. '******************************************************************
  594. '*    模 块 名 称 :物料需求计划--汇总需求查询条件
  595. '*    功 能 描 述 :汇总需求查询条件
  596. '*    程序员姓名  :乔进
  597. '*    最后修改人  :乔进
  598. '*    最后修改时间:2001/12/10
  599. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  600. '******************************************************************
  601. Dim Tsxx As String                       '系统信息提示
  602. '以下为固定使用变量(文本框)
  603. Dim Textvar() As Variant                 '存储变体型文本框信息
  604. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  605. Dim Textint() As Integer                 '存储整型文本框信息
  606. Dim Textstr() As String                  '存储字符型文本框信息
  607. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  608. Dim TextGroupCode As String              '文本框录入分组编码
  609. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  610. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  611. Dim CurTextIndex As Integer              '当前文本框索引值
  612. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  613. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  614. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  615.     Dim jdzygs As Integer                         '控件焦点转移个数
  616.     jdzygs = 20
  617.     Select Case KeyAscii
  618.         Case vbKeyReturn
  619.             If Kjjdzy(jdzygs) Then
  620.                 KeyAscii = 0
  621.             End If
  622.         Case 39           '屏蔽"'"
  623.             KeyAscii = 0
  624.     End Select
  625. End Sub
  626. Private Sub Form_Load()
  627.     Dim Listindex As Integer
  628.     '以下为文本框处理程序(Fixed)
  629.     TextGroupCode = "MRP_TotalDemandQuery"
  630.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())  '读入文本框录入信息
  631.     Call Wbkcsh
  632.     
  633.     '[>>初始化查询条件默认值
  634.     Sub_FillCombo Me.Combo_Con(0)
  635.     FillCmb Combo_Con(2)
  636.     FillCmb Combo_Con(3)
  637.     Combo_Con(1).AddItem ""
  638.     Combo_Con(1).AddItem "0-相关需求"
  639.     Combo_Con(1).AddItem "1-独立需求"
  640.     '<<]
  641.     Me.SSTab1.TabIndex = 1
  642.    
  643.     Listindex = HasCurrentCyc(Xtyear, Xtmm)
  644.     If Listindex >= 0 Then
  645.         Combo_Con(0).Listindex = Listindex
  646.     End If
  647.     
  648.     MRP_TotalDemandQuery.HelpContextID = 241400302
  649.  
  650. End Sub
  651. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)          '查询条件窗体卸载
  652.     '查询条件窗体卸载时判断是否因为结果窗体卸载,如是则卸载,否则隐藏
  653.     If UnloadCheck.Value <> 1 Then
  654.         Cancel = 1
  655.         Me.Hide
  656.     End If
  657.     
  658. End Sub
  659.  
  660. Private Sub QdCommand_Click()                                   '确 定
  661.     '录入条件有效性判断(Fixed)
  662.     If Not Lrtjyxxpd Then
  663.         Exit Sub
  664.     End If
  665.     Me.Hide
  666.         
  667.     '[>>激活查询过程结果窗体
  668.     
  669.     MRP_TotalDemandList.Timer1.Enabled = True
  670.     MRP_TotalDemandList.SetFocus
  671.     
  672.     '<<]
  673. End Sub
  674. Private Sub QxCommand_Click()                                    '取消(Fixed)
  675.     Me.Hide
  676. End Sub
  677. Private Function Lrtjyxxpd() As Boolean                          '用户录入条件有效性判断
  678.     Dim jsqte As Integer
  679.     Dim iYear As Integer, iMonth As Integer
  680.     Lrtjyxxpd = False
  681.  
  682.     '对需要进行事后判断的文本框录入内容进行有效性判断 (Fixed)
  683.     For jsqte = 0 To Max_Text_Index
  684.         If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  685.             If Not TextYxxpd(jsqte) Then
  686.                 Exit Function
  687.             End If
  688.         End If
  689.     Next jsqte
  690.    
  691.     '[>>以下为依据实际情况自定义部分
  692.     '判断计划周期是否是空
  693.     If Trim(Me.Combo_Con(0)) = "" Then
  694.         Tsxx = "计划周期必须选择!"
  695.         Call Xtxxts(Tsxx, 0, 1)
  696.         Exit Function
  697.     End If
  698.     '查询日期范围应由小到大
  699.     If Format(LrText(0).Text, "yyyy-mm-dd") > Format(LrText(1).Text, "yyyy-mm-dd") And Trim(LrText(1).Text) <> "" Then
  700.         Tsxx = "查询日期范围应由小到大!"
  701.         Call Xtxxts(Tsxx, 0, 1)
  702.         LrText(0).SetFocus
  703.         Exit Function
  704.     End If
  705.     
  706.     Sub_DivMonth Trim(Combo_Con(0)), iYear, iMonth
  707.     
  708.     If Trim(LrText(0)) <> "" Then
  709.         If Fn_InPeriod(iYear, iMonth, Trim(LrText(0))) = False Then
  710.             Tsxx = "查询起始日期不在所选计划周期范围内!"
  711.             Call Xtxxts(Tsxx, 0, 1)
  712.             Exit Function
  713.         End If
  714.     End If
  715.     
  716.     If Trim(LrText(1)) <> "" Then
  717.         If Fn_InPeriod(iYear, iMonth, Trim(LrText(1))) = False Then
  718.             Tsxx = "查询截止日期不在所选计划周期范围内!"
  719.             Call Xtxxts(Tsxx, 0, 1)
  720.             Exit Function
  721.         End If
  722.     End If
  723.     '<<]以上为依据实际情况自定义部分
  724.  
  725.     Lrtjyxxpd = True
  726. End Function
  727. Private Sub Cmd_Clear_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)    '将用户输入条件全部清除(可选)
  728.     '清除文本框(Fixed)
  729.     For jsqte = 0 To Max_Text_Index
  730.         LrText(jsqte).Tag = ""
  731.         LrText(jsqte).Text = ""
  732.     Next jsqte
  733.     Me.Combo_Con(0).Listindex = 0
  734.     Me.Combo_Con(1).Listindex = 0
  735.     Me.Combo_Con(2).Listindex = 0
  736.     Me.Combo_Con(3).Listindex = 0
  737.     
  738.     Me.Opt_Abandon(0).Value = True
  739.     Me.Opt_Check(0).Value = True
  740.     Me.Opt_Create(0).Value = True
  741.     Me.Opt_Finish(0).Value = True
  742.     Me.Opt_PlanType(0).Value = True
  743.      
  744.     
  745.     '[>>
  746.     '此处可以写入其他清除条件程序
  747.     Opt_Check(0).Value = True
  748.     Me.Opt_Create(0).Value = True
  749.     Me.Opt_Finish(0).Value = True
  750.     '<<]
  751.   
  752. End Sub
  753. '*************以下为文本框录入处理程序(固定不变部分)*************'
  754. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  755.   
  756.     '以下为依据实际情况自定义部分[
  757.     '在此填写文本框录入事后处理程序
  758.     ']以上为依据实际情况自定义部分
  759.   
  760. End Sub
  761. Private Sub LrText_Change(Index As Integer)
  762.    
  763.     '屏蔽程序改变控制
  764.     If TextChangeLock Then
  765.         Exit Sub
  766.     End If
  767.     
  768.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  769.     
  770.     '限制字段录入长度
  771.           
  772.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  773.         
  774.     Select Case Textint(Index, 1)
  775.         Case 8, 11      '金额型
  776.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  777.         Case 9, 12      '数量型
  778.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  779.         Case 10          '单价型
  780.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  781.         Case Else        '其他小数类型控制
  782.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  783.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  784.             End If
  785.     End Select
  786.         
  787.     TextChangeLock = False '解锁
  788. End Sub
  789. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  790.     Call TextShow(Index)
  791.     CurTextIndex = Index
  792.     LrText(Index).SelStart = Len(LrText(Index))
  793. End Sub
  794. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  795.     
  796.     Select Case KeyCode
  797.         Case vbKeyF2
  798.             Call Text_Help(Index)
  799.     End Select
  800. End Sub
  801. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  802.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  803. End Sub
  804. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  805.     '显示相应信息但不能进行有效性判断
  806.   
  807. End Sub
  808.  
  809. Private Sub SSTab1_Click(PreviousTab As Integer)
  810.     If PreviousTab = 0 Then
  811.         LrText(4).SetFocus
  812.     Else
  813.         Combo_Con(0).SetFocus
  814.     End If
  815. End Sub
  816. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)     '按钮提供帮助
  817.     Call Text_Help(Index)
  818. End Sub
  819. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  820.     If Not Textboolean(Index, 1) Then
  821.         Exit Sub
  822.     End If
  823.      
  824.     '调用帮助
  825.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  826.   
  827.     '根据设置选择显示编码和名称,并进行存储
  828.     If Len(Xtfhcs) <> 0 Then
  829.         If Textint(Index, 3) = 1 Then
  830.             LrText(Index).Text = Xtfhcsfz
  831.             LrText(Index).Tag = Xtfhcs
  832.         Else
  833.             LrText(Index).Text = Xtfhcs
  834.             LrText(Index).Tag = Xtfhcsfz
  835.         End If
  836.     End If
  837.    
  838.     LrText(Index).SetFocus
  839. End Sub
  840. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  841.     '填写文本框得到焦点,进行相应信息处理程序
  842.    
  843. End Sub
  844. Private Sub Wbkcsh()                          '录入文本框初始化
  845.     
  846.     Dim jsqte As Integer
  847.   
  848.     '最大录入文本框索引值
  849.     Max_Text_Index = Textvar(1)
  850.   
  851.     ReDim TextValiJudgeLock(Max_Text_Index)
  852.     For jsqte = 0 To Max_Text_Index
  853.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  854.             If Textboolean(jsqte, 1) Then
  855.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  856.                     'Load Ydcommand1(jsqte)
  857.                 End If
  858.                 Ydcommand1(jsqte).Visible = True
  859.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  860.             End If
  861.             TextChangeLock = True
  862.             LrText(jsqte).Text = ""
  863.             LrText(jsqte).Tag = ""
  864.             If Textint(jsqte, 5) <> 0 Then
  865.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  866.             End If
  867.             TextChangeLock = False
  868.         End If
  869.         TextValiJudgeLock(jsqte) = True
  870.     Next jsqte
  871. End Sub
  872. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  873.     
  874.     Dim Sqlstr As String
  875.     Dim Findrec As ADODB.Recordset
  876.   
  877.     '文本框内容未曾改变不进行有效性判断
  878.     If TextValiJudgeLock(Index) Then
  879.         TextYxxpd = True
  880.         Exit Function
  881.     End If
  882.   
  883.     '文本框内容为空认为有效,并清空其Tag值
  884.     If Trim(LrText(Index)) = "" Then
  885.         LrText(Index).Tag = ""
  886.         Call Wbklrwbcl(Index)
  887.         TextValiJudgeLock(Index) = True
  888.         TextYxxpd = True
  889.         Exit Function
  890.     End If
  891.   
  892.     '可在此加入不做有效性判断的理由
  893.   
  894.     Select Case Textint(Index, 4)
  895.         Case 1      '编码型
  896.             Sqlstr = Trim(Textstr(Index, 5))
  897.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  898.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  899.             If Findrec.EOF Then
  900.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  901.                 LrText(Index).SetFocus
  902.                 Exit Function
  903.             Else
  904.                 Select Case Textint(Index, 3)
  905.                     Case 0
  906.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  907.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  908.                         End If
  909.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  910.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  911.                         End If
  912.                     Case 1
  913.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  914.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  915.                         End If
  916.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  917.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  918.                         End If
  919.                 End Select
  920.             End If
  921.         Case 2      '日期型
  922.             If IsDate(LrText(Index).Text) Then
  923.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  924.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  925.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  926.                 End If
  927.             Else
  928.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  929.                 Call Xtxxts(Tsxx, 0, 1)
  930.                 LrText(Index).SetFocus
  931.                 Exit Function
  932.             End If
  933.         Case 3      '其他类型
  934.     End Select
  935.     
  936.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  937.     TextValiJudgeLock(Index) = True
  938.     '调用文本框事后处理程序
  939.     Call Wbklrwbcl(Index)
  940.    
  941.     '有效性判断通过则返回True
  942.     TextYxxpd = True
  943.    
  944. End Function
  945. Private Sub Sub_FillCombo(ComboList As ComboBox)
  946.     Dim RecTemp As New ADODB.Recordset
  947.     Sqlstr = "Select Distinct kjYear From Gy_kjrlb Order by  kjYear     "
  948.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  949.     ComboList.Clear
  950.     ComboList.AddItem ""
  951.     If Not RecTemp.EOF Then
  952.         RecTemp.MoveFirst
  953.         Do While Not RecTemp.EOF
  954.             For jsqte = 1 To 12
  955.                 ComboList.AddItem Format(Str(RecTemp!kjyear), "0000") + "." + Format(Str(jsqte), "00")
  956.             Next jsqte
  957.             RecTemp.MoveNext
  958.         Loop
  959.     End If
  960.     ComboList.Listindex = 0
  961. End Sub
  962. Private Sub FillCmb(Cmb As ComboBox)
  963.     Cmb.AddItem ""
  964.     Cmb.AddItem "<"
  965.     Cmb.AddItem "<="
  966.     Cmb.AddItem "="
  967.     Cmb.AddItem ">="
  968.     Cmb.AddItem ">"
  969.     Cmb.Listindex = 0
  970. End Sub
  971. '判断指定的日期是否在某个计划月份内
  972. Private Function Fn_InPeriod(iYear As Integer, iMonth As Integer, curDate As String) As Boolean
  973.     Dim sBeginDate As String, sEndDate As String
  974.     Fn_InPeriod = False
  975.     sBeginDate = Fn_GetMonthBeginDate(iYear, iMonth)
  976.     sEndDate = Fn_GetMonthEndDate(iYear, iMonth)
  977.     
  978.     If CDate(curDate) >= CDate(sBeginDate) And CDate(curDate) <= CDate(sEndDate) Then
  979.         Fn_InPeriod = True
  980.         Exit Function
  981.     End If
  982.         
  983. End Function
  984. 'Functoin :返回一个月的起始日期
  985. Private Function Fn_GetMonthBeginDate(sYear As Integer, sMonth As Integer)
  986.     Dim sBeginDate As String, Rect As New ADODB.Recordset, Sql As String
  987.     
  988.     Sql = "Select * from gy_kjrlb Where kjYear='" & sYear & "' And Period='" & sMonth & "'"
  989.     Set Rect = Cw_DataEnvi.DataConnect.Execute(Sql)
  990.     If Not Rect.EOF Then
  991.         Fn_GetMonthBeginDate = Format(Rect!Qsrq, "yyyy-mm-dd")
  992.     Else
  993.         sBeginDate = Str(sYear) + "-" + Str(sMonth) + "-01"
  994.         Fn_GetMonthBeginDate = Format(sBeginDate, "yyyy-mm-dd")
  995.     End If
  996.     
  997.     Set Rect = Nothing
  998. End Function
  999. 'Functoin :返回一个月的结束日期
  1000. Private Function Fn_GetMonthEndDate(sYear As Integer, sMonth As Integer)
  1001.     Dim sEndDate As String, Rect As New ADODB.Recordset, Sql As String
  1002.     
  1003.     Sql = "Select * from gy_kjrlb Where kjYear='" & sYear & "' And Period='" & sMonth & "'"
  1004.     Set Rect = Cw_DataEnvi.DataConnect.Execute(Sql)
  1005.     If Not Rect.EOF Then
  1006.         Fn_GetMonthEndDate = Format(Rect!Zzrq, "yyyy-mm-dd")
  1007.         
  1008.     Else
  1009.         If sMonth + 1 > 12 Then
  1010.             sEndDate = Str(sYear) + "-12-31"
  1011.         Else
  1012.             sEndDate = Str(sYear) + Str(sMonth + 1) + "-01"
  1013.             sEndDate = Format(CDate(sEndDate) - 1, "yyyy-mm-dd")
  1014.         End If
  1015.         Fn_GetMonthEndDate = Format(sEndDate, "yyyy-mm-dd")
  1016.     End If
  1017. End Function
  1018. Private Sub Sub_DivMonth(InPara As String, Out1 As Integer, Out2 As Integer)
  1019.     Dim Pos1 As Integer
  1020.     Pos1 = InStr(1, InPara, ".")
  1021.     Out1 = Val(Left(InPara, Pos1 - 1))
  1022.     Out2 = Right(InPara, Len(InPara) - Pos1)
  1023. End Sub
  1024. Function HasCurrentCyc(kjyear As Integer, Period As Integer) As Integer
  1025.     Dim curcyc As String, bHas As Boolean
  1026.     bHas = False
  1027.     curcyc = Trim(Str(kjyear)) + "." + Trim(Format(Str(Period), "00"))
  1028.     For jsqte = 0 To Combo_Con(0).ListCount
  1029.         If Trim(curcyc) = Trim(Combo_Con(0).List(jsqte)) Then
  1030.             HasCurrentCyc = jsqte
  1031.             Exit Function
  1032.         End If
  1033.     Next jsqte
  1034.     bHasCurrentCyc = -1
  1035. End Function