Dim e As RequestEventArgs = args(0)
Dim wb As New weui
If e.PostValues.Count = 0 Then '生成增加订单网页
wb.InsertHTML("<h3 align='center' style='margin-top:5px'>健康咨询</h3>")
wb.AddForm("","form1","zxjl.htm")
With wb.AddInputGroup("form1","ipg1","咨询记录")
.AddInput("用户名","用户名","text").Value = e.Cookies("username")
Dim dr As DataRow = DataTables("药品订购方").SQLfind("用户名 = '" & e.Cookies("username") & "'")
If dr IsNot Nothing Then
With .AddInput("健康室","健康室","text")
.Value = dr("健康室")
.readonly = True
End With
Else
With .AddSelect("健康室","健康室","|" & DataTables("咨询记录").SQLGetComboListString("健康室","","日期 Desc"))
.Attribute = """
End With
End If
.AddInput("日期","日期","date").Value = Format(Date.Today,"yyyy-MM-dd")
If e.PostValues.Count = 0 Then
.AddInput("工号","工号","text").Placeholder = "必填项"
Dim dr1 As DataRow = DataTables("咨询记录").SQLfind("工号 = '" & e.PostValues("工号") & "'")
If dr1 IsNot Nothing Then
With .AddInput("员工姓名","员工姓名","text")
.Value = dr1("员工姓名")
End With
With .AddInput("身份证","身份证","text")
.Value = dr1("身份证")
End With
With .AddInput("性别","性别","text")
.Value = dr1("性别")
End With
With .AddInput("部门","部门","text")
.Value = dr1("部门")
End With
Else
.AddInput("员工姓名","员工姓名","text").Placeholder = "必填项"
.AddInput("身份证","身份证","text")
.AddSelect("性别","性别","男|女")
.AddInput("部门","部门","text").Placeholder = "必填项"
End If
End If
.AddInput("疾病分类","疾病分类","text").Placeholder = "按科分,必填项"
.AddInput("疾病","疾病","text").Placeholder = "必填项"
.AddInput("建议","建议","text").Placeholder = "必填项"
With .AddSelect("药品类别","药品类别","|" & DataTables("咨询记录").SQLGetComboListString("药品类别","","日期 Desc"))
.Attribute = """
End With
With .AddSelect("药品名称","药品名称","")
.Attribute = "" '调用js函数
End With
.AddInput("生产厂家","生产厂家","text")
.AddInput("规格","规格","text")
.AddInput("整盒含量","整盒含量","number").Readonly = True
.AddInput("整盒库存","整盒库存","number").readonly = True
.AddInput("散领数量","散领数量","").Attribute = ""
.AddInput("整领数量","整领数量","number").Step = "0.01"
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "确定", "button").Attribute= ""
.Add("btn2", "汇总","","zxjllist.htm")
.Add("btn3", "统计", "","zxjltjlist.htm")
End With
With wb.AddDialog("","dlg1", "提示","增加成功,是否继续增加?") '增加订单成功提示框
.AddButton("btnYes","是").Attribute = ""
.AddButton("btnNo","否","http://www.qqhealth.net").Kind = 1
End With
With wb.AddDialog("","dlg2", "错误","") '增加订单失败提示框
.AddButton("btnOK","确定")
End With
wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
wb.AppendHTML("<script src='./lib/calc.js'></script>") '引入脚本文件
End If
e.WriteString(wb.Build)