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

📄 bos_qmchybill.cls

📁 金蝶地磅称重插件
💻 CLS
📖 第 1 页 / 共 5 页
字号:
                       m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fresult='不合格' where finterid=" & rs!Fbillno_yd
                   End If
                 Else
                    Set Rs1 = m_ListInterface.K3Lib.GetData("select Fnote from t_ST_QM_WLDentry where fnote='不合格' and finterid=" & rs!Fbillno_yd & " and finterid_hx=0")
                    If Rs1.EOF Then
                       m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fresult='合格' where finterid=" & rs!Fbillno_yd
                   End If
                 End If
               End If
          End If
       End If
    End If
    Exit Sub
Errhandle:
    MsgBox err.Description, vbCritical, "金蝶提示"
End Sub


Private Sub m_ListInterface_UnMultiCheck(ByVal lCheckMode As Long, ByVal lCheckMaxLevel As Long, ByVal lBusinessLevel As Long, ByVal lCheckStatus As Long, ByVal lLastCheckFrom As Long, ByVal lLastCheckTo As Long, bSendMessage As Boolean, Cancel As Boolean)
    ''驳回审核时触发
    On Error GoTo Errhandle
    ''一级审核驳回时
    If lCheckMode = 0 And lBusinessLevel = lCheckMaxLevel And lCheckStatus = GetCheckLevel(lCheckMaxLevel) Then
       Dim D As Dictionary
       Set D = m_ListInterface.GetCurrentSelRowInfo()
       Set Rs_Chy = m_ListInterface.K3Lib.GetData("select fbillno_yd,fqmstyle from t_ST_QM_Hxd where finterid=" & D.GetValue("FInterID"))
       
       ''如果为收料检验(2),委外入库(4),运输协议(7),其他检验(9),委外出库(8)
       If Rs_Chy!Fbillno_yd <> "" And (Rs_Chy!Fqmstyle = "2" Or Rs_Chy!Fqmstyle = "4" Or Rs_Chy!Fqmstyle = "7" Or Rs_Chy!Fqmstyle = "8" Or Rs_Chy!Fqmstyle = "9") Then
        Set rs = m_ListInterface.K3Lib.GetData("select t1.fStatus,t2.FBillNo_yd from t_ST_QM_Hxd t1 left join t_ST_QM_Bmd t2 on t1.FBillNo_yd=t2.FInterId where t1.fInterId=" & D.GetValue("FInterID"))
        If rs.RecordCount > 0 Then
           If rs!Fstatus = 0 Then
              ''更新检验单FBillNo_Hx字段
              m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLD set FBillNo_Hx=0,FChBillerid=0,FChcheckid=0 where finterid=" & rs!Fbillno_yd
              
              ''删除对应物理检验单的化学检验结果
              m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLDEntry set fvalue_wl=0,FInterId_hx=0 where finterid=" & rs!Fbillno_yd & " and FInterId_hx=" & D.GetValue("FInterID")
           End If
           If rs!Fstatus = 1 Then
              MsgBox "该单据已经作废,不允许驳回审核!", , "金蝶提示"
              Cancel = True
              Exit Sub
           End If
           If rs!Fstatus = 2 Then
              MsgBox "该单据已经引用,不允许驳回审核!", , "金蝶提示"
              Cancel = True
              Exit Sub
           End If
        End If
       End If
       
       ''----------------------------------------------------------------------------------------------------------
       ''如果为调拔检斤(3),工艺检斤(5),成品入库检斤(6)
       If Rs_Chy!Fbillno_yd <> "" And (Rs_Chy!Fqmstyle = "3" Or Rs_Chy!Fqmstyle = "5" Or Rs_Chy!Fqmstyle = "6") Then
        Set rs = m_ListInterface.K3Lib.GetData("select t1.fStatus,t1.FBillNo_yd from t_ST_QM_Hxd t1 where t1.fInterId=" & D.GetValue("FInterID"))
        If rs.RecordCount > 0 Then
           If rs!Fstatus = 0 Then
              ''更新检验单FBillNo_Hx字段
              m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLD set FBillNo_Hx=0,FChBillerid=0,FChcheckid=0  where finterid=" & rs!Fbillno_yd
              
              ''删除对应物理检验单的化学检验结果
              m_ListInterface.K3Lib.UpdateData "update t_ST_QM_WLDEntry set fvalue_wl=0,FInterId_hx=0 where finterid=" & rs!Fbillno_yd & " and FInterId_hx=" & D.GetValue("FInterID")
           End If
           If rs!Fstatus = 1 Then
              MsgBox "该单据已经作废,不允许驳回审核!", , "金蝶提示"
              Cancel = True
              Exit Sub
           End If
           If rs!Fstatus = 2 Then
              MsgBox "该单据已经引用,不允许驳回审核!", , "金蝶提示"
              Cancel = True
              Exit Sub
           End If
        End If
       End If
    End If
    Exit Sub
Errhandle:
    MsgBox err.Description, vbCritical, "金蝶提示"
End Sub

Private Sub m_ListInterface_MenuBarInitialize(ByVal oMenuBar As K3ClassEvents.MenuBar)
    On Error GoTo Errhandle
    Dim oTool   As K3ClassEvents.BOSTool
    Dim oBand   As K3ClassEvents.BOSBand

    '*************** 开始设置 BOS 原有菜单 ***************
    '隐藏“下推”菜单
    Set oBand = oMenuBar.BOSBands("menu")
    Set oTool = oBand.BOSTools("mnuPushBill")
    With oTool
        .Visible = False
        .Enabled = True
    End With
    
    '隐藏“上查”工具档按钮
    Set oBand = oMenuBar.BOSBands("BandToolBar")
    Set oTool = oBand.BOSTools("mnuDataViewPrvBill")
    With oTool
        .Visible = False
        .Enabled = True
    End With
 
    '隐藏“下查”工具档按钮
    Set oBand = oMenuBar.BOSBands("BandToolBar")
    Set oTool = oBand.BOSTools("mnuDataViewNextBill")
    With oTool
        .Visible = False
        .Enabled = True
    End With
    '*************** 结束设置 BOS 原有菜单 ***************

    ''根据当前操作员来判断是否显示“过滤”按钮
    ''-------------------------------------------------
    If m_ListInterface.List.ShowMode = 0 Then
       ''如果为审核人时,按原过滤条件显示
       Set rs = m_ListInterface.K3Lib.GetData("select fcheckman from ICClassMCMan where fid=110001314 and fchecklevel=1 and fcheckman=" & m_ListInterface.K3Lib.User.UserID)
       If Not rs.EOF Then
            ''显示过滤菜单和工具栏按钮
            'm_ListInterface.List.ListFilterString = "1=1"
            Set oBand = oMenuBar.BOSBands("BandToolBar")
            Set oTool = oBand.BOSTools("mnuDataFilter")
            With oTool
                .Visible = True
                .Enabled = True
            End With
            Exit Sub
          Exit Sub
       End If
       
       ''如果为制单人时,按原过滤条件显示,否则不能看到化学检验单
       Set rs = m_ListInterface.K3Lib.GetData("select fbillerid from t_ST_QM_Hxd where fbillerid=" & m_ListInterface.K3Lib.User.UserID)
       If rs.EOF Then
            ''锁定过滤菜单和工具栏按钮
            m_ListInterface.List.ListFilterString = "1=2"
            Set oBand = oMenuBar.BOSBands("BandToolBar")
            Set oTool = oBand.BOSTools("mnuDataFilter")
            With oTool
                .Visible = False
                .Enabled = False
            End With
            Exit Sub
        Else
            ''显示过滤菜单和工具栏按钮
            'm_ListInterface.List.ListFilterString = "1=1"
            Set oBand = oMenuBar.BOSBands("BandToolBar")
            Set oTool = oBand.BOSTools("mnuDataFilter")
            With oTool
                .Visible = True
                .Enabled = True
            End With
            Exit Sub
       End If
    End If
    ''-------------------------------------------------
    Exit Sub
Errhandle:
    MsgBox err.Description, vbCritical, "金蝶提示"
End Sub

''单据作废按钮触发该过程
Sub DropBills(Drop_BillId As Long)
    On Error GoTo Errhandle
    If Drop_BillId <> 0 Then
            Select Case CStr(m_BillInterface.GetFieldValue("FQmStyle"))
                   Case "1"  '销售出库
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.RefreshBill
                   Case "2"  '外购入库
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Bmd set fstatus=0 where finterid=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "3"  '调拔
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fstatus=0,fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "4"  '委外入库
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fstatus=0,fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "5"  '生产领料
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Bmd set fstatus=0 where finterid=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "6"  '成品入库
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fstatus=0,fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "7"  '运输协议
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fstatus=0,fbillno_hx=0 where fbillno_hx=(select fbillno_yd from t_ST_QM_Hxd where finterid=" & Drop_BillId & ")"
                         m_BillInterface.RefreshBill
                   Case "8"  '委外出库
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_Hxd set fjystyle='作废',fstatus=1 where finterid=" & Drop_BillId
                         m_BillInterface.K3Lib.UpdateData "update t_ST_QM_WLD set fstatus=0,fbillno_hx=0 where fbillno_hx=(select fbillno_

⌨️ 快捷键说明

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