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

📄 u_toubiaowj.pas

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

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Buttons, StdCtrls,adodb, ComCtrls,Unit_TopParentForm;
  //Forms;

type
  Tf_Toubiaowj = class(Tfrm_TopParentForm)
    ListView1: TListView;
    bb_Add: TBitBtn;
    BitBtn1: TBitBtn;
    bb_Save: TBitBtn;
    Memo1: TMemo;
    Label3: TLabel;
    Label7: TLabel;
    Edit1: TEdit;
    SpeedButton1: TSpeedButton;
    Label1: TLabel;
    ListView2: TListView;
    Label2: TLabel;
    Edit2: TEdit;
    Com_leibie: TComboBox;
    Label6: TLabel;
    Button1: TButton;
    Label4: TLabel;
    Edit3: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Com_zhaoBiaoChange(Sender: TObject);
    procedure Com_GclxnameChange(Sender: TObject);
    procedure Com_xmnameChange(Sender: TObject);
    procedure Getlist;
    procedure BitBtn1Click(Sender: TObject);
    procedure bb_AddClick(Sender: TObject);
    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
      Selected: Boolean);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  f_Toubiaowj: Tf_Toubiaowj;

implementation

uses
   datamodule,systemobject,DataAccessCommonShell;

{$R *.dfm}

procedure Tf_Toubiaowj.FormCreate(Sender: TObject);
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
  inherited;
  panel2.caption:='投标文件';
  if com_zhaobiao.Text='施工' then
    listview1.Columns[3].Width:=50
  else
    listview1.Columns[3].Width:=0;
  getlist;
end;

procedure TF_Toubiaowj.Getlist;
var
  AListItem   : TListItem;
  adoquery:tadoquery;
  Top:string;
  i:Integer;
begin
  if com_zhaobiao.text='施工' then
  begin
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.Close;
      adoquery.SQL.Text:=' select a.dwbm_id,b.dw_name,c.bd_name,a.wj2_leibie from bid_wenjian2 a,bid_danwei_xinxi b, '
          +' bid_biaoduan_xinxi c where a.dw_id=b.dw_id and a.bd_isbn=c.bd_isbn and a.wj2_leixing=2 '
          +' and 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+')';
      adoquery.Open;
      adoquery.First;
      listview1.Items.Clear;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        alistitem:=listview1.Items.Add;
        alistitem.Caption:=adoquery.fieldbyname('dwbm_id').AsString;
        alistitem.SubItems.Add(adoquery.fieldbyname('dw_name').AsString);
        alistitem.SubItems.Add(adoquery.fieldbyname('bd_name').AsString);
        if adoquery.fieldbyname('wj2_leibie').AsString='0' then
          alistitem.SubItems.Add('')
        else
          alistitem.SubItems.Add(adoquery.fieldbyname('wj2_leibie').AsString);
        adoquery.Next;
      end;
      adoquery.Close;
      adoquery.SQL.Text:=' select b.dw_name,c.bd_name from bid_yaohao_jieguo a,bid_danwei_xinxi b,bid_biaoduan_xinxi c'
         +' where a.dw_id=b.dw_id and a.bd_isbn=c.bd_isbn and a.dw_id not in(select '
         +' dw_id from bid_wenjian2 where xmgczb_id=a.xmgczb_id and bd_isbn=a.bd_isbn and wj2_leixing=2)'
         +' and 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+')';
      adoquery.Open;
      adoquery.First;
      listview2.Items.Clear;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        alistitem:=listview2.Items.Add;
        alistitem.Caption:=adoquery.fieldbyname('dw_name').AsString;
        alistitem.SubItems.Add(adoquery.fieldbyname('bd_name').AsString);
        adoquery.Next;
      end;
    finally
      FreeAndNil(adoquery);
    end;
  end;
  if com_zhaobiao.Text='监理' then
  begin
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Close;
      adoquery.Connection:=datamodule1.ADOMainConn;
      adoquery.Close;
      adoquery.SQL.Text:=' select a.dwbm_id,b.dw_name,c.bd_name,a.wj2_leibie from bid_wenjian2 a,bid_danwei_xinxi b, '
          +' bid_biaoduan_xinxi c where a.dw_id=b.dw_id and a.bd_isbn=c.bd_isbn and a.wj2_leixing=2 '
          +' and 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+')';
      adoquery.Open;
      adoquery.First;
      listview1.Items.Clear;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        alistitem:=listview1.Items.Add;
        alistitem.Caption:=adoquery.fieldbyname('dwbm_id').AsString;
        alistitem.SubItems.Add(adoquery.fieldbyname('dw_name').AsString);
        alistitem.SubItems.Add(adoquery.fieldbyname('bd_name').AsString);
        alistitem.SubItems.Add(adoquery.fieldbyname('wj2_leibie').AsString);
        adoquery.Next;
      end;

      adoquery.Close;
      adoquery.SQL.Text:='select cs_renshu from bid_canshu_SAVE 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+') ';
      adoquery.Open;
      if adoquery.FieldByName('cs_renshu').AsString='' then
      begin
        freeandnil(adoquery);
        exit;
      end;
      top:=adoquery.FieldByName('cs_renshu').AsString;
      adoquery.Close;
      adoquery.SQL.Text:=' select top '+trim(top)+' b.dwbm_id,a.dw_name,bd_name from bid_danwei_xinxi a,'
         +' bid_wenjian2 b,bid_ys_jl c,bid_canshu_save d,bid_biaoduan_xinxi e where b.wj2_leixing=1'
         +' and a.dw_id=b.dw_id and b.dw_id=c.dw_ID  and b.xmgczb_id=d.xmgczb_id and b.bd_isbn=c.bd_isbn'
         +' and b.bd_isbn=e.bd_isbn and c.ysjl_caiwu>=ISNULL(d.CS_CAIWU_HEGE,0) AND'
         +' c.ysjl_jishu>=ISNULL(d.cs_jishu_hege,0) and c.ysjl_jingyan>=ISNULL(d.cs_jingyan_hege,0) and'
         +' (c.ysjl_caiwu+c.ysjl_jishu+c.ysjl_jingyan)>=ISNULL(d.cs_zuidixian,0) and e. 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 not in (select dw_id from bid_wenjian2 where bd_isbn=e.bd_isbn and wj2_leixing=2)'
         +' order by dwbm_id';
      adoquery.open;
      adoquery.First;
      listview2.Items.Clear;
      for i:=0 to adoquery.RecordCount-1 do
      begin
        alistitem:=listview2.Items.Add;
        alistitem.Caption:=adoquery.fieldbyname('dw_name').AsString;
        alistitem.SubItems.Add(adoquery.fieldbyname('bd_name').AsString);
        adoquery.Next;
      end;
    finally
      freeandnil(adoquery);
    end;
  end;
end;

procedure Tf_Toubiaowj.Com_zhaoBiaoChange(Sender: TObject);
begin
  inherited;
  if com_zhaobiao.Text='施工' then
    listview1.Columns[3].Width:=50
  else
    listview1.Columns[3].Width:=0;
  if (com_xmname.Items.IndexOf(com_xmname.Text)>=0)  and (com_gclxname.Items.IndexOf(com_gclxname.Text)>=0) then
     getList;
end;

procedure Tf_Toubiaowj.Com_GclxnameChange(Sender: TObject);
begin
   inherited;
   if (com_xmname.Items.IndexOf(com_xmname.Text)>=0)  and (com_zhaobiao.Items.IndexOf(com_zhaobiao.Text)>=0) then
    getList;
end;

procedure Tf_Toubiaowj.Com_xmnameChange(Sender: TObject);
begin

⌨️ 快捷键说明

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