D10sxYilanbuyi/F06染色成品仓库/U_DyeClothInList.pas

768 lines
20 KiB
ObjectPascal
Raw Normal View History

2025-06-06 13:56:41 +08:00
unit U_DyeClothInList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
RM_System, RM_GridReport, Menus, cxCalendar, MovePanel, Math, Clipbrd,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, cxTextEdit, dxSkinsCore,
dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu, U_BaseList, cxPC,
2025-10-16 19:49:06 +08:00
System.StrUtils, dxScrollbarAnnotations;
2025-06-06 13:56:41 +08:00
type
TfrmDyeClothInList = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBExport: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DS_1: TDataSource;
GPM_1: TcxGridPopupMenu;
Label2: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
CDS_1: TClientDataSet;
TBRKCX: TToolButton;
begtime: TDateTimePicker;
endTime: TDateTimePicker;
IsJYTime: TCheckBox;
ToolButton2: TToolButton;
ToolButton4: TToolButton;
Panel6: TPanel;
Label31: TLabel;
LBCPAP: TLabel;
BTLP: TButton;
BTNP: TButton;
TCBNOR: TComboBox;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column22: TcxGridDBColumn;
v1Column1: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
Label3: TLabel;
Label7: TLabel;
Label10: TLabel;
Label5: TLabel;
lbl1: TLabel;
OrderNo: TEdit;
2026-09-28 14:57:03 +08:00
IONote: TEdit;
2025-06-06 13:56:41 +08:00
C_Name: TEdit;
2026-09-28 14:57:03 +08:00
Material: TEdit;
PB_note: TEdit;
2025-06-06 13:56:41 +08:00
Tv1Column9: TcxGridDBColumn;
Tv1Column11: TcxGridDBColumn;
PM_1: TPopupMenu;
PM11: TMenuItem;
ToolButton1: TToolButton;
N1: TMenuItem;
N2: TMenuItem;
2026-01-14 17:32:29 +08:00
Tv1finishDescription: TcxGridDBColumn;
2026-09-28 14:57:03 +08:00
ToolButton3: TToolButton;
Tv1Material: TcxGridDBColumn;
Tv1PB_ioType: TcxGridDBColumn;
Tv1PB_note: TcxGridDBColumn;
Tv1PB_Qty: TcxGridDBColumn;
Tv1PB_piece: TcxGridDBColumn;
Tv1IONote: TcxGridDBColumn;
Tv1Meter: TcxGridDBColumn;
Tv1Piece: TcxGridDBColumn;
ToolButton5: TToolButton;
2025-06-06 13:56:41 +08:00
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure ConNoMChange(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure orderNoKeyPress(Sender: TObject; var Key: Char);
procedure TBRKCXClick(Sender: TObject);
procedure BTNPClick(Sender: TObject);
procedure BTLPClick(Sender: TObject);
procedure TCBNORChange(Sender: TObject);
procedure JYTypeChange(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure cxPageControl1Change(Sender: TObject);
procedure CDS_1BeforeOpen(DataSet: TDataSet);
procedure Tv1DataControllerFilterBeforeChange(Sender: TcxDBDataFilterCriteria; ADataSet: TDataSet; const AFilterText: string);
procedure Tv1DataControllerSummaryFooterSummaryItemsSummary(ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments; var OutArguments: TcxSummaryEventOutArguments);
procedure Tv1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems6GetText(Sender: TcxDataSummaryItem; const AValue: Variant; AIsFooter: Boolean; var AText: string);
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure PM11Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure CustNameKeyPress(Sender: TObject; var Key: Char);
2026-01-14 17:32:29 +08:00
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
2026-09-28 14:57:03 +08:00
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
2025-06-06 13:56:41 +08:00
private
CurrentPage, RecordsNumber: Integer;
lstCust: TStringList;
procedure InitGrid();
procedure SetStatus();
{ Private declarations }
public
canshu1, canshu2, FWorkshop: string;
{ Public declarations }
end;
implementation
uses
2026-09-28 14:57:03 +08:00
U_DataLink, U_RTFun, U_LabelPrint, U_DyeClothInPut;
2025-06-06 13:56:41 +08:00
{$R *.dfm}
procedure TfrmDyeClothInList.SetStatus();
begin
TBRKCX.Enabled := False;
if canshu1 = '<27><><EFBFBD><EFBFBD>' then
TBRKCX.Enabled := true;
end;
procedure TfrmDyeClothInList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
FreeAndNil(lstCust);
Action := caFree;
end;
procedure TfrmDyeClothInList.FormCreate(Sender: TObject);
begin
inherited;
lstCust := TStringList.Create;
EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime - 20;
FWorkshop := trim(Self.fParameters3);
end;
2026-09-28 14:57:03 +08:00
procedure TfrmDyeClothInList.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
2026-01-14 17:32:29 +08:00
begin
if Key = VK_ESCAPE then // VK_ESCAPE <20><> ESC <20><><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
begin
Key := 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Close; // <20><><EFBFBD><EFBFBD> ModalResult := mrCancel;
end;
end;
2025-06-06 13:56:41 +08:00
procedure TfrmDyeClothInList.InitGrid();
var
WSql: string;
begin
WSql := SGetFilters(Panel1, 1, 2);
if Trim(WSql) <> '' then
WSql := ' and ' + WSql;
if IsJYTime.Checked then
begin
WSql := WSql + ' and IOTime>=' + quotedstr(FormatDateTime('yyyy-MM-dd', BegDate.DateTime));
WSql := WSql + ' and IOTime<' + quotedstr(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1));
end;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select top ' + inttostr(RecordsNumber) + ' * ');
sql.Add(' from ');
sql.Add('(select rownumber=cast((row_number() over(order by A.IOTime desc)) as int)');
sql.Add(',COUNT(1) OVER() AS TotalCount');
2026-09-28 14:57:03 +08:00
sql.Add(',* from V_Dye_Cloth_IO_cai A where A.IOFlag = ''<27><><EFBFBD><EFBFBD>'' ');
// if trim(FWorkshop) <> '' then
// sql.Add(' and Workshop=''' + trim(FWorkshop) + ''' ');
2025-06-06 13:56:41 +08:00
sql.Add('and 1=1 ' + WSql);
sql.Add(') temp_row');
sql.Add(' where rownumber> ' + inttostr(((CurrentPage - 1) * RecordsNumber)));
sql.Add(' order by rownumber');
2025-11-12 17:32:20 +08:00
2026-09-28 14:57:03 +08:00
// showmessage(sql.text);
2025-06-06 13:56:41 +08:00
Open;
end;
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(CDS_1.FieldByName('TotalCount').AsInteger / RecordsNumber));
finally
ADOQueryMain.EnableControls;
TV1.DataController.Filter.Clear;
end;
end;
procedure TfrmDyeClothInList.TBRafreshClick(Sender: TObject);
begin
CurrentPage := 1;
InitGrid();
end;
procedure TfrmDyeClothInList.CDS_1BeforeOpen(DataSet: TDataSet);
begin
lstCust.Clear;
end;
procedure TfrmDyeClothInList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmDyeClothInList.CustNameKeyPress(Sender: TObject; var Key: Char);
begin
inherited;
if Key = #13 then
begin
CurrentPage := 1;
InitGrid();
end;
end;
procedure TfrmDyeClothInList.cxPageControl1Change(Sender: TObject);
begin
CurrentPage := 1;
SetStatus();
InitGrid();
end;
procedure TfrmDyeClothInList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyeClothInList.FormShow(Sender: TObject);
begin
inherited;
canshu1 := self.fParameters1;
canshu2 := self.fParameters3;
FWorkshop := self.fParameters3;
2025-11-12 17:32:20 +08:00
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
2025-06-06 13:56:41 +08:00
CurrentPage := 1;
RecordsNumber := 500;
2025-11-12 17:32:20 +08:00
InitGrid();
2025-06-06 13:56:41 +08:00
SetStatus();
2026-01-14 17:32:29 +08:00
KeyPreview := True; // ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2025-06-06 13:56:41 +08:00
end;
procedure TfrmDyeClothInList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel(Self.Caption, cxGrid1);
end;
procedure TfrmDyeClothInList.orderNoKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
CurrentPage := 1;
InitGrid();
end;
end;
procedure TfrmDyeClothInList.PM11Click(Sender: TObject);
begin
SelOKNo(CDS_1, true);
end;
procedure TfrmDyeClothInList.TBRKCXClick(Sender: TObject);
begin
2026-09-28 14:57:03 +08:00
if CDS_1.Locate('ssel', True, []) = False then
2025-06-06 13:56:41 +08:00
begin
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
2026-09-28 14:57:03 +08:00
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
Exit;
try
ADOQueryCmd.Connection.BeginTrans;
CDS_1.DisableControls;
with CDS_1 do
2025-06-06 13:56:41 +08:00
begin
2026-09-28 14:57:03 +08:00
First;
while not eof do
2025-06-06 13:56:41 +08:00
begin
2026-09-28 14:57:03 +08:00
if CDS_1.FieldByName('ssel').AsBoolean then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.add('insert into Dye_Cloth_IO_Del select * from Dye_Cloth_IO where IOID=''' + trim(CDS_1.fieldbyname('IOID').AsString) + ''' ');
sql.Add('update Dye_Cloth_IO_Del Set DelTime=Getdate(),Deler=''' + trim(DName) + ''' where IOID=''' + trim(CDS_1.fieldbyname('IOID').AsString) + ''' ');
sql.Add(' delete from Dye_Cloth_IO ');
sql.Add('where IOID =''' + Trim(CDS_1.FieldByName('IOID').asString) + ''' ');
ExecSQL;
end;
/////////////////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>////////////////
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update Dye_Cloth_Stock Set StkPiece=(select Sum(isnull(Piece,0)*IOQtyFlag) from Dye_Cloth_IO A where A.StkID =''' + Trim(CDS_1.FieldByName('StkId').asString) + ''')');
sql.Add(',STKMeter=(select Sum(isnull(Meter,0)*IOQtyFlag) from Dye_Cloth_IO A where A.StkID =''' + Trim(CDS_1.FieldByName('StkId').asString) + ''')');
sql.Add('where StkID =''' + Trim(CDS_1.FieldByName('StkId').asString) + ''' ');
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from Dye_Cloth_Stock where StkID=''' + Trim(CDS_1.fieldbyname('StkID').AsString) + '''');
Open;
end;
if (ADOQueryCmd.FieldByName('StkPiece').AsString = '0') and (ADOQueryCmd.FieldByName('StkMeter').AsString = '0') then
begin
ADOQueryCmd.Edit;
ADOQueryCmd.FieldByName('StkExists').Value := 0;
ADOQueryCmd.Post;
end
else
begin
ADOQueryCmd.Edit;
ADOQueryCmd.FieldByName('StkExists').Value := 1;
ADOQueryCmd.Post;
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from Dye_Cloth_Stock where StkID=''' + Trim(CDS_1.fieldbyname('StkID').AsString) + '''');
Open;
end;
if ADOQueryTemp.FieldByName('StkMeter').Value < 0 then
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>棡');
if ADOQueryTemp.FieldByName('StkPiece').Value < 0 then
raise Exception.Create('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>棡');
end;
Next;
2025-06-06 13:56:41 +08:00
end;
end;
2026-09-28 14:57:03 +08:00
CDS_1.EnableControls;
ADOQueryCmd.Connection.CommitTrans;
except
CDS_1.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
2025-06-06 13:56:41 +08:00
end;
2026-09-28 14:57:03 +08:00
end;
2025-06-06 13:56:41 +08:00
2026-09-28 14:57:03 +08:00
//var <20><><EFBFBD><EFBFBD>Ʒд<C6B7><D0B4>һ<EFBFBD><D2BB>
// IOIDS: string;
//begin
// if CDS_1.Locate('ssel', True, []) = False then
// begin
// Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
// Exit;
// end;
// if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
// Exit;
// CDS_1.DisableControls;
// with CDS_1 do
// begin
// First;
// while not Eof do
// begin
// if CDS_1.FieldByName('SSel').AsBoolean = True then
// begin
//
// IOIDS := IOIDS + Trim(CDS_1.fieldbyname('IOID').AsString) + ',';
// CDS_1.Delete;
// end
// else
// Next;
// end;
// end;
// CDS_1.EnableControls;
// try
// ADOQueryCmd.Connection.BeginTrans;
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
// sql.Add('insert into Trade_Need_Up(UOperation,UType,UDataId) values(''<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>'',''<27><><EFBFBD><EFBFBD>'',' + quotedstr(IOIDS) + ') ');
// ExecSQL;
// end;
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add('exec P_Dye_Cloth_ReIn_cai ');
// Sql.Add('@CIIDS=' + quotedstr(Trim(IOIDS)));
// Sql.Add(',@DCode=' + Quotedstr(DCode));
// Sql.Add(',@DName=' + Quotedstr(DName));
// Open;
// end;
// if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
// begin
// raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
// end;
// ADOQueryCmd.Connection.CommitTrans;
// CurrentPage := 1;
// InitGrid();
// application.MessageBox('ɾ<><C9BE><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
// except
// ADOQueryCmd.Connection.RollbackTrans;
// application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
// end;
//
//end;
2025-06-06 13:56:41 +08:00
2026-01-14 17:32:29 +08:00
2026-09-28 14:57:03 +08:00
//var
// MCIIDS, MIOIDS, MSTKIDS, MPCIDS: string;
//begin
// if CDS_1.IsEmpty then
// Exit;
// if not CDS_1.Locate('SSel', True, []) then
// begin
// Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
// Exit;
// end;
// MCIIDS := '';
// MIOIDS := '';
// MSTKIDS := '';
// MPCIDS := '';
// CDS_1.DisableControls;
// with CDS_1 do
// begin
// First;
// while not Eof do
// begin
// if CDS_1.fieldbyname('SSel').AsBoolean then
// begin
// MCIIDS := MCIIDS + (Trim(CDS_1.fieldbyname('StkID').AsString)) + ',';
// MIOIDS := MIOIDS + (Trim(CDS_1.fieldbyname('IOID').AsString)) + ',';
// MSTKIDS := MSTKIDS + (Trim(CDS_1.fieldbyname('STKID').AsString)) + ',';
// MPCIDS := MPCIDS + (Trim(CDS_1.fieldbyname('PCID').AsString)) + ',';
// end;
// Next;
// end;
// end;
// MCIIDS := leftBstr(trim(MCIIDS), length(MCIIDS) - 1);
// MIOIDS := leftBstr(trim(MIOIDS), length(MIOIDS) - 1);
// MSTKIDS := leftBstr(trim(MSTKIDS), length(MSTKIDS) - 1);
//
// CDS_1.Locate('SSel', True, []);
// CDS_1.EnableControls;
//
// if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
// Exit;
//
// try
// ADOQueryCmd.Connection.BeginTrans;
//
2025-12-09 17:30:34 +08:00
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
2026-09-28 14:57:03 +08:00
// sql.Add('insert into Dye_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) ');
// sql.Add('values(''Ⱦɫ<C8BE><C9AB>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>'' ');
// sql.Add(',' + quotedstr(MPCIDS));
// sql.Add(',''ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼'' ');
// sql.Add(',' + quotedstr(DName));
// sql.Add(',' + quotedstr(trim(self.Caption)));
// sql.Add(',' + quotedstr(MSTKIDS));
// sql.Add(') ');
2025-12-09 17:30:34 +08:00
// execsql;
// end;
2026-09-28 14:57:03 +08:00
//
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add('exec P_Dye_Cloth_ReIn_cai ');
// Sql.Add('@StkIds=' + quotedstr(trim(MSTKIDS)));
// Sql.Add(',@IOIDS=' + quotedstr(trim(MIOIDS)));
// Sql.Add(',@FillId=' + quotedstr(trim(dcode)));
// Sql.Add(',@Filler=' + quotedstr(trim(dname)));
//// ShowMessage(sql.Text);
// Open;
// end;
//
// if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
// begin
// raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
// end;
//
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add(' update Dye_Cloth_Stock set StkExists =0 where StkMeter =0 and StkPiece =0 ');
// ExecSQL;
// end;
//
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
// sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
// sql.Add(' ' + quotedstr(trim(DName)));
// sql.Add(',getdate() ');
// sql.Add(',' + quotedstr(trim(self.Caption)));
// sql.Add(',' + quotedstr(trim('<27><>ƥ<EFBFBD><C6A5><EFBFBD>⳷<EFBFBD><E2B3B7>')));
// sql.Add(',' + quotedstr(trim(MSTKIDS)));
// sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
// sql.Add(')');
// ExecSQL;
// end;
// ADOQueryCmd.Connection.CommitTrans;
//// with ADOQueryCmd do
//// begin
//// Close;
//// sql.Clear;
//// sql.Add('exec P_Dye_Card_PSC ');
//// execsql;
//// end;
// InitGrid();
// except
// ADOQueryCmd.Connection.RollbackTrans;
// application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
// end;
//end;
2025-06-06 13:56:41 +08:00
procedure TfrmDyeClothInList.Tv1DataControllerFilterBeforeChange(Sender: TcxDBDataFilterCriteria; ADataSet: TDataSet; const AFilterText: string);
begin
lstCust.Clear;
end;
procedure TfrmDyeClothInList.Tv1DataControllerSummaryFooterSummaryItemsSummary(ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments; var OutArguments: TcxSummaryEventOutArguments);
var
BaoID: string;
begin
2025-11-12 17:32:20 +08:00
// if TcxGridDBTableSummaryItem(Arguments.SummaryItem).Column = VC_BaoID then
// begin
// BaoID := vartostr(ASender.DataController.Values[Arguments.RecordIndex, VC_BaoID.Index]);
// if BaoID = '' then
// Exit;
// if BaoID = null then
// Exit;
// if lstCust.IndexOf(BaoID) = -1 then
// begin
// lstCust.Add(BaoID);
// end;
// end;
2025-06-06 13:56:41 +08:00
end;
procedure TfrmDyeClothInList.Tv1TcxGridDBDataControllerTcxDataSummaryFooterSummaryItems6GetText(Sender: TcxDataSummaryItem; const AValue: Variant; AIsFooter: Boolean; var AText: string);
begin
if lstCust <> nil then
AText := IntToStr(lstCust.Count);
end;
procedure TfrmDyeClothInList.BTNPClick(Sender: TObject);
begin
if CurrentPage < CDS_1.FieldByName('TotalCount').AsInteger / RecordsNumber then
CurrentPage := CurrentPage + 1;
InitGrid();
end;
procedure TfrmDyeClothInList.BTLPClick(Sender: TObject);
begin
if CurrentPage > 1 then
CurrentPage := CurrentPage - 1;
InitGrid();
end;
procedure TfrmDyeClothInList.TCBNORChange(Sender: TObject);
begin
RecordsNumber := StrToInt(TCBNOR.Text);
CurrentPage := 1;
InitGrid();
end;
procedure TfrmDyeClothInList.JYTypeChange(Sender: TObject);
begin
CurrentPage := 1;
InitGrid();
end;
procedure TfrmDyeClothInList.N1Click(Sender: TObject);
begin
SelOKNo(CDS_1, false);
end;
procedure TfrmDyeClothInList.N2Click(Sender: TObject);
begin
Clipboard.SetTextBuf(PChar(Trim(CDS_1.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));
end;
procedure TfrmDyeClothInList.ToolButton1Click(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'DyeClothIn1';
FFiltration1 := Trim(self.CDS_1.fieldbyname('IONO').AsString);
if ShowModal = 1 then
begin
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TfrmDyeClothInList.ToolButton2Click(Sender: TObject);
var
WSql: string;
begin
if CDS_1.IsEmpty then
Exit;
if not CDS_1.Locate('SSel', True, []) then
begin
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
WSql := '';
CDS_1.DisableControls;
with CDS_1 do
begin
First;
while not Eof do
begin
if CDS_1.fieldbyname('SSel').AsBoolean then
begin
if WSql <> '' then
begin
WSql := WSql + ',' + QuotedStr(Trim(CDS_1.fieldbyname('CIID').AsString));
end
else
begin
WSql := QuotedStr(Trim(CDS_1.fieldbyname('CIID').AsString));
end;
end;
Next;
end;
end;
CDS_1.Locate('SSel', True, []);
CDS_1.EnableControls;
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'DyeClothIn2';
FFiltration1 := WSql;
if ShowModal = 1 then
begin
end;
end;
finally
frmLabelPrint.Free;
end;
end;
2026-09-28 14:57:03 +08:00
procedure TfrmDyeClothInList.ToolButton3Click(Sender: TObject);
begin
try
frmDyeClothInPut := TfrmDyeClothInPut.Create(Application);
with frmDyeClothInPut do
begin
FIOID := '';
FWorkshop := self.FWorkshop;
if ShowModal = 1 then
begin
Self.InitGrid();
end;
end;
finally
frmDyeClothInPut.Free;
end;
end;
2025-06-06 13:56:41 +08:00
procedure TfrmDyeClothInList.ToolButton4Click(Sender: TObject);
begin
2025-11-12 17:32:20 +08:00
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
2025-06-06 13:56:41 +08:00
end;
2026-09-28 14:57:03 +08:00
procedure TfrmDyeClothInList.ToolButton5Click(Sender: TObject);
begin
try
frmDyeClothInPut := TfrmDyeClothInPut.Create(Application);
with frmDyeClothInPut do
begin
FIOID := CDS_1.FieldByName('IOID').AsString;
TBAdd.Visible := False;
FWorkshop := self.FWorkshop;
if ShowModal = 1 then
begin
Self.InitGrid();
end;
end;
finally
frmDyeClothInPut.Free;
end;
end;
2025-06-06 13:56:41 +08:00
end.