以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 根据员工号自动输入员工信息 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=142319) |
-- 作者:qqhealth -- 发布时间:2019/10/24 7:56:00 -- 根据员工号自动输入员工信息 老师您好,我想在web客户端根据输入的员工号,自动输入员工其他信息,红色代码不知对不,需要怎么改?谢谢!如果数据库没有这个员工号,则新输入员工信息。 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) |
-- 作者:有点蓝 -- 发布时间:2019/10/24 8:33:00 -- 需要使用ajax处理,参考:http://www.foxtable.com/mobilehelp/topics/0103.htm |
-- 作者:qqhealth -- 发布时间:2019/10/24 11:48:00 -- 老师您好,系统里如果有工号信息,用ajax可以自动输入。没有工号的情况,则需要手动录入,不知怎么写判断条件。谢谢! |
-- 作者:有点蓝 -- 发布时间:2019/10/24 11:58:00 -- 没看懂。没有就没有,如果没有输入框就不会赋值,默认就是空的。还需要做什么判断? |
-- 作者:qqhealth -- 发布时间:2019/10/24 12:11:00 -- 老师您好,我的问题是,比如工号123接受过咨询服务,在数据库里有,则可以通过ajax调数据,直接选择即可。而工号345没有接受过咨询,在数据库里没有信息,则需要手动录入,ajax处理的选择框里不能手动录入信息。谢谢! [此贴子已经被作者于2019/10/24 12:35:57编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/10/24 13:33:00 -- 那就改为使用AddInput文本框,不要使用选择框。难道一个工号还会有几个姓名,有几条信息?需要选择? |
-- 作者:qqhealth -- 发布时间:2019/10/24 15:41:00 -- 老师可以了,谢谢! |