Dim cl As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "标准产量米数_标准工时","生产时段_生产工时"
cl("标准产量米数_标准产量") = cl("标准产量米数_标准工时") * cl("生产时段_生产工时")
End Select
Dim sjcl As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "实际产量_每卷米数","实际产量_卷数"
sjcl("实际产量_产量米数") = sjcl("实际产量_每卷米数") * sjcl("实际产量_卷数")
End Select
Dim xl As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "标准产量米数_标准产量","实际产量_产量米数","实际产量_卷数"
If xl.IsNull("实际产量_卷数") Then '如果数量或单价为空
xl("生产效率") = Nothing
Else
xl("生产效率") = xl("实际产量_产量米数") / xl("标准产量米数_标准产量")
End If
End Select
Select Case e.DataCol.Name
Case "生产日期"
If e.DataRow.IsNull("生产日期") Then
e.DataRow("年份") = Nothing
e.DataRow("月份") = Nothing
Else
e.DataRow("年份") = e.DataRow("生产日期").Year
e.DataRow("月份") = e.DataRow("生产日期").Month
End If
End Select
If e.DataCol.Name = "批准" AndAlso e.DataRow("批准") = True Then
Dim dr As DataRow = DataTables("挤出部SR料及稼动率日报表A").AddNew
dr("生产日期") = e.DataRow("生产日期")
dr("操作员") = e.DataRow("操作员")
dr("班别") = e.DataRow("班别")
dr("部门名称") = e.DataRow("部门名称")
End If
Dim jgs As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "标准产量米数_标准工时","订单数量"
jgs("预估生产工时_净工时") = jgs("订单数量") / jgs("标准产量米数_标准工时") / 3600
End Select
Dim gsxj As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "订单数量","标准产量米数_标准工时","预估生产工时_净工时","预估生产工时_浮动工时"
gsxj("预估生产工时_工时小计") = gsxj("预估生产工时_净工时") + gsxj("预估生产工时_浮动工时")
End Select
Select Case e.DataCol.Name
Case "是否换色","产品规格"
If e.DataRow("是否换色") = True Then
e.DataRow("换色次数") = 1
Else
e.DataRow("换色次数") = Nothing
End If
End Select
Select Case e.DataCol.Name
Case "是否换模","产品规格"
If e.DataRow("是否换模") = True Then
e.DataRow("换模次数") = 1
Else
e.DataRow("换模次数") = Nothing
End If
End Select
Select Case e.DataCol.Name
Case "是否计划本日完成","产品规格"
If e.DataRow("是否计划本日完成") = True Then
e.DataRow("本班计划完成单数") = 1
Else
e.DataRow("本班计划完成单数") = 0
End If
End Select
Select Case e.DataCol.Name
Case "是否完成计划","产品规格"
If e.DataRow("是否完成计划") = True Then
e.DataRow("实际完成单数") = 1
Else
e.DataRow("实际完成单数") = Nothing
End If
End Select
Select Case e.DataCol.Name
Case "生产日期","部门名称","班别","操作员","计件金额_打样次数","计件金额_打样单价"
e.DataRow("计件金额_打样金额") = e.DataRow("计件金额_打样单价") * e.DataRow("计件金额_打样次数")
End Select
Select Case e.DataCol.Name
Case "是否打样","产品规格","生产日期","部门名称","班别","操作员","生产用料_全新料公斤","生产用料_SR料公斤","生产用料_ABS料公斤","生产用料_跑粉公斤","生产用料_全新料单价","生产用料_SR料单价","生产用料_ABS料单价","生产用料_跑粉单价"
If e.DataRow("是否打样") = False Then
e.DataRow("计件金额_产量金额") = e.DataRow("生产用料_全新料公斤") * e.DataRow("生产用料_全新料单价") + e.DataRow("生产用料_SR料公斤") * e.DataRow("生产用料_SR料单价") + e.DataRow("生产用料_ABS料公斤") * e.DataRow("生产用料_ABS料单价")+ e.DataRow("生产用料_跑粉公斤") * e.DataRow("生产用料_跑粉单价")
Else
e.DataRow("计件金额_产量金额") = Nothing
End If
End Select
'Select Case e.DataCol.Name
'Case "生产日期","部门名称","班别","操作员","生产用料_全新料公斤","生产用料_SR料公斤","生产用料_ABS料公斤","生产用料_跑粉公斤","生产用料_全新料单价","生产用料_SR料单价","生产用料_ABS料单价","生产用料_跑粉单价"
'e.DataRow("计件金额_产量金额") = e.DataRow("生产用料_全新料公斤") * e.DataRow("生产用料_全新料单价") + e.DataRow("生产用料_SR料公斤") * e.DataRow("生产用料_SR料单价") + e.DataRow("生产用料_ABS料公斤") * e.DataRow("生产用料_ABS料单价")+ e.DataRow("生产用料_跑粉公斤") * e.DataRow("生产用料_跑粉单价")
'End Select
Select Case e.DataCol.Name
Case "是否打样","产品规格"
If e.DataRow("是否打样") = True Then
e.DataRow("计件金额_打样次数") = 1
Else
e.DataRow("计件金额_打样次数") = Nothing
End If
End Select
Select Case e.DataCol.Name
Case "操作员"
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
If dr.IsNull("操作员") Then
dr("岗位系数") = Nothing
Else
Dim filter As String
filter = "工资结构_姓名 = '" & dr("操作员") & "'"
pr = DataTables("工资系数结构").Find(filter)
If pr IsNot Nothing Then
dr("岗位系数") = pr("工资结构_岗位系数")
End If
End If
End Select
Select Case e.DataCol.Name
Case "生产日期","部门名称","班别","操作员","岗位系数","出勤工时"
e.DataRow("出勤系数") = e.DataRow("出勤工时") / 12 * e.DataRow("岗位系数")
End Select
'Select Case e.DataCol.name
'Case "生产日期","操作员","岗位系数"
'Dim dr As DataRow = e.DataRow
'If dr.IsNull("生产日期") = False AndAlso dr.IsNull("操作员") = False AndAlso dr.IsNull("岗位系数") = False Then
'If e.DataTable.SQLCompute("Count([_Identify])","岗位系数 = " & dr("岗位系数") & " And 操作员 = '" & dr("操作员") & "' And 生产日期 = #" & e.DataRow("生产日期") & "# ") > 1 Then
'e.DataRow("岗位系数") = e.OldValue '取消输入
'End If
'End If
'e.DataRow.Save
'End Select
'
Select Case e.DataCol.Name
Case "实际产量_卷数","实际产量_每卷重量"
e.DataRow("实际产量_成品重量") = e.DataRow("实际产量_每卷重量") * e.DataRow("实际产量_卷数")
End Select
Select Case e.DataCol.Name
Case "实际产量_卷数","实际产量_产量米数"
e.DataRow("实际产量_产量米数") = e.DataRow("实际产量_每卷米数") * e.DataRow("实际产量_卷数")
End Select
Select Case e.DataCol.Name
Case "生产日期","出勤工时","操作员"
e.DataRow("出勤天数") = e.DataRow("出勤工时") / 12
End Select