233 lines
6.4 KiB
ObjectPascal
233 lines
6.4 KiB
ObjectPascal
![]() |
unit U_PBOuGLtListHZSEL;
|
|||
|
|
|||
|
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, RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System,
|
|||
|
RM_GridReport, cxCheckBox, Menus, MovePanel, BtnEdit, cxLookAndFeels,
|
|||
|
cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
|
|||
|
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
|
|||
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|||
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|||
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|||
|
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|||
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
|||
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
|||
|
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
|||
|
dxSkinscxPCPainter, cxNavigator;
|
|||
|
|
|||
|
type
|
|||
|
TfrmPBOuGLtListHZSEL = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBExport: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
Label1: TLabel;
|
|||
|
Label2: TLabel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
CDS_Print: TClientDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBMain: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N1: TMenuItem;
|
|||
|
N2: TMenuItem;
|
|||
|
MovePanel2: TMovePanel;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
v2Column5: TcxGridDBColumn;
|
|||
|
cxGrid2Level1: TcxGridLevel;
|
|||
|
Label3: TLabel;
|
|||
|
PrtCodeName: TEdit;
|
|||
|
CDS_DH: TClientDataSet;
|
|||
|
ADOQueryDH: TADOQuery;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
v1Column14: TcxGridDBColumn;
|
|||
|
Label14: TLabel;
|
|||
|
KHNAME: TEdit;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
Label4: TLabel;
|
|||
|
C_Color: TEdit;
|
|||
|
v1Column7: TcxGridDBColumn;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
v1Column9: TcxGridDBColumn;
|
|||
|
Label5: TLabel;
|
|||
|
PrtCode: TEdit;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure ConNoMChange(Sender: TObject);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TBExportClick(Sender: TObject);
|
|||
|
procedure TBFindClick(Sender: TObject);
|
|||
|
procedure MPRTCodeNameChange(Sender: TObject);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure N2Click(Sender: TObject);
|
|||
|
procedure PrtCodeNameChange(Sender: TObject);
|
|||
|
procedure CheJianChange(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure Tv1DblClick(Sender: TObject);
|
|||
|
private
|
|||
|
procedure InitGrid();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmPBOuGLtListHZSEL: TfrmPBOuGLtListHZSEL;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_Fun, U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmPBOuGLtListHZSEL := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
//cxGrid1.Align:=alClient;
|
|||
|
|
|||
|
EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
|
|||
|
BegDate.DateTime := EndDate.DateTime - 30;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
|
|||
|
SQL.Add('P_View_HZCKCX ');
|
|||
|
sql.add(' ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' ');
|
|||
|
sql.Add(' ,''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
BegDate.SetFocus;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.ConNoMChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid(Self.Caption + '1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
ReadCxGrid(Self.Caption, Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
ReadCxGrid(Self.Caption + '1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.TBExportClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then
|
|||
|
exit;
|
|||
|
SelExportData(Tv1, ADOQueryMain, '');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.TBFindClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.MPRTCodeNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.N1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, True);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.N2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, False);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.PrtCodeNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.CheJianChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
ModalResult := 1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmPBOuGLtListHZSEL.Tv1DblClick(Sender: TObject);
|
|||
|
begin
|
|||
|
ToolButton1.Click();
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|