If e.Col.name = "发货单号" Then
e.Cancel = True
Dim str As String = e.Row("发货要求")
If str = "请采用老的发货方式" Then
Return
Else
Dim gdh,gdhh As String
Dim msg As String = ""
Dim gdsl() As String = str.Split("|")
For Index As Integer = 0 To gdsl.Length - 1
Dim gds() As String = gdsl(Index).Split("_")
For Index1 As Integer = 0 To gds.Length -1
Dim sum As Integer = DataTables("库位数量统计").SQLCompute("Sum(数量)","物料编码 = '" & e.Row("存货编码") & "' and 生产订单号码 = '" & gds(0) & "' and 工单行号 = '" & gds(1) & "'")
If sum < gds(2) Then
msg &= "工单号:" & gds(0) & "工单行号:" & gds(1) & "需要发货:" & gds(2) & "库存可用数量:" & sum & "不满足出库条件" & vbcrlf
End If
Next
Next
If msg > "" Then
MessageBox.show(msg,"下面工单不满足出库条件",MessageBoxButtons.OK,MessageBoxIcon.Error)
Else
vars("u8fhdh") = e.Row("发货单号")
vars("chbm") = e.Row("存货编码")
Vars("xsddh") = e.Row("销售订单号")
vars("xsckdph") = "发货单号:" & e.Row("发货单号") & "---" & "物料编码:" & e.Row("存货编码") & "- - -" & "需要配货(" & e.Row("挪货数量") & ")" & e.Row("主计量单位") & "分别为:" & e.Row("发货要求")
vars("xsckdck") = "发货单号:" & e.Row("发货单号") & "---" & "物料编码:" & e.Row("存货编码") & "- - -" & "需要出库(" & e.Row("挪货数量") & ")" & e.Row("主计量单位") & "分别为:" & e.Row("发货要求")
If e.Row("配货状态") = False Then
forms("配货整理").open
ElseIf e.Row("配货状态") = True And e.Row("出库状态") = False Then
Forms("A-Z出库扫描").open
End If
End If
End If
End If
请帮忙看看for 循环怎么改,才能避免对以"_"为分隔符的数组多次循环。不然就出现附件的现象,重复循环显示。
此主题相关图片如下:tip.png