📄 u_zigeyspsbg.pas
字号:
alistitem:=listview1.Items.Add;
alistitem.Caption:='资格预审资审评分-'+inttostr(i);
end;
end;
for i:=1 to bdsl do
begin
if fileexists(GetFilePath+inttostr(i)+'_pfmx.cll') then
begin
alistitem:=listview1.Items.Add;
alistitem.Caption:='评分明细-'+inttostr(i);
end;
end;
if fileexists(GetFilePath+'tgzgyssqr.cll') then
begin
alistitem:=listview1.Items.Add;
alistitem.Caption:='通过资格预审人';
end;
if fileexists(GetFilePath+'zsgzz.cll') then
begin
alistitem:=listview1.Items.Add;
alistitem.Caption:='资格预审评审工作组名单';
end;
end;
end;
procedure Tf_zigeyspsbg.Com_zhaobiaoChange(Sender:TObject);
begin
inherited;
LoadFilename;
end;
procedure Tf_zigeyspsbg.Com_xmnameChange(Sender:TObject);
begin
inherited;
LoadFilename;
end;
procedure Tf_zigeyspsbg.Com_GclxnameChange(Sender: TObject);
begin
inherited;
LoadFilename;
end;
procedure Tf_zigeyspsbg.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key in ['0'..'9'] then
else exit;
end;
procedure Tf_zigeyspsbg.FormCreate(Sender: TObject);
begin
GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
inherited;
panel2.Caption:='资格预审评审报告';
LoadFilename;
end;
procedure Tf_zigeyspsbg.bb_SaveClick(Sender: TObject);
var
i,j,k:integer;
isheet,iName:integer;//记录页码 ,附表名称
i1,i2,i3,i4,i5:Integer;
sName:string;
cell1:tcell;
begin
isheet:=strtoint(edit1.Text);
iName:=strtoint(Edit2.TEXT)-1;
i1:=1;
i2:=1;
i3:=1;
i4:=1;
i5:=1;
cell1:=tcell.Create(nil);
try
for i:=0 to listview1.Items.Count-1 do
begin
Cell1.OpenFile(OpenFilePath(listview1.Items[i].Caption),'');
//设置附表
if com_zhaobiao.Text='施工' then
begin
if listview1.Items[I].Caption='资审申请人' then
begin
iname:=iname+1;
sname:='附表'+inttostr(iname);
end;
if pos('资格预审符合性检查',listview1.Items[I].Caption)>0 then
begin
if i1=1 then iname:=iname+1;
if (listview1.Items[I].Caption='资格预审符合性检查-无类别') then
sname:='附表'+inttostr(iname)
else
begin
sname:='附表'+inttostr(iname)+'-'+inttostr(i1);
end;
i1:=i1+1;
end;
if pos('资格预审强制性检查',listview1.Items[I].Caption)>0 then
begin
if i2=1 then iname:=iname+1;
if (listview1.Items[I].Caption='资格预审强制性检查-无类别') then
sname:='附表'+inttostr(iname)
else
begin
sname:='附表'+inttostr(iname)+'-'+inttostr(i2);
end;
i2:=i2+1;
end;
if pos('资格预审资审评分',listview1.Items[I].Caption)>0 then
begin
if i3=1 then iname:=iname+1;
if (listview1.Items[I].Caption='资格预审资审评分-无类别') then
sname:='附表'+inttostr(iname)
else
begin
sname:='附表'+inttostr(iname)+'-'+inttostr(i3);
end;
i3:=i3+1;
end;
if pos('评分明细',listview1.Items[I].Caption)>0 then
begin
if i4=1 then iname:=iname+1;
if (listview1.Items[I].Caption='评分明细-无类别') then
sname:='附表'+inttostr(iname)
else
begin
sname:='附表'+inttostr(iname)+'-'+inttostr(i4);
end;
i4:=i4+1;
end;
if pos('通过资格预审人',listview1.Items[I].Caption)>0 then
begin
if i5=1 then iname:=iname+1;
if (listview1.Items[I].Caption='通过资格预审人-无类别') then
sname:='附表'+inttostr(iname)
else
begin
sname:='附表'+inttostr(iname)+'-'+inttostr(i5);
end;
i5:=i5+1;
end;
if listview1.Items[I].Caption='资格预审评审工作组名单' then
begin
//iname:=iname+1;
sname:='';//'附表'+inttostr(iname);
end;
end;
if com_zhaobiao.Text='监理' then
begin
if listview1.Items[I].Caption='资审申请人' then
begin
iname:=iname+1;
sname:='附表'+inttostr(iname);
end;
if pos('资格预审符合性检查',listview1.Items[I].Caption)>0 then
begin
if i1=1 then iname:=iname+1;
sname:='附表'+inttostr(iname)+'-'+inttostr(i1);
i1:=i1+1;
end;
if pos('资格预审强制性检查',listview1.Items[I].Caption)>0 then
begin
if i2=1 then iname:=iname+1;
sname:='附表'+inttostr(iname)+'-'+inttostr(i2);
i2:=i2+1;
end;
if pos('资格预审资审评分',listview1.Items[I].Caption)>0 then
begin
if i3=1 then iname:=iname+1;
sname:='附表'+inttostr(iname)+'-'+inttostr(i3);
i3:=i3+1;
end;
if pos('评分明细',listview1.Items[I].Caption)>0 then
begin
if i4=1 then iname:=iname+1;
sname:='附表'+inttostr(iname)+'-'+inttostr(i4);
i4:=i4+1;
end;
if listview1.Items[I].Caption='通过资格预审人' then
begin
iname:=iname+1;
sname:='附表'+inttostr(iname);
end;
if listview1.Items[I].Caption='资格预审评审工作组名单' then
begin
//iname:=iname+1;
sname:='';//'附表'+inttostr(iname);
end;
end;
//设置页码
if cell1.GetTotalSheets=1 then
begin
cell1.SetCellString(cell1.GetCols(0)-1,4,0,sName);
if checkbox1.Checked then
begin
//设置页眉
if com_zhaobiao.text='施工' then
cell1.PrintSetHead('',
' '
+xmbdgc.XM_NAME+xmbdgc.GCLX_NAME
+' '
,'')
else
cell1.PrintSetHead('',
' '
+xmbdgc.XM_NAME
+' '
,'');
Cell1.PrintSetHeaderFont(Cell1.FindFontIndex('宋体',1),8,8,RGB(0, 0, 0));
end;
cell1.PrintSetAlign(1,1);
cell1.printsetfoot('',inttostr(isheet),'');
cell1.PrintSheet(0,0);
//cell1.PrintPreview(0,0);
isheet:=isheet+1;
end
else
begin
for j:=0 to cell1.GetTotalSheets-1 do
begin
cell1.SetCellString(cell1.GetCols(j)-1,4,j,sName+'-'+inttoStr(j+1));
if checkbox1.Checked then
begin
//设置页眉
if com_zhaobiao.text='施工' then
cell1.PrintSetHead('',
' '
+xmbdgc.XM_NAME+xmbdgc.GCLX_NAME
+' '
,'')
else
cell1.PrintSetHead('',
' '
+xmbdgc.XM_NAME
+' '
,'');
Cell1.PrintSetHeaderFont(Cell1.FindFontIndex('宋体',1),8,8,RGB(0, 0, 0));
end;
cell1.PrintSetAlign(1,1);
cell1.printsetfoot('',inttostr(isheet),'');
cell1.PrintSheet(0,j);
//cell1.PrintPreview(0,j);
isheet:=isheet+1;
end;
end;
end;
finally
freeandnil(cell1);
end;
end;
procedure Tf_zigeyspsbg.SpeedButton2Click(Sender: TObject);
var
listitem:tlistitem;
begin
inherited;
listitem:=listview2.Items.Add;
listitem.Caption:=listview1.Selected.Caption;
listview1.DeleteSelected;
end;
procedure Tf_zigeyspsbg.SpeedButton3Click(Sender: TObject);
var
listitem:tlistitem;
begin
inherited;
listitem:=listview1.Items.Add;
listitem.Caption:=listview2.Selected.Caption;
listview2.DeleteSelected;
end;
procedure Tf_zigeyspsbg.BitBtn1Click(Sender: TObject);
var
XMLFile:TXMLDocument;
RootNode,ChildNode,TempNode,TempSubNode:IXMLNode;
VCLZip: TVCLZip;
i:Integer;
begin
inherited;
if not IsExistsPath then exit;
if application.MessageBox('是否要上传该报表','请确定',MB_YESNO)<>Idyes then
exit;
if not DirectoryExists(GetFilePath) then
CreateDir(GetFilePath);
if not fileexists(GetFilePath+'Post.XML') then
begin
CopyFile(Pchar(sPath+'report\File\Post.XML'),Pchar(GetFilePath+'Post.XML'),false);
end;
MakeXmlFile(xmbdgc.XM_NAME,xmbdgc.BDLX_NAME,xmbdgc.GCLX_NAME,
GetFilePath+'Post.XML');
if fileexists(GetFilePath+'Post.zip') then
begin
DeleteFile(GetFilePath+'Post.zip');
end;
VCLZip:=TVCLZip.Create(application);
try
VCLZip.RootDir := GetFilePath;
VCLZip.ZipName := GetFilePath+'Post.zip';
XMLFile:= TXMLDocument.Create(application);
try
XMLFile.LoadFromFile(GetFilePath+'Post.XML');
RootNode := xmlFile.DocumentElement;
ChildNode:= GetChildNodeByName(RootNode, 'REPORT');
TempNode := GetChildNodeByName(ChildNode, 'ZIGEYUSHEN');
if TempNode<>Nil then
begin
TempNode.ChildNodes.Clear;
for i:=0 to listview1.Items.Count-1 do
begin
TempSubNode := TempNode.AddChild('ROW');
TempSubNode.Attributes['NAME'] := listview1.Items[i].Caption;
TempSubNode.Attributes['PATH'] := copy(OpenFilePath(listview1.Items[i].Caption),Length(GetFilePath)+1,
Length(OpenFilePath(listview1.Items[i].Caption))-Length(GetFilePath));
VCLZip.FilesList.Add(OpenFilePath(listview1.Items[i].Caption));
end;
end;
XMLFile.SaveToFile(GetFilePath+'Post.XML')
Finally
FreeAndNil(XMLFile);
end;
VCLZip.FilesList.Add(GetFilePath+'Post.xml');
VCLZip.Zip;
Finally
FreeAndNil(VCLZip);
end;
frm_up_report:=Tfrm_up_report.create(nil);
try
frm_up_report.up_id:='400';
frm_up_report.Edt_path.Text:=GetFilePath+'Post.zip';
frm_up_report.showmodal;
finally
Freeandnil(frm_up_report);
end;
end;
procedure Tf_zigeyspsbg.BitBtn2Click(Sender : TObject);
var
cell1:TCell;
begin
inherited;
cell1:=tcell.Create(nil);
try
Cell1.OpenFile(OpenFilePath(listview1.Selected.Caption),'');
cell1.PrintSetAlign(1,1);
cell1.PrintPreview(0,0);
cell1.closefile;
finally
freeandnil(cell1);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -