以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  有时可打开,大部分时间打不开  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=150070)

--  作者:夏许多雪
--  发布时间:2020/5/20 9:55:00
--  有时可打开,大部分时间打不开
有一个移动开发项目,在合同评审中,有时可打开,有时打不开。请帮我看一下什么原因。
要点多次后有时会打开,打开后的页面如下:

图片点击可在新窗口打开查看此主题相关图片如下:合同评审打开页面.jpg
图片点击可在新窗口打开查看
经常是空白页面。要点5、6次,有时会打开。
contractreview函数代码如下:

\'打开需要合同评审的单位
Dim e As RequestEventArgs = args(0)
Dim un As String = e.cookies("un")
Dim page As Integer = 0 \'默认page为0,显示第一页
If e.GetValues.ContainsKey("crpage") Then  \'如果地址中有page参数
    Integer.TryParse(e.GetValues("crpage"), page) \'提取page参数
End If
Dim Id As Integer
If e.GetValues.ContainsKey("crid") Then
    Integer.TryParse(e.GetValues("crid"), Id)
End If
Dim wb As new WeUI
Dim dr As DataRow = DataTables("职卫订单").Find("_identify = \'" & Id & "\'")
If dr IsNot Nothing Then
    wb.AddForm("","form1","default.htm")
    With wb.AddInputGroup("form1","ipg1","合同评审")
        With .AddInput("订单编号","订单编号","text")
            .value = dr("订单编号")
            .Readonly = True
        End With
        With .AddInput("客户名称","客户名称","text")
            .value = dr("客户名称")
            .Readonly = True
        End With
        With .AddInput("业务员","业务员","text")
            .value = dr("业务员")
            .Readonly = True
        End With
        .AddInput("审核人","审核人","text").value = un
        .AddInput ("审核日期","审核日期","date").value = Date.Today
    End With
    Dim usg As String
    Dim tr As DataRow = DataTables("用户").find("Name = \'" & un & "\'")
    If tr IsNot Nothing Then
        
        usg = tr("Config")
    End If
    If usg Like "*业务*" Then
        With wb.AddcheckGroup("form1","chk","业务审核")
            .Add("rv","业务审核")
        End With
    ElseIf usg Like "*采样*" Then
        With wb.AddcheckGroup("form1","chk","采样审核")
            .Add("rv","采样审核")
        End With
    ElseIf usg Like "*评价*" Then
        With wb.AddcheckGroup("form1","chk","评价审核")
            .Add("rv","评价审核")
        End With
    ElseIf usg Like "*分析*" Then
        With wb.AddcheckGroup("form1","chk","分析审核")
            .Add("rv","分析审核")
        End With
    End If
    With wb.AddInputGroup("form1","ipg2","审核意见")
        If usg Like "*业务*" Then
            .AddTextArea("业务意见")
        ElseIf usg Like "*采样*" Then
            .AddTextArea("采样意见")
        ElseIf usg Like "*评价*" Then
            .AddTextArea("评价意见")
        ElseIf usg Like "*分析*" Then
            .AddTextArea("分析意见")
        End If
    End With
    
End If

e.WriteString(wb.Build)






[此贴子已经被作者于2020/5/20 10:52:23编辑过]

--  作者:有点蓝
--  发布时间:2020/5/20 10:06:00
--  
贴出httprequest事件的代码。直接贴代码即可,不要像一楼那样发那种带行号的代码
--  作者:夏许多雪
--  发布时间:2020/5/20 10:13:00
--  
httprequest代码:

Dim wb As new WeUI
Dim verified As Boolean
Dim un As String = e.cookies("username")
Dim pw As String = e.cookies("password")
If e.path = "logon.htm" Then
    If e.postvalues.containskey("username") AndAlso e.postvalues.containskey("password") Then
        un = e.postvalues("username")
        pw = e.postvalues("password")
    End If
End If


If verified AndAlso e.path = "logon.htm" Then
    wb.AppendCookie("username",un)
    wb.AppendCookie("password",pw)
    wb.InsertHTML("<meta http-equiv=\'Refresh\' c>")
    e.writestring(wb.build)
    Return
ElseIf verified = False AndAlso e.path <> "logon.htm" Then
    wb.AppendHTML("<meta http-equiv=\'Refresh\' c>")
    e.writestring(wb.Build)
    Return
End If

Select Case e.path
    \'登录页面
   
    Case "dlist.htm"
        Functions.Execute("dlist",e)
        Return
    Case "fxlist.htm"
        Functions.Execute("fxlist",e)
        Return
    Case "fxdlist.htm"
        Functions.Execute("fxdlist",e)
        Return
    Case "fxdedit.htm"
        Functions.Execute("fxdedit",e)
        Return
    Case "fxedit.htm"
        Functions.Execute("fxedit",e)
        Return
    Case "contractlist.htm"
        Functions.Execute("contractlist",e)
        Return
    Case "contractreview.htm"
        Functions.Execute("contractreview",e)
    
End Select
e.writestring(wb.Build)
[此贴子已经被作者于2020/5/20 10:51:19编辑过]

--  作者:夏许多雪
--  发布时间:2020/5/20 10:15:00
--  
table.js文件

function edit(){
    location="edit.htm?page=" + table1.pagenumber + "&key=" + table1.primarykey;
}
function dedit(){
    location="dedit.htm?dpage=" + table1.pagenumber + "&doid=" + table1.primarykey;
}
function dlist(){
    location="dlist.htm?lpage=0&loid=" + table1.primarykey;
}
function bedit(){
    location="bedit.htm?page=" + table1.pagenumber + "&key=" + table1.primarykey;
}
function fxedit(){
    location="fxedit.htm?page=" + table1.pagenumber + "&key=" + table1.primarykey;
}
function fxdlist(){
    location="fxdlist.htm?fxlpage=0&fxloid=" + table1.primarykey;
}
function fxdedit(){
    location="fxdedit.htm?fxdpage=" + table1.pagenumber + "&fxdoid=" + table1.primarykey;
}
function contractreview(){
    location="contractreview.htm?crpage=" + table1.pagenumber + "&crid=" + table1.primarykey;
}
function logon() {
    location = "logon.htm"
}

--  作者:有点蓝
--  发布时间:2020/5/20 10:26:00
--  
        Functions.Execute("fxedit",e)
        Return
    Case "contractlist.htm"
        Functions.Execute("contractlist",e)
        Return
    Case "contractreview.htm"
        Functions.Execute("contractreview",e)
          Return  
End Select
e.writestring(wb.Build)

--  作者:夏许多雪
--  发布时间:2020/5/20 10:40:00
--  
谢谢,因为前面有问题,我删除了,加上后好像可以了。
--  作者:有点蓝
--  发布时间:2020/5/20 10:44:00
--  
必须加上return,不然会导致e.writestring重复调用,就会出现1楼描述的问题