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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Jcsz_Ywfw 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "业务范围"
  5.    ClientHeight    =   4740
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4485
  9.    HelpContextID   =   130101
  10.    Icon            =   "基础设置_业务范围.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4740
  15.    ScaleWidth      =   4485
  16.    StartUpPosition =   2  '屏幕中心
  17.    Begin VB.CommandButton Com_Save 
  18.       Caption         =   "保存(&S)"
  19.       Height          =   300
  20.       Left            =   1965
  21.       TabIndex        =   14
  22.       Top             =   4335
  23.       Width           =   1120
  24.    End
  25.    Begin VB.CommandButton Com_Cancel 
  26.       Cancel          =   -1  'True
  27.       Caption         =   "取消(&C)"
  28.       Height          =   300
  29.       Left            =   3195
  30.       TabIndex        =   20
  31.       Top             =   4335
  32.       Width           =   1120
  33.    End
  34.    Begin VB.Frame Frame1 
  35.       Height          =   4170
  36.       Left            =   120
  37.       TabIndex        =   15
  38.       Top             =   30
  39.       Width           =   4215
  40.       Begin VB.CheckBox Che_Xtjc 
  41.          Caption         =   "系统集成"
  42.          Height          =   315
  43.          Left            =   300
  44.          TabIndex        =   8
  45.          Top             =   2250
  46.          Value           =   1  'Checked
  47.          Width           =   1515
  48.       End
  49.       Begin VB.Frame Frame6 
  50.          Caption         =   "零成本出库方式"
  51.          Height          =   1935
  52.          Left            =   150
  53.          TabIndex        =   18
  54.          Top             =   240
  55.          Width           =   2055
  56.          Begin VB.OptionButton Opt_Ckfs 
  57.             Caption         =   "手工输入"
  58.             Height          =   255
  59.             Index           =   4
  60.             Left            =   180
  61.             TabIndex        =   4
  62.             Top             =   1560
  63.             Value           =   -1  'True
  64.             Width           =   1065
  65.          End
  66.          Begin VB.OptionButton Opt_Ckfs 
  67.             Caption         =   "结存成本"
  68.             Height          =   255
  69.             Index           =   3
  70.             Left            =   180
  71.             TabIndex        =   3
  72.             Top             =   1260
  73.             Width           =   1065
  74.          End
  75.          Begin VB.OptionButton Opt_Ckfs 
  76.             Caption         =   "参考成本"
  77.             Height          =   255
  78.             Index           =   2
  79.             Left            =   180
  80.             TabIndex        =   2
  81.             Top             =   930
  82.             Width           =   1065
  83.          End
  84.          Begin VB.OptionButton Opt_Ckfs 
  85.             Caption         =   "上次出库成本"
  86.             Height          =   255
  87.             Index           =   1
  88.             Left            =   180
  89.             TabIndex        =   1
  90.             Top             =   600
  91.             Width           =   1425
  92.          End
  93.          Begin VB.OptionButton Opt_Ckfs 
  94.             Caption         =   "上次入库成本"
  95.             Height          =   255
  96.             Index           =   0
  97.             Left            =   180
  98.             TabIndex        =   0
  99.             Top             =   270
  100.             Width           =   1425
  101.          End
  102.       End
  103.       Begin VB.Frame Frame5 
  104.          Caption         =   "暂估方式"
  105.          Height          =   1245
  106.          Left            =   2340
  107.          TabIndex        =   17
  108.          Top             =   240
  109.          Width           =   1725
  110.          Begin VB.OptionButton Opt_Zgcl 
  111.             Caption         =   "单到补差"
  112.             Enabled         =   0   'False
  113.             Height          =   225
  114.             Index           =   2
  115.             Left            =   210
  116.             TabIndex        =   7
  117.             Top             =   870
  118.             Width           =   1095
  119.          End
  120.          Begin VB.OptionButton Opt_Zgcl 
  121.             Caption         =   "单到回冲"
  122.             Enabled         =   0   'False
  123.             Height          =   225
  124.             Index           =   1
  125.             Left            =   225
  126.             TabIndex        =   6
  127.             Top             =   570
  128.             Width           =   1095
  129.          End
  130.          Begin VB.OptionButton Opt_Zgcl 
  131.             Caption         =   "月初回冲"
  132.             Enabled         =   0   'False
  133.             Height          =   225
  134.             Index           =   0
  135.             Left            =   210
  136.             TabIndex        =   5
  137.             Top             =   270
  138.             Value           =   -1  'True
  139.             Width           =   1095
  140.          End
  141.       End
  142.       Begin VB.CheckBox Che_Check 
  143.          Caption         =   "期末处理差异"
  144.          Height          =   315
  145.          Index           =   0
  146.          Left            =   300
  147.          TabIndex        =   10
  148.          Top             =   2865
  149.          Value           =   1  'Checked
  150.          Width           =   1785
  151.       End
  152.       Begin VB.CheckBox Che_Check 
  153.          Caption         =   "差异率计算包括本期暂估"
  154.          Height          =   315
  155.          Index           =   1
  156.          Left            =   300
  157.          TabIndex        =   11
  158.          Top             =   3165
  159.          Value           =   1  'Checked
  160.          Width           =   2325
  161.       End
  162.       Begin VB.CheckBox Che_Check 
  163.          Caption         =   "材料入库单是库房系统生成"
  164.          Height          =   315
  165.          Index           =   3
  166.          Left            =   300
  167.          TabIndex        =   13
  168.          Top             =   3765
  169.          Value           =   1  'Checked
  170.          Width           =   2505
  171.       End
  172.       Begin VB.CheckBox Che_Check 
  173.          Caption         =   "系统处理暂估"
  174.          Height          =   315
  175.          Index           =   4
  176.          Left            =   300
  177.          TabIndex        =   9
  178.          Top             =   2550
  179.          Value           =   1  'Checked
  180.          Width           =   1515
  181.       End
  182.       Begin VB.TextBox Txt_Qcyf 
  183.          Alignment       =   2  'Center
  184.          Height          =   300
  185.          Left            =   3330
  186.          MaxLength       =   2
  187.          TabIndex        =   16
  188.          Text            =   "1"
  189.          Top             =   1725
  190.          Width           =   360
  191.       End
  192.       Begin VB.CheckBox Che_Check 
  193.          Caption         =   "系统处理出库金额自填"
  194.          Height          =   315
  195.          Index           =   2
  196.          Left            =   300
  197.          TabIndex        =   12
  198.          Top             =   3480
  199.          Value           =   1  'Checked
  200.          Width           =   2145
  201.       End
  202.       Begin VB.Label Label3 
  203.          AutoSize        =   -1  'True
  204.          Caption         =   "开帐月份:"
  205.          Height          =   195
  206.          Left            =   2400
  207.          TabIndex        =   19
  208.          Top             =   1785
  209.          Width           =   900
  210.       End
  211.    End
  212. End
  213. Attribute VB_Name = "Jcsz_Ywfw"
  214. Attribute VB_GlobalNameSpace = False
  215. Attribute VB_Creatable = False
  216. Attribute VB_PredeclaredId = True
  217. Attribute VB_Exposed = False
  218. Dim Tsxx As String               '系统提示信息
  219. Private Sub Com_Save_Click()
  220.   
  221.     '保存用户设置
  222.     Call Sub_SaveDefine
  223.     
  224.     '重新读入系统帐套参数
  225.     Call Drxtztcs
  226.     
  227.     Unload Me
  228.    
  229. End Sub
  230. Private Sub Che_Check_Click(Index As Integer)
  231.     If Che_Check(0).Value = 1 And Che_Check(4).Value = 1 Then
  232.         If Not Index = 1 Then
  233.             Che_Check(1).Value = 1
  234.         Else
  235.             Che_Check(1).Value = 0
  236.         End If
  237.     Else
  238.         Che_Check(1).Value = 0
  239.     End If
  240.   
  241. End Sub
  242. Private Sub Sub_SaveDefine()                   '保存用户设置
  243.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  244.     
  245.     Cw_DataEnvi.DataConnect.BeginTrans
  246.     
  247.     '保存网格设置
  248.     With RecTemp
  249.         If .State = 1 Then .Close
  250.         
  251.             .Open "Select * From Gy_AccInformation Where SystemCode='chhs'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  252.           
  253.             .MoveFirst
  254.             .Find "itemcode='Chhs_Qmclcy'"
  255.             If Not .EOF Then
  256.                 .Fields("itemvalue") = Che_Check(0).Value
  257.                 .Update
  258.             End If
  259.             .MoveFirst
  260.             .Find "itemcode='Chhs_Xtclzg'"
  261.             If Not .EOF Then
  262.                 .Fields("itemvalue") = Che_Check(4).Value
  263.                 .Update
  264.             End If
  265.             .MoveFirst
  266.             .Find "itemcode='Chhs_Cylzg'"
  267.             If Not .EOF Then
  268.                 .Fields("itemvalue") = Che_Check(1).Value
  269.                 .Update
  270.             End If
  271.             .MoveFirst
  272.             .Find "itemcode='Chhs_ClrkdKfsc'"
  273.             If Not .EOF Then
  274.                 .Fields("itemvalue") = Che_Check(3).Value
  275.                 .Update
  276.             End If
  277.             .MoveFirst
  278.             .Find "itemcode='Chhs_Xtjc'"
  279.             If Not .EOF Then
  280.                 .Fields("itemvalue") = Che_Xtjc.Value
  281.                 .Update
  282.             End If
  283.             .MoveFirst
  284.             .Find "itemcode='Chhs_SFjezt'"
  285.             If Not .EOF Then
  286.                 .Fields("itemvalue") = Che_Check(2).Value
  287.                 .Update
  288.             End If
  289.             .MoveFirst
  290.             .Find "itemcode='Chhs_Eval1'"
  291.             If Not .EOF Then
  292.                 If Opt_Zgcl(0).Value Then
  293.                     .Fields("itemvalue") = 1
  294.                 Else
  295.                     .Fields("itemvalue") = 0
  296.                 End If
  297.                 .Update
  298.             End If
  299.             .MoveFirst
  300.             .Find "itemcode='Chhs_Eval2'"
  301.             If Not .EOF Then
  302.                 If Opt_Zgcl(1).Value Then
  303.                     .Fields("itemvalue") = 1
  304.                 Else
  305.                     .Fields("itemvalue") = 0
  306.                 End If
  307.                 .Update
  308.             End If
  309.             .MoveFirst
  310.             .Find "itemcode='Chhs_Eval3'"
  311.             If Not .EOF Then
  312.                 If Opt_Zgcl(2).Value Then
  313.                     .Fields("itemvalue") = 1
  314.                 Else
  315.                     .Fields("itemvalue") = 0
  316.                 End If
  317.                 .Update
  318.             End If
  319.              .MoveFirst
  320.             .Find "itemcode='Chhs_Lcbck1'"
  321.             If Not .EOF Then
  322.                 If Opt_Ckfs(0).Value Then
  323.                     .Fields("itemvalue") = 1
  324.                 Else
  325.                     .Fields("itemvalue") = 0
  326.                 End If
  327.                 .Update
  328.             End If
  329.              .MoveFirst
  330.             .Find "itemcode='Chhs_Lcbck2'"
  331.             If Not .EOF Then
  332.                 If Opt_Ckfs(1).Value Then
  333.                     .Fields("itemvalue") = 1
  334.                 Else
  335.                     .Fields("itemvalue") = 0
  336.                 End If
  337.                 .Update
  338.             End If
  339.              .MoveFirst
  340.             .Find "itemcode='Chhs_Lcbck3'"
  341.             If Not .EOF Then
  342.                 If Opt_Ckfs(2).Value Then
  343.                     .Fields("itemvalue") = 1
  344.                 Else
  345.                     .Fields("itemvalue") = 0
  346.                 End If
  347.                 .Update
  348.             End If
  349.              .MoveFirst
  350.             .Find "itemcode='Chhs_Lcbck4'"
  351.             If Not .EOF Then
  352.                 If Opt_Ckfs(3).Value Then
  353.                     .Fields("itemvalue") = 1
  354.                 Else
  355.                     .Fields("itemvalue") = 0
  356.                 End If
  357.                 .Update
  358.             End If
  359.              .MoveFirst
  360.             .Find "itemcode='Chhs_Lcbck5'"
  361.             If Not .EOF Then
  362.                 If Opt_Ckfs(4).Value Then
  363.                     .Fields("itemvalue") = 1
  364.                 Else
  365.                     .Fields("itemvalue") = 0
  366.                 End If
  367.                 .Update
  368.             End If
  369.    End With
  370.     
  371.     Cw_DataEnvi.DataConnect.CommitTrans
  372.     Set RecTemp = Nothing
  373.     
  374.     Tsxx = "保存完毕!"
  375.     Call Xtxxts(Tsxx, 0, 4)
  376.    
  377. End Sub
  378. Private Sub Che_Xtjc_Click()
  379.     
  380.     If Che_Xtjc.Value = 0 Then
  381.        Che_Check(3).Value = 0
  382.        Che_Check(3).Enabled = False
  383.     Else
  384.        Che_Check(3).Enabled = True
  385.     End If
  386. End Sub
  387. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移(Fixed)
  388.     Dim jdzygs As Integer                         '控件焦点转移个数
  389.     jdzygs = 30
  390.     Select Case KeyAscii
  391.         Case vbKeyReturn
  392.             If Kjjdzy(jdzygs) Then
  393.                 KeyAscii = 0
  394.             End If
  395.         Case 39           '屏蔽"'"
  396.             KeyAscii = 0
  397.     End Select
  398. End Sub
  399. Private Sub Form_Load()
  400.  
  401.     '调 入 初 始 值
  402.     Call Sub_Csdy
  403.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  404.     If Not Security_Log("Chhs_YwfwEdit", Xtczybm, 1, True, False) Then
  405.         Com_Save.Enabled = False
  406.     End If
  407. End Sub
  408. Private Sub Com_Cancel_Click()
  409.     Unload Me
  410.   
  411. End Sub
  412. Private Sub Sub_Csdy()        '初始参数
  413.     Dim RecTemp As Recordset
  414.     Dim Rectempfz As Recordset
  415.   
  416.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("select * from Gy_AccInformation where SystemCode ='Chhs'")
  417.    
  418.     With RecTemp
  419.  
  420.         If Not .EOF Then
  421.         
  422.             '期末是否处理差异
  423.             .MoveFirst
  424.             .Find "itemcode='Chhs_Qmclcy'"
  425.             If Not .EOF Then
  426.                 Che_Check(0).Value = .Fields("itemvalue")
  427.             End If
  428.           
  429.             '系统是否处理暂估
  430.             .MoveFirst
  431.             .Find "itemcode='Chhs_Xtclzg'"
  432.             If Not .EOF Then
  433.                 Che_Check(4).Value = .Fields("itemvalue")
  434.             End If
  435.             
  436.             '系统集成
  437.             .MoveFirst
  438.             .Find "itemcode='Chhs_Xtjc'"
  439.             If Not .EOF Then
  440.                 Che_Xtjc.Value = .Fields("itemvalue")
  441.             End If
  442.             
  443.             If Che_Xtjc.Value = 0 Then
  444.                 Che_Check(3).Enabled = False
  445.             End If
  446.           
  447.             '差异率计算是否包括暂估
  448.             .MoveFirst
  449.             .Find "itemcode='Chhs_Cylzg'"
  450.             If Not .EOF Then
  451.                 Che_Check(1).Value = .Fields("itemvalue")
  452.             End If
  453.           
  454.             '材料入库单是否是库房系统生成
  455.             .MoveFirst
  456.             .Find "itemcode='Chhs_ClrkdKfsc'"
  457.             If Not .EOF Then
  458.                 Che_Check(3).Value = .Fields("itemvalue")
  459.             End If
  460.           
  461.             
  462.             '上次入库成本
  463.             .MoveFirst
  464.             .Find "itemcode='Chhs_Lcbck1'"
  465.             If Not .EOF Then
  466.                 Opt_Ckfs(0).Value = .Fields("itemvalue")
  467.             End If
  468.           
  469.             '上次出库成本
  470.             .MoveFirst
  471.             .Find "itemcode='Chhs_Lcbck2'"
  472.             If Not .EOF Then
  473.                 Opt_Ckfs(1).Value = .Fields("itemvalue")
  474.             End If
  475.           
  476.             '上次出库成本
  477.             .MoveFirst
  478.             .Find "itemcode='Chhs_Lcbck2'"
  479.             If Not .EOF Then
  480.                 Opt_Ckfs(1).Value = .Fields("itemvalue")
  481.             End If
  482.           
  483.             '参考成本
  484.             .MoveFirst
  485.             .Find "itemcode='Chhs_Lcbck3'"
  486.             If Not .EOF Then
  487.                 Opt_Ckfs(2).Value = .Fields("itemvalue")
  488.             End If
  489.           
  490.             '结存成本
  491.             .MoveFirst
  492.             .Find "itemcode='Chhs_Lcbck4'"
  493.             If Not .EOF Then
  494.                 Opt_Ckfs(3).Value = .Fields("itemvalue")
  495.             End If
  496.           
  497.             '手工输入
  498.             .MoveFirst
  499.             .Find "itemcode='Chhs_Lcbck5'"
  500.             If Not .EOF Then
  501.                 Opt_Ckfs(4).Value = .Fields("itemvalue")
  502.             End If
  503.           
  504.           
  505.             '月初回冲
  506.             .MoveFirst
  507.             .Find "itemcode='Chhs_Eval1'"
  508.             If Not .EOF Then
  509.                 Opt_Zgcl(0).Value = .Fields("itemvalue")
  510.             End If
  511.           
  512.             '单到回冲
  513.             .MoveFirst
  514.             .Find "itemcode='Chhs_Eval2'"
  515.             If Not .EOF Then
  516.                 Opt_Zgcl(1).Value = .Fields("itemvalue")
  517.             End If
  518.           
  519.             '单到补差
  520.             .MoveFirst
  521.             .Find "itemcode='Chhs_Eval3'"
  522.             If Not .EOF Then
  523.                 Opt_Zgcl(2).Value = .Fields("itemvalue")
  524.             End If
  525.         End If
  526.         
  527.     End With
  528.     
  529.     '开帐月份
  530.     Txt_Qcyf.Text = StartMon
  531.      
  532.     '正常单据录入后,业务范围不能修改
  533.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("select * from chhs_startinputmain ")
  534.     If Not RecTemp.EOF Then
  535.        Com_Save.Enabled = False
  536.     End If
  537.     
  538.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute("select * from gy_inoutmain ")
  539.     If Not RecTemp.EOF Then
  540.        Com_Save.Enabled = False
  541.     End If
  542.     Set RecTemp = Nothing
  543.    
  544. End Sub