224 lines
6.2 KiB
ObjectPascal
224 lines
6.2 KiB
ObjectPascal
unit U_DCYueMoney;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
||
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
||
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
||
cxDropDownEdit, MovePanel, Menus, cxCheckBox, RM_Dataset, RM_System, RM_Common,
|
||
RM_Class, RM_GridReport, RM_e_Xls, cxPC, cxLookAndFeels, cxLookAndFeelPainters,
|
||
cxNavigator, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
|
||
dxBarBuiltInMenu, U_BaseList, dxSkinWXI, dxScrollbarAnnotations, cxContainer,
|
||
dxCore, cxDateUtils, cxTextEdit, cxMaskEdit, cxCalendar;
|
||
|
||
type
|
||
TfrmDCYueMoney = class(TfrmBaseList)
|
||
ToolBar1: TToolBar;
|
||
TBRafresh: TToolButton;
|
||
TBFind: TToolButton;
|
||
TBClose: TToolButton;
|
||
Panel1: TPanel;
|
||
ADOQueryCmd: TADOQuery;
|
||
ADOQueryMain: TADOQuery;
|
||
ADOQueryTemp: TADOQuery;
|
||
DataSource1: TDataSource;
|
||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||
CDS_Main: TClientDataSet;
|
||
Label1: TLabel;
|
||
DCGName: TcxTextEdit;
|
||
Label2: TLabel;
|
||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||
RMDB_Main: TRMDBDataSet;
|
||
RM1: TRMGridReport;
|
||
RMXLSExport1: TRMXLSExport;
|
||
ToolButton2: TToolButton;
|
||
ADOPrint: TADOQuery;
|
||
cxGrid1: TcxGrid;
|
||
Tv1: TcxGridDBBandedTableView;
|
||
v1Column1: TcxGridDBBandedColumn;
|
||
v1Column2: TcxGridDBBandedColumn;
|
||
v1Column4: TcxGridDBBandedColumn;
|
||
v1Column5: TcxGridDBBandedColumn;
|
||
v1Column6: TcxGridDBBandedColumn;
|
||
v1Column8: TcxGridDBBandedColumn;
|
||
v1Column9: TcxGridDBBandedColumn;
|
||
v1Column10: TcxGridDBBandedColumn;
|
||
v1Column12: TcxGridDBBandedColumn;
|
||
v1Column13: TcxGridDBBandedColumn;
|
||
v1Column14: TcxGridDBBandedColumn;
|
||
v1Column16: TcxGridDBBandedColumn;
|
||
v1Column17: TcxGridDBBandedColumn;
|
||
v1Column18: TcxGridDBBandedColumn;
|
||
v1Column20: TcxGridDBBandedColumn;
|
||
v1Column21: TcxGridDBBandedColumn;
|
||
v1Column22: TcxGridDBBandedColumn;
|
||
v1Column25: TcxGridDBBandedColumn;
|
||
v1Column26: TcxGridDBBandedColumn;
|
||
v1Column28: TcxGridDBBandedColumn;
|
||
v1Column29: TcxGridDBBandedColumn;
|
||
v1Column54: TcxGridDBBandedColumn;
|
||
v1Column55: TcxGridDBBandedColumn;
|
||
v1Column56: TcxGridDBBandedColumn;
|
||
v1Column57: TcxGridDBBandedColumn;
|
||
v1Column58: TcxGridDBBandedColumn;
|
||
v1Column59: TcxGridDBBandedColumn;
|
||
v1Column60: TcxGridDBBandedColumn;
|
||
v1Column61: TcxGridDBBandedColumn;
|
||
v1Column62: TcxGridDBBandedColumn;
|
||
v1Column63: TcxGridDBBandedColumn;
|
||
v1Column64: TcxGridDBBandedColumn;
|
||
v1Column65: TcxGridDBBandedColumn;
|
||
cxGrid1Level1: TcxGridLevel;
|
||
ToolButton1: TToolButton;
|
||
v1Column3: TcxGridDBBandedColumn;
|
||
v1Column7: TcxGridDBBandedColumn;
|
||
v1Column11: TcxGridDBBandedColumn;
|
||
v1Column15: TcxGridDBBandedColumn;
|
||
v1Column19: TcxGridDBBandedColumn;
|
||
v1Column23: TcxGridDBBandedColumn;
|
||
v1Column24: TcxGridDBBandedColumn;
|
||
Tv1Column1: TcxGridDBBandedColumn;
|
||
Begdate: TcxDateEdit;
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure TBRafreshClick(Sender: TObject);
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure TBFindClick(Sender: TObject);
|
||
procedure DCGNameChange(Sender: TObject);
|
||
procedure cxPageControl1Change(Sender: TObject);
|
||
procedure ToolButton2Click(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
private
|
||
FLeft, FTop: Integer;
|
||
procedure InitGrid();
|
||
{ Private declarations }
|
||
public
|
||
{ Public declarations }
|
||
FMainid, FSubId, FConNo, FColor, FCodeName: string;
|
||
end;
|
||
|
||
var
|
||
frmDCYueMoney: TfrmDCYueMoney;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_RTFun;
|
||
|
||
{$R *.dfm}
|
||
|
||
procedure TfrmDCYueMoney.FormDestroy(Sender: TObject);
|
||
begin
|
||
inherited;
|
||
frmDCYueMoney := nil;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
inherited;
|
||
Action := caFree;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.InitGrid();
|
||
begin
|
||
//MovePanel2.Visible := True;
|
||
//MovePanel2.Refresh;
|
||
try
|
||
ADOQueryMain.DisableControls;
|
||
with ADOQueryMain do
|
||
begin
|
||
Filtered := False;
|
||
Close;
|
||
sql.Clear;
|
||
SQL.Add('exec P_Kint_Wage_FS_DCGZ :Begdate');
|
||
Parameters.ParamByName('Begdate').Value := Trim(FormatDateTime('yyyy-MM', Begdate.Date));
|
||
Open;
|
||
end;
|
||
SCreateCDS(ADOQueryMain, CDS_Main);
|
||
SInitCDSData(ADOQueryMain, CDS_Main);
|
||
finally
|
||
ADOQueryMain.EnableControls;
|
||
end;
|
||
//MovePanel2.Visible := False;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.TBRafreshClick(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.TBCloseClick(Sender: TObject);
|
||
begin
|
||
WriteCxBandedGrid('Tv11', Tv1, '<27><><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>');
|
||
Close;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.FormShow(Sender: TObject);
|
||
begin
|
||
inherited;
|
||
BegDate.Date := SGetServerDate(ADOQueryTemp);
|
||
ReadCxBandedGrid('Tv11', Tv1, '<27><><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>');
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.TBFindClick(Sender: TObject);
|
||
begin
|
||
if ADOQueryMain.Active then
|
||
begin
|
||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||
SCreateCDS(ADOQueryMain, CDS_Main);
|
||
SInitCDSData(ADOQueryMain, CDS_Main);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.DCGNameChange(Sender: TObject);
|
||
begin
|
||
TBFind.Click;
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.cxPageControl1Change(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.ToolButton2Click(Sender: TObject);
|
||
var
|
||
filepath: string;
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
exit;
|
||
with AdoPrint do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
SQL.Add('exec P_View_DAY_GZCL' + quotedstr(trim(FormatDateTime('yyyy-MM-dd', Begdate.Date))));
|
||
open;
|
||
end;
|
||
|
||
try
|
||
filepath := ExtractFilePath(Application.ExeName) + 'report\<5C><><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʊ<EFBFBD>.rmf';
|
||
if not FileExists(Pchar(filepath)) then
|
||
begin
|
||
application.MessageBox(pchar('<27>ļ<EFBFBD>[' + filepath + ']<5D><><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_IConError);
|
||
exit;
|
||
end;
|
||
RM1.LoadFromFile(filepath);
|
||
RM1.ShowReport;
|
||
finally
|
||
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmDCYueMoney.ToolButton1Click(Sender: TObject);
|
||
begin
|
||
TcxGridToExcel('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', cxGrid1);
|
||
end;
|
||
|
||
end.
|
||
|