'开启全局表的KEYDOWN事件
For Each dt As DataTable In DataTables
dt.GlobalHandler.KeyDown = True
Next
'打开用户登录窗口
Forms("Login").show()
'对开发者以外的其他用户隐藏表标题;
Dim dtb As new DataTableBuilder("finished_sample","已完成样办")
dtb.Build()
If User.Type <> UserTypeEnum.Developer Then
For Each dt As Table In Tables
If dt.Name <> "scheduling" And dt.Name <> "finished_sample" Then
dt.Visible = False
End If
Next
End If
'自动判断当前用户的角色,并筛选指定的内容显示;
Dim dr As DataRow = DataTables("User_info").Find("User_Name= '" & _username & "'") '分开查询,防注入登录
If dr IsNot Nothing Then
Select Case _Userroles
Case "QA","QAM"
DataTables("scheduling").LoadFilter= "[QA_team] = '" & _usergroup & "' and ( [sample_state] <> '已出办' and [sample_state] <> '取消' ) "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
If _usergroup = "GD2" Then
Tables("scheduling").setcolvisiblewidth("input_date|115|Season|100|series|100|Customer|95|Inside_SRS|90|SRS_No|100|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115")
Else
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|SRS_No|100|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115")
End If
With Tables("scheduling")
Dim i As Integer
i = .FindRow("PA_feedback IS NULL and 排单顺序 < #" & Cdate(Date.Today) & "# and Follow_QA = '" & dr("FullName") & "'" )
If i >= 0 Then
Forms("Updating").show
End If
End With
' *****************************
Case "PA"
RibbonTabs("Sample_Manage").Visible = False
DataTables("scheduling").LoadFilter= "[Sewing_Team] = '" & _usergroup & "' and ( [sample_state] <> '已出办' and [sample_state] <> '取消' ) "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115")
With Tables("scheduling")
Dim i As Integer
i = .FindRow("PA_feedback is not null and 排单顺序 < #" & Cdate(Date.Today) & "# and Sewing_Team = '" & dr("user_group") & "'" )
If i >= 0 Then
Forms("Updating").show
End If
End With
' *****************************
Case "PAM"
RibbonTabs("Sample_Manage").Visible = False
DataTables("scheduling").LoadFilter= " [sample_state] <> '已出办' and [sample_state] <> '取消' "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|Follow_QA|60|Sewing_Team|50|sample_readydate|115|PA_feedback|115|排单顺序|115|sample_state|70|QA_team|50|PttnFinishDate|80|Cup_readydate|80|Other_readydate|80|Remark|245|Revise_Log|130|Last_update|115")
Case "纸样经理"
RibbonTabs("Sample_Manage").Visible = False
DataTables("scheduling").LoadFilter= "[PttnType] <> '已有纸样' and [PttnState] <> '已完成' and [sample_state] <> '取消' "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Mold_ID|100|cup_style|100|patten_ID|100|Pattener|60|PttnType|60|PttnFinishDate|115|PttnState|100|Follow_QA|60|Sewing_Team|50|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115")
With Tables("scheduling")
Dim i As Integer
i = .FindRow("PttnState <> '已完成' And PttnFinishDate < #" & Cdate(Date.Today) & "# and PttnFinishDate is not null " )
If i >= 0 Then
Forms("Updating").show
End If
End With
Case "定型经理"
RibbonTabs("Sample_Manage").Visible = False
DataTables("scheduling").LoadFilter= "[CupType] <> '无需做棉杯' and [Cupstate] <> '已完成' and CupTeam like '%定型%' and [sample_state] <> '取消' "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|product_type|50|Mold_ID|100|cup_style|100|CupType|60|Cupstate|100|CupTeam|100|Cup_readydate|115|Follow_QA|60|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115")
With Tables("scheduling")
Dim i As Integer
i = .FindRow("Cupstate <> '已完成' And Cup_readydate < #" & Cdate(Date.Today) & "# and Cup_readydate is not null " )
If i >= 0 Then
Forms("Updating").show
End If
End With
Case "FCQA"
RibbonTabs("Sample_Manage").Visible = False
DataTables("scheduling").LoadFilter= "[CupType] <> '无需做棉杯' and [CupTeam] like '*FC*' "
DataTables("scheduling").LoadOrder= "[排单顺序]"
DataTables("scheduling").Load()
' 判断当前PA用户是否有排期需要更新,如果有的话,弹出更新窗口并列出需要更新的数据,更新完毕后,再进行后面的排期工作
Tables("scheduling").setcolvisiblewidth("input_date|115|Customer|95|Inside_SRS|90|Style_No|125|Size|50|Color|95|Customer_Qty|40|Keep_Qty|40|sample_use|70|product_type|50|Mold_ID|100|cup_style|100|CupType|60|Cupstate|100|CupTeam|100|Cup_readydate|115|Follow_QA|60|排单顺序|115|sample_state|70|QA_team|50|Remark|245|Revise_Log|130|Last_update|115")
With Tables("scheduling")
Dim i As Integer
i = .FindRow("Cupstate <> '已完成' And Cup_readydate < #" & Cdate(Date.Today) & "# and Cup_readydate is not null " )
If i >= 0 Then
Forms("Updating").show
End If
End With
End Select
MainTable = Tables("scheduling")
Tables("scheduling").Sort = "排单顺序"
End If