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

📄 unit_zishenr.pas

📁 招投标软件代码,很有应用价值,请大家参考下哦,不明白的地方给我留言
💻 PAS
📖 第 1 页 / 共 2 页
字号:
   inherited;
   if (Com_zhaoBiao.Items.IndexOf(Com_zhaoBiao.text)<0)
      or (Com_Gclxname.Items.IndexOf(Com_Gclxname.text)<0) then exit;
   ChooseLoadFile;
end;

procedure tfrm_zishenr.Com_zhaoBiaoChange(Sender:Tobject);
begin
   inherited;
   if (com_xmname.Items.IndexOf(com_xmname.text)<0)
      or (Com_Gclxname.Items.IndexOf(Com_Gclxname.text)<0) then exit;
   ChooseLoadFile;
end;


procedure tfrm_zishenr.Com_GclxnameChange(Sender: TObject);
begin
   inherited;
   if (com_xmname.Items.IndexOf(com_xmname.text)<0)
      or (Com_zhaoBiao.Items.IndexOf(Com_zhaoBiao.text)<0) then exit;
   ChooseLoadFile;
end;

procedure tfrm_zishenr.LoadDateSource;
var
  adoquery:TAdoquery;
  i,iPage,irow,j,leibie: Integer;
  recordcount:Integer;
  str_page:string;
begin
  if com_zhaobiao.Text='施工' then
  begin
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Close;
      adoquery.Connection:=DataModule1.ADOMainConn;
      adoquery.Close;
      adoquery.SQL.Text:='select b.dwBM_id,a.DW_name,b.wj2_leibie,b.xmgczb_id,b.wj2_duanshu from bid_danwei_xinxi a,'
                      +' bid_wenjian2 b where  b.wj2_leixing=1 and  b.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 a.dw_id=b.dw_id   '
                      +' order by b.dwbm_id ' ;
      adoquery.Open;
      recordcount:=0;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        if j<> adoquery.FieldByName('dwbm_id').AsInteger then
        begin
          recordcount:=recordcount+1;
          j:=adoquery.FieldByName('dwbm_id').AsInteger;
        end;
        adoquery.Next;
      end;
      setcellsheet(cell1,recordcount,24);
      adoquery.First;
      i:=0;
      while not adoquery.Eof do
      begin
        if recordcount=adoquery.FieldByName('dwbm_id').AsInteger then
        begin
          leibie:=adoquery.FieldByName('wj2_leibie').AsInteger;
          if leibie=1 then
          begin
            cell1.setcellstring(4,irow+6,ipage,'▲');
          end;
          if leibie=2 then
          begin
            for j:=4 to 5 do
            begin
              if trim(cell1.GetCellString(j,6,0))='二类' then
                 cell1.setcellstring(j,irow+6,ipage,'▲');
            end;
          end;
          if leibie=3 then
          begin
            for j:=4 to 6 do
            begin
              if trim(cell1.GetCellString(j,6,0))='三类' then
                 cell1.setcellstring(j,irow+6,ipage,'▲');
            end;
          end;
        end
        else
        begin
          i:=i+1;
          ipage:=i div 24;
          irow:=i mod 24;
          cell1.SetCellDouble(1,irow+6,ipage,adoquery.fieldbyname('dwbm_id').AsInteger);
          cell1.SetCellString(2,irow+6,ipage,adoquery.fieldbyname('dw_name').AsString);
          cell1.SetCellString(3,irow+6,ipage,adoquery.fieldbyname('wj2_duanshu').AsString);
          recordcount:=adoquery.FieldByName('dwbm_id').AsInteger;
          leibie:=adoquery.FieldByName('wj2_leibie').AsInteger;
          if leibie=1 then
          begin
            cell1.setcellstring(4,irow+6,ipage,'▲');
          end;
          if leibie=2 then
          begin
            for j:=4 to 5 do
            begin
              if trim(cell1.GetCellString(j,6,0))='二类' then
                 cell1.setcellstring(j,irow+6,ipage,'▲');
            end;
          end;
          if leibie=3 then
          begin
            for j:=4 to 6 do
            begin
              if trim(cell1.GetCellString(j,6,0))='三类' then
                 cell1.setcellstring(j,irow+6,ipage,'▲');
            end;
          end;
        end;
        adoquery.Next;
      end;
    finally;
      freeandnil(adoquery);
    end;
  end;
  if com_zhaobiao.Text='监理' then
  begin
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.SQL.Text:='select dwbm_id,dw_name,bd_name from (select dwbm_id,dw_Id,bd_name from bid_wenjian2 a'
        +' left join bid_biaoduan_xinxi b on a.bd_isbn=b.bd_isbn where a.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 wj2_leixing=1) '
        +' a,bid_danwei_xinxi b where a.dw_id=b.dw_id order by dwbm_id ';
      adoquery.Open;
      j:=0;
      recordcount:=0;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        if j<> adoquery.FieldByName('dwbm_id').AsInteger then
        begin
          recordcount:=recordcount+1;
          j:=adoquery.FieldByName('dwbm_id').AsInteger;
        end;
        adoquery.Next;
      end;
      setcellsheet(cell1,recordcount,24);
      adoquery.First;
      I:=0;
      while not adoquery.Eof do
      begin
        if recordcount=adoquery.FieldByName('dwbm_id').AsInteger then
        begin
          for j:=3 to cell1.GetCols(0) do
          begin
            if trim(cell1.GetCellString(j,5,0))=adoquery.FieldByName('bd_name').AsString  then
               cell1.SetCellString(j,irow+5,ipage,'√');
          end;
        end
        else
        begin
          i:=i+1;
          irow:=i mod 24;
          ipage:=i div 24;
          cell1.SetCellString(1,irow+5,ipage,adoquery.fieldbyname('dwbm_id').AsString);
          cell1.SetCellString(2,irow+5,ipage,adoquery.fieldbyname('dw_name').AsString);
          recordcount:=adoquery.FieldByName('dwbm_id').AsInteger;
          for j:=3 to cell1.GetCols(0) do
          begin
            if trim(cell1.GetCellString(j,5,0))=adoquery.FieldByName('bd_name').AsString  then
               cell1.SetCellString(j,irow+5,ipage,'√');
          end;
        end;
        adoquery.Next;
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
  cell1.SetCurSheet(0);
end;



procedure Tfrm_ZiShenR.FormCreate(Sender: TObject);
var
  sName:string;
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
  inherited;
  ecol:='';
  Caption:='资审人一览表';
  Panel2.Caption:='资审人一览表';
  chooseloadfile;
  bb_savetodata.Visible:=true;
  bb_savetodata.OnClick:=bb_savetodataclick;
  com_xmname.OnChange:=Com_xmnameChange;
  com_zhaobiao.OnChange:=Com_zhaoBiaoChange;
  com_gclxname.OnChange:=Com_GclxnameChange;
  cell1.OnMouseLClick:=Cell1MouseLClick;
  cell1.OnMouseRClick:=Cell1MouseRClick;
  BitBtn2.OnClick:=BitBtn2Click;
  btn_xiangxi.Visible:=true;
  btn_xiangxi.Left:=544;
  btn_xiangxi.Parent:=panel3;
  btn_xiangxi.top:=10;
  btn_xiangxi.caption:='载入数据';
  btn_xiangxi.OnClick:=btn_xiangxiclick;
  bb_reflash.Visible:=true;
  bb_reflash.OnClick:=bb_reflashClick;
  cell1.OnEditFinish:=Cell1EditFinish;
end;

procedure Tfrm_ZiShenR.bb_savetodataClick(Sender: TObject);
var
  adoquery:tadoquery;
  i:integer;
  sql:string;
begin
  adoquery:=tadoquery.Create(nil);
  try
    adoquery.Connection:=datamodule1.ADOMainConn;
    adoquery.Close;
    sql:='';
    for i:=7 to 30 do
    begin
      if (cell1.GetCellString(2,i,cell1.GetCurSheet)<>'') and
         (cell1.GetCellString(3,i,cell1.GetCurSheet)<>'') then
      begin
        sql:=sql+' update bid_wenjian2 set wj2_duanshu='+trim(cell1.GetCellString(3,i,cell1.GetCurSheet))
           +' where wj2_leixing=1 and dw_id in (select dw_id from bid_danwei_xinxi '
           +' where dw_name='''+trim(cell1.GetCellString(2,i,cell1.GetCurSheet))+''') ; ';
      end;
    end;
    if sql<>'' then
    begin
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.SQL.Text:=sql;
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    end;
  finally
    freeandnil(adoquery);
  end;
end;

procedure Tfrm_ZiShenR.btn_xiangxiclick(Sender:TObject);
begin
  LoadDateSource;
end;

procedure Tfrm_ZiShenR.BitBtn2Click(Sender:TObject);
begin
  inherited;
  if bOpen=true then exit;
  if com_zhaobiao.Text='施工' then
    getcellxuhao(cell1,7,24);
  if com_zhaobiao.Text='监理' then
    getcellxuhao(cell1,6,24);
  cell1.SaveFile(GetFilePath+'zgyssqr.cll',1);
  cell1.openfile(GetFilePath+'zgyssqr.cll','');
end;


end.

⌨️ 快捷键说明

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