unit u_op_kuaidi_query; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, ComCtrls, bsSkinTabs, wwdbdatetimepicker, RxLookup, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, bsSkinCtrls; type Tfrm_op_kuaidi_query = class(TForm) bsSkinButton1: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinGroupBox1: TbsSkinGroupBox; Label6: TLabel; Label3: TLabel; Label5: TLabel; Label11: TLabel; Label14: TLabel; Label4: TLabel; Label8: TLabel; Label10: TLabel; Label1: TLabel; Label7: TLabel; wwDBComboBox15: TwwDBComboBox; Edit2: TEdit; wwDBComboBox4: TwwDBComboBox; Edit4: TEdit; wwDBComboBox14: TwwDBComboBox; wwDBComboBox11: TwwDBComboBox; wwDBComboBox6: TwwDBComboBox; wwDBDateTimePicker2: TwwDBDateTimePicker; wwDBDateTimePicker4: TwwDBDateTimePicker; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo4: TRxDBLookupCombo; wwDBDateTimePicker3: TwwDBDateTimePicker; wwDBDateTimePicker1: TwwDBDateTimePicker; Edit1: TEdit; wwDBComboBox1: TwwDBComboBox; wwDBComboBox17: TwwDBComboBox; wwDBComboBox2: TwwDBComboBox; wwDBComboBox18: TwwDBComboBox; wwDBComboBox19: TwwDBComboBox; wwDBComboBox5: TwwDBComboBox; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; Label12: TLabel; Label13: TLabel; Label15: TLabel; Label16: TLabel; Label17: TLabel; Label18: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; wwDBComboBox7: TwwDBComboBox; Edit3: TEdit; wwDBComboBox8: TwwDBComboBox; Edit5: TEdit; wwDBComboBox16: TwwDBComboBox; Edit6: TEdit; wwDBComboBox9: TwwDBComboBox; Edit7: TEdit; wwDBComboBox10: TwwDBComboBox; wwDBDateTimePicker5: TwwDBDateTimePicker; wwDBComboBox12: TwwDBComboBox; wwDBDateTimePicker6: TwwDBDateTimePicker; wwDBDateTimePicker7: TwwDBDateTimePicker; wwDBComboBox13: TwwDBComboBox; wwDBDateTimePicker8: TwwDBDateTimePicker; wwDBComboBox20: TwwDBComboBox; wwDBComboBox24: TwwDBComboBox; RxDBLookupCombo5: TRxDBLookupCombo; wwDBComboBox22: TwwDBComboBox; RxDBLookupCombo6: TRxDBLookupCombo; RxDBLookupCombo7: TRxDBLookupCombo; wwDBComboBox23: TwwDBComboBox; wwDBComboBox25: TwwDBComboBox; RxDBLookupCombo8: TRxDBLookupCombo; bsSkinTabSheet2: TbsSkinTabSheet; Label25: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label36: TLabel; wwDBComboBox26: TwwDBComboBox; Edit8: TEdit; wwDBComboBox27: TwwDBComboBox; Edit9: TEdit; wwDBComboBox28: TwwDBComboBox; Edit10: TEdit; wwDBComboBox29: TwwDBComboBox; Edit11: TEdit; wwDBComboBox30: TwwDBComboBox; wwDBDateTimePicker9: TwwDBDateTimePicker; wwDBComboBox31: TwwDBComboBox; wwDBDateTimePicker10: TwwDBDateTimePicker; wwDBComboBox32: TwwDBComboBox; wwDBDateTimePicker11: TwwDBDateTimePicker; wwDBComboBox33: TwwDBComboBox; wwDBDateTimePicker12: TwwDBDateTimePicker; RxDBLookupCombo9: TRxDBLookupCombo; wwDBComboBox34: TwwDBComboBox; RxDBLookupCombo10: TRxDBLookupCombo; wwDBComboBox35: TwwDBComboBox; wwDBComboBox36: TwwDBComboBox; RxDBLookupCombo11: TRxDBLookupCombo; wwDBComboBox37: TwwDBComboBox; RxDBLookupCombo12: TRxDBLookupCombo; bsSkinTabSheet3: TbsSkinTabSheet; Label37: TLabel; Label38: TLabel; Label39: TLabel; Label40: TLabel; Label41: TLabel; Label42: TLabel; Label43: TLabel; Label44: TLabel; Label45: TLabel; Label46: TLabel; Label47: TLabel; Label48: TLabel; wwDBComboBox38: TwwDBComboBox; Edit12: TEdit; wwDBComboBox39: TwwDBComboBox; Edit13: TEdit; Edit14: TEdit; wwDBComboBox40: TwwDBComboBox; Edit15: TEdit; wwDBComboBox41: TwwDBComboBox; wwDBComboBox42: TwwDBComboBox; wwDBDateTimePicker13: TwwDBDateTimePicker; wwDBComboBox43: TwwDBComboBox; wwDBDateTimePicker14: TwwDBDateTimePicker; wwDBDateTimePicker15: TwwDBDateTimePicker; wwDBComboBox44: TwwDBComboBox; wwDBDateTimePicker16: TwwDBDateTimePicker; wwDBComboBox45: TwwDBComboBox; wwDBComboBox46: TwwDBComboBox; RxDBLookupCombo13: TRxDBLookupCombo; wwDBComboBox47: TwwDBComboBox; RxDBLookupCombo14: TRxDBLookupCombo; RxDBLookupCombo15: TRxDBLookupCombo; wwDBComboBox48: TwwDBComboBox; RxDBLookupCombo16: TRxDBLookupCombo; wwDBComboBox49: TwwDBComboBox; bsSkinTabSheet4: TbsSkinTabSheet; Label49: TLabel; Label50: TLabel; Label51: TLabel; Label52: TLabel; Label53: TLabel; Label54: TLabel; Label55: TLabel; Label56: TLabel; Label57: TLabel; Label58: TLabel; Label59: TLabel; Label60: TLabel; wwDBComboBox50: TwwDBComboBox; Edit16: TEdit; wwDBComboBox51: TwwDBComboBox; Edit17: TEdit; Edit18: TEdit; wwDBComboBox52: TwwDBComboBox; Edit19: TEdit; wwDBComboBox53: TwwDBComboBox; wwDBComboBox54: TwwDBComboBox; wwDBDateTimePicker17: TwwDBDateTimePicker; wwDBComboBox55: TwwDBComboBox; wwDBDateTimePicker18: TwwDBDateTimePicker; wwDBDateTimePicker19: TwwDBDateTimePicker; wwDBComboBox56: TwwDBComboBox; wwDBDateTimePicker20: TwwDBDateTimePicker; wwDBComboBox57: TwwDBComboBox; wwDBComboBox58: TwwDBComboBox; RxDBLookupCombo17: TRxDBLookupCombo; wwDBComboBox59: TwwDBComboBox; RxDBLookupCombo18: TRxDBLookupCombo; RxDBLookupCombo19: TRxDBLookupCombo; wwDBComboBox60: TwwDBComboBox; RxDBLookupCombo20: TRxDBLookupCombo; wwDBComboBox61: TwwDBComboBox; bsBusinessSkinForm1: TbsBusinessSkinForm; Label9: TLabel; wwDBComboBox21: TwwDBComboBox; RxDBLookupCombo2: TRxDBLookupCombo; Label2: TLabel; wwDBComboBox3: TwwDBComboBox; Edit20: TEdit; Label61: TLabel; wwDBComboBox62: TwwDBComboBox; wwDBComboBox63: TwwDBComboBox; Label62: TLabel; wwDBComboBox64: TwwDBComboBox; Edit21: TEdit; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_kuaidi_query: Tfrm_op_kuaidi_query; kuaidi_query_num:integer; implementation uses u_data_share, u_op_kuaidi_shen, u_op_kuaidi_check, u_main, my_sys_function; {$R *.dfm} procedure Tfrm_op_kuaidi_query.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_kuaidi_query.bsSkinButton10Click(Sender: TObject); begin Edit2.text:=''; Edit20.text:=''; Edit21.text:=''; wwDBComboBox1.text:=''; wwDBComboBox63.text:=''; Edit1.text:=''; wwDBDateTimePicker1.Clear; wwDBDateTimePicker3.Clear; Edit4.text:=''; RxDBLookupCombo2.ClearValue; wwDBDateTimePicker2.Clear; wwDBDateTimePicker4.Clear; RxDBLookupCombo3.ClearValue; RxDBLookupCombo4.ClearValue; Edit3.text:=''; Edit5.text:=''; Edit6.text:=''; Edit7.text:=''; Edit8.text:=''; Edit9.text:=''; Edit10.text:=''; Edit11.text:=''; Edit12.text:=''; Edit13.text:=''; Edit14.text:=''; Edit15.text:=''; Edit16.text:=''; Edit17.text:=''; Edit18.text:=''; Edit19.text:=''; wwDBDateTimePicker5.Clear; wwDBDateTimePicker6.Clear; wwDBDateTimePicker7.Clear; wwDBDateTimePicker8.Clear; wwDBDateTimePicker9.Clear; wwDBDateTimePicker10.Clear; wwDBDateTimePicker11.Clear; wwDBDateTimePicker12.Clear; wwDBDateTimePicker13.Clear; wwDBDateTimePicker14.Clear; wwDBDateTimePicker15.Clear; wwDBDateTimePicker16.Clear; wwDBDateTimePicker17.Clear; wwDBDateTimePicker18.Clear; wwDBDateTimePicker19.Clear; wwDBDateTimePicker20.Clear; RxDBLookupCombo5.ClearValue; RxDBLookupCombo6.ClearValue; RxDBLookupCombo7.ClearValue; RxDBLookupCombo8.ClearValue; RxDBLookupCombo9.ClearValue; RxDBLookupCombo10.ClearValue; RxDBLookupCombo11.ClearValue; RxDBLookupCombo12.ClearValue; RxDBLookupCombo13.ClearValue; RxDBLookupCombo14.ClearValue; RxDBLookupCombo15.ClearValue; RxDBLookupCombo16.ClearValue; RxDBLookupCombo17.ClearValue; RxDBLookupCombo18.ClearValue; RxDBLookupCombo19.ClearValue; RxDBLookupCombo20.ClearValue; end; procedure Tfrm_op_kuaidi_query.bsSkinButton1Click(Sender: TObject); var shen_string,op_string:widestring; begin if kuaidi_query_num=1 then shen_string:='where 申请人='+''''+employee+''''; op_string:=''; shen_string:=query_tiaojian(1,shen_string,'发送编号',wwDBComboBox15.text,Edit2.text); shen_string:=query_tiaojian(1,shen_string,'收件人姓名',wwDBComboBox2.text,Edit1.text); shen_string:=query_tiaojian(1,shen_string,'快递编号',wwDBComboBox3.text,Edit20.text); shen_string:=query_tiaojian(1,shen_string,'付费方式',wwDBComboBox62.text,wwDBComboBox63.text); shen_string:=query_tiaojian(1,shen_string,'申请状态',wwDBComboBox17.text,wwDBComboBox1.text); shen_string:=query_tiaojian(1,shen_string,'委托编号',wwDBComboBox64.text,Edit21.text); shen_string:=query_tiaojian(1,shen_string,'申请日期',wwDBComboBox18.text,wwDBDateTimePicker1.text); shen_string:=query_tiaojian(1,shen_string,'审核日期',wwDBComboBox19.text,wwDBDateTimePicker3.text); shen_string:=query_tiaojian(1,shen_string,'申请人',wwDBComboBox5.text,RxDBLookupCombo4.DisplayValues[0]); shen_string:=query_tiaojian(1,shen_string,'收件人公司',wwDBComboBox4.text,Edit4.text); shen_string:=query_tiaojian(1,shen_string,'快递公司',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]); shen_string:=query_tiaojian(1,shen_string,'申请日期',wwDBComboBox6.text,wwDBDateTimePicker2.text); shen_string:=query_tiaojian(1,shen_string,'审核日期',wwDBComboBox11.text,wwDBDateTimePicker4.text); shen_string:=query_tiaojian(1,shen_string,'审核人',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValues[0]); if bsSkinTabSheet1.Showing then begin op_string:=query_tiaojian(1,op_string,'业务编号',wwDBComboBox7.text,Edit3.text); op_string:=query_tiaojian(1,op_string,'主提单号',wwDBComboBox16.text,Edit6.text); op_string:=query_tiaojian(1,op_string,'开船日期',wwDBComboBox10.text,wwDBDateTimePicker5.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox20.text,wwDBDateTimePicker8.text); op_string:=query_tiaojian(1,op_string,'客服员',wwDBComboBox24.text,RxDBLookupCombo5.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'操作员',wwDBComboBox25.text,RxDBLookupCombo8.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'委托编号',wwDBComboBox8.text,Edit5.text); op_string:=query_tiaojian(1,op_string,'分提单号',wwDBComboBox9.text,Edit7.text); op_string:=query_tiaojian(1,op_string,'开船日期',wwDBComboBox12.text,wwDBDateTimePicker6.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox13.text,wwDBDateTimePicker7.text); op_string:=query_tiaojian(1,op_string,'揽货人',wwDBComboBox22.text,RxDBLookupCombo6.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'录入人',wwDBComboBox23.text,RxDBLookupCombo7.DisplayValues[0]); if trim(op_string)<>''then begin op_string:='(select 编号 from t_op_seae '+op_string+')'; end; end; if bsSkinTabSheet2.Showing then begin op_string:=query_tiaojian(1,op_string,'业务编号',wwDBComboBox26.text,Edit8.text); op_string:=query_tiaojian(1,op_string,'主提单号',wwDBComboBox28.text,Edit10.text); op_string:=query_tiaojian(1,op_string,'进口日期',wwDBComboBox30.text,wwDBDateTimePicker9.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox32.text,wwDBDateTimePicker11.text); op_string:=query_tiaojian(1,op_string,'客服员',wwDBComboBox35.text,RxDBLookupCombo10.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'操作员',wwDBComboBox36.text,RxDBLookupCombo11.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'委托编号',wwDBComboBox27.text,Edit9.text); op_string:=query_tiaojian(1,op_string,'分提单号',wwDBComboBox29.text,Edit11.text); op_string:=query_tiaojian(1,op_string,'进口日期',wwDBComboBox31.text,wwDBDateTimePicker10.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox33.text,wwDBDateTimePicker12.text); op_string:=query_tiaojian(1,op_string,'揽货人',wwDBComboBox34.text,RxDBLookupCombo9.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'录入人',wwDBComboBox37.text,RxDBLookupCombo12.DisplayValues[0]); if trim(op_string)<>''then op_string:='(select 编号 from t_op_seai '+op_string+')'; end; if bsSkinTabSheet3.Showing then begin op_string:=query_tiaojian(1,op_string,'业务编号',wwDBComboBox38.text,Edit12.text); op_string:=query_tiaojian(1,op_string,'主运单号',wwDBComboBox41.text,Edit15.text); op_string:=query_tiaojian(1,op_string,'委托编号',wwDBComboBox39.text,Edit13.text); op_string:=query_tiaojian(1,op_string,'分运单号',wwDBComboBox40.text,Edit14.text); op_string:=query_tiaojian(1,op_string,'一程开航日期',wwDBComboBox42.text,wwDBDateTimePicker13.text); op_string:=query_tiaojian(1,op_string,'一程开航日期',wwDBComboBox43.text,wwDBDateTimePicker14.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox45.text,wwDBDateTimePicker16.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox44.text,wwDBDateTimePicker15.text); op_string:=query_tiaojian(1,op_string,'客服员',wwDBComboBox46.text,RxDBLookupCombo13.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'操作员',wwDBComboBox49.text,RxDBLookupCombo16.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'揽货人',wwDBComboBox47.text,RxDBLookupCombo14.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'录入人',wwDBComboBox48.text,RxDBLookupCombo15.DisplayValues[0]); if trim(op_string)<>''then op_string:='(select 编号 from t_op_aire '+op_string+')'; end; if bsSkinTabSheet4.Showing then begin op_string:=query_tiaojian(1,op_string,'业务编号',wwDBComboBox50.text,Edit16.text); op_string:=query_tiaojian(1,op_string,'主运单号',wwDBComboBox53.text,Edit19.text); op_string:=query_tiaojian(1,op_string,'委托编号',wwDBComboBox51.text,Edit17.text); op_string:=query_tiaojian(1,op_string,'分运单号',wwDBComboBox52.text,Edit18.text); op_string:=query_tiaojian(1,op_string,'进口日期',wwDBComboBox54.text,wwDBDateTimePicker17.text); op_string:=query_tiaojian(1,op_string,'进口日期',wwDBComboBox55.text,wwDBDateTimePicker18.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox57.text,wwDBDateTimePicker20.text); op_string:=query_tiaojian(1,op_string,'会计期间',wwDBComboBox56.text,wwDBDateTimePicker19.text); op_string:=query_tiaojian(1,op_string,'客服员',wwDBComboBox58.text,RxDBLookupCombo17.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'操作员',wwDBComboBox61.text,RxDBLookupCombo20.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'揽货人',wwDBComboBox59.text,RxDBLookupCombo18.DisplayValues[0]); op_string:=query_tiaojian(1,op_string,'录入人',wwDBComboBox60.text,RxDBLookupCombo19.DisplayValues[0]); if trim(op_string)<>''then op_string:='(select 编号 from t_op_airi '+op_string+')'; end; if trim(op_string)<>''then begin if trim(shen_string)='' then shen_string:='where 发送编号 in (select 发送编号 from t_op_kuaidi_detail where 编号 in '+op_string+')' else shen_string:=shen_string+' and 发送编号 in (select 发送编号 from t_op_kuaidi_detail where 编号 in '+op_string+')'; end; case kuaidi_query_num of 1: begin frm_op_kuaidi_shen.t_op_kuaidi.close; frm_op_kuaidi_shen.t_op_kuaidi.sql.clear; frm_op_kuaidi_shen.t_op_kuaidi.sql.add('select * from t_op_kuaidi '+shen_string+' order by 发送编号'); frm_op_kuaidi_shen.t_op_kuaidi.open; if frm_op_kuaidi_shen.t_op_kuaidi.isempty then begin showmessage('没有检索出符合条件的数据!!'); exit; end; end; 2: begin frm_op_kuaidi_check.t_op_kuaidi.close; frm_op_kuaidi_check.t_op_kuaidi.sql.clear; frm_op_kuaidi_check.t_op_kuaidi.sql.add('select * from t_op_kuaidi '+shen_string+' order by 发送编号'); frm_op_kuaidi_check.t_op_kuaidi.open; if frm_op_kuaidi_check.t_op_kuaidi.isempty then begin showmessage('没有检索出符合条件的数据!!'); exit; end; end; end; close; end; procedure Tfrm_op_kuaidi_query.FormShow(Sender: TObject); begin wwDBComboBox15.text:='模糊'; wwDBComboBox17.text:='等于'; wwDBComboBox21.text:='等于'; wwDBComboBox62.text:='等于'; wwDBComboBox18.text:='等于'; wwDBComboBox19.text:='等于'; wwDBComboBox5.text:='等于'; wwDBComboBox4.text:='模糊'; wwDBComboBox2.text:='模糊'; wwDBComboBox3.text:='模糊'; wwDBComboBox64.text:='等于'; wwDBComboBox6.text:='等于'; wwDBComboBox11.text:='等于'; wwDBComboBox14.text:='等于'; wwDBComboBox7.text:='模糊'; wwDBComboBox16.text:='模糊'; wwDBComboBox10.text:='等于'; wwDBComboBox20.text:='等于'; wwDBComboBox24.text:='等于'; wwDBComboBox25.text:='等于'; wwDBComboBox8.text:='模糊'; wwDBComboBox9.text:='模糊'; wwDBComboBox12.text:='等于'; wwDBComboBox13.text:='等于'; wwDBComboBox22.text:='等于'; wwDBComboBox23.text:='等于'; wwDBComboBox26.text:='模糊'; wwDBComboBox28.text:='模糊'; wwDBComboBox30.text:='等于'; wwDBComboBox32.text:='等于'; wwDBComboBox35.text:='等于'; wwDBComboBox36.text:='等于'; wwDBComboBox27.text:='模糊'; wwDBComboBox29.text:='模糊'; wwDBComboBox31.text:='等于'; wwDBComboBox33.text:='等于'; wwDBComboBox34.text:='等于'; wwDBComboBox37.text:='等于'; wwDBComboBox38.text:='模糊'; wwDBComboBox39.text:='模糊'; wwDBComboBox40.text:='模糊'; wwDBComboBox41.text:='模糊'; wwDBComboBox42.text:='等于'; wwDBComboBox43.text:='等于'; wwDBComboBox44.text:='等于'; wwDBComboBox45.text:='等于'; wwDBComboBox46.text:='等于'; wwDBComboBox47.text:='等于'; wwDBComboBox48.text:='等于'; wwDBComboBox49.text:='等于'; wwDBComboBox50.text:='模糊'; wwDBComboBox51.text:='模糊'; wwDBComboBox52.text:='模糊'; wwDBComboBox53.text:='模糊'; wwDBComboBox54.text:='等于'; wwDBComboBox55.text:='等于'; wwDBComboBox56.text:='等于'; wwDBComboBox57.text:='等于'; wwDBComboBox58.text:='等于'; wwDBComboBox59.text:='等于'; wwDBComboBox60.text:='等于'; wwDBComboBox61.text:='等于'; frm_data_share.t_crm_client_kuaidi.requery; end; end.