You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
3.8 KiB
Plaintext

unit u_crm_client_ty_query;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, wwdbdatetimepicker, wwdblook, StdCtrls, bsSkinCtrls,
BusinessSkinForm, Mask, wwdbedit, Wwdotdot, Wwdbcomb, RxLookup;
type
Tfrm_crm_client_ty_query = class(TForm)
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
wwDBLookupCombo1: TwwDBLookupCombo;
d1: TwwDBDateTimePicker;
d2: TwwDBDateTimePicker;
Label5: TLabel;
Label9: TLabel;
wwDBLookupCombo2: TwwDBLookupCombo;
Label10: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
Label14: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
Label8: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label11: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
RxDBLookupCombo2: TRxDBLookupCombo;
Label12: TLabel;
wwDBComboBox1: TwwDBComboBox;
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_crm_client_ty_query: Tfrm_crm_client_ty_query;
implementation
uses u_crm_client_ty, my_sys_function, u_data_share;
{$R *.dfm}
procedure Tfrm_crm_client_ty_query.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_crm_client_ty_query.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
begin
str:=' where '+open_data('3113','录入人','no','no','no','no');
if wwDBLookupCombo1.text<>''then
begin
if str='' then
str:=' where 录入人='+''''+wwDBLookupCombo1.text+''''
else
str:=str+' and 录入人='+''''+wwDBLookupCombo1.text+'''';
end;
if wwDBLookupCombo2.text<>''then
begin
if str='' then
str:=' where 审核人='+''''+wwDBLookupCombo2.text+''''
else
str:=str+' and 审核人='+''''+wwDBLookupCombo2.text+'''';
end;
if d1.text<>''then
begin
if str='' then
str:=' where 日期>='+''''+d1.text+''''
else
str:=str+' and 日期>='+''''+d1.text+'''';
end;
if d2.text<>''then
begin
if str='' then
str:=' where 日期<='+''''+d2.text+''''
else
str:=str+' and 日期<='+''''+d2.text+'''';
end;
if wwDBDateTimePicker1.text<>''then
begin
if str='' then
str:=' where 审核日期>='+''''+wwDBDateTimePicker1.text+''''
else
str:=str+' and 审核日期>='+''''+wwDBDateTimePicker1.text+'''';
end;
if wwDBDateTimePicker2.text<>''then
begin
if str='' then
str:=' where 审核日期<='+''''+wwDBDateTimePicker2.text+''''
else
str:=str+' and 审核日期<='+''''+wwDBDateTimePicker2.text+'''';
end;
if wwDBComboBox1.text<>''then
begin
if str='' then
str:=' where 状态='+''''+wwDBComboBox1.Text+''''
else
str:=str+' and 状态='+''''+wwDBComboBox1.Text+'''';
end;
if RxDBLookupCombo3.DisplayValues[0]<>'' then begin
if str='' then
str:=' where 揽货人='''+RxDBLookupCombo3.DisplayValues[0]+''''
else
str:=str+' and 揽货人='''+RxDBLookupCombo3.DisplayValues[0]+'''';
end;
if RxDBLookupCombo2.DisplayValues[1]<>'' then begin
if str='' then
str:=' where 客户简称='''+RxDBLookupCombo2.DisplayValues[1]+''''
else
str:=str+' and 客户简称='''+RxDBLookupCombo2.DisplayValues[1]+'''';
end;
str:='select * from t_crm_client_ty '+str+' order by 日期';
table_query(frm_crm_client_ty.t_crm_client_ty,str);
if frm_crm_client_ty.t_crm_client_ty.IsEmpty then
begin
showmessage('没有检索出信息!!');
exit;
end;
close;
end;
procedure Tfrm_crm_client_ty_query.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_crm_client_ty_query.bsSkinButton10Click(Sender);
end;
end;
end.