⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 producelistform.frm

📁 即时通讯
💻 FRM
📖 第 1 页 / 共 3 页
字号:
    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
        producedrawmaterialsingle.produceId = _
            HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
        producedrawmaterialsingle.f = 0
        producedrawmaterialsingle.show 1
    End If
End Sub

Private Sub m_produce_Click()
    If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
        producedrawmaterialform.produceId = _
            HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)
        producedrawmaterialform.show 1
        producedrawmaterialform.produceId = ""
    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"                         ' 查询
            QueryProduce
        Case "sx"                         '刷 新
            q = 0
            Call FindAllProduce
            HFG_cooperateList_SelChange
        Case "xg"                         '修改
            If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
            
                ' 操作权限判断
                ret = yhqxpd(MainForm.g_application.m_userId, Trim(str(PRODUCE_MODIFY_P)))       ' 权限判断
                
                If Not ret Then
                    MainForm.g_msgText = "该功能您无权操作!"
                    HMsgBox MainForm.g_msgText, 0, 1
                    Exit Sub
                End If
                ' 调用修改外协单窗体
            
                ProduceSingleForm.m_produceId = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11))
                ProduceSingleForm.m_operatorType = 2
                ProduceSingleForm.show 1
                ' 刷新列表
                If q = 1 Then
                    RefreshQueryList
                Else
                    Call FindAllProduce
                End If
                HFG_cooperateList_SelChange
            End If
        Case "bj"                         '报警
            Call AlartProduce
        Case "print"                         '打印
            PrintData
        Case "xz"                         '新增一条记录
            If Trim(m_productSchemeId) <> "" Then
                ProduceSingleForm.m_operatorType = 0
                ProduceSingleForm.m_productSchemeId = m_productSchemeId
                ProduceSingleForm.m_psbomId = m_psbomId
                ProduceSingleForm.m_materialNum = Me.m_materialNum
                ProduceSingleForm.psMaterialId = Me.psMaterialId
                ProduceSingleForm.show 1
                ' 刷新列表
                Me.FindAllProduce
                HFG_cooperateList_SelChange
            End If
        Case "ck"                         '查看
            If Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11)) <> "" Then
                ProduceSingleForm.m_produceId = Trim(HFG_cooperateList.TextMatrix(HFG_cooperateList.row, 11))
                ProduceSingleForm.m_operatorType = 1
                ProduceSingleForm.show 1
            End If
        Case "tc"                         '退 出
            Unload Me
    End Select
End Sub
'**************************************
'*    功 能 描 述 :查找到所有的外协生产单,并显示
'*    输 入 参 数 :无
'*    输 出 能 数 :无
'**************************************
Public Function FindAllProduce() As Boolean
    Dim ret As Boolean
    Dim currentrow As Integer                 ' 当前插入的行
    
    ret = m_dao.FindAllProduce(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("exeEmployeeName") & " ")
                HFG_cooperateList.TextMatrix(currentrow, 3) = Trim(.Fields("quantity") & " ")
                HFG_cooperateList.TextMatrix(currentrow, 4) = "¥" & Trim(.Fields("fee") & " ")
                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("produceId") & " ")
                HFG_cooperateList.TextMatrix(currentrow, 12) = Trim(.Fields("finishNum") & " ")
                If Trim(.Fields("核检合格率") & " ") = "" Then
                    HFG_cooperateList.TextMatrix(currentrow, 13) = "0.00" & "%"
                Else
                    HFG_cooperateList.TextMatrix(currentrow, 13) = Format(CDbl(Trim(.Fields("核检合格率") & " ")) * 100, "0.00") & "%"
                End If
                '<<]
                '设置数据行高度(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 AlartProduce() 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.FindAllProduce(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("exeEmployeeName"))
                HFG_cooperateList.TextMatrix(currentrow, 3) = Trim(.Fields("quantity"))
                HFG_cooperateList.TextMatrix(currentrow, 4) = "¥" & Trim(.Fields("fee"))
                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("produceId"))
                HFG_cooperateList.TextMatrix(currentrow, 12) = Trim(.Fields("finishNum"))
                If Trim(.Fields("核检合格率") & " ") = "" Then
                    HFG_cooperateList.TextMatrix(currentrow, 13) = "0.00" & "%"
                Else
                    HFG_cooperateList.TextMatrix(currentrow, 13) = Format(CDbl(Trim(.Fields("核检合格率") & " ")) * 100, "0.00") & "%"
                End If
                '<<]
                '设置数据行高度(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 QueryProduce()
    q = 1
    QueryFom.m_currentQuery = QUERY_PRODUCE
    QueryFom.m_operateType = 1
    QueryFom.show vbModal
    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.produce_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 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("exeEmployeeName"))
            HFG_cooperateList.TextMatrix(currentrow, 3) = Trim(.Fields("quantity"))
            HFG_cooperateList.TextMatrix(currentrow, 4) = "¥" & Trim(.Fields("fee"))
            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("produceId"))
            HFG_cooperateList.TextMatrix(currentrow, 12) = Trim(.Fields("finishNum"))
            If Trim(.Fields("核检合格率") & " ") = "" Then
                HFG_cooperateList.TextMatrix(currentrow, 13) = "0.00" & "%"
            Else
                HFG_cooperateList.TextMatrix(currentrow, 13) = Format(CDbl(Trim(.Fields("核检合格率") & " ")) * 100, "0.00") & "%"
            End If
            '<<]
            '设置数据行高度(Fixed)
            HFG_cooperateList.RowHeight(currentrow) = 200
     
            '动态集指针加1,同时将计数器加1(Fixed)
            .MoveNext
            currentrow = currentrow + 1
        Loop
    End With
    
    Text1.text = Trim(m_recordset.RecordCount)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -