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

📄 frmproductionman.frm

📁 企业ERP系统 采用VB+SQL2000实现。 有客户合约
💻 FRM
📖 第 1 页 / 共 4 页
字号:
    Exit Sub
errLabel:
    objDatabase.DatabaseError
    GoTo remClear
End Sub

Private Sub Form_Load()
'设置窗口大小
    FormInit Me, True
    SetObjectWH Frame1
    SetObjectWH MSHF1
    FillMshf1 ("select * from tBusinessOrderSub a ,(select distinct orderno,delivery from tBusinessOrder) b where a.orderno=b.orderno order by a.orderno")
    ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = False
    ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = False
    Initcbb txtOrderNo, "OrderNo", "tBusinessOrderSub"
    Initcbb txtSuppliersName, "SuppliersName", "tBusinessOrderSub"
    Initcbb txtSeason, "Season", "tBusinessOrderSub"
    Initcbb txtFactoryName, "FactoryName", "tBusinessOrderSub"
    InitTitle
    HookWheel Me.hwnd
End Sub
Private Sub InitTitle()
    Label3.item(4).Caption = "加工單編號"
    Label5.Caption = "供應商"
    Label11.Caption = "生產狀態"
    Label6.Caption = "季節"
    Label3.item(1).Caption = "布名"
    Label7.Caption = "布號"
    Label9.Caption = "加工廠簡稱"
    Label10.Caption = "組織規格"
    Label1.Caption = "投坯日期"
    Label8.Caption = "至"
    Label4.Caption = "交期"
    Label13.Caption = "至"
    Label2.Caption = "煮漂"
    Label14.Caption = "至"
    Label16.Caption = "絲光"
    Label17.Caption = "至"
    Label18.Caption = "磨毛"
    Label19.Caption = "至"
    Label20.Caption = "染色"
    Label21.Caption = "至"
    Label22.Caption = "印花"
    Label23.Caption = "至"
    Label24.Caption = "整理"
    Label25.Caption = "至"
    Label26.Caption = "批色辦"
    Label27.Caption = "至"
    Label12.Caption = "模糊查詢項"
    cmdFindAll.Caption = "全部 &A"
    cmdFind.Caption = "查詢 &F"
    cmdCancel.Caption = "取消 &C"
    Me.Caption = "生產進度表"
End Sub
'編輯生產進度
Private Sub EditOperatorInf()
    frmProductionProgressInfo.newItem = False
    If lngrow = 1 Then
       MsgBox "請選擇合約!", vbInformation + vbOKOnly, "提示"
       Exit Sub
    End If
    frmProductionProgressInfo.InitInfo MSHF1.TextMatrix(lngrow, 23)
    frmProductionProgressInfo.newItem = False
    frmProductionProgressInfo.Show vbModal
    ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = False
    ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = False
End Sub
'刪除生產進度
Private Sub DelOperatorInf()
    Dim strSql As String
    
    If lngrow > MSHF1.Rows - 1 Then Exit Sub
    If lngrow <= 1 Then
        MsgBox "请选中一条要删除的记录!", vbExclamation, "提示"
        Exit Sub
    End If
        On Error GoTo errHandle
    
    If MsgBox("确定要刪除?", vbQuestion + vbYesNo, "询问") = vbNo Then
        Exit Sub
    Else
        strSql = "delete from  tBusinessOrderSub where id=" & MSHF1.TextMatrix(lngrow, 23)
        objDatabase.ExecCmd strSql
        MsgBox "刪除成功!", vbInformation, "提示"
    End If
    FillMshf1 ("select * from tBusinessOrderSub a ,(select distinct orderno,delivery from tBusinessOrder) b where a.orderno=b.orderno order by a.orderno")
    ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = False
    ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = False
    Exit Sub
errHandle:

   objDatabase.DatabaseError
    
End Sub
Public Sub FillMshf1(ByVal strSql As String)
   Dim rs As ADODB.Recordset
   Dim lngrow As Long
   Dim Quantity, EmbryoAmount, ProductionQuantity, ShipmentsAmount As Integer
      Screen.MousePointer = vbHourglass
      On Error GoTo errLabel
      Set rs = New ADODB.Recordset
      With rs
        .CursorLocation = adUseClient
        .CursorType = adOpenDynamic
        .LockType = adLockOptimistic
        Set .ActiveConnection = Cn
      End With
      rs.Open strSql
      With MSHF1
          .Redraw = False
          .Rows = 2
          .Cols = 24
          .Clear
          '初始化
         .WordWrap = False
         .TextMatrix(0, 0) = "序號"
         .ColWidth(0) = 500
         .TextMatrix(0, 1) = "加工單號"
         .ColWidth(1) = 1500
         .TextMatrix(0, 2) = "加工廠單號"
         .ColWidth(2) = 1500
         .TextMatrix(0, 3) = "組織規格"
         .ColWidth(3) = 2000
         .TextMatrix(0, 4) = "交期"
         .ColWidth(4) = 1500
         .TextMatrix(0, 5) = "花色名"
         .ColWidth(5) = 1500
         .TextMatrix(0, 6) = "要貨數量"
         .ColWidth(6) = 1200
         .TextMatrix(0, 7) = "投胚數量"
         .ColWidth(7) = 1200
         .TextMatrix(0, 8) = "投胚日期"
         .ColWidth(8) = 1200
         .TextMatrix(0, 9) = "煮漂"
         .ColWidth(9) = 1200
         .TextMatrix(0, 10) = "絲光"
         .ColWidth(10) = 1200
         .TextMatrix(0, 11) = "磨毛"
         .ColWidth(11) = 1200
         .TextMatrix(0, 12) = "染色"
         .ColWidth(12) = 1200
         .TextMatrix(0, 13) = "印花"
         .ColWidth(13) = 1200
         .TextMatrix(0, 14) = "整理"
         .ColWidth(14) = 1200
         .TextMatrix(0, 15) = "批色辦"
         .ColWidth(15) = 1200
         .TextMatrix(0, 16) = "客OK"
         .ColWidth(16) = 600
         .TextMatrix(0, 17) = "查貨日期"
         .ColWidth(17) = 1200
         .TextMatrix(0, 18) = "碼單"
         .ColWidth(18) = 1200
         .TextMatrix(0, 19) = "成品數量"
         .ColWidth(19) = 1200
         .TextMatrix(0, 20) = "出貨數量"
         .ColWidth(20) = 1200
         .TextMatrix(0, 21) = "庫存"
         .ColWidth(21) = 1200
         .TextMatrix(0, 22) = "染廠名"
         .ColWidth(22) = 2500
         .TextMatrix(0, 23) = ""
         .ColWidth(23) = 0
         '.....................................................
         .Rows = rs.RecordCount + 2
         On Error Resume Next
         For lngrow = 2 To rs.RecordCount + 1
                .TextMatrix(lngrow, 0) = lngrow - 1
                .TextMatrix(lngrow, 1) = Trim$(NullValue(rs.Fields!OrderNo))
                .TextMatrix(lngrow, 2) = Trim$(NullValue(rs.Fields!FactoryNo))
                .TextMatrix(lngrow, 3) = Trim$(NullValue(rs.Fields!Composition))
                .TextMatrix(lngrow, 4) = Trim$(NullValue(rs.Fields!Delivery))
                .TextMatrix(lngrow, 5) = Trim$(NullValue(rs.Fields!LayoutColor))
                .TextMatrix(lngrow, 6) = Trim$(NullValue(rs.Fields!Quantity))
                .TextMatrix(lngrow, 7) = Trim$(NullValue(rs.Fields!EmbryoAmount))
                .TextMatrix(lngrow, 8) = Trim$(NullValue(rs.Fields!EmbryoDate))
                .TextMatrix(lngrow, 9) = Trim$(NullValue(rs.Fields!ItemDate1))
                .TextMatrix(lngrow, 10) = Trim$(NullValue(rs.Fields!ItemDate2))
                .TextMatrix(lngrow, 11) = Trim$(NullValue(rs.Fields!ItemDate3))
                .TextMatrix(lngrow, 12) = Trim$(NullValue(rs.Fields!ItemDate4))
                .TextMatrix(lngrow, 13) = Trim$(NullValue(rs.Fields!ItemDate5))
                .TextMatrix(lngrow, 14) = Trim$(NullValue(rs.Fields!ItemDate6))
                .TextMatrix(lngrow, 15) = Trim$(NullValue(rs.Fields!ItemDate7))
                .TextMatrix(lngrow, 16) = IIf(NullValue(rs.Fields!Labdip) = False, "No", "Ok")
                .TextMatrix(lngrow, 17) = Trim$(NullValue(rs.Fields!ReportDate))
                .TextMatrix(lngrow, 18) = Trim$(NullValue(rs.Fields!CodeAmount))
                .TextMatrix(lngrow, 19) = Trim$(NullValue(rs.Fields!ProductionQuantity))
                .TextMatrix(lngrow, 20) = Trim$(NullValue(rs.Fields!ShipmentsAmount))
                .TextMatrix(lngrow, 21) = Trim$(NullValue(rs.Fields!StockAmount))
                .TextMatrix(lngrow, 22) = Trim$(NullValue(rs.Fields!FactoryName))
                .TextMatrix(lngrow, 23) = Trim$(NullValue(rs.Fields!ID))
                Quantity = Quantity + rs.Fields!Quantity
                EmbryoAmount = EmbryoAmount + rs.Fields!EmbryoAmount
                ProductionQuantity = ProductionQuantity + rs.Fields!ProductionQuantity
                ShipmentsAmount = ShipmentsAmount + rs.Fields!ShipmentsAmount
                rs.MoveNext
          Next
          lngrow = 0
          .TextMatrix(1, 0) = "总计"
          .TextMatrix(1, 1) = .Rows - 2
          .TextMatrix(1, 6) = Quantity
          .TextMatrix(1, 7) = EmbryoAmount
          .TextMatrix(1, 19) = ProductionQuantity
          .TextMatrix(1, 20) = ShipmentsAmount
          .row = 1
          .col = 1
          .CellBackColor = &HFFFFC0
          .col = 6
          .CellBackColor = &HFFFFC0
          .col = 7
          .CellBackColor = &HFFFFC0
          .col = 19
          .CellBackColor = &HFFFFC0
          .col = 20
          .CellBackColor = &HFFFFC0
           SetItemBackColor MSHF1
           .Redraw = True
      End With
      rs.Close
remClear:
    Set rs = Nothing
    Screen.MousePointer = vbDefault
    Exit Sub
errLabel:
    On Error Resume Next
    MSHF1.Redraw = True
    GoTo remClear
End Sub

Private Sub MSHF1_Click()
    lngrow = Val(MSHF1.row)
    If lngrow <= 1 Then
        MSHF1.Sort = 1
    Else
       MSHF1.row = lngrow
       MSHF1.col = 0
       MSHF1.ColSel = MSHF1.Cols - 1
    End If
        ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = True
        ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = True
End Sub

Private Sub MSHF1_DblClick()
   EditOperatorInf
End Sub



Private Sub MSHF1_RowColChange()
   If MSHF1.col = 7 Then
       frmProductionProgressEmbry.FillMshf2 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressEmbry.Show vbModal
   End If
   If MSHF1.col = 9 Then
       frmProductionProgressItemDate1.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate1.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate1.Show vbModal
   End If
   If MSHF1.col = 10 Then
       frmProductionProgressItemDate2.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate2.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate2.Show vbModal
   End If
   If MSHF1.col = 11 Then
       frmProductionProgressItemDate3.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate3.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate3.Show vbModal
   End If
   If MSHF1.col = 12 Then
       frmProductionProgressItemDate4.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate4.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate4.Show vbModal
   End If
   If MSHF1.col = 13 Then
       frmProductionProgressItemDate5.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate5.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate5.Show vbModal
   End If
   If MSHF1.col = 14 Then
       frmProductionProgressItemDate6.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate6.txtOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressItemDate6.Show vbModal
   End If
   If MSHF1.col = 19 Then
       frmProductionProgressProcess.m_nOrderNo = MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressProcess.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionProgressProcess.Show vbModal
   End If
   If MSHF1.col = 20 Then
       frmProductionSummaryShipment.ReadCustomerPurveyInf MSHF1.TextMatrix(MSHF1.row, 1)
       frmProductionSummaryShipment.Show vbModal
   End If
End Sub

⌨️ 快捷键说明

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