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

📄 unit_yaohao.pas

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

procedure TFrm_YaoHao.FormCreate(Sender: TObject);
begin
  GetItems(com_xmname,com_zhaobiao,com_gclxname,1);
  //inherited;
  caption:='摇号管理';
  panel2.Caption:='摇号管理';
  ecol:='';
  panel1.Visible:=true;
  com_project.Text:='请选择';
  com_project.Items.Clear;
  com_project.Items.Add('配号管理');
  com_project.Items.Add('摇号结果');
  com_project.Items.Add('投标人所投合同段一览表');
  btn_xiangxi.Caption:='生成序列';
  com_zhaobiao.ItemIndex:=com_zhaobiao.Items.IndexOf('施工');
  GetXmbdgc(com_xmname.text,com_zhaobiao.text,com_gclxname.text);
  com_zhaobiao.Enabled:=false;
  com_project.OnChange:=com_projectchange;
  com_xmname.OnChange:=Com_xmnameChange;
  cell1.OnMouseLClick:=cell1MouseLClick;
  cell1.OnMouseRClick:=cell1MouseRClick;
  com_zhaobiao.OnChange:=Com_zhaoBiaoChange;
  com_gclxname.OnChange:=Com_GclxnameChange;
  cell1.OnEditFinish:=cell1EditFinish;
  BTN_xiangxi.OnClick:=btn_xiangxiclick;
  com_leibie.OnChange:=com_leibiechange;
  bb_reflash.Visible:=true;
  bb_reflash.OnClick:=bb_reflashClick;
  edit1.OnKeyPress:=Edit1KeyPress;
  edit1.OnExit:=edit1exit;
  GetXmLeiBie(com_leibie);
end;

procedure TFrm_YaoHao.updateyaohao;
var
  adoquery:tadoquery;
begin
  adoquery:=tadoquery.Create(nil);
  try
    adoquery.Connection:=datamodule1.ADOMainConn;
    datamodule1.ADOMainConn.BeginTrans;
    try
      adoquery.Close;
      adoquery.SQL.text:='update bid_xmgczb set yaohao_cs='+trim(edit1.text)
         +' where xm_isbn='''+trim(xmbdgc.XM_ISBn)+''' and gclx_id='+xmbdgc.gCLX_ID
         +' and zblx_id='+xmbdgc.BDLX_ID;
      adoquery.ExecSQL;
      datamodule1.ADOMainConn.CommitTrans;
    except
      datamodule1.ADOMainConn.RollbackTrans;
    end;
  finally
    freeandnil(adoquery);
  end;
end;

procedure TFrm_YaoHao.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  if key=#13 then
  begin
    updateyaohao;
    getcol;
  end;
end;

procedure TFrm_YaoHao.Edit1Exit(Sender: TObject);
begin
   updateyaohao;
   getcol;
end;

procedure TFrm_YaoHao.com_projectchange(sender:tobject);
begin
  inherited;
  if com_project.ItemIndex=0 then
  begin
    GetXmLeibie(com_leibie);
    if (com_leibie.Items[0]<>'无类别') and (com_leibie.ItemIndex<1) then
    begin
      com_leibie.Items.Add('全部单位');
    end;
    btn_xiangxi.Caption:='生成序列';
    btn_xiangxi.Visible:=true;
    btn_xiangxi.Left:=384;
    label2.visible:=false;
    edit1.Visible:=false;
    btn_xiangxi.Enabled:=true;
    LoadDateSource;
  end
  else
  begin
    GetXmLeibie(com_leibie);
    btn_xiangxi.Caption:='载入数据';
    btn_xiangxi.Visible:=true;
    if com_project.ItemIndex=1 then
    begin
      label2.visible:=true;
      edit1.Visible:=true;
      label2.Left:=384;
      edit1.Left:=440;
      btn_xiangxi.Left:=564;
    end
    else if com_project.ItemIndex=2 then
    begin
      label2.visible:=false;
      edit1.Visible:=false;
      btn_xiangxi.Left:=384;
    end;
    getcol;
  end;
end;

procedure TFrm_YaoHao.btn_xiangxiclick(Sender:TObject);
var
  adoquery:tadoquery;
  top:string;
begin
  if com_project.ItemIndex=0 then
  begin
    if application.MessageBox('该操作将要重新加载数据,该项目后面数据将需要你再次重新录入','请确认',MB_YESNO)<>mryes then exit;
    adoquery:=tadoquery.Create(nil);
    try
      adoquery.Connection:=datamodule1.ADOMainConn;
      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;
      top:=adoquery.fieldbyname('cs_renshu').AsString;
      if top='' then
      begin
        freeandnil(adoquery);
        exit;
      end;
      datamodule1.ADOMainConn.BeginTrans;
      try
        adoquery.SQL.Text:=' delete from bid_yaohao_jieguo 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+')'
                       +' select identity(int,1,1) as id,a.dw_id,a.xmgczb_id INTO #BID_LINSHI from '
                       +' (select top '+trim(top)+' b.DW_ID,B.XMGCZB_ID'
                       +' from bid_danwei_xinxi a '
                       +' ,bid_wenjian2 b,bid_yushen_defen c,bid_canshu_save d where B.wj2_leixing=1 and a.dw_id=b.dw_id and b.dw_id=c.dw_ID '
                       +' and b.xmgczb_id=c.xmgczb_id and c.xmgczb_id=d.xmgczb_id and c.ys_caiwu>=d.CS_CAIWU_HEGE AND '
                       +' c.ys_jishu>=d.cs_jishu_hege and c.ys_jingyan>=d.cs_jingyan_hege and b.wj2_leibie=c.bd_leibie and '
                       +' (c.ys_caiwu+c.ys_jishu+c.ys_jingyan)>=d.cs_zuidixian and c.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+') group by b.dw_id,b.xmgczb_id,dw_name order by a.dw_name) A '
                       +' ; '
                       +' delete from BID_SHENQINGRHM 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 dw_id in (select dw_id from bid_wenjian2 where wj2_leixing=1 and xmgczb_id=bid_shenqingrhm.xmgczb_id) '
                       +';'
                       +' insert into bid_shenqingrhm(dw_id,xmgczb_id,sqrhm,BD_LEIBIE)'
                       +' select b.dw_id,b.xmgczb_id,id,wj2_leibie from #bid_linshi a,(select top '+trim(top)+' b.DW_ID,B.XMGCZB_ID,'
                       +'wj2_leibie from bid_danwei_xinxi a '
                       +' ,bid_wenjian2 b,bid_yushen_defen c,bid_canshu_save d where B.wj2_leixing=1 and a.dw_id=b.dw_id and b.dw_id=c.dw_ID '
                       +' and b.xmgczb_id=c.xmgczb_id and c.xmgczb_id=d.xmgczb_id and c.ys_caiwu>=d.CS_CAIWU_HEGE AND '
                       +' c.ys_jishu>=d.cs_jishu_hege and c.ys_jingyan>=d.cs_jingyan_hege and b.wj2_leibie=c.bd_leibie and '
                       +' (c.ys_caiwu+c.ys_jishu+c.ys_jingyan)>=d.cs_zuidixian and c.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 a.dw_name) b where a.dw_id=b.dw_id and a.xmgczb_id=b.xmgczb_id '
                       +'drop table #bid_Linshi ';
        adoquery.ExecSQL;
        datamodule1.ADOMainConn.CommitTrans;
      except
        datamodule1.ADOMainConn.RollbackTrans;
      end;
    finally;
      freeandnil(adoquery);
    end;
  end;
  if (com_project.items.IndexOf(com_project.Text)<0) or (com_zhaobiao.items.IndexOf(com_zhaobiao.Text)<0)
    or (com_xmname.items.IndexOf(com_xmname.Text)<0) or (com_gclxname.items.IndexOf(com_gclxname.Text)<0) then
   begin
     showmessage('信息指定不完全!');
     exit;
   end;
  LoadDateSource;
end;


procedure TFrm_YaoHao.Com_xmnameChange(sender:Tobject);
begin
  inherited;
  com_leibie.Text:='请选择类别';
  GetXmLeibie(com_leibie);
  if (com_leibie.Items[0]<>'无类别') and (com_leibie.ItemIndex<1) then
  begin
    com_leibie.Items.Add('全部单位');
  end;
  if com_project.ItemIndex=0 then
    LoadDateSource
  else
    getcol;
end;

procedure TFrm_YaoHao.Com_zhaoBiaoChange(Sender:Tobject);
begin
  inherited;
  com_leibie.Text:='请选择类别';
  GetXmLeibie(com_leibie);
  if (com_leibie.Items[0]<>'无类别') and (com_leibie.ItemIndex<1) then
  begin
    com_leibie.Items.Add('全部单位');
  end;
  if com_project.ItemIndex=0 then
    LoadDateSource
  else
    getcol;
end;

procedure TFrm_YaoHao.com_leibieChange(Sender: Tobject);
begin
  inherited;
  if com_project.ItemIndex=0 then
    LoadDateSource
  else
    getcol;
end;

procedure TFrm_YaoHao.Com_GclxnameChange(Sender: TObject);
begin
  inherited;
  com_leibie.Text:='请选择类别';
  GetXmLeibie(com_leibie);
  if (com_leibie.Items[0]<>'无类别') and (com_leibie.ItemIndex<1) then
  begin
    com_leibie.Items.Add('全部单位');
  end;
  if com_project.ItemIndex=0 then
    LoadDateSource
  else
    getcol;
end;

procedure TFrm_YaoHao.bb_reflashClick(Sender: TObject);
begin
  if com_project.ItemIndex=0 then
    LoadDateSource
  else
    getcol;
end;

procedure TFrm_YaoHao.Cell1MouseLClick(Sender: TObject; col, row,updn: Integer);
begin
  ecol:=cell1.getcellstring(1,cell1.GetCurrentRow,cell1.GetCurSheet);
end;

procedure TFrm_YaoHao.Cell1MouseRClick(Sender: TObject; col, row,updn: Integer);
begin
  ecol:=cell1.getcellstring(1,cell1.GetCurrentRow,cell1.GetCurSheet);
end;


procedure TFrm_YaoHao.BitBtn2Click(Sender: TObject);
begin
  inherited;
  if bOpen=true then exit;
  if com_project.ItemIndex=0 then
  begin
    getcellXuhao(cell1,6,21);
    cell1.SaveFile(GetFilePath+GetLeibie(com_leibie.text)+'_tbpeihao.cll',1);
    cell1.openfile(GetFilePath+GetLeibie(com_leibie.text)+'_tbpeihao.cll','');
  end;

⌨️ 快捷键说明

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