D10sxYilanbuyi/F04染色刷卡/U_DyePCList.pas

765 lines
27 KiB
ObjectPascal
Raw Normal View History

2025-08-01 16:35:48 +08:00
unit U_DyePCList;
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, MovePanel, cxButtonEdit, cxCalendar, RM_System, RM_Common,
RM_Class, RM_GridReport, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu,
U_BaseList, dxScrollbarAnnotations;
type
TfrmDyePCList = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBExport: TToolButton;
TBPrint: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu;
Label3: TLabel;
pcid: TEdit;
CDS_Main: TClientDataSet;
MovePanel2: TMovePanel;
RMGridReport1: TRMGridReport;
customerNoName: TEdit;
Label13: TLabel;
ywy: TEdit;
Label17: TLabel;
lbHx: TEdit;
Label7: TLabel;
ToolButton1: TToolButton;
dbGrid1: TcxGrid;
tv1: TcxGridDBTableView;
tv1CraftIdx: TcxGridDBColumn;
tv1mcName: TcxGridDBColumn;
2025-09-30 17:22:54 +08:00
tv1CCQX1: TcxGridDBColumn;
tv1DX1: TcxGridDBColumn;
tv1DX2: TcxGridDBColumn;
tv1DX3: TcxGridDBColumn;
tv1DX4: TcxGridDBColumn;
tv1DX5: TcxGridDBColumn;
tv1DX6: TcxGridDBColumn;
tv1JG1: TcxGridDBColumn;
tv1JRG1: TcxGridDBColumn;
tv1JRG2: TcxGridDBColumn;
tv1JRG3: TcxGridDBColumn;
2025-08-01 16:35:48 +08:00
tv1GC_BatchNo: TcxGridDBColumn;
tv1CurGlideName: TcxGridDBColumn;
tv1Note: TcxGridDBColumn;
dbGrid1Level1: TcxGridLevel;
2025-09-11 16:06:40 +08:00
ToolButton2: TToolButton;
2025-09-30 17:22:54 +08:00
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
Label2: TLabel;
tv1PCKey: TcxGridDBColumn;
BegTime: TDateTimePicker;
EndTime: TDateTimePicker;
2025-08-01 16:35:48 +08:00
procedure FormDestroy(Sender: TObject);
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 TBFindClick(Sender: TObject);
procedure pcidChange(Sender: TObject);
procedure PRTColorChange(Sender: TObject);
procedure TBdelClick(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
2025-09-11 16:06:40 +08:00
procedure ToolButton2Click(Sender: TObject);
2025-09-30 17:22:54 +08:00
procedure tv1JRG1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1JRG2CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure tv1CCQX1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX2CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX3CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX4CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX5CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX6CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1JG1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1JRG3CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
procedure tv1DX1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure tv1CCQX1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1DX2StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1DX3StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1DX4StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1DX5StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1DX6StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1JG1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1JRG1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1JRG2StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
procedure tv1JRG3StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
var AStyle: TcxStyle);
2025-08-01 16:35:48 +08:00
private
FLeft, FTop: Integer;
procedure InitGrid();
{ Private declarations }
public
fsyrName, canshu1: string;
2025-09-30 17:22:54 +08:00
2025-08-01 16:35:48 +08:00
{ Public declarations }
end;
var
frmDyePCList: TfrmDyePCList;
implementation
uses
2025-09-11 16:06:40 +08:00
U_DataLink, U_RTFun, U_ZDYHelp, U_MachTaskList;
2025-08-01 16:35:48 +08:00
{$R *.dfm}
procedure TfrmDyePCList.FormDestroy(Sender: TObject);
begin
inherited;
frmDyePCList := nil;
end;
procedure TfrmDyePCList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyePCList.FormCreate(Sender: TObject);
begin
inherited;
2025-09-11 16:06:40 +08:00
// EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
// BegDate.DateTime := EndDate.DateTime;
2025-08-01 16:35:48 +08:00
fsyrName := trim(DdataBase);
canshu1 := trim(DParameters1);
2025-09-11 16:06:40 +08:00
// SInitComBoxBySql(ADOQueryTemp, GlideName, false, 'select PSName as Name from Dye_Process');
2025-09-30 17:22:54 +08:00
2025-08-01 16:35:48 +08:00
end;
procedure TfrmDyePCList.InitGrid();
var
2025-09-11 16:06:40 +08:00
mBegDate, mendDate: string;
mAction: string;
rs: _Recordset;
r: integer;
2025-08-01 16:35:48 +08:00
begin
2025-09-11 16:06:40 +08:00
// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
2025-08-01 16:35:48 +08:00
try
2025-09-11 16:06:40 +08:00
tv1.BeginUpdate;
2025-08-01 16:35:48 +08:00
ADOQueryMain.DisableControls;
2025-09-30 17:22:54 +08:00
2025-08-01 16:35:48 +08:00
with ADOQueryMain do
begin
2025-09-11 16:06:40 +08:00
close;
filtered := false;
2025-08-01 16:35:48 +08:00
sql.Clear;
2025-09-30 17:22:54 +08:00
SQL.Add('select * from PCAboutTime where time between :StartTime and :EndTime order By Time');
Parameters.ParamByName('StartTime').Value := Trunc(BegDate.Date) + Frac(BegTime.Time);
Parameters.ParamByName('EndTime').Value := Trunc(EndDate.Date) + Frac(EndTime.Time);
2025-08-01 16:35:48 +08:00
Open;
2025-09-30 17:22:54 +08:00
2025-08-01 16:35:48 +08:00
end;
2025-09-11 16:06:40 +08:00
SCreateCDS(ADOQueryMain, CDS_main);
SInitCDSData(ADOQueryMain, CDS_main);
2025-08-01 16:35:48 +08:00
finally
ADOQueryMain.EnableControls;
2025-09-11 16:06:40 +08:00
tv1.EndUpdate;
// tv1.ApplyBestFit();
2025-08-01 16:35:48 +08:00
end;
end;
procedure TfrmDyePCList.TBRafreshClick(Sender: TObject);
begin
MovePanel2.Visible := True;
MovePanel2.Refresh;
InitGrid();
MovePanel2.Visible := False;
end;
procedure TfrmDyePCList.ToolButton1Click(Sender: TObject);
begin
2025-09-30 17:22:54 +08:00
WriteCxGrid(self.Caption + tv1.Name, Tv1, '<27>Ų<EFBFBD><C5B2><EFBFBD>Ϣ');
2025-08-01 16:35:48 +08:00
end;
2025-09-11 16:06:40 +08:00
procedure TfrmDyePCList.ToolButton2Click(Sender: TObject);
begin
// if ADOQuerymain.IsEmpty then
// exit;
frmMachTaskList := TfrmMachTaskList.create(self);
with frmMachTaskList do
begin
2025-09-30 17:22:54 +08:00
// fcurMachId := trim(self.adoquerymain.FieldByName('mcid').AsString);
// machName.text := trim(self.adoquerymain.FieldByName('mcName').AsString);
2025-09-11 16:06:40 +08:00
showModal;
free;
end;
initgrid();
end;
2025-09-30 17:22:54 +08:00
procedure TfrmDyePCList.tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
// if ADOQuerymain.IsEmpty then
// exit;
frmMachTaskList := TfrmMachTaskList.create(self);
with frmMachTaskList do
begin
fBegTime := Self.CDS_Main.FieldByName('time').AsString;
fMCName := Self.Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
fText := self.CDS_Main.FieldByName(fMCName).AsString;
showModal;
free;
end;
initgrid();
end;
procedure TfrmDyePCList.tv1DX5CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX5.Index] = ARow2.Values[tv1DX5.Index]) and (ARow1.Values[tv1DX5.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX5StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX5.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1DX2CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX2.Index] = ARow2.Values[tv1DX2.Index]) and (ARow1.Values[tv1DX2.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX2StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX2.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1DX3CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX3.Index] = ARow2.Values[tv1DX3.Index]) and (ARow1.Values[tv1DX3.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX3StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX3.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1DX1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX1.Index] = ARow2.Values[tv1DX1.Index]) and (ARow1.Values[tv1DX1.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX1.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
//procedure TfrmDyePCList.tv1DX1StylesGetContentStyle(
// Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
// AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
//begin
// if ARecord <> nil then
// begin
// if ARecord.RecordIndex mod 2 = 0 then
// begin
// // ż<><C5BC><EFBFBD>У<EFBFBD><D0A3><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
// AStyle := TcxStyle.Create(nil);
// AStyle.Color := clWhite;
// AStyle.TextColor := clBlack;
// end
// else
// begin
// // <20><><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>dz<EFBFBD><C7B3>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
// AStyle := TcxStyle.Create(nil);
// AStyle.Color := $00FFF5E1; // dz<><C7B3>ɫ
// AStyle.TextColor := clBlack;
// end;
// end;
//end;
procedure TfrmDyePCList.tv1CCQX1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1CCQX1.Index] = ARow2.Values[tv1CCQX1.Index]) and (ARow1.Values[tv1CCQX1.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1CCQX1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1CCQX1.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1DX4CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX4.Index] = ARow2.Values[tv1DX4.Index]) and (ARow1.Values[tv1DX4.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX4StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX4.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1DX6CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1DX6.Index] = ARow2.Values[tv1DX6.Index]) and (ARow1.Values[tv1DX6.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX6StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1DX6.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1JG1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1JG1.Index] = ARow2.Values[tv1JG1.Index]) and (ARow1.Values[tv1JG1.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JG1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1JG1.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1JRG1CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1JRG1.Index] = ARow2.Values[tv1JRG1.Index]) and (ARow1.Values[tv1JRG1.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JRG1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1JRG1.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1JRG2CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1JRG2.Index] = ARow2.Values[tv1JRG2.Index]) and (ARow1.Values[tv1JRG2.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JRG2StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1JRG2.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
procedure TfrmDyePCList.tv1JRG3CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean);
begin
if (ARow1.Values[tv1JRG3.Index] = ARow2.Values[tv1JRG3.Index]) and (ARow1.Values[tv1JRG3.Index] <> NULL) then
AAreEqual := True
else
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JRG3StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
I: Integer;
begin
if (ARecord <> nil) and (ARecord is TcxGridDataRow) then
begin
GroupValue := VarToStr(ARecord.Values[tv1JRG3.Index]);
if (GroupValue <> '') and (GroupValue <> null) then
begin
// <20><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>λ<EFBFBD>ú<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // <20><><EFBFBD><EFBFBD>ɫ
1: AStyle.Color := $00CCFFCC; // <20><><EFBFBD><EFBFBD>ɫ
2: AStyle.Color := $00FFCCCC; // <20><><EFBFBD><EFBFBD>ɫ
end;
AStyle.TextColor := clBlack;
end;
end;
end;
2025-08-01 16:35:48 +08:00
procedure TfrmDyePCList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmDyePCList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyePCList.FormShow(Sender: TObject);
begin
inherited;
2025-09-30 17:22:54 +08:00
ReadCxGrid(self.Caption + tv1.Name, Tv1, '<27>Ų<EFBFBD><C5B2><EFBFBD>Ϣ');
2025-08-01 16:35:48 +08:00
canshu1 := self.fParameters1;
2025-09-30 17:22:54 +08:00
// BegDate.DateTime := strToDateTime(FormatDateTime('yyyy-MM-dd 00:00:00', SGetServerDate(ADOQueryTemp))) - 1;
// EndDate.DateTime := strToDateTime(FormatDateTime('yyyy-MM-dd 00:00:00', SGetServerDate(ADOQueryTemp))) + 1;
var ServerDate: TDateTime := SGetServerDate(ADOQueryTemp);
2025-08-01 16:35:48 +08:00
2025-09-30 17:22:54 +08:00
BegDate.Date := Trunc(ServerDate) - 1; // ǰһ<C7B0><D2BB>
EndDate.Date := Trunc(ServerDate) + 1; // <20><>һ<EFBFBD><D2BB>
BegTime.Time := EncodeTime(0, 0, 0, 0); // <20><><EFBFBD><EFBFBD>8<EFBFBD><38>
endTime.Time := EncodeTime(0, 0, 0, 0); // <20><><EFBFBD><EFBFBD>6<EFBFBD><36>
2025-08-01 16:35:48 +08:00
initgrid();
end;
procedure TfrmDyePCList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
// SelExportData(tv1,ADOQueryMain,self.Caption);
TcxGridToExcel(self.Caption, DBGrid1);
end;
procedure TfrmDyePCList.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, CDS_Main);
SInitCDSData(ADOQueryMain, CDS_Main);
end;
end;
procedure TfrmDyePCList.pcidChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyePCList.PRTColorChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyePCList.TBdelClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
Exit;
try
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('insert into Dye_Need_Up(UType,UDataId) values(''<27><>̨ˢ<CCA8><CBA2>'',' + quotedstr(Trim(CDS_Main.fieldbyname('GOID').AsString)) + ') ');
sql.Add('delete Dye_Plan_Glide_OutPut where GOID=''' + Trim(CDS_Main.fieldbyname('GOID').AsString) + '''');
ExecSQL;
end;
////////////////// <20><><EFBFBD>½<EFBFBD><C2BD><EFBFBD> //////////////////
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('exec P_Dye_Card_upCL @PCID=' + QuotedStr(CDS_Main.fieldbyname('pcid').AsString));
execsql;
end;
////////////////// <20><><EFBFBD>½<EFBFBD><C2BD><EFBFBD> //////////////////
CDS_Main.Delete;
except
application.MessageBox(<><C9BE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
end;
end;
end.