|
|
unit u_op_seae_print_mul;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dxExEdtr, ADODB, DB, BusinessSkinForm, dxDBTLCl, dxGrClms,
|
|
|
bsSkinCtrls, dxTL, dxDBCtrl, dxDBGrid, dxCntner, ComCtrls, bsSkinTabs,
|
|
|
StdCtrls;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_print_mul = class(TForm)
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1TEU: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column63: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column64: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column65: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column66: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column67: TdxDBGridMaskColumn;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
t_op_seae1: TDataSource;
|
|
|
t_sys_report: TADOQuery;
|
|
|
t_sys_report1: TDataSource;
|
|
|
t_op_seae: TADOStoredProc;
|
|
|
t_sys_report_employee: TADOQuery;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
Memo1: TMemo;
|
|
|
Memo2: TMemo;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
SaveDialog1: TSaveDialog;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_print_mul: Tfrm_op_seae_print_mul;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses my_sys_function, u_main;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_sys_report.IsEmpty then
|
|
|
begin
|
|
|
showmessage('û<>е<EFBFBD>֤<EFBFBD><D6A4>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><DEB7><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
sys_print_piliang('<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤',t_sys_report.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,t_op_seae,t_op_seae1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,t_sys_report.fieldbyname('CH_ID').asinteger);
|
|
|
|
|
|
if not t_sys_report_employee.Locate('CH_ID',t_sys_report.fieldbyname('CH_ID').asinteger,[])then
|
|
|
begin
|
|
|
t_sys_report_employee.insert;
|
|
|
t_sys_report_employee['CH_ID']:=t_sys_report['CH_ID'];
|
|
|
t_sys_report_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
|
|
|
t_sys_report_employee.post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_sys_report_employee.edit;
|
|
|
t_sys_report_employee['<27><><EFBFBD><EFBFBD>']:=date;
|
|
|
t_sys_report_employee.post;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.FormShow(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
t_sys_report_employee.close;
|
|
|
t_sys_report_employee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').value:=employee;
|
|
|
t_sys_report_employee.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report_employee.open;
|
|
|
if not t_sys_report_employee.IsEmpty then
|
|
|
begin
|
|
|
t_sys_report_employee.first;
|
|
|
while not t_sys_report_employee.eof do
|
|
|
begin
|
|
|
if t_sys_report_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').AsDateTime>=date-30 then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:=t_sys_report_employee.fieldbyname('CH_ID').asstring
|
|
|
else
|
|
|
str:=str+','+t_sys_report_employee.fieldbyname('CH_ID').asstring;
|
|
|
end;
|
|
|
t_sys_report_employee.next;
|
|
|
end;
|
|
|
str:=' and CH_ID in ('+str+')';
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.sql.clear;
|
|
|
t_sys_report.sql.add('select * from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+str+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_sys_report.Parameters[0].value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report.open;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.sql.clear;
|
|
|
t_sys_report.sql.add('select * from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_sys_report.Parameters[0].value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report.open;
|
|
|
end;
|
|
|
if FileExists(ExtractFilePath(application.ExeName)+'exptxt.ini') then memo1.Lines.LoadFromFile(ExtractFilePath(application.ExeName)+'exptxt.ini');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton12Click(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
begin
|
|
|
if bsSkinButton12.caption='<27><><EFBFBD>и<EFBFBD>ʽ'then
|
|
|
begin
|
|
|
bsSkinButton12.caption:='<27><><EFBFBD>ڸ<EFBFBD>ʽ';
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.sql.clear;
|
|
|
t_sys_report.sql.add('select * from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_sys_report.Parameters[0].value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report.open;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not t_sys_report_employee.IsEmpty then
|
|
|
begin
|
|
|
t_sys_report_employee.first;
|
|
|
while not t_sys_report_employee.eof do
|
|
|
begin
|
|
|
if t_sys_report_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').AsDateTime>=date-30 then
|
|
|
begin
|
|
|
if str='' then
|
|
|
str:=t_sys_report_employee.fieldbyname('CH_ID').asstring
|
|
|
else
|
|
|
str:=str+','+t_sys_report_employee.fieldbyname('CH_ID').asstring;
|
|
|
end;
|
|
|
t_sys_report_employee.next;
|
|
|
end;
|
|
|
str:=' and CH_ID in ('+str+')';
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.sql.clear;
|
|
|
t_sys_report.sql.add('select * from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '+str+' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_sys_report.Parameters[0].value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report.open;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_sys_report.close;
|
|
|
t_sys_report.sql.clear;
|
|
|
t_sys_report.sql.add('select * from t_sys_report where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
t_sys_report.Parameters[0].value:='<27><><EFBFBD>˳<EFBFBD><CBB3>ڵ<EFBFBD>֤';
|
|
|
t_sys_report.open;
|
|
|
end;
|
|
|
bsSkinButton12.caption:='<27><><EFBFBD>и<EFBFBD>ʽ';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
sl_tmp:tstringlist;
|
|
|
str_tmp:string;
|
|
|
m,i,n:integer;
|
|
|
begin //<2F><><EFBFBD>ݹ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
Memo2.Lines.clear;
|
|
|
t_op_seae.first;
|
|
|
i:=0;
|
|
|
while not t_op_seae.eof do
|
|
|
begin
|
|
|
i:=i+1;
|
|
|
for n:=0 to memo1.Lines.Count-1 do begin
|
|
|
str_tmp:=Memo1.Lines.Strings[n];
|
|
|
str_tmp:=StringReplace(str_tmp,'[RDNUM]',inttostr(i),[]);
|
|
|
for m:=0 to t_op_seae.FieldCount-1 do begin
|
|
|
str_tmp:=StringReplace(str_tmp,'['+t_op_seae.Fields[m].FieldName+']',t_op_seae.Fields[m].AsString,[]);
|
|
|
end;
|
|
|
Memo2.Lines.Add(str_tmp);
|
|
|
end;
|
|
|
|
|
|
t_op_seae.next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
memo1.Lines.SaveToFile(ExtractFilePath(application.ExeName)+'exptxt.ini');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_print_mul.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
if SaveDialog1.Execute then
|
|
|
begin
|
|
|
memo2.Lines.SaveToFile(SaveDialog1.FileName+'.txt');
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|