以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 一键入库(药品入库登记) (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=141954) |
||||
-- 作者:qqhealth -- 发布时间:2019/10/15 8:38:00 -- 一键入库(药品入库登记) 此主题相关图片如下:11.jpg 老师您好,下面是药品订购表,其中有个入库日期,如何实现对汇总表的中的订单统一实现一键入库,点击入库键,入库时间为操作当天。谢谢!现在代码是对每个药品进行编辑输入入库日期。谢谢!编辑页面代码如何: 此主题相关图片如下:10.jpg Dim dr As DataRow = DataTables("药品订单").SQLFind("[_Identify]=" & PrimaryKey) If dr IsNot Nothing Then wb.AddForm("","form1","ypedit.htm?key=" & PrimaryKey & "&page=" & PageNumber) With wb.AddInputGroup("form1","ipg1","编辑订单") .AddInput("药品名称","药品名称","text").Value = dr("药品名称") With .AddInput("价格","价格","number") .Readonly = True .Value = dr("价格") End With With .AddInput("数量","数量","number") .Value = dr("数量") .Attribute = "" End With With .AddInput("金额","金额","number") .Step = "0.01" .Value = dr("金额") End With .AddInput("入库日期","入库日期","date") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With Else With wb.AddMsgPage("","msgpage","编辑失败", "此订单可能已经被删除!") \'提示用户此订单不存在. .icon= "Warn" .AddButton("btn1","返回",PageURL) \'生成返回原来页面的按钮 End With End If Else \'保存编辑结果 Dim dr As DataRow = DataTables("药品订单").SQLFind("[_Identify]=" & PrimaryKey) If dr IsNot Nothing Then Dim nms() As String = {"药品名称","数量","金额","入库日期"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next dr.Save() \'显示完成提示,2妙手自动返回原来的页面 wb.AddToast("","t1", "编辑完成",0).Visible = True e.WriteString("<meta http-equiv=\'refresh\' c>") Else With wb.AddMsgPage("","msgpage","保存失败", "此订单可能已经被删除!") \'提示用户此订单不存在. .icon= "Warn" .AddButton("btn1","返回",PageURL) \'生成返回原来页面的按钮 End With End If End If |
||||
-- 作者:有点蓝 -- 发布时间:2019/10/15 9:17:00 -- 汇总表不是根据某个条件查询的吗?那么还是根据这个条件统一更新入库日期即可 |
||||
-- 作者:qqhealth -- 发布时间:2019/10/15 17:29:00 -- 老师您好,根据查询条件筛选出所有待入库清单后,点击确定后不知如何增加入库日期,代码如下,谢谢老师! \'\'生成菜单 Dim wb As New WeUI \'根据此页数据生成网页 With wb.AddTable("","Table1") .PageNumber = page \'设置页码 .Primarykey = "_Identify" \'设置主键 .ActiveSheet = "menu" \'设置菜单 .CreateFromDataTable(dt) .Alternate = 2 \'每两行显示一个不同背景颜色的行 Dim nms() As String Dim amt As Double .Head.AddRow("No.","药品名称","数量","价格","金额","入库日期") amt = dt.compute("sum(金额)") .Body.AddRow("","合计","","",amt,"","").Attribute = "style=\'background-color:#F0FFFF\'" End With wb.AddForm("","form1","yprklist.htm") With wb.AddInputGroup("form1","ipg1","全部入库") .AddInput("入库日期","入库日期","date").Value = Format(Date.Today,"yyyy-MM-dd") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With wb.AppendHTML("<script src=\'./lib/table.js\'></script>") \'引入脚本文件 |
||||
-- 作者:有点蓝 -- 发布时间:2019/10/15 17:32:00 -- .CreateFromDataTable(dt) ‘dt表的数据怎么来的? |
||||
-- 作者:qqhealth -- 发布时间:2019/10/15 21:36:00 -- 老师您好,整个yprklist函数见附件,谢谢!
|
||||
-- 作者:有点蓝 -- 发布时间:2019/10/15 22:06:00 -- 大概这样
|
||||
-- 作者:qqhealth -- 发布时间:2019/10/16 12:44:00 -- 老师您好,点击入库确定按钮后报错如下,谢谢!出错代码: |
||||
-- 作者:有点蓝 -- 发布时间:2019/10/16 13:39:00 -- 自己调试看是那一句代码有问题,不要一有问题就只会问 |
||||
-- 作者:qqhealth -- 发布时间:2019/10/17 22:51:00 -- 老师您好,下面这句代码有问题,不知怎么修改?谢谢! cmd.ExecuteScalar()
|
||||
-- 作者:qqhealth -- 发布时间:2019/10/18 8:27:00 -- 改为cmd.ExecuteNonQuery()也不行 |