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

📄 unit_custombrowsebase.pas

📁 delphi开发的中国移动大客户管理系统,后台数据库为oracle
💻 PAS
📖 第 1 页 / 共 4 页
字号:
}

                    end;
                try
                {with query_tmp do
                    begin
                        close;
                        sql.clear;
		        if cbJT_JTCY.Checked then
            			sql.add('select count(*) Rcount from '+tmpstr+','+'t_V_jtcy j'+' where t.JTYHDM_G=j.JTYHDM ')
                        else
                        	sql.add('select count(*) Rcount from '+tmpstr+' where 1=1');
                        sql.add(JT_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)+' 条';
                        close;
                    end;}
                pro_GetsqlQuery(self);
                with browse_normal do
                    begin
                	close;
                        sql.clear;
                        sql.Add(JT_sqlquery+JT_sqlwhere+JT_sqlOrder);
                        open;
                        StatusBar1.Panels[3].Text:='成功';
                    end;
		doubletmp:=doubleinter+(now-beforebrowsetime);
		StatusBar1.Panels[4].Text:='本次查询费时 '+currtostr(doubletmp*86400)+' 秒';
                except
//                    fun_messagebox('系统在执行过程中发生错误,请检查输入项');
                end;
            end;
    end;
end;


procedure Tform_custombrowsebase.coGR_USER_ZJBSKeyPress(Sender: TObject;
  var Key: Char);
begin
key:=#0;
end;


procedure Tform_custombrowsebase.FlatButton4Click(Sender: TObject);
begin
close;

end;

procedure Tform_custombrowsebase.pro_GR_checkcondition(sender: tobject);
begin
GR_condition:=true;
if cbGR_BE_DH_T.Checked then
    begin
        if trunc(dtpGR_BE_DH_TEnd.DateTime)<trunc(dtpGR_BE_DH_TBegin.DateTime) then
            begin
//                fun_messagebox('成为大客户时间开始日期不能大于结束日期');
                GR_condition:=false;
            end;
    end;

end;

procedure Tform_custombrowsebase.pro_GR_getsqlwhere(sender: tobject);
var
    tmpstr:string;
begin
GR_sqlwhere:='';
//if coGR_cityno.Text<>'所有' then
if lGR_cityno<>'' then
        tmpstr:=tmpstr+' and '+'t.cityno_c='+lGR_cityno+' and '+'t.cityno_city_c='+lGR_cityno+' and '+'t.cityno_county_c='+lGR_cityno;
//if coGR_off_no_home.Text<>'所有' then
if lGR_off_no_home<>'' then
        tmpstr:=tmpstr+' and '+'t.off_no_home_c='+lGR_off_no_home+' and '+'t.off_no_home_county_c='+lGR_off_no_home;
if edGR_SID.Text<>'' then
      tmpstr:=tmpstr+' and '+'t.SID_c='+''''+edGR_SID.Text+'''';
//if coGR_USER_ZJBS.Text<>'所有' then
if lGR_USER_ZJBS<>'' then
        tmpstr:=tmpstr+' and '+'t.USER_ZJBS='+''''+lGR_USER_ZJBS+''''+' and '+'t.productno_c='+''''+lGR_USER_ZJBS+'''';
//if coGR_GH.Text<>'所有' then
if lGR_GH<>'' then
        tmpstr:=tmpstr+' and '+'t.GH_c='+''''+lGR_GH+'''';


//
//if coGR_DJDM.Text<>'所有' then
if lGR_DJDM<>'' then
        tmpstr:=tmpstr+' and '+'t.DJDM='+lGR_DJDM+' and '+'t.gradeno_c='+lGR_DJDM;
//if coGR_SXDM.Text<>'所有' then
if lGR_SXDM<>'' then
        tmpstr:=tmpstr+' and '+'t.SXDM='+lGR_SXDM;
//if coGR_Stat.Text<>'所有' then
if lGR_Stat<>'' then
        tmpstr:=tmpstr+' and '+'t.Stat='+lGR_Stat+' and '+'t.Stat_stat_c='+lGR_Stat;
//if coGR_ZY.Text<>'所有' then
if lGR_ZY<>'' then
        tmpstr:=tmpstr+' and '+'t.ZY='+''''+lGR_ZY+'''';
//if coGR_XB.Text<>'所有' then
if lGR_XB<>'' then
        tmpstr:=tmpstr+' and '+'t.XB='+''''+lGR_XB+'''';

//

//
if cbGR_ZWSJ.Checked then
	tmpstr:=tmpstr+' and '+'t.zwsj>='+inttostr(spiGR_ZWSJBegin.Value)+' and t.zwsj<='+inttostr(spiGR_ZWSJEnd.Value);

if cbGR_BE_DH_T.Checked then
    begin
        tmpstr:=tmpstr+' and '+'t.BE_DH_T between '+'to_date('''+formatdatetime('yyyymmdd',dtpGR_BE_DH_TBegin.Date)+''',''yyyymmdd'')'+' and '+'to_date('''+formatdatetime('yyyymmdd',dtpGR_BE_DH_TEnd.Date)+''',''yyyymmdd'')';
    end;
if cbGR_Age.Checked then
        tmpstr:=tmpstr+' and t.Age between '+inttostr(spiGR_AgeBegin.value)+' and '+inttostr(spiGR_AgeEnd.value);

if cbGR_return.checked then
       tmpstr:=tmpstr+' and rownum<'+inttostr(spiGR_Return.value);
GR_sqlwhere:=tmpstr;
end;

procedure Tform_custombrowsebase.pro_JT_checkcondition(sender: tobject);
begin
JT_Condition:=true;
if cbJT_BE_G_Date.Checked then
    begin
        if trunc(dtpJT_BE_G_DateEnd.DateTime)<trunc(dtpJT_BE_G_DateBegin.DateTime) then
            begin
//                fun_messagebox('成为大客户时间开始日期不能大于结束日期');
                JT_Condition:=false;
            end;
    end;
end;

procedure Tform_custombrowsebase.pro_JT_getsqlwhere(sender: tobject);
var
    tmpstr:string;
begin
JT_sqlwhere:='';
//
//if coJT_Name.Text<>'所有' then       //集团代码

if (lJT_JTYHMC<>'') then
        tmpstr:=tmpstr+' and '+'t.JTYHMC like '+'''%'+lJT_JTYHMC+'%''';
if lJT_JTYHDM<>'' then
       tmpstr:=tmpstr+' and '+'t.JTYHDM_G='+lJT_JTYHDM;
//if coJT_cityno.Text<>'所有' then      //地市
if lJT_cityno<>'' then
        tmpstr:=tmpstr+' and '+'t.cityno_G='+lJT_cityno+' and '+'t.cityno_city_G='+lJT_cityno;
//if coJT_off_no_home.Text<>'所有' then  //局向
if lJT_off_no_home<>'' then
        tmpstr:=tmpstr+' and '+'t.JX_G='+lJT_off_no_home+' and '+'t.off_no_home_county_G='+lJT_off_no_home;
//if coJT_GH.Text<>'所有' then      //
if lJT_GH<>'' then
        tmpstr:=tmpstr+' and '+'t.GH_G='+''''+lJT_GH+'''';
//
//if coJT_HYDM.Text<>'所有' then          //行业
if lJT_HYDM<>'' then
        tmpstr:=tmpstr+' and '+'t.HYDM_G='+lJT_HYDM+' and '+'t.hydm_Calling_G='+lJT_HYDM;
//if coJT_JTLB.Text<>'所有' then            //集团类型
if lJT_JTLB<>'' then
        tmpstr:=tmpstr+' and '+'t.JTLB_G='+''''+lJT_JTLB+''''+' and '+'t.JTLB_Type_G='+''''+lJT_JTLB+'''';
//if coJT_GroupFlag.Text<>'所有' then      //客户属性
if lJT_GroupFlag<>'' then
        tmpstr:=tmpstr+' and '+'t.GROUPFLAG='+lJT_GroupFlag;


        //
if cbJT_BE_G_Date.Checked then
    begin
        tmpstr:=tmpstr+' and '+'t.BE_G_DATE between '+'to_date('''+formatdatetime('yyyymmdd',dtpJT_BE_G_DateBegin.Date)+''',''yyyymmdd'')'+' and '+'to_date('''+formatdatetime('yyyymmdd',dtpJT_BE_G_DateEnd.Date)+''',''yyyymmdd'')';
    end;

if cbJT_JTCY.Checked then
    begin
        tmpstr:=tmpstr+' and j.JTCY between '+inttostr(spiJT_JTCYBegin.value)+' and '+inttostr(spiJT_JTCYEnd.value);
    end;

if cbJT_return.checked then
       tmpstr:=tmpstr+' and rownum<'+inttostr(spiJT_Return.value);
JT_sqlwhere:=tmpstr;


end;

procedure Tform_custombrowsebase.spiGR_ZWSJBeginChange(Sender: TObject);
begin
if sender=spiGR_ZWSJBegin then
    begin
        spiGR_ZWSJEnd.MinValue:=spiGR_ZWSJBegin.Value;
        if spiGR_ZWSJEnd.Value<spiGR_ZWSJBegin.Value then
              spiGR_ZWSJEnd.Value:=spiGR_ZWSJBegin.Value;
    end;
if sender=spiGR_AgeBegin then
    begin
        spiGR_AgeEnd.MinValue:=spiGR_AgeBegin.Value;
        if spiGR_AgeEnd.Value<spiGR_AgeBegin.Value then
              spiGR_AgeEnd.Value:=spiGR_AgeBegin.Value;
    end;
if sender=spiGR_ZWSJBegin then
    begin
    	spiGR_ZWSJEnd.MinValue:=spiGR_ZWSJBegin.Value;
        if spiGR_ZWSJEnd.Value<spiGR_ZWSJBegin.Value then
              spiGR_ZWSJEnd.Value:=spiGR_ZWSJBegin.Value;

    end;
if sender=spiJT_JTCYBegin then
    begin
     	spiJT_JTCYEnd.MinValue:=spiJT_JTCYBegin.Value;
        if spiJT_JTCYEnd.Value<spiJT_JTCYBegin.Value then
              spiJT_JTCYEnd.Value:=spiJT_JTCYBegin.Value;
    end;
end;

procedure Tform_custombrowsebase.pro_CheckPanel(sender: tobject);
var
    i:integer;
begin
with self do
    begin
        for i:=0 to ComponentCount-1 do
            begin
		if (Components[i] is TPanel) or (Components[i] is TFlatPanel) then
                    begin
                        if (Components[i] is TPanel) then
                            begin
                                 if ((Components[i] as tpanel).parent=ScrollBox_GR)or ((Components[i] as tpanel).parent=ScrollBox_JT) then
                                     begin
                                         if (Components[i] as tpanel).autosize=false then
                                             (Components[i] as tpanel).autosize:=true;
                                     end;
                            end;
                    end;
		if (Components[i] is TComboBox) or (Components[i] is TFlatComboBox) or (Components[i] is TFlatEdit)then
                   begin
                   	if (Components[i] is TFlatComboBox) then
                               if (Components[i] as TFlatComboBox).style<>csDropDownList then
                      		(Components[i] as TFlatComboBox).style:=csDropDownList;
                   	if (Components[i] is TComboBox) then
                                if (Components[i] as TComboBox).style<>csDropDownList then
                       		    (Components[i] as TComboBox).style:=csDropDownList;
                   end;
                {if (Components[i] is TFlatEdit) or (Components[i] is TFlatComboBox)or (Components[i] is TDateTimePicker) then
                    begin
                        if (Components[i] is TControl) then
                            (Components[i] as TControl).width:=140;
                    end;}
            end;
    end;
end;

procedure Tform_custombrowsebase.pro_GR_orderpanel(sender: tobject);
begin
PanelGR_Stuff.top:=0;
PanelGR_base.top:=PanelGR_Stuff.top+PanelGR_Stuff.Height;
PanelGR_base1.top:=PanelGR_base.top+PanelGR_base.Height;
PanelGRBTN_highlevel.top:=PanelGR_base1.top+PanelGR_base1.Height;
PanelGR_highlevel.Top:=PanelGRBTN_highlevel.top+PanelGRBTN_highlevel.Height;
PanelGR_highlevel1.top:=PanelGR_highlevel.top+PanelGR_highlevel.Height;
PanelGR_highlevel2.top:=PanelGR_highlevel1.top+PanelGR_highlevel.Height;
PanelGRBTN_SelectOrder.top:=PanelGR_highlevel2.top+PanelGR_highlevel2.Height;
PanelGR_SelectOrder.top:=PanelGRBTN_SelectOrder.top+PanelGRBTN_SelectOrder.Height;
end;

procedure Tform_custombrowsebase.pro_JT_orderpanel(sender: tobject);
begin
PanelJT_Stuff.top:=0;
PanelJT_base.top:=PanelJT_Stuff.Top+PanelJT_Stuff.Height;
PanelJT_base1.top:=PanelJT_base.top+PanelJT_base.Height;
PanelJTBTN_highlevel.top:=PanelJT_base1.top+PanelJT_base1.Height;
PanelJT_highlevel.Top:=PanelJTBTN_highlevel.top+PanelJTBTN_highlevel.Height;
PanelJT_highlevel1.top:=PanelJT_highlevel.top+PanelJT_highlevel.Height;
PanelJTBTN_SelectOrder.top:=PanelJT_highlevel1.top+PanelJT_highlevel1.Height;
PanelJT_SelectOrder.top:=PanelJTBTN_SelectOrder.top+PanelJTBTN_SelectOrder.Height;

end;

procedure Tform_custombrowsebase.coGR_citynoChange(Sender: TObject);
begin
  	Fun_Getcounty(coGR_off_no_home,'所有',coGR_Cityno.Text,0,ps_homename);
        coGR_off_no_home.OnChange(coGR_off_no_home)
end;

procedure Tform_custombrowsebase.coJT_citynoChange(Sender: TObject);
begin
  	Fun_Getcounty(coJT_off_no_home,'所有',coJT_Cityno.Text,0,ps_homename);
        coJT_off_no_home.OnChange(coJT_off_no_home);
        coJT_HYDM.OnChange(self);

end;

procedure Tform_custombrowsebase.coJT_NameEnter(Sender: TObject);
VAR
   TMPSTR:STRING;
begin
end;


procedure Tform_custombrowsebase.coGR_GHEnter(Sender: TObject);
VAR
   TMPSTR:STRING;
begin
{GH_Strsql:='select WK_NO,name from t_f_Manager where 1=1';
pro_GR_getid(self);
if coGR_cityno.Text<>'所有' then
        tmpstr:=tmpstr+' and '+'cityno='+''''+lGR_cityno+'''';
if coGR_off_no_home.Text<>'所有' then
        tmpstr:=tmpstr+' and '+'off_no_home='+''''+lGR_off_no_home+'''';
GH_Strsql:=GH_Strsql+TMPSTR;
pro_GR_CREATEGH(SELF,GH_Strsql);}

end;

procedure Tform_custombrowsebase.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
   action:=cafree;
end;

procedure Tform_custombrowsebase.pro_getsqlQuery(sender: tobject);
var
    tmpstr:string;
begin
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
	GR_sqlquery:='select rownum row_num,t.* from '+tmpstr+' where 1=1';
if PageControl1.ActivePageIndex=1 then
    begin
        if cbJT_JTCY.Checked then
            JT_sqlquery:='select rownum row_num,t.*,j.jtcy from '+tmpstr+','+'t_V_jtcy j'+' where t.JTYHDM_G=j.JTYHDM '
        else
            JT_sqlquery:='select rownum row_num,t.* from '+tmpstr+' where 1=1'
    end;

end;

procedure Tform_custombrowsebase.PageControl1Changing(Sender: TObject;
  var AllowChange: Boolean);
begin
allowchange:=true;
if browse_normal.Active then

//	if fun_messagebox('是否切换窗口',1,1)<>1 then
//            allowchange:=false;

end;

procedure Tform_custombrowsebase.coGR_off_no_homeChange(Sender: TObject);
begin
Fun_GetManager(coGR_GH,'所有',coGR_Cityno.Text,coGR_off_no_home.Text,GH);

end;

procedure Tform_custombrowsebase.coJT_off_no_homeChange(Sender: TObject);
begin
  Fun_GetManager(coJT_GH,'所有',coJT_Cityno.Text,coJT_off_no_home.Text,GH);
  coJT_HYDM.onChange(self);

⌨️ 快捷键说明

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