With wb.AddForm("page10","form10","handle.htm")
If
e.PostValues.Count = 0 Then
With
wb.AddInputGroup("form10","ipg1","生产原料出库")
With .AddInputCell("ic1") '通过InputCell增加输入框
.AddLabel("lnl","原料货号",0) '增加标签,0显示在左边
End With
.AddInput("原料货号","","Text")
'前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("操作日期","出库日期","date").Value = Format(Date.Today,"yyyy-MM-dd")
.AddInput("原料类型","原料类型","Text")
'前一个"姓名"是ID,后一个"姓名"是标题
.AddSelect("领料单位","领料单位","散染车间|梳纺车间|兔毛纺车间|外协纺纱|其他用途")
.AddInput("ckjs","出库件数","number").Step = "0.01"
.AddInput("mjbz","每件标重","number").Step = "0.01"
With .AddInputCell("sj") '通过InputCell增加输入框
.AddLabel("lsj","预估出库",0)
'增加标签,0显示在左边
.AddInput("ygbz","number",1).Step = "0.01"
'增加输入框,1表示显示在中间
.AddVcodeButton("hym","预估计算",2).Attribute =""
End With
.AddInput("出库标重","出库标重","number").Step = "0.01"
.AddSwitch("是否清批","是否清批").Value
= "True"
.AddInput("外协单位","外协单位","Text")
'前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("备注","备注说明","Text") '前一个"姓名"是ID,后一个"姓名"是标题
End
With
With
wb.AddButtonGroup("form10","btg555",False)
'.Add("btn111", "导航",""
,"default.htm")
.Add("btn510", "清除重录", "button").Attribute = ""
.Add("btn511",
"扫一扫码", "button").Attribute = " & path & "/plus/barcode_scan.html',true,true);"""
.Add("btn211",
"确定", "button").Attribute= ""
End
With
With
wb.AddDialog("","dlg1",
"提示","增加出库成功,是否继续增加?")
'增加订单成功提示框
.AddButton("btnYes","是").Attribute = ""
.AddButton("btnNo","否").Attribute
= ""
End
With
With wb.AddDialog("","dlg2",
"数据录入不完整","")
'增加订单失败提示框
.AddButton("btnOK","确定")
End
With
'引入脚本文件
End If
wb.AppendHTML("<script
src='/" & path & "/js/生产原料出库预估计算.js'></script>")
wb.AppendHTML("<script src='/" & path & "/js/提交数据判断.js'></script>")
'引入脚本文件
wb.InsertHTML("<script>function
scaned( t, r, f ) {dosomthing(r);}</script>")
wb.AppendHTML("<script
type='text/javascript' src='/" &
path & "/js/扫码相关.js'></script>", True)
End
With
Case "handle.htm"
Dim nms() As String = {"操作日期","原料货号","领料单位","出库标重"}
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then
e.WriteString("请输入"
& nm & "!")
'返回错误消息
Return
'必须返回
End If
Next
Dim dr As DataRow = DataTables("外购原料出库").AddNew()
dr("移动出库") =True
dr("发料人") =UserName
Dim inms() As String = {"操作日期","原料类型","原料货号","领料单位","出库标重","ckjs","是否清批","外协领料单位名称","备注"} '输入框名称数组
Dim cnms() As String = {"操作日期","原料类型","原料货号","领料单位","出库标重","出库件数","是否清批","外协领料单位名称","备注"} '列名数组,注意列名和输入框必须一一对应,位置不能错乱
For i As Integer = 0 To inms.Length -1
dr(cnms(i)) = e.PostValues(Inms(i))
Next
dr.Save() '保存并生成增加成功提示页面
e.WriteString("OK")
'返回增加