⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtaskman.frm

📁 售后服务系统 优质的售后服务是企业生存和市场竞争的保障
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Caption         =   "问题描述"
         Height          =   180
         Left            =   1785
         TabIndex        =   8
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "问题类型"
         Height          =   180
         Left            =   4080
         TabIndex        =   7
         Top             =   1155
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "严重级别"
         Height          =   180
         Left            =   1800
         TabIndex        =   6
         Top             =   1155
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "联系人"
         Height          =   180
         Left            =   1965
         TabIndex        =   5
         Top             =   690
         Width           =   540
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "客户单位"
         Height          =   180
         Left            =   1785
         TabIndex        =   4
         Top             =   285
         Width           =   720
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   120
      Top             =   6480
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc AdoProList 
      Height          =   375
      Left            =   120
      Top             =   6840
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "AdoProList"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "FrmTaskMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Task()
  '设置数据源
  Adodc1.ConnectionString = Conn
  Adodc1.RecordSource = "SELECT TaskId As 编号, StartDate As 开始日期," _
        + "EndDate As 结束日期, SolveWay As 解决方式, Place As 工作地点," _
        + "Detail As 工作描述, LostMemo As 遗留问题" _
        + " FROM SrvTask WHERE ProId=" + Trim(Val(DataList1.BoundText)) _
        + " ORDER BY TaskId"
  Adodc1.Refresh
  Set DataGrid1.DataSource = Adodc1
  DataGrid1.Columns(0).Width = 0
  DataGrid1.Columns(1).Width = 1200
  DataGrid1.Columns(2).Width = 1200
  DataGrid1.Columns(3).Width = 1000
  DataGrid1.Columns(4).Width = 1200
  DataGrid1.Columns(5).Width = 1400
  DataGrid1.Columns(6).Width = 1200
End Sub

Private Sub Cmd_Add_Click()
  If DataList1.Text = "" Then
    MsgBox "请选择问题"
    Exit Sub
  End If

  FrmTaskEdit.TmpProId = Val(DataList1.BoundText)
  '设置添加记录标记
  FrmTaskEdit.Modify = False
  '初始化frmtaskedit窗体中的控件
  FrmTaskEdit.DTSDate = Format(Now, "yyyy-mm-dd")
  FrmTaskEdit.DTEDate = Format(Now, "yyyy-mm-dd")
  '启动窗体
  FrmTaskEdit.Show 1
  '刷新显示
  Refresh_Task
End Sub

Private Sub Cmd_Back_Click()
  Unload Me
End Sub

Private Sub Cmd_Del_Click()
  '判断是否选择了要删除的记录
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '确认删除
  If MsgBox("是否删除当前工作记录?", vbYesNo, "请确认") = vbYes Then
    MyTask.Delete (Adodc1.Recordset.Fields(0))
    Refresh_Task
  End If
End Sub

Private Sub Cmd_Edit_Click()
  '判断是否选择了要修改的记录
  If Adodc1.Recordset.BOF = True Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '保存光标位置
  p = Adodc1.Recordset.AbsolutePosition
  '读取当前记录的各列数据
  '任务编号
  FrmTaskEdit.OriId = Adodc1.Recordset.Fields(0)
  '问题编号
  FrmTaskEdit.TmpProId = Val(DataList1.Text)
  '开始日期
  FrmTaskEdit.DTSDate.Value = Trim(Adodc1.Recordset.Fields(1))
  '结束日期
  FrmTaskEdit.DTEDate.Value = Trim(Adodc1.Recordset.Fields(2))
  '解决方法
  FrmTaskEdit.txtWay = Trim(Adodc1.Recordset.Fields(3))
  '工作地点
  FrmTaskEdit.txtPlace = Trim(Adodc1.Recordset.Fields(4))
  '工作描述
  FrmTaskEdit.txtDetail = Trim(Adodc1.Recordset.Fields(5))
  '遗留问题
  FrmTaskEdit.txtLost = Trim(Adodc1.Recordset.Fields(6))
  '设置修改标记
  FrmTaskEdit.Modify = True
  '启动窗体
  FrmTaskEdit.Show 1
  '刷新显示
  Refresh_Task
  '恢复光标位置
  Adodc1.Recordset.Move 0
  Adodc1.Recordset.Move p - 1
End Sub

Private Sub Cmd_Solve_Click()
  '判断是否选择了要解决的记录
  If DataList1.Text = "" Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '读取当前问题,并判断问题当前状态
  MyPro.GetInfo (Val(DataList1.BoundText))
  If MyPro.Status = "解决" Then
    MsgBox "问题已经解决"
    Exit Sub
  End If
  '确定是否要把当前记录设置为“已解决”状态
  If MsgBox("是否将当前问题标记为解决?", vbYesNo, "请确认") = vbYes Then
    'SrvTask表中存在至少一条此问题的解决记录
    If MyTask.In_DB(Val(DataList1.BoundText)) = False Then
      MsgBox "请添加问题解决记录"
      Exit Sub
    End If
    '更新mypro表
    MyPro.Status = "解决"
    MyPro.UpdateStatus (Val(DataList1.BoundText))
  End If
  Refresh_Task
End Sub

Private Sub DataList1_Click()
  If Trim(DataList1.Text) = "" Then
    txtCustName = ""
    txtContact = ""
    txtLevel = ""
    txtType = ""
    txtDetail = ""
    txtDEmpName = ""
    txtREmpName = ""
    txtSuggest = ""
    lblDespDate = ""
    lblPostDate = ""
  Else
    With MyPro
      .GetInfo (Val(DataList1.BoundText))
      txtContact = .Contact
      MyBase.GetInfo (.ProLevel)
      txtLevel = MyBase.BaseName
      MyBase.GetInfo (.ProType)
      txtType = MyBase.BaseName
      MyBase.GetInfo (.CustId)  '客户名称
      txtCustName = MyBase.BaseName
      txtSDate = .SolveDate
      txtDetail = .Detail
    End With
    
    With MyDespatch
      .GetInfo (Val(DataList1.BoundText))
      txtDEmpName = MyUser.GetName(.DespUser)
      txtREmpName = MyUser.GetName(.RespUser)
      txtSuggest = .DespSuggest
      lblDespDate = .DespDate
      lblPostDate = .PostDate
    End With
  End If
  Refresh_Task
End Sub

Private Sub Form_Load()
  '如果是主管用户,则只能查看,不能编辑
  If CurUser.UserType = 1 Then
    Cmd_Add.Visible = False
    Cmd_Del.Visible = False
    Cmd_Edit.Caption = "查看"
    Cmd_Edit.Left = 3635
    Cmd_Solve.Left = 5305
    Cmd_Back.Left = 6975
    '设置数据源,读取当前主管用户所属的问题
    AdoProList.ConnectionString = Conn
    AdoProList.RecordSource = "SELECT p.Title,d.ProId FROM SrvDespatch d,SrvProblem p " _
            + " WHERE d.ProId=p.ProId AND d.DespUser='" _
            + Trim(CurUser.UserName) + "' ORDER BY d.ProId"
  Else
    '设置数据源,读取当前普通用户所属的问题
    AdoProList.ConnectionString = Conn
    AdoProList.RecordSource = "SELECT p.Title,d.ProId FROM SrvDespatch d,SrvProblem p " _
          + "WHERE d.ProId=p.ProId AND d.RespUser='" _
          + Trim(CurUser.UserName) + "' ORDER BY d.ProId"
  End If
  '刷新问题列表
  AdoProList.Refresh
  Set DataList1.RowSource = AdoProList
  DataList1.ListField = "Title"
  DataList1.BoundColumn = "ProId"
  '刷新问题描述
  DataList1_Click
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -