D7myGuhang/坯布码单待检(PBMDDJ.dll)/U_CKProductBSCRCList.pas
DESKTOP-E401PHE\Administrator b27e54cd55 0
2025-08-13 10:59:27 +08:00

176 lines
4.7 KiB
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_CKProductBSCRCList;
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, cxButtonEdit,
cxTextEdit, cxTimeEdit, cxCalendar, cxLookAndFeels,
cxLookAndFeelPainters, cxNavigator;
type
TfrmCKProductBSCRCList = class(TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBExport: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu;
Label3: TLabel;
spname: TEdit;
Label1: TLabel;
Label2: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
CDS_Main: TClientDataSet;
Label6: TLabel;
MJID: TEdit;
Label9: TLabel;
spcolor: TEdit;
MovePanel2: TMovePanel;
cxGrid2: TcxGrid;
TV1: TcxGridDBBandedTableView;
cxGridLevel1: TcxGridLevel;
V1Column27: TcxGridDBBandedColumn;
V1Column30: TcxGridDBBandedColumn;
V1Column31: TcxGridDBBandedColumn;
V1Column35: TcxGridDBBandedColumn;
V1Column37: TcxGridDBBandedColumn;
V1Column41: TcxGridDBBandedColumn;
V1Column43: TcxGridDBBandedColumn;
V1Column44: TcxGridDBBandedColumn;
V1Column45: TcxGridDBBandedColumn;
V1Column1: TcxGridDBBandedColumn;
V1Column2: TcxGridDBBandedColumn;
V1Column3: TcxGridDBBandedColumn;
V1Column4: TcxGridDBBandedColumn;
V1Column5: TcxGridDBBandedColumn;
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 spnameChange(Sender: TObject);
procedure PRTColorChange(Sender: TObject);
private
procedure InitGrid();
{ Private declarations }
public
{ Public declarations }
end;
var
frmCKProductBSCRCList: TfrmCKProductBSCRCList;
implementation
uses
U_DataLink,U_Fun,U_ZDYHelp;
{$R *.dfm}
procedure TfrmCKProductBSCRCList.FormDestroy(Sender: TObject);
begin
frmCKProductBSCRCList:=nil;
end;
procedure TfrmCKProductBSCRCList.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TfrmCKProductBSCRCList.FormCreate(Sender: TObject);
begin
BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-30;
EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp)
end;
procedure TfrmCKProductBSCRCList.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('exec P_CPCRC_List3 '+quotedstr(Trim(FormatDateTime('yyyy-MM-dd',begdate.DateTime)))
+','+quotedstr(Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime))));
Open;
end;
SCreateCDS20(ADOQueryMain,CDS_Main);
SInitCDSData20(ADOQueryMain,CDS_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmCKProductBSCRCList.TBRafreshClick(Sender: TObject);
begin
MovePanel2.Visible:=True;
MovePanel2.Refresh;
InitGrid();
MovePanel2.Visible:=False;
end;
procedure TfrmCKProductBSCRCList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
end;
end;
procedure TfrmCKProductBSCRCList.TBCloseClick(Sender: TObject);
begin
WriteCxBandedGrid(self.Caption+tv1.Name,Tv1,'<27><>Ʒ<EFBFBD><C6B7>ˮ<EFBFBD><CBAE>');
Close;
end;
procedure TfrmCKProductBSCRCList.FormShow(Sender: TObject);
begin
ReadCxBandedGrid(self.Caption+tv1.Name,Tv1,'<27><>Ʒ<EFBFBD><C6B7>ˮ<EFBFBD><CBAE>');
end;
procedure TfrmCKProductBSCRCList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then exit;
TcxGridToExcel('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>',cxGrid2);
end;
procedure TfrmCKProductBSCRCList.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 TfrmCKProductBSCRCList.spnameChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmCKProductBSCRCList.PRTColorChange(Sender: TObject);
begin
TBFind.Click;
end;
end.