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.

372 lines
12 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_ch_prnFee_query;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, bsSkinCtrls, wwdblook, wwdbdatetimepicker,inifiles,
Mask, wwdbedit, Wwdotdot, Wwdbcomb, RxLookup, StdCtrls;
type
Tfrm_ch_prnfee_query = class(TForm)
Label10: TLabel;
Label9: TLabel;
Label14: TLabel;
Label15: TLabel;
Label6: TLabel;
Label7: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
Label11: TLabel;
Label20: TLabel;
Label124: TLabel;
Label13: TLabel;
Label16: TLabel;
Label28: TLabel;
Label19: TLabel;
Label22: TLabel;
Label23: TLabel;
Label26: TLabel;
Label27: TLabel;
Label29: TLabel;
Label125: TLabel;
Label30: TLabel;
Label37: TLabel;
Label38: TLabel;
Label39: TLabel;
Label40: TLabel;
Label41: TLabel;
Edit1: TEdit;
RxDBLookupCombo2: TRxDBLookupCombo;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo4: TRxDBLookupCombo;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
wwDBComboBox1: TwwDBComboBox;
wwDBComboBox2: TwwDBComboBox;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
wwDBLookupCombo3: TwwDBLookupCombo;
wwDBLookupCombo52: TwwDBLookupCombo;
RxDBLookupCombo5: TRxDBLookupCombo;
RxDBLookupCombo6: TRxDBLookupCombo;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
RxDBLookupCombo9: TRxDBLookupCombo;
wwDBComboBox3: TwwDBComboBox;
wwDBComboBox4: TwwDBComboBox;
wwDBComboBox5: TwwDBComboBox;
wwDBComboBox6: TwwDBComboBox;
wwDBComboBox7: TwwDBComboBox;
wwDBComboBox11: TwwDBComboBox;
wwDBComboBox13: TwwDBComboBox;
wwDBComboBox14: TwwDBComboBox;
wwDBComboBox15: TwwDBComboBox;
wwDBComboBox16: TwwDBComboBox;
wwDBComboBox17: TwwDBComboBox;
wwDBComboBox18: TwwDBComboBox;
wwDBComboBox19: TwwDBComboBox;
wwDBComboBox20: TwwDBComboBox;
wwDBComboBox21: TwwDBComboBox;
wwDBComboBox22: TwwDBComboBox;
wwDBComboBox24: TwwDBComboBox;
wwDBComboBox25: TwwDBComboBox;
wwDBComboBox26: TwwDBComboBox;
wwDBComboBox27: TwwDBComboBox;
wwDBComboBox28: TwwDBComboBox;
RxDBLookupCombo10: TRxDBLookupCombo;
RxDBLookupCombo12: TRxDBLookupCombo;
wwDBComboBox29: TwwDBComboBox;
wwDBComboBox32: TwwDBComboBox;
RxDBLookupCombo13: TRxDBLookupCombo;
wwDBComboBox33: TwwDBComboBox;
Edit5: TEdit;
wwDBComboBox34: TwwDBComboBox;
Edit6: TEdit;
wwDBLookupCombo49: TwwDBLookupCombo;
wwDBComboBox35: TwwDBComboBox;
Edit7: TEdit;
wwDBComboBox36: TwwDBComboBox;
wwDBComboBox41: TwwDBComboBox;
Edit10: TEdit;
wwDBComboBox42: TwwDBComboBox;
Edit11: TEdit;
wwDBComboBox43: TwwDBComboBox;
wwDBComboBox44: TwwDBComboBox;
wwDBComboBox46: TwwDBComboBox;
bsBusinessSkinForm1: TbsBusinessSkinForm;
Label33: TLabel;
Label12: TLabel;
wwDBComboBox8: TwwDBComboBox;
cmbbPrn: TComboBox;
cmbbYwLb: TComboBox;
wwDBComboBox9: TwwDBComboBox;
RxDBLookupCombo16: TRxDBLookupCombo;
Label17: TLabel;
wwDBComboBox45: TwwDBComboBox;
RxDBLookupCombo15: TRxDBLookupCombo;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
procedure FormShow(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function getprnstr:string ;
procedure loadFindIni ;
procedure writeFindIni ;
end;
var
frm_ch_prnfee_query: Tfrm_ch_prnfee_query;
implementation
{$R *.dfm}
uses u_main,my_sys_function, u_data_share ;
procedure Tfrm_ch_prnfee_query.FormShow(Sender: TObject);
begin
loadfindini;
frm_data_share.t_code_state.Filtered:=false;
frm_data_share.t_code_state.Filter:='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+'<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+'''';
frm_data_share.t_code_state.Filtered:=true;
frm_data_share.t_crm_client_ship.requery;
frm_data_share.t_crm_client_changzhan.requery;
frm_data_share.t_crm_client_truck.requery;
frm_data_share.t_crm_client_baoguan.requery;
frm_data_share.t_crm_client_weituo.requery;
frm_data_share.t_crm_client_daili.requery;
frm_data_share.t_crm_client_huodai.requery;
frm_data_share.t_code_state.first;
while not frm_data_share.t_code_state.eof do
begin
wwDBComboBox1.Items.Add(frm_data_share.t_code_state.fieldbyname('ҵ<><D2B5>״̬').asstring);
frm_data_share.t_code_state.next;
end;
wwDBComboBox1.Items.Add('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_ch_prnfee_query.bsSkinButton10Click(Sender: TObject);
begin
Edit1.text:='';
Edit2.text:='';
Edit3.text:='';
Edit4.text:='';
Edit5.text:='';
Edit6.text:='';
Edit7.text:='';
Edit10.text:='';
Edit11.text:='';
wwDBComboBox1.text:='';
wwDBComboBox2.text:='';
wwDBDateTimePicker1.Clear;
wwDBDateTimePicker2.Clear;
wwDBDateTimePicker3.Clear;
wwDBDateTimePicker4.Clear;
wwDBComboBox3.text:='';
RxDBLookupCombo2.ClearValue;
RxDBLookupCombo9.ClearValue;
wwDBLookupCombo3.text:='';
wwDBLookupCombo49.text:='';
wwDBLookupCombo52.text:='';
RxDBLookupCombo4.ClearValue;
RxDBLookupCombo3.ClearValue;
RxDBLookupCombo6.ClearValue;
RxDBLookupCombo5.ClearValue;
RxDBLookupCombo10.ClearValue;
RxDBLookupCombo12.ClearValue;
RxDBLookupCombo13.ClearValue;
RxDBLookupCombo16.ClearValue;
RxDBLookupCombo15.ClearValue;
cmbbYwLb.ItemIndex:=-1 ;
cmbbPrn.ItemIndex:=-1 ;
end;
procedure Tfrm_ch_prnfee_query.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
function Tfrm_ch_prnfee_query.getprnstr: string;
var
str:widestring;
str_date:string;
begin
str:=' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD> ';
str:=query_tiaojian(1,str,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox15.text,Edit1.text);
str:=query_tiaojian(1,str,'ί<>б<EFBFBD><D0B1><EFBFBD>',wwDBComboBox4.text,Edit4.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><E1B5A5>',wwDBComboBox16.text,Edit2.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><E1B5A5>',wwDBComboBox5.text,Edit3.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>',wwDBComboBox41.text,Edit10.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><ECB5A5>',wwDBComboBox42.text,Edit11.text);
str:=query_tiaojian(1,str,'<27><>Ʊ<EFBFBD><C6B1>',wwDBComboBox33.text,Edit5.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox34.text,Edit6.text);
str:=query_tiaojian(1,str,'ҵ<><D2B5>״̬',wwDBComboBox17.text,wwDBComboBox1.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD>״̬',wwDBComboBox7.text,wwDBComboBox2.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox18.text,wwDBDateTimePicker1.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox6.text,wwDBDateTimePicker2.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox19.text,wwDBDateTimePicker3.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox11.text,wwDBDateTimePicker4.text);
str:=query_tiaojian(1,str,'װ<>˷<EFBFBD>ʽ',wwDBComboBox20.text,wwDBComboBox3.text);
str:=query_tiaojian(1,str,'ί<>е<EFBFBD>λ',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox22.text,RxDBLookupCombo9.DisplayValues[1]);
str:=query_tiaojian(1,str,'װ<><D7B0><EFBFBD><EFBFBD>',wwDBComboBox26.text,wwDBLookupCombo3.text);
str:=query_tiaojian(1,str,'ж<><D0B6><EFBFBD><EFBFBD>',wwDBComboBox27.text,wwDBLookupCombo52.text);
str:=query_tiaojian(1,str,'<27>ͷ<EFBFBD>Ա',wwDBComboBox24.text,RxDBLookupCombo4.DisplayValue);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValue);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD>Ա',wwDBComboBox25.text,RxDBLookupCombo6.DisplayValue);
str:=query_tiaojian(1,str,'¼<><C2BC><EFBFBD><EFBFBD>',wwDBComboBox13.text,RxDBLookupCombo5.DisplayValue);
str:=query_tiaojian(1,str,'<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>',wwDBComboBox32.text,RxDBLookupCombo13.DisplayValues[1]);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD>',wwDBComboBox36.text,wwDBLookupCombo49.text);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD>',wwDBComboBox35.text,Edit7.text);
// str:=query_tiaojian(1,str,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
str:=query_tiaojian(1,str,'ҵ<><D2B5><EFBFBD><EFBFBD>Դ',wwDBComboBox9.text,RxDBLookupCombo16.DisplayValue);
str:=query_tiaojian(1,str,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox46.text,cmbbYwLb.Text);
str:=query_tiaojian(1,str,'<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>',wwDBComboBox28.text,RxDBLookupCombo10.DisplayValue);
str:=query_tiaojian(1,str,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox29.text,RxDBLookupCombo12.DisplayValue);
str:=query_tiaojian(1,str,'<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox45.text,RxDBLookupCombo15.DisplayValue);
if cmbbPrn.Text<>'' then
if str='' then str:='where <20>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ='+inttostr(cmbbPrn.itemindex)
else str:=str+'and <20>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ='+inttostr(cmbbPrn.itemindex) ;
if trim(str)='' then
begin
str:='where '+open_data('0039','¼<><C2BC><EFBFBD><EFBFBD>',
'<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end
else
begin
str:=str+' and '+open_data('0039','¼<><C2BC><EFBFBD><EFBFBD>',
'<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
result:=str ;
end;
procedure Tfrm_ch_prnfee_query.bsSkinButton1Click(Sender: TObject);
begin
writeFindIni;
modalresult:=mrok ;
end;
procedure Tfrm_ch_prnfee_query.loadFindIni;
var
findini:tinifile ;
mysec,tmpname:string;
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
i:integer ;
begin
mysec:=inttostr(321) ;
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'prnFeequery.ini');
try
canload:=findini.ReadBool(mysec,mysec,false);
bsSkinCheckRadioBox1.Checked:=canload ;
if canload then
begin
for i:=0 to ControlCount-1 do
begin
tmpname:=Controls[i].Name ;
if Controls[i] is TwwDBComboBox then
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
if Controls[i] is TwwDBLookupCombo then
(Controls[i] as TwwDBLookupCombo).Text:=findini.ReadString(mysec,TmpName,'') else
if Controls[i] is TEdit then
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
if Controls[i] is TwwDBDateTimePicker then
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
if Controls[i] is TRxDBLookupCombo then
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
end ;
end else
begin
wwDBComboBox15.text:='ģ<><C4A3>';
wwDBComboBox16.text:='ģ<><C4A3>';
wwDBComboBox41.text:='ģ<><C4A3>';
wwDBComboBox42.text:='ģ<><C4A3>';
wwDBComboBox33.text:='ģ<><C4A3>';
wwDBComboBox34.text:='ģ<><C4A3>';
wwDBComboBox4.text:='ģ<><C4A3>';
wwDBComboBox5.text:='ģ<><C4A3>';
wwDBComboBox35.text:='ģ<><C4A3>';
wwDBComboBox36.text:='ģ<><C4A3>';
wwDBComboBox17.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox7.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox18.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox6.text:='С<><D0A1>';
wwDBComboBox11.text:='С<><D0A1>';
wwDBComboBox19.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox20.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox21.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox22.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox24.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox25.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox26.text:='ģ<><C4A3>';
wwDBComboBox27.text:='ģ<><C4A3>';
wwDBComboBox13.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox14.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox28.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox29.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox32.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox43.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox46.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox8.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox9.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox45.text:='<27><><EFBFBD><EFBFBD>';
end ;
finally
findini.free;
end ;
end;
procedure Tfrm_ch_prnfee_query.writeFindIni;
var
findini:tinifile ;
mysec,tmpname:string;
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
i:integer ;
begin
canload:=bsSkinCheckRadioBox1.Checked ;
mysec:=inttostr(321) ;
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'prnFeequery.ini');
try
findini.WriteBool(mysec,mysec,canload);
if canload then
begin
for i:=0 to ControlCount-1 do
begin
tmpname:=Controls[i].Name ;
if Controls[i] is TwwDBComboBox then
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
if Controls[i] is TwwDBLookupCombo then
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBLookupCombo).Text) else
if Controls[i] is TEdit then
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
if Controls[i] is TwwDBDateTimePicker then
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
if Controls[i] is TRxDBLookupCombo then
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
end ;
end ;
finally
findini.free;
end ;
end;
end.