📄 frmfullview.frm
字号:
Height = 270
Left = 1200
MaxLength = 20
TabIndex = 2
Top = 240
Width = 1335
End
Begin VB.TextBox txtMsuggest
Height = 1695
Left = 1200
MaxLength = 20
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 600
Width = 3975
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "主管姓名"
Height = 180
Left = 240
TabIndex = 10
Top = 285
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "负责人"
Height = 180
Left = 2880
TabIndex = 9
Top = 285
Width = 540
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "处理意见"
Height = 180
Left = 240
TabIndex = 8
Top = 645
Width = 720
End
Begin VB.Label lblDealDate
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblDealdate"
Height = 180
Left = 3960
TabIndex = 7
Top = 2520
Width = 990
End
Begin VB.Label lblDesDate
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblDesDate"
Height = 180
Left = 1200
TabIndex = 6
Top = 2520
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "处理日期"
Height = 180
Left = 2880
TabIndex = 5
Top = 2520
Width = 720
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "提交日期"
Height = 180
Left = 240
TabIndex = 4
Top = 2520
Width = 720
End
End
End
Attribute VB_Name = "FrmFullview"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'更新问题列表
Private Sub Refresh_PrList()
Dim TmpSource As String
'根据用户类型,决定显示的内容
Select Case CurUser.UserType
Case 1 '接线员
TmpSource = "SELECT PrId As 编号, Cname As 客户单位," _
+ " Pdetail As 问题描述 FROM PrRec WHERE LogPerson='" _
+ Trim(CurUser.Ename) + "'"
Case 2 '主管用户
If CurUser.UserName = "manager" Then '总经理
TmpSource = "SELECT PrId As 编号, Cname As 客户单位," _
+ " Pdetail As 问题描述 FROM PrRec WHERE PrId>0"
Else
TmpSource = "SELECT p.PrId As 编号, p.Cname As 客户单位," _
+ " p.Pdetail As 问题描述 FROM PrRec p, Despatch d" _
+ " WHERE p.PrId=d.PrId And d.Muser='" + Trim(CurUser.Ename) + "'"
End If
Case 3 '普通用户
TmpSource = "SELECT p.PrId As 编号, p.Cname As 客户单位," _
+ " p.Pdetail As 问题描述 FROM PrRec p, Despatch d" _
+ " WHERE p.PrId=d.PrId And d.Euser='" + Trim(CurUser.Ename) + "'"
End Select
'根据日期设置筛选问题
Select Case ComboDate.ListIndex
Case 1 '选择年
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And CreateDate LIKE '%" + ComboY.Text + "%'"
Else
TmpSource = TmpSource + " And p.CreateDate LIKE '%" + ComboY.Text + "%'"
End If
Case 2 '选择月
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And CreateDate LIKE '%" _
+ ComboY.Text + "-" + ComboM.Text + "%'"
Else
TmpSource = TmpSource + " And p.CreateDate LIKE '%" _
+ ComboY.Text + "-" + ComboM.Text + "%'"
End If
Case 3 '选择天
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And CreateDate = '" + ComboY.Text + "-" + ComboM.Text + "-" + ComboD.Text + "'"
Else
TmpSource = TmpSource + " And p.CreateDate = '" + ComboY.Text + "-" + ComboM.Text + "-" + ComboD.Text + "'"
End If
End Select
'根据严重级别筛选问题
If ComboLevel.ListIndex > 0 Then
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And Plevel='" + ComboLevel.Text + "'"
Else
TmpSource = TmpSource + " And p.Plevel='" + ComboLevel.Text + "'"
End If
End If
'根据问题类型筛选问题
If ComboType.ListIndex > 0 Then
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And Ptype='" + ComboType.Text + "'"
Else
TmpSource = TmpSource + " And p.Ptype='" + ComboType.Text + "'"
End If
End If
'根据问题状态筛选问题
If ComboStatus.ListIndex > 0 Then
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " And Pstatus='" + ComboStatus.Text + "'"
Else
TmpSource = TmpSource + " And p.Pstatus='" + ComboStatus.Text + "'"
End If
End If
'问题排序
If CurUser.UserType = 1 Or _
(CurUser.UserType = 2 And CurUser.UserName = "manager") Then
TmpSource = TmpSource + " ORDER BY PrId"
Else
TmpSource = TmpSource + " ORDER BY p.PrId"
End If
AdoPrList.RecordSource = TmpSource
AdoPrList.Refresh
DataGrid1_Click
End Sub
Private Sub Refresh_Task(ByVal TmpId As Long)
'设置工作记录的数据源
Adodc1.RecordSource = "SELECT TaskId As 编号, Sdate As 开始日期," _
+ "Edate As 结束日期, Rway As 解决方式, Rplace As 工作地点," _
+ "Rdescribe As 工作描述, Rlost As 遗留问题" _
+ " FROM TaskRec WHERE PrId=" + Trim(TmpId) _
+ " ORDER BY TaskId"
Adodc1.Refresh
End Sub
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub ComboD_Click()
Refresh_PrList
End Sub
Private Sub ComboDate_Click()
Select Case ComboDate.ListIndex
Case 1
ComboM.Visible = False
ComboD.Visible = False
Case 2
ComboM.Visible = True
ComboD.Visible = False
Case 3
ComboM.Visible = True
ComboD.Visible = True
End Select
Refresh_PrList
End Sub
Private Sub ComboLevel_Click()
Refresh_PrList
End Sub
Private Sub ComboM_Click()
Refresh_PrList
End Sub
Private Sub ComboStatus_Click()
Refresh_PrList
End Sub
Private Sub ComboType_Click()
Refresh_PrList
End Sub
Private Sub ComboY_Click()
Refresh_PrList
End Sub
Private Sub DataGrid1_Click()
Dim TmpId As Long
'判断是否选择了问题记录,把问题编号保存在TmpId中
If AdoPrList.Recordset.EOF = True Then
TmpId = -1
Else
TmpId = AdoPrList.Recordset.Fields(0)
End If
'读取问题信息
With MyPrRec
.GetInfo (TmpId)
txtClient = .Cname
txtContact = .Cperson
txtTel = .Ctel
txtDescribe = .Pdetail
txtMemo = .Pcomment
End With
'读取工作分配信息
With MyDespatch
.GetInfo (TmpId)
txtMuser = .Muser
ComboEuser = .Euser
txtMsuggest = .Msuggest
lblDesDate = .Ddate
lblDealDate = .Mdate
End With
'刷新工作记录表格
Refresh_Task (TmpId)
'读取服务调查数据
With MyInv
.GetInfo (TmpId)
txtCustomer = .Customer
txtCustomerTel = .CustomerTel
ComboTitle.Text = .Title
txtBody = .Body
lblHandler = .Handler
lblInvDate = .InvDate
End With
End Sub
Private Sub Form_Load()
'初始化问题筛选条件
ComboDate.ListIndex = 3
ComboLevel.ListIndex = 0
ComboType.ListIndex = 0
ComboStatus.ListIndex = 0
'初始化年、月、日控件
For i = 1900 To 2100
ComboY.AddItem Trim(i)
Next
ComboY.ListIndex = Year(Now) - 1900
For i = 1 To 12
If i < 10 Then
ComboM.AddItem "0" + Trim(i)
Else
ComboM.AddItem Trim(i)
End If
Next
ComboM.ListIndex = Month(Now) - 1
For i = 1 To 31
If i < 10 Then
ComboD.AddItem "0" + Trim(i)
Else
ComboD.AddItem Trim(i)
End If
Next
ComboD.ListIndex = Day(Now) - 1
'接线员不能看到工作分配和工作过程记录
If CurUser.UserType = 1 Then
DataGrid2.Visible = False
ComboEuser.Visible = False
txtMsuggest.Visible = False
lblDealDate.Visible = False
End If
'刷新显示
Refresh_PrList
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -