📄 cghzrycx.pas
字号:
begin
bjhgsjEdit.Enabled:=True;
bjhgsjDate.Enabled:=True;
end
else
begin
bjhgsjEdit.Enabled:=False;
bjhgsjDate.Enabled:=False;
end;
end;
procedure TcghzrycxForm.bzrqCheckClick(Sender: TObject);
begin
if bzrqCheck.Checked then
begin
bzrqEdit.Enabled:=True;
bzrqDate.Enabled:=True;
end
else
begin
bzrqEdit.Enabled:=False;
bzrqDate.Enabled:=False;
end;
end;
procedure TcghzrycxForm.shrqCheckClick(Sender: TObject);
begin
if shrqCheck.Checked then
begin
shrqEdit.Enabled:=True;
shrqDate.Enabled:=True;
end
else
begin
shrqEdit.Enabled:=False;
shrqDate.Enabled:=False;
end;
end;
procedure TcghzrycxForm.pzrqCheckClick(Sender: TObject);
begin
if pzrqCheck.Checked then
begin
pzrqEdit.Enabled:=True;
pzrqDate.Enabled:=True;
end
else
begin
pzrqEdit.Enabled:=False;
pzrqDate.Enabled:=False;
end;
end;
procedure TcghzrycxForm.cgfsCheckClick(Sender: TObject);
begin
if cgfsCheck.Checked then
cgfsCombo.Enabled:=True
else
cgfsCOmbo.Enabled:=False;
end;
procedure TcghzrycxForm.jhyCheckClick(Sender: TObject);
begin
if jhyCheck.Checked then
jhyEdit.Enabled:=True
else
jhyEdit.Enabled:=False;
end;
procedure TcghzrycxForm.BitBtn1Click(Sender: TObject);
var strwhere,strCondition:string;
I:integer;
strlist:array[0..21]of string;
begin
for i:=0 to 21 do
strlist[I]:='';
strCondition:='';
strwhere:=' where ';
if sqbidCheck.Checked then
strlist[0]:='sqbid'+' like '+''''+sqbidedit.Text+'%'+'''';
if rwmcCheck.Checked then
strlist[1]:='rwmc'+' like '+''''+rwmcedit.Text+'%'+'''';
if yxnxCheck.Checked then
strlist[2]:='yxnx'+' like '+''''+yxnxedit.Text+'%'+'''';
if lshCheck.Checked then
strlist[3]:='lsh'+' like '+''''+lshedit.Text+'%'+'''';
if bzrcheck.Checked then
strlist[4]:='bzr'+' like '+''''+bzrCombo.Text+'%'+'''';
if pzrCheck.Checked then
strlist[5]:=' pzr like '+''''+pzrCombo.Text+'%'+'''';
if shrcheck.Checked then
strlist[6]:=' shr like '+''''+shrCombo.text+'%'+'''';
if sqdwcheck.Checked then
strlist[7]:=' sbdw like '+''''+sqdwCombo.Text+'%'+'''';
if sqrqCheck.Checked then
strlist[8]:=' sbrq like '+''''+sqinputForm.Getdate709(sqsjedit.Text)+'%'+'''';
if cpmcCheck.Checked then
strlist[9]:='cpmc'+' like '+''''+cpmcedit.Text+'%'+'''';
if cpbhCheck.Checked then
strlist[10]:='cpbh'+' like '+''''+cpbhCombo.text+'%'+'''';
if xhggCheck.Checked then
strlist[11]:='xhgg'+' like '+''''+xhggedit.Text+'%'+'''';
if hgfczfCheck.Checked then
if hgfczfCombo.text='合格' then
strlist[12]:='hg_flag ='+'1'
else
strlist[12]:='hg_flag ='+'0';
if sjcgcjCheck.Checked then
strlist[13]:='sjcgsccj'+' like '+''''+sjcgcjedit.Text+'%'+'''';
if cgfsCheck.Checked then
strlist[14]:='cgfs'+' like '+''''+cgfsCombo.Text+'%'+'''';
if jhyCheck.Checked then
strlist[15]:='jhy'+' like '+''''+jhyedit.Text+'%'+'''';
if ycdhsjCheck.Checked then
strlist[16]:=' ycdhsj >= '+''''+sqinputForm.Getdate709(ycdhsjedit.Text)+'''';
if bjsjCheck.Checked then
strlist[17]:=' bjsj like '+''''+sqinputForm.Getdate709(bjsjedit.Text)+'%'+'''';
if bzrqCheck.Checked then
strlist[18]:=' bzrq like '+''''+sqinputForm.Getdate709(bzrqedit.Text)+'%'+'''';
if shrqCheck.Checked then
strlist[19]:=' shrq like '+''''+sqinputForm.Getdate709(shrqedit.Text)+'%'+'''';
if pzrqCheck.Checked then
strlist[20]:=' pzrq like '+''''+sqinputForm.Getdate709(pzrqedit.Text)+'%'+'''';
if bjhgsjCheck.Checked then
strlist[21]:=' bjhgsj like '+''''+sqinputForm.Getdate709(bjhgsjedit.Text)+'%'+'''';
for I:=0 to 21 do
if (strlist[I]<>'') then
begin
if (strCondition<>'') then
strCondition:=strCondition+' and '+strlist[I]
else
strCondition:=strCondition+strlist[I];
end;
hzglbSelect:='select SQBID as 申请表单号,RWMC as 任务名称,YXNX as 有效年限,LSH as 流水号,CPBH as 产品编号,CPMC as 产品名称,xHGG as 型号规格,SLDW as 计量单位,SBRQ as 申请日期,SBSL as 申报数量,KCSL as 库存数量,';
hzglbSelect:=hzglbSelect+'SXSL as 需采购数量,GJJE as 估计金额,sccj as 申请指定厂家,SJCGSCCJ as 实际采购厂家,YBJSL as 已报检数量,CGSLHS as 采购数量核实,BJHGSJ as 报检合格时间,YSBX1 as 用于何任务,SJYQ as 时间要求,YCDHSJ as 预测到货时间,BJSJ as 报检时间,';
hzglbSelect:=hzglbSelect+'BJHGSL as 报检合格数量,BJBHGSL as 报检不合格数量,XQDW as 申报部门,BZR as 申请表编制人,BZRQ as 编制日期,SHR as 申请表审核人,SHRQ as 审核时间,PZR as 申请表批准人,PZRQ as 批准时间,CGFS as 采购方式,HG_FLAG as 合格分承制方,'+'JHY as 计划员,QT as 到货说明,BZ as 备注';
if strCondition='' then
begin
showmessage('请您选择并给出一个查询条件后,再执行查询!');
exit;
end
else
begin
cghzbForm.condition:=strCondition;
strwhere:=strwhere+strCondition;
with Datamodule1 do
begin
with hzglquery do
begin
try
SQL.clear;
close;
sql.Add(hzglbselect);
SQL.add(' from dbo.a_cghzglb ');
sql.add(strwhere);
sql.Text:=sql.Text+'order by 申请表单号 desc';
open;
for I:=0 to datamodule1.hzglquery.Fields.Count-1 do
if visible_flag_array[I]=1 then
datamodule1.hzglquery.Fields[I].Visible:=false;
except
on EDBEngineError do
messageDlg('您操作有误!',mtInformation,[mbOK],0);
end;
end;
end;
end;
cghzrycxForm.Close;
cghzbForm.TotalTable_Count(strwhere);
cghzbForm.ybjsl_count;
cghzbForm.bjhgsl_count;
cghzbForm.bjbhgsl_count;
cghzbForm.cgslhs_count;
cghzbForm.Record_Count;
cghzbForm.TotalMoney_Count;
cghzbForm.TotalProduct_Count;
end;
procedure TcghzrycxForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
cghzrycxForm.Release;
end;
procedure TcghzrycxForm.FormActivate(Sender: TObject);
begin
bjhgsjdate.DateTime:=date;
bjsjdate.DateTime:=date;
bzrqdate.DateTime:=date;
shrqdate.DateTime:=date;
pzrqdate.DateTime:=date;
ycdhsjdate.DateTime:=date;
sqsjdate.DateTime:=date;
with datamodule1 do
begin
with publicquery1 do
begin
//初始化部门名称和部门人员名称
close;
sql.clear;
sql.add('Select bmmc,bmfzr from dbo.e_bmmcb');
open;
first;
sqdwCombo.Items.Clear;
bzrCombo.Items.Clear;
shrCombo.Items.Clear;
pzrCombo.Items.Clear;
while not eof do
begin
sqdwCombo.Items.Add(FieldByName('bmmc').asstring);
bzrCombo.Items.Add(FieldByName('bmfzr').asstring);
shrCombo.Items.Add(FieldByName('bmfzr').asstring);
pzrCombo.Items.Add(FieldByName('bmfzr').asstring);
next;
end;
end;
end;
end;
procedure TcghzrycxForm.cpbhcomboDblClick(Sender: TObject);
begin
wzxxcxForm:=TwzxxcxForm.Create(application);
wzxxcxform.cpbhEdit.Text:=cpbhCombo.Text;
hide;
if (wzxxcxForm.ShowModal=mrOK) then
begin
cpbhCombo.Text:=wzxxcxForm.cpbhstr;
cpmcedit.Text:=wzxxcxForm.cpmcstr;
xhggedit.Text:=wzxxcxForm.xhggstr;
end;
wzxxcxForm.free;
show;
end;
procedure TcghzrycxForm.sqsjDateCloseUp(Sender: TObject);
begin
sqsjedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(sqsjDate.Date));
end;
procedure TcghzrycxForm.bjsjDateCloseUp(Sender: TObject);
begin
bjsjedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(bjsjDate.Date));
end;
procedure TcghzrycxForm.bjhgsjDateCloseUp(Sender: TObject);
begin
bjhgsjedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(bjhgsjDate.Date));
end;
procedure TcghzrycxForm.bzrqDateCloseUp(Sender: TObject);
begin
bzrqedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(bzrqDate.Date));
end;
procedure TcghzrycxForm.shrqDateCloseUp(Sender: TObject);
begin
shrqedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(shrqDate.Date));
end;
procedure TcghzrycxForm.ycdhsjDateCloseUp(Sender: TObject);
begin
ycdhsjedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(ycdhsjDate.Date));
end;
procedure TcghzrycxForm.pzrqDateCloseUp(Sender: TObject);
begin
pzrqedit.Text:=sqinputForm.ShowMeDate(sqinputForm.DateTo709str(pzrqDate.Date));
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -