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.
D6HECHUAN/信息资源/u_crm_client_contract_query...

203 lines
4.9 KiB
Plaintext

unit u_crm_client_contract_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_contract_query = class(TForm)
Label2: TLabel;
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
Edit1: TEdit;
wwDBLookupCombo1: TwwDBLookupCombo;
d1: TwwDBDateTimePicker;
d2: TwwDBDateTimePicker;
Label5: TLabel;
Label6: TLabel;
d3: TwwDBDateTimePicker;
Label7: TLabel;
d4: TwwDBDateTimePicker;
wwDBComboBox1: TwwDBComboBox;
Label9: TLabel;
wwDBLookupCombo2: TwwDBLookupCombo;
Label10: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
Label14: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo10: TRxDBLookupCombo;
Label22: TLabel;
Label8: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label11: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
RxDBLookupCombo2: TRxDBLookupCombo;
Label12: TLabel;
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_contract_query: Tfrm_crm_client_contract_query;
implementation
uses u_crm_client_contract, my_sys_function, u_data_share;
{$R *.dfm}
procedure Tfrm_crm_client_contract_query.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_crm_client_contract_query.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
begin
str:=' where '+open_data('3003','揽货人','录入人','no','no','no');
if Edit1.text<>''then
begin
if str='' then
str:=' where 合同协议名称 like '+''''+'%'+edit1.text+'%'+''''
else
str:=str+' and 合同协议名称 like '+''''+'%'+edit1.text+'%'+'''';
end;
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 d3.text<>''then
begin
if str='' then
str:=' where 有效日期>='+''''+d3.text+''''
else
str:=str+' and 有效日期>='+''''+d3.text+'''';
end;
if d4.text<>''then
begin
if str='' then
str:=' where 有效日期<='+''''+d4.text+''''
else
str:=str+' and 有效日期<='+''''+d4.text+'''';
end;
if wwDBComboBox1.text<>''then
begin
if str='' then
str:=' where 是否审核='+inttostr(wwDBComboBox1.ItemIndex)
else
str:=str+' and 是否审核='+inttostr(wwDBComboBox1.ItemIndex);
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;
if RxDBLookupCombo10.DisplayValues[0]<>'' then begin
if str='' then
str:=' where 所属部门='''+RxDBLookupCombo10.DisplayValues[0]+''''
else
str:=str+' and 所属部门='''+RxDBLookupCombo10.DisplayValues[0]+'''';
end;
str:='select * from t_crm_client_contract '+str+' order by 录入日期';
table_query(frm_crm_client_contract.t_crm_client_contract,str);
if frm_crm_client_contract.t_crm_client_contract.IsEmpty then
begin
showmessage('没有检索出信息!!');
exit;
end;
close;
end;
procedure Tfrm_crm_client_contract_query.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_crm_client_contract_query.bsSkinButton10Click(Sender);
end;
end;
end.