Dim e As RequestEventArgs = args(0)
'获取要显示的页
Dim wb As New weui
wb.AddToast("form1", "t1", "提交发单中", 1) '定义提示
With wb.AddTabBar("", "tb1", 1)
.Addbutton("bt0", "首页", "./images/sy.ico", "default.htm")
.Addbutton("bt1", "消息通知", "./images/xxtz.ico", "xxtz.htm")
.Addbutton("bt2", "最新动态", "./images/最新动态.ico", "zxdt.htm")
.Addbutton("bt3", "订单查询", "./images/订单查询.ico", "ddcx.htm")
.AddButton("bt5", "订单管理", "./images/订单管理.ico", "list.htm")
.AddPage("page1", "调度管理", "./images/调度.ico")
.AddButton("bt6", "退出", "./images/tc.ico", "exit.htm")
End With
wb.AddPageTitle("page1", "pageheader", "已发单", "您正在操作编号【" & e.GetValues("oid") & "】的订单!")
Dim oid As String
If e.GetValues.ContainsKey("oid") Then
oid = e.GetValues("oid")
End If
Dim pr As DataRow = DataTables("订单明细表").SQLFind("订单编号='" & oid & "'")
If pr IsNot Nothing Then
If e.PostValues.Count = 0 Then
Dim url As String = "ddfs.htm?oid=" & pr("订单编号")
wb.AddForm("page1", "form1", url).Attribute = """
With wb.AddInputGroup("form1", "", "")
With .Addinput("姓名", "姓名", "text")
.Value = pr("姓名")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg2", "时间日期")
With .AddInput("订单日期", "订单日期", "date")
.Value = pr ("订单日期")
.Readonly = True
End With
With .AddInput("订单时间", "订单时间", "time")
.Value = Format( pr("订单时间"), "HH:mm")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg3", "城市交通")
With .Addinput("城市", "城市", "text")
.Value = pr("城市")
.Readonly = True
End With
With .Addinput("地铁站", "地铁站", "text")
.Value = pr("地铁站")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg4", "客户信息")
With .AddInput("客户网名", "客户网名", "Text")
.Value = pr("客户网名")
.Readonly = True
End With
With .AddInput("客户网名备注", "网名备注", "Text")
.Value = pr("客户网名备注")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg5", "")
With .AddInput("客服", "客服", "Text")
.Value = pr("客服")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg6", "价格信息")
With .AddInput("单价", "单价", "number")
.Value = pr("单价")
.Readonly = True
End With
With .AddInput("单位", "单位", "text")
.Value = pr("单位")
.Readonly = True
End With
End With
With wb.AddInputGroup("form1", "ipg7", "已发单")
.AddSwitch("已发单", "已发单").Value = True
End With
With wb.AddButtonGroup("form1", "bng2", True)
.Add("btn1", "确定").Attribute = """
.Add("btn2", "取消").Attribute = """
End With
With wb.AddDialog("form1", "dlg1", "提示", "您确定要提交已发单吗?")
.AddButton("btnCancel", "取消", "default.htm").Kind = 1
.AddButton("btnOK", "确定", "submit")
End With
With wb.AddDialog("form1", "dlg2", "提示", "您确定要取消提交吗?")
.AddButton("btnOK", "确定", "default.htm")
End With
e.WriteString(wb.Build)
Else
If pr("已发单") = True Then
With wb.AddMsgPage("page1", "msgpage", "提示", "对不起,已发单已操作,请勿重复操作!")
.icon = "info" '改变图标
.AddButton("btn1", "返回", "default.htm")
End With
e.WriteString(wb.Build)
Return""
Else
pr("已发单") = True
pr("发单时间") = Date.Now
pr("订单状态") = "进行中:已发单"
pr("状态时间") = Date.Now
pr.Save()
With wb.AddMsgPage("page1", "msgpage", "恭喜你,发单成功", "订单已发送给员工")
.AddButton("btn1", "返回", "default.htm")
End With
e.WriteString(wb.Build)
End If
End If
End If