此主题相关图片如下:企业微信截图_20191107223445.png
只能上传一张图片,代码哪里不对呢
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Select Case e.Path
Case "xmgl00003.htm"
'------------------------------------------------------------------------------------------------------------------------------
wb.AddPageTitle("","pageheader","现场问题汇报","TOCASA 国际建材")
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","xmgl00003.htm")
With wb.AddInputGroup("form1","ipg11","新增汇报")
'提取登陆数据
With .AddInput("汇报人","填报人:","Text")
.value = name
.readonly = True
End With
With .AddInput("日期","提交日期:","date")
.Value = Date.Today
.readonly = True
End With
.AddInput("订单ID","订单ID","Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("客户","客户称呼","Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("问题分类","问题分类","Text") '前一个"姓名"是ID,后一个"姓名"是标题
'.AddSelect("问题分类","问题分类","漏发货|设计问题|现场问题|其他问题")
With wb.AddInputGroup("form1","ipg2","问题描述")
.AddTextArea("问题描述",5).Placeholder = "请输入200字以内的描述"
End With
.AddUploader("up1","现场照片",True) 'True表示允许上传多个文件
With wb.AddInputGroup("form1","ipg3","解决方案")
.AddTextArea("解决方案",5).Placeholder = "请输入200字以内的描述"
End With
With wb.AddInputGroup("form1","ipg4","备注")
.AddTextArea("备注",5).Placeholder = "请输入200字以内的备注"
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build)
Else
'Dim nms() As String
Dim nms() As String = {"日期","问题分类","问题描述","现场照片","解决方案","备注","客户","汇报人"}
Dim dr As DataRow = DataTables("项目问题汇总").AddNew()
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
'e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
e.SaveFile(key, fln, "C:\web\TOWEB\项目部\问题照片\" & dr("问题分类")& fln)
Next
dr.Lines("现场照片") = e.Files(key)
dr("推送标志") = 0
dr("gduserid") = "PiXinHua|TangShuoGuo|LiuYong|HuYuJie|ZengGang"
'dr("zduserid") = userid
dr("事故ID") = "GSID" & Format(Date.Now,"yyMMdd-HHmmss")
End If
Next
'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","提交成功", "感谢您的辛劳付出,小艺给您点赞加分") '生成成功提示页
.AddButton("btn1","继续增加","xmgl00003.htm")
End With '
e.WriteString(wb.Build)
End If
'----------------------------------------------------------------------------------------------------------------------
End If
End If
End Select
[此贴子已经被作者于2019/11/7 22:38:14编辑过]