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

📄 unit_custombrowsebase.pas

📁 delphi开发的中国移动大客户管理系统,后台数据库为oracle
💻 PAS
📖 第 1 页 / 共 4 页
字号:
        coGR_cityno.OnChange(self);
        coJT_cityno.OnChange(self);
   	Pro_GFillInitValue(Self,'所有');
        
end;

procedure Tform_custombrowsebase.pro_initother(sender: tobject);
var
    i:integer;
begin
edGR_SID.Text:='';
dtpGR_BE_DH_TBegin.Date:=now;
dtpGR_BE_DH_TEnd.Date:=now;
dtpJT_BE_G_DateBegin.Date:=now;
dtpJT_BE_G_DateEnd.Date:=now;
StatusBar1.Panels[0].text:=self.Caption;
StatusBar1.Panels[1].text:=PageControl1.ActivePage.Caption;
//初始化排序列表
lbGR_canselect.Clear;
for i:=0 to lbGR_fieldcomment.Items.Count-1 do
	lbGR_canselect.Items.Add(lbGR_fieldcomment.Items[i]);
lbJT_canselect.Clear;
for i:=0 to lbJT_fieldcomment.Items.Count-1 do
	lbJT_canselect.Items.Add(lbJT_fieldcomment.Items[i]);

cbGR_Order.Checked:=false;
cbJT_Order.Checked:=false;

end;

procedure Tform_custombrowsebase.btnGR_highlevelClick(Sender: TObject);
begin
if btnGR_highlevel.tag=2  then
   begin
       PanelGR_highlevel.Visible:=true;
       PanelGR_highlevel.top:=PanelGRBTN_highlevel.top+PanelGRBTN_highlevel.Height;
       PanelGR_highlevel1.Visible:=true;
       PanelGR_highlevel1.top:=PanelGR_highlevel.top+PanelGR_highlevel.Height;
       PanelGR_highlevel2.Visible:=true;
       PanelGR_highlevel2.top:=PanelGR_highlevel1.top+PanelGR_highlevel1.Height;
       btnGR_highlevel.down:=true;
       btnGR_highlevel.tag:=1;
   end
else
if btnGR_highlevel.tag=1 then
    begin

       PanelGR_highlevel1.Visible:=false;
       PanelGR_highlevel2.Visible:=false;
       PanelGR_highlevel.Visible:=false;
       btnGR_highlevel.down:=false;
       btnGR_highlevel.tag:=2;
    end;
       ScrollBox_GR.VertScrollBar.Position:=PanelGRBTN_highlevel.Top;//个人高级选项
end;

procedure Tform_custombrowsebase.btnGR_stuffClick(Sender: TObject);
begin
{if btnGR_stuff.tag=2  then
   begin
       PanelGR_stuff.Visible:=true;
       PanelGR_stuff.top:=PanelGRBTN_stuff.top+PanelGRBTN_stuff.Height;
       btnGR_stuff.down:=true;
       btnGR_stuff.tag:=1;
   end
else
if btnGR_stuff.tag=1 then
    begin
       PanelGR_stuff.Visible:=false;
       btnGR_stuff.down:=false;
       btnGR_stuff.tag:=2;
    end;
       ScrollBox_GR.VertScrollBar.Position:=PanelGRBTN_stuff.Top;//个人高级选项
 }
end; 

procedure Tform_custombrowsebase.btnJT_HighLevelClick(Sender: TObject);
begin
if btnJT_highlevel.tag=2  then
   begin
       PanelJT_highlevel.Visible:=true;
       PanelJT_highlevel.top:=PanelJTBTN_highlevel.top+PanelJTBTN_highlevel.Height;
       PanelJT_highlevel1.Visible:=true;
       PanelJT_highlevel1.top:=PanelJT_highlevel.top+PanelJT_highlevel.Height;
       btnJT_highlevel.down:=true;
       btnJT_highlevel.tag:=1;
   end
else
if btnJT_highlevel.tag=1 then
    begin
       PanelJT_highlevel1.Visible:=false;
       PanelJT_highlevel.Visible:=false;
       btnJT_highlevel.down:=false;
       btnJT_highlevel.tag:=2;
    end;
ScrollBox_JT.VertScrollBar.Position:=PanelJTBTN_HighLevel.Top;//个人高级选项

end;

procedure Tform_custombrowsebase.cbGR_BE_DH_TClick(Sender: TObject);
begin
if cbGR_BE_DH_T.Checked then
    begin
      dtpGR_BE_DH_TBegin.Color:=clwindow;
      dtpGR_BE_DH_TEnd.Color:=clwindow;
      dtpGR_BE_DH_TBegin.Enabled:=true;
      dtpGR_BE_DH_TEnd.Enabled:=true;
    end
else
    begin
      dtpGR_BE_DH_TBegin.Color:=clActiveBorder;
      dtpGR_BE_DH_TEnd.Color:=clActiveBorder;
      dtpGR_BE_DH_TBegin.Enabled:=false;
      dtpGR_BE_DH_TEnd.Enabled:=false;
    end;
end;

procedure Tform_custombrowsebase.cbJT_Be_G_DateClick(Sender: TObject);
begin
if cbJT_BE_G_Date.Checked then
    begin
      dtpJT_BE_G_DateBegin.Color:=clwindow;
      dtpJT_BE_G_DateEnd.Color:=clwindow;
      dtpJT_BE_G_DateBegin.Enabled:=true;
      dtpJT_BE_G_DateEnd.Enabled:=true;
    end
else
    begin
      dtpJT_BE_G_DateBegin.Color:=clActiveBorder;
      dtpJT_BE_G_DateEnd.Color:=clActiveBorder;
      dtpJT_BE_G_DateBegin.Enabled:=false;
      dtpJT_BE_G_DateEnd.Enabled:=false;
    end;
//coJT_Name.ItemIndex:=0;
end;

procedure Tform_custombrowsebase.pro_GR_getid(sender: tobject);
var
   tmpstr:string;
    i:integer;
begin
lGR_GH:='';
lGR_cityno:='';
lGR_off_no_home:='';
lGR_USER_ZJBS:='';
lGR_DJDM:='';
lGR_SXDM:='';
lGR_Stat:='';
lGR_ZY:='';
lGR_XB:='';
if coGR_GH.text<>'所有' then
   lGR_GH:=copy(coGR_GH.text,1,pos(':',coGR_GH.text)-1);
if  CoGR_CityNo.text<>'所有' then
   lGR_cityno:=Fun_GetCity(CoGR_CityNo,'',1);
if  CoGR_OFF_NO_HOME.text<>'所有' then
   lGR_off_no_home:=Fun_GetCounty(CoGR_OFF_NO_HOME,'','',1);
if  CoGR_USER_ZJBS.text<>'所有' then
	lGR_USER_ZJBS:=fun_getcodename(coGR_USER_ZJBS);
if  coGR_DJDM.text<>'所有' then
	lGR_DJDM:=fun_getcodename(coGR_DJDM);
if  coGR_SXDM.text<>'所有' then
	lGR_SXDM:=fun_getcodename(coGR_SXDM);
if  coGR_Stat.text<>'所有' then
	lGR_Stat:=fun_getcodename(coGR_Stat);
if  coGR_ZY.text<>'所有' then
	lGR_ZY:=fun_getcodename(coGR_ZY);
if  coGR_XB.text<>'所有' then
	lGR_XB:=fun_getcodename(coGR_XB);
end;


procedure Tform_custombrowsebase.pro_JT_getid(sender: tobject);
var
    tmpstr:string;
    i:integer;
begin
lJT_GH:='';
lJT_cityno:='';
lJT_off_no_home:='';
lJT_HYDM:='';
lJT_GroupFlag:='';
lJT_JTLB:='';
lJT_JTYHMC:='';
lJT_JTYHDM:='';
if coJT_GH.text<>'所有' then
   lJT_GH:=copy(coJT_GH.text,1,pos(':',coJT_GH.text)-1);
if CoJT_CityNo.text<>'所有' then
   lJT_cityno:=Fun_GetCity(CoJT_CityNo,'',1);
if CoJT_OFF_NO_HOME.text<>'所有' then
	lJT_off_no_home:=Fun_GetCounty(CoJT_OFF_NO_HOME,'','',1);
if coJT_GroupFlag.text<>'所有' then
	lJT_GroupFlag:=fun_getcodename(coJT_GroupFlag);
if coJT_HYDM.text<>'所有' then
	lJT_HYDM:=fun_getcodename(coJT_HYDM);
if coJT_JTLB.text<>'所有' then
	lJT_JTLB:=fun_getcodename(coJT_JTLB);
if edJT_DMORMC.text<>'' then
    begin
        tmpstr:=trim(edJT_DMORMC.text);
	for i:=1 to length(trim(edJT_DMORMC.text)) do
            begin
                if not (tmpstr[i] in ['0'..'9']) then
                    lJT_JTYHMC:=tmpstr;
            end;
	if lJT_JTYHMC='' then
             lJT_JTYHDM:=tmpstr;
    end;
{with query_tmp do
    begin
        //  企业名称
        if coJT_Name.text<>'所有' then
            begin
                close;
                sql.clear;
                sql.add('select JTYHDM from T_F_GROUPINFO');
                sql.add('where trim(JTYHMC)='+''''+coJT_Name.text+'''');
                open;
                if recordcount>0 then
                   lJT_JTYHMC:=trim(fieldbyname('JTYHDM').asstring);
            end;
    end;}
end;


procedure Tform_custombrowsebase.cbGR_ZWSJClick(Sender: TObject);
begin
  if cbGR_ZWSJ.Checked then
      begin
        spiGR_ZWSJBegin.colorflat:=clwindow;
        spiGR_ZWSJEnd.colorflat:=clwindow;
        spiGR_ZWSJBegin.Enabled:=true;
        spiGR_ZWSJEnd.Enabled:=true;
      end
  else
      begin
        spiGR_ZWSJBegin.colorflat:=clActiveBorder;
        spiGR_ZWSJEnd.colorflat:=clActiveBorder;
        spiGR_ZWSJBegin.Enabled:=false;
        spiGR_ZWSJEnd.Enabled:=false;
      end;

  end;

procedure Tform_custombrowsebase.cbGR_AgeClick(Sender: TObject);
  begin
  if cbGR_Age.Checked then
      begin
        spiGR_AgeBegin.colorflat:=clwindow;
        spiGR_AgeEnd.colorflat:=clwindow;
        spiGR_AgeBegin.Enabled:=true;
        spiGR_AgeEnd.Enabled:=true;
      end
  else
      begin
        spiGR_AgeBegin.colorflat:=clActiveBorder;
        spiGR_AgeEnd.colorflat:=clActiveBorder;
        spiGR_AgeBegin.Enabled:=false;
        spiGR_AgeEnd.Enabled:=false;
    end;
end;

procedure Tform_custombrowsebase.cbJT_JTCYClick(Sender: TObject);
begin
  if cbJT_JTCY.Checked then
      begin
        spiJT_JTCYBegin.colorflat:=clwindow;
        spiJT_JTCYEnd.colorflat:=clwindow;
        spiJT_JTCYBegin.Enabled:=true;
        spiJT_JTCYEnd.Enabled:=true;
      end
  else
      begin
        spiJT_JTCYBegin.colorflat:=clActiveBorder;
        spiJT_JTCYEnd.colorflat:=clActiveBorder;
        spiJT_JTCYBegin.Enabled:=false;
        spiJT_JTCYEnd.Enabled:=false;
    end;
//coJT_Name.ItemIndex:=0;
end;

procedure Tform_custombrowsebase.FlatButton1Click(Sender: TObject);
var
    tmpsql,tmpstr:string;
    beforebrowsetime:tdatetime;
    doubletmp,doubleinter:double;
begin
GR_sqlOrder:='';
GR_sqlwhere:='';
JT_sqlOrder:='';
JT_sqlwhere:='';
beforebrowsetime:=now;
doubleinter:=0;
tmpstr:=self.Name;
delete(tmpstr,1,3);
if PageControl1.ActivePageIndex=0 then
	tmpstr:='T_V_GR'+tmpstr+' t';
if PageControl1.ActivePageIndex=1 then
	tmpstr:='T_V_JT'+tmpstr+' t';
  if PageControl1.ActivePageIndex=0 then//个人客户
    begin
        pro_GR_checkcondition(self);
        if GR_condition then
            begin
                pro_GR_Getid(self);
                pro_GR_Getsqlwhere(self);
                if (cbGR_Order.Checked) and (lbGR_selected.Items.Count>0) then
	                pro_GR_GetsqlOrder(self);
                if GR_sqlwhere='' then
                    begin
                        doubleinter:=now-beforebrowsetime;
//                        if fun_messagebox('无查询条件,是否继续',1,1)<>1 then
//                    		exit
//                        else
//                           beforebrowsetime:=now;
                    end;
                try

                {with query_tmp do
                    begin
                        close;
                        sql.clear;
                        sql.add('select count(*) Rcount from '+tmpstr +' where 1=1');
                        sql.add(GR_sqlwhere);
                        open;
                        if fieldbyname('Rcount').asinteger>=REMIDEROW then
			    begin
                            	doubleinter:=doubleinter+(now-beforebrowsetime);
                            	if fun_messagebox('记录返回 '+inttostr(fieldbyname('Rcount').asinteger)+' 条,是否继续显示',1,1)<>1 then
                    			exit
                                else
                                   beforebrowsetime:=now;
                            end;
                        StatusBar1.Panels[3].Text:=inttostr(fieldbyname('Rcount').asinteger)+' 条';
                    end;}
                pro_GetsqlQuery(self);
                with browse_normal do
                    begin
                	close;
                        sql.clear;
                        sql.Add(GR_sqlquery+GR_sqlwhere+GR_sqlOrder);
                        open;
                        StatusBar1.Panels[3].Text:='成功';
                    end;
		doubletmp:=doubleinter+(now-beforebrowsetime);
		StatusBar1.Panels[4].Text:='本次查询费时 '+currtostr(doubletmp*86400)+' 秒';
                except
//                    fun_messagebox('系统在执行过程中发生错误,请检查输入条件');
                end;
            end;
    end;
if PageControl1.ActivePageIndex=1 then//集团客户
    begin
        pro_JT_checkcondition(self);
        if JT_condition then
            begin
                pro_JT_Getid(self);
                pro_JT_Getsqlwhere(self);
                if (cbJT_Order.Checked) and (lbGR_selected.Items.Count>0) then
	                pro_JT_GetsqlOrder(self);
                if JT_sqlwhere='' then
                    begin
                        doubleinter:=now-beforebrowsetime;

{
			if fun_messagebox('无查询条件,是否继续',1,1)<>1 then
                    		exit
                        else
                            beforebrowsetime:=now;

⌨️ 快捷键说明

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