以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  做了个手机页面增加请假单,每次提交都会出现三行是什么问题?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=161151)

--  作者:jiterp
--  发布时间:2021/3/8 11:36:00
--  做了个手机页面增加请假单,每次提交都会出现三行是什么问题?
做了个手机页面增加请假单,每次提交都会出现三行是什么问题,看代码好象没什么问题呀,这是什么情况?


下面是整段函数代码:



\'定义部门档案
Dim dept As New SQLCommand
dept.C
dept.CommandText = "s elect depname from sy_dept"
Dim deptdr As DataTable = dept.ExecuteReader

Dim e As RequestEventArgs = args(0)
Dim wb As New weui
If e.PostValues.Count = 0 Then \'生成增加订单网页
    wb.AddForm("","form1","Qjd_addnew.htm")
    wb.AddPageTitle("form1","ph1","填制请假单")
    With wb.AddInputGroup("form1","ipg1")
        .AddSelect("qjtype","请假类型","事假|病假|婚假")
        .AddSelect("staname","员工名称","|"+ DataTables("sy_staff").GetComboListString("staname"))
        .AddSelect("sdepname","所属部门","|"+deptdr.GetComboListString("depname"))
        .AddInput("stardate","开始日期","date")
        .AddInput("strtime","开始时间","time")
        .AddInput("enddate","结束日期","date")
        .AddInput("endtime","结束时间","time")
        With wb.AddInputGroup("form1","ipg2","请假事由")
            .AddTextArea("qjtext",5).Placeholder = "请输入200字以内的请假原因"
        End With
    End With
    
    With wb.AddButtonGroup("form1","btg1", False)  \'水平排列
        .Add("btn1", "提交","submit")
    End With
    e.WriteString(wb.Build)
Else \'保存新增的订单
    Dim nms() As String = {"qjtype","staname","sdepname","stardate","strtime","enddate","endtime","qjtext"}
    Dim dr As DataRow = DataTables("hr_qjd").AddNew()
    For Each nm As String In nms
        dr(nm) = e.PostValues(nm)
    Next
    dr("maker")="admin"
    dr("djdate")= Date.Today
    dr("cstate")= 0
    dr("qjcode")= Functions.Execute("Maxcode",Date.Today,"ck_hr_qjd")  \'自动单据编号
    dr("dateqty")= 1
    dr("workuser")= 8
    dr.Save()

    With wb.AddMsgPage("","msgpage","请假单创建成功", "好好学习,天天向上") \'增加订单成功提示信息
        .AddButton("btn1","继续增加","Qjd_addnew.htm")
    End With
    e.WriteString(wb.Build)
End If
[此贴子已经被作者于2021/3/8 11:37:05编辑过]

--  作者:有点蓝
--  发布时间:2021/3/8 11:45:00
--  
看不出有问题。有没有什么表事件?httprequest代码发上来看看
--  作者:jiterp
--  发布时间:2021/3/8 12:02:00
--  
谢谢老师提醒:是httprequest事件里多了最后一行,最后一行去掉就正常了。
Select Case e.Path
    Case "Qjd_filter.htm"
        Functions.Execute("Filter",e)
    Case "list.htm"
        Functions.Execute("List",e) 
    Case "tongji.htm"
        Functions.Execute("Statistics",e)

End
Select
e.WriteString(wb.Build)