📄 cooperatelistform.frm
字号:
CooperateRedo.m_cooperateRedoID = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
CooperateRedolist.m_cooperateredoType = 0
CooperateRedo.show 1
End If
End Sub
Private Sub splb_Click()
Dim ret As Boolean
ret = yhqxpd(MainForm.g_application.m_userId, COOPERATE_COUNTERCLAIM)
If Not ret Then
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
cooperatecounterclaimlb.m_cooperateId = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
cooperatecounterclaimlb.show 1
cooperatecounterclaimlb.m_cooperateId = ""
End If
End Sub
Private Sub m_cooperateRedoList_Click()
Dim ret As Boolean
ret = yhqxpd(MainForm.g_application.m_userId, COOPERATE_REDO_LIST)
If Not ret Then
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
CooperateRedolist.m_cooperateId = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
CooperateRedolist.show 1
CooperateRedolist.m_cooperateId = ""
End If
End Sub
Private Sub m_fllb_Click()
Dim ret As Boolean
ret = yhqxpd(MainForm.g_application.m_userId, COOPERATEDROWMATERIALQD)
If Not ret Then
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
cooperatedrowmaterqdform.cooperateId = _
HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
cooperatedrowmaterqdform.show 1
cooperatedrowmaterqdform.cooperateId = ""
End If
End Sub
Private Sub m_getMaterial_Click()
Dim ret As Boolean
ret = yhqxpd(MainForm.g_application.m_userId, COOPERATEDROWMATERIALQD)
If Not ret Then
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
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)
Dim ret As Boolean
Select Case Button.Key
Case "cx" ' 查询
q = 1
QueryCooperate
Case "sx" '刷 新
q = 0
Call FindAllCooperate
HFG_cooperateList_SelChange
Case "bj" '报警
Call AlartCooperate
Case "print" '报警
PrintData
Case "xz" '新增一条记录
If Trim(m_productSchemeId) <> "" Then
CooperateSingleForm.m_operatorType = 0
CooperateSingleForm.m_productSchemeId = m_productSchemeId
CooperateSingleForm.m_materialNum = m_materialNum
CooperateSingleForm.m_psbomId = m_psbomId
CooperateSingleForm.show 1
Call FindAllCooperate
HFG_cooperateList_SelChange
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 "xg" '修改一个生产外协单资料
If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
' 操作权限判断
ret = yhqxpd(MainForm.g_application.m_userId, Trim(str(COOPERATE_MODIFY_P))) ' 权限判断
If Not ret Then
MainForm.g_msgText = "该功能您无权操作!"
HMsgBox MainForm.g_msgText, 0, 1
Exit Sub
End If
' 调用修改外协单窗体
CooperateSingleForm.m_cooperateId = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11))
CooperateSingleForm.m_operatorType = 2
CooperateSingleForm.show 1
' 刷新数据
If q = 1 Then
RefreshQueryList
Else
Call FindAllCooperate
End If
HFG_cooperateList_SelChange
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, m_supplierid, m_state)
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
Text1.text = Trim(m_recordset.RecordCount)
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, m_supplierid, m_state)
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
Text1.text = Trim(m_recordset.RecordCount)
m_recordset.Close
End Function
Private Sub T_alartDays_KeyPress(KeyAscii As Integer)
InputFieldLimit T_alartDays, 4, KeyAscii
End Sub
'**************************************
'* 功 能 描 述 :查找生产外协单
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Function QueryCooperate()
QueryFom.m_currentQuery = QUERY_COOPERATE
QueryFom.m_operateType = 1
QueryFom.show 1
' 如果此原料已有BOM记录,则调出些条BOM的信息
m_idList = MainForm.g_application.m_queryResultId
RefreshQueryList
End Function
Private Sub T_setToNum_KeyPress(KeyAscii As Integer)
InputFieldLimit T_setToNum, 5, KeyAscii
End Sub
Private Function PrintData()
' Dim Report As DataReportDemo
'
' Set Report = New DataReportDemo
'
' Report.PrintData 1
'
' Report.show 1
End Function
Private Sub RefreshQueryList()
Dim ret As Boolean
' 显示查询到的结果
On Error GoTo EXITFUN
MainForm.g_application.m_databaseCon.m_adoConnection.BeginTrans ' 开始事务
InsertQueryIdList m_idList ' 把要显示的记录ID列表插入临时表
ret = m_dao.cooperate_findByIdList(m_recordset) ' 查找记录
MainForm.g_application.m_databaseCon.m_adoConnection.CommitTrans ' 提交事务
HFG_cooperateList.clear
HFG_cooperateList.Rows = 2
RefreshListTitle
If ret Then
GetRecordToList m_recordset
End If
Text1.text = Trim(m_recordset.RecordCount)
m_recordset.Close
Exit Sub
EXITFUN:
MainForm.g_application.m_databaseCon.m_adoConnection.RollbackTrans ' 回滚事务
End Sub
'**************************************
'* 功 能 描 述 :从数据集中取出记录在列表中显示
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub GetRecordToList(recSet As ADODB.Recordset)
Dim currentrow As Integer
With recSet
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
Text1.text = Trim(recSet.RecordCount)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -