⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit_pingbiaoj.pas

📁 招投标软件代码,很有应用价值,请大家参考下哦,不明白的地方给我留言
💻 PAS
字号:
unit Unit_pingbiaoj;


interface

uses
  unit_parentform,Dialogs,forms,SysUtils,DB, ADODB;

type
  TFrm_pingbiaoj = class(TFrm_ParentForm)
    procedure FormCreate(Sender: TObject);
    procedure Com_xmnameChange(sender:Tobject);
    procedure Com_zhaoBiaoChange(Sender:Tobject);
    procedure Com_GclxnameChange(Sender: TObject);
    procedure Com_projectChange(Sender: TObject);
    procedure Cell1EditFinish(Sender: TObject;var text: WideString; var approve: Integer);
    procedure bb_reflashClick(Sender: TObject);
    procedure BitBtn2Click(Sender:TObject);
    procedure LoadSource;
    procedure getbiaoduan;
  private


  end;

var
  Frm_pingbiaoj:TFrm_pingbiaoj;

implementation

uses
  unit_public,SystemObject,DataModule,DataAccessCommonShell;

procedure TFrm_pingbiaoj.GetBiaoDuan;
var
  adoquery:tadoquery;
  str:string;
  I:Integer;
begin
  com_project.Items.Clear;
  com_project.Text:='请选择';
  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_project.Items.Add(adoquery.fieldbyname('bd_name').asstring);
      adoquery.Next;
    end;
  finally
    freeandnil(adoquery);
  end;
end;


procedure TFrm_pingbiaoj.FormCreate(Sender: TObject);
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,2);
  inherited;
  panel2.Caption:='评标价';
  caption:='评标价';
  label1.Caption:='选择标段';
  panel1.Visible:=true;
  bb_reflash.Visible:=true;
  bb_reflash.OnClick:=bb_reflashClick;
  cell1.OnEditFinish:=Cell1EditFinish;
  BitBtn2.OnClick:=BitBtn2Click;
  com_leibie.Visible:=false;
  btn_xiangxi.Visible:=false;
  GetBiaoDuan;
end;

procedure TFrm_pingbiaoj.bb_reflashClick(Sender: TObject);
begin
  inherited;
  LoadSource;
end;

procedure TFrm_pingbiaoj.Com_xmnameChange(sender:Tobject);
begin
  inherited;
  GetBiaoDuan; 
end;

procedure TFrm_pingbiaoj.Com_zhaoBiaoChange(Sender:Tobject);
begin
  inherited;
  GetBiaoDuan;
end;

procedure TFrm_pingbiaoj.Com_GclxnameChange(Sender: TObject);
begin
  inherited;
  GetBiaoDuan;
end;

procedure TFrm_pingbiaoj.LoadSource;
var
  adoquery:tadoquery;
  i:Integer;
  Piancha:double;
  dw_name:string;
begin
  inherited;
  if  trim(com_zhaobiao.text)='施工' then
  begin
    if cell1.OpenFile(SPATH+'report\shigong\pingbiao\xmtbjshpbpx.cll','')<>1 then
    begin
      showmessage('文件打开错误');
      exit;
    end;
    cell1.ShowSideLabel(0, 0); //不显示行标
    cell1.ShowTopLabel(0, 0);  //不显示列标
    if com_project.ItemIndex<0 then exit;
    cell1.setcellstring(1,4,0,com_project.Text);
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.SQL.Text:='exec pb_shenhe_paixu '''+trim(com_project.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_zuizhongbj').asstring);
        cell1.setcellstring(4,i+6,0,adoquery.fieldbyname('pb_suanshubj').asstring);
        if (trim(adoquery.fieldbyname('pb_zuizhongbj').asstring)<>'') and (trim(adoquery.fieldbyname('pb_suanshubj').asstring)<>'') then
        begin
           piancha:=(trunc(1000000*(adoquery.fieldbyname('pb_suanshubj').AsFloat-adoquery.fieldbyname('pb_zuizhongbj').AsFloat)
              /adoquery.fieldbyname('pb_zuizhongbj').AsFloat))/10000 ;
           cell1.setcellstring(5,i+6,0,floattostr(piancha));

        end;
        cell1.setcellstring(6,i+6,0,adoquery.fieldbyname('pb_pingbiaoj').asstring);
        cell1.setcellstring(7,i+6,0,adoquery.fieldbyname('f').asstring);
        cell1.SetCellDouble(8,i+6,0,i+1);
        adoquery.Next;
      end;
    finally
      freeandnil(adoquery);
    end;
  end
  else if trim(com_zhaobiao.text)='监理' then
  begin
    if cell1.OpenFile(SPATH+'report\jianli\pingbiao\jlpfhz.cll','')<>1 then
    begin
      showmessage('文件打开错误');
      exit;
    end;
    cell1.setcellstring(1,4,0,com_project.Text);
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.SQL.Text:='exec Get_jl_houxuanR '''+trim(com_project.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.SetCellString(1,6+i,0,inttostr(i+1));
        cell1.SetCellString(2,i+6,0,adoquery.fieldbyname('dw_name').AsString);
        cell1.setcellstring(3,i+6,0,adoquery.fieldbyname('jishu').AsString);
        cell1.setcellstring(4,i+6,0,adoquery.fieldbyname('caiwu').AsString);
        cell1.setcellstring(5,i+6,0,adoquery.fieldbyname('total').AsString);
        cell1.setcellstring(6,i+6,0,inttostr(i+1));
        adoquery.Next;
      end;
    finally
      freeandnil(adoquery);
    end;
  end
  else if com_zhaobiao.Text='设计' then
  begin
    if cell1.OpenFile(SPATH+'report\sheji\pingbiao\zongHedf.cll','')<>1 then
    begin
      showmessage('文件打开错误');
      exit;
    end;
    cell1.ShowTopLabel(0, 0);  //不显示列标
    cell1.setcellstring(1,4,0,com_project.Text);
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.SQL.Text:='exec Get_Sj_zongHedf '''+trim(com_project.Text)+''','''+trim(xmbdgc.XM_ISBn)+''','+xmbdgc.gCLX_ID+','+xmbdgc.BDLX_ID;;
      adoquery.Open;
      dw_name:='';
      I:=5;
      if adoquery.RecordCount>0 then
      begin
        adoquery.First;
        while not adoquery.Eof do
        begin
          if dw_name=adoquery.FieldByName('dw_name').AsString then
          begin
            cell1.SetCellString(adoquery.fieldbyname('sjzj_id').AsInteger+2,i,0,
               adoquery.fieldbyname('cw_defen').AsString);
          end
          else
          begin
            i:=i+1;
            cell1.SetCellString(1,i,0,inttostr(i-5));
            cell1.SetCellString(2,i,0,adoquery.fieldbyname('dw_name').AsString);
            cell1.SetCellString(adoquery.fieldbyname('sjzj_id').AsInteger+2,i,0,
               adoquery.fieldbyname('cw_defen').AsString);
            if adoquery.fieldbyname('cw_defen').AsString<>'' then
            begin
              cell1.SetCellString(10,i,0,adoquery.fieldbyname('cw').AsString);
              cell1.SetCellString(11,i,0,adoquery.fieldbyname('pb_defen').AsString);
              cell1.SetCellString(12,i,0,adoquery.fieldbyname('pb').AsString);
            end;
            dw_name:=adoquery.fieldbyname('dw_name').AsString;
          end;
          adoquery.Next;
        end;
        cell1.DeleteRow(i+1,cell1.GetRows(0)-7-(i-5),0);
      end;
    finally
      freeandnil(adoquery);
    end;
  end;

end;

procedure TFrm_pingbiaoj.Cell1EditFinish(Sender: TObject;var text: WideString; var approve: Integer);
var
  adoquery:tadoquery;
begin
  if com_zhaobiao.Text<>'施工' then exit;
  if (cell1.GetCurrentCol<>4) or (cell1.GetCurrentRow<6) then exit;
  adoquery:=tadoquery.Create(nil);
  try
    adoquery.Close;
    adoquery.Connection:=datamodule1.ADOMainConn;
    datamodule1.ADOMainConn.BeginTrans;
    try
      adoquery.SQL.Text:='update bid_pingbiao set pb_suanshubj='''+trim(cell1.GetCellString(4,cell1.GetCurrentRow,0))
          +''',pb_pingbiaoj='''+trim(cell1.GetCellString(4,cell1.GetCurrentRow,0))+''' where dw_id in (select dw_ID from '
          +' bid_danwei_xinxi where dw_name='''+trim(cell1.GetCellString(2,cell1.GetCurrentRow,0))+''') and bd_isbn  '
          +' in (select bd_isbn  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+') and bd_name='''+trim(com_project.Text)+''')';
      adoquery.ExecSQL;
      datamodule1.ADOMainConn.CommitTrans;
    except
      datamodule1.ADOMainConn.RollbackTrans;
    end;
  finally
    freeandnil(adoquery);
  end;
end;

procedure TFrm_pingbiaoj.Com_projectChange(Sender: TObject);
begin
  inherited;
  LoadSource;
end;

procedure TFrm_pingbiaoj.BitBtn2Click(Sender:TObject);
begin
  inherited;
  if bopen=true then exit;
  if com_project.items.indexof(com_project.text)<0 then exit;
  if com_zhaobiao.Text='施工' then
  begin
    cell1.SaveFile(GetFilePath+inttostr(com_project.items.indexof(com_project.text)+1)+'_xmtbjshpbpx.cll',1);
  end
  else if com_zhaobiao.Text='监理' then
  begin
    cell1.SaveFile(GetFilePath+inttostr(com_project.items.indexof(com_project.text)+1)+'_jlpfhz.cll',1);
  end
  else if com_zhaobiao.Text='设计' then
  begin
    cell1.SaveFile(GetFilePath+inttostr(com_project.items.indexof(com_project.text)+1)+'_zongHedf.cll',1);
  end;

end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -