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

📄 unit_pingbiaohxr.pas

📁 招投标软件代码,很有应用价值,请大家参考下哦,不明白的地方给我留言
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    cell1.ShowTopLabel(0, 0);  //不显示列标
  end;
end;

procedure TFrm_pingbiaohxr.FormCreate(Sender: TObject);
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,2);
  inherited;
  panel2.Caption:='中标候选人';
  caption:='中标候选人';
  label1.Caption:='请选择合同段';
  com_leibie.Visible:=False;
  LoadSource;
  bb_reflash.Visible:=true;
  bb_reflash.OnClick:=bb_reflashclick;
end;

procedure TFrm_pingbiaohxr.Com_ProjectChange(Sender: TObject);
var
  adoquery:tadoquery;
  i:integer;
  dw_name:string;
begin
  inherited;
  if com_zhaobiao.Text='设计' then
  begin
    if cell1.OpenFile(SPATH+'report\sheji\pingbiao\zbhxr.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
            i:=i+1;
            cell1.SetCellString(1,i,0,inttostr(i-5));
            cell1.SetCellString(2,i,0,adoquery.fieldbyname('dw_name').AsString);
            cell1.SetCellString(3,i,0,adoquery.fieldbyname('pb').AsString);
            if i<8 then
            begin
              cell1.SetCellString(4,i,0,'同意推荐为第'+mintoMax1(i-5)+'中标候选人');
            end
            else
            begin
              cell1.SetCellString(4,i,0,'----------');
            end;
            dw_name:=adoquery.fieldbyname('dw_name').AsString;
            if adoquery.fieldbyname('sj_zhongbiao').AsInteger=1 then
              cell1.SetCellString(5,i,0,'√')
            else
              cell1.SetCellString(5,i,0,'×')
          end;
          adoquery.Next;
        end;
        cell1.DeleteRow(i+1,cell1.GetRows(0)-7-(i-5),0);
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
end;

procedure TFrm_pingbiaohxr.bb_reflashclick(Sender:Tobject);
begin
  LoadSource;
end;

procedure TFrm_pingbiaohxr.Com_xmnameChange(sender:Tobject);
begin
  inherited;
  LoadSource;
end;

procedure TFrm_pingbiaohxr.Com_zhaoBiaoChange(Sender:Tobject);
begin
  inherited;
  LoadSource;
end;

procedure TFrm_pingbiaohxr.Com_GclxnameChange(Sender: TObject);
begin
  inherited;
  LoadSource;
end;

procedure TFrm_pingbiaohxr.Cell1MouseLClick(Sender: TObject; col, row,updn: Integer);
var
  adoquery:tadoquery;
  zhongbiao:Integer;
  bd_name:string;
  i:integer;
begin
  if updn=0 then exit;
  if (com_zhaobiao.Text='施工') or (com_zhaobiao.Text='监理') then
  begin
    if (cell1.GetCurrentCol<>5) or (cell1.GetCurrentRow<6) or (trim(cell1.GetCellString(3,cell1.GetCurrentRow,0))='') then exit;
    if cell1.GetCellString(5,cell1.GetCurrentRow,0)='√' then
    begin
      {for i:=(((cell1.GetCurrentRow-6) div 3)*3+6) to (((cell1.GetCurrentRow-6) div 3)*3+8) do
      begin
        if i<>cell1.GetCurrentRow then  cell1.SetCellString(5,i,0,'√');
      end;}
      cell1.SetCellString(5,cell1.GetCurrentRow,0,'×');
      zhongbiao:=0;
    end
    else if cell1.GetCellString(5,cell1.GetCurrentRow,0)='×' then
    begin
      for i:=(((cell1.GetCurrentRow-6) div 3)*3+6) to (((cell1.GetCurrentRow-6) div 3)*3+8) do
      begin
        if (i<>cell1.GetCurrentRow) and (trim(cell1.GetCellString(3,i,0))<>'') then
          cell1.SetCellString(5,i,0,'×');
      end;
      cell1.SetCellString(5,cell1.GetCurrentRow,0,'√');
      zhongbiao:=1;
    end;
    for i:=0 to 2 do       //获得标段名称
    begin
      if cell1.GetCellString(1,cell1.GetCurrentRow-i,0)='' then
      else
      begin
        bd_name:=cell1.GetCellString(1,cell1.GetCurrentRow-i,0);
        break;
      end;
    end;
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.SQL.Text:='update bid_pingbiao set pb_zhongbiao=0 where 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(bd_name)+''') '
          +' update bid_pingbiao set pb_zhongbiao='+inttostr(zhongbiao)+' where 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(bd_name)+''') '
          +' and dw_id in (select dw_id from bid_danwei_xinxi where dw_name='''+trim(cell1.GetCellString(3,cell1.GetCurrentRow,0))+''')';
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    finally
      freeandnil(adoquery);
    end;
  end
  else if com_zhaobiao.Text='设计' then
  begin
    if (cell1.GetCurrentCol<>5) or (cell1.GetCurrentRow<6) or (trim(cell1.GetCellString(2,cell1.GetCurrentRow,0))='') then exit;
    if cell1.GetCellString(5,cell1.GetCurrentRow,0)='√' then
    begin
      {for i:=(((cell1.GetCurrentRow-6) div 3)*3+6) to (((cell1.GetCurrentRow-6) div 3)*3+8) do
      begin
        if i<>cell1.GetCurrentRow then  cell1.SetCellString(5,i,0,'√');
      end;}
      cell1.SetCellString(5,cell1.GetCurrentRow,0,'×');
      zhongbiao:=0;
    end
    else if cell1.GetCellString(5,cell1.GetCurrentRow,0)='×' then
    begin
      for i:=6 to cell1.GetRows(0)-2 do
      begin
        if (i<>cell1.GetCurrentRow) and (trim(cell1.GetCellString(2,i,0))<>'') then
          cell1.SetCellString(5,i,0,'×');
      end;
      cell1.SetCellString(5,cell1.GetCurrentRow,0,'√');
      zhongbiao:=1;
    end;
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.SQL.Text:='update bid_sj_qingbiao set sj_zhongbiao=0'
          +' where 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)+''')'
          +' update bid_sj_qingbiao set sj_zhongbiao='+inttostr(zhongbiao)
          +' where 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)
          +''') and dw_name='+quotedstr(cell1.GetCellString(2,cell1.GetCurrentRow,0));
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
end;

procedure TFrm_pingbiaohxr.Bib_PriviewClick(Sender: TObject);
begin
  cell1.SetColHidden(cell1.GetCols(0)-1,cell1.GetCols(0)-1);
  inherited;
  cell1.SetColunHidden(cell1.GetCols(0)-1,cell1.GetCols(0)-1);
end;

procedure TFrm_pingbiaohxr.BitBtn1Click(Sender: TObject);
begin
  cell1.SetColHidden(cell1.GetCols(0)-1,cell1.GetCols(0)-1);
  inherited;
  cell1.SetColunHidden(cell1.GetCols(0)-1,cell1.GetCols(0)-1);
end;

procedure TFrm_pingbiaohxr.BitBtn2Click(Sender:TObject);
begin
  inherited;
  if bopen=true then exit;
  cell1.DeleteCol(cell1.GetCols(0)-1,1,0);
  cell1.SaveFile(GetFilePath+'zbhxr.cll',1);
end;

end.

⌨️ 快捷键说明

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