2025-04-30 20:03:19 +08:00
|
|
|
|
unit U_ClothHCList;
|
|
|
|
|
|
|
|
|
|
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,
|
2025-08-09 17:27:54 +08:00
|
|
|
|
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, cxDropDownEdit,
|
|
|
|
|
cxCheckBox, 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;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
TfrmClothHCList = class(TForm)
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
TBRafresh: TToolButton;
|
|
|
|
|
TBFind: TToolButton;
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
BegDate: TDateTimePicker;
|
|
|
|
|
EndDate: TDateTimePicker;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
OrderNoM: TEdit;
|
|
|
|
|
Order_Main: TClientDataSet;
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
PRTColor: TEdit;
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
TV2: TcxGridDBTableView;
|
|
|
|
|
V2filltime: TcxGridDBColumn;
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
V2Column10: TcxGridDBColumn;
|
|
|
|
|
V2Column13: TcxGridDBColumn;
|
|
|
|
|
V2Subid: TcxGridDBColumn;
|
|
|
|
|
V2KHOrderNo: TcxGridDBColumn;
|
|
|
|
|
V2Column14: TcxGridDBColumn;
|
|
|
|
|
SubID: TEdit;
|
|
|
|
|
conNo: TEdit;
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
V2Column15: TcxGridDBColumn;
|
|
|
|
|
V2Column16: TcxGridDBColumn;
|
|
|
|
|
prtCodeName: TEdit;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
prtspec: TEdit;
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
V2CustomerNoName: TcxGridDBColumn;
|
|
|
|
|
V2MPRTNiuDu: TcxGridDBColumn;
|
|
|
|
|
V2MPRTBZNote: TcxGridDBColumn;
|
|
|
|
|
V2PRTOrderQty: TcxGridDBColumn;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
V2OrderUnit: TcxGridDBColumn;
|
|
|
|
|
Button1: TButton;
|
|
|
|
|
V2Column1: TcxGridDBColumn;
|
|
|
|
|
V2Column2: TcxGridDBColumn;
|
|
|
|
|
PRTHX: TEdit;
|
|
|
|
|
Label5: TLabel;
|
2025-08-09 17:27:54 +08:00
|
|
|
|
TV2Column1: TcxGridDBColumn;
|
|
|
|
|
TV2Column2: TcxGridDBColumn;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
procedure FormDestroy(Sender: TObject);
|
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
procedure TBFindClick(Sender: TObject);
|
|
|
|
|
procedure TBRafreshClick(Sender: TObject);
|
|
|
|
|
procedure OrderNoMChange(Sender: TObject);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure OrderNoMKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
procedure TV2DblClick(Sender: TObject);
|
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
|
private
|
2025-08-09 17:27:54 +08:00
|
|
|
|
FInt, PFInt: Integer;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
procedure InitGrid();
|
|
|
|
|
procedure InitForm();
|
2025-08-09 17:27:54 +08:00
|
|
|
|
procedure InitGridWSQL(FWSQL: string);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
2025-08-09 17:27:54 +08:00
|
|
|
|
fType: string;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frmClothHCList: TfrmClothHCList;
|
|
|
|
|
|
|
|
|
|
implementation
|
2025-08-09 17:27:54 +08:00
|
|
|
|
|
2025-04-30 20:03:19 +08:00
|
|
|
|
uses
|
2025-08-09 17:27:54 +08:00
|
|
|
|
U_DataLink, U_ClothContractInPut, U_Fun, U_ProductOrderList, U_ZDYHelp,
|
|
|
|
|
U_ProductOrderNewList_JD;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.FormDestroy(Sender: TObject);
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
frmClothHCList := nil;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
2025-08-09 17:27:54 +08:00
|
|
|
|
procedure TfrmClothHCList.FormClose(Sender: TObject; var Action: TCloseAction);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
Action := caFree;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.TBCloseClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
2025-08-09 17:27:54 +08:00
|
|
|
|
WriteCxGrid(self.Caption + tv2.Name, Tv2, 'ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.InitGrid();
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
//ADOQueryMain.DisableControls;
|
|
|
|
|
with ADOQueryMain do
|
2025-08-09 17:27:54 +08:00
|
|
|
|
begin
|
2025-04-30 20:03:19 +08:00
|
|
|
|
Close;
|
2025-08-09 17:27:54 +08:00
|
|
|
|
Filtered := False;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('exec P_View_HC :begdate,:enddate,:WSQL');
|
2025-08-09 17:27:54 +08:00
|
|
|
|
Parameters.ParamByName('begdate').Value := FormatDateTime('yyyy-MM-dd', BegDate.Date);
|
|
|
|
|
Parameters.ParamByName('enddate').Value := FormatDateTime('yyyy-MM-dd', EndDate.Date + 1);
|
|
|
|
|
Parameters.ParamByName('WSQL').Value := '';
|
2025-04-30 20:03:19 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-08-09 17:27:54 +08:00
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
finally
|
|
|
|
|
//ADOQueryMain.EnableControls;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-08-09 17:27:54 +08:00
|
|
|
|
procedure TfrmClothHCList.InitGridWSQL(FWSQL: string);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
Filtered := False;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('exec P_View_HC :begdate,:enddate,:WSQL');
|
2025-08-09 17:27:54 +08:00
|
|
|
|
Parameters.ParamByName('begdate').Value := '2014-01-01';
|
|
|
|
|
Parameters.ParamByName('enddate').Value := '2050-01-01';
|
|
|
|
|
Parameters.ParamByName('WSQL').Value := FWSQL;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-08-09 17:27:54 +08:00
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
finally
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.InitForm();
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
ReadCxGrid(self.Caption + tv2.Name, Tv2, 'ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
BegDate.DateTime := EndDate.DateTime;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
//InitGrid();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.TBFindClick(Sender: TObject);
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if ADOQueryMain.Active = False then
|
|
|
|
|
Exit;
|
|
|
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.TBRafreshClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
InitGrid();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.OrderNoMChange(Sender: TObject);
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if ADOQueryMain.Active = False then
|
|
|
|
|
Exit;
|
|
|
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.FormShow(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
InitForm();
|
|
|
|
|
TBRafresh.Click;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-08-09 17:27:54 +08:00
|
|
|
|
procedure TfrmClothHCList.OrderNoMKeyPress(Sender: TObject; var Key: Char);
|
2025-04-30 20:03:19 +08:00
|
|
|
|
var
|
2025-08-09 17:27:54 +08:00
|
|
|
|
fsj: string;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if Key = #13 then
|
2025-04-30 20:03:19 +08:00
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if Length(Trim(OrderNoM.Text)) < 4 then
|
|
|
|
|
Exit;
|
|
|
|
|
fsj := ' and B.OrderNo like ''' + '%' + Trim(OrderNoM.Text) + '%' + '''';
|
2025-04-30 20:03:19 +08:00
|
|
|
|
InitGridWSQL(fsj);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.TV2DblClick(Sender: TObject);
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if fType = '10' then
|
|
|
|
|
frmClothHCList.ModalResult := 1;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothHCList.Button1Click(Sender: TObject);
|
|
|
|
|
begin
|
2025-08-09 17:27:54 +08:00
|
|
|
|
if fType = '10' then
|
|
|
|
|
frmClothHCList.ModalResult := 1;
|
2025-04-30 20:03:19 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|
2025-08-09 17:27:54 +08:00
|
|
|
|
|