217 lines
6.7 KiB
ObjectPascal
217 lines
6.7 KiB
ObjectPascal
unit U_KnitClothWaitReleased;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||
cxEdit, DB, cxDBData, StdCtrls, ADODB, DBClient, ComCtrls, ExtCtrls,
|
||
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
||
cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu,
|
||
cxGridPopupMenu, cxCheckBox, Menus, cxLookAndFeels, cxLookAndFeelPainters,
|
||
cxNavigator, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
|
||
dxBarBuiltInMenu, Vcl.ToolWin, dxSkinBasic, 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, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
|
||
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
|
||
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
||
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
|
||
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
|
||
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
|
||
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI,
|
||
dxSkinXmas2008Blue, dxScrollbarAnnotations, cxContainer, cxTextEdit;
|
||
|
||
type
|
||
TfrmKnitClothWaitReleased = class(TForm)
|
||
cxGrid1: TcxGrid;
|
||
Tv2: TcxGridDBTableView;
|
||
v1OrderNo: TcxGridDBColumn;
|
||
cxGridDBColumn2: TcxGridDBColumn;
|
||
v1Column10: TcxGridDBColumn;
|
||
v1Column14: TcxGridDBColumn;
|
||
cxGridDBColumn3: TcxGridDBColumn;
|
||
v1PRTMF: TcxGridDBColumn;
|
||
v1PRTKZ: TcxGridDBColumn;
|
||
cxGrid1Level1: TcxGridLevel;
|
||
Panel1: TPanel;
|
||
Label2: TLabel;
|
||
OrderNo: TcxTextEdit;
|
||
Label3: TLabel;
|
||
PRTColor: TcxTextEdit;
|
||
CDS_OrderSel: TClientDataSet;
|
||
DataSource1: TDataSource;
|
||
ADOQueryTemp: TADOQuery;
|
||
ADOQueryCmd: TADOQuery;
|
||
ADOQueryMain: TADOQuery;
|
||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||
v2Column2: TcxGridDBColumn;
|
||
Label8: TLabel;
|
||
CustomerNoName: TcxTextEdit;
|
||
v2Column3: TcxGridDBColumn;
|
||
PopupMenu1: TPopupMenu;
|
||
N1: TMenuItem;
|
||
N2: TMenuItem;
|
||
ToolBar3: TToolBar;
|
||
ToolButton5: TToolButton;
|
||
ToolButton8: TToolButton;
|
||
ToolButton7: TToolButton;
|
||
ToolButton1: TToolButton;
|
||
Tv2Column2: TcxGridDBColumn;
|
||
Tv2Column3: TcxGridDBColumn;
|
||
Tv2Column1: TcxGridDBColumn;
|
||
Tv2Column4: TcxGridDBColumn;
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure OrderNoChange(Sender: TObject);
|
||
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||
procedure N1Click(Sender: TObject);
|
||
procedure N2Click(Sender: TObject);
|
||
procedure ToolButton5Click(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
procedure ToolButton7Click(Sender: TObject);
|
||
procedure ToolButton8Click(Sender: TObject);
|
||
private
|
||
{ Private declarations }
|
||
procedure InitGrid();
|
||
public
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmKnitClothWaitReleased: TfrmKnitClothWaitReleased;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_RTFun;
|
||
|
||
{$R *.dfm}
|
||
|
||
procedure TfrmKnitClothWaitReleased.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
Action := caFree;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmKnitClothWaitReleased := nil;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.FormShow(Sender: TObject);
|
||
begin
|
||
ReadCxGrid('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>11', Tv2, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.InitGrid();
|
||
begin
|
||
try
|
||
ADOQueryMain.DisableControls;
|
||
with ADOQueryMain do
|
||
begin
|
||
Filtered := False;
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('select * from ');
|
||
sql.Add('(select KC.MainId,KC.SubID ,ZPPS=Count(KC.StkID),ZPKGQty=sum(StkGrossWeight),ZPQty=sum(StkMeter) ');
|
||
sql.Add(' from Knit_Cloth_Stock KC where KC.StkExists=1 group by KC.MainId,KC.SubID ) AA ');
|
||
sql.Add(' left join Knit_Plan_Main BB on AA.MainId=BB.MainID ');
|
||
sql.Add(' left join Knit_Plan_Sub CC on AA.SubID=CC.SubID ');
|
||
// ShowMessage(SQL.Text);
|
||
Open;
|
||
end;
|
||
SCreateCDS(ADOQueryMain, CDS_OrderSel);
|
||
SInitCDSData(ADOQueryMain, CDS_OrderSel);
|
||
finally
|
||
ADOQueryMain.EnableControls;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.OrderNoChange(Sender: TObject);
|
||
begin
|
||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||
SCreateCDS(ADOQueryMain, CDS_OrderSel);
|
||
SInitCDSData(ADOQueryMain, CDS_OrderSel);
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.ToolButton1Click(Sender: TObject);
|
||
var
|
||
KHName: string;
|
||
begin
|
||
if CDS_OrderSel.Locate('SSel', True, []) = False then
|
||
begin
|
||
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
CDS_OrderSel.DisableControls;
|
||
KHName := '';
|
||
with CDS_OrderSel do
|
||
begin
|
||
First;
|
||
while not Eof do
|
||
begin
|
||
if FieldByName('SSel').AsBoolean = True then
|
||
begin
|
||
if Trim(KHName) = '' then
|
||
begin
|
||
KHName := Trim(fieldbyname('CustNo').AsString);
|
||
end
|
||
else
|
||
begin
|
||
if Trim(fieldbyname('CustNo').AsString) <> KHName then
|
||
begin
|
||
CDS_OrderSel.EnableControls;
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ͬ<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
end;
|
||
Next;
|
||
end;
|
||
end;
|
||
CDS_OrderSel.EnableControls;
|
||
ModalResult := 1;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.ToolButton5Click(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.ToolButton7Click(Sender: TObject);
|
||
begin
|
||
|
||
Close;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.ToolButton8Click(Sender: TObject);
|
||
begin
|
||
WriteCxGrid('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>11', Tv2, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||
begin
|
||
ModalResult := 1;
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.N1Click(Sender: TObject);
|
||
begin
|
||
SelOKNo(CDS_OrderSel, True);
|
||
end;
|
||
|
||
procedure TfrmKnitClothWaitReleased.N2Click(Sender: TObject);
|
||
begin
|
||
SelOKNo(CDS_OrderSel, False);
|
||
end;
|
||
|
||
end.
|
||
|