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.

182 lines
5.6 KiB
Plaintext

11 months ago
unit u_rp_wy;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, wwdbdatetimepicker, RxLookup, bsSkinCtrls, DB, ADODB,
dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner,
ExtCtrls, Menus;
type
Tfrm_rp_wy = class(TForm)
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
Label2: TLabel;
bsSkinButton5: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
wwDBDateTimePicker1: TwwDBDateTimePicker;
ds_rp_wy: TDataSource;
t_rp_wy: TADOQuery;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label3: TLabel;
Label4: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
bsSkinPanel2: TbsSkinPanel;
dxDBGrid2: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridColumn;
dxDBGrid2Column2: TdxDBGridMaskColumn;
dxDBGrid2RMB: TdxDBGridCurrencyColumn;
dxDBGrid2USD: TdxDBGridCurrencyColumn;
bsSkinPanel3: TbsSkinPanel;
dxDBGrid2Column6: TdxDBGridColumn;
dxDBGrid2Column7: TdxDBGridColumn;
dxDBGrid2Column8: TdxDBGridColumn;
dxDBGrid2Column9: TdxDBGridColumn;
dxDBGrid1: TdxDBGrid;
t_rp_wyjl: TADOQuery;
ds_rp_wyjl: TDataSource;
dxDBGrid1RMB: TdxDBGridCurrencyColumn;
dxDBGrid1USD: TdxDBGridCurrencyColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridDateColumn;
dxDBGrid1Column7: TdxDBGridCheckColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridCheckColumn;
bsSkinRadioGroup1: TbsSkinRadioGroup;
RxDBLookupCombo1: TRxDBLookupCombo;
PopupMenu2: TPopupMenu;
N16: TMenuItem;
PopupMenu1: TPopupMenu;
MenuItem1: TMenuItem;
procedure bsSkinButton2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure dxDBGrid2Click(Sender: TObject);
procedure bsSkinRadioGroup1Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_wy: Tfrm_rp_wy;
BillSQLStr,BillAmoutStr,SQLStr:string;
implementation
uses u_main,my_sys_function,u_data_share, u_sys_progress ;
{$R *.dfm}
procedure Tfrm_rp_wy.bsSkinButton2Click(Sender: TObject);
begin
sys_print('ΥԼͳ<D4BC>Ʊ<EFBFBD><C6B1><EFBFBD>',2,nil,nil,nil,nil,ds_rp_wy,NIL,NIL,NIL,nil,nil,nil);
end;
procedure Tfrm_rp_wy.FormShow(Sender: TObject);
var
SQLStr:string;
begin
bsSkinButton1Click(nil);
if t_rp_wy.IsEmpty then
begin
dxdbgrid1.DataSource:=nil;
Exit;
end;
dxdbgrid1.DataSource:=ds_rp_wyjl;
if bsSkinRadioGroup1.ItemIndex=0 then SQLStr:='select top 2 * from t_op_bill_fangdanwy where ΥԼ<CEA5><D4BC>־=1 and ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
if bsSkinRadioGroup1.ItemIndex=1 then SQLStr:='select * from t_op_bill_fangdanwy where ΥԼ<CEA5><D4BC>־=1 and ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
if bsSkinRadioGroup1.ItemIndex=2 then SQLStr:='select * from t_op_bill_fangdanwy where ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
with t_rp_wyjl do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
end;
procedure Tfrm_rp_wy.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_wy.bsSkinButton1Click(Sender: TObject);
var
s,s1,s2,s3,s4:string;
begin
if RxDBLookupCombo1.DisplayValue='' then s1:='' else s1:=' and ί<>е<EFBFBD>λ='+QuotedStr(RxDBLookupCombo1.DisplayValues[1]);
if wwDBDateTimePicker1.Text='' then s2:='' else s2:=' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+QuotedStr(wwDBDateTimePicker1.Text);
if wwDBDateTimePicker2.Text='' then s3:='' else s3:=' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+QuotedStr(wwDBDateTimePicker2.Text);
if RxDBLookupCombo2.DisplayValue='' then s4:='' else s4:=' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+QuotedStr(RxDBLookupCombo2.DisplayValues[0]);
s:=s1+s2+s3+s4;
BillSQLStr:=' select tid <20><><EFBFBD><EFBFBD>,* from t_op_bill_fangdantepi where 1=1 '+s+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc ';
with t_rp_wy do
begin
Close;
SQL.Clear;
SQL.Add(BillSQLStr);
Open;
end;
dxDBGrid2Click(nil);
end;
procedure Tfrm_rp_wy.dxDBGrid2Click(Sender: TObject);
var
SQLStr:string;
begin
if t_rp_wy.IsEmpty then
begin
dxdbgrid1.DataSource:=nil;
Exit;
end;
dxdbgrid1.DataSource:=ds_rp_wyjl;
if bsSkinRadioGroup1.ItemIndex=0 then SQLStr:='select top 2 * from t_op_bill_fangdanwy where ΥԼ<CEA5><D4BC>־=1 and ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
if bsSkinRadioGroup1.ItemIndex=1 then SQLStr:='select * from t_op_bill_fangdanwy where ΥԼ<CEA5><D4BC>־=1 and ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
if bsSkinRadioGroup1.ItemIndex=2 then SQLStr:='select * from t_op_bill_fangdanwy where ί<>е<EFBFBD>λ='+QuotedStr(t_rp_wy.fieldbyname('ί<>е<EFBFBD>λ').AsString)
+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD> desc';
with t_rp_wyjl do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
end;
procedure Tfrm_rp_wy.bsSkinRadioGroup1Click(Sender: TObject);
begin
dxDBGrid2Click(nil);
end;
procedure Tfrm_rp_wy.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid2);
end;
procedure Tfrm_rp_wy.MenuItem1Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
end.