270 lines
7.3 KiB
ObjectPascal
270 lines
7.3 KiB
ObjectPascal
unit U_TatDCGCLCXList1;
|
||
|
||
interface
|
||
|
||
uses
|
||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
||
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
|
||
Vcl.ComCtrls, Vcl.ToolWin, Vcl.ExtCtrls, cxGraphics, cxControls,
|
||
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator,
|
||
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxGridCustomTableView,
|
||
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxGridCustomView,
|
||
cxGrid, Data.Win.ADODB, dxBarBuiltInMenu, cxGridCustomPopupMenu,
|
||
cxGridPopupMenu, Datasnap.DBClient, Vcl.StdCtrls, DateUtils, cxContainer,
|
||
cxTextEdit, cxMaskEdit, cxButtonEdit, Vcl.Buttons;
|
||
|
||
type
|
||
TfrmTatDCGCLCXList = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TBRafresh: TToolButton;
|
||
ToolButton1: TToolButton;
|
||
TBClose: TToolButton;
|
||
Panel1: TPanel;
|
||
TV1: TcxGridDBTableView;
|
||
cxGrid1Level1: TcxGridLevel;
|
||
cxGrid1: TcxGrid;
|
||
ADOQueryMain: TADOQuery;
|
||
GPM_1: TcxGridPopupMenu;
|
||
DS_1: TDataSource;
|
||
CDS_1: TClientDataSet;
|
||
TV1Column2: TcxGridDBColumn;
|
||
TV1Column3: TcxGridDBColumn;
|
||
TV1Column4: TcxGridDBColumn;
|
||
TV1Column6: TcxGridDBColumn;
|
||
TV1Column7: TcxGridDBColumn;
|
||
begdate: TDateTimePicker;
|
||
enddate: TDateTimePicker;
|
||
Label1: TLabel;
|
||
Label2: TLabel;
|
||
ToolButton2: TToolButton;
|
||
Label3: TLabel;
|
||
InputLen: TcxButtonEdit;
|
||
JBSCPerson: TEdit;
|
||
TV1Column1: TcxGridDBColumn;
|
||
TV1Column5: TcxGridDBColumn;
|
||
TV1Column8: TcxGridDBColumn;
|
||
TV1Column9: TcxGridDBColumn;
|
||
TV1Column10: TcxGridDBColumn;
|
||
TV1Column11: TcxGridDBColumn;
|
||
Label4: TLabel;
|
||
Panel3: TPanel;
|
||
SpeedButton1: TSpeedButton;
|
||
SpeedButton2: TSpeedButton;
|
||
SpeedButton3: TSpeedButton;
|
||
SpeedButton4: TSpeedButton;
|
||
SpeedButton5: TSpeedButton;
|
||
SpeedButton6: TSpeedButton;
|
||
SpeedButton7: TSpeedButton;
|
||
SpeedButton8: TSpeedButton;
|
||
SpeedButton9: TSpeedButton;
|
||
SpeedButton10: TSpeedButton;
|
||
SpeedButton11: TSpeedButton;
|
||
SpeedButton12: TSpeedButton;
|
||
SpeedButton49: TSpeedButton;
|
||
SpeedButton84: TSpeedButton;
|
||
SpeedButton85: TSpeedButton;
|
||
SpeedButton86: TSpeedButton;
|
||
SpeedButton87: TSpeedButton;
|
||
SpeedButton88: TSpeedButton;
|
||
SpeedButton89: TSpeedButton;
|
||
SpeedButton90: TSpeedButton;
|
||
SpeedButton91: TSpeedButton;
|
||
SpeedButton92: TSpeedButton;
|
||
SpeedButton93: TSpeedButton;
|
||
SpeedButton94: TSpeedButton;
|
||
SpeedButton95: TSpeedButton;
|
||
SpeedButton96: TSpeedButton;
|
||
SpeedButton97: TSpeedButton;
|
||
SpeedButton98: TSpeedButton;
|
||
SpeedButton99: TSpeedButton;
|
||
SpeedButton100: TSpeedButton;
|
||
SpeedButton101: TSpeedButton;
|
||
SpeedButton102: TSpeedButton;
|
||
SpeedButton103: TSpeedButton;
|
||
SpeedButton104: TSpeedButton;
|
||
SpeedButton105: TSpeedButton;
|
||
SpeedButton106: TSpeedButton;
|
||
SpeedButton107: TSpeedButton;
|
||
SpeedButton108: TSpeedButton;
|
||
SpeedButton111: TSpeedButton;
|
||
SpeedButton113: TSpeedButton;
|
||
C_Name: TEdit;
|
||
TV1Column12: TcxGridDBColumn;
|
||
TV1Column13: TcxGridDBColumn;
|
||
TV1Column14: TcxGridDBColumn;
|
||
TV1Column15: TcxGridDBColumn;
|
||
TV1Column16: TcxGridDBColumn;
|
||
TV1Column17: TcxGridDBColumn;
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure TBRafreshClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure InputLenClick(Sender: TObject);
|
||
procedure ToolButton2Click(Sender: TObject);
|
||
procedure SpeedButton113Click(Sender: TObject);
|
||
procedure SpeedButton1Click(Sender: TObject);
|
||
procedure SpeedButton4Click(Sender: TObject);
|
||
procedure Edit1Click(Sender: TObject);
|
||
procedure C_NameChange(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
private
|
||
{ Private declarations }
|
||
public
|
||
procedure InitGrid();
|
||
procedure InitFilter();
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmTatDCGCLCXList: TfrmTatDCGCLCXList;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_RTFun, U_EmployeeSel;
|
||
|
||
{$R *.dfm}
|
||
|
||
procedure TfrmTatDCGCLCXList.C_NameChange(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.Edit1Click(Sender: TObject);
|
||
var
|
||
i: Integer;
|
||
begin
|
||
panel3.Visible := true;
|
||
with Panel3 do
|
||
begin
|
||
|
||
for i := 0 to ControlCount - 1 do
|
||
begin
|
||
if Controls[i] is TSpeedButton then
|
||
begin
|
||
TSpeedButton(Controls[i]).Hint := Trim(TEdit(Sender).Name);
|
||
end;
|
||
end;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.FormCreate(Sender: TObject);
|
||
begin
|
||
WindowState := wsMaximized;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.FormShow(Sender: TObject);
|
||
var
|
||
DayNum: Integer; // <20>洢<EFBFBD><E6B4A2><EFBFBD>ա<EFBFBD><D5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>1-31<33><31>
|
||
begin
|
||
Enddate.Date := Date;
|
||
DayNum := DayOfTheMonth(EndDate.Date);
|
||
BegDate.DateTime := EndDate.DateTime - DayNum + 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.InitFilter();
|
||
begin
|
||
if ADOQueryMain.Active then
|
||
begin
|
||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||
SCreateCDS(ADOQueryMain, CDS_1);
|
||
SInitCDSData(ADOQueryMain, CDS_1);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.InitGrid();
|
||
begin
|
||
var Filtration: string;
|
||
Filtration := FormatDateTime('yyyy-MM-dd', Begdate.Date) + '*' + FormatDateTime('yyyy-MM-dd', Enddate.Date);
|
||
with ADOQueryMain do
|
||
try
|
||
ADOQueryMain.DisableControls;
|
||
|
||
with ADOQueryMain do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('exec P_Tat_Cloth_Inspect_Refresh2 ');
|
||
sql.Add('@Filtration=' + QuotedStr((Trim(Filtration))));
|
||
sql.Add(',@TC_Name=' + QuotedStr((Trim(C_Name.Text))));
|
||
Open;
|
||
end;
|
||
SCreateCDS(ADOQueryMain, CDS_1);
|
||
SInitCDSData(ADOQueryMain, CDS_1);
|
||
|
||
finally
|
||
ADOQueryMain.EnableControls;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.InputLenClick(Sender: TObject);
|
||
begin
|
||
// try
|
||
// frmEmployeeSel := TfrmEmployeeSel.Create(self);
|
||
// with frmEmployeeSel do
|
||
// begin
|
||
// FPost := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
||
// if ShowModal = 1 then
|
||
// begin
|
||
// JBSCPerson.Text := frmEmployeeSel.FRName;
|
||
// SCPerson1.Text := frmEmployeeSel.FRName;
|
||
// JBSCPerson.Hint := frmEmployeeSel.FRCode;
|
||
// InitFilter();
|
||
// end;
|
||
// end;
|
||
// finally
|
||
// frmEmployeeSel.Free;
|
||
// end;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.SpeedButton113Click(Sender: TObject);
|
||
begin
|
||
Panel3.Visible := False;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.SpeedButton1Click(Sender: TObject);
|
||
var
|
||
fsj: string;
|
||
begin
|
||
fsj := Trim(TSpeedButton(Sender).Hint);
|
||
if Trim(fsj) = '' then
|
||
Exit;
|
||
if TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Name = 'KuangHao' then
|
||
Exit;
|
||
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
||
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
|
||
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.SpeedButton4Click(Sender: TObject);
|
||
var
|
||
fsj: string;
|
||
begin
|
||
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
||
if Trim(fsj) = '' then
|
||
Exit;
|
||
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1);
|
||
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.TBCloseClick(Sender: TObject);
|
||
begin
|
||
Close;
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.TBRafreshClick(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
// InitFilter();
|
||
end;
|
||
|
||
procedure TfrmTatDCGCLCXList.ToolButton2Click(Sender: TObject);
|
||
begin
|
||
InitFilter();
|
||
end;
|
||
|
||
end.
|
||
|