📄 frmphclerkmx.frm
字号:
Set cn = env.OpenConnection(dsname:="odbc_api_demo", Prompt:="rdodriverprompt", ReadOnly:=False, Connect:=d_conn)
'''''''
Combo1.AddItem "设计员"
Combo1.AddItem "操作员"
Combo1.AddItem "业务员"
Combo1.AddItem "签单人"
Combo1.AddItem "欠款审核"
Combo1.AddItem "负责人"
'''''''
MSFlex1.BackColorBkg = RGB(255, 255, 255)
MSFlex1.BackColorFixed = RGB(238, 236, 218)
errmsg:
If Err.Number <> 0 Then
Exit Sub
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
mX = X
mY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
frmPHClerkMX.Move frmPHClerkMX.Left - mX + X, frmPHClerkMX.Top - mY + Y
End If
Picture5.Cls
Picture6.Cls
End Sub
Private Sub Form_Paint()
'''''商品编号'''
jframe.danum = 3
jframe.rtop = 50
jframe.rleft = 35
jframe.rright = 659
jframe.rbottom = 97
jframe.ddraw frmPHClerkMX
''''''''
jframe.danum = 3
jframe.rtop = 102
jframe.rleft = 35
jframe.rright = 659
jframe.rbottom = 420
jframe.ddraw frmPHClerkMX
End Sub
Private Sub Image1_Click()
Unload Me
End Sub
Private Sub Image2_Click()
frmPHClerkMX.WindowState = 1
End Sub
Private Sub Mask1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{tab}"
End If
End Sub
Private Sub Mask2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
SendKeys "{tab}"
End If
End Sub
Private Sub MSFlex1_DblClick()
On Error GoTo errmsg
If Trim(Combo1.Text) = "操作员" Then
JTflagh = 3
Dim JTPRtext As String
'JTPRtext = ListView1.SelectedItem.SubItems(1)
sql = "select * from JTPRtable where 喷绘序列='" & Trim(MSFlex1.TextArray(MSFlex1.Row * MSFlex1.Cols + 2)) & "' and 日期='" & Trim(MSFlex1.TextArray(MSFlex1.Row * MSFlex1.Cols + 1)) & "'"
'MsgBox sql
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
JTPRtableText(0) = Trim(result("日期"))
JTPRtableText(1) = Trim(result("喷绘序列"))
JTPRtableText(2) = Trim(result("总面积"))
JTPRtableText(3) = Trim(result("布料号"))
JTPRtableText(4) = Trim(result("幅宽"))
JTPRtableText(5) = Trim(result("原有长度"))
JTPRtableText(6) = Trim(result("实际用布长度"))
JTPRtableText(7) = Trim(result("实际用布面积"))
JTPRtableText(8) = Trim(result("剩余长度"))
JTPRtableText(9) = Trim(result("操作员"))
End If
sql = "select * from JTSEtable where 喷绘序列='" & Trim(MSFlex1.TextArray(MSFlex1.Row * MSFlex1.Cols + 2)) & "' and 日期='" & Trim(MSFlex1.TextArray(MSFlex1.Row * MSFlex1.Cols + 1)) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
JTSErows = result.RowCount
result.MoveFirst
End If
i = 1
If result.RowCount <> 0 Then
Do While Not result.EOF()
JTSEtableText1(i) = Trim(result("文件号"))
JTSEtableText2(i) = Trim(result("画面规格"))
JTSEtableText3(i) = Trim(result("设计员"))
JTSEtableText4(i) = Trim(result("负责人"))
result.MoveNext
i = i + 1
Loop
End If
frmPHJiTaiIn.Show
errmsg:
JTflagh = 4
JTPRtableText(0) = "2002年03月11日"
JTPRtableText(1) = "20310001" 'Trim(result("喷绘序列"))
JTPRtableText(2) = "68" 'Trim(result("总面积"))
JTPRtableText(3) = "wa010001" 'Trim(result("布料号"))
JTPRtableText(4) = "21" 'Trim(result("幅宽"))
JTPRtableText(5) = "12" 'Trim(result("原有长度"))
JTPRtableText(6) = "12" 'Trim(result("实际用布长度"))
JTPRtableText(7) = "252" 'Trim(result("实际用布面积"))
JTPRtableText(8) = "0" 'Trim(result("剩余长度"))
JTPRtableText(9) = "" 'Trim(result("操作员"))
'''
JTSErows = 3
i = 1
JTSEtableText1(i) = "13151a"
JTSEtableText2(i) = "7*8"
JTSEtableText3(i) = "fffff"
JTSEtableText4(i) = "33ewee"
i = 2
JTSEtableText1(i) = "13151b"
JTSEtableText2(i) = "3*4"
JTSEtableText3(i) = "wwwww"
JTSEtableText4(i) = "rddddd"
frmPHJiTaiIn.Show
End If
End Sub
Private Sub Picture5_Click()
'''''''
On Error GoTo errmsg
Dim datel As String
Dim datel1 As String
''''''记录信息的变量,根据客户名称查询YWPRtable得到合同号'''
datel = Mid(Mask1.Text, 1, 4) & "年" & Trim(Mid(Mask1.Text, 5, 2)) & "月" & Trim(Mid(Mask1.Text, 7, 2)) & "日"
datel1 = Mid(Mask2.Text, 1, 4) & "年" & Trim(Mid(Mask2.Text, 5, 2)) & "月" & Trim(Mid(Mask2.Text, 7, 2)) & "日"
'''''''查询条件1'''
If Mask1.Text <> "" And Trim(Combo1.Text) <> "" And Trim(Combo2.Text) <> "" Then
'''''''
MSFlex1.Clear
If Trim(Combo1.Text) = "设计员" Then
'MsgBox "dddd"
'''布置电子表格'''''''
MSFlex1.Cols = 5
MSFlex1.FormatString = "^ 设计员 |^ 日 期 |^ 合同数 |^ 画面数 |^ 平米数 "
'End If
''''
If Mask2.Text = "" Then
If Trim(Combo2.Text) <> "所有" Then
sql = "select distinct 设计员 from JTSEtable where 日期='" & Trim(datel) & "' and 设计员='" & Trim(Combo2.Text) & "'"
Else
sql = "select distinct 设计员 from JTSEtable where 日期='" & Trim(datel) & "'"
End If
Else
If Trim(Combo2.Text) <> "所有" Then
sql = "select distinct 设计员 from JTSEtable where 日期>='" & Trim(datel) & "' and 日期<='" & Trim(datel1) & "' and 设计员='" & Trim(Combo2.Text) & "'"
Else
sql = "select distinct 设计员 from JTSEtable where 日期>='" & Trim(datel) & "' and 日期<='" & Trim(datel1) & "'"
End If
End If
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
MSFlex1.Rows = result.RowCount + 2
result.MoveFirst
End If
'''''显示设计员名称'''''''''''
If result.RowCount <> 0 Then
i = 1
Do While Not result.EOF()
MSFlex1.TextArray(i * MSFlex1.Cols) = Trim(result("设计员"))
MSFlex1.TextArray(i * MSFlex1.Cols + 1) = Trim(datel)
result.MoveNext
i = i + 1
Loop
End If
''''''''计算平米数和画面数 ''''''''
For i = 1 To MSFlex1.Rows - 2
sql = "select * from JTSEtable where 日期='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols + 1)) & "' and 设计员='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols)) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
MSFlex1.TextArray(i * MSFlex1.Cols + 3) = result.RowCount
result.MoveFirst
End If
RecordHJ = 0
If result.RowCount <> 0 Then
Do While Not result.EOF()
RecordHJ = RecordHJ + Mid(result("画面规格"), 1, InStr(result("画面规格"), "*") - 1) * Mid(result("画面规格"), (InStr(result("画面规格"), "*") + 1), Len(result("画面规格")) - InStr(result("画面规格"), "*"))
result.MoveNext
Loop
End If
MSFlex1.TextArray(i * MSFlex1.Cols + 4) = RecordHJ
Next i
''''查询JTSEtable表,得到记录个数
sql = "select * from JTSEtable where 日期='" & Trim(datel) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
Records = result.RowCount
result.MoveFirst
End If
''''''存储记录到数组中''''
ReDim RecordDate(Records) As String
ReDim RecordHThao(Records) As String
ReDim RecordDesigner(Records) As String
If result.RowCount <> 0 Then
i = 0
Do While Not result.EOF()
RecordDate(i) = Trim(result("日期"))
RecordHThao(i) = Mid(Trim(result("文件号")), 1, 5)
RecordDesigner(i) = Trim(result("设计员"))
result.MoveNext
i = i + 1
Loop
End If
'''''删除临时表CouHTnumbers''''
sql = "delete from CouHTnumbers"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
For i = 1 To MSFlex1.Rows - 2
sql = "insert into CouHTnumbers(日期,设计员,合同号) values('" & Trim(RecordDate(i - 1)) & "','" & Trim(RecordDesigner(i - 1)) & "','" & Trim(RecordHThao(i - 1)) & "')"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
Next i
''''''查询合同数''''''
For i = 1 To MSFlex1.Rows - 2
sql = "select distinct 合同号 from CouHTnumbers where 日期='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols + 1)) & "' and 设计员='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols)) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
MSFlex1.TextArray(i * MSFlex1.Cols + 2) = result.RowCount
End If
Next i
'''''''计算合计''''
For i = 0 To 3
HJ(i) = 0
Next i
For i = 1 To MSFlex1.Rows - 2
HJ(0) = HJ(0) + Val(MSFlex1.TextArray(i * MSFlex1.Cols + 2))
HJ(1) = HJ(1) + Val(MSFlex1.TextArray(i * MSFlex1.Cols + 3))
HJ(2) = HJ(2) + Val(MSFlex1.TextArray(i * MSFlex1.Cols + 4))
Next i
MSFlex1.TextArray((MSFlex1.Rows - 1) * MSFlex1.Cols) = "合计:"
MSFlex1.TextArray((MSFlex1.Rows - 1) * MSFlex1.Cols + 2) = HJ(0)
MSFlex1.TextArray((MSFlex1.Rows - 1) * MSFlex1.Cols + 3) = HJ(1)
MSFlex1.TextArray((MSFlex1.Rows - 1) * MSFlex1.Cols + 4) = HJ(2)
ElseIf Trim(Combo1.Text) = "负责人" Then
'MsgBox "ssss"
'''布置电子表格'''''''
MSFlex1.Cols = 5
MSFlex1.FormatString = "^ 负责人 |^ 日 期 |^ 合同数 |^ 画面数 |^ 平米数 "
If Trim(Combo2.Text) <> "所有" Then
sql = "select distinct 负责人 from JTSEtable where 日期='" & Trim(datel) & "' and 负责人='" & Trim(Combo2.Text) & "'"
Else
sql = "select distinct 负责人 from JTSEtable where 日期='" & Trim(datel) & "'"
End If
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
MSFlex1.Rows = result.RowCount + 2
result.MoveFirst
End If
'''''显示设计员名称'''''''''''
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -