D7szYidui/经轴仓库(Warehouse.dll)/U_EmptyRollerkCList.pas
DESKTOP-E401PHE\Administrator ef99fc8b5e 移交
2025-07-19 09:32:10 +08:00

183 lines
4.3 KiB
ObjectPascal
Raw Permalink 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_EmptyRollerkCList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
RM_Common, RM_Class, RM_GridReport, RM_System, RM_Dataset, MMSystem, Menus,
BtnEdit;
type
TfrmEmptyRollerkCList = class(TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBExport: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1Qty: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
ADOQueryCmd: TADOQuery;
ADOQueryTmp: TADOQuery;
DataSource1: TDataSource;
CDS_Main: TClientDataSet;
cxGridPopupMenu1: TcxGridPopupMenu;
TOk: TToolButton;
Label7: TLabel;
ADOQueryPrint: TADOQuery;
RMDB_Main: TRMDBDataSet;
RM1: TRMGridReport;
ADOQueryMain: TADOQuery;
v1Column16: TcxGridDBColumn;
Label31: TLabel;
FactoryName: TEdit;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
ToolButton2: TToolButton;
v1Ssel: TcxGridDBColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure P_CodeNameChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure TOkClick(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
private
procedure InitGrid();
procedure SetStatus();
{ Private declarations }
public
fCKName, canshu1: string;
{ Public declarations }
end;
var
frmEmptyRollerkCList: TfrmEmptyRollerkCList;
implementation
uses
U_DataLink, U_Fun10, U_ZDYHelp;
{$R *.dfm}
procedure TfrmEmptyRollerkCList.SetStatus();
begin
TOk.Visible := false;
TOk.Visible := false;
if Trim(canshu1) = 'ѡ<><D1A1>' then
begin
TOk.Visible := true;
v1Ssel.Visible := true;
end;
if Trim(canshu1) = '<27><><EFBFBD><EFBFBD>' then
begin
TOk.Visible := true;
v1Ssel.Visible := true;
end;
end;
procedure TfrmEmptyRollerkCList.InitGrid();
begin
try
with adoqueryMain do
begin
close;
sql.Clear;
sql.Add(' exec P_View_EmptyRollerkC ');
open;
end;
SCreateCDS20(adoqueryMain, CDS_Main);
SInitCDSData20(adoqueryMain, CDS_Main);
finally
end;
end;
procedure TfrmEmptyRollerkCList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
writeCxGrid(self.Caption, Tv1, '<27>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>');
if Trim(canshu1) = 'ѡ<><D1A1>' then
Action := cahide
else
Action := cafree;
end;
procedure TfrmEmptyRollerkCList.FormDestroy(Sender: TObject);
begin
frmEmptyRollerkCList := nil;
end;
procedure TfrmEmptyRollerkCList.P_CodeNameChange(Sender: TObject);
begin
if adoqueryMain.Active = False then
Exit;
SDofilter(adoqueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(adoqueryMain, CDS_Main);
SInitCDSData20(adoqueryMain, CDS_Main);
end;
procedure TfrmEmptyRollerkCList.FormShow(Sender: TObject);
begin
readCxGrid(self.Caption, Tv1, '<27>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>');
SetStatus();
InitGrid();
end;
procedure TfrmEmptyRollerkCList.TBCloseClick(Sender: TObject);
begin
close;
end;
procedure TfrmEmptyRollerkCList.TBRafreshClick(Sender: TObject);
begin
initGrid();
end;
procedure TfrmEmptyRollerkCList.TBExportClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
TcxGridToExcel(self.Caption, cxgrid1);
end;
procedure TfrmEmptyRollerkCList.TOkClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
ModalResult := 1;
end;
procedure TfrmEmptyRollerkCList.N1Click(Sender: TObject);
begin
SelOKNo(CDS_Main, true);
end;
procedure TfrmEmptyRollerkCList.N2Click(Sender: TObject);
begin
SelOKNo(CDS_Main, false);
end;
procedure TfrmEmptyRollerkCList.ToolButton2Click(Sender: TObject);
begin
if adoqueryMain.Active = False then
Exit;
SDofilter(adoqueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(adoqueryMain, CDS_Main);
SInitCDSData20(adoqueryMain, CDS_Main);
end;
end.