'-----以下是采购单查询网页 po_view.htm 的第二个表格内容(采购单行信息)。
目的:当用户点击采购单行的时候,希望在表的下方,已经准备好的图片区域显示订单所所对应的物料图片。
If srs.Count>0 Then
wb.insertHTML("form1","采购单行信息")
With wb.AddTable("form1","Table2")
.AfterSelChange = "po_view8()"
.Highlight= 1
.Alternate = 2
.head.AddRow("名称","规格","数量","单位","单价","金额","收")
For Each sr As DataRow In srs
With .Body.AddRow(sr("po_imc"),sr("po_igg"))
.addcell(sr("po_isl"),"class='alignC'")
.addcell(sr("po_idw"),"class='alignC'")
.addcell(sr("po_idj"),"class='alignR'")
.AddCell(sr("po_isl") * sr("po_idj"),"class='alignR'")
.addcell(sr("po_iok"),"class='alignC'")
.Primarykey = sr("po_iid") '----改为由物料主键作为表格key
End With
Next
End With
End If
Dim img001 As new List(of String)
With wb.AddInputGroup("form1","ipg4","库存图片")
With .AddUploader("imgid","",True)
.allowadd=False '关闭上传功能
Dim path As String = FilePath & "Photo\"
'.addimage(img001) ' <<------ 这里应该如何接收来自 JS函数po_view8()返回的图片集合值?
End With
End With
’----以下是JS函数:po_view8()
function po_view8(){
var obj = new Object();
obj.key=table2.primarykey;
var result = sendAjaxJSON(obj,"item_getImg.htm","",false);
alert(result); //测试结果有值(图片名称)
if (result){
document.getElementById('img001').value=result; '-<<------这里如何接收item_getImg() 返回的img01的值?
}
}
’----以下是自定义函数:item_getImg()
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim sb As New StringBuilder
Dim jo As JO bject = JObject.Parse(e.PlainText)
Dim key As Integer = jo("key")
Dim dr As DataRow = Data Tables("item99").SQLF ind("[_Identify] = " & key)
If dr IsNot Nothing Then
e.WriteString(dr("img01")) 'dr("img01") 列中装的多个文件名称
End If
请教专家:问题点如红颜色部份文字。
先谢谢专家!
[此贴子已经被作者于2017/12/1 22:04:55编辑过]