📄 cooperatestat.frm
字号:
HFG_cooperateList.TextMatrix(0, 12) = "materialId"
'设置列对齐方式 7-右对齐 5-居中对齐 2-左对齐
HFG_cooperateList.ColAlignment(0) = 2
HFG_cooperateList.ColAlignment(1) = 2
HFG_cooperateList.ColAlignment(2) = 2
HFG_cooperateList.ColAlignment(3) = 2
HFG_cooperateList.ColAlignment(4) = 8
HFG_cooperateList.ColAlignment(5) = 8
HFG_cooperateList.ColAlignment(6) = 8
HFG_cooperateList.ColAlignment(7) = 8
HFG_cooperateList.ColAlignment(8) = 8
HFG_cooperateList.ColAlignment(9) = 8
HFG_cooperateList.ColAlignment(10) = 2
HFG_cooperateList.ColAlignment(11) = 2
HFG_cooperateList.ColAlignment(12) = 2
HFG_cooperateList.ColWidth(0) = 1
HFG_cooperateList.ColWidth(10) = 1
HFG_cooperateList.ColWidth(11) = 1
HFG_cooperateList.ColWidth(12) = 1
End Sub
Private Sub Form_Resize()
HFG_cooperateList.Height = Me.Height - 1400
HFG_cooperateList.Width = Me.Width - 350
' Image1.Stretch = False
If (HFG_cooperateList.Height > HFG_cooperateList.Height - 300) Or (HFG_cooperateList.Width > HFG_cooperateList.Width - 200) Then
HFG_cooperateList.Height = HFG_cooperateList.Height + 400
HFG_cooperateList.Width = HFG_cooperateList.Width + 200
'
' Image1.Stretch = True
End If
End Sub
Private Sub HFG_cooperateList_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If Button And vbRightButton Then ' 用户点击右键,调出快捷菜单
' PopupMenu PM_menu
' ElseIf Button And vbLeftButton Then
' HFG_cooperateList_SelChange
' End If
End Sub
'**************************************
'* 功 能 描 述 :用户选择生产单改变时间处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub HFG_cooperateList_SelChange()
'
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
T_billNum.text = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 3))
T_hadFinish.text = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 12))
T_setToNum.text = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 12))
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 10)) = "0" Then
CK_state.value = 0
Else
CK_state.value = 1
End If
End If
End Sub
Private Sub Label1_Click()
Call CallDateControl(1, Trim(T_beginDate.text))
If Len(XT_calendar.Xtfhcs) <> 0 Then
T_beginDate.text = XT_calendar.Xtfhcs ' 将日历窗体里取得的值传给建档日期的文本框
End If
End Sub
Private Sub Label6_Click()
Call CallDateControl(1, Trim(T_finishDate.text))
If Len(XT_calendar.Xtfhcs) <> 0 Then
T_finishDate.text = XT_calendar.Xtfhcs ' 将日历窗体里取得的值传给建档日期的文本框
End If
End Sub
'**************************************
'* 功 能 描 述 :查找生产计划单
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Label7_Click()
Dim ret As Boolean
QueryFom.m_currentQuery = QUERY_PRODUCTSCHEME
QueryFom.show vbModal
ret = m_productSchemeDAO.FindSchemeById(m_recordset, MainForm.g_application.m_queryResultId)
If ret Then
T_productScheme.text = Trim(m_recordset.Fields("name"))
T_productScheme.Tag = Trim(m_recordset.Fields("schemeId"))
End If
m_recordset.Close
End Sub
Private Sub m_cooperateFinish_Click()
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
CooperateFinish.m_cooperateId = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
CooperateFinish.m_cooperateType = 0
CooperateFinish.show 1
End If
End Sub
Private Sub m_cooperateFinishList_Click()
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
CooperateFinishlist.m_operateType = 1
CooperateFinishlist.m_cooperateId = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11))
CooperateFinishlist.show
CooperateFinishlist.RefreshFinishList
End If
End Sub
Private Sub m_cooperateRedo_Click()
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
CooperateRedo.m_cooperateRedoID = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
CooperateRedolist.m_cooperateredoType = 0
CooperateRedo.show 1
End If
End Sub
Private Sub m_getMaterial_Click()
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
cooperatedrowmaterForm.cooperateId = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
cooperatedrowmaterForm.f = 0
cooperatedrowmaterForm.show 1
End If
End Sub
Private Sub m_setFinishNum_Click()
If F_setFinishNum.Visible Then
F_setFinishNum.Visible = False
Else
F_setFinishNum.Visible = True
End If
End Sub
'**************************************
'* 功 能 描 述 :工具栏按钮的单击操作按钮
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "cx" ' 查询
QueryCooperate
Case "tj" '统计
CooperateStat
Case "bj" '报警
Call AlartCooperate
Case "xz" '新增一条记录
If Trim(m_productSchemeId) <> "" Then
CooperateSingleForm.m_operatorType = 0
CooperateSingleForm.m_productSchemeId = m_productSchemeId
CooperateSingleForm.m_psbomId = m_psbomId
CooperateSingleForm.show
End If
Case "ck" '查看
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
CooperateSingleForm.m_cooperateId = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11))
CooperateSingleForm.m_operatorType = 1
CooperateSingleForm.show
End If
Case "tc" '退 出
Unload Me
End Select
End Sub
'**************************************
'* 功 能 描 述 :查找到所有的外协生产单,并显示
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Public Function FindAllCooperate() As Boolean
Dim ret As Boolean
Dim currentrow As Integer ' 当前插入的行
ret = m_dao.FindAllCooperate(m_recordset, -1, m_productSchemeId, m_psbomId, "", "")
HFG_cooperateList.clear
HFG_cooperateList.Rows = 2
RefreshListTitle
If ret Then
With m_recordset
currentrow = 1
Do While Not .EOF
If currentrow > HFG_cooperateList.Rows - 1 Then
HFG_cooperateList.AddItem ""
End If
'[>>自定义填充内容
HFG_cooperateList.TextMatrix(currentrow, 0) = Trim(.Fields("psName"))
HFG_cooperateList.TextMatrix(currentrow, 1) = Trim(.Fields("bomName"))
HFG_cooperateList.TextMatrix(currentrow, 2) = Trim(.Fields("Supplier"))
HFG_cooperateList.TextMatrix(currentrow, 3) = Trim(.Fields("quantity"))
HFG_cooperateList.TextMatrix(currentrow, 4) = Trim(.Fields("quote"))
HFG_cooperateList.TextMatrix(currentrow, 5) = Trim(.Fields("totalMoney"))
HFG_cooperateList.TextMatrix(currentrow, 6) = Trim(.Fields("planBeginDate"))
HFG_cooperateList.TextMatrix(currentrow, 7) = Trim(.Fields("planFinishDate"))
HFG_cooperateList.TextMatrix(currentrow, 8) = Trim(.Fields("finishDate"))
HFG_cooperateList.TextMatrix(currentrow, 9) = Trim(.Fields("employeeName"))
HFG_cooperateList.TextMatrix(currentrow, 10) = Trim(.Fields("state"))
HFG_cooperateList.TextMatrix(currentrow, 11) = Trim(.Fields("cooperateId"))
HFG_cooperateList.TextMatrix(currentrow, 12) = Trim(.Fields("finishNum"))
'<<]
'设置数据行高度(Fixed)
HFG_cooperateList.RowHeight(currentrow) = 200
'动态集指针加1,同时将计数器加1(Fixed)
.MoveNext
currentrow = currentrow + 1
Loop
End With
End If
m_recordset.Close
End Function
'**************************************
'* 功 能 描 述 :生产外协单报警处理
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Function AlartCooperate() As Boolean
Dim ret As Boolean
Dim currentrow As Integer ' 当前插入的行
' If Trim(T_alartDays.text) = "" Then
' MainForm.g_msgText = "报警天数不能为空!请设置!"
' HMsgBox MainForm.g_msgText, 0, 1
' Exit Function
' End If
' ret = m_dao.FindAllCooperate(m_recordset, CInt(T_alartDays.text), m_productSchemeId, m_psbomId)
'
' HFG_cooperateList.clear
' HFG_cooperateList.Rows = 2
'
' RefreshListTitle
' If ret Then
' With m_recordset
' currentrow = 1
' Do While Not .EOF
' If currentrow > HFG_cooperateList.Rows - 1 Then
' HFG_cooperateList.AddItem ""
' End If
'
' '[>>自定义填充内容
' HFG_cooperateList.TextMatrix(currentrow, 0) = Trim(.Fields("psName"))
' HFG_cooperateList.TextMatrix(currentrow, 1) = Trim(.Fields("bomName"))
' HFG_cooperateList.TextMatrix(currentrow, 2) = Trim(.Fields("Supplier"))
' HFG_cooperateList.TextMatrix(currentrow, 3) = Trim(.Fields("quantity"))
' HFG_cooperateList.TextMatrix(currentrow, 4) = Trim(.Fields("quote"))
' HFG_cooperateList.TextMatrix(currentrow, 5) = Trim(.Fields("totalMoney"))
' HFG_cooperateList.TextMatrix(currentrow, 6) = Trim(.Fields("planBeginDate"))
' HFG_cooperateList.TextMatrix(currentrow, 7) = Trim(.Fields("planFinishDate"))
' HFG_cooperateList.TextMatrix(currentrow, 8) = Trim(.Fields("finishDate"))
' HFG_cooperateList.TextMatrix(currentrow, 9) = Trim(.Fields("employeeName"))
' HFG_cooperateList.TextMatrix(currentrow, 10) = Trim(.Fields("state"))
' HFG_cooperateList.TextMatrix(currentrow, 11) = Trim(.Fields("cooperateId"))
' HFG_cooperateList.TextMatrix(currentrow, 12) = Trim(.Fields("finishNum"))
' '<<]
' '设置数据行高度(Fixed)
' HFG_cooperateList.RowHeight(currentrow) = 200
'
' '动态集指针加1,同时将计数器加1(Fixed)
' .MoveNext
' currentrow = currentrow + 1
' Loop
' End With
' End If
' m_recordset.Close
End Function
Private Sub T_alartDays_KeyPress(KeyAscii As Integer)
' InputFieldLimit T_alartDays, 4, KeyAscii
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -