📄 unit_qingbiao.pas
字号:
unit Unit_qingbiao;
interface
uses
unit_parentform,Dialogs,forms,SysUtils,DB, ADODB,shellAPI,windows,controls;
type
TFrm_qingbiao = class(TFrm_ParentForm)
procedure FormCreate(Sender: TObject);
procedure Com_xmnameChange(sender:Tobject);
procedure com_zhuanjianChange(Sender:Tobject);
procedure Com_zhaoBiaoChange(Sender:Tobject);
procedure Com_GclxnameChange(Sender: TObject);
procedure com_projectchange(sender:tobject);
procedure Btn_xiangxiclick(Sender:Tobject);
procedure Com_LeibieChange(Sender: TObject);
procedure Cell1MouseLClick(Sender: TObject; col, row,updn: Integer);
procedure Cell1EditFinish(Sender: TObject;var text: WideString; var approve: Integer);
procedure BitBtn2Click(Sender:TObject);
procedure Getbiaoduan;//得到表段
procedure GetInfor; // 得到检查项目
procedure LoadSource; //加载数据
procedure GetSjdwdefen(Acol,ATotal:integer;StrText:String);//根据基本分算出该单位各个检查项目得分;Atotal>=0
end;
var
Frm_qingbiao:TFrm_qingbiao;
implementation
uses
unit_public,SystemObject,DataModule,DataAccessCommonShell;
procedure tfrm_QingBiao.getbiaoduan;
var
adoquery:tadoquery;
i:Integer;
begin
com_leibie.Items.Clear;
com_leibie.Text:='请选择';
com_project.text:='请选择';
btn_xiangxi.visible:=false;
adoquery:=tadoquery.Create(nil);
try
adoquery.Close;
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.SQL.Text:='select bd_name from bid_biaoduan_xinxi where xmgczb_id in (select xmgczb_id from bid_xmgczb '
+' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
+' and zblx_id='+xmbdgc.BDLX_ID+') order by bd_bianhao';
adoquery.Open;
adoquery.First;
for i:=0 to adoquery.RecordCount-1 do
begin
com_leibie.Items.Add(adoquery.fieldbyname('bd_name').asstring);
adoquery.Next;
end;
finally
freeandnil(adoquery);
end;
end;
procedure tfrm_qingbiao.getinfor;
begin
com_project.Items.Clear;
com_project.Text:='请选择';
if trim(com_zhaobiao.Text)='施工' then
begin
com_project.Items.Add('投标报价审查');
com_project.Items.Add('复合标底计算');
com_project.items.add('复合标底综合表');
com_project.Items.Add('履约保证金一览表');
com_project.Items.Add('符合性审查');
com_project.Items.Add('项目技术审查');
end;
if trim(com_zhaobiao.Text)='监理' then
begin
com_project.Items.Add('符合性审查');
com_project.Items.Add('投标报价算术性校核');
com_project.Items.Add('详细评审');
com_project.Items.Add('技术建议书评审');
com_project.Items.Add('财务建议书评审');
end
else if trim(com_zhaobiao.Text)='设计' then
begin
com_project.Items.Add('商务和技术');
com_project.Items.Add('专家个人打分表');
com_project.Items.Add('报价清单');
com_project.Items.Add('评标价得分计算');
end;
end;
procedure TFrm_qingbiao.GetSjdwdefen(Acol,ATotal:integer;StrText:String);
var
i,j,k:integer;
min,max:Integer;
Text:string;
jieguo:double;
begin
if cell1.GetCellString(acol,5,0)='' then exit;
jieguo:=0;
k:=0;
text:='';
if Atotal=0 then//全部计算
begin
for i:=6 to cell1.GetRows(0)-2 do
begin
if (cell1.GetCellString(1,i,0)<>'') then
begin
text:=cell1.GetCellString(1,i,0);
if jieguo>0 then
cell1.SetCellString(acol+1,k,0,floattostr(jieguo));
k:=i;//记录要写入内容的单元格行数
jieguo:=0;
if trim(cell1.GetCellString(acol,i,0))<>'' then
jieguo:=strtofloat(cell1.getcellstring(acol,i,0));
end
else
begin
if trim(cell1.GetCellString(acol,i,0))<>'' then
jieguo:=jieguo+strtofloat(cell1.GetCellString(acol,i,0));
end;
end;
if jieguo>0 then
cell1.SetCellString(acol+1,k,0,floattostr(jieguo));
end
else
begin
for i:=ATotal downto 0 do
begin
if trim(cell1.GetCellString(1,i,0))<>'' then
begin
min:=i;
break;
end;
end;
for i:=atotal+1 to cell1.GetRows(0)-2 do
begin
if trim(cell1.GetCellString(1,i,0))<>'' then
begin
max:=i-1;
break;
end;
end;
for i:=min to max do
begin
if trim(cell1.GetCellString(acol,i,0))<>'' then
begin
if i=atotal then
jieguo:=jieguo+strtofloat(Strtext)
else
jieguo:=jieguo+strtofloat(cell1.GetCellString(acol,i,0));
end;
end;
if jieguo>0 then
cell1.SetCellString(acol+1,min,0,floattostr(jieguo));
end;
//计算总分
jieguo:=0;
for i:=6 to cell1.GetRows(0)-3 do
begin
if trim(cell1.GetCellString(acol,i,0))<>'' then
if (i=atotal) and (atotal>0) then
jieguo:=jieguo+strtofloat(Strtext)
else
jieguo:=jieguo+strtoFloat(cell1.GetCellString(acol,i,0));
end;
if jieguo>0 then
cell1.SetCellString(acol,19,0,floattostr(jieguo));
end;
procedure TFrm_qingbiao.FormCreate(Sender: TObject);
begin
GetItems(com_xmname,com_zhaobiao,com_gclxname,2);
inherited;
panel2.Caption:='清标';
caption:='清标';
panel1.Visible:=true;
BitBtn2.OnClick:=BitBtn2Click;
btn_xiangxi.OnClick:=btn_xiangxiclick;
com_zhuanjia.OnChange:=com_zhuanjianChange;
cell1.OnEditFinish:=Cell1EditFinish;
getinfor;
getbiaoduan;
end;
procedure TFrm_qingbiao.LoadSource;
var
adoquery:tadoquery;
i,j:integer;
iPage,irow:integer;
dPingjun:double;
begin
if com_project.Items.IndexOf(com_project.text)<0 then exit;
if com_zhaobiao.Text='施工' then
begin
if com_project.ItemIndex=0 then
begin
if cell1.OpenFile(SPATH+'report\shigong\pingbiao\tbbj.cll','')<>1 then
begin
showmessage('文件打开错误');
exit;
end;
cell1.ShowSideLabel(0, 0); //不显示行标
cell1.ShowTopLabel(0, 0); //不显示列标
cell1.SetCellString(1,4,0,com_leibie.Text);
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.SQL.Text:=' exec pb_shigong_baojiash '''+trim(com_leibie.Text)+''','''+trim(xmbdgc.XM_ISBn)
+''','+xmbdgc.gCLX_ID+','+xmbdgc.BDLX_ID;
adoquery.Open;
adoquery.First;
for I:=0 to adoquery.RecordCount-1 do
begin
cell1.SetCellDouble(1,i+6,0,i+1);
cell1.SetCellString(2,i+6,0,adoquery.fieldbyname('dw_name').AsString);
cell1.SetCellString(3,i+6,0,adoquery.fieldbyname('pb_toubiaobj').AsString);
if adoquery.fieldbyname('pb_xiuzhengbj').AsString='' then
cell1.SetCellString(4,i+6,0,'---')
else
cell1.SetCellString(4,i+6,0,adoquery.fieldbyname('pb_xiuzhengbj').AsString);
if adoquery.fieldbyname('fudu').AsFloat>0 then
cell1.SetCellString(5,i+6,0,'+'+adoquery.fieldbyname('fudu').AsString)
else if adoquery.fieldbyname('fudu').AsFloat=-100 then
cell1.SetCellString(5,i+6,0,'0')
else
cell1.SetCellString(5,i+6,0,adoquery.fieldbyname('fudu').AsString);
cell1.SetCellString(6,i+6,0,adoquery.fieldbyname('pb_zuizhongbj').AsString);
if i=0 then
cell1.SetCellString(7,i+6,0,adoquery.fieldbyname('bd_biaodi').AsString);
cell1.SetCellDouble(8,i+6,0,adoquery.fieldbyname('bizhi').asfloat);
if adoquery.fieldbyname('bizhi').AsFloat>=105 then
cell1.SetCellFontStyle(8,i+6,0,2);
adoquery.Next;
end;
finally
freeandnil(adoquery);
end;
exit;
end;
if com_project.ItemIndex=1 then
begin
if cell1.OpenFile(SPATH+'report\shigong\pingbiao\fhbd.cll','')<>1 then
begin
showmessage('文件打开错误');
exit;
end;
cell1.ShowSideLabel(0, 0); //不显示行标
cell1.ShowTopLabel(0, 0); //不显示列标
cell1.SetCellString(1,4,0,com_leibie.Text);
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.SQL.Text:='exec pb_fuhe_biaodi '''+trim(com_leibie.Text)+''','''+trim(xmbdgc.XM_ISBn)
+''','+xmbdgc.gCLX_ID+','+xmbdgc.BDLX_ID+',1';
adoquery.Open;
for i:=0 to adoquery.RecordCount-1 do
begin
cell1.SetCellDouble(1,i+6,0,i+1);
cell1.SetCellString(2,i+6,0,adoquery.fieldbyname('dw_name').AsString);
cell1.SetCellString(3,i+6,0,adoquery.fieldbyname('pb_zuizhongbj').AsString);
cell1.SetCellString(4,i+6,0,adoquery.fieldbyname('biaodi').AsString);
if trim(adoquery.fieldbyname('pb_zuizhongbj').asstring)='' then continue;
if (adoquery.fieldbyname('pb_zuizhongbj').AsFloat)/(adoquery.fieldbyname('biaodi').AsFloat)>=1.05 then
begin //超出业主标底105%
cell1.SetCellString(5,i+6,0,'X');
cell1.SetCellString(6,i+6,0,'X');
cell1.SetCellString(7,i+6,0,'X');
cell1.SetCellString(8,i+6,0,'X');
cell1.SetCellString(9,i+6,0,'X');
cell1.SetCellString(10,i+6,0,'X');
end
else
begin
cell1.SetCellString(5,i+6,0,adoquery.fieldbyname('n').AsString);
cell1.SetCellString(6,i+6,0,adoquery.fieldbyname('d').AsString);
cell1.SetCellString(7,i+6,0,adoquery.fieldbyname('p').AsString+'%');
cell1.SetCellString(8,i+6,0,adoquery.fieldbyname('f1').AsString);
cell1.SetCellString(9,i+6,0,adoquery.fieldbyname('id').AsString);
cell1.SetCellString(10,i+6,0,adoquery.fieldbyname('h').AsString);
end;
adoquery.Next;
end;
finally
freeandnil(adoquery);
end;
exit;
end;
if com_project.ItemIndex=2 then
begin
if cell1.OpenFile(SPATH+'report\shigong\pingbiao\fhbdzh.cll','')<>1 then
begin
showmessage('文件打开错误');
exit;
end;
cell1.ShowSideLabel(0, 0); //不显示行标
cell1.ShowTopLabel(0, 0); //不显示列标
cell1.SetCellString(1,4,0,com_leibie.Text);
adoquery:=tadoquery.Create(nil);
try
adoquery.Connection:=datamodule1.ADOMainConn;
adoquery.SQL.Text:='exec pb_fuhe_biaodi '''+trim(com_leibie.Text)+''','''+trim(xmbdgc.XM_ISBn)
+''','+xmbdgc.gCLX_ID+','+xmbdgc.BDLX_ID+',2';
adoquery.Open;
for i:=0 to adoquery.RecordCount-1 do
begin
cell1.SetCellDouble(1,i+6,0,i+1);
cell1.SetCellString(2,i+6,0,adoquery.fieldbyname('dw_name').AsString);
cell1.SetCellString(3,i+6,0,adoquery.fieldbyname('pb_zuizhongbj').AsString);
cell1.SetCellString(4,i+6,0,adoquery.fieldbyname('biaodi').AsString);
if trim(adoquery.fieldbyname('pb_zuizhongbj').asstring)='' then continue;
if (adoquery.fieldbyname('pb_zuizhongbj').AsFloat)/(adoquery.fieldbyname('biaodi').AsFloat)>=1.05 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -