unit u_ch_zhipiao_query; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, wwdbdatetimepicker, StdCtrls, RxLookup, wwdblook, bsSkinCtrls, BusinessSkinForm; type Tfrm_ch_zhipiao_query = class(TForm) Label13: TLabel; RxDBLookupCombo5: TRxDBLookupCombo; Label6: TLabel; Edit1: TEdit; Label10: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; Label5: TLabel; bsSkinButton1: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsBusinessSkinForm1: TbsBusinessSkinForm; Label9: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label1: TLabel; Edit2: TEdit; Label37: TLabel; ComboBox1: TComboBox; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); private { Private declarations } public { Public declarations } end; var frm_ch_zhipiao_query: Tfrm_ch_zhipiao_query; zhipiao_query_type:integer; implementation uses my_sys_function, u_data_share, u_ch_balance_pay, u_ch_balance_accept; {$R *.dfm} procedure Tfrm_ch_zhipiao_query.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_zhipiao_query.bsSkinButton10Click(Sender: TObject); begin Edit1.text:=''; Edit2.text:=''; RxDBLookupCombo5.ClearValue; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; RxDBLookupCombo2.ClearValue; ComboBox1.Text:=''; end; procedure Tfrm_ch_zhipiao_query.bsSkinButton1Click(Sender: TObject); var str:widestring; begin case zhipiao_query_type of 1: begin str:='SELECT * FROM t_ch_zhipiao where 1=1 '; if Edit1.text<>''then str:=str+' and 支票号码 like '+''''+'%'+Edit1.text+'%'+''''; if RxDBLookupCombo5.DisplayValue<>''then str:=str+' and 制单人='+''''+RxDBLookupCombo5.DisplayValue+''''; if wwDBDateTimePicker1.text<>''then str:=str+' and 开票日期>='+''''+wwDBDateTimePicker1.text+''''; if wwDBDateTimePicker2.text<>''then str:=str+' and 开票日期<='+''''+wwDBDateTimePicker2.text+''''; if RxDBLookupCombo2.DisplayValue<>''then str:=str+' and 客户名称='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if Edit2.text<>''then str:=str+' and 支票金额='+Edit2.text; if ComboBox1.Text<>'' then str:=str+' and 币别='+''''+ComboBox1.Text+''''; frm_ch_balance_pay.t_ch_zhipiao.close; frm_ch_balance_pay.t_ch_zhipiao.sql.text:=str; frm_ch_balance_pay.t_ch_zhipiao.open; if frm_ch_balance_pay.t_ch_zhipiao.isempty then showmessage('没有检索出信息!!') else close; end; 2: begin str:='SELECT * FROM t_ch_jinzhang where 1=1 '; if Edit1.text<>''then str:=str+' and 票据号码 like '+''''+'%'+Edit1.text+'%'+''''; if RxDBLookupCombo5.DisplayValue<>''then str:=str+' and 制单人='+''''+RxDBLookupCombo5.DisplayValue+''''; if wwDBDateTimePicker1.text<>''then str:=str+' and 开票日期>='+''''+wwDBDateTimePicker1.text+''''; if wwDBDateTimePicker2.text<>''then str:=str+' and 开票日期<='+''''+wwDBDateTimePicker2.text+''''; if RxDBLookupCombo2.DisplayValue<>''then str:=str+' and 客户名称='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if Edit2.text<>''then str:=str+' and 票据金额='+Edit2.text; if ComboBox1.Text<>'' then str:=str+' and 币别='+''''+ComboBox1.Text+''''; frm_ch_balance_accept.t_ch_jinzhang.close; frm_ch_balance_accept.t_ch_jinzhang.sql.text:=str; frm_ch_balance_accept.t_ch_jinzhang.open; if frm_ch_balance_accept.t_ch_jinzhang.isempty then showmessage('没有检索出信息!!') else close; end; end; { if frm_info_price_manage.t_price_ship.isempty then showmessage('没有检索出信息!!') else close; } end; procedure Tfrm_ch_zhipiao_query.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin key:=#0; frm_ch_zhipiao_query.bsSkinButton1Click(Sender); end; end; end.