|
|
unit u_rp_tai_tasks;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dxExEdtr, DB, ADODB, XPMenu, Menus, dxDBTLCl, dxGrClms, dxTL,
|
|
|
dxDBCtrl, dxDBGrid, dxCntner, Mask, wwdbedit, Wwdotdot, Wwdbcomb,
|
|
|
bsSkinCtrls, wwdblook, RxLookup, wwdbdatetimepicker, StdCtrls, ComCtrls,
|
|
|
bsSkinTabs;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_tai_tasks = class(TForm)
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
N39: TMenuItem;
|
|
|
XPMenu1: TXPMenu;
|
|
|
t_seae_pin1: TDataSource;
|
|
|
t_seae_pin: TADOQuery;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
qry_seae_info: TADOQuery;
|
|
|
ds_seae_info: TDataSource;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
Label6: TLabel;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
Label3: TLabel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
t_seae_pinBC: TIntegerField;
|
|
|
t_seae_pinBC2: TIntegerField;
|
|
|
t_seae_pinBA: TIntegerField;
|
|
|
t_seae_pinBCL: TIntegerField;
|
|
|
t_seae_pinVC: TIntegerField;
|
|
|
t_seae_pinBL: TIntegerField;
|
|
|
t_seae_pinInvoice: TIntegerField;
|
|
|
t_seae_pinDSDesigner: TIntegerField;
|
|
|
qry_seae_infoDSDesigner: TIntegerField;
|
|
|
t_seae_pinDSDesigner2: TIntegerField;
|
|
|
dxDBGrid1BC: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1BA: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1BCL: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1VC: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1BL: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Invoice: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridMaskColumn;
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_tai_tasks: Tfrm_rp_tai_tasks;
|
|
|
|
|
|
implementation
|
|
|
uses u_main, my_sys_function, u_data_share;
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1)
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid(dxdbgrid1,1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
i:Integer;
|
|
|
begin
|
|
|
wwDBDateTimePicker1.Text:='';
|
|
|
wwDBDateTimePicker2.Text:='';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
SQLStr,SQLStr1:string;
|
|
|
begin
|
|
|
SQLStr:=' where 1=1';
|
|
|
SQLStr1:=' where <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>=1';
|
|
|
if wwDBDateTimePicker1.Text<>'' then SQLStr:=SQLStr+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1>>='''+wwDBDateTimePicker1.Text+'''';
|
|
|
if wwDBDateTimePicker2.Text<>'' then SQLStr:=SQLStr+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1><='''+wwDBDateTimePicker2.Text+' 23:59:59'+'''';
|
|
|
if wwDBDateTimePicker1.Text<>'' then SQLStr1:=SQLStr1+' and <20>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+wwDBDateTimePicker1.Text+'''';
|
|
|
if wwDBDateTimePicker2.Text<>'' then SQLStr1:=SQLStr1+' and <20>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+wwDBDateTimePicker2.Text+' 23:59:59'+'''';
|
|
|
|
|
|
with t_seae_pin do
|
|
|
begin
|
|
|
Close;
|
|
|
SQL.Clear;
|
|
|
SQL.Add('select sum(t.BC<42>Զ<EFBFBD>) as BC<42>Զ<EFBFBD>,SUM(t.BC<42>ֶ<EFBFBD>) as BC<42>ֶ<EFBFBD>,sum(t.BA) as BA,sum(t.BCL) as BCL,sum(t.VC) as VC, '
|
|
|
+' sum(t.BL) as BL,sum(t.Invoice) as Invoice,sum(t.<2E><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,s.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
+' from (select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''BC'' AND <20><><EFBFBD>ɷ<EFBFBD>ʽ=''<27>Զ<EFBFBD>'' then 1 else 0 end BC<42>Զ<EFBFBD>'
|
|
|
+',case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''BC'' AND <20><><EFBFBD>ɷ<EFBFBD>ʽ<>''<27>Զ<EFBFBD>'' then 1 else 0 end BC<42>ֶ<EFBFBD>'
|
|
|
+',case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''BA'' THEN 1 ELSE 0 END as BA, case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''BCL'' THEN 1 ELSE 0 END as BCL'
|
|
|
+',case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''VC'' THEN 1 ELSE 0 END as VC, case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''ORIGINAL'' THEN 1 ELSE 0 END as BL'
|
|
|
+',case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''Invoic'' THEN 1 ELSE 0 END as Invoice'
|
|
|
+',case when <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> not IN (''BC'',''BA'',''BCL'',''VC'',''ORIGINAL'',''Invoic'') THEN 1 else 0 end as <20><><EFBFBD><EFBFBD>'
|
|
|
+' from t_op_task '+SQLStr+' ) t left outer join '
|
|
|
+' (select COUNT(*) as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_op_seae_sign_main '+SQLStr1+' ) s on 1=1 group by s.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
Close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
savereggrid(dxdbgrid1,'<27><><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>');
|
|
|
frm_rp_tai_tasks.Hide;
|
|
|
frm_rp_tai_tasks.ManualFloat(frm_rp_tai_tasks.BoundsRect );
|
|
|
frm_main.freeTabs('frm_rp_tai_tasks');
|
|
|
action:=cafree;
|
|
|
frm_rp_tai_tasks:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_tai_tasks.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
wwDBDateTimePicker1.Date:=Date;
|
|
|
wwDBDateTimePicker2.Date:=Date;
|
|
|
loadreggrid(dxdbgrid1,false,'<27><><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>');
|
|
|
bsSkinButton1Click(nil);
|
|
|
end;
|
|
|
|
|
|
end.
|