以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  判断完成进度的问题,求助  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174465)

--  作者:xuxingbo
--  发布时间:2022/1/17 12:48:00
--  判断完成进度的问题,求助
求助,想实现以下功能:

当状态列新值为“已完成”时,进度列对应行赋值100
当状态列新值为“未完成”时,进度列判定:
班组列空值,进度列为“0”;不是空值,进度列为25
区域审批列空值,进度列为“25”;不是空值,进度列为50
中心审批列空值,进度列为“50”;不是空值,进度列为75

以下是我的代码,但实现不了这个功能请大神赐教!!!
    If e.NewValue = "已完成" Then
        e.DataRow("中心审批") = user.Name
        e.DataRow("中心审批时间") = Date.Today
        e.DataRow("进度") = "100"
    ElseIf e.NewValue = "未完成" Then
        Select Case e.DataCol.Name
            Case "班组"
                If e.NewValue = Nothing
                    e.DataRow("进度") = "0"
                Else
                    e.DataRow("进度") = "25"
                End If
            Case "区域审批"
                If e.NewValue = Nothing
                    e.DataRow("进度") = "25"
                Else
                    e.DataRow("进度") = "50"
                End If
            Case "状态"
                If e.NewValue = "已完成"
                    e.DataRow("中心审批") = user.Name
                    e.DataRow("中心审批时间") = Date.Today
                End If
            Case "中心审批"
                If e.NewValue = Nothing
                    e.DataRow("进度") = "50"
                Else
                    e.DataRow("进度") = "75"
                End If
            Case "状态"
                If e.NewValue = "已完成"
                    e.DataRow("进度") = "100"
                End If
        End Select
    End If
End If

--  作者:cd_tdh
--  发布时间:2022/1/17 13:03:00
--  

Select Case e.DataCol.Name
    Case "班组"
        If e.NewValue = Nothing
            e.DataRow("进度") = "0"
        Else
            e.DataRow("进度") = "25"
        End If
    Case "区域审批"
        If e.NewValue = Nothing
            e.DataRow("进度") = "25"
        Else
            e.DataRow("进度") = "50"
        End If
    Case "中心审批"
        If e.NewValue = Nothing
            e.DataRow("进度") = "50"
        Else
            e.DataRow("进度") = "75"
        End If
    Case "状态"
        If e.NewValue = "已完成"
            e.DataRow("进度") = "100"
            e.DataRow("中心审批") = user.Name
            e.DataRow("中心审批时间") = Date.Today
        End If
End Select

 

你这样写多了一个环节,我觉得应该是班组提交为:25,班组审批为:50,区域审批为:75,中心审批完:100。

或是换一个方式,直接用状态列来控制进度,这样更科学,比如下面这样。

 


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20220117131505.jpg
图片点击可在新窗口打开查看
[此贴子已经被作者于2022/1/17 13:15:37编辑过]