RTFormwork/项目代码/RTBasicsV1/F00染色通用窗体/U_DyePlanCardSel.pas
“ddf” 61630656e9 1
2024-07-07 09:35:27 +08:00

230 lines
6.0 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_DyePlanCardSel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
cxCurrencyEdit, cxImage, cxDBEdit, Menus, RM_Common, RM_Class, RM_e_Xls,
RM_Dataset, RM_System, RM_GridReport, cxGridCustomPopupMenu, cxGridPopupMenu,
cxPC, cxSplitter, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, ShellAPI, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu,
U_BaseHelp, System.ImageList, Vcl.ImgList;
type
TfrmDyePlanCardSel = class(TfrmBaseHelp)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
GPM_1: TcxGridPopupMenu;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DS_1: TDataSource;
Label3: TLabel;
OrderNo: TEdit;
v1OrderNo: TcxGridDBColumn;
v1OrdDate: TcxGridDBColumn;
v1DeliveryDate: TcxGridDBColumn;
v1ConNo: TcxGridDBColumn;
v1MPRTSpec: TcxGridDBColumn;
CDS_1: TClientDataSet;
v1CustomerNoName: TcxGridDBColumn;
Label4: TLabel;
CustomerNoName: TEdit;
v1MPRTCodeName: TcxGridDBColumn;
v1MPRTMF: TcxGridDBColumn;
Label8: TLabel;
MPRTCodeName: TEdit;
Label9: TLabel;
ConNo: TEdit;
v1MPRTKZ: TcxGridDBColumn;
Label10: TLabel;
MPRTSpec: TEdit;
Label12: TLabel;
MPRTKZ: TEdit;
v1Column1: TcxGridDBColumn;
v1Column6: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column5: TcxGridDBColumn;
v1Column9: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
Label2: TLabel;
OrdDefNote3: TEdit;
ADOConnection1: TADOConnection;
ToolButton1: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure TBFindClick(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure OrderNoChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure Tv1DblClick(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
DQdate: TDateTime;
procedure InitGrid();
{ Private declarations }
public
FFInt, FCloth: Integer;
fsyrName: string;
canshu1, canshu2: string;
fFlileFlag: string;
{ Public declarations }
end;
var
frmDyePlanCardSel: TfrmDyePlanCardSel;
implementation
uses
U_DataLink, U_RTFun;
{$R *.dfm}
procedure TfrmDyePlanCardSel.FormDestroy(Sender: TObject);
begin
inherited;
frmDyePlanCardSel := nil;
end;
procedure TfrmDyePlanCardSel.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyePlanCardSel.FormCreate(Sender: TObject);
begin
inherited;
try
with ADOConnection1 do
begin
Connected := false;
ConnectionString := DConString;
Connected := true;
end;
ADOQueryBaseCmd.Connection := ADOConnection1;
ADOQueryBaseTemp.Connection := ADOConnection1;
except
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
end;
end;
procedure TfrmDyePlanCardSel.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyePlanCardSel.InitGrid();
var
strwhere: string;
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Close;
Filtered := False;
sql.Clear;
sql.Add('select C.*,B.*');
sql.Add(' from JYCDS_1 C ');
sql.Add('inner join JYOrder_sub B on C.mainID=B.mainID ');
sql.Add('where C.OrdDate>=''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''' ');
sql.Add('and C.OrdDate<''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''' ');
// sql.Add(' and CustomerNoName='''+Trim(CustomerNoName.Text)+'''');
Open;
end;
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
finally
ADOQueryMain.EnableControls;
TBFind.Click;
end;
end;
procedure TfrmDyePlanCardSel.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
end;
procedure TfrmDyePlanCardSel.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyePlanCardSel.ToolButton1Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + 'TV1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure TfrmDyePlanCardSel.OrderNoChange(Sender: TObject);
begin
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
end;
procedure TfrmDyePlanCardSel.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(self.Caption + 'TV1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
BegDate.DateTime := SGetServerDate(ADOQueryTemp) - 90;
EndDate.DateTime := SGetServerDate(ADOQueryTemp);
InitGrid();
end;
procedure TfrmDyePlanCardSel.CheckBox1Click(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyePlanCardSel.CheckBox2Click(Sender: TObject);
begin
TBRafresh.Click;
end;
procedure TfrmDyePlanCardSel.cxTabControl1Change(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyePlanCardSel.Tv1DblClick(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
ModalResult := 1;
end;
end.