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.

188 lines
5.9 KiB
Plaintext

11 months ago
unit u_rp_no_histry_query;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, RxLookup, wwdbdatetimepicker, StdCtrls, Mask,
wwdbedit, Wwdotdot, Wwdbcomb, bsSkinCtrls, ComCtrls;
type
Tfrm_rp_no_histry_query = class(TForm)
Label10: TLabel;
Label5: TLabel;
Label8: TLabel;
Label11: TLabel;
Label9: TLabel;
Label22: TLabel;
Label23: TLabel;
Label14: TLabel;
Label16: TLabel;
Label15: TLabel;
bsSkinButton1: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
wwDBComboBox18: TwwDBComboBox;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBComboBox6: TwwDBComboBox;
wwDBDateTimePicker2: TwwDBDateTimePicker;
wwDBComboBox19: TwwDBComboBox;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBComboBox11: TwwDBComboBox;
wwDBDateTimePicker4: TwwDBDateTimePicker;
wwDBComboBox21: TwwDBComboBox;
RxDBLookupCombo2: TRxDBLookupCombo;
wwDBComboBox28: TwwDBComboBox;
RxDBLookupCombo10: TRxDBLookupCombo;
RxDBLookupCombo12: TRxDBLookupCombo;
wwDBComboBox29: TwwDBComboBox;
wwDBComboBox14: TwwDBComboBox;
RxDBLookupCombo3: TRxDBLookupCombo;
wwDBComboBox25: TwwDBComboBox;
RxDBLookupCombo6: TRxDBLookupCombo;
wwDBComboBox24: TwwDBComboBox;
RxDBLookupCombo4: TRxDBLookupCombo;
bsBusinessSkinForm1: TbsBusinessSkinForm;
Label1: TLabel;
wwDBComboBox3: TwwDBComboBox;
Edit1: TEdit;
Label32: TLabel;
wwDBComboBox38: TwwDBComboBox;
Edit9: TEdit;
Label2: TLabel;
wwDBComboBox1: TwwDBComboBox;
wwDBDateTimePicker5: TwwDBDateTimePicker;
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
function get_no_str(table_str:string;date_query:string):widestring;
procedure wwDBComboBox18KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_no_histry_query: Tfrm_rp_no_histry_query;
no_histry_query_bs:integer;
no_histry_query_limited:string;
no_histry_query_fee:integer;
no_histry_query_table:string;
implementation
uses my_sys_function, u_rp_no_histrytotal,u_data_share;
{$R *.dfm}
function Tfrm_rp_no_histry_query.get_no_str(table_str:string;date_query:string):widestring;
var
str_bill:widestring;
begin
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox19.text,wwDBDateTimePicker3.text);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox11.text,wwDBDateTimePicker4.text);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27>ͷ<EFBFBD>Ա',wwDBComboBox24.text,RxDBLookupCombo4.DisplayValue);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValue);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD>Ա',wwDBComboBox25.text,RxDBLookupCombo6.DisplayValue);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>',wwDBComboBox28.text,RxDBLookupCombo10.DisplayValue);
str_bill:=query_tiaojian(1,str_bill,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox29.text,RxDBLookupCombo12.DisplayValue);
str_bill:=query_tiaojian(2,str_bill,table_str+'<27>ܴ<EFBFBD>',wwDBComboBox3.text,Edit1.text);
str_bill:=query_tiaojian(2,str_bill,table_str+'<27>ܴ<EFBFBD>',wwDBComboBox38.text,Edit9.text);
/////////////////////////?
if no_histry_query_limited<>'no'then
begin
if trim(str_bill)='' then
begin
str_bill:='where '+open_data(no_histry_query_limited,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',table_str+'<27><><EFBFBD><EFBFBD>Ա',table_str+'<27>ͷ<EFBFBD>Ա','no','no');
end
else
begin
str_bill:=str_bill+' and '+open_data(no_histry_query_limited,table_str+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',table_str+'<27><><EFBFBD><EFBFBD>Ա',table_str+'<27>ͷ<EFBFBD>Ա','no','no');
end;
end;
str_bill:=query_tiaojian(1,str_bill,table_str+date_query,wwDBComboBox18.text,wwDBDateTimePicker1.text);
str_bill:=query_tiaojian(1,str_bill,table_str+date_query,wwDBComboBox6.text,wwDBDateTimePicker2.text);
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]);
case no_histry_query_fee of
1:
begin
if str_bill='' then
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
else
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end;
2:
begin
if str_bill='' then
str_bill:='where t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0'
else
str_bill:=str_bill+' and t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>0';
end;
end;
result:=str_bill;
end;
procedure Tfrm_rp_no_histry_query.bsSkinButton10Click(Sender: TObject);
begin
wwDBDateTimePicker1.Clear;
wwDBDateTimePicker2.Clear;
wwDBDateTimePicker3.Clear;
wwDBDateTimePicker4.Clear;
RxDBLookupCombo4.ClearValue;
RxDBLookupCombo3.ClearValue;
RxDBLookupCombo6.ClearValue;
RxDBLookupCombo2.ClearValue;
RxDBLookupCombo10.ClearValue;
RxDBLookupCombo12.ClearValue;
end;
procedure Tfrm_rp_no_histry_query.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_no_histry_query.FormShow(Sender: TObject);
begin
wwDBComboBox18.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox6.text:='С<><D0A1>';
wwDBComboBox11.text:='С<><D0A1>';
wwDBComboBox19.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox21.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox24.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox25.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox28.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox29.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox14.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox3.text:='<27><><EFBFBD><EFBFBD>';
wwDBComboBox38.text:='<27><><EFBFBD><EFBFBD>';
frm_data_share.t_crm_client_all.requery;
frm_data_share.t_sys_employee.requery;
frm_data_share.t_sys_department.requery;
end;
procedure Tfrm_rp_no_histry_query.bsSkinButton1Click(Sender: TObject);
var
str_bill,str_seae,str_seai,str_aire,str_airi:widestring;
sl:tstrings;
begin
close;
end;
procedure Tfrm_rp_no_histry_query.wwDBComboBox18KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_rp_no_histry_query.bsSkinButton1Click(Sender);
end;
end;
end.