e.Form.Controls("所有记录").Checked = True
Dim 操作表 As WinForm.Table = e.Form.Controls("样品明细")
Dim MT As Table = 操作表.Table
For Each R As Row In MT.Rows
Dim FDR As Row = R
MT.Position = R.Index
Dim 记录ID As Integer = FDr("_Identify")
Dim Fil As String = "_Identify = " & 记录ID & ""
Dim CFil As String = " 记录ID = " & 记录ID
If FDr.IsNull("应签收数量") OrElse Fdr("签收完成") = False Then
If FDr("审批数量") > 0 Then
FDr("应签收数量") = FDr("审批数量")
Else
If FDr("审核数量") > 0 Then
FDr("应签收数量") = FDr("审核数量")
Else
If FDr("计划数量") > 0 Then
FDr("应签收数量") = FDr("计划数量")
End If
End If
End If
End If
Dim 缺陷列表 As String = ""
Dim drs As List(Of DataRow) = DataTables("样品签收日志").SQLSelect(CFil)
For Each LR As DataRow In DRS
缺陷列表 = 缺陷列表 & LR("缺陷记录") & "|"
Next
缺陷列表 = Functions.Execute("List_Bis", 缺陷列表)
If drs.Count > 0 Then
FDr("缺陷记录") = 缺陷列表
FDr("签收数量") = DataTables("样品签收日志").SQLCompute("Sum(本次签收数量)", CFil)
FDr("出瓷总数") = DataTables("样品签收日志").SQLCompute("Sum(本次出瓷数量)", CFil)
FDr("不合格数量") = DataTables("样品签收日志").SQLCompute("Sum(不合格数量)", CFil)
FDr("出样批次") = DataTables("样品签收日志").SQLCompute("Count(*)", CFil)
FDr("签收下差数") = FDr("应签收数量") - fdr("签收数量")
If FDr("签收数量") > 0 AndAlso FDr("应签收数量") > 0 Then
If FDr("签收下差数") <= 0 Then
FDr("签收完成") = True
End If
End If
Dim FFDr As DataRow = DataTables("样品签收日志").SQLFind(CFil, "签收日期 Desc")
If FFDr IsNot Nothing Then
Fdr("今日缺陷") = FFDr("缺陷记录")
Fdr("今日签收") = FFDr("本次签收数量")
Fdr("今日出瓷") = FFDr("本次出瓷数量")
FDr("最近签收日期") = FFDr("签收日期")
End If
Else
FDr("缺陷记录") = ""
FDr("签收数量") = Nothing
FDr("出瓷总数") = Nothing
FDr("不合格数量") = Nothing
FDr("出样批次") = Nothing
FDr("签收下差数") = Nothing
FDr("签收完成") = False
Fdr("今日缺陷") = Nothing
Fdr("今日签收") = Nothing
Fdr("今日出瓷") = Nothing
FDr("最近签收日期") = Nothing
End If
_跳过全局表事件 = True
FDr.Save
Next
MessageBox.Show("统计完成")
此主题相关图片如下:07a76c140263639b42eb34b1abc1875.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2024-7/20247923314872823.png)