+
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:18k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{38911DA0-E448-11D0-84A3-00DD01104159}#1.1#0"; "comct332.ocx"
- Begin VB.Form Base_DeptAdmin
- Caption = "部门权限设置"
- ClientHeight = 6000
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 7890
- Icon = "基础设置_部门权限设置.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 6000
- ScaleWidth = 7890
- StartUpPosition = 2 '屏幕中心
- Begin VB.PictureBox Picture1
- AutoRedraw = -1 'True
- AutoSize = -1 'True
- BackColor = &H00808080&
- BorderStyle = 0 'None
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 45
- Left = -120
- ScaleHeight = 45
- ScaleWidth = 7845
- TabIndex = 1
- Top = 2520
- Visible = 0 'False
- Width = 7845
- End
- Begin VB.CheckBox Chk_Supperman
- Caption = "管 理 员"
- Height = 225
- Left = 105
- TabIndex = 0
- ToolTipText = "管理员可以对计划系统进行任意的操作"
- Top = 5595
- Width = 1245
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 7680
- Top = 1920
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 8
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":1042
- Key = "G1"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":135E
- Key = ""
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":1C3A
- Key = ""
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":2516
- Key = "U1"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":2832
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":310E
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":3FEA
- Key = "U"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_部门权限设置.frx":4E3E
- Key = "G"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ListView ListView1
- Height = 1695
- Left = 0
- TabIndex = 2
- Top = 450
- Width = 7635
- _ExtentX = 13467
- _ExtentY = 2990
- View = 3
- LabelEdit = 1
- LabelWrap = -1 'True
- HideSelection = 0 'False
- FullRowSelect = -1 'True
- _Version = 393217
- Icons = "ImageList1"
- SmallIcons = "ImageList1"
- ColHdrIcons = "ImageList1"
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 2
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Text = "用户名"
- Object.Width = 5292
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Text = "说明"
- Object.Width = 10583
- EndProperty
- End
- Begin MSComctlLib.ListView ListView2
- Height = 2565
- Left = 0
- TabIndex = 3
- Top = 2910
- Width = 7665
- _ExtentX = 13520
- _ExtentY = 4524
- View = 3
- LabelEdit = 1
- LabelWrap = -1 'True
- HideSelection = -1 'True
- Checkboxes = -1 'True
- FullRowSelect = -1 'True
- GridLines = -1 'True
- _Version = 393217
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- NumItems = 3
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Text = "权限"
- Object.Width = 1764
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Text = "部门名称"
- Object.Width = 5292
- EndProperty
- BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 2
- Text = "说明"
- Object.Width = 4586
- EndProperty
- End
- Begin ComCtl3.CoolBar CoolBar1
- Height = 420
- Left = 0
- TabIndex = 4
- Top = 0
- Width = 7935
- _ExtentX = 13996
- _ExtentY = 741
- BandCount = 1
- _CBWidth = 7935
- _CBHeight = 420
- _Version = "6.0.8169"
- MinHeight1 = 360
- Width1 = 1440
- NewRow1 = 0 'False
- Begin MSComctlLib.Toolbar Toolbar
- Height = 330
- Left = 60
- TabIndex = 5
- Top = 60
- Width = 6000
- _ExtentX = 10583
- _ExtentY = 582
- ButtonWidth = 1349
- AllowCustomize = 0 'False
- Style = 1
- TextAlignment = 1
- ImageList = "ImageList1"
- DisabledImageList= "ImageList1"
- HotImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 1
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "授权"
- Key = "Audit"
- ImageIndex = 6
- Object.Width = 3
- BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628}
- NumButtonMenus = 9
- BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "NewUser"
- Text = "新增用户(&U)"
- EndProperty
- BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "NewUserGroup"
- Text = "新增用户组(&G)"
- EndProperty
- BeginProperty ButtonMenu3 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Text = "-"
- EndProperty
- BeginProperty ButtonMenu4 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "Properth"
- Text = "属性"
- EndProperty
- BeginProperty ButtonMenu5 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "Authorization"
- Text = "权限"
- EndProperty
- BeginProperty ButtonMenu6 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "Del"
- Text = "删除"
- EndProperty
- BeginProperty ButtonMenu7 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Text = "-"
- EndProperty
- BeginProperty ButtonMenu8 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "Refresh"
- Text = "刷新"
- EndProperty
- BeginProperty ButtonMenu9 {66833FEE-8583-11D1-B16A-00C0F0283628}
- Key = "Exit"
- Text = "关闭(&C)"
- EndProperty
- EndProperty
- EndProperty
- EndProperty
- End
- End
- Begin VB.Image Image1
- Height = 135
- Left = 0
- MousePointer = 7 'Size N S
- Top = 2640
- Width = 7695
- End
- End
- Attribute VB_Name = "Base_DeptAdmin"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模 块 名 称 :基础设置_部门权限设置
- '* 功 能 描 述 :对独立需求用户的部门操作权限进行设置
- '* 程序员姓名 :乔进
- '* 最后修改人 :乔进
- '* 最后修改时间:2001/11/19
- '* 备 注:最后修改
- '*******************************************************
- Dim Sqlstr As String: Dim RecTemp As New ADODB.Recordset: Dim jsqte As Integer
- Dim bChange As Boolean: Dim sPreID As String: Dim Tsxx As String, bFirstLoad As Boolean, mbMoving As Boolean
- '关于管理员得处理
- Private Sub Chk_Supperman_Click()
- If Chk_Supperman.Value = 1 Then
- For jsqte = 1 To ListView2.ListItems.Count
- ListView2.ListItems(jsqte).Checked = True
- Next jsqte
- Else
- For jsqte = 1 To ListView2.ListItems.Count
- ListView2.ListItems(jsqte).Checked = False
- Next jsqte
- End If
- End Sub
- Private Sub Form_Load()
- bFirstLoad = True
- Screen.MousePointer = 11
- Sub_Initial
- If ListView1.ListItems.Count <> 0 Then Call ListView1_ItemClick(ListView1.ListItems.Item(1))
- DoEvents: Me.Toolbar.Refresh
- bFirstLoad = False
- Screen.MousePointer = 0
- Base_DeptAdmin.HelpContextID = 2411002
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- If Me.Height < 4000 Then Me.Height = 4000
- SizeControls Image1.Top
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set RecTemp = Nothing
- End Sub
- '****************************控件位置调整**********************************************************
- Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- With Image1
- Picture1.Move .Left, .Top, .Width, .Height / 2
- End With
- Picture1.Visible = True
- mbMoving = True
- End Sub
- Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim sglPos As Single
- If mbMoving Then
- sglPos = Y + Image1.Top
- If sglPos < sglSplitLimit Then
- Picture1.Top = sglSplitLimit
- ElseIf sglPos > Me.Height - sglSplitLimit Then
- Picture1.Top = Me.Height - sglSplitLimit
- Else
- Picture1.Top = sglPos
- End If
- End If
- End Sub
- Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- SizeControls Picture1.Top
- Picture1.Visible = False
- mbMoving = False
- End Sub
- Sub SizeControls(X As Single)
- On Error Resume Next
- If X < 1000 Then X = 1000
- If X > Me.Height - 1500 - Toolbar.Height Then X = Me.Height - 1500 + Toolbar.Height
- ListView1.Height = X - Toolbar.Height
- Image1.Top = X
- ListView2.Top = X + 140
- ListView2.Height = Me.Height - (ListView1.Height + Image1.Height + 400) - Toolbar.Height - Chk_Supperman.Height - 50
- Chk_Supperman.Top = ListView2.Top + ListView2.Height + 25
- Chk_Supperman.Left = 100
- ListView1.Width = Me.Width - 100
- ListView2.Width = Me.Width - 100
- Image1.Width = Me.Width - 100
- CoolBar1.Width = Me.Width - 150
- End Sub
- '*****************************位置调整结束***********************************************************************
- '*****************************初始化用户列表,只显示对本系统拥有权限的用户****************************************
- Private Sub Sub_Initial()
- Dim sID As Long: Dim Xitem As ListItem
- Sqlstr = "Select Min(ID) From Xt_Xtgnb Where gnbm like '24%' "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- sID = RecTemp.Fields(0)
- Sqlstr = "Select * From Gy_Czygl Where SubString(LTrim(AuthorityID)," & sID & ",1 ) = 1 Order by Czybm "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not RecTemp.EOF Then
- RecTemp.MoveFirst
- Do While Not RecTemp.EOF
- Set Xitem = ListView1.ListItems.Add()
- Xitem.Key = "T" & Trim(RecTemp!Czybm & "")
- Xitem.Text = Trim(RecTemp!Czymc & "")
- Xitem.SmallIcon = "U"
- Xitem.Icon = "U"
- Xitem.SubItems(1) = Trim(RecTemp!explain & "")
- RecTemp.MoveNext
- Loop
- End If
- RecTemp.Close
- Set RecTemp = Nothing
- End Sub
- '*********************根据用户初始化部门列表和权限列表*********************************************************
- Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
- Dim KeyID As String: Dim Recmember As New ADODB.Recordset: Dim Xitem As ListItem: Dim Ydanswer As Integer
- On Error GoTo Errhand
- KeyID = Right(Trim(Item.Key & ""), Len(Trim(Item.Key & "")) - 1)
- If sPreID <> KeyID Or bFirstLoad = True Then
- ListView2.ListItems.Clear
- Screen.MousePointer = 11
- '查找MRP部门权限表中某个部门所对应的部门
- Sqlstr = "Select * From MRP_DeptAdmin Where Czybm ='" & KeyID & "' "
- Set Recmember = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not Recmember.EOF Then
- If Recmember.Fields("Admin") = True Then
- Chk_Supperman.Value = 1
- Else
- Chk_Supperman.Value = 0
- End If
- Else
- Chk_Supperman.Value = 0
- End If
- Sqlstr = "Select d.DeptCode ,d.DeptName ,a.Czybm From Gy_Department d Left Join MRP_DeptAdmin a On d.DeptCode=a.DeptCode And a.Czybm='" & KeyID & "' Where KfFlag=1 "
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Not RecTemp.EOF Then
- RecTemp.MoveFirst
- Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- Do While Not RecTemp.EOF
- Set Xitem = ListView2.ListItems.Add()
- Xitem.SubItems(1) = Trim(RecTemp!DeptName & "")
- Xitem.Key = "T" & Trim(RecTemp!DeptCode & "")
- If Not IsNull(RecTemp!Czybm) Or Chk_Supperman.Value = 1 Then
- Xitem.Checked = True
- End If
- RecTemp.MoveNext
- Loop
- End If
- End If
- Screen.MousePointer = 0
- sPreID = KeyID: bChange = True
- Set RecTemp = Nothing
- Set Recmember = Nothing
- Me.Tag = KeyID
- Me.Caption = "生产计划-用户权限管理(" & Trim(Item.Text & "") & ")"
- Exit Sub
- Errhand:
- MsgBox Err.Description, 16
- End Sub
- '********************保存用户权限设置******************************************************************************
- Private Sub Sub_SaveDept()
- Dim KeyID As String
- On Error GoTo Errhand
- If bChange = False Then Exit Sub
- KeyID = Trim(Me.Tag & "")
- Sqlstr = "Delete From MRP_DeptAdmin Where Czybm ='" & KeyID & "'"
- Cw_DataEnvi.DataConnect.Execute (Sqlstr)
- If Chk_Supperman.Value = 1 Then
- Sqlstr = "Insert Into MRP_DeptAdmin (Czybm ,DeptCode ,Admin ) Values ( '" & KeyID & "','' ,'1' )"
- Cw_DataEnvi.DataConnect.Execute (Sqlstr)
- Else
- For jsqte = 1 To ListView2.ListItems.Count
- If ListView2.ListItems.Item(jsqte).Checked = True Then
- Sqlstr = "Insert Into MRP_DeptAdmin (Czybm , DeptCode ,Admin ) Values ('" & KeyID & "', '" & Right(Trim(ListView2.ListItems.Item(jsqte).Key & ""), Len(Trim(ListView2.ListItems.Item(jsqte).Key & "")) - 1) & "' , '0')"
- Cw_DataEnvi.DataConnect.Execute (Sqlstr)
- End If
- Next jsqte
- End If
- sPreID = KeyID
- Tsxx = "权限保存完成!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- Errhand:
- MsgBox Err.Description, 16
- End Sub
- Private Sub ListView2_ItemCheck(ByVal Item As MSComctlLib.ListItem)
- If Me.Chk_Supperman.Value = 1 Then Item.Checked = True
- End Sub
- Private Sub Toolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "Audit"
- Call Sub_SaveDept
- End Select
- End Sub