📄 frmpj.frm
字号:
Exit Sub
End If
If Adodc1.Recordset.EOF Then
Else
If Option2.Value Then
ph = Trim(DataGrid1.Columns(4).Value)
Unload frmzxczp
frmzxczp.Show
frmzxczp.Move 0, 0, 11890, 7465
Sql = "select * from xdgl_zxczpzb where zxlph='" & ph & "'"
If RS.State Then
RS.Close
End If
Call Open_link
Set RS = ZHCX.Execute(Sql, 0)
If Not RS.EOF Then
frmzxczp.Combo1.Text = Trim(RS("npyj"))
frmzxczp.Text1.Text = Trim(RS("jkbh"))
frmzxczp.Text3.Text = Trim(RS("czrw"))
frmzxczp.Text2.Text = Trim(RS("bz"))
If IsNull(RS("zxqk")) Then
frmzxczp.DataGrid1.AllowAddNew = False
frmzxczp.DataGrid1.AllowDelete = False
frmzxczp.DataGrid1.AllowUpdate = True
frmzxczp.DataGrid1.AllowArrows = False
Else
frmzxczp.Command1.Enabled = False
frmzxczp.Command2.Enabled = True
frmzxczp.Command3.Enabled = True
frmzxczp.DataGrid1.AllowAddNew = False
frmzxczp.DataGrid1.AllowDelete = False
frmzxczp.DataGrid1.AllowUpdate = False
frmzxczp.DataGrid1.AllowArrows = False
End If
End If
frmzxczp.Command1.Enabled = False
frmzxczp.Command5.Enabled = True
frmzxczp.Label3.Caption = ph
frmzxczp.Adodc1.RecordSource = "select * from xdgl_zxczpfb where zxlph='" & ph & "'"
frmzxczp.Adodc1.Refresh
frmzxczp.Adodc1.Recordset.MoveLast
Call frmzxczp.sx
If RS.State Then
RS.Close
End If
Call Close_link
Else
ph = DataGrid1.Columns(1).Value
Unload frmzhczp
frmzhczp.Show
frmzhczp.Move 0, 0, 11890, 7465
Sql = "select * from xdgl_zhczpzb where zlph='" & ph & "'"
If RS.State Then
RS.Close
End If
Call Open_link
Set RS = ZHCX.Execute(Sql, 0)
If Not RS.EOF Then
frmzhczp.Combo1.Text = Trim(RS("npyj"))
frmzhczp.Text1.Text = Trim(RS("npjtxm"))
frmzhczp.Combo2.Text = Trim(RS("czdw"))
frmzhczp.Text2.Text = Trim(RS("bz"))
frmzhczp.Text4.Text = Trim(RS("czrw"))
If IsNull(RS("zxjg")) Then
frmzhczp.DataGrid1.AllowAddNew = False
frmzhczp.DataGrid1.AllowDelete = False
frmzhczp.DataGrid1.AllowUpdate = True
frmzhczp.DataGrid1.AllowArrows = False
Else
frmzhczp.Command1.Enabled = False
frmzhczp.Command2.Enabled = True
frmzhczp.Command3.Enabled = True
frmzhczp.DataGrid1.AllowAddNew = False
frmzhczp.DataGrid1.AllowDelete = False
frmzhczp.DataGrid1.AllowUpdate = False
frmzhczp.DataGrid1.AllowArrows = False
End If
End If
frmzhczp.Command1.Enabled = False
frmzhczp.Command5.Enabled = True
frmzhczp.Label2.Caption = ph
If RS.State Then
RS.Close
End If
Call Close_link
frmzhczp.Adodc1.RecordSource = "select * from xdgl_zhczpfb where zlph='" & ph & "'"
frmzhczp.Adodc1.Refresh
frmzhczp.Adodc1.Recordset.MoveLast
Call frmzhczp.sx
End If
If Err Then Err.Clear
End If
End Sub
Private Sub Command5_Click()
On Error Resume Next
Dim ph As String
If Option4.Value Then
Call MsgBox("不能对未执行的票进行操作!", vbOKOnly, "警告")
Exit Sub
End If
If Adodc1.Recordset.EOF Then
Else
A = MsgBox("是否将该记录评价为不合格!", vbYesNo, "提示")
If A <> 6 Then
Exit Sub
End If
Call Open_link
If Option2.Value Then
ph = Trim(DataGrid1.Columns(4).Value)
Sql = "select * from xdgl_zxczpzb where zxlph='" & ph & "'"
If RS.State Then
RS.Close
End If
Set RS = ZHCX.Execute(Sql, 1)
If RS.EOF Then
Call MsgBox("选定的记录不存在,请查询记录是否正确!", vbOKOnly, "警告")
Call Close_link
Exit Sub
Else
If RS.State Then
RS.Close
End If
Sql = "update xdgl_zxczpzb set pjqk='不合格' where zxlph='" & ph & "'"
Set RS = ZHCX.Execute(Sql, 1)
End If
If RS.State Then
RS.Close
End If
Adodc1.Refresh
Call cx
Else
ph = Trim(DataGrid1.Columns(1).Value)
Sql = "select * from xdgl_zhczpzb where zlph='" & ph & "'"
If RS.State Then
RS.Close
End If
Set RS = ZHCX.Execute(Sql, 1)
If RS.EOF Then
Call MsgBox("选定的记录不存在,请查询记录是否正确!", vbOKOnly, "警告")
Call Close_link
Exit Sub
Else
If RS.State Then
RS.Close
End If
Sql = "update xdgl_zhczpzb set pjjg='不合格' where zlph='" & ph & "'"
Set RS = ZHCX.Execute(Sql, 1)
End If
If RS.State Then
RS.Close
End If
Adodc1.Refresh
Call sx
End If
Call Close_link
End If
End Sub
Private Sub DataGrid1_DblClick()
Call Command1_Click
End Sub
Private Sub DTPicker1_Change()
Call DTPicker2_Change
End Sub
Private Sub DTPicker2_Change()
Combo1.Text = ""
Combo2.Clear
Call Open_link
If Option1.Value Then
If Option3.Value Then
Adodc1.RecordSource = "select * from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and zxjg='已执行' "
Else
Adodc1.RecordSource = "select * from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and ((zxjg is null) or zxjg='作废')"
End If
Adodc1.Refresh
Call sx
Else
If Option3.Value Then
Adodc1.RecordSource = "select * from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and zxqk='已执行'"
Else
Adodc1.RecordSource = "select * from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and ((zxqk is null) or zxqk='作废')"
End If
Adodc1.Refresh
Call cx
End If
Set RS = ZHCX.Execute(Adodc1.RecordSource, 0)
Do While Not RS.EOF
If Option1.Value Then
If Not IsNull(RS("zlph")) Then
Combo2.AddItem RS("zlph")
End If
Else
If Not IsNull(RS("zxlph")) Then
Combo2.AddItem RS("zxlph")
End If
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Combo2.Text = ""
Call sx
Call Close_link
End Sub
Private Sub Form_Load()
On Error Resume Next
Adodc1.ConnectionString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
DTPicker1.Value = Format(Now, "yyyy-mm-01")
DTPicker2.Value = DateAdd("d", -1, DateAdd("m", 1, Format(Now, "yyyy-mm-01")))
If Option1.Value Then
plx = "xdgl_zhczpzb"
plx_1 = "zlph"
plx_2 = "rq"
Else
plx = "xdgl_zxczpzb"
plx_1 = "zxlph"
plx_2 = "scsj"
End If
Combo1.Clear
Combo2.Clear
Call Open_link
' sql1 = "select sbmc from xdgl_sblx where sblx='厂站' or sblx='单位名称'"
' Set RS = ZHCX.Execute(sql1, 0)
' Do While Not RS.EOF
' If Not IsNull(RS(0)) Then
' Combo1.AddItem Trim(RS(0))
' End If
' RS.MoveNext
' Loop
' If RS.State Then
' RS.Close
' End If
If Option1.Value Then
sql1 = "select distinct czdw from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
Else
sql1 = "select distinct czdw from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
End If
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo1.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
sql1 = "select " & plx_1 & " from " & plx & " where " & plx_2 & " between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "'"
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo2.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Adodc1.RecordSource = "select * from " & plx & " where " & plx_2 & " between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "'"
Adodc1.Refresh
If Option1.Value Then
Call sx
Else
Call cx
End If
Call Close_link
End Sub
Sub sx()
DataGrid1.Columns(0).Visible = False
DataGrid1.Columns(1).Caption = "票号"
DataGrid1.Columns(1).Width = 1600
DataGrid1.Columns(2).Visible = False
DataGrid1.Columns(3).Visible = False
DataGrid1.Columns(4).Caption = "评价情况"
DataGrid1.Columns(4).Width = 1600
DataGrid1.Columns(5).Visible = False
DataGrid1.Columns(6).Visible = False
DataGrid1.Columns(7).Caption = "操作任务"
DataGrid1.Columns(7).Width = 4000
DataGrid1.Columns(8).Visible = False
DataGrid1.Columns(9).Visible = False
DataGrid1.Columns(10).Visible = False
DataGrid1.Columns(11).Visible = False
End Sub
Sub cx()
DataGrid1.Columns(0).Visible = False
DataGrid1.Columns(1).Visible = False
DataGrid1.Columns(2).Visible = False
DataGrid1.Columns(3).Visible = False
DataGrid1.Columns(4).Caption = "票号"
DataGrid1.Columns(4).Width = 1600
DataGrid1.Columns(5).Visible = False
DataGrid1.Columns(6).Caption = "评价情况"
DataGrid1.Columns(6).Width = 1600
DataGrid1.Columns(7).Caption = "操作任务"
DataGrid1.Columns(7).Width = 4000
DataGrid1.Columns(8).Visible = False
DataGrid1.Columns(9).Visible = False
DataGrid1.Columns(10).Visible = False
DataGrid1.Columns(11).Visible = False
DataGrid1.Columns(12).Visible = False
End Sub
Private Sub Option1_Click()
If Option1.Value Then
If Option3.Value Then
Adodc1.RecordSource = "select * from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and zxjg='已执行' "
Else
Adodc1.RecordSource = "select * from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and ((zxjg is null) or zxjg='作废') "
End If
Adodc1.Refresh
Call sx
Else
If Option3.Value Then
Adodc1.RecordSource = "select * from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and zxqk='已执行'"
Else
Adodc1.RecordSource = "select * from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' and ((zxqk is null) or zxqk='作废')"
End If
Adodc1.Refresh
Call cx
End If
Call Open_link
Combo1.Clear
If Option1.Value Then
sql1 = "select distinct czdw from xdgl_zhczpzb where rq between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
Else
sql1 = "select distinct czdw from xdgl_zxczpzb where scsj between '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
End If
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo1.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Call Close_link
End Sub
Private Sub Option2_Click()
Call Option1_Click
End Sub
Private Sub Option3_Click()
Call Option1_Click
End Sub
Private Sub Option4_Click()
Call Option1_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -