'上传拼图
' wb.AddForm("", "form1", "receive.htm")
With wb.AddInputGroup("form1", "ipg图片", "文件上传")
With.AddUploader("up128", "拼色图片", True)
.AllowDelete = True '允许删除
.Incremental = True '允许重复选择文件或连续拍照
End With
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "添加", "submit")
End With
wb.AddToast("", "tst1", "正在上传", 1)
wb.AddToast("", "tst2", "上传成功", 1)
wb.AddToast("", "tst3", "上传失败", 0).Icon = "warn"
wb.AppendHTML("<script src='/weui/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
Else
If e.PostValues.count < 16 Then
e.WriteString("数据填写不完整!")
' MessageBox.Show("数据填写不完整!")
Return
End If
Dim sb As New StringBuilder
sb.AppendLine("<meta name='viewport' c>")
sb.AppendLine("接收到的数据有:<br/><br/>")
Dim drNew As DataRow = dtb.AddNew
str接待人 = e.PostValues("接待人")
For Each key As String In e.PostValues.Keys
sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
If key = "销售日期" OrElse key = "销售时间" Then Continue For
drNew(key) = e.PostValues(key)
' MessageBox.Show(sb.ToString)
Next
drNew("录单人") = drNew("接待人")
drNew("销售时间") = e.PostValues("销售日期") & " " & e.PostValues("销售时间")
Dim drs As List(Of DataRow) = DataTables("客服订单").Select("接待人='" & str接待人 & "' And [记录时间]>=#" & Date.Today & " 00:00:00# And [记录时间]<=#" & Date.Today & " 23:59:59#")
drNew("id") = left(GetPY(str接待人, 1) & "----", 4) & "-" & format(Date.today, "yyyyMMdd") & "-" & Format(drs.count + 1, "0000")
drNew("当前状态") = 199
drNew("收款方式") = "一次付清"
drNew("记录时间") = Date.now
' drNew("拼色图片") = "C:\web\uploadfiles\" & fln
MessageBox.Show("收到图片" & e.Files.Keys.count & "张!")
For Each key As String In e.Files.Keys
For Each fln As String In e.Files(key)
' MessageBox.Show("收到图片!")
e.SaveFile(key, fln, "C:\web\uploadfiles\" & fln) '保存接收到的文件
drNew("拼色图片") = "C:\web\uploadfiles\" & fln
Next
Next
e.WriteString("上传数据成功!")
e.WriteString(sb.ToString)
' MessageBox.Show(sb.ToString)
End If