174 lines
5.2 KiB
ObjectPascal
174 lines
5.2 KiB
ObjectPascal
|
|
unit U_DCCarMX_Worker;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
|
cxTextEdit, cxDBLookupComboBox, cxContainer, cxDropDownEdit, cxPC, Menus,
|
|||
|
|
TeEngine, Series, TeeProcs, Chart, DbChart, GanttCh, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmDCCarMX_Worker = class(TForm)
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn15: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn16: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn17: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn18: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn19: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn20: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn21: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Panel6: TPanel;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn13: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn14: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
ClientDataSet2: TClientDataSet;
|
|||
|
|
cxGridPopupMenu3: TcxGridPopupMenu;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ClientDataSet3: TClientDataSet;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn21CustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
private
|
|||
|
|
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
public
|
|||
|
|
FBegdate,FEnddate:TDate;
|
|||
|
|
FCarNo,FWorker:String;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmDCCarMX_Worker: TfrmDCCarMX_Worker;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmDCCarMX_Worker.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_BI_DC_CarNo_MX_Worker :begdate,:enddate,:CarNo,:Worker,:Type');
|
|||
|
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',FBegdate));
|
|||
|
|
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',FEnddate));;
|
|||
|
|
Parameters.ParamByName('CarNo').Value:=FCarNo;
|
|||
|
|
Parameters.ParamByName('Worker').Value:=FWorker;
|
|||
|
|
Parameters.ParamByName('Type').Value:='JSDate';
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_BI_DC_CarNo_MX_Worker :begdate,:enddate,:CarNo,:Worker,:Type');
|
|||
|
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',FBegdate));
|
|||
|
|
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',FEnddate));;
|
|||
|
|
Parameters.ParamByName('CarNo').Value:=FCarNo;
|
|||
|
|
Parameters.ParamByName('Worker').Value:=FWorker;
|
|||
|
|
Parameters.ParamByName('Type').Value:='C_CodeName';
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet2);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet2);
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmDCCarMX_Worker.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caHide;;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmDCCarMX_Worker.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Caption:=FCarNo+'<27><>'+FWorker+'<27><>'+'<27><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>ϸ';
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmDCCarMX_Worker.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmDCCarMX_Worker:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmDCCarMX_Worker.cxGridDBColumn21CustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
Id0,Id1,Id11,Id21:Integer;
|
|||
|
|
begin
|
|||
|
|
Id0:=TV1.GetColumnByFieldName('Qty').Index;
|
|||
|
|
Id1:=TV1.GetColumnByFieldName('DayStr').Index;
|
|||
|
|
if AViewInfo.GridRecord.Values[Id0]>15000 then
|
|||
|
|
begin
|
|||
|
|
if AViewInfo.GridRecord.Values[Id0]>22500 then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if (AViewInfo.GridRecord.Values[Id1]<>'01') and (AViewInfo.GridRecord.Values[Id1]<>'11')
|
|||
|
|
and (AViewInfo.GridRecord.Values[Id1]<>'21') then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|