📄 frmproductionsummary.frm
字号:
Private Sub InitTitle()
' Label1.Caption = "下單日期"
' ' Label10.Caption = "至"
' ' CmdConfirm.Caption = "確定"
' CmdReset.Caption = "取消"
Label3.item(4).Caption = "加工單編號"
Label5.Caption = "下單公司"
Label11.Caption = "簽發者"
Label6.Caption = "業務員"
Label3.item(1).Caption = "布名"
Label7.Caption = "布號"
Label9.Caption = "加工廠簡稱"
Label2.Caption = "船頭辦"
Label1.Caption = "下單日期"
Label8.Caption = "至"
Label4.Caption = "交期"
Label13.Caption = "至"
Label12.Caption = "模糊查詢項"
cmdFindAll.Caption = "全部 &A"
cmdFind.Caption = "查詢 &F"
cmdCancel.Caption = "取消 &C"
Me.Caption = "生產匯總表"
End Sub
'編輯坯布合約
Private Sub EditOperatorInf()
frmProductionSummaryInfo.newItem = False
If lngrow = 1 Then
MsgBox "請選擇合約!", vbInformation + vbOKOnly, "提示"
Exit Sub
End If
frmProductionSummaryInfo.InitInfo MSHF1.TextMatrix(lngrow, 26)
frmProductionSummaryInfo.newItem = False
frmProductionSummaryInfo.Show vbModal
ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = False
ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = False
ActiveBar21.Bands("toolbar").Tools.item("cmdView").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 tBusinessOrder where id=" & MSHF1.TextMatrix(lngrow, 26)
objDatabase.ExecCmd strSql
MsgBox "刪除成功!", vbInformation, "提示"
End If
FillMshf1 ("select * from tBusinessOrder a ,(select orderno,Labdip,LateDate,Composition,LayoutColor,ReportDate,SuppliersName,EmbryoAmount,ProductionState,ProductionQuantity,season,UlkColor,UlkQuality,UlkLayout,Report,MtlResult,Price,ShipmentsAmount from tBusinessOrderSub) b where a.orderno=b.orderno")
ActiveBar21.Bands("toolbar").Tools.item("cmdDel").Enabled = False
ActiveBar21.Bands("toolbar").Tools.item("cmdEdit").Enabled = False
ActiveBar21.Bands("toolbar").Tools.item("cmdView").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 = 27
.Clear
'初始化
.WordWrap = False
.TextMatrix(0, 0) = "序號"
.ColWidth(0) = 500
.TextMatrix(0, 1) = "下單日期"
.ColWidth(1) = 1200
.TextMatrix(0, 2) = "加工单號"
.ColWidth(2) = 1200
.TextMatrix(0, 3) = "工廠"
.ColWidth(3) = 1500
.TextMatrix(0, 4) = "組織規格"
.ColWidth(4) = 2000
.TextMatrix(0, 5) = "布名"
.ColWidth(5) = 2000
.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) = "S/O"
.ColWidth(11) = 1000
.TextMatrix(0, 12) = "坯布供應商"
.ColWidth(12) = 2000
.TextMatrix(0, 13) = "投坯數量"
.ColWidth(13) = 1200
.TextMatrix(0, 14) = "生產進度"
.ColWidth(14) = 800
.TextMatrix(0, 15) = "成品數量"
.ColWidth(15) = 1200
.TextMatrix(0, 16) = "ULK COLOR"
.ColWidth(16) = 800
.TextMatrix(0, 17) = "ULK QULITY"
.ColWidth(17) = 800
.TextMatrix(0, 18) = "ULK LAYOUT"
.ColWidth(18) = 800
.TextMatrix(0, 19) = "查貨報告"
.ColWidth(19) = 2500
.TextMatrix(0, 20) = "測試"
.ColWidth(20) = 1000
.TextMatrix(0, 21) = "價格"
.ColWidth(21) = 1200
.TextMatrix(0, 22) = "出貨"
.ColWidth(22) = 1200
.TextMatrix(0, 23) = "工廠單號"
.ColWidth(23) = 1000
.TextMatrix(0, 24) = "下單公司"
.ColWidth(24) = 1500
.TextMatrix(0, 25) = "交貨季節"
.ColWidth(25) = 1500
.TextMatrix(0, 26) = ""
.ColWidth(26) = 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!Founddate))
.TextMatrix(lngrow, 2) = Trim$(NullValue(rs.Fields!OrderNo))
.TextMatrix(lngrow, 3) = Trim$(NullValue(rs.Fields!FactoryName))
.TextMatrix(lngrow, 4) = Trim$(NullValue(rs.Fields!Composition))
.TextMatrix(lngrow, 5) = Trim$(NullValue(rs.Fields!FabricName))
.TextMatrix(lngrow, 6) = Trim$(NullValue(rs.Fields!Width))
.TextMatrix(lngrow, 7) = Trim$(NullValue(rs.Fields!LayoutColor))
.TextMatrix(lngrow, 8) = FormatDateStr(NullValue(rs.Fields!Delivery), "")
.TextMatrix(lngrow, 9) = FormatDateStr(NullValue(rs.Fields!ReportDate), "")
.TextMatrix(lngrow, 10) = Trim$(NullValue(rs.Fields!Quantity))
.TextMatrix(lngrow, 11) = IIf(NullValue(rs.Fields!Labdip), "ok", "No") & "," & FormatDateStr(NullValue(rs.Fields!LateDate), "")
.TextMatrix(lngrow, 12) = Trim$(NullValue(rs.Fields!SuppliersName))
.TextMatrix(lngrow, 13) = Trim$(NullValue(rs.Fields!EmbryoAmount))
.TextMatrix(lngrow, 14) = Trim$(NullValue(rs.Fields!ProductionState))
.TextMatrix(lngrow, 15) = Trim$(NullValue(rs.Fields!ProductionQuantity))
.TextMatrix(lngrow, 16) = Trim$(NullValue(rs.Fields!UlkColor))
.TextMatrix(lngrow, 17) = Trim$(NullValue(rs.Fields!UlkQuality))
.TextMatrix(lngrow, 18) = Trim$(NullValue(rs.Fields!UlkLayout))
.TextMatrix(lngrow, 19) = Trim$(NullValue(rs.Fields!Report))
.TextMatrix(lngrow, 20) = IIf(NullValue(rs.Fields!MtlResult) = False, "No", "Ok")
.TextMatrix(lngrow, 21) = Trim$(NullValue(rs.Fields!Price))
.TextMatrix(lngrow, 22) = NullValue(rs.Fields!ShipmentsAmount)
.TextMatrix(lngrow, 23) = Trim$(NullValue(rs.Fields!FactoryNo))
.TextMatrix(lngrow, 24) = Trim$(NullValue(rs.Fields!CompanyName))
.TextMatrix(lngrow, 25) = Trim$(NullValue(rs.Fields!Season))
.TextMatrix(lngrow, 26) = 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, 10) = Quantity
.TextMatrix(1, 13) = EmbryoAmount
.TextMatrix(1, 15) = ProductionQuantity
.TextMatrix(1, 22) = ShipmentsAmount
.row = 1
.col = 1
.CellBackColor = &HFFFFC0
.col = 10
.CellBackColor = &HFFFFC0
.col = 13
.CellBackColor = &HFFFFC0
.col = 15
.CellBackColor = &HFFFFC0
.col = 22
.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
ActiveBar21.Bands("toolbar").Tools.item("cmdView").Enabled = True
End Sub
Private Sub MSHF1_DblClick()
'EditOperatorInf
frmProductionProgress.FillMshf1 ("select * from tBusinessOrderSub a, (select distinct Delivery,orderno,FoundDate from tBusinessOrder where OrderNo='" & MSHF1.TextMatrix(lngrow, 2) & "') b where a.orderno=b.orderno")
frmProductionProgress.Show
'Unload Me
End Sub
Private Sub MSHF1_RowColChange()
If MSHF1.col = 2 Then
Dim rs As New ADODB.Recordset
rs.Open "select top 1 id from tBusinessOrderSub where OrderNo='" & MSHF1.TextMatrix(MSHF1.row, 2) & "'", Cn, 1, 3
frmProductionProgressInfo.InitInfo rs.Fields!ID
rs.Close
Set rs = Nothing
frmProductionProgressInfo.newItem = False
frmProductionProgressInfo.Show vbModal
End If
If MSHF1.col = 12 Or MSHF1.col = 13 Then
frmProductionProgressEmbry.Show vbModal
frmProductionProgressEmbry.FillMshf2 MSHF1.TextMatrix(MSHF1.row, 2)
End If
If MSHF1.col = 15 Then
frmProductionProgressProcess.Show
frmProductionProgressProcess.FillMshf1 MSHF1.TextMatrix(MSHF1.row, 2)
End If
If MSHF1.col = 16 Or MSHF1.col = 17 Or MSHF1.col = 18 Then
frmProductionSummarySub.Show
frmProductionSummarySub.InitInfo (MSHF1.TextMatrix(MSHF1.row, 2))
End If
If MSHF1.col = 20 Or MSHF1.col = 19 Then
frmProductionSummaryTest.Show
frmProductionSummaryTest.InitInfo (MSHF1.TextMatrix(MSHF1.row, 2))
End If
If MSHF1.col = 22 Then
frmProductionSummaryShipment.Show
frmProductionSummaryShipment.ReadCustomerPurveyInf MSHF1.TextMatrix(MSHF1.row, 2)
End If
If MSHF1.col = 25 Then
frmProductionSummarySeason.Show
frmProductionSummarySeason.InitInfo MSHF1.TextMatrix(MSHF1.row, 2)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -