268 lines
8.3 KiB
ObjectPascal
268 lines
8.3 KiB
ObjectPascal
![]() |
unit U_ClothContractList_SJDMX;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
|||
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
|||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
|
|||
|
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|||
|
cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class,
|
|||
|
RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxCheckBox,
|
|||
|
cxCurrencyEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
|||
|
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|||
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
|
|||
|
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
|
|||
|
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
|||
|
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
|||
|
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
|||
|
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
|||
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter;
|
|||
|
|
|||
|
type
|
|||
|
TfrmClothContractList_SJDMX = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
Label1: TLabel;
|
|||
|
Label2: TLabel;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
Label3: TLabel;
|
|||
|
ConNo: TEdit;
|
|||
|
Label5: TLabel;
|
|||
|
C_CodeName: TEdit;
|
|||
|
TBExport: TToolButton;
|
|||
|
Label4: TLabel;
|
|||
|
C_Spec: TEdit;
|
|||
|
ScrollBox1: TScrollBox;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
v1OrderUnit: TcxGridDBColumn;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
ClientDataSet3: TClientDataSet;
|
|||
|
DataSource2: TDataSource;
|
|||
|
DataSource3: TDataSource;
|
|||
|
ClientDataSet2: TClientDataSet;
|
|||
|
v1Qty1: TcxGridDBColumn;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBMain: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
CDS_PRT: TClientDataSet;
|
|||
|
Label6: TLabel;
|
|||
|
FactoryNoName: TEdit;
|
|||
|
v1Column12: TcxGridDBColumn;
|
|||
|
v1Column13: TcxGridDBColumn;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxStyle_gridRow: TcxStyle;
|
|||
|
cxStyle_gridFoot: TcxStyle;
|
|||
|
cxStyle_gridHead: TcxStyle;
|
|||
|
cxStyle_gridGroupBox: TcxStyle;
|
|||
|
cxStyle_yellow: TcxStyle;
|
|||
|
cxStyle_Red: TcxStyle;
|
|||
|
cxStyle_fontBlack: TcxStyle;
|
|||
|
cxStyle_fontclFuchsia: TcxStyle;
|
|||
|
cxStyle_fontclPurple: TcxStyle;
|
|||
|
cxStyle_fontclGreen: TcxStyle;
|
|||
|
cxStyle_fontclBlue: TcxStyle;
|
|||
|
cxStyle_fontclTeal: TcxStyle;
|
|||
|
cxStyle_fontclOlive: TcxStyle;
|
|||
|
v1Column18: TcxGridDBColumn;
|
|||
|
v1Column19: TcxGridDBColumn;
|
|||
|
v1Column11: TcxGridDBColumn;
|
|||
|
v1Column15: TcxGridDBColumn;
|
|||
|
Label7: TLabel;
|
|||
|
JHPlace: TEdit;
|
|||
|
Order_Main: TClientDataSet;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure TBFindClick(Sender: TObject);
|
|||
|
procedure TBExportClick(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure ConNoChange(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
private
|
|||
|
FInt, PFInt: Integer;
|
|||
|
// Fcphh,FfactoryName:string;
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitForm();
|
|||
|
function DelData(): Boolean;
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
Fcphh, FfactoryName: string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmClothContractList_SJDMX: TfrmClothContractList_SJDMX;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_ClothContractInPut, U_ClothContractList_SJDCK, U_Fun,
|
|||
|
U_ProductOrderList, U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmClothContractList_SJDMX := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
ScrollBox1.Align := alClient;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
WriteCxGrid(self.Caption, Tv1, 'ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
Filtered := False;
|
|||
|
sql.Add('exec P_Get_FabricStockHz_PC');
|
|||
|
sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' ');
|
|||
|
sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' ');
|
|||
|
sql.Add(',@conType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ'' ');
|
|||
|
sql.Add(',@cphh=''' + Fcphh + ''' ');
|
|||
|
sql.Add(',@factoryName=''' + FfactoryName + ''' ');
|
|||
|
// sql.Add(',@subid='''+Fsubid+''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.InitForm();
|
|||
|
begin
|
|||
|
ReadCxGrid(self.Caption, Tv1, 'ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 90;
|
|||
|
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.TBFindClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active = False then
|
|||
|
Exit;
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmClothContractList_SJDMX.DelData(): Boolean;
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.TBExportClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then
|
|||
|
Exit;
|
|||
|
TcxGridToExcel('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>', cxGrid1);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.ConNoChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active = False then
|
|||
|
Exit;
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
InitForm();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
|||
|
var
|
|||
|
FValue: string;
|
|||
|
FBounds: TRect;
|
|||
|
begin
|
|||
|
FBounds := AViewInfo.Bounds;
|
|||
|
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
|||
|
begin
|
|||
|
ACanvas.FillRect(FBounds);
|
|||
|
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
|
|||
|
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
|||
|
InflateRect(FBounds, -1, -1);
|
|||
|
ACanvas.Font.Color := clBlack;
|
|||
|
ACanvas.Brush.Style := bsClear;
|
|||
|
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
|||
|
ADone := True;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmClothContractList_SJDMX.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
frmClothContractList_SJDCK := TfrmClothContractList_SJDCK.Create(Application);
|
|||
|
with frmClothContractList_SJDCK do
|
|||
|
begin
|
|||
|
// PState:=1;
|
|||
|
// Fcphh := Trim(Self.Order_Main.fieldbyname('CPHH').AsString);
|
|||
|
// FfactoryName := Trim(Self.Order_Main.fieldbyname('JHPlace').AsString);
|
|||
|
Fsubid := Trim(Self.Order_Main.fieldbyname('subid').AsString);
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmClothContractList_SJDCK.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|