This commit is contained in:
LAPTOP-8NOV8MVQ\cai 2025-11-12 17:32:20 +08:00
parent 552b1986fb
commit db6a693a71
129 changed files with 25625 additions and 5815 deletions

View File

@ -10,6 +10,7 @@ inherited frmClothInfoSel: TfrmClothInfoSel
Font.Name = #23435#20307
Position = poScreenCenter
OnClose = FormClose
OnKeyDown = FormKeyDown
ExplicitWidth = 1501
ExplicitHeight = 650
PixelsPerInch = 96
@ -222,8 +223,6 @@ inherited frmClothInfoSel: TfrmClothInfoSel
Height = 485
Align = alClient
TabOrder = 1
ExplicitLeft = 6
ExplicitTop = 39
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False

View File

@ -95,6 +95,7 @@ type
procedure TBCloseClick(Sender: TObject);
procedure cxDBTreeList1DblClick(Sender: TObject);
procedure C_CodeKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
CurrentPage, RecordsNumber: Integer;
procedure InitGrid(PType: string);
@ -280,7 +281,7 @@ begin
if Trim(FCTType) = '' then
FCTType := '通用';
ReadCxGrid('单位名称' + Trim(FCTType), TV1, '自定义数据');
KeyPreview := True;
InitTree();
InitGrid('');
end;
@ -321,5 +322,16 @@ begin
frmClothInfoSel := nil;
end;
procedure TfrmClothInfoSel.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
end.

View File

@ -18,15 +18,15 @@
<Transaction>1899/12/30 00:00:00.000.518,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.503,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.187,D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.431,D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_ClothInfo_Tat.pas=D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_ClothInfo.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.305,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_KnitClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.228,=D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_ClothInfo.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.187,D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.228,=D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_ClothInfo.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.754,D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_TatClothInfo.dfm=D:\Dp10Repo\项目代码\RTBasics\A02基础产品管理\U_ClothInfo_Tat.dfm</Transaction>

View File

@ -3,11 +3,11 @@ inherited frmClothInfo: TfrmClothInfo
Top = 154
Caption = #20135#21697#26723#26696
ClientHeight = 702
ClientWidth = 1444
ClientWidth = 1456
FormStyle = fsMDIChild
Position = poScreenCenter
Visible = True
ExplicitWidth = 1460
ExplicitWidth = 1472
ExplicitHeight = 741
PixelsPerInch = 96
TextHeight = 12
@ -15,7 +15,7 @@ inherited frmClothInfo: TfrmClothInfo
Tag = 1
Left = 0
Top = 0
Width = 1444
Width = 1456
Height = 38
AutoSize = True
ButtonHeight = 38
@ -28,6 +28,7 @@ inherited frmClothInfo: TfrmClothInfo
ParentColor = False
ShowCaptions = True
TabOrder = 0
ExplicitWidth = 1444
object TBRafresh: TToolButton
Left = 0
Top = 0
@ -160,7 +161,7 @@ inherited frmClothInfo: TfrmClothInfo
object Panel1: TPanel [2]
Left = 0
Top = 38
Width = 1444
Width = 1456
Height = 45
Align = alTop
BevelInner = bvRaised
@ -168,6 +169,7 @@ inherited frmClothInfo: TfrmClothInfo
Color = 16242829
ParentBackground = False
TabOrder = 1
ExplicitWidth = 1444
object Label11: TLabel
Left = 1072
Top = 107
@ -200,18 +202,32 @@ inherited frmClothInfo: TfrmClothInfo
Caption = #20135#21697#21517#31216
end
object Label9: TLabel
Left = 365
Left = 628
Top = 15
Width = 24
Height = 12
Caption = #26448#36136
end
object Label8: TLabel
Left = 197
Left = 481
Top = 15
Width = 48
Width = 24
Height = 12
Caption = #24037#33402#32534#21495
Caption = #24037#33402
end
object Label1: TLabel
Left = 335
Top = 15
Width = 24
Height = 12
Caption = #38376#24133
end
object Label2: TLabel
Left = 193
Top = 15
Width = 24
Height = 12
Caption = #33394#21495
end
object C_Name: TEdit
Tag = 2
@ -224,22 +240,37 @@ inherited frmClothInfo: TfrmClothInfo
end
object Material: TEdit
Tag = 2
Left = 392
Left = 654
Top = 11
Width = 89
Height = 20
TabOrder = 2
OnKeyPress = C_CodeKeyPress
end
object DTMNo: TEdit
Tag = 2
Left = 244
object C_NameGY: TEdit
Left = 508
Top = 11
Width = 89
Height = 20
TabOrder = 1
OnKeyPress = C_CodeKeyPress
end
object C_NameWidth: TEdit
Left = 363
Top = 11
Width = 89
Height = 20
TabOrder = 3
OnKeyPress = C_CodeKeyPress
end
object C_NameSeHao: TEdit
Left = 220
Top = 11
Width = 89
Height = 20
TabOrder = 4
OnKeyPress = C_CodeKeyPress
end
end
object Panel2: TPanel [3]
Left = 512
@ -307,15 +338,16 @@ inherited frmClothInfo: TfrmClothInfo
object Panel3: TPanel [5]
Left = 228
Top = 83
Width = 1216
Width = 1228
Height = 619
Align = alClient
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = 'Panel3'
TabOrder = 4
ExplicitWidth = 1216
object Splitter1: TSplitter
Left = 825
Left = 2
Top = 60
Height = 352
ExplicitLeft = 936
@ -323,15 +355,16 @@ inherited frmClothInfo: TfrmClothInfo
ExplicitHeight = 100
end
object cxGrid1: TcxGrid
Left = 2
Left = 5
Top = 60
Width = 823
Width = 1175
Height = 352
Align = alLeft
Align = alClient
PopupMenu = PM_1
TabOrder = 0
ExplicitLeft = 6
ExplicitTop = 59
ExplicitWidth = 1163
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False
@ -347,7 +380,6 @@ inherited frmClothInfo: TfrmClothInfo
OptionsCustomize.ColumnFiltering = False
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
Styles.IncSearch = DataLink_ClothInfo.SHuangSe
Styles.Header = DataLink_ClothInfo.Default
@ -360,7 +392,7 @@ inherited frmClothInfo: TfrmClothInfo
PropertiesClassName = 'TcxCheckBoxProperties'
HeaderAlignmentHorz = taCenter
Styles.Header = DataLink_ClothInfo.Default
Width = 36
Width = 30
end
object v1Column12: TcxGridDBColumn
Caption = #31867#21035
@ -369,60 +401,44 @@ inherited frmClothInfo: TfrmClothInfo
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_ClothInfo.Default
Width = 62
Width = 51
end
object v1CYNo: TcxGridDBColumn
Caption = #20135#21697#32534#21495
Caption = #25104#21697#32534#21495
DataBinding.FieldName = 'C_Code'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_ClothInfo.Default
Width = 82
Width = 68
end
object v1Column9: TcxGridDBColumn
Caption = #20135#21697#21517#31216
Caption = #25104#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 85
Width = 70
end
object Tv1Material: TcxGridDBColumn
Caption = #26448#36136
DataBinding.FieldName = 'Material'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 71
Width = 59
end
object Tv1CFinishingStandards: TcxGridDBColumn
Caption = #21518#25972#29702#26631#20934
DataBinding.FieldName = 'FinishingStandards'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
Width = 75
end
object Tv1DTMNo: TcxGridDBColumn
Caption = #40664#35748#24037#33402#32534#21495
DataBinding.FieldName = 'DTMNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 101
end
object Tv1Column5: TcxGridDBColumn
Caption = #24314#31435#20154
DataBinding.FieldName = 'filler'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 63
end
object Tv1Column9: TcxGridDBColumn
Caption = #24314#31435#26102#38388
DataBinding.FieldName = 'FILLTIME'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 59
Width = 83
end
object Tv1Column6: TcxGridDBColumn
Caption = #26368#21518#20462#25913#20154
@ -430,7 +446,7 @@ inherited frmClothInfo: TfrmClothInfo
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 95
Width = 80
end
object Tv1Column7: TcxGridDBColumn
Caption = #26368#21518#20462#25913#26102#38388
@ -438,14 +454,91 @@ inherited frmClothInfo: TfrmClothInfo
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 103
Width = 88
end
object Tv1C_COLOR: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'C_COLOR'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_Width: TcxGridDBColumn
Caption = #25104#21697#38376#24133
DataBinding.FieldName = 'C_Width'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_washWidth: TcxGridDBColumn
Caption = #28165#27927#21518#38376#24133
DataBinding.FieldName = 'C_washWidth'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1LatitudeSlope: TcxGridDBColumn
Caption = #32428#26012
DataBinding.FieldName = 'LatitudeSlope'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1F_Width: TcxGridDBColumn
Caption = #22383#24067#38376#24133
DataBinding.FieldName = 'F_Width'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_FinishLatitudeDensity: TcxGridDBColumn
Caption = #25104#21697#32428#23494'('#26681'/'#33521#23544')'
DataBinding.FieldName = 'C_FinishLatitudeDensity'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 129
end
object Tv1C_GramWeight: TcxGridDBColumn
Caption = #25104#21697#20811#37325
DataBinding.FieldName = 'C_GramWeight'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1F_FinishLatitudeDensity: TcxGridDBColumn
Caption = #22383#24067#32428#23494'('#26681'/'#33521#23544')'
DataBinding.FieldName = 'F_FinishLatitudeDensity'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 130
end
object Tv1F_GramWeight: TcxGridDBColumn
Caption = #22383#24067#20811#37325
DataBinding.FieldName = 'F_GramWeight'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1DTMID: TcxGridDBColumn
Caption = #24037#33402#20027#38190
DataBinding.FieldName = 'DTMID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1DTMPSlist: TcxGridDBColumn
Caption = #20135#21697#40664#35748#24037#33402
DataBinding.FieldName = 'DTMPSlist'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 110
end
object Tv1CINote: TcxGridDBColumn
Caption = #22791#27880
DataBinding.FieldName = 'CINote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 62
Width = 49
end
end
object cxGrid1Level1: TcxGridLevel
@ -455,21 +548,23 @@ inherited frmClothInfo: TfrmClothInfo
object Panel7: TPanel
Left = 2
Top = 2
Width = 1212
Width = 1224
Height = 40
Align = alTop
BevelOuter = bvNone
TabOrder = 1
ExplicitWidth = 1212
object Panel4: TPanel
Left = 0
Top = 0
Width = 1212
Width = 1224
Height = 40
Align = alClient
AutoSize = True
TabOrder = 0
ExplicitWidth = 1212
DesignSize = (
1212
1224
40)
object Label14: TLabel
Left = 19
@ -566,50 +661,53 @@ inherited frmClothInfo: TfrmClothInfo
object Panel9: TPanel
Left = 2
Top = 412
Width = 1212
Width = 1224
Height = 205
Align = alBottom
Caption = 'Panel9'
TabOrder = 2
ExplicitWidth = 1212
object Panel10: TPanel
Left = 1
Top = 1
Width = 1210
Width = 1222
Height = 203
Align = alClient
Caption = 'Panel9'
TabOrder = 0
ExplicitWidth = 1210
object GroupBox1: TGroupBox
Left = 1
Top = 42
Width = 1208
Width = 1220
Height = 160
Align = alClient
Caption = #26679#21697#32553#30053#22270#65288#21452#20987#22270#29255#26597#30475#21407#22270#65289
TabOrder = 0
ExplicitWidth = 1208
object ScrollBox1: TScrollBox
Left = 2
Top = 14
Width = 1204
Width = 1216
Height = 144
Align = alClient
BevelInner = bvLowered
BorderStyle = bsNone
TabOrder = 0
ExplicitLeft = 3
ExplicitTop = 6
ExplicitWidth = 1204
end
end
object Panel11: TPanel
Left = 1
Top = 1
Width = 1208
Width = 1220
Height = 41
Align = alTop
TabOrder = 1
Visible = False
ExplicitWidth = 1208
DesignSize = (
1208
1220
41)
object Label7: TLabel
Left = 33
@ -625,7 +723,7 @@ inherited frmClothInfo: TfrmClothInfo
ParentFont = False
end
object cbbHX: TComboBox
Left = 368
Left = 373
Top = 3
Width = 210
Height = 32
@ -642,6 +740,7 @@ inherited frmClothInfo: TfrmClothInfo
OnChange = cbbHXChange
Items.Strings = (
#33457#22411)
ExplicitLeft = 368
end
end
end
@ -649,7 +748,7 @@ inherited frmClothInfo: TfrmClothInfo
object cxTabControl1: TcxTabControl
Left = 2
Top = 42
Width = 1212
Width = 1224
Height = 18
Align = alTop
TabOrder = 3
@ -661,16 +760,19 @@ inherited frmClothInfo: TfrmClothInfo
#24050#23457#26680
#20840#37096)
OnChange = cxTabControl1Change
ExplicitWidth = 1212
ClientRectRight = 0
ClientRectTop = 0
end
object cxGrid2: TcxGrid
Left = 828
Left = 1180
Top = 60
Width = 386
Width = 46
Height = 352
Align = alClient
Align = alRight
TabOrder = 4
Visible = False
ExplicitLeft = 1168
object Tv2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -774,8 +876,8 @@ inherited frmClothInfo: TfrmClothInfo
object RMDB_Main: TRMDBDataSet
Visible = True
DataSet = ADOQueryPrint
Left = 952
Top = 296
Left = 1032
Top = 240
end
object ODPat: TOpenDialog
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]

View File

@ -90,7 +90,7 @@ type
Label9: TLabel;
Material: TEdit;
Label8: TLabel;
DTMNo: TEdit;
C_NameGY: TEdit;
PM_1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
@ -102,13 +102,11 @@ type
Button2: TButton;
TCBNOR1: TComboBox;
RMBarCodeObject1: TRMBarCodeObject;
Tv1Column5: TcxGridDBColumn;
Tv1Column6: TcxGridDBColumn;
Tv1Column7: TcxGridDBColumn;
TbLook: TToolButton;
DataSource3: TDataSource;
CDS_Sub: TClientDataSet;
Tv1Column9: TcxGridDBColumn;
cxGridPopupMenu2: TcxGridPopupMenu;
ToolButton2: TToolButton;
N3: TMenuItem;
@ -137,6 +135,21 @@ type
Tv2DTMName: TcxGridDBColumn;
Tv1DTMNo: TcxGridDBColumn;
Tv1CFinishingStandards: TcxGridDBColumn;
Label1: TLabel;
C_NameWidth: TEdit;
Label2: TLabel;
C_NameSeHao: TEdit;
Tv1C_COLOR: TcxGridDBColumn;
Tv1C_Width: TcxGridDBColumn;
Tv1C_washWidth: TcxGridDBColumn;
Tv1LatitudeSlope: TcxGridDBColumn;
Tv1F_Width: TcxGridDBColumn;
Tv1C_FinishLatitudeDensity: TcxGridDBColumn;
Tv1C_GramWeight: TcxGridDBColumn;
Tv1F_FinishLatitudeDensity: TcxGridDBColumn;
Tv1F_GramWeight: TcxGridDBColumn;
Tv1DTMID: TcxGridDBColumn;
Tv1DTMPSlist: TcxGridDBColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
procedure TBDelClick(Sender: TObject);
@ -303,7 +316,7 @@ var
fwhere, MBCIID, Pwhere: string;
begin
Panel2.Visible := True;
Panel2.Refresh;
// Panel2.Refresh;
if not CDS_1.IsEmpty then
MBCIID := Trim(CDS_1.FieldByName('BCIID').AsString)
else
@ -314,6 +327,30 @@ begin
if cxTabControl1.TabIndex < 2 then
Pwhere := 'isnull(status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ';
if trim(C_NameGY.Text) <> '' then
begin
if Pwhere <> '' then
Pwhere := Pwhere + ' and C_Name like ''%-%-%-%' + trim(C_NameGY.Text) + '%'''
else
Pwhere := 'C_Name like ''%-%-%-%' + trim(C_NameGY.Text) + '%''';
end;
if trim(C_NameSeHao.Text) <> '' then
begin
if Pwhere <> '' then
Pwhere := Pwhere + ' and C_Name like ''%-%' + trim(C_NameSeHao.Text) + '%-%-%'''
else
Pwhere := 'C_Name like ''%-%' + trim(C_NameSeHao.Text) + '%-%-%''';
end;
if trim(C_NameWidth.Text) <> '' then
begin
if Pwhere <> '' then
Pwhere := Pwhere + ' and C_Name like ''%-%-%' + trim(C_NameWidth.Text) + '%-%'''
else
Pwhere := 'C_Name like ''%-%-%' + trim(C_NameWidth.Text) + '%-%''';
end;
if trim(Pwhere) <> '' then
begin
if fwhere <> '' then
@ -321,6 +358,7 @@ begin
else
fwhere := ' where ' + trim(Pwhere);
end;
// ShowMessage(fwhere);
try
ADOQueryMain.DisableControls;
@ -338,6 +376,7 @@ begin
Open;
end;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
// SDofilter(ADOQueryMain, Pwhere);
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
TV1.DataController.Filter.Clear;
@ -616,7 +655,7 @@ procedure TfrmClothInfo.C_CodeKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
CurrentPage := 1;
// CurrentPage := 1;
InitGrid();
end;
end;
@ -698,11 +737,8 @@ procedure TfrmClothInfo.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
var
fsj: string;
begin
fsj := 'select DISTINCT HXNAME name from TP_File where ISNULL(HXNAME,'''')<>'''' AND WBID=' + quotedstr(trim(CDS_1.fieldbyname('BCIID').AsString));
SInitComBoxBySql(ADOQueryTemp, cbbHX, True, fsj);
InitImage();
// InitImage();
end;
procedure TfrmClothInfo.TBMLEditClick(Sender: TObject);

View File

@ -446,7 +446,6 @@ object frmClothInfoInput: TfrmClothInfoInput
Height = 272
Align = alBottom
TabOrder = 24
ExplicitLeft = 0
object TV4: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>

View File

@ -1128,9 +1128,9 @@ begin
if Trim(FBCIID) = '' then
begin
Append;
FieldByName('FILLID').Value := Trim(DCode);
FieldByName('FILLER').Value := Trim(DName);
FieldByName('FILLTIME').Value := SGetServerDateTime(ADOQueryTemp);
FieldByName('EditId').Value := Trim(DCode);
FieldByName('EDITER').Value := Trim(DName);
FieldByName('EDITTIME').Value := SGetServerDateTime(ADOQueryTemp);
end
else
begin

View File

@ -1,45 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.242,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LbaelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.840,=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.716,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProcessSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.659,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtDyeInList.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.943,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.233,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProductInfoSel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.526,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_PrtDyeInfoInPut.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_ProductInfoInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.233,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProductInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.242,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LbaelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.840,=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.659,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtDyeInList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.486,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\ProductStk.dproj=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\InformationBase.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.923,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\Unit1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.997,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.486,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\InformationBase.dproj=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\ProductStk.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.716,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProcessSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.526,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_ProductInfoInPut.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_PrtDyeInfoInPut.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.233,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProductInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.713,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.659,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtDyeInList.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.233,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProductInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.713,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.526,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_PrtDyeInfoInPut.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_ProductInfoInPut.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.495,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.526,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_ProductInfoInPut.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_PrtDyeInfoInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.686,=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_ProductInfoInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.997,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.943,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.495,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.659,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInList.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtDyeInList.dfm</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\D10sxYilanbuyi"/>

View File

@ -166,7 +166,22 @@ begin
Edit;
FieldByName('BPIID').Value := Trim(MaxNo);
Post;
with ADOQueryCMD do
begin
Close;
SQL.Clear;
SQL.Add('EXEC P_UpdateBS_Cloth_Gy_SubZJ');
SQL.Add(' @BPIID = ' + QuotedStr(Trim(MaxNo)));
SQL.Add(' ,@P_Name = '+ QuotedStr(Trim(CDS_Sub.FieldByName('P_Name').asString)) );
SQL.Add(' ,@P_Type = ' + QuotedStr(Trim(CDS_Sub.FieldByName('P_Type').asString)) );
SQL.Add(' ,@QtyUnit = ' + QuotedStr(Trim(CDS_Sub.FieldByName('QtyUnit').asString)) );
ExecSQL;
end;
Next;
end;
end;
CDS_Sub.EnableControls;

View File

@ -163,6 +163,7 @@ inherited frmPrtDyeInfoList: TfrmPrtDyeInfoList
Height = 475
Align = alClient
TabOrder = 2
ExplicitTop = 87
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>

View File

@ -1,46 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothOutEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.394,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothOutEdit.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachOutEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.440,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyePlanCardSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.865,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LbaelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.796,=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothInEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.398,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothInEdit.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.398,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInEdit.pas=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothInEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.951,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\InformationBase.dproj=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\DyeGreyClothStk.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.817,=D:\Dp10Repo\public10\design\U_BaseDataLink.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.440,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyePlanCardSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.070,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothStkSel.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMacStkSel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.394,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachOutEdit.pas=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothOutEdit.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.070,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMacStkSel.dfm=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothStkSel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.394,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachOutEdit.dfm=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothOutEdit.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.398,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothInEdit.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInEdit.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.951,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\DyeGreyClothStk.dproj=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\InformationBase.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.791,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelMapSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.070,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMacStkSel.pas=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothStkSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.069,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.394,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothOutEdit.dfm=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachOutEdit.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.278,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.070,D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothStkSel.pas=D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMacStkSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.492,=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothStkSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.716,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProcessSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.398,D:\Dp10Repo\项目代码\RTBasics\B03基础物料仓库\U_BSPrtMachInEdit.dfm=D:\Dp10Repo\项目代码\RTBasics\F01染色坯布仓库\U_DyeGreyClothInEdit.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.069,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>2025/08/29 17:00:58.000.253,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F01染色坯布仓库\U_DyePlanForCardSel.pas</Transaction>
<Transaction>2025/09/29 17:18:11.000.618,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F01染色坯布仓库\U_DyePBImport.pas</Transaction>
<Transaction>2025/10/13 14:35:20.000.136,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F01染色坯布仓库\U_DyeGreyClothStkStats.pas</Transaction>

View File

@ -130,7 +130,7 @@ inherited frmDyeGreyClothInList: TfrmDyeGreyClothInList
Caption = #33267
end
object Label3: TLabel
Left = 351
Left = 365
Top = 12
Width = 48
Height = 12
@ -139,12 +139,12 @@ inherited frmDyeGreyClothInList: TfrmDyeGreyClothInList
object Label5: TLabel
Left = 178
Top = 12
Width = 48
Width = 60
Height = 12
Caption = #20837#24211#21333#21495
Caption = #29983#20135#35746#21333#21495
end
object Label8: TLabel
Left = 351
Left = 365
Top = 37
Width = 60
Height = 12
@ -177,41 +177,41 @@ inherited frmDyeGreyClothInList: TfrmDyeGreyClothInList
end
object C_name: TEdit
Tag = 2
Left = 413
Left = 427
Top = 8
Width = 100
Height = 20
TabOrder = 2
OnChange = TBFindClick
OnKeyPress = OrderNoKeyPress
end
object BCIOID: TEdit
object OrderNo: TEdit
Tag = 2
Left = 228
Left = 242
Top = 8
Width = 109
Height = 20
TabOrder = 3
OnChange = BCIOIDChange
OnKeyPress = OrderNoKeyPress
end
object finishDescription: TEdit
Tag = 2
Left = 413
Left = 427
Top = 33
Width = 100
Height = 20
TabOrder = 4
OnChange = finishDescriptionChange
OnKeyPress = OrderNoKeyPress
end
object IOType: TComboBox
Tag = 2
Left = 228
Left = 242
Top = 33
Width = 109
Height = 20
Style = csDropDownList
DropDownCount = 20
TabOrder = 5
OnChange = TBFindClick
OnChange = IOTypeChange
Items.Strings = (
#21152#24037#20837#24211
#22238#20462#20837#24211
@ -230,6 +230,7 @@ inherited frmDyeGreyClothInList: TfrmDyeGreyClothInList
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 2
ExplicitTop = 97
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -559,13 +560,13 @@ inherited frmDyeGreyClothInList: TfrmDyeGreyClothInList
Visible = True
DataSet = CDS_HZ
Left = 600
Top = 232
Top = 233
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 520
Top = 232
Top = 233
end
object CDS_PRT: TClientDataSet
Aggregates = <>

View File

@ -50,7 +50,7 @@ type
Label8: TLabel;
Label12: TLabel;
C_name: TEdit;
BCIOID: TEdit;
OrderNo: TEdit;
finishDescription: TEdit;
IOType: TComboBox;
cxGrid2: TcxGrid;
@ -90,13 +90,12 @@ type
procedure TBDelClick(Sender: TObject);
procedure TBAddClick(Sender: TObject);
procedure TBEditClick(Sender: TObject);
procedure BCIOIDChange(Sender: TObject);
procedure finishDescriptionChange(Sender: TObject);
procedure FromCoNameChange(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
procedure IOTypeChange(Sender: TObject);
private
canshu1, canshu2, canshu3, FWorkshop: string;
@ -170,6 +169,12 @@ begin
end;
end;
procedure TfrmDyeGreyClothInList.IOTypeChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothInList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
@ -301,6 +306,16 @@ begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmDyeGreyClothInList.OrderNoKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13 then
begin
TBFind.Click;
end;
end;
procedure TfrmDyeGreyClothInList.TBDelClick(Sender: TObject);
var
MBCIOID: string;
@ -416,25 +431,7 @@ begin
end;
end;
procedure TfrmDyeGreyClothInList.BCIOIDChange(Sender: TObject);
begin
if Length(Trim(BCIOID.Text)) < 4 then
begin
if Trim(BCIOID.Text) <> '' then
Exit;
end;
TBFind.Click;
end;
procedure TfrmDyeGreyClothInList.finishDescriptionChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothInList.FromCoNameChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothInList.cxTabControl1Change(Sender: TObject);
begin

View File

@ -115,6 +115,7 @@ inherited frmDyeGreyClothOutList: TfrmDyeGreyClothOutList
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
ExplicitTop = 44
object Label1: TLabel
Left = 28
Top = 12
@ -130,7 +131,7 @@ inherited frmDyeGreyClothOutList: TfrmDyeGreyClothOutList
Caption = #33267
end
object Label3: TLabel
Left = 321
Left = 333
Top = 12
Width = 48
Height = 12
@ -139,12 +140,12 @@ inherited frmDyeGreyClothOutList: TfrmDyeGreyClothOutList
object Label5: TLabel
Left = 178
Top = 12
Width = 48
Width = 60
Height = 12
Caption = #20986#24211#21333#21495
Caption = #29983#20135#35746#21333#21495
end
object Label8: TLabel
Left = 321
Left = 333
Top = 39
Width = 60
Height = 12
@ -184,34 +185,34 @@ inherited frmDyeGreyClothOutList: TfrmDyeGreyClothOutList
end
object C_NAME: TEdit
Tag = 2
Left = 384
Left = 396
Top = 8
Width = 80
Height = 20
TabOrder = 2
OnChange = TBFindClick
OnKeyPress = OrderNoKeyPress
end
object BCIOID: TEdit
object OrderNo: TEdit
Tag = 2
Left = 228
Left = 240
Top = 8
Width = 80
Height = 20
TabOrder = 3
OnChange = BCIOIDChange
OnKeyPress = OrderNoKeyPress
end
object finishDescription: TEdit
Tag = 2
Left = 384
Left = 396
Top = 35
Width = 80
Height = 20
TabOrder = 4
OnChange = finishDescriptionChange
OnKeyPress = OrderNoKeyPress
end
object IOType: TComboBox
Tag = 2
Left = 228
Left = 240
Top = 35
Width = 80
Height = 20
@ -231,7 +232,6 @@ inherited frmDyeGreyClothOutList: TfrmDyeGreyClothOutList
Width = 100
Height = 20
TabOrder = 6
OnChange = finishDescriptionChange
end
end
object cxGrid2: TcxGrid [2]

View File

@ -50,7 +50,7 @@ type
Label8: TLabel;
Label12: TLabel;
C_NAME: TEdit;
BCIOID: TEdit;
OrderNo: TEdit;
finishDescription: TEdit;
IOType: TComboBox;
ToolButton1: TToolButton;
@ -88,16 +88,15 @@ type
procedure TBExportClick(Sender: TObject);
procedure TBFindClick(Sender: TObject);
procedure SPNameChange(Sender: TObject);
procedure BCIOIDChange(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure TBDelClick(Sender: TObject);
procedure TBAddClick(Sender: TObject);
procedure TBEditClick(Sender: TObject);
procedure finishDescriptionChange(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
private
canshu1, canshu2, FWorkshop: string;
procedure InitGrid();
@ -282,15 +281,6 @@ begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothOutList.BCIOIDChange(Sender: TObject);
begin
if Length(Trim(BCIOID.Text)) < 4 then
begin
if Trim(BCIOID.Text) <> '' then
Exit;
end;
TBFind.Click;
end;
procedure TfrmDyeGreyClothOutList.N1Click(Sender: TObject);
begin
@ -302,6 +292,16 @@ begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmDyeGreyClothOutList.OrderNoKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13 then
begin
TBFind.Click;
end;
end;
procedure TfrmDyeGreyClothOutList.TBDelClick(Sender: TObject);
var
MBCIOID: string;
@ -417,10 +417,6 @@ begin
end;
procedure TfrmDyeGreyClothOutList.finishDescriptionChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothOutList.cxTabControl1Change(Sender: TObject);
begin

View File

@ -92,14 +92,14 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
Color = clSkyBlue
TabOrder = 1
object Label3: TLabel
Left = 324
Left = 331
Top = 14
Width = 48
Height = 12
Caption = #25104#21697#21517#31216
end
object Label8: TLabel
Left = 487
Left = 494
Top = 14
Width = 60
Height = 12
@ -108,12 +108,12 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
object Label2: TLabel
Left = 38
Top = 14
Width = 48
Width = 60
Height = 12
Caption = #20837#24211#21333#21495
Caption = #29983#20135#35746#21333#21495
end
object Label5: TLabel
Left = 183
Left = 190
Top = 14
Width = 48
Height = 12
@ -121,39 +121,39 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
end
object C_name: TEdit
Tag = 2
Left = 373
Left = 380
Top = 10
Width = 100
Height = 20
TabOrder = 0
OnChange = TBFindClick
OnKeyPress = OrderNoKeyPress
end
object finishDescription: TEdit
Tag = 2
Left = 552
Left = 559
Top = 10
Width = 100
Height = 20
TabOrder = 1
OnChange = TBFindClick
OnKeyPress = OrderNoKeyPress
end
object BCIOID: TEdit
object OrderNo: TEdit
Tag = 2
Left = 92
Left = 99
Top = 10
Width = 78
Height = 20
TabOrder = 2
OnChange = FromCoNameChange
OnKeyPress = OrderNoKeyPress
end
object ioType: TEdit
Tag = 2
Left = 237
Left = 244
Top = 10
Width = 78
Height = 20
TabOrder = 3
OnChange = FromCoNameChange
OnKeyPress = OrderNoKeyPress
end
end
object cxGrid2: TcxGrid [2]
@ -294,14 +294,14 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
DataBinding.FieldName = 'F_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 71
Width = 80
end
object v1Column9: TcxGridDBColumn
Caption = #20837#24211#25968#37327
DataBinding.FieldName = 'Qty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 63
Width = 81
end
object v2Column6: TcxGridDBColumn
Tag = 2
@ -311,21 +311,21 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 74
Width = 89
end
object Tv1QtyUnit: TcxGridDBColumn
Caption = #25968#37327#21333#20301
DataBinding.FieldName = 'QtyUnit'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
Width = 96
end
object v1Column7: TcxGridDBColumn
Caption = #20837#24211#21305#25968
DataBinding.FieldName = 'piece'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 62
Width = 96
end
object v1Column1: TcxGridDBColumn
Caption = #24211#23384#21305#25968
@ -333,7 +333,7 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 69
Width = 97
end
object v1Column4: TcxGridDBColumn
Caption = #25104#21697#38376#24133
@ -341,7 +341,7 @@ inherited frmDyeGreyClothStkList: TfrmDyeGreyClothStkList
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 74
Width = 80
end
object v1Column8: TcxGridDBColumn
Tag = 2

View File

@ -44,7 +44,7 @@ type
Label2: TLabel;
C_name: TEdit;
finishDescription: TEdit;
BCIOID: TEdit;
OrderNo: TEdit;
Tv1IOTime: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column9: TcxGridDBColumn;
@ -71,7 +71,6 @@ type
procedure TBFindClick(Sender: TObject);
procedure MPRTCodeNameChange(Sender: TObject);
procedure SXBatchNOChange(Sender: TObject);
procedure FromCoNameChange(Sender: TObject);
// procedure ToolButton1Click(Sender: TObject);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure FormCreate(Sender: TObject);
@ -81,6 +80,7 @@ type
procedure Tv1Column3PropertiesChange(Sender: TObject);
procedure Tv1Column3PropertiesEditValueChanged(Sender: TObject);
procedure TbExportClick(Sender: TObject);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
private
procedure InitGrid();
{ Private declarations }
@ -127,7 +127,7 @@ begin
Close;
sql.Clear;
sql.Add(' select A.* ');
sql.Add(' from BS_Cloth_IO A ');
sql.Add(' from V_BS_Cloth_Stk A ');
SQL.Add(' where A.IOFlag=''Èë¿â'' and (isnull(StkQty,0)>0 or isnull(StkPiece,0)>0) ');
sql.Add(' and isnull(stkName,'''')=''' + Trim(FstkName) + '''');
if trim(FWorkshop) <> '' then
@ -190,15 +190,23 @@ begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothStkList.OrderNoKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13 then
begin
TBFind.Click;
end;
end;
procedure TfrmDyeGreyClothStkList.SXBatchNOChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyeGreyClothStkList.FromCoNameChange(Sender: TObject);
begin
TBFind.Click;
end;
//procedure TfrmDyeGreyClothStkList.ToolButton1Click(Sender: TObject);
//var

View File

@ -2,7 +2,7 @@ inherited frmDyeGreyClothStkSel: TfrmDyeGreyClothStkSel
Left = 105
Top = 131
Caption = #24211#23384#36873#25321#21015#34920
ClientHeight = 472
ClientHeight = 527
ClientWidth = 1165
Color = clWhite
Font.Charset = GB2312_CHARSET
@ -11,7 +11,7 @@ inherited frmDyeGreyClothStkSel: TfrmDyeGreyClothStkSel
Position = poMainFormCenter
OnClose = FormClose
ExplicitWidth = 1181
ExplicitHeight = 511
ExplicitHeight = 566
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar [0]
@ -174,10 +174,11 @@ inherited frmDyeGreyClothStkSel: TfrmDyeGreyClothStkSel
Left = 0
Top = 74
Width = 1165
Height = 398
Height = 453
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 2
ExplicitTop = 71
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -223,10 +224,6 @@ inherited frmDyeGreyClothStkSel: TfrmDyeGreyClothStkSel
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.IncSearch = DataLink_DyeGreyClothStk.SHuangSe
Styles.Header = DataLink_DyeGreyClothStk.Default
Styles.Inactive = DataLink_DyeGreyClothStk.SHuangSe
Styles.Selection = DataLink_DyeGreyClothStk.SHuangSe
object Tv1Column2: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'ssel'
@ -449,6 +446,7 @@ inherited frmDyeGreyClothStkSel: TfrmDyeGreyClothStkSel
Top = 232
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 520
Top = 232

View File

@ -5,7 +5,6 @@ inherited frmDyeGreyClothStkStats: TfrmDyeGreyClothStkStats
ClientHeight = 567
ClientWidth = 1400
Position = poDefault
ExplicitLeft = -549
ExplicitWidth = 1416
ExplicitHeight = 606
PixelsPerInch = 96
@ -144,7 +143,7 @@ inherited frmDyeGreyClothStkStats: TfrmDyeGreyClothStkStats
Width = 100
Height = 20
TabOrder = 1
OnChange = TBFindClick
OnKeyPress = finishDescriptionKeyPress
end
object BegDate: TDateTimePicker
Left = 77
@ -173,6 +172,7 @@ inherited frmDyeGreyClothStkStats: TfrmDyeGreyClothStkStats
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 2
ExplicitTop = 111
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -303,7 +303,7 @@ inherited frmDyeGreyClothStkStats: TfrmDyeGreyClothStkStats
Width = 104
end
object Tv1IOTime: TcxGridDBColumn
Caption = #22383#24067#20837#24211#26102#38388
Caption = #22383#24067#20837#24211#26085#26399
DataBinding.FieldName = 'IOTime'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -348,6 +348,41 @@ inherited frmDyeGreyClothStkStats: TfrmDyeGreyClothStkStats
HeaderAlignmentHorz = taCenter
Width = 85
end
object Tv1CPRKQty: TcxGridDBColumn
Caption = #25104#21697#20837#24211#25968#37327
DataBinding.FieldName = 'CPRKQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1CPRKPiece: TcxGridDBColumn
Caption = #25104#21697#20837#24211#21305#25968
DataBinding.FieldName = 'CPRKPiece'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1CPCKQty: TcxGridDBColumn
Caption = #25104#21697#20986#24211#25968#37327
DataBinding.FieldName = 'CPCKQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1CPCKPiece: TcxGridDBColumn
Caption = #25104#21697#20986#24211#21305#25968
DataBinding.FieldName = 'CPCKPiece'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1CPCKIOTime: TcxGridDBColumn
Caption = #25104#21697#20986#24211#26102#38388
DataBinding.FieldName = 'CPCKIOTime'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object v1Column14: TcxGridDBColumn
Tag = 2
Caption = #32553#29575

View File

@ -58,6 +58,11 @@ type
EndDate: TDateTimePicker;
Tv1CKIOTime: TcxGridDBColumn;
TbSave: TToolButton;
Tv1CPRKQty: TcxGridDBColumn;
Tv1CPRKPiece: TcxGridDBColumn;
Tv1CPCKQty: TcxGridDBColumn;
Tv1CPCKPiece: TcxGridDBColumn;
Tv1CPCKIOTime: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBRafreshClick(Sender: TObject);
@ -78,6 +83,7 @@ type
procedure Tv1Column3PropertiesEditValueChanged(Sender: TObject);
procedure TbExportClick(Sender: TObject);
procedure TbSaveClick(Sender: TObject);
procedure finishDescriptionKeyPress(Sender: TObject; var Key: Char);
private
procedure InitGrid();
function SaveData(): Boolean;
@ -103,6 +109,16 @@ begin
frmDyeGreyClothStkStats := nil;
end;
procedure TfrmDyeGreyClothStkStats.finishDescriptionKeyPress(Sender: TObject;
var Key: Char);
begin
if Key = #13 then
begin
TBFind.Click;
end;
end;
procedure TfrmDyeGreyClothStkStats.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
@ -169,7 +185,7 @@ end;
procedure TfrmDyeGreyClothStkStats.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(trim(Self.Caption), Tv1, 'Å÷²¼¿â´æÍ³¼Æ');
// ReadCxGrid(trim(Self.Caption), Tv1, 'Å÷²¼¿â´æÍ³¼Æ');
BegDate.DateTime := SGetServerDate(ADOQueryCmd) - 2;
EndDate.DateTime := SGetServerDate(ADOQueryCmd);
InitGrid();

View File

@ -165,7 +165,7 @@ begin
end;
end;
411: //Å÷²¼¿â´æÍ³¼Æ
411: //셕뺍데욋닸固셕
begin
with TfrmDyeGreyClothStkStats.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
begin

View File

@ -40,7 +40,9 @@ uses
U_DyeProcessDefin in 'U_DyeProcessDefin.pas' {frmDyeProcessDefin},
U_ProductInfoSel in '..\A00通用窗体\U_ProductInfoSel.pas' {frmProductInfoSel},
U_CraftSel in 'U_CraftSel.pas' {frmCraftSel},
U_DyeSimpleTechnicsList in 'U_DyeSimpleTechnicsList.pas' {frmDyeSimpleTechnicsList};
U_DyeSimpleTechnicsList in 'U_DyeSimpleTechnicsList.pas' {frmDyeSimpleTechnicsList},
U_DyeTechnicsinputKaika in 'U_DyeTechnicsinputKaika.pas' {frmDyeTechnicsinputKaika},
U_DyeSimpleTechnicsKaiKa in 'U_DyeSimpleTechnicsKaiKa.pas' {frmDyeSimpleTechnicsKaiKa};
{$R *.res}

View File

@ -199,6 +199,14 @@
<Form>frmDyeSimpleTechnicsList</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="U_DyeTechnicsinputKaika.pas">
<Form>frmDyeTechnicsinputKaika</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="U_DyeSimpleTechnicsKaiKa.pas">
<Form>frmDyeSimpleTechnicsKaiKa</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -30,13 +30,14 @@
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.495,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeProcessList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.722,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyeGreyClothOutSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.014,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeTechnicsList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.531,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeTechnicsList.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeTechnicsinput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.855,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanList.dfm=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanList1.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.344,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeCardInput.dfm=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.855,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanList.dfm=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanList1.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.571,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelMapSet.pas</Transaction>
@ -44,22 +45,23 @@
<Transaction>1899/12/30 00:00:00.000.782,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.dfm=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput1.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.344,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeCardInput.dfm=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.905,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.058,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyeTechnicsSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.359,D:\Dp10Repo\项目代码\傲唐\财务管理(Financial.dll)\U_YWTCInPut.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.383,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F02染色计划单\U_CraftSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.046,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyeProcessSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.383,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F02染色计划单\U_CraftSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.286,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.905,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.344,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeCardInput.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.819,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeInspSet.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.058,=D:\Dp10Repo\项目代码\RTBasics\F00染色通用窗体\U_DyeTechnicsSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.344,D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeCardInput.pas=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanCardInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.286,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyePlanInPut.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.213,=D:\Dp10Repo\项目代码\RTBasics\F02染色计划单\U_DyeCardInput.pas</Transaction>
<Transaction>2025/09/28 12:18:54.000.943,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F02染色计划单\U_DyeSimpleTechnicsList.pas</Transaction>
<Transaction>2025/11/01 09:33:01.000.459,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F02染色计划单\U_DyeTechnicsinputKaika.pas</Transaction>
<Transaction>2025/11/01 09:39:35.000.613,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F02染色计划单\U_DyeSimpleTechnicsKaiKa.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\D10sxYilanbuyi"/>
@ -131,5 +133,9 @@
<File Path="U_CraftSel.dfm"/>
<File Path="U_DyeSimpleTechnicsList.pas"/>
<File Path="U_DyeSimpleTechnicsList.dfm"/>
<File Path="U_DyeTechnicsinputKaika.pas"/>
<File Path="U_DyeTechnicsinputKaika.dfm"/>
<File Path="U_DyeSimpleTechnicsKaiKa.pas"/>
<File Path="U_DyeSimpleTechnicsKaiKa.dfm"/>
</ProjectSortOrder>
</BorlandProject>

View File

@ -10,6 +10,7 @@ inherited frmCraftSel: TfrmCraftSel
Font.Name = #23435#20307
Position = poScreenCenter
OnClose = FormClose
OnKeyDown = FormKeyDown
ExplicitWidth = 909
ExplicitHeight = 597
PixelsPerInch = 96
@ -22,6 +23,7 @@ inherited frmCraftSel: TfrmCraftSel
Align = alClient
TabOrder = 0
object TV1: TcxGridDBTableView
OnDblClick = TV1DblClick
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_1

View File

@ -63,6 +63,8 @@ type
procedure TBSaveFormatClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure DTMNoChange(Sender: TObject);
procedure TV1DblClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
procedure InitGrid();
{ Private declarations }
@ -142,7 +144,7 @@ begin
InitGrid();
ReadCxGrid(self.Caption + 'TV1', TV1, '工艺信息选择');
KeyPreview := True;
end;
procedure TfrmCraftSel.TBCloseClick(Sender: TObject);
@ -169,11 +171,28 @@ begin
ModalResult := 1;
end;
procedure TfrmCraftSel.TV1DblClick(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
ModalResult := 1;
end;
procedure TfrmCraftSel.FormDestroy(Sender: TObject);
begin
inherited;
frmCraftSel := nil;
end;
procedure TfrmCraftSel.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
end.

View File

@ -2,7 +2,6 @@ inherited frmDyeCardList: TfrmDyeCardList
Caption = #29983#20135#27969#31243#21345
ClientHeight = 632
ClientWidth = 1503
ExplicitTop = -2
ExplicitWidth = 1519
ExplicitHeight = 671
PixelsPerInch = 96
@ -170,7 +169,6 @@ inherited frmDyeCardList: TfrmDyeCardList
Color = clWhite
ParentBackground = False
TabOrder = 1
ExplicitTop = 32
object Label1: TLabel
Left = 23
Top = 12
@ -454,7 +452,6 @@ inherited frmDyeCardList: TfrmDyeCardList
Align = alClient
PopupMenu = PM_1
TabOrder = 2
ExplicitTop = 125
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -760,7 +757,6 @@ inherited frmDyeCardList: TfrmDyeCardList
#24050#23436#25104
#20840#37096)
OnChange = cxTabControl1Change
ExplicitTop = 96
ClientRectBottom = 22
ClientRectRight = 1503
ClientRectTop = 19

View File

@ -8,6 +8,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Position = poMainFormCenter
OnClose = FormClose
OnKeyDown = FormKeyDown
ExplicitWidth = 1464
ExplicitHeight = 828
PixelsPerInch = 96
@ -173,22 +174,22 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
end
object PCType: TComboBox
Left = 683
Top = 12
Top = 10
Width = 93
Height = 20
Style = csDropDownList
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ItemIndex = 0
ItemIndex = 2
ParentFont = False
TabOrder = 3
Text = #27491#24120#21345
Text = #22806#22238#20462
Items.Strings = (
#27491#24120#21345
#21069#36947#21345)
#26679#24067#21345
#22806#22238#20462)
end
object PCQty: TEdit
Tag = 2
@ -232,6 +233,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 6
OnClick = avgCardClick
end
end
object pnlOrder: TPanel
@ -285,7 +287,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
ParentFont = False
end
object Label11: TLabel
Left = 721
Left = 743
Top = 11
Width = 26
Height = 12
@ -311,7 +313,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
ParentFont = False
end
object Label24: TLabel
Left = 876
Left = 898
Top = 11
Width = 52
Height = 12
@ -324,7 +326,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
ParentFont = False
end
object Label2: TLabel
Left = 1068
Left = 1090
Top = 10
Width = 52
Height = 12
@ -389,6 +391,20 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Left = 892
Top = 45
Width = 52
Height = 12
Caption = #24037#33402#35201#27714
Font.Charset = GB2312_CHARSET
Font.Color = clMaroon
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object OrderNo: TBtnEditA
Tag = 2
Left = 101
@ -435,7 +451,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
end
object C_COLORNO: TEdit
Tag = 2
Left = 753
Left = 775
Top = 7
Width = 100
Height = 20
@ -447,24 +463,9 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
ParentFont = False
TabOrder = 3
end
object C_Color: TComboBox
Left = 590
Top = 7
Width = 117
Height = 20
Style = csDropDownList
Font.Charset = GB2312_CHARSET
Font.Color = clBlue
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 4
OnChange = C_ColorChange
end
object OrdQty: TEdit
Tag = 2
Left = 930
Left = 952
Top = 7
Width = 81
Height = 20
@ -475,11 +476,11 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 5
TabOrder = 4
end
object OrdUnit: TEdit
Tag = 2
Left = 1009
Left = 1031
Top = 7
Width = 41
Height = 20
@ -490,11 +491,11 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 6
TabOrder = 5
end
object OrdPiece: TEdit
Tag = 2
Left = 1122
Left = 1148
Top = 6
Width = 81
Height = 20
@ -505,7 +506,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 7
TabOrder = 6
end
object DTMPSlist: TBtnEditA
Left = 307
@ -519,7 +520,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 8
TabOrder = 7
OnBtnClick = DTMPSlistBtnClick
end
object C_Name: TEdit
@ -534,7 +535,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 9
TabOrder = 8
end
object DTMID: TEdit
Tag = 2
@ -548,12 +549,12 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 10
TabOrder = 9
Visible = False
end
object CINote: TEdit
Tag = 2
Left = 782
Left = 781
Top = 37
Width = 100
Height = 20
@ -563,7 +564,36 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 10
end
object C_description: TEdit
Tag = 2
Left = 950
Top = 33
Width = 100
Height = 20
Font.Charset = GB2312_CHARSET
Font.Color = clBlue
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 11
Visible = False
end
object C_COLOR: TEdit
Tag = 2
Left = 592
Top = 6
Width = 129
Height = 20
Font.Charset = GB2312_CHARSET
Font.Color = clBlue
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 12
end
end
object cxGrid2: TcxGrid
@ -633,6 +663,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.FieldName = 'IOType'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80
end
object Tv1OrderNo: TcxGridDBColumn
@ -640,7 +671,8 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 78
Options.Editing = False
Width = 115
end
object v2Column1: TcxGridDBColumn
Tag = 2
@ -663,7 +695,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 84
Width = 115
end
object cxGridDBColumn5: TcxGridDBColumn
Caption = #21305#25968
@ -673,7 +705,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Options.Editing = False
Styles.Content = DataLink_DyePlan.FontBlue
Styles.Header = DataLink_DyePlan.FontBlue
Width = 86
Width = 91
end
object v2Column6: TcxGridDBColumn
Tag = 2
@ -685,7 +717,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
Options.Editing = False
Styles.Content = DataLink_DyePlan.FontBlue
Styles.Header = DataLink_DyePlan.FontBlue
Width = 84
Width = 102
end
object cxGridDBColumn6: TcxGridDBColumn
Tag = 2
@ -700,7 +732,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
'Y')
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 51
Width = 106
end
object cxGridDBColumn3: TcxGridDBColumn
Caption = #25104#21697#38376#24133
@ -708,7 +740,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
Width = 104
end
object v1Column8: TcxGridDBColumn
Tag = 2
@ -726,7 +758,14 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
Width = 100
end
object TV2C_description: TcxGridDBColumn
Caption = #24037#33402#35201#27714
DataBinding.FieldName = 'C_description'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
end
object cxGrid2Level1: TcxGridLevel
@ -1244,6 +1283,14 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
HeaderAlignmentHorz = taCenter
Width = 32
end
object TV1KaZu: TcxGridDBColumn
Caption = #21345#32452#21495
DataBinding.FieldName = 'KaZu'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80
end
object V1Column1: TcxGridDBColumn
Tag = 7
Caption = #21345#21495
@ -1337,7 +1384,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.FieldName = 'C_Color'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 78
Width = 142
end
object V1Column6: TcxGridDBColumn
Caption = #21333#20301
@ -1365,7 +1412,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.FieldName = 'PCNote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 195
Width = 126
end
object TV1Column10: TcxGridDBColumn
Tag = 7
@ -1400,6 +1447,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Column13: TcxGridDBColumn
Tag = 7
@ -1408,6 +1456,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Column14: TcxGridDBColumn
Tag = 7
@ -1416,6 +1465,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Column15: TcxGridDBColumn
Tag = 7
@ -1424,6 +1474,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Column16: TcxGridDBColumn
Tag = 7
@ -1432,6 +1483,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Column17: TcxGridDBColumn
Tag = 7
@ -1440,6 +1492,22 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1C_description: TcxGridDBColumn
Caption = #24037#33402#35201#27714
DataBinding.FieldName = 'C_description'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1CINote: TcxGridDBColumn
Caption = #20135#21697#20449#24687#22791#27880
DataBinding.FieldName = 'CINote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 70
end
end
object cxGrid1Level1: TcxGridLevel
@ -1474,7 +1542,6 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
AutoSize = True
Caption = #20445#23384
ImageIndex = 16
Visible = False
OnClick = ToolButton5Click
end
object ToolButton1: TToolButton
@ -1596,6 +1663,7 @@ inherited frmDyePlanCardInput: TfrmDyePlanCardInput
end
end
object GPM_2: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 408
Top = 144

View File

@ -151,7 +151,6 @@ type
C_Width: TEdit;
C_GramWeight: TEdit;
C_COLORNO: TEdit;
C_Color: TComboBox;
Label24: TLabel;
OrdQty: TEdit;
OrdUnit: TEdit;
@ -171,6 +170,13 @@ type
avgCard: TButton;
Label8: TLabel;
CINote: TEdit;
TV1KaZu: TcxGridDBColumn;
TV2C_description: TcxGridDBColumn;
C_description: TEdit;
Label12: TLabel;
TV1C_description: TcxGridDBColumn;
TV1CINote: TcxGridDBColumn;
C_COLOR: TEdit;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -189,11 +195,13 @@ type
procedure Button1Click(Sender: TObject);
procedure TV3DblClick(Sender: TObject);
procedure OrderNoBtnClick(Sender: TObject);
procedure C_ColorChange(Sender: TObject);
procedure C_COLORChange(Sender: TObject);
procedure TV3Column1PropertiesEditValueChanged(Sender: TObject);
procedure DTMPSlistBtnClick(Sender: TObject);
procedure TV2DblClick(Sender: TObject);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
procedure avgCardClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
FC_Code: string;
FRollNum: integer;
@ -205,6 +213,9 @@ type
function GetCard(): Boolean;
procedure InitRepairCard(PPCID: string);
{ Private declarations }
procedure ShowDistributionResult(cardCount: Integer; pieceArray, qtyArray: array of Double);
procedure CalculateDistribution(totalValue: Double; cardCount: Integer; var resultArray: array of Double);
public
FWorkshop, FPCIDS, FMainID: string;
@ -337,13 +348,13 @@ begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select OrderNo, C_Name, F_Name, QtyUnit, Material,SUM(StkQty) as StkQty, SUM(StkPiece) as StkPiece ');
sql.Add(' ,IOTime = min(IOTime) ,IOType = min(ioType) ,C_Width = min(C_Width) ,F_Width = min(F_Width)');
sql.Add(' from BS_Cloth_IO A where isnull(STKName,'''')=''染色坯布'' ');
SQL.Add(' and A.IOFlag=''入库'' ');
sql.Add(' select A.OrderNo, A.C_Name, A.F_Name, A.QtyUnit, A.Material,SUM(A.StkQty) as StkQty, SUM(A.StkPiece) as StkPiece ');
sql.Add(' ,IOTime = min(A.IOTime) ,IOType = min(A.ioType) ,C_Width = min(A.C_Width) ,F_Width = min(A.F_Width),C_description = min(B.C_description)');
sql.Add(' from BS_Cloth_IO A left join Dye_Plan_Main B on A.OrderNo= B.OrderNo ');
SQL.Add(' where isnull(A.STKName,'''')=''染色坯布'' and A.IOFlag=''入库'' ');
// SQL.Add(' and EXISTS(select * from [dbo].[F_Tool_SplitString](' + quotedstr(FGC_STKID) + ','','' ) X where X.RTValue=A.StkId AND ISNULL(RTValue,'''')<>'''') ');
SQL.Add(' and A.OrderNo= ' + QuotedStr(trim(OrderNo.Text)));
SQL.Add(' group by OrderNo, C_Name, F_Name, QtyUnit, Material ');
SQL.Add(' group by A.OrderNo, A.C_Name, A.F_Name, A.QtyUnit, A.Material ');
// ShowMessage(sql.Text);
Open;
end;
@ -408,15 +419,6 @@ end;
procedure TfrmDyePlanCardInput.OrderNoBtnClick(Sender: TObject);
begin
with ADOQueryTmp do
begin
close;
sql.Clear;
sql.Add('exec P_OrderCR');
// ShowMessage(sql.Text);
execsql;
end;
frmProductOrderListSel := TfrmProductOrderListSel.create(self);
with frmProductOrderListSel do
@ -511,6 +513,16 @@ begin
frmDyePlanCardInput := nil;
end;
procedure TfrmDyePlanCardInput.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyePlanCardInput.DTMPSlistBtnClick(Sender: TObject);
begin
try
@ -538,6 +550,228 @@ begin
end;
end;
procedure TfrmDyePlanCardInput.avgCardClick(Sender: TObject);
var
i, k: integer;
maxId, KZmaxID: string;
totalPieces, totalQty: Double;
pieceArray: array of Double;
qtyArray: array of Double;
mQRCode : string;
begin
// 验证输入
if trim(C_Name.Text) = '' then
begin
application.MessageBox('产品名称不能为空!', '提示信息', MB_ICONERROR);
exit;
end;
if (StrToFloatDef(PCPiece.Text, 0) + StrToFloatDef(PCQty.Text, 0)) = 0 then
begin
application.MessageBox('开卡匹数、数量不能都为零!', '提示信息', MB_OK);
exit;
end;
if DTMPSlist.Text = '' then
begin
application.MessageBox('产品工序不能为空!', '提示信息', MB_OK);
exit;
end;
if GetLSNo(ADOQueryCmd, KZmaxID, 'KZ', 'Dye_Plan_Card_KZ', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
// 获取车数
if strtointdef(trim(carNum.text), 0) <= 1 then
k := 1
else
k := strtointdef(trim(carNum.text), 0);
// 获取总匹数和总数量
totalPieces := StrToFloatDef(PCPiece.Text, 0);
totalQty := StrToFloatDef(PCQty.Text, 0);
// 预分配数组
SetLength(pieceArray, k);
SetLength(qtyArray, k);
// 计算每张卡的分配值
CalculateDistribution(totalPieces, k, pieceArray);
CalculateDistribution(totalQty, k, qtyArray);
CDS_Color.Locate('C_Color', C_Color.Text, []);
CDS_1.Last;
for i := 0 to k - 1 do
begin
if GetLSNo(ADOQueryCmd, maxId, 'CZ', 'Dye_Plan_Card', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
FPCIDS := FPCIDS + maxId + ';';
mQRCode := FC_Name + '|' + OrderNo.Text + '|0|';
mQRCode := mQRCode + FormatDateTime('yyyymmddhhnnss', SGetServerDateTime(ADOQueryBaseTemp));
mQRCode := mQRCode + '|0|';
mQRCode := mQRCode + OrderNo.Text + '*0|0';
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('select * from Dye_Plan_Card A where 1=2');
Open;
Append;
FieldByName('OrderNo').Value := OrderNo.Text;
FieldByName('Mainid').Value := FMainid;
FieldByName('Filler').Value := trim(DName);
FieldByName('Workshop').Value := trim(FWorkshop);
FieldByName('PCType').Value := trim(PCType.Text);
FieldByName('PCID').Value := trim(maxId);
FieldByName('KaZu').Value := trim(KZmaxID);
FieldByName('PCTime').Value := formatdateTime('yyyy-MM-dd', PCTime.DateTime);
FieldByName('GC_BatchNo').Value := trim(FGC_BatchNo);
FieldByName('GC_Piece').Value := trim(FGC_Piece);
FieldByName('GC_STKID').Value := trim(FGC_STKID);
FieldByName('GC_Position').Value := trim(FGC_Position);
FieldByName('DTMPSlist').Value := trim(DTMPSlist.Text);
FieldByName('C_description').Value := trim(C_description.Text);
FieldByName('bzunit').Value := trim(Fbzunit);
FieldByName('CustNo').Value := trim(FFromCoNo);
FieldByName('CustName').Value := trim(FFromCoName);
FieldByName('Saleser').Value := trim(FSaleser);
FieldByName('C_Name').Value := trim(FC_Name);
FieldByName('C_Code').Value := trim(FC_Code);
FieldByName('C_GramWeight').Value := trim(C_GramWeight.Text);
FieldByName('C_Width').Value := trim(C_Width.Text);
FieldByName('C_Color').Value := trim(C_Color.Text);
FieldByName('PCUnit').Value := trim(OrdUnit.Text);
FieldByName('C_ColorNo').Value := trim(C_ColorNo.Text);
FieldByName('CINote').Value := trim(CINote.Text);
// 使用预分配的匹数和数量
FieldByName('PCPiece').Value := pieceArray[i];
FieldByName('PCQty').Value := qtyArray[i];
FieldByName('batchno').Value := INTTOSTR(k) + '-' + INTTOSTR(i + 1);
FieldByName('QRCode').Value := trim(mQRCode);
FieldByName('PrtCount').Value := 0;
post;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_GreyCloth_Out ');
Sql.Add('@PCID=' + quotedstr(trim(maxId)));
Sql.Add(',@Filler=' + quotedstr(trim(DName)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
begin
FGC_STKID := '';
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
end;
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Plan_UpdateOrderNo ');
Sql.Add('@OrderNo=' + quotedstr(Trim(OrderNo.Text)));
Open;
end;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Cloth_GX @carno=' + QuotedStr(trim(KZmaxID)));
sql.add(',@dname=' + QuotedStr(trim(dname)));
SQL.Add(',@C_Name=' + QuotedStr(Trim(C_Name.Text)));
SQL.Add(',@OrderNo=' + QuotedStr(Trim(OrderNo.Text)));
SQL.Add(',@DTMID=' + QuotedStr(Trim(DTMID.Text)));
execsql;
end;
with ADOQueryCmd do
begin
SQL.Clear;
SQL.Add('EXEC P_InsertGxToKaika @PCID = ' + quotedstr(trim(KZmaxID)));
ExecSQL;
end;
InitCard();
InitGreyClothStk();
// 显示分配结果信息
ShowDistributionResult(k, pieceArray, qtyArray);
end;
// 分配计算函数
procedure TfrmDyePlanCardInput.CalculateDistribution(totalValue: Double; cardCount: Integer; var resultArray: array of Double);
var
i: Integer;
baseValue, remainder: Double;
intBaseValue, intRemainder: Integer;
begin
if cardCount <= 0 then
Exit;
// 如果是整数,按整数分配
if Frac(totalValue) = 0 then
begin
intBaseValue := Trunc(totalValue) div cardCount;
intRemainder := Trunc(totalValue) mod cardCount;
for i := 0 to cardCount - 1 do
begin
if i < intRemainder then
resultArray[i] := intBaseValue + 1
else
resultArray[i] := intBaseValue;
end;
end;
end;
// 显示分配结果
procedure TfrmDyePlanCardInput.ShowDistributionResult(cardCount: Integer; pieceArray, qtyArray: array of Double);
var
i: Integer;
distributionInfo: string;
begin
distributionInfo := '成功开立' + IntToStr(cardCount) + '张卡,分配情况:' + #13#10;
for i := 0 to cardCount - 1 do
begin
distributionInfo := distributionInfo + Format('卡%d: %.0f匹, %.2f米' + #13#10, [i + 1, pieceArray[i], qtyArray[i]]);
end;
ShowMessage(distributionInfo);
end;
procedure TfrmDyePlanCardInput.Button1Click(Sender: TObject);
var
maxId: string;
@ -637,7 +871,8 @@ end;
procedure TfrmDyePlanCardInput.Button2Click(Sender: TObject);
var
i, k, fhxInt: integer;
maxId, maxno: string;
maxId, maxno, KZmaxID: string;
mQRCode : string;
begin
if trim(C_Name.Text) = '' then
@ -656,6 +891,12 @@ begin
exit;
end;
if GetLSNo(ADOQueryCmd, KZmaxID, 'KZ', 'Dye_Plan_Card_KZ', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
if strtointdef(trim(carNum.text), 0) <= 1 then
k := 1
else
@ -674,8 +915,14 @@ begin
// if not GetLSNo(ADOQueryCmd, maxno, 'PC', 'BS_Cloth_IO', 3, 1) then
// raise Exception.Create('取染色坯布出库编号失败!');
mQRCode := FC_Name + '|' + OrderNo.Text + '|0|';
mQRCode := mQRCode + FormatDateTime('yyyymmddhhnnss', SGetServerDateTime(ADOQueryBaseTemp));
mQRCode := mQRCode + '|0|';
mQRCode := mQRCode + OrderNo.Text + '*0|0';
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
@ -691,14 +938,17 @@ begin
FieldByName('Workshop').Value := trim(FWorkshop);
FieldByName('PCType').Value := trim(PCType.Text);
FieldByName('PCID').Value := trim(maxId);
FieldByName('KaZu').Value := trim(KZmaxID);
FieldByName('PCTime').Value := formatdateTime('yyyy-MM-dd', PCTime.DateTime);
FieldByName('GC_BatchNo').Value := trim(FGC_BatchNo);
FieldByName('GC_Piece').Value := trim(FGC_Piece);
FieldByName('GC_STKID').Value := trim(FGC_STKID);
FieldByName('GC_Position').Value := trim(FGC_Position);
FieldByName('DTMPSlist').Value := trim(DTMPSlist.Text);
FieldByName('C_description').Value := trim(C_description.Text);
FieldByName('bzunit').Value := trim(Fbzunit);
FieldByName('CINote').Value := trim(CINote.Text);
// FieldByName('STATUS').Value := '9';
FieldByName('CustNo').Value := trim(FFromCoNo);
@ -715,6 +965,10 @@ begin
FieldByName('PCQty').Value := StrtoFloatDef(PCQty.Text, 0);
// ShowMessage(FieldByName('PCQty').Value);
FieldByName('batchno').Value := INTTOSTR(k) + '-' + INTTOSTR(i);
FieldByName('QRCode').Value := trim(mQRCode);
FieldByName('PrtCount').Value := 0;
post;
end;
@ -738,17 +992,6 @@ begin
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Cloth_GX @carno=' + QuotedStr(trim(maxId)));
sql.add(',@dname=' + QuotedStr(trim(dname)));
SQL.Add(',@C_Name=' + QuotedStr(Trim(C_Name.Text)));
SQL.Add(',@OrderNo=' + QuotedStr(Trim(OrderNo.Text)));
SQL.Add(',@DTMID=' + QuotedStr(Trim(DTMID.Text)));
execsql;
end;
with ADOQueryCmd do
begin
@ -761,11 +1004,30 @@ begin
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Cloth_GX @carno=' + QuotedStr(trim(KZmaxID)));
sql.add(',@dname=' + QuotedStr(trim(dname)));
SQL.Add(',@C_Name=' + QuotedStr(Trim(C_Name.Text)));
SQL.Add(',@OrderNo=' + QuotedStr(Trim(OrderNo.Text)));
SQL.Add(',@DTMID=' + QuotedStr(Trim(DTMID.Text)));
execsql;
end;
with ADOQueryCmd do
begin
SQL.Clear;
SQL.Add('EXEC P_InsertGxToKaika @PCID = ' + quotedstr(trim(KZmaxID)));
ExecSQL;
end;
InitCard();
InitGreyClothStk();
end;
procedure TfrmDyePlanCardInput.C_ColorChange(Sender: TObject);
procedure TfrmDyePlanCardInput.C_COLORChange(Sender: TObject);
begin
CDS_Color.Locate('C_Color', C_Color.Text, []);
C_COLOR.Text := CDS_Color.FieldByName('C_COLOR').AsString;
@ -791,10 +1053,12 @@ begin
inherited;
ReadCxGrid(self.Caption + 'TV1', Tv1, '生产指示单管理');
ReadCxGrid(self.Caption + 'TV2', Tv2, '生产指示单管理');
ReadCxGrid(self.Caption + 'TV3', Tv3, '生产指示单管理');
InitOrder();
InitCard();
InitGreyClothStk();
InitRepairCard('');
KeyPreview := True;
end;
procedure TfrmDyePlanCardInput.ToolButton1Click(Sender: TObject);
@ -857,6 +1121,7 @@ procedure TfrmDyePlanCardInput.ToolButton2Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + 'TV1', Tv1, '生产指示单管理');
WriteCxGrid(self.Caption + 'TV2', Tv2, '生产指示单管理');
WriteCxGrid(self.Caption + 'TV3', Tv3, '生产指示单管理');
end;
@ -915,12 +1180,38 @@ begin
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
with ADOQueryCmd do
with ADOQueryTmp do
begin
Close;
Sql.Clear;
Sql.Add('delete from Dye_Plan_glide where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
ExecSQL;
SQL.Clear;
SQL.Add('select * from Dye_Plan_card where KaZu = ' + QuotedStr(Trim(CDS_1.FieldByName('KaZu').AsString)));
Open;
end;
if ADOQueryTmp.IsEmpty then
begin
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('delete from Dye_Plan_glide where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('KaZu').AsString)));
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('delete from Bs_Cloth_GY_Main_Kaika where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('KaZu').AsString)));
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('delete from Bs_Cloth_GY_Sub_Kaika where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('KaZu').AsString)));
ExecSQL;
end;
end;
if (Trim(CDS_1.fieldbyname('PCType').AsString) = '正常卡') or (Trim(CDS_1.fieldbyname('PCType').AsString) = '前道卡') then
@ -981,90 +1272,185 @@ begin
end;
procedure TfrmDyePlanCardInput.ToolButton5Click(Sender: TObject);
var
HasSaved: Boolean; // 记录是否成功保存
begin
HasSaved := False; // 初始化标志
try
CDS_1.DisableControls;
CDS_1.First;
while not CDS_1.Eof do
begin
if CDS_1.Fieldbyname('Ssel').AsBoolean then
begin
ADOQueryCmd.Connection.BeginTrans;
try
// if CDS_1.Fieldbyname('Ssel').AsBoolean then
// begin
ADOQueryCmd.Connection.BeginTrans;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from Dye_Plan_Card A');
sql.Add('where PCID=''' + trim(CDS_1.fieldbyname('PCID').AsString) + '''');
open;
edit;
FieldByName('Editer').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTmp);
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'Dye_Plan_Card', 0);
post;
end;
if (Trim(CDS_1.fieldbyname('PCType').AsString) = '正常卡') or (Trim(CDS_1.fieldbyname('PCType').AsString) = '前道卡') then
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from Dye_Plan_Card A');
sql.Add('where PCID=''' + trim(CDS_1.fieldbyname('PCID').AsString) + '''');
open;
edit;
FieldByName('Editer').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTmp);
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'Dye_Plan_Card', 0);
post;
Close;
Sql.Clear;
Sql.Add('exec P_Dye_GreyCloth_Out_Del ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Open;
end;
if (Trim(CDS_1.fieldbyname('PCType').AsString) = '正常卡') or (Trim(CDS_1.fieldbyname('PCType').AsString) = '前道卡') then
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
with ADOQueryCmd do
begin
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_GreyCloth_Out_Del ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_GreyCloth_Out ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Sql.Add(',@Filler=' + quotedstr(trim(DName)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
begin
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
end;
end
else
begin
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Card_Move ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
begin
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
end;
Close;
Sql.Clear;
Sql.Add('exec P_Dye_GreyCloth_Out ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Sql.Add(',@Filler=' + quotedstr(trim(DName)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
begin
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
end;
end
else
begin
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('exec P_Dye_Card_Move ');
Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
Open;
end;
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
begin
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
end;
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
raise Exception.Create(PChar(Exception(ExceptObject).Message));
end;
ADOQueryCmd.Connection.CommitTrans;
HasSaved := True; // 标记有保存操作
except
ADOQueryCmd.Connection.RollbackTrans;
raise Exception.Create(PChar(Exception(ExceptObject).Message));
end;
// end;
CDS_1.Next;
end;
CDS_1.EnableControls;
// 显示保存成功提示
if HasSaved then
begin
Application.MessageBox('保存成功!', '提示信息', MB_OK + MB_ICONINFORMATION);
end;
InitCard();
InitGreyClothStk();
except
CDS_1.EnableControls;
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', MB_OK + MB_ICONERROR);
end;
end;
//procedure TfrmDyePlanCardInput.ToolButton5Click(Sender: TObject);
//begin
//
// try
// CDS_1.DisableControls;
// CDS_1.First;
// while not CDS_1.Eof do
// begin
// if CDS_1.Fieldbyname('Ssel').AsBoolean then
// begin
// ADOQueryCmd.Connection.BeginTrans;
// try
// with ADOQueryCmd do
// begin
// close;
// sql.Clear;
// sql.Add('select * from Dye_Plan_Card A');
// sql.Add('where PCID=''' + trim(CDS_1.fieldbyname('PCID').AsString) + '''');
// open;
// edit;
// FieldByName('Editer').Value := Trim(DName);
// FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTmp);
// RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'Dye_Plan_Card', 0);
// post;
// end;
//
// if (Trim(CDS_1.fieldbyname('PCType').AsString) = '正常卡') or (Trim(CDS_1.fieldbyname('PCType').AsString) = '前道卡') then
// begin
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add('exec P_Dye_GreyCloth_Out_Del ');
// Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
// Open;
// end;
// if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
// raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add('exec P_Dye_GreyCloth_Out ');
// Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
// Sql.Add(',@Filler=' + quotedstr(trim(DName)));
// Open;
// end;
// if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
// begin
// raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
// end;
// end
// else
// begin
// with ADOQueryCmd do
// begin
// Close;
// Sql.Clear;
// Sql.Add('exec P_Dye_Card_Move ');
// Sql.Add('@PCID=' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
// Open;
// end;
// if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
// begin
// raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
// end;
// end;
//
// ADOQueryCmd.Connection.CommitTrans;
// except
// ADOQueryCmd.Connection.RollbackTrans;
// raise Exception.Create(PChar(Exception(ExceptObject).Message));
// end;
// end;
// CDS_1.Next;
// end;
// CDS_1.EnableControls;
// InitCard();
// InitGreyClothStk();
// except
// CDS_1.EnableControls;
// application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
// end;
//
//end;
procedure TfrmDyePlanCardInput.TV2DblClick(Sender: TObject);
begin
@ -1083,6 +1469,14 @@ begin
C_COLORNO.Text := ADOQueryTmp.FieldByName('C_COLORNO').AsString;
C_Name.Text := ADOQueryTmp.FieldByName('C_Name').AsString;
CINote.Text := ADOQueryTmp.FieldByName('CINote').AsString;
PCType.Text := '正常卡';
carnum.Text := '1';
PCPiece.Text := CDS_2.FieldByName('StkPiece').AsString;
PCQty.Text := CDS_2.FieldByName('STKQty').AsString;
C_description.Text := CDS_2.FieldByName('C_description').AsString;
if (ADOQueryTmp.FieldByName('DTMID').AsString = '') or (ADOQueryTmp.FieldByName('DTMID').AsString = null) then
begin
Application.MessageBox('未设置默认工序!', '提示信息', MB_OK);

View File

@ -2,6 +2,7 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
Caption = #29983#20135#27969#31243#21345
ClientHeight = 632
ClientWidth = 1503
OnKeyDown = FormKeyDown
ExplicitWidth = 1519
ExplicitHeight = 671
PixelsPerInch = 96
@ -101,16 +102,40 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
ImageIndex = 11
OnClick = btnnowcClick
end
object TBPrint: TToolButton
object TbDetailGY: TToolButton
Left = 687
Top = 0
AutoSize = True
Caption = #35814#32454#24037#33402
ImageIndex = 8
OnClick = TbDetailGYClick
end
object TbSimpleGY: TToolButton
Left = 782
Top = 0
AutoSize = True
Caption = #31616#26131#24037#33402
ImageIndex = 8
OnClick = TbSimpleGYClick
end
object TbUpdateGY: TToolButton
Left = 877
Top = 0
AutoSize = True
Caption = #26356#26032#24037#33402
ImageIndex = 1
OnClick = TbUpdateGYClick
end
object TBPrint: TToolButton
Left = 972
Top = 0
AutoSize = True
Caption = #25171#21360#27969#31243#21345
ImageIndex = 21
OnClick = TBPrintClick
end
object TBExport: TToolButton
Left = 794
Left = 1079
Top = 0
AutoSize = True
Caption = #23548#20986
@ -118,7 +143,7 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
OnClick = TBExportClick
end
object ToolButton6: TToolButton
Left = 865
Left = 1150
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
@ -126,7 +151,7 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
OnClick = ToolButton6Click
end
object TBClose: TToolButton
Left = 960
Left = 1245
Top = 0
AutoSize = True
Caption = #20851#38381
@ -386,7 +411,6 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
Align = alClient
PopupMenu = PM_1
TabOrder = 2
ExplicitTop = 125
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -432,6 +456,13 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
HeaderAlignmentHorz = taCenter
Width = 50
end
object Tv1KaZu: TcxGridDBColumn
Caption = #21345#32452#21495
DataBinding.FieldName = 'KaZu'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 70
end
object v1Column10: TcxGridDBColumn
Caption = #21345#21495
DataBinding.FieldName = 'PCID'
@ -626,9 +657,15 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
Width = 80
end
object v1Column13: TcxGridDBColumn
Caption = #24037#24207#20449#24687
DataBinding.FieldName = 'GlideList'
Caption = #24037#33402#20449#24687
DataBinding.FieldName = 'DTMPSlist'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 200
@ -720,6 +757,27 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_description: TcxGridDBColumn
Caption = #24037#33402#35201#27714
DataBinding.FieldName = 'C_description'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1CINote: TcxGridDBColumn
Caption = #20135#21697#20449#24687#22791#27880
DataBinding.FieldName = 'CINote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 131
end
object Tv1C_Color: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'C_Color'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 70
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
@ -734,7 +792,7 @@ inherited frmDyePlanCardList: TfrmDyePlanCardList
TabOrder = 3
Properties.CustomButtons.Buttons = <>
Properties.Style = 9
Properties.TabIndex = 3
Properties.TabIndex = 0
Properties.Tabs.Strings = (
#26410#23457#26680
#24050#23457#26680

View File

@ -121,6 +121,13 @@ type
Tv1Chktime: TcxGridDBColumn;
Tv1TotalPCID: TcxGridDBColumn;
Tv1TotalPCIDNum: TcxGridDBColumn;
TbDetailGY: TToolButton;
Tv1KaZu: TcxGridDBColumn;
Tv1C_description: TcxGridDBColumn;
TbUpdateGY: TToolButton;
TbSimpleGY: TToolButton;
Tv1CINote: TcxGridDBColumn;
Tv1C_Color: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -144,6 +151,10 @@ type
procedure tbeditClick(Sender: TObject);
procedure btnWCClick(Sender: TObject);
procedure btnnowcClick(Sender: TObject);
procedure TbDetailGYClick(Sender: TObject);
procedure TbUpdateGYClick(Sender: TObject);
procedure TbSimpleGYClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
DQdate: TDateTime;
procedure InitGrid();
@ -151,6 +162,8 @@ type
procedure InitForm();
// procedure SetStatus();
procedure PrintCar(MPCID: string);
function UpdateQRCodeWithPrtCount(ADOQuery: TADOQuery; const PCID: string): Boolean;
{ Private declarations }
public
FFInt, FCloth: Integer;
@ -165,7 +178,8 @@ var
implementation
uses
U_DataLink, U_RTFun, U_DyePlanCardInput, U_LabelPrint;
U_DataLink, U_RTFun, U_DyePlanCardInput, U_LabelPrint, U_DyeTechnicsinputKaika,
U_DyeSimpleTechnicsKaiKa;
{$R *.dfm}
procedure TfrmDyePlanCardList.PrintCar(MPCID: string);
@ -215,9 +229,12 @@ begin
tbadd.Enabled := true;
if Trim(canshu1) = '录入' then
begin
tchk.Visible := False;
tnochk.Visible := False;
case cxTabControl1.TabIndex of
0:
begin
tbedit.Enabled := true;
tbdel.Enabled := true;
@ -272,6 +289,16 @@ begin
frmDyePlanCardList := nil;
end;
procedure TfrmDyePlanCardList.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyePlanCardList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
@ -385,11 +412,11 @@ procedure TfrmDyePlanCardList.TBDelClick(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
if (Trim(CDS_1.fieldbyname('Filler').AsString) <> Trim(DName)) and (dname <> 'ADMIN') then
begin
Application.MessageBox('不能操作他人的数据!', '提示', 0);
Exit;
end;
// if (Trim(CDS_1.fieldbyname('Filler').AsString) <> Trim(DName)) and (dname <> 'ADMIN') then
// begin
// Application.MessageBox('不能操作他人的数据!', '提示', 0);
// Exit;
// end;
if CDS_1.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -442,6 +469,22 @@ begin
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('delete from Bs_Cloth_GY_Main_Kaika where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
Sql.Clear;
Sql.Add('delete from Bs_Cloth_GY_Sub_Kaika where PCID = ' + quotedstr(Trim(CDS_1.fieldbyname('PCID').AsString)));
ExecSQL;
end;
if (Trim(CDS_1.fieldbyname('PCType').AsString) = '正常卡') or (Trim(CDS_1.fieldbyname('PCType').AsString) = '前道卡') then
begin
with ADOQueryCmd do
@ -505,6 +548,54 @@ begin
// SelExportData(Tv1,ADOQueryMain,self.Caption);
end;
function TfrmDyePlanCardList.UpdateQRCodeWithPrtCount(ADOQuery: TADOQuery; const PCID: string): Boolean;
var
mQRCode: string;
mPrtCount: Integer;
NewQRCode: string;
begin
Result := False;
try
with ADOQuery do
begin
// 查询数据
Close;
SQL.Clear;
SQL.Add('SELECT QRCode, PrtCount FROM Dye_Plan_Card WHERE PCID = ' + QuotedStr(Trim(PCID)));
Open;
if not IsEmpty then
begin
// 获取字段值
mQRCode := FieldByName('QRCode').AsString;
mPrtCount := FieldByName('PrtCount').AsInteger;
// 检查QRCode是否为空
if mQRCode <> '' then
begin
// 将最后一位替换为PrtCount
NewQRCode := Copy(mQRCode, 1, Length(mQRCode) - 1) + IntToStr(mPrtCount);
// 更新记录
Edit;
FieldByName('QRCode').AsString := NewQRCode;
Post;
Result := True;
end;
end;
end;
except
on E: Exception do
begin
// 处理异常
Application.MessageBox(PChar('更新QRCode时发生错误: ' + E.Message), '错误', MB_ICONERROR);
Result := False;
end;
end;
end;
procedure TfrmDyePlanCardList.TBPrintClick(Sender: TObject);
var
MPCID: string;
@ -521,16 +612,34 @@ begin
CDS_1.DisableControls;
with CDS_1 do
begin
MPCID := Trim(CDS_1.fieldbyname('PCID').AsString);
First;
while CDS_1.Locate('SSel', True, []) do
begin
// MPCID := MPCID + ',' + Trim(CDS_1.fieldbyname('PCID').AsString);
if MPCID = '' then
begin
MPCID := Trim(CDS_1.fieldbyname('PCID').AsString);
end
else
begin
MPCID := MPCID + ',' + Trim(CDS_1.fieldbyname('PCID').AsString);
end;
Edit;
FieldByName('SSel').Value := False;
Post;
with Self.ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add(' update Dye_Plan_Card set PrtCount = PrtCount + 1 ');
sql.add(' where PCID = ' + QuotedStr(Trim(CDS_1.fieldbyname('PCID').AsString)));
ExecSQL;
end;
UpdateQRCodeWithPrtCount(ADOQueryCmd, CDS_1.fieldbyname('PCID').AsString);
end;
end;
CDS_1.EnableControls;
@ -546,6 +655,7 @@ begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
@ -588,6 +698,67 @@ begin
InitGrid();
end;
procedure TfrmDyePlanCardList.TbSimpleGYClick(Sender: TObject);
begin
try
frmDyeSimpleTechnicsKaiKa := TfrmDyeSimpleTechnicsKaiKa.Create(Application);
with frmDyeSimpleTechnicsKaiKa do
begin
fKaZu := CDS_1.FieldByName('KaZu').AsString;
if ShowModal = 1 then
begin
end;
end;
finally
frmDyeSimpleTechnicsKaiKa.Free;
end;
end;
procedure TfrmDyePlanCardList.TbUpdateGYClick(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
if CDS_1.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Exit;
end;
CDS_1.DisableControls;
with CDS_1 do
begin
First;
while CDS_1.Locate('SSel', True, []) do
begin
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('Delete From Bs_Cloth_GY_Main_Kaika where PCID = ' + quoTedStr(Trim(CDS_1.FieldByName('KaZu').AsString)));
SQL.Add('Delete From Bs_Cloth_GY_Sub_Kaika where PCID = ' + quoTedStr(Trim(CDS_1.FieldByName('KaZu').AsString)));
ExecSQL;
end;
with ADOQueryCmd do
begin
SQL.Clear;
SQL.Add('EXEC P_InsertGxToKaika @PCID = ' + quotedstr(trim(CDS_1.FieldByName('KaZu').AsString)));
ExecSQL;
end;
Edit;
FieldByName('SSel').Value := False;
Post;
end;
end;
Application.MessageBox('更新成功!', '提示信息', MB_OK);
CDS_1.EnableControls;
end;
procedure TfrmDyePlanCardList.TBAddClick(Sender: TObject);
begin
@ -623,8 +794,10 @@ begin
fFlileFlag := UserDataFlag + 'HX';
canshu1 := self.fParameters1;
canshu2 := self.fParameters3;
// canshu1 := '录入';
FWorkshop := self.fParameters3;
InitForm();
KeyPreview := True;
end;
procedure TfrmDyePlanCardList.CheckBox2Click(Sender: TObject);
@ -665,7 +838,7 @@ begin
MPCIDS := MPCIDS + trim(CDS_1.FieldByName('PCID').AsString) + ';';
if j = 0 then
begin
firstCurrentValue := VarToStr(Tv1.DataController.Values[0, Column.Index]);
firstCurrentValue := VarToStr(Tv1.DataController.Values[I, Column.Index]);
j := 1;//第一个选中值执行其余不执行
end;
@ -808,6 +981,24 @@ begin
end;
end;
procedure TfrmDyePlanCardList.TbDetailGYClick(Sender: TObject);
begin
try
frmDyeTechnicsinputKaika := TfrmDyeTechnicsinputKaika.Create(Application);
with frmDyeTechnicsinputKaika do
begin
PState := '查看';
FPCID := Trim(self.CDS_1.fieldbyname('KaZu').AsString);
if ShowModal = 1 then
begin
end;
end;
finally
frmDyeTechnicsinputKaika.Free;
end;
end;
procedure TfrmDyePlanCardList.ToolButton6Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + 'TV1', Tv1, '生产指示单管理');

View File

@ -15,6 +15,7 @@ object frmProductOrderListSel: TfrmProductOrderListSel
WindowState = wsMaximized
OnClose = FormClose
OnDestroy = FormDestroy
OnKeyDown = FormKeyDown
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
@ -186,7 +187,6 @@ object frmProductOrderListSel: TfrmProductOrderListSel
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 2
ExplicitTop = 109
object Tv1: TcxGridDBTableView
OnDblClick = Tv1DblClick
Navigator.Buttons.CustomButtons = <>
@ -200,6 +200,7 @@ object frmProductOrderListSel: TfrmProductOrderListSel
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsData.Editing = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True

View File

@ -69,6 +69,7 @@ type
procedure cxTabControl1Change(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
DQdate: TDateTime;
procedure InitGrid();
@ -95,6 +96,16 @@ begin
frmProductOrderListSel := nil;
end;
procedure TfrmProductOrderListSel.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmProductOrderListSel.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
@ -163,6 +174,7 @@ begin
v1Column4.Visible := False;
v1Column4.Hidden := True;
end;
KeyPreview := True;
// InitGrid();
end;
@ -222,10 +234,13 @@ begin
SelOKNo(Order_Main, false);
end;
procedure TfrmProductOrderListSel.OrderNoKeyPress(Sender: TObject;
var Key: Char);
procedure TfrmProductOrderListSel.OrderNoKeyPress(Sender: TObject; var Key: Char);
begin
InitGrid();
if Key = #13 then
begin
InitGrid();
end;
end;
procedure TfrmProductOrderListSel.TBRafreshClick(Sender: TObject);

View File

@ -13,6 +13,7 @@ object frmDyePlanInPut: TfrmDyePlanInPut
OldCreateOrder = False
Position = poMainFormCenter
WindowState = wsMaximized
OnKeyDown = FormKeyDown
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
@ -79,7 +80,6 @@ object frmDyePlanInPut: TfrmDyePlanInPut
ParentColor = False
ParentCtl3D = False
TabOrder = 1
ExplicitTop = 32
object Label1: TLabel
Left = 304
Top = 132
@ -373,7 +373,6 @@ object frmDyePlanInPut: TfrmDyePlanInPut
ParentFont = False
ShowCaptions = True
TabOrder = 3
ExplicitTop = 315
object ToolButton1: TToolButton
Left = 0
Top = 0

View File

@ -84,6 +84,7 @@ type
procedure C_NameDblClick(Sender: TObject);
procedure C_NameBtnClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
procedure InitData();
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
@ -201,6 +202,16 @@ begin
C_Name.Text := '';
end;
procedure TfrmDyePlanInPut.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyePlanInPut.FormShow(Sender: TObject);
var
forderNo: string;
@ -211,7 +222,7 @@ begin
// Workshop.text := trim(FWorkshop);
fFlileFlag := UserDataFlag + 'HX';
InitData();
KeyPreview := True;
end;
function TfrmDyePlanInPut.SaveData(): Boolean;

View File

@ -2,7 +2,7 @@ inherited frmDyePlanList: TfrmDyePlanList
Caption = #29983#20135#25351#31034#21333
ClientHeight = 699
ClientWidth = 1401
ExplicitLeft = -172
OnKeyDown = FormKeyDown
ExplicitWidth = 1417
ExplicitHeight = 738
PixelsPerInch = 96
@ -12,7 +12,7 @@ inherited frmDyePlanList: TfrmDyePlanList
Left = 0
Top = 0
Width = 1401
Height = 38
Height = 76
AutoSize = True
ButtonHeight = 38
ButtonWidth = 91
@ -108,67 +108,76 @@ inherited frmDyePlanList: TfrmDyePlanList
AutoSize = True
Caption = #19979#36798
ImageIndex = 12
Wrap = True
OnClick = TbXiadaClick
end
object TbNoXiada: TToolButton
Left = 734
Top = 0
Left = 0
Top = 38
AutoSize = True
Caption = #25764#38144#19979#36798
ImageIndex = 11
OnClick = TbNoXiadaClick
end
object TbJiesuan: TToolButton
Left = 829
Top = 0
Left = 95
Top = 38
AutoSize = True
Caption = #32467#31639
ImageIndex = 12
OnClick = TbJiesuanClick
end
object TbNoJiesuan: TToolButton
Left = 900
Top = 0
Left = 166
Top = 38
AutoSize = True
Caption = #25764#38144#32467#31639
ImageIndex = 11
OnClick = TbNoJiesuanClick
end
object TbQuxiao: TToolButton
Left = 995
Top = 0
Left = 261
Top = 38
AutoSize = True
Caption = #21462#28040
ImageIndex = 12
OnClick = TbQuxiaoClick
end
object TbNoQuxiao: TToolButton
Left = 1066
Top = 0
Left = 332
Top = 38
AutoSize = True
Caption = #25764#38144#21462#28040
ImageIndex = 11
OnClick = TbNoQuxiaoClick
end
object TbTongBu: TToolButton
Left = 427
Top = 38
AutoSize = True
Caption = #21516#27493#25968#25454
ImageIndex = 1
OnClick = TbTongBuClick
end
object TBExport: TToolButton
Left = 1161
Top = 0
Left = 522
Top = 38
AutoSize = True
Caption = #23548#20986
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton2: TToolButton
Left = 1232
Top = 0
Left = 593
Top = 38
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton2Click
end
object TBClose: TToolButton
Left = 1327
Top = 0
Left = 688
Top = 38
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
@ -177,7 +186,7 @@ inherited frmDyePlanList: TfrmDyePlanList
end
object Panel1: TPanel [1]
Left = 0
Top = 38
Top = 76
Width = 1401
Height = 65
Align = alTop
@ -185,7 +194,6 @@ inherited frmDyePlanList: TfrmDyePlanList
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
ExplicitTop = 44
object Label1: TLabel
Left = 18
Top = 17
@ -311,13 +319,12 @@ inherited frmDyePlanList: TfrmDyePlanList
end
object cxGrid1: TcxGrid [2]
Left = 0
Top = 125
Top = 163
Width = 1401
Height = 370
Height = 332
Align = alClient
PopupMenu = PM_1
TabOrder = 2
ExplicitTop = 127
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -458,11 +465,10 @@ inherited frmDyePlanList: TfrmDyePlanList
Height = 8
HotZoneClassName = 'TcxMediaPlayer9Style'
AlignSplitter = salBottom
ExplicitTop = 501
end
object cxTabControl1: TcxTabControl [4]
Left = 0
Top = 103
Top = 141
Width = 1401
Height = 22
Align = alTop
@ -503,7 +509,6 @@ inherited frmDyePlanList: TfrmDyePlanList
Font.Style = []
ParentFont = False
TabOrder = 0
ExplicitTop = -2
object TV2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>

View File

@ -96,6 +96,7 @@ type
Tv1C_PlanQty: TcxGridDBColumn;
TbJiesuan: TToolButton;
TbNoJiesuan: TToolButton;
TbTongBu: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -131,6 +132,8 @@ type
procedure ToolButton3Click(Sender: TObject);
procedure TbJiesuanClick(Sender: TObject);
procedure TbNoJiesuanClick(Sender: TObject);
procedure TbTongBuClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
DQdate: TDateTime;
procedure InitGrid();
@ -210,7 +213,7 @@ begin
end;
3:
begin
TbNoQuxiao.Enabled := True;
TbNoQuxiao.Enabled := True;
end;
end;
end;
@ -302,6 +305,16 @@ begin
frmDyePlanList := nil;
end;
procedure TfrmDyePlanList.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyePlanList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
@ -581,6 +594,7 @@ begin
ReadCxGrid(self.Caption + 'TV2', Tv2, 'Éú²úָʾµ¥¹ÜÀí');
SetStatus();
InitGrid();
KeyPreview := True;
end;
procedure TfrmDyePlanList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
@ -814,6 +828,31 @@ begin
InitGrid();
end;
procedure TfrmDyePlanList.TbTongBuClick(Sender: TObject);
begin
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('exec P_OrderCR');
// ShowMessage(sql.Text);
execsql;
end;
// 同步成功提示
ShowMessage('同步成功!');
except
on E: Exception do
begin
// 同步失败提示
ShowMessage('同步失败:' + E.Message);
end;
end;
end;
procedure TfrmDyePlanList.TbXiadaClick(Sender: TObject);
begin
if Order_Main.IsEmpty then

View File

@ -12,6 +12,7 @@ object frmDyeProcessDefin: TfrmDyeProcessDefin
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
OnKeyDown = FormKeyDown
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
@ -62,7 +63,7 @@ object frmDyeProcessDefin: TfrmDyeProcessDefin
Height = 772
Align = alClient
TabOrder = 0
Properties.ActivePage = JGQX
Properties.ActivePage = CCQX
Properties.CustomButtons.Buttons = <>
ClientRectBottom = 770
ClientRectLeft = 2

View File

@ -877,6 +877,7 @@ type
procedure Tv4fs_usePropertiesEditValueChanged(Sender: TObject);
procedure Tv5gj_usePropertiesEditValueChanged(Sender: TObject);
procedure Tv6Column2PropertiesEditValueChanged(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
canshu1: string;
@ -1064,12 +1065,22 @@ begin
end;
procedure TfrmDyeProcessDefin.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyeProcessDefin.FormShow(Sender: TObject);
var
MaxPSID, MaxProcessID, MaxBCPID: string;
Maxid1, maxid2, maxid3, maxgx: string;
begin
InitGrid();
KeyPreview := True;
ArrangeTabsByDataset();
with ADOQueryTemp do
@ -1419,7 +1430,7 @@ begin
end;
with ADOQueryCmd do
begin
if Trim(CDS_2.fieldbyname('BCPID').AsString) = '' then
if Trim(CDS_2.fieldbyname('BCPID').AsString) = '' then
begin
Append;
@ -2060,7 +2071,7 @@ begin
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + QuotedStr(Trim(CDS_5.fieldbyname('BCPID').AsString)) );
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + QuotedStr(Trim(CDS_5.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
@ -2468,8 +2479,6 @@ begin
end;
end;
procedure TfrmDyeProcessDefin.Tv1Column1PropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
@ -2516,11 +2525,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('ccqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('ccqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -2532,12 +2540,11 @@ begin
end;
end;
CDS_1.Next;
CDS_1.Next;
end;
end;
procedure TfrmDyeProcessDefin.Tv2Column1PropertiesEditValueChanged(
Sender: TObject);
procedure TfrmDyeProcessDefin.Tv2Column1PropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
I: Integer;
@ -2583,11 +2590,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('rgqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('rgqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -2599,7 +2605,7 @@ begin
end;
end;
CDS_2.Next;
CDS_2.Next;
end;
end;
@ -2625,8 +2631,7 @@ begin
end;
end;
procedure TfrmDyeProcessDefin.Tv3Column1PropertiesEditValueChanged(
Sender: TObject);
procedure TfrmDyeProcessDefin.Tv3Column1PropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
I: Integer;
@ -2672,11 +2677,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('jgqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('jgqx_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -2688,7 +2692,7 @@ begin
end;
end;
CDS_3.Next;
CDS_3.Next;
end;
end;
@ -2761,8 +2765,7 @@ begin
end;
end;
procedure TfrmDyeProcessDefin.Tv4fs_usePropertiesEditValueChanged(
Sender: TObject);
procedure TfrmDyeProcessDefin.Tv4fs_usePropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
I: Integer;
@ -2808,11 +2811,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('fs_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('fs_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -2824,7 +2826,7 @@ begin
end;
end;
CDS_4.Next;
CDS_4.Next;
end;
end;
@ -2875,8 +2877,7 @@ begin
end;
end;
procedure TfrmDyeProcessDefin.Tv5gj_usePropertiesEditValueChanged(
Sender: TObject);
procedure TfrmDyeProcessDefin.Tv5gj_usePropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
I: Integer;
@ -2922,11 +2923,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('gj_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('gj_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -2938,12 +2938,11 @@ begin
end;
end;
CDS_5.Next;
CDS_5.Next;
end;
end;
procedure TfrmDyeProcessDefin.Tv6Column2PropertiesEditValueChanged(
Sender: TObject);
procedure TfrmDyeProcessDefin.Tv6Column2PropertiesEditValueChanged(Sender: TObject);
var
TotalUse: Double;
I: Integer;
@ -2989,11 +2988,10 @@ begin
begin
Edit;
// FieldByName('ccqx_rate').Value := RoundFloat(RateValue,2);
FieldByName('fp_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue,2) ));
FieldByName('fp_rate').Value := AddPercentSuffixIfNeeded(FloatToStr(RoundFloat(RateValue, 2)));
Post;
end;
end
else
begin
@ -3005,7 +3003,7 @@ begin
end;
end;
CDS_6.Next;
CDS_6.Next;
end;
end;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ inherited frmDyeProcessList: TfrmDyeProcessList
ClientHeight = 569
ClientWidth = 1134
WindowState = wsMaximized
OnKeyDown = FormKeyDown
ExplicitWidth = 1150
ExplicitHeight = 608
PixelsPerInch = 96
@ -24,7 +25,6 @@ inherited frmDyeProcessList: TfrmDyeProcessList
ParentColor = False
ShowCaptions = True
TabOrder = 0
ExplicitWidth = 1126
object TBRafresh: TToolButton
Left = 0
Top = 0
@ -165,7 +165,6 @@ inherited frmDyeProcessList: TfrmDyeProcessList
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
ExplicitWidth = 1126
object Label5: TLabel
Left = 326
Top = 12
@ -224,7 +223,6 @@ inherited frmDyeProcessList: TfrmDyeProcessList
Height = 455
Align = alClient
TabOrder = 2
ExplicitTop = 110
object TV2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False

View File

@ -79,6 +79,7 @@ type
procedure TbAdd_FBClick(Sender: TObject);
procedure TbAdd_fpClick(Sender: TObject);
procedure TbAdd_gjClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ Private declarations }
procedure InitGrid();
@ -126,6 +127,16 @@ begin
frmDyeProcessList := nil;
end;
procedure TfrmDyeProcessList.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyeProcessList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;

View File

@ -0,0 +1,259 @@
inherited frmDyeSimpleTechnicsKaiKa: TfrmDyeSimpleTechnicsKaiKa
Left = -55
Caption = #31616#26131#24037#33402#31649#29702
ClientHeight = 845
ClientWidth = 1200
Position = poDesigned
WindowState = wsMaximized
OnKeyDown = FormKeyDown
ExplicitWidth = 1216
ExplicitHeight = 884
PixelsPerInch = 96
TextHeight = 13
object Splitter1: TSplitter [0]
Left = 561
Top = 38
Height = 807
ExplicitLeft = 800
ExplicitTop = 328
ExplicitHeight = 100
end
object ToolBar1: TToolBar [1]
Tag = 1
Left = 0
Top = 0
Width = 1200
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 91
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_DyePlan.ImageList_new32
Images = DataLink_DyePlan.ImageList_new32
List = True
ParentColor = False
ShowCaptions = True
TabOrder = 0
object ToolButton3: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton3Click
end
object TBClose: TToolButton
Left = 95
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel2: TPanel [2]
Left = 0
Top = 38
Width = 561
Height = 807
Align = alLeft
TabOrder = 1
object Splitter2: TSplitter
Left = 1
Top = 1
Width = 2
Height = 805
ExplicitLeft = 700
ExplicitHeight = 744
end
object Panel3: TPanel
Left = 3
Top = 1
Width = 557
Height = 805
Align = alClient
TabOrder = 0
object cxGrid9: TcxGrid
Left = 1
Top = 39
Width = 555
Height = 765
Align = alClient
TabOrder = 0
object Tv3: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_GX
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsData.Editing = False
OptionsView.GroupByBox = False
object Tv3PSNO: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'GlideNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 41
end
object Tv3PSType: TcxGridDBColumn
Caption = #24037#24207#31867#22411
DataBinding.FieldName = 'PSType'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv3PSName: TcxGridDBColumn
Caption = #24037#24207#21517#31216
DataBinding.FieldName = 'PSName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv3PSID: TcxGridDBColumn
Caption = #24037#24207'ID'
DataBinding.FieldName = 'PSID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv3Page: TcxGridDBColumn
Caption = #39029#38754
DataBinding.FieldName = 'Page'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel8: TcxGridLevel
GridView = Tv3
end
end
object ToolBar2: TToolBar
Tag = 1
Left = 1
Top = 1
Width = 555
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 75
Caption = 'ToolBar2'
Images = DataLink_DyePlan.ImageList_new32
List = True
ShowCaptions = True
TabOrder = 1
Visible = False
object TbShow: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #26174#31034
ImageIndex = 8
OnClick = TbShowClick
end
end
end
end
object ScrollBox1: TScrollBox [3]
Left = 564
Top = 38
Width = 636
Height = 807
Align = alClient
TabOrder = 2
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Left = 281
Top = 288
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Left = 153
Top = 289
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 397
Top = 145
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 301
Top = 145
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 205
Top = 145
end
object GPM_2: TcxGridPopupMenu
PopupMenus = <>
Left = 447
Top = 361
end
object DS_2: TDataSource
DataSet = CDS_2
Left = 391
Top = 208
end
object CDS_2: TClientDataSet
Aggregates = <>
Params = <>
Left = 320
Top = 209
end
object DS_PsType: TDataSource
DataSet = CDS_PSType
Left = 720
Top = 139
end
object CDS_PSType: TClientDataSet
Aggregates = <>
Params = <>
Left = 648
Top = 137
end
object ADOQuery1: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 917
Top = 3
end
object GPM_1: TcxGridPopupMenu
PopupMenus = <>
Left = 468
Top = 227
end
object CDS_GX: TClientDataSet
Aggregates = <>
Params = <>
Left = 676
Top = 556
end
object DS_GX: TDataSource
DataSet = CDS_GX
Left = 740
Top = 564
end
object GPM_3: TcxGridPopupMenu
Grid = cxGrid9
PopupMenus = <>
Left = 495
Top = 321
end
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ inherited frmDyeTechnicsList: TfrmDyeTechnicsList
Caption = #24037#33402#30331#35760
ClientHeight = 593
ClientWidth = 1467
OnKeyDown = FormKeyDown
ExplicitWidth = 1483
ExplicitHeight = 632
PixelsPerInch = 96
@ -143,7 +144,7 @@ inherited frmDyeTechnicsList: TfrmDyeTechnicsList
Width = 180
Height = 20
TabOrder = 0
OnChange = DTMNoChange
OnKeyPress = DTMNameKeyPress
end
object DTMNo: TEdit
Tag = 2
@ -152,7 +153,7 @@ inherited frmDyeTechnicsList: TfrmDyeTechnicsList
Width = 180
Height = 20
TabOrder = 1
OnChange = DTMNoChange
OnKeyPress = DTMNoKeyPress
end
end
object cxGrid2: TcxGrid [3]
@ -162,8 +163,6 @@ inherited frmDyeTechnicsList: TfrmDyeTechnicsList
Height = 494
Align = alLeft
TabOrder = 2
ExplicitLeft = 8
ExplicitTop = 105
object Tv2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False
@ -234,6 +233,13 @@ inherited frmDyeTechnicsList: TfrmDyeTechnicsList
Options.Focusing = False
Width = 150
end
object Tv2GYNote: TcxGridDBColumn
Caption = #24037#33402#22791#27880
DataBinding.FieldName = 'GYNote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv2Editer: TcxGridDBColumn
Caption = #26368#21518#20462#25913#20154
DataBinding.FieldName = 'Editer'

View File

@ -64,6 +64,7 @@ type
TV1All_zhuji: TcxGridDBColumn;
Tv2Editer: TcxGridDBColumn;
Tv2Column1: TcxGridDBColumn;
Tv2GYNote: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
@ -71,7 +72,7 @@ type
procedure FormShow(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure DTMNoChange(Sender: TObject);
procedure TchkClick(Sender: TObject);
procedure TNochkClick(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
@ -82,6 +83,9 @@ type
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure DTMNoKeyPress(Sender: TObject; var Key: Char);
procedure DTMNameKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ Private declarations }
@ -179,6 +183,16 @@ begin
frmDyeTechnicsList := nil;
end;
procedure TfrmDyeTechnicsList.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyeTechnicsList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
@ -258,6 +272,7 @@ begin
ReadCxGrid(trim(self.Caption) + 'Tv2', Tv2, '¹¤ÒÕ¹ÜÀí');
SetStatus();
InitGrid();
KeyPreview := True;
end;
procedure TfrmDyeTechnicsList.TBRafreshClick(Sender: TObject);
@ -337,9 +352,24 @@ begin
end;
end;
procedure TfrmDyeTechnicsList.DTMNoChange(Sender: TObject);
procedure TfrmDyeTechnicsList.DTMNameKeyPress(Sender: TObject; var Key: Char);
begin
ToolButton2.Click;
if Key = #13 then
begin
ToolButton2.Click;
end;
end;
procedure TfrmDyeTechnicsList.DTMNoKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
ToolButton2.Click;
end;
end;
procedure TfrmDyeTechnicsList.TchkClick(Sender: TObject);

View File

@ -4,6 +4,7 @@ inherited frmDyeTechnicsinput: TfrmDyeTechnicsinput
Caption = #24037#33402#30331#35760
ClientHeight = 593
ClientWidth = 1034
OnKeyDown = FormKeyDown
ExplicitWidth = 1050
ExplicitHeight = 632
PixelsPerInch = 96
@ -168,9 +169,9 @@ inherited frmDyeTechnicsinput: TfrmDyeTechnicsinput
TabOrder = 2
object cxGrid1: TcxGrid
Left = 1
Top = 77
Top = 113
Width = 711
Height = 515
Height = 479
Align = alClient
PopupMenu = PM_1
TabOrder = 0
@ -315,14 +316,12 @@ inherited frmDyeTechnicsinput: TfrmDyeTechnicsinput
Left = 1
Top = 39
Width = 711
Height = 38
Height = 74
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 2
ExplicitLeft = -4
ExplicitTop = 45
object Label2: TLabel
Left = 295
Top = 9
@ -337,6 +336,13 @@ inherited frmDyeTechnicsinput: TfrmDyeTechnicsinput
Height = 13
Caption = #24037#33402#32534#21495
end
object Label1: TLabel
Left = 30
Top = 42
Width = 48
Height = 13
Caption = #24037#33402#22791#27880
end
object DTMName: TEdit
Tag = 2
Left = 349
@ -353,6 +359,14 @@ inherited frmDyeTechnicsinput: TfrmDyeTechnicsinput
Height = 21
TabOrder = 1
end
object GYNote: TEdit
Tag = 2
Left = 84
Top = 39
Width = 453
Height = 21
TabOrder = 2
end
end
object TbMoveUp: TcxButton
Left = 461

View File

@ -72,6 +72,8 @@ type
TV1DTMName: TcxGridDBColumn;
Tv3DTMName: TcxGridDBColumn;
TV1PSID: TcxGridDBColumn;
GYNote: TEdit;
Label1: TLabel;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
@ -92,6 +94,7 @@ type
procedure PSNameKeyPress(Sender: TObject; var Key: Char);
procedure TbMoveUpClick(Sender: TObject);
procedure btnMoveDownClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ Private declarations }
@ -475,7 +478,8 @@ begin
if ADOQueryCmd.IsEmpty then
begin
Append;
FieldByName('Filler').Value := Trim(DName);
FieldByName('Editer').Value := Trim(DName);
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
FieldByName('DTMID').Value := Trim(maxno);
end
else
@ -587,6 +591,16 @@ begin
frmDyeTechnicsinput := nil;
end;
procedure TfrmDyeTechnicsinput.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE ESC 键的常量
begin
Key := 0; // 清除按键,防止继续传递
Close; // 或者 ModalResult := mrCancel;
end;
end;
procedure TfrmDyeTechnicsinput.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
@ -607,6 +621,8 @@ begin
InitGrid();
InitGlide();
InitGridSub();
KeyPreview := True;
end;
procedure TfrmDyeTechnicsinput.TBRafreshClick(Sender: TObject);

View File

@ -0,0 +1,301 @@
inherited frmDyeTechnicsinputKaika: TfrmDyeTechnicsinputKaika
Left = 93
Top = 106
Caption = #24320#21345#24037#33402#26597#30475
ClientHeight = 593
ClientWidth = 1034
ExplicitWidth = 1050
ExplicitHeight = 632
PixelsPerInch = 96
TextHeight = 13
object cxSplitter1: TcxSplitter [0]
Left = 1026
Top = 0
Width = 8
Height = 593
AlignSplitter = salRight
end
object Panel3: TPanel [1]
Left = 0
Top = 0
Width = 1026
Height = 593
Align = alClient
Caption = 'Panel3'
TabOrder = 1
object cxGrid1: TcxGrid
Left = 1
Top = 77
Width = 1024
Height = 515
Align = alClient
PopupMenu = PM_1
TabOrder = 0
ExplicitLeft = -4
ExplicitTop = 72
object TV1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False
Navigator.Buttons.Delete.Visible = False
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_1
DataController.Filter.AutoDataSetFilter = True
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsBehavior.GoToNextCellOnEnter = True
OptionsCustomize.ColumnFiltering = False
OptionsCustomize.ColumnSorting = False
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.IncSearch = DataLink_DyePlan.SHuangSe
Styles.Header = DataLink_DyePlan.handBlack
Styles.Inactive = DataLink_DyePlan.SHuangSe
Styles.Selection = DataLink_DyePlan.SHuangSe
object cxGridDBColumn1: TcxGridDBColumn
Caption = #21345#32452#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
HeaderAlignmentHorz = taCenter
Width = 157
end
object VC_GlideNo: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'GlideNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 60
end
object TV1PSName: TcxGridDBColumn
Caption = #24037#24207#21517#31216
DataBinding.FieldName = 'GlideName'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = TV1PSNamePropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 229
end
object TV1PSType: TcxGridDBColumn
Caption = #24037#24207#31867#22411
DataBinding.FieldName = 'PSType'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 133
end
object TV1PSID: TcxGridDBColumn
DataBinding.FieldName = 'PSID'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 183
end
end
object cxGridLevel2: TcxGridLevel
GridView = TV1
end
end
object ToolBar1: TToolBar
Tag = 1
Left = 1
Top = 1
Width = 1024
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 91
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_DyePlan.ImageList_new32
Images = DataLink_DyePlan.ImageList_new32
List = True
ParentColor = False
ShowCaptions = True
TabOrder = 1
ExplicitLeft = -4
object ToolButton2: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton2Click
end
object TBClose: TToolButton
Left = 95
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel4: TPanel
Left = 1
Top = 39
Width = 1024
Height = 38
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 2
ExplicitLeft = -4
ExplicitTop = 45
object Label2: TLabel
Left = 295
Top = 9
Width = 48
Height = 13
Caption = #24037#33402#21517#31216
end
object Label3: TLabel
Left = 30
Top = 9
Width = 48
Height = 13
Caption = #24037#33402#32534#21495
end
object DTMName: TEdit
Tag = 2
Left = 349
Top = 6
Width = 189
Height = 21
TabOrder = 0
end
object DTMNo: TEdit
Tag = 2
Left = 84
Top = 6
Width = 189
Height = 21
TabOrder = 1
end
end
object TbMoveUp: TcxButton
Left = 461
Top = 140
Width = 75
Height = 25
Caption = #19978#31227
TabOrder = 3
Visible = False
OnClick = TbMoveUpClick
end
object btnMoveDown: TcxButton
Left = 461
Top = 192
Width = 75
Height = 25
Caption = #19979#31227
TabOrder = 4
Visible = False
OnClick = btnMoveDownClick
end
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Left = 241
Top = 256
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Left = 153
Top = 289
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 381
Top = 145
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 301
Top = 145
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 237
Top = 161
end
object GPM_2: TcxGridPopupMenu
PopupMenus = <>
Left = 215
Top = 385
end
object DS_2: TDataSource
DataSet = CDS_2
Left = 303
Top = 224
end
object CDS_2: TClientDataSet
Aggregates = <>
Params = <>
Left = 144
Top = 361
end
object DS_1: TDataSource
DataSet = CDS_1
Left = 1088
Top = 211
end
object CDS_1: TClientDataSet
Aggregates = <>
IndexFieldNames = 'GlideNo'
Params = <>
Left = 664
Top = 217
end
object ADOQuery1: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 765
Top = 267
end
object GPM_1: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
Left = 948
Top = 203
end
object PM_1: TPopupMenu
Left = 860
Top = 204
object N2: TMenuItem
Caption = #21024#38500
OnClick = N2Click
end
end
object CDS_3: TClientDataSet
Aggregates = <>
Params = <>
Left = 424
Top = 304
end
object DS_3: TDataSource
DataSet = CDS_3
Left = 480
Top = 304
end
end

View File

@ -0,0 +1,394 @@
unit U_DyeTechnicsinputKaika;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
cxTextEdit, cxPC, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxBarBuiltInMenu, Menus, U_BaseList, dxSkinsCore, dxSkinsDefaultPainters,
U_BaseInput, dxDateRanges, dxScrollbarAnnotations, System.ImageList,
Vcl.ImgList, cxButtons;
type
TfrmDyeTechnicsinputKaika = class(TfrmBaseInput)
ADOQueryTemp: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
GPM_2: TcxGridPopupMenu;
DS_2: TDataSource;
CDS_2: TClientDataSet;
DS_1: TDataSource;
CDS_1: TClientDataSet;
ADOQuery1: TADOQuery;
GPM_1: TcxGridPopupMenu;
PM_1: TPopupMenu;
N2: TMenuItem;
cxSplitter1: TcxSplitter;
Panel3: TPanel;
cxGrid1: TcxGrid;
TV1: TcxGridDBTableView;
VC_GlideNo: TcxGridDBColumn;
cxGridDBColumn1: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
ToolBar1: TToolBar;
TBClose: TToolButton;
ToolButton2: TToolButton;
Panel4: TPanel;
Label2: TLabel;
Label3: TLabel;
DTMName: TEdit;
DTMNo: TEdit;
TV1PSName: TcxGridDBColumn;
CDS_3: TClientDataSet;
DS_3: TDataSource;
TbMoveUp: TcxButton;
btnMoveDown: TcxButton;
TV1PSID: TcxGridDBColumn;
TV1PSType: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure v2Column4PropertiesEditValueChanged(Sender: TObject);
procedure v2Column2PropertiesEditValueChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure TbMoveUpClick(Sender: TObject);
procedure btnMoveDownClick(Sender: TObject);
procedure TV1PSNamePropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
private
{ Private declarations }
procedure InitGlide();
procedure SetXH();
public
fPSIDList: string;
FPCID, PState: string;
{ Public declarations }
RKFlag, FCYID, fmanage: string;
end;
var
frmDyeTechnicsinputKaika: TfrmDyeTechnicsinputKaika;
implementation
uses
U_DataLink, U_RTFun, U_ZDYHelp, U_DyeProcessSel, U_DyeProcessDefinKaika,
U_DyeProcessDefin;
{$R *.dfm}
procedure TfrmDyeTechnicsinputKaika.SetXH();
var
i: Integer;
begin
with CDS_1 do
begin
First;
i := 1;
while not Eof do
begin
with CDS_1 do
begin
Edit;
FieldByName('XHNoTemp').Value := i;
Post;
end;
i := i + 1;
Next;
end;
end;
with CDS_1 do
begin
CDS_1.IndexFieldNames := '';
First;
i := 1;
while not Eof do
begin
with CDS_1 do
begin
Edit;
FieldByName('GlideNo').Value := FieldByName('XHNoTemp').AsInteger;
Post;
end;
i := i + 1;
Next;
end;
CDS_1.IndexFieldNames := 'GlideNo';
end;
end;
procedure TfrmDyeTechnicsinputKaika.InitGlide();
var
maxNo, maxsubid: string;
begin
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add(' select C.DTMNo,C.DTMName FROM Dye_Plan_Glide A ');
sql.Add(' inner join Dye_Technics_Sub B on A.PSID = B.PSID ');
sql.Add(' inner join Dye_Technics_Main C on B.DTMID = C.DTMID ');
Open;
// ShowMessage(sql.Text);
end;
SCSHData(ADOQueryTemp, Panel4, 2);
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add(' select A.*,B.PSType FROM Dye_Plan_Glide A inner join Dye_Process B');
sql.Add(' on A.PSID = B.PSID ');
sql.Add(' Where A.PCID=''' + trim(FPCID) + '''');
SQL.Add(' ORDER BY A.GlideNo');
Open;
end;
SCreateCDS(ADOQueryTemp, CDS_1);
SInitCDSData(ADOQueryTemp, CDS_1);
end;
procedure TfrmDyeTechnicsinputKaika.FormDestroy(Sender: TObject);
begin
inherited;
frmDyeTechnicsinputKaika := nil;
end;
procedure TfrmDyeTechnicsinputKaika.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyeTechnicsinputKaika.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyeTechnicsinputKaika.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, '开卡工艺查看');
InitGlide();
end;
procedure TfrmDyeTechnicsinputKaika.TbMoveUpClick(Sender: TObject);
var
test: string;
ACurrentRow, APrevRow: Integer;
begin
ACurrentRow := Tv1.DataController.FocusedRowIndex + 1;//当前行位置(从1开始)
if ACurrentRow = 1 then // 已经是第一条记录
Exit;
APrevRow := ACurrentRow - 1;
CDS_1.DisableControls;
try
// 交换当前记录和上一条记录的顺序值
CDS_1.RecNo := ACurrentRow;
CDS_1.Edit;
CDS_1.FieldByName('GlideNo').AsInteger := APrevRow;
test := CDS_1.FieldByName('PSName').AsString;
CDS_1.Post;
CDS_1.RecNo := APrevRow;
CDS_1.Edit;
CDS_1.FieldByName('GlideNo').AsInteger := ACurrentRow;
test := CDS_1.FieldByName('PSName').AsString;
CDS_1.Post;
// 刷新数据
// CDS_1.Refresh;
CDS_1.IndexFieldNames := 'GlideNo';
// 重新定位到移动后的记录
Tv1.DataController.FocusedRowIndex := APrevRow - 1;
finally
CDS_1.EnableControls;
end;
end;
procedure TfrmDyeTechnicsinputKaika.ToolButton2Click(Sender: TObject);
begin
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '开卡工艺查看');
end;
procedure TfrmDyeTechnicsinputKaika.TV1PSNamePropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmDyeProcessDefinKaika := TfrmDyeProcessDefinKaika.Create(Application);
with frmDyeProcessDefinKaika do
begin
FPSID := Self.CDS_1.FieldByName('PSID').Value;
FPSType := Self.CDS_1.FieldByName('PSType').Value;
if ShowModal = 1 then
begin
end;
end;
finally
frmDyeProcessDefinKaika.Free;
end;
end;
procedure TfrmDyeTechnicsinputKaika.v2Column4PropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
mvalue := '';
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from Dye_Technics_Main where DTMNo =' + quotedstr(Trim(mvalue)));
Open;
end;
if ADOQueryCmd.IsEmpty = false then
begin
application.MessageBox('已存在工艺编号', '提示');
CDS_2.Edit;
CDS_2.FieldByName('DTMNo').AsString := '';
exit;
end;
with CDS_2 do
begin
Edit;
FieldByName('DTMNo').Value := Trim(mvalue);
//Post;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('update Dye_Technics_Main set DTMNo=''' + trim(mvalue) + ''' ');
sql.Add(',Editer=''' + trim(DName) + '''');
sql.Add(',Edittime=getdate()');
sql.add(' where DTMID=''' + trim(CDS_2.fieldbyname('DTMID').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmDyeTechnicsinputKaika.btnMoveDownClick(Sender: TObject);
var
test: string;
ACurrentRow, APrevRow: Integer;
begin
ACurrentRow := Tv1.DataController.FocusedRowIndex + 1;//当前行位置(从1开始)
if ACurrentRow = CDS_1.RecordCount then // 已经是第一条记录
Exit;
APrevRow := ACurrentRow + 1;
CDS_1.DisableControls;
try
// 交换当前记录和上一条记录的顺序值
CDS_1.RecNo := APrevRow;
CDS_1.Edit;
CDS_1.FieldByName('GlideNo').AsInteger := ACurrentRow;
test := CDS_1.FieldByName('PSName').AsString;
CDS_1.Post;
CDS_1.RecNo := ACurrentRow;
CDS_1.Edit;
CDS_1.FieldByName('GlideNo').AsInteger := APrevRow;
test := CDS_1.FieldByName('PSName').AsString;
CDS_1.Post;
// 刷新数据
// CDS_1.Refresh;
CDS_1.IndexFieldNames := 'GlideNo';
Tv1.DataController.FocusedRowIndex := ACurrentRow - 1;
finally
CDS_1.EnableControls;
end;
end;
procedure TfrmDyeTechnicsinputKaika.v2Column2PropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
mvalue := '';
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from Dye_Technics_Main where DTMName =' + quotedstr(Trim(mvalue)));
Open;
end;
if ADOQueryCmd.IsEmpty = false then
begin
application.MessageBox('已存在工艺名称', '提示');
CDS_2.Edit;
CDS_2.FieldByName('DTMName').AsString := '';
exit;
end;
with CDS_2 do
begin
Edit;
FieldByName('DTMName').Value := Trim(mvalue);
//Post;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('update Dye_Technics_Main set DTMName=''' + trim(mvalue) + ''' ');
sql.Add(',Editer=''' + trim(DName) + '''');
sql.Add(',Edittime=getdate()');
sql.add(' where DTMID=''' + trim(CDS_2.fieldbyname('DTMID').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmDyeTechnicsinputKaika.FormCreate(Sender: TObject);
begin
inherited;
fmanage := Trim(DParameters1);
end;
procedure TfrmDyeTechnicsinputKaika.N2Click(Sender: TObject);
var
i: Integer;
DTMPSlist: string;
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
CDS_1.Delete;
SetXH();
end;
end.

View File

@ -0,0 +1,329 @@
object frameCCQXList: TframeCCQXList
Left = 0
Top = 0
Width = 1281
Height = 132
TabOrder = 0
object Panel_ccqx: TPanel
Left = 0
Top = 0
Width = 1281
Height = 132
Align = alClient
TabOrder = 0
object LabelCCQX: TLabel
Left = 4
Top = 3
Width = 48
Height = 12
Caption = #38271#36710#28165#27927
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel113: TcxLabel
Left = 66
Top = 9
Caption = #36710#36895'(m/min)'
end
object ccqx_speed: TcxTextEdit
Tag = 2
Left = 141
Top = 7
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object ccqx_temperature1: TcxTextEdit
Tag = 2
Left = 5
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 2
Width = 40
end
object ccqx_temperature2: TcxTextEdit
Tag = 2
Left = 56
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 3
Width = 40
end
object ccqx_temperature3: TcxTextEdit
Tag = 2
Left = 107
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 4
Width = 40
end
object ccqx_temperature4: TcxTextEdit
Tag = 2
Left = 158
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 5
Width = 40
end
object ccqx_temperature5: TcxTextEdit
Tag = 2
Left = 209
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 6
Width = 40
end
object ccqx_temperature6: TcxTextEdit
Tag = 2
Left = 260
Top = 74
Hint = #38271#36710#28165#27927#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 7
Width = 40
end
object TbCCQXReplace: TcxButton
Left = 9
Top = 32
Width = 50
Height = 25
Caption = #19968#38190#26367#25442
TabOrder = 8
OnClick = TbCCQXReplaceClick
end
object TbccqxClear: TcxButton
Left = 66
Top = 32
Width = 50
Height = 25
Caption = #19968#38190#28165#31354
TabOrder = 9
OnClick = TbccqxClearClick
end
object cxLabel41: TcxLabel
Left = 171
Top = 59
Hint = #28165#27927#27700#28201
Caption = '4#'
end
object cxLabel42: TcxLabel
Left = 68
Top = 59
Hint = #28165#27927#27700#28201
Caption = '2#'
end
object cxLabel45: TcxLabel
Left = 16
Top = 59
Caption = '1#'
end
object cxLabel46: TcxLabel
Left = 120
Top = 59
Caption = '3#'
end
object cxLabel47: TcxLabel
Left = 223
Top = 59
Caption = '5#'
end
object cxLabel48: TcxLabel
Left = 275
Top = 59
Hint = #28165#27927#27700#28201
Caption = '6#'
end
object cxGrid4: TcxGrid
Left = 328
Top = 6
Width = 200
Height = 120
TabOrder = 16
object TvCCQX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_CCQX
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object TvCCQXccqx_Name: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'ccqx_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn2PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object Tv1ccqx_rate: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'ccqx_rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = Tv1ccqx_ratePropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvCCQXserialno: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvCCQXccqx_spel: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'ccqx_spel'
DataBinding.IsNullValueType = True
Visible = False
Width = 80
end
object TvCCQXccqx_unit: TcxGridDBColumn
Caption = #21333#20301
DataBinding.FieldName = 'ccqx_unit'
DataBinding.IsNullValueType = True
Visible = False
Width = 80
end
object TvCCQXBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel4: TcxGridLevel
GridView = TvCCQX
end
end
object cxLabel1: TcxLabel
Left = 534
Top = 59
Caption = #22791#27880
end
object TbCCQXAdd: TcxButton
Left = 288
Top = 6
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 18
OnClick = TbCCQXAddClick
end
object TbCCQXDel: TcxButton
Left = 287
Top = 38
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 19
OnClick = TbCCQXDelClick
end
object ccqx_note: TcxMemo
Tag = 2
Left = 568
Top = 40
Properties.ScrollBars = ssVertical
TabOrder = 20
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object DS_CCQX: TDataSource
DataSet = CDS_CCQX
Left = 759
Top = 80
end
object CDS_CCQX: TClientDataSet
Aggregates = <>
Params = <>
Left = 767
Top = 8
end
end

View File

@ -0,0 +1,478 @@
unit U_frameCCQXList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeCCQXList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_ccqx: TPanel;
LabelCCQX: TLabel;
cxLabel113: TcxLabel;
ccqx_speed: TcxTextEdit;
ccqx_temperature1: TcxTextEdit;
ccqx_temperature2: TcxTextEdit;
ccqx_temperature3: TcxTextEdit;
ccqx_temperature4: TcxTextEdit;
ccqx_temperature5: TcxTextEdit;
ccqx_temperature6: TcxTextEdit;
TbCCQXReplace: TcxButton;
TbccqxClear: TcxButton;
cxLabel41: TcxLabel;
cxLabel42: TcxLabel;
cxLabel45: TcxLabel;
cxLabel46: TcxLabel;
cxLabel47: TcxLabel;
cxLabel48: TcxLabel;
cxGrid4: TcxGrid;
TvCCQX: TcxGridDBTableView;
TvCCQXccqx_Name: TcxGridDBColumn;
Tv1ccqx_rate: TcxGridDBColumn;
TvCCQXserialno: TcxGridDBColumn;
cxGridLevel4: TcxGridLevel;
cxLabel1: TcxLabel;
TbCCQXAdd: TcxButton;
TbCCQXDel: TcxButton;
ccqx_note: TcxMemo;
DS_CCQX: TDataSource;
CDS_CCQX: TClientDataSet;
TvCCQXccqx_spel: TcxGridDBColumn;
TvCCQXccqx_unit: TcxGridDBColumn;
TvCCQXBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure TbCCQXReplaceClick(Sender: TObject);
procedure TbccqxClearClick(Sender: TObject);
procedure TbCCQXAddClick(Sender: TObject);
procedure TbCCQXDelClick(Sender: TObject);
procedure cxGridDBColumn2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure Tv1ccqx_ratePropertiesEditValueChanged(Sender: TObject);
private
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSid: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeCCQXList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeCCQXList.TbCCQXAddClick(Sender: TObject);
begin
with CDS_CCQX do
begin
Append;
CDS_CCQX.FieldByName('serialno').Value := CDS_CCQX.RecordCount + 1;
Post;
end;
end;
procedure TframeCCQXList.TbccqxClearClick(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_ccqx, '长车清洗温控');
end;
procedure TframeCCQXList.TbCCQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_CCQX.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_CCQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_CCQX.Delete;
end
else
exit;
i := 0;
CDS_CCQX.First;
while not CDS_CCQX.Eof do
begin
i := i + 1;
CDS_CCQX.Edit;
CDS_CCQX.fieldByName('serialno').value := i;
CDS_CCQX.Post;
CDS_CCQX.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeCCQXList.TbCCQXReplaceClick(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_ccqx, '长车清洗温控', FindLastEditedTextEdit(panel_ccqx, '长车清洗温控'));
end;
procedure TframeCCQXList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeCCQXList.ToolButton3Click(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
RTValues := SelCDSKey(CDS_HZ, ['POSID']);
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'Position';
FFiltration1 := RTValues[0];
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TframeCCQXList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
procedure TframeCCQXList.Tv1ccqx_ratePropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
TvCCQX.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
TvCCQX.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
function TframeCCQXList.SaveData(mPSid: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSid) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSid) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSid);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_ccqx, 2);
ADOQueryCmd.Post;
////////////////// 保存长车清洗子表 //////////////////////
with CDS_CCQX do
begin
First;
while not Eof do
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid1, 'CCQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid1 := Trim(CDS_CCQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid1) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '长车清洗';
FieldByName('PSID').Value := Trim(mPSid);
FieldByName('BCPID').Value := Trim(maxsubid1);
RTSetSaveDataCDS(ADOQueryCmd, TvCCQX, CDS_CCQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// 保存长车清洗子表结束 //////////////////////
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TframeCCQXList.cxGridDBColumn2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_CCQX do
begin
Edit;
FieldByName('ccqx_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('ccqx_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('ccqx_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeCCQXList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TframeCCQXList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// 检查是否是 TcxTextEdit并且 Hint 匹配,且不是排除的控件
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // 直接清空
end;
end;
end;
function TframeCCQXList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// 如果没有子控件,直接返回空
if AParent.ControlCount = 0 then
Exit;
// 使用 TList 存储控件(兼容旧版 Delphi
SortedControls := TList.Create;
try
// 将所有子控件添加到列表
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// 手动排序:按 TopY坐标 LeftX坐标升序排列
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// 比较两个控件的 Top Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// 交换位置
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// 遍历排序后的控件
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留
end;
end;
finally
SortedControls.Free;
end;
end;
end.

View File

@ -0,0 +1,462 @@
object frameFPList: TframeFPList
Left = 0
Top = 0
Width = 1147
Height = 137
TabOrder = 0
object Panel_FP: TPanel
Left = 0
Top = 0
Width = 1147
Height = 157
Align = alTop
TabOrder = 0
object LabelFP: TLabel
Left = 4
Top = 4
Width = 24
Height = 12
Caption = #21457#27873
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel290: TcxLabel
Left = 40
Top = 4
Caption = #36710#36895'(M/Min)'
end
object fp_speed: TcxTextEdit
Tag = 2
Left = 114
Top = 4
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object fp_gjNumber: TcxTextEdit
Tag = 2
Left = 219
Top = 4
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 2
Width = 50
end
object cxLabel279: TcxLabel
Left = 167
Top = 4
Caption = #21038#33014#27425#25968
end
object TbFPReplace2: TcxButton
Left = 9
Top = 30
Width = 50
Height = 25
Caption = #19968#38190#26367#25442
TabOrder = 4
OnClick = TbFPReplace2Click
end
object TbFPClear2: TcxButton
Left = 66
Top = 30
Width = 50
Height = 25
Caption = #19968#38190#28165#31354
TabOrder = 5
OnClick = TbFPClear2Click
end
object cxLabel284: TcxLabel
Left = 68
Top = 56
Caption = '2#'
end
object cxLabel286: TcxLabel
Left = 16
Top = 56
Caption = '1#'
end
object cxLabel287: TcxLabel
Left = 223
Top = 56
Caption = '5#'
end
object cxLabel288: TcxLabel
Left = 117
Top = 91
Caption = '9#'
end
object cxLabel297: TcxLabel
Left = 275
Top = 56
Caption = '6#'
end
object cxLabel299: TcxLabel
Left = 120
Top = 56
Caption = '3#'
end
object cxLabel300: TcxLabel
Left = 171
Top = 56
Caption = '4#'
end
object cxLabel301: TcxLabel
Left = 16
Top = 91
Caption = '7#'
end
object cxLabel302: TcxLabel
Left = 66
Top = 91
Caption = '8#'
end
object cxLabel303: TcxLabel
Left = 167
Top = 91
Caption = '10#'
end
object cxLabel323: TcxLabel
Left = 223
Top = 91
Caption = '11#'
end
object fp_temperature1: TcxTextEdit
Tag = 2
Left = 4
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 17
Width = 40
end
object fp_temperature10: TcxTextEdit
Tag = 2
Left = 158
Top = 106
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 18
Width = 40
end
object fp_temperature11: TcxTextEdit
Tag = 2
Left = 209
Top = 106
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 19
Width = 40
end
object fp_temperature2: TcxTextEdit
Tag = 2
Left = 55
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 20
Width = 40
end
object fp_temperature3: TcxTextEdit
Tag = 2
Left = 106
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 21
Width = 40
end
object fp_temperature4: TcxTextEdit
Tag = 2
Left = 158
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 22
Width = 40
end
object fp_temperature5: TcxTextEdit
Tag = 2
Left = 209
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 23
Width = 40
end
object fp_temperature6: TcxTextEdit
Tag = 2
Left = 260
Top = 72
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 24
Width = 40
end
object fp_temperature7: TcxTextEdit
Tag = 2
Left = 4
Top = 106
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 25
Width = 40
end
object fp_temperature8: TcxTextEdit
Tag = 2
Left = 55
Top = 106
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 26
Width = 40
end
object fp_temperature9: TcxTextEdit
Tag = 2
Left = 107
Top = 106
Hint = #21457#27873#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 27
Width = 40
end
object cxGrid6: TcxGrid
Left = 328
Top = 7
Width = 200
Height = 120
TabOrder = 28
object TvFP: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_FP
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object cxGridDBColumn14: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'fp_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn14PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn17: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'fp_rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = cxGridDBColumn17PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvFPserialno: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvFPfp_spel: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'fp_spel'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
object TvFPfp_unit: TcxGridDBColumn
Caption = #21333#20301
DataBinding.FieldName = 'fp_unit'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
object TvFPBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel5: TcxGridLevel
GridView = TvFP
end
end
object cxLabel8: TcxLabel
Left = 534
Top = 61
Caption = #22791#27880
end
object TbFPAdd: TcxButton
Left = 287
Top = 7
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 30
OnClick = TbFPAddClick
end
object TbFPDel: TcxButton
Left = 287
Top = 38
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 31
OnClick = TbFPDelClick
end
object fp_Precautions: TcxMemo
Tag = 2
Left = 568
Top = 46
Properties.Alignment = taLeftJustify
Properties.ScrollBars = ssVertical
TabOrder = 32
Height = 50
Width = 140
end
object cxLabel12: TcxLabel
Left = 117
Top = 33
Caption = #24038#38388#38553
end
object fp_leftGap: TcxTextEdit
Tag = 2
Left = 156
Top = 33
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 34
Width = 40
end
object cxLabel13: TcxLabel
Left = 197
Top = 33
Caption = #21491#38388#38553
end
object fp_rightGap: TcxTextEdit
Tag = 2
Left = 235
Top = 33
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 36
Width = 40
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object CDS_FP: TClientDataSet
Aggregates = <>
Params = <>
Left = 949
Top = 3
end
object DS_FP: TDataSource
DataSet = CDS_FP
Left = 949
Top = 51
end
end

View File

@ -0,0 +1,509 @@
unit U_frameFPList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeFPList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_FP: TPanel;
LabelFP: TLabel;
cxLabel290: TcxLabel;
fp_speed: TcxTextEdit;
fp_gjNumber: TcxTextEdit;
cxLabel279: TcxLabel;
TbFPReplace2: TcxButton;
TbFPClear2: TcxButton;
cxLabel284: TcxLabel;
cxLabel286: TcxLabel;
cxLabel287: TcxLabel;
cxLabel288: TcxLabel;
cxLabel297: TcxLabel;
cxLabel299: TcxLabel;
cxLabel300: TcxLabel;
cxLabel301: TcxLabel;
cxLabel302: TcxLabel;
cxLabel303: TcxLabel;
cxLabel323: TcxLabel;
fp_temperature1: TcxTextEdit;
fp_temperature10: TcxTextEdit;
fp_temperature11: TcxTextEdit;
fp_temperature2: TcxTextEdit;
fp_temperature3: TcxTextEdit;
fp_temperature4: TcxTextEdit;
fp_temperature5: TcxTextEdit;
fp_temperature6: TcxTextEdit;
fp_temperature7: TcxTextEdit;
fp_temperature8: TcxTextEdit;
fp_temperature9: TcxTextEdit;
cxGrid6: TcxGrid;
TvFP: TcxGridDBTableView;
cxGridDBColumn14: TcxGridDBColumn;
cxGridDBColumn17: TcxGridDBColumn;
TvFPserialno: TcxGridDBColumn;
cxGridLevel5: TcxGridLevel;
cxLabel8: TcxLabel;
TbFPAdd: TcxButton;
TbFPDel: TcxButton;
fp_Precautions: TcxMemo;
cxLabel12: TcxLabel;
fp_leftGap: TcxTextEdit;
cxLabel13: TcxLabel;
fp_rightGap: TcxTextEdit;
CDS_FP: TClientDataSet;
DS_FP: TDataSource;
TvFPfp_spel: TcxGridDBColumn;
TvFPfp_unit: TcxGridDBColumn;
TvFPBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure TbFPReplace2Click(Sender: TObject);
procedure TbFPClear2Click(Sender: TObject);
procedure TbFPAddClick(Sender: TObject);
procedure TbFPDelClick(Sender: TObject);
procedure cxGridDBColumn14PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn17PropertiesEditValueChanged(Sender: TObject);
private
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID :String): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeFPList.InitGrid();
begin
//
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// with ADOQueryTemp do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* FROM V_Dye_Technics_Details A');
// sql.Add(' Where A.PSID=''' + trim(fpsid) + '''');
//// SQL.Add(' and A.PSID = ''' + trim(CDS_2.fieldbyname('PSID').AsString) + '''');
// Open;
// end;
// with ADOQueryCmd do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* FROM BS_Cloth_GY_Sub A');
// sql.Add(' Where A.PSID=''' + trim(CDS_GX.fieldbyname('PSID').AsString) + '''');
//// SQL.Add(' and A.PSID = ''' + trim(CDS_2.fieldbyname('PSID').AsString) + '''');
// Open;
// end;
end;
procedure TframeFPList.TbFPAddClick(Sender: TObject);
begin
with CDS_FP do
begin
Append;
CDS_FP.FieldByName('serialno').Value := CDS_FP.RecordCount + 1;
Post;
end;
end;
procedure TframeFPList.TbFPClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_Fp, '发泡温控');
end;
procedure TframeFPList.TbFPDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_FP.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_FP.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_FP.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_FP.Delete;
end
else
exit;
i := 0;
CDS_FP.First;
while not CDS_FP.Eof do
begin
i := i + 1;
CDS_FP.Edit;
CDS_FP.fieldByName('serialno').value := i;
CDS_FP.Post;
CDS_FP.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeFPList.TbFPReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_fp, '发泡温控', FindLastEditedTextEdit(panel_fp, '发泡温控'));
end;
procedure TframeFPList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeFPList.ToolButton3Click(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
RTValues := SelCDSKey(CDS_HZ, ['POSID']);
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'Position';
FFiltration1 := RTValues[0];
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TframeFPList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeFPList.SaveData(mPSID :String) : Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fp, 2);
ADOQueryCmd.Post;
/// ////////////////// 保存发泡子表 //////////////////////
with CDS_FP do
begin
First;
while not Eof do
begin
if Trim(CDS_FP.Fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid6, 'FP', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid6 := Trim(CDS_FP.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add('BCPID=''' + Trim(maxsubid6) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_FP.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '发泡';
FieldByName('PSID').Value := Trim(mPSID);
FieldByName('BCPID').Value := Trim(maxsubid6);
RTSetSaveDataCDS(ADOQueryCmd, TvFP, CDS_FP, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// 保存发泡子表结束 //////////////////////
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TframeFPList.cxGridDBColumn14PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_FP do
begin
Edit;
FieldByName('fp_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('fp_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('fp_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeFPList.cxGridDBColumn17PropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
TvFP.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
TvFP.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
procedure TframeFPList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TframeFPList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// 检查是否是 TcxTextEdit并且 Hint 匹配,且不是排除的控件
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // 直接清空
end;
end;
end;
function TframeFPList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// 如果没有子控件,直接返回空
if AParent.ControlCount = 0 then
Exit;
// 使用 TList 存储控件(兼容旧版 Delphi
SortedControls := TList.Create;
try
// 将所有子控件添加到列表
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// 手动排序:按 TopY坐标 LeftX坐标升序排列
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// 比较两个控件的 Top Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// 交换位置
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// 遍历排序后的控件
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留
end;
end;
finally
SortedControls.Free;
end;
end;
end.

View File

@ -0,0 +1,445 @@
object frameFSList: TframeFSList
Left = 0
Top = 0
Width = 1147
Height = 132
TabOrder = 0
object Panel_FS: TPanel
Left = 0
Top = 0
Width = 1147
Height = 136
Align = alTop
TabOrder = 0
object LabelFS: TLabel
Left = 4
Top = 3
Width = 48
Height = 12
Caption = #19979#27700#23450#22411
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel198: TcxLabel
Left = 60
Top = 4
Caption = #36710#36895'(M/Min)'
end
object fs_speed: TcxTextEdit
Tag = 2
Left = 136
Top = 4
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object FS_Style: TcxComboBox
Tag = 2
Left = 196
Top = 4
Properties.Items.Strings = (
''
#28165#27700
#38450#27700
#25239#33740
#38450#32432#35010)
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 2
Width = 70
end
object fs_isVacuun: TcxComboBox
Tag = 2
Left = 196
Top = 30
Properties.Items.Strings = (
''
#26159
#21542)
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 3
Width = 70
end
object TbFSReplace2: TcxButton
Left = 9
Top = 30
Width = 50
Height = 25
Caption = #19968#38190#26367#25442
TabOrder = 4
OnClick = TbFSReplace2Click
end
object TBFScLEAR2: TcxButton
Left = 66
Top = 30
Width = 50
Height = 25
Caption = #19968#38190#28165#31354
TabOrder = 5
OnClick = TBFScLEAR2Click
end
object cxLabel192: TcxLabel
Left = 68
Top = 56
Caption = '2#'
end
object cxLabel194: TcxLabel
Left = 16
Top = 56
Caption = '1#'
end
object cxLabel195: TcxLabel
Left = 223
Top = 56
Caption = '5#'
end
object cxLabel196: TcxLabel
Left = 117
Top = 89
Caption = '9#'
end
object cxLabel205: TcxLabel
Left = 275
Top = 56
Caption = '6#'
end
object cxLabel207: TcxLabel
Left = 120
Top = 56
Caption = '3#'
end
object cxLabel208: TcxLabel
Left = 171
Top = 56
Caption = '4#'
end
object cxLabel209: TcxLabel
Left = 16
Top = 89
Caption = '7#'
end
object cxLabel210: TcxLabel
Left = 66
Top = 89
Caption = '8#'
end
object cxLabel211: TcxLabel
Left = 167
Top = 89
Caption = '10#'
end
object cxLabel231: TcxLabel
Left = 223
Top = 89
Caption = '11#'
end
object fs_temperature1: TcxTextEdit
Tag = 2
Left = 4
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 17
Width = 40
end
object fs_temperature10: TcxTextEdit
Tag = 2
Left = 158
Top = 104
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 18
Width = 40
end
object fs_temperature11: TcxTextEdit
Tag = 2
Left = 209
Top = 104
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 19
Width = 40
end
object fs_temperature2: TcxTextEdit
Tag = 2
Left = 55
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 20
Width = 40
end
object fs_temperature3: TcxTextEdit
Tag = 2
Left = 106
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 21
Width = 40
end
object fs_temperature4: TcxTextEdit
Tag = 2
Left = 158
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 22
Width = 40
end
object fs_temperature5: TcxTextEdit
Tag = 2
Left = 209
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 23
Width = 40
end
object fs_temperature6: TcxTextEdit
Tag = 2
Left = 260
Top = 71
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 24
Width = 40
end
object fs_temperature7: TcxTextEdit
Tag = 2
Left = 4
Top = 104
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 25
Width = 40
end
object fs_temperature8: TcxTextEdit
Tag = 2
Left = 55
Top = 104
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 26
Width = 40
end
object fs_temperature9: TcxTextEdit
Tag = 2
Left = 107
Top = 104
Hint = #38450#27700#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 27
Width = 40
end
object cxGrid7: TcxGrid
Left = 328
Top = 6
Width = 200
Height = 120
TabOrder = 28
object TvFS: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_FS
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object cxGridDBColumn19: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'fs_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn19PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn22: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'fs_rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = cxGridDBColumn22PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvFSColumn1: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvFSfs_spel: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'fs_spel'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
object TvFSfs_unit: TcxGridDBColumn
Caption = #21333#20301
DataBinding.FieldName = 'fs_unit'
DataBinding.IsNullValueType = True
Visible = False
Width = 80
end
object TvFSBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel6: TcxGridLevel
GridView = TvFS
end
end
object cxLabel7: TcxLabel
Left = 534
Top = 57
Caption = #22791#27880
end
object TbFSAdd: TcxButton
Left = 287
Top = 6
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 30
OnClick = TbFSAddClick
end
object TbFSDel: TcxButton
Left = 287
Top = 37
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 31
OnClick = TbFSDelClick
end
object fs_Precautions: TcxMemo
Tag = 2
Left = 568
Top = 42
Properties.Alignment = taLeftJustify
Properties.ScrollBars = ssVertical
TabOrder = 32
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object CDS_fS: TClientDataSet
Aggregates = <>
Params = <>
Left = 1023
Top = 11
end
object DS_FS: TDataSource
DataSet = CDS_fS
Left = 1039
Top = 62
end
end

View File

@ -0,0 +1,495 @@
unit U_frameFSList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeFSList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_FS: TPanel;
LabelFS: TLabel;
cxLabel198: TcxLabel;
fs_speed: TcxTextEdit;
FS_Style: TcxComboBox;
fs_isVacuun: TcxComboBox;
TbFSReplace2: TcxButton;
TBFScLEAR2: TcxButton;
cxLabel192: TcxLabel;
cxLabel194: TcxLabel;
cxLabel195: TcxLabel;
cxLabel196: TcxLabel;
cxLabel205: TcxLabel;
cxLabel207: TcxLabel;
cxLabel208: TcxLabel;
cxLabel209: TcxLabel;
cxLabel210: TcxLabel;
cxLabel211: TcxLabel;
cxLabel231: TcxLabel;
fs_temperature1: TcxTextEdit;
fs_temperature10: TcxTextEdit;
fs_temperature11: TcxTextEdit;
fs_temperature2: TcxTextEdit;
fs_temperature3: TcxTextEdit;
fs_temperature4: TcxTextEdit;
fs_temperature5: TcxTextEdit;
fs_temperature6: TcxTextEdit;
fs_temperature7: TcxTextEdit;
fs_temperature8: TcxTextEdit;
fs_temperature9: TcxTextEdit;
cxGrid7: TcxGrid;
TvFS: TcxGridDBTableView;
cxGridDBColumn19: TcxGridDBColumn;
cxGridDBColumn22: TcxGridDBColumn;
TvFSColumn1: TcxGridDBColumn;
cxGridLevel6: TcxGridLevel;
cxLabel7: TcxLabel;
TbFSAdd: TcxButton;
TbFSDel: TcxButton;
fs_Precautions: TcxMemo;
CDS_fS: TClientDataSet;
DS_FS: TDataSource;
TvFSfs_spel: TcxGridDBColumn;
TvFSfs_unit: TcxGridDBColumn;
TvFSBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure TbFSReplace2Click(Sender: TObject);
procedure TBFScLEAR2Click(Sender: TObject);
procedure TbFSAddClick(Sender: TObject);
procedure TbFSDelClick(Sender: TObject);
procedure cxGridDBColumn19PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn22PropertiesEditValueChanged(Sender: TObject);
private
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeFSList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeFSList.TbFSAddClick(Sender: TObject);
begin
with CDS_FS do
begin
Append;
CDS_FS.FieldByName('serialno').Value := CDS_FS.RecordCount + 1;
Post;
end;
end;
procedure TframeFSList.TBFScLEAR2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_FS, '防水温控');
end;
procedure TframeFSList.TbFSDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_FS.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_FS.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_FS.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_FS.Delete;
end
else
exit;
i := 0;
CDS_FS.First;
while not CDS_FS.Eof do
begin
i := i + 1;
CDS_FS.Edit;
CDS_FS.fieldByName('serialno').value := i;
CDS_FS.Post;
CDS_FS.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeFSList.TbFSReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_fs, '防水温控', FindLastEditedTextEdit(panel_fs, '防水温控'));
end;
procedure TframeFSList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeFSList.ToolButton3Click(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
RTValues := SelCDSKey(CDS_HZ, ['POSID']);
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'Position';
FFiltration1 := RTValues[0];
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TframeFSList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeFSList.SaveData(mPSID: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fs, 2);
ADOQueryCmd.Post;
with CDS_fS do
begin
First;
while not Eof do
begin
if Trim(CDS_fS.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid4, 'FS', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid4 := Trim(CDS_fS.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid4) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_fS.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '下水定型';
FieldByName('PSID').Value := Trim(mPSID);
FieldByName('BCPID').Value := Trim(maxsubid4);
RTSetSaveDataCDS(ADOQueryCmd, TvFS, CDS_fS, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TframeFSList.cxGridDBColumn19PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_FS do
begin
Edit;
FieldByName('fs_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('fs_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('fs_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeFSList.cxGridDBColumn22PropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
TvFS.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
TvFS.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
procedure TframeFSList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TframeFSList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// 检查是否是 TcxTextEdit并且 Hint 匹配,且不是排除的控件
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // 直接清空
end;
end;
end;
function TframeFSList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// 如果没有子控件,直接返回空
if AParent.ControlCount = 0 then
Exit;
// 使用 TList 存储控件(兼容旧版 Delphi
SortedControls := TList.Create;
try
// 将所有子控件添加到列表
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// 手动排序:按 TopY坐标 LeftX坐标升序排列
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// 比较两个控件的 Top Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// 交换位置
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// 遍历排序后的控件
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留
end;
end;
finally
SortedControls.Free;
end;
end;
end.

View File

@ -0,0 +1,309 @@
object frameGDXList: TframeGDXList
Left = 0
Top = 0
Width = 1147
Height = 132
TabOrder = 0
object Panel_dx: TPanel
Left = 0
Top = 0
Width = 1147
Height = 129
Align = alTop
TabOrder = 0
object LabelGDX: TLabel
Left = 4
Top = 3
Width = 36
Height = 12
Caption = #24178#23450#22411
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel4: TcxLabel
Left = 57
Top = 5
Caption = #36710#36895'(M/Min)'
end
object dx_speed: TcxTextEdit
Tag = 2
Left = 133
Top = 5
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object cxLabel21: TcxLabel
Left = 68
Top = 49
Caption = '2#'
end
object cxLabel23: TcxLabel
Left = 16
Top = 49
Caption = '1#'
end
object cxLabel24: TcxLabel
Left = 223
Top = 49
Caption = '5#'
end
object cxLabel25: TcxLabel
Left = 117
Top = 85
Caption = '9#'
end
object cxLabel6: TcxLabel
Left = 275
Top = 49
Caption = '6#'
end
object cxLabel61: TcxLabel
Left = 120
Top = 49
Caption = '3#'
end
object cxLabel62: TcxLabel
Left = 171
Top = 49
Caption = '4#'
end
object cxLabel63: TcxLabel
Left = 16
Top = 85
Caption = '7#'
end
object cxLabel64: TcxLabel
Left = 66
Top = 85
Caption = '8#'
end
object cxLabel65: TcxLabel
Left = 167
Top = 85
Caption = '10#'
end
object dx_temperature1: TcxTextEdit
Tag = 2
Left = 5
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 12
Width = 40
end
object dx_temperature5: TcxTextEdit
Tag = 2
Left = 209
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 13
Width = 40
end
object dx_temperature9: TcxTextEdit
Tag = 2
Left = 107
Top = 100
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 14
Width = 40
end
object dx_temperature6: TcxTextEdit
Tag = 2
Left = 260
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 15
Width = 40
end
object dx_temperature3: TcxTextEdit
Tag = 2
Left = 107
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 16
Width = 40
end
object dx_temperature4: TcxTextEdit
Tag = 2
Left = 158
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 17
Width = 40
end
object dx_temperature7: TcxTextEdit
Tag = 2
Left = 5
Top = 100
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 18
Width = 40
end
object dx_temperature8: TcxTextEdit
Tag = 2
Left = 56
Top = 100
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 19
Width = 40
end
object dx_temperature10: TcxTextEdit
Tag = 2
Left = 158
Top = 100
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 20
Width = 40
end
object dx_temperature2: TcxTextEdit
Tag = 2
Left = 56
Top = 66
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 21
Width = 40
end
object TbDXReplace2: TcxButton
Left = 9
Top = 26
Width = 50
Height = 25
Caption = #19968#38190#26367#25442
TabOrder = 22
OnClick = TbDXReplace2Click
end
object TbDXClear2: TcxButton
Left = 66
Top = 26
Width = 50
Height = 25
Caption = #19968#38190#28165#31354
TabOrder = 23
OnClick = TbDXClear2Click
end
object cxLabel189: TcxLabel
Left = 223
Top = 85
Caption = '11#'
end
object dx_temperature11: TcxTextEdit
Tag = 2
Left = 209
Top = 100
Hint = #24178#23450#22411#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 25
Width = 40
end
object cxLabel5: TcxLabel
Left = 534
Top = 52
Caption = #22791#27880
end
object dx_Precautions: TcxMemo
Tag = 2
Left = 568
Top = 39
Properties.ScrollBars = ssVertical
TabOrder = 27
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
end

View File

@ -0,0 +1,318 @@
unit U_frameGDXList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeGDXList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_dx: TPanel;
LabelGDX: TLabel;
cxLabel4: TcxLabel;
dx_speed: TcxTextEdit;
cxLabel21: TcxLabel;
cxLabel23: TcxLabel;
cxLabel24: TcxLabel;
cxLabel25: TcxLabel;
cxLabel6: TcxLabel;
cxLabel61: TcxLabel;
cxLabel62: TcxLabel;
cxLabel63: TcxLabel;
cxLabel64: TcxLabel;
cxLabel65: TcxLabel;
dx_temperature1: TcxTextEdit;
dx_temperature5: TcxTextEdit;
dx_temperature9: TcxTextEdit;
dx_temperature6: TcxTextEdit;
dx_temperature3: TcxTextEdit;
dx_temperature4: TcxTextEdit;
dx_temperature7: TcxTextEdit;
dx_temperature8: TcxTextEdit;
dx_temperature10: TcxTextEdit;
dx_temperature2: TcxTextEdit;
TbDXReplace2: TcxButton;
TbDXClear2: TcxButton;
cxLabel189: TcxLabel;
dx_temperature11: TcxTextEdit;
cxLabel5: TcxLabel;
dx_Precautions: TcxMemo;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure TbDXReplace2Click(Sender: TObject);
procedure TbDXClear2Click(Sender: TObject);
private
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint;
{$R *.dfm}
procedure TframeGDXList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeGDXList.TbDXClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_DX, '干定型温控');
end;
procedure TframeGDXList.TbDXReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_dx, '干定型温控', FindLastEditedTextEdit(panel_dx, '干定型温控'));
end;
procedure TframeGDXList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeGDXList.ToolButton3Click(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
RTValues := SelCDSKey(CDS_HZ, ['POSID']);
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'Position';
FFiltration1 := RTValues[0];
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TframeGDXList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeGDXList.SaveData(mPSID: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_dx, 2);
ADOQueryCmd.Post;
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TframeGDXList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TframeGDXList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// 检查是否是 TcxTextEdit并且 Hint 匹配,且不是排除的控件
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // 直接清空
end;
end;
end;
function TframeGDXList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// 如果没有子控件,直接返回空
if AParent.ControlCount = 0 then
Exit;
// 使用 TList 存储控件(兼容旧版 Delphi
SortedControls := TList.Create;
try
// 将所有子控件添加到列表
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// 手动排序:按 TopY坐标 LeftX坐标升序排列
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// 比较两个控件的 Top Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// 交换位置
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// 遍历排序后的控件
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留
end;
end;
finally
SortedControls.Free;
end;
end;
end.

View File

@ -0,0 +1,468 @@
object frameGJList: TframeGJList
Left = 0
Top = 0
Width = 1147
Height = 137
TabOrder = 0
object Panel_GJ: TPanel
Left = 0
Top = 0
Width = 1147
Height = 136
Align = alTop
TabOrder = 0
object LabelGJ: TLabel
Left = 4
Top = 3
Width = 24
Height = 12
Caption = #21038#33014
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel240: TcxLabel
Left = 40
Top = 6
Caption = #36710#36895'(M/Min)'
end
object gj_speed: TcxTextEdit
Tag = 2
Left = 114
Top = 6
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object cxLabel278: TcxLabel
Left = 165
Top = 6
Caption = #21038#33014#27425#25968
end
object gj_number: TcxTextEdit
Tag = 2
Left = 217
Top = 6
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 3
Width = 50
end
object TbGJReplace2: TcxButton
Left = 9
Top = 29
Width = 50
Height = 25
Caption = #19968#38190#26367#25442
TabOrder = 4
OnClick = TbGJReplace2Click
end
object TbGJClear2: TcxButton
Left = 66
Top = 29
Width = 50
Height = 25
Caption = #19968#38190#28165#31354
TabOrder = 5
OnClick = TbGJClear2Click
end
object cxLabel234: TcxLabel
Left = 68
Top = 56
Caption = '2#'
end
object cxLabel236: TcxLabel
Left = 16
Top = 56
Caption = '1#'
end
object cxLabel237: TcxLabel
Left = 223
Top = 56
Caption = '5#'
end
object cxLabel238: TcxLabel
Left = 117
Top = 94
Caption = '9#'
end
object cxLabel247: TcxLabel
Left = 275
Top = 56
Caption = '6#'
end
object cxLabel249: TcxLabel
Left = 120
Top = 56
Caption = '3#'
end
object cxLabel250: TcxLabel
Left = 171
Top = 56
Caption = '4#'
end
object cxLabel251: TcxLabel
Left = 16
Top = 94
Caption = '7#'
end
object cxLabel252: TcxLabel
Left = 66
Top = 94
Caption = '8#'
end
object cxLabel253: TcxLabel
Left = 167
Top = 94
Caption = '10#'
end
object cxLabel273: TcxLabel
Left = 223
Top = 94
Caption = '11#'
end
object gj_temperature1: TcxTextEdit
Tag = 2
Left = 4
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 17
Width = 40
end
object gj_temperature10: TcxTextEdit
Tag = 2
Left = 158
Top = 109
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 18
Width = 40
end
object gj_temperature11: TcxTextEdit
Tag = 2
Left = 209
Top = 109
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 19
Width = 40
end
object gj_temperature2: TcxTextEdit
Tag = 2
Left = 55
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 20
Width = 40
end
object gj_temperature3: TcxTextEdit
Tag = 2
Left = 106
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 21
Width = 40
end
object gj_temperature4: TcxTextEdit
Tag = 2
Left = 158
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 22
Width = 40
end
object gj_temperature5: TcxTextEdit
Tag = 2
Left = 209
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 23
Width = 40
end
object gj_temperature6: TcxTextEdit
Tag = 2
Left = 260
Top = 74
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 24
Width = 40
end
object gj_temperature7: TcxTextEdit
Tag = 2
Left = 4
Top = 109
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 25
Width = 40
end
object gj_temperature8: TcxTextEdit
Tag = 2
Left = 55
Top = 109
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 26
Width = 40
end
object gj_temperature9: TcxTextEdit
Tag = 2
Left = 107
Top = 109
Hint = #21038#33014#28201#25511
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 27
Width = 40
end
object cxGrid8: TcxGrid
Left = 328
Top = 6
Width = 200
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 28
object TvGJ: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_gj
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object cxGridDBColumn24: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'gj_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn24PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn27: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'gj_rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = cxGridDBColumn27PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvGJserialno: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvGJgj_spel: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'gj_spel'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
object TvGJgj_unit: TcxGridDBColumn
Caption = #21333#20301
DataBinding.FieldName = 'gj_unit'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
object TvGJBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel7: TcxGridLevel
GridView = TvGJ
end
end
object cxLabel9: TcxLabel
Left = 534
Top = 53
Caption = #22791#27880
end
object TbGJAdd: TcxButton
Left = 287
Top = 6
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 30
OnClick = TbGJAddClick
end
object TbGJDel: TcxButton
Left = 287
Top = 37
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 31
OnClick = TbGJDelClick
end
object gj_Precautions: TcxMemo
Tag = 2
Left = 568
Top = 39
Properties.Alignment = taLeftJustify
Properties.ScrollBars = ssVertical
TabOrder = 32
Height = 50
Width = 140
end
object cxLabel10: TcxLabel
Left = 117
Top = 32
Caption = #24038#38388#38553
end
object gj_leftGap: TcxTextEdit
Tag = 2
Left = 156
Top = 32
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 34
Width = 40
end
object cxLabel11: TcxLabel
Left = 197
Top = 32
Caption = #21491#38388#38553
end
object gj_rightGap: TcxTextEdit
Tag = 2
Left = 235
Top = 32
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 36
Width = 40
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object CDS_gj: TClientDataSet
Aggregates = <>
Params = <>
Left = 967
Top = 8
end
object DS_gj: TDataSource
DataSet = CDS_gj
Left = 967
Top = 62
end
end

View File

@ -0,0 +1,494 @@
unit U_frameGJList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeGJList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_GJ: TPanel;
LabelGJ: TLabel;
cxLabel240: TcxLabel;
gj_speed: TcxTextEdit;
cxLabel278: TcxLabel;
gj_number: TcxTextEdit;
TbGJReplace2: TcxButton;
TbGJClear2: TcxButton;
cxLabel234: TcxLabel;
cxLabel236: TcxLabel;
cxLabel237: TcxLabel;
cxLabel238: TcxLabel;
cxLabel247: TcxLabel;
cxLabel249: TcxLabel;
cxLabel250: TcxLabel;
cxLabel251: TcxLabel;
cxLabel252: TcxLabel;
cxLabel253: TcxLabel;
cxLabel273: TcxLabel;
gj_temperature1: TcxTextEdit;
gj_temperature10: TcxTextEdit;
gj_temperature11: TcxTextEdit;
gj_temperature2: TcxTextEdit;
gj_temperature3: TcxTextEdit;
gj_temperature4: TcxTextEdit;
gj_temperature5: TcxTextEdit;
gj_temperature6: TcxTextEdit;
gj_temperature7: TcxTextEdit;
gj_temperature8: TcxTextEdit;
gj_temperature9: TcxTextEdit;
cxGrid8: TcxGrid;
TvGJ: TcxGridDBTableView;
cxGridDBColumn24: TcxGridDBColumn;
cxGridDBColumn27: TcxGridDBColumn;
TvGJserialno: TcxGridDBColumn;
cxGridLevel7: TcxGridLevel;
cxLabel9: TcxLabel;
TbGJAdd: TcxButton;
TbGJDel: TcxButton;
gj_Precautions: TcxMemo;
cxLabel10: TcxLabel;
gj_leftGap: TcxTextEdit;
cxLabel11: TcxLabel;
gj_rightGap: TcxTextEdit;
CDS_gj: TClientDataSet;
DS_gj: TDataSource;
TvGJgj_spel: TcxGridDBColumn;
TvGJgj_unit: TcxGridDBColumn;
TvGJBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure TbGJReplace2Click(Sender: TObject);
procedure TbGJClear2Click(Sender: TObject);
procedure TbGJAddClick(Sender: TObject);
procedure TbGJDelClick(Sender: TObject);
procedure cxGridDBColumn24PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn27PropertiesEditValueChanged(Sender: TObject);
private
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeGJList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeGJList.TbGJAddClick(Sender: TObject);
begin
with CDS_GJ do
begin
Append;
CDS_GJ.FieldByName('serialno').Value := CDS_GJ.RecordCount + 1;
Post;
end;
end;
procedure TframeGJList.TbGJClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_gj, '刮胶温控');
end;
procedure TframeGJList.TbGJDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_GJ.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_GJ.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_GJ.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_GJ.Delete;
end
else
exit;
i := 0;
CDS_GJ.First;
while not CDS_GJ.Eof do
begin
i := i + 1;
CDS_GJ.Edit;
CDS_GJ.fieldByName('serialno').value := i;
CDS_GJ.Post;
CDS_GJ.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeGJList.TbGJReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_gj, '刮胶温控', FindLastEditedTextEdit(panel_gj, '刮胶温控'));
end;
procedure TframeGJList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeGJList.ToolButton3Click(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
RTValues := SelCDSKey(CDS_HZ, ['POSID']);
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'Position';
FFiltration1 := RTValues[0];
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TframeGJList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeGJList.SaveData(mPSID: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_gj, 2);
ADOQueryCmd.Post;
////////////////// 保存刮胶子表 //////////////////////
with CDS_gj do
begin
First;
while not Eof do
begin
if Trim(CDS_gj.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid5, 'GJ', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid5 := Trim(CDS_gj.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid5) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_gj.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '刮胶';
FieldByName('PSID').Value := Trim(mPSID);
FieldByName('BCPID').Value := Trim(maxsubid5);
RTSetSaveDataCDS(ADOQueryCmd, TvGJ, CDS_gj, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// 保存刮胶子表结束 //////////////////////
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TframeGJList.cxGridDBColumn24PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_GJ do
begin
Edit;
FieldByName('gj_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('gj_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('gj_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeGJList.cxGridDBColumn27PropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
TvGJ.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
TvGJ.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
procedure TframeGJList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TframeGJList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// 检查是否是 TcxTextEdit并且 Hint 匹配,且不是排除的控件
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // 直接清空
end;
end;
end;
function TframeGJList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// 如果没有子控件,直接返回空
if AParent.ControlCount = 0 then
Exit;
// 使用 TList 存储控件(兼容旧版 Delphi
SortedControls := TList.Create;
try
// 将所有子控件添加到列表
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// 手动排序:按 TopY坐标 LeftX坐标升序排列
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// 比较两个控件的 Top Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// 交换位置
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// 遍历排序后的控件
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留
end;
end;
finally
SortedControls.Free;
end;
end;
end.

View File

@ -0,0 +1,257 @@
object frameJGQXList: TframeJGQXList
Left = 0
Top = 0
Width = 1147
Height = 132
TabOrder = 0
object Panel_jgqx: TPanel
Left = 0
Top = 0
Width = 1147
Height = 140
Align = alTop
TabOrder = 0
object LabelJGQX: TLabel
Left = 4
Top = 2
Width = 48
Height = 12
Caption = #26426#32568#28165#27927
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel340: TcxLabel
Left = 8
Top = 28
Caption = #20445#28201#28201#24230'('#8451')'
end
object jgqx_keepTemper: TcxTextEdit
Tag = 2
Left = 90
Top = 28
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 50
end
object jgqx_keepTime: TcxTextEdit
Tag = 2
Left = 90
Top = 51
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 2
Width = 50
end
object cxLabel347: TcxLabel
Left = 8
Top = 51
Caption = #20445#28201#26102#38388'(min)'
end
object cxLabel173: TcxLabel
Left = 150
Top = 28
Caption = #21319#28201#36895#29575
end
object cxLabel334: TcxLabel
Left = 150
Top = 51
Caption = #38477#28201#36895#29575
end
object jgqx_upperSpeed: TcxTextEdit
Tag = 2
Left = 206
Top = 28
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 6
Width = 50
end
object jgqx_downSpeed: TcxTextEdit
Tag = 2
Left = 206
Top = 51
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 7
Width = 50
end
object cxGrid5: TcxGrid
Left = 334
Top = 7
Width = 200
Height = 120
TabOrder = 8
object TvJGQX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_jgqx
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object cxGridDBColumn9: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'jgqx_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn9PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn10: TcxGridDBColumn
Caption = #21333#20301'(%)'
DataBinding.FieldName = 'ccqx_unit'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Visible = False
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn12: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'jgqx_rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = cxGridDBColumn12PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn13: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'jgqx_spel'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvJGQXserialno: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvJGQXBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel3: TcxGridLevel
GridView = TvJGQX
end
end
object cxLabel3: TcxLabel
Left = 534
Top = 54
Caption = #22791#27880
end
object TbJGQXAdd: TcxButton
Left = 288
Top = 7
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 10
OnClick = TbJGQXAddClick
end
object TbJGQXDel: TcxButton
Left = 288
Top = 38
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 11
OnClick = TbJGQXDelClick
end
object jgqx_note: TcxMemo
Tag = 2
Left = 568
Top = 39
Properties.ScrollBars = ssVertical
TabOrder = 12
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object CDS_JGQX: TClientDataSet
Aggregates = <>
Params = <>
Left = 950
Top = 65526
end
object DS_jgqx: TDataSource
DataSet = CDS_JGQX
Left = 927
Top = 51
end
end

View File

@ -0,0 +1,339 @@
unit U_frameJGQXList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeJGQXList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_jgqx: TPanel;
LabelJGQX: TLabel;
cxLabel340: TcxLabel;
jgqx_keepTemper: TcxTextEdit;
jgqx_keepTime: TcxTextEdit;
cxLabel347: TcxLabel;
cxLabel173: TcxLabel;
cxLabel334: TcxLabel;
jgqx_upperSpeed: TcxTextEdit;
jgqx_downSpeed: TcxTextEdit;
cxGrid5: TcxGrid;
TvJGQX: TcxGridDBTableView;
cxGridDBColumn9: TcxGridDBColumn;
cxGridDBColumn10: TcxGridDBColumn;
cxGridDBColumn12: TcxGridDBColumn;
cxGridDBColumn13: TcxGridDBColumn;
TvJGQXserialno: TcxGridDBColumn;
cxGridLevel3: TcxGridLevel;
cxLabel3: TcxLabel;
TbJGQXAdd: TcxButton;
TbJGQXDel: TcxButton;
jgqx_note: TcxMemo;
CDS_JGQX: TClientDataSet;
DS_jgqx: TDataSource;
TvJGQXBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure TbJGQXAddClick(Sender: TObject);
procedure TbJGQXDelClick(Sender: TObject);
procedure cxGridDBColumn9PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn12PropertiesEditValueChanged(Sender: TObject);
private
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeJGQXList.cxGridDBColumn12PropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
TvJGQX.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
TvJGQX.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
procedure TframeJGQXList.cxGridDBColumn9PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_JGQX do
begin
Edit;
FieldByName('jgqx_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('jgqx_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('jgqx_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeJGQXList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeJGQXList.TbJGQXAddClick(Sender: TObject);
begin
with CDS_JGQX do
begin
Append;
CDS_JGQX.FieldByName('serialno').Value := CDS_JGQX.RecordCount + 1;
Post;
end;
end;
procedure TframeJGQXList.TbJGQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_JGQX.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_JGQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_JGQX.Delete;
end
else
exit;
i := 0;
CDS_JGQX.First;
while not CDS_JGQX.Eof do
begin
i := i + 1;
CDS_JGQX.Edit;
CDS_JGQX.fieldByName('serialno').value := i;
CDS_JGQX.Post;
CDS_JGQX.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeJGQXList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeJGQXList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeJGQXList.SaveData(mPSID: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_jgqx, 2);
ADOQueryCmd.Post;
////////////////// 保存机缸清洗子表 //////////////////////
with CDS_JGQX do
begin
First;
while not Eof do
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid3, 'JGQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid3 := Trim(CDS_JGQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid3) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '机缸清洗';
FieldByName('PSID').Value := Trim(mPSID);
FieldByName('BCPID').Value := Trim(maxsubid3);
RTSetSaveDataCDS(ADOQueryCmd, TvJGQX, CDS_JGQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// 保存机缸清洗子表结束 //////////////////////
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
end.

View File

@ -0,0 +1,238 @@
object frameRGQXList: TframeRGQXList
Left = 0
Top = 0
Width = 1147
Height = 132
TabOrder = 0
object Panel_rgqx: TPanel
Left = 0
Top = 0
Width = 1147
Height = 131
Align = alTop
TabOrder = 0
object LabelRGQX: TLabel
Left = 4
Top = 3
Width = 60
Height = 12
Caption = #21367#26579#32568#28165#27927
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object cxLabel114: TcxLabel
Left = 8
Top = 22
Caption = #26579#36895'(m/min)'
end
object cxLabel150: TcxLabel
Left = 8
Top = 46
Caption = #35774#23450#28082#28201'('#8451')'
end
object cxLabel165: TcxLabel
Left = 144
Top = 22
Caption = #36947#25968#35774#32622
end
object rgqx_daoSet: TcxTextEdit
Tag = 2
Left = 204
Top = 19
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 3
Width = 58
end
object rgqx_speed: TcxTextEdit
Tag = 2
Left = 86
Top = 19
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 4
Width = 50
end
object rgqx_waterTemper: TcxTextEdit
Tag = 2
Left = 86
Top = 45
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 5
Width = 50
end
object cxGrid3: TcxGrid
Left = 328
Top = 6
Width = 200
Height = 120
TabOrder = 6
object TvRGQX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_rgqx
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.ColumnAutoWidth = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
object cxGridDBColumn1: TcxGridDBColumn
Caption = #21161#21058#32534#21495
DataBinding.FieldName = 'rgqx_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = cxGridDBColumn1PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 70
end
object cxGridDBColumn7: TcxGridDBColumn
Caption = #27604#29575'(%)'
DataBinding.FieldName = 'rgqx_Rate'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = False
Properties.OnEditValueChanged = cxGridDBColumn7PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 70
end
object TvRGQXserialno: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'serialno'
DataBinding.IsNullValueType = True
Visible = False
Width = 60
end
object TvRGQXrgqx_spel: TcxGridDBColumn
Caption = #31867#22411
DataBinding.FieldName = 'rgqx_spel'
DataBinding.IsNullValueType = True
Visible = False
Width = 80
end
object TvRGQXrgqx_unit: TcxGridDBColumn
Caption = #21333#20301
DataBinding.FieldName = 'rgqx_unit'
DataBinding.IsNullValueType = True
Visible = False
Width = 80
end
object TvRGQXBPIID: TcxGridDBColumn
Caption = #21161#21058#20027#38190
DataBinding.FieldName = 'BPIID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel2: TcxGridLevel
GridView = TvRGQX
end
end
object cxLabel2: TcxLabel
Left = 534
Top = 51
Caption = #22791#27880
end
object TbRGQXAdd: TcxButton
Left = 288
Top = 6
Width = 40
Height = 20
Caption = #22686#34892
TabOrder = 8
OnClick = TbRGQXAddClick
end
object TbRGQXDel: TcxButton
Left = 287
Top = 38
Width = 40
Height = 20
Caption = #21024#34892
TabOrder = 9
OnClick = TbRGQXDelClick
end
object rgqx_note: TcxMemo
Tag = 2
Left = 568
Top = 37
Properties.ScrollBars = ssVertical
TabOrder = 10
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
object CDS_RGQX: TClientDataSet
Aggregates = <>
Params = <>
Left = 1119
Top = 4
end
object DS_rgqx: TDataSource
DataSet = CDS_RGQX
Left = 1119
Top = 52
end
end

View File

@ -0,0 +1,342 @@
unit U_frameRGQXList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel, cxMaskEdit,
cxDropDownEdit, cxButtonEdit, cxButtons;
type
TframeRGQXList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_rgqx: TPanel;
LabelRGQX: TLabel;
cxLabel114: TcxLabel;
cxLabel150: TcxLabel;
cxLabel165: TcxLabel;
rgqx_daoSet: TcxTextEdit;
rgqx_speed: TcxTextEdit;
rgqx_waterTemper: TcxTextEdit;
cxGrid3: TcxGrid;
TvRGQX: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
TvRGQXserialno: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
cxLabel2: TcxLabel;
TbRGQXAdd: TcxButton;
TbRGQXDel: TcxButton;
rgqx_note: TcxMemo;
CDS_RGQX: TClientDataSet;
DS_rgqx: TDataSource;
TvRGQXrgqx_spel: TcxGridDBColumn;
TvRGQXrgqx_unit: TcxGridDBColumn;
TvRGQXBPIID: TcxGridDBColumn;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure TbRGQXAddClick(Sender: TObject);
procedure TbRGQXDelClick(Sender: TObject);
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn7PropertiesEditValueChanged(Sender: TObject);
private
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID: string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint,U_ProductInfoSel;
{$R *.dfm}
procedure TframeRGQXList.cxGridDBColumn1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmProductInfoSel := TfrmProductInfoSel.Create(Application);
with frmProductInfoSel do
begin
FSTKName := '助剂';
if ShowModal = 1 then
begin
with Self.CDS_RGQX do
begin
Edit;
FieldByName('rgqx_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value;
FieldByName('rgqx_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Type').value;
FieldByName('rgqx_unit').Value := frmProductInfoSel.CDS_1.fieldbyname('QtyUnit').value;
FieldByName('BPIID').Value := frmProductInfoSel.CDS_1.fieldbyname('BPIID').value;
end;
end;
end;
finally
frmProductInfoSel.Free;
end;
end;
procedure TframeRGQXList.cxGridDBColumn7PropertiesEditValueChanged(
Sender: TObject);
var
s: string;
fValue: Double;
begin
s := TcxTextEdit(Sender).EditingText;
if (s <> '') and (s[Length(s)] <> '%') then
begin
try
// 尝试将字符串转换为浮点数
fValue := StrToFloat(s);
// 格式化为两位小数并添加百分号
Tvrgqx.Controller.FocusedColumn.EditValue := FormatFloat('0.00', fValue) + '%';
except
on E: EConvertError do
begin
// 如果转换失败,保持原样并添加百分号
Tvrgqx.Controller.FocusedColumn.EditValue := s + '%';
end;
end;
end;
end;
procedure TframeRGQXList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeRGQXList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeRGQXList.TbRGQXAddClick(Sender: TObject);
begin
with CDS_RGQX do
begin
Append;
CDS_RGQX.FieldByName('serialno').Value := CDS_RGQX.RecordCount + 1;
Post;
end;
end;
procedure TframeRGQXList.TbRGQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_RGQX.IsEmpty then
begin
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_RGQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_RGQX.Delete;
end
else
exit;
i := 0;
CDS_RGQX.First;
while not CDS_RGQX.Eof do
begin
i := i + 1;
CDS_RGQX.Edit;
CDS_RGQX.fieldByName('serialno').value := i;
CDS_RGQX.Post;
CDS_RGQX.Next;
end;
end
else
begin
Application.MessageBox('无可删除数据!', '提示', 0);
Exit;
end;
end;
procedure TframeRGQXList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeRGQXList.SaveData(mPSID: string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_rgqx, 2);
ADOQueryCmd.Post;
////////////////// 保存卷染缸清洗子表 //////////////////////
with CDS_RGQX do
begin
First;
while not Eof do
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid2, 'RGQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
Application.MessageBox('取配比子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxsubid2 := Trim(CDS_RGQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid2) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '卷染缸清洗';
FieldByName('PSID').Value := Trim(mPSID);
FieldByName('BCPID').Value := Trim(maxsubid2);
RTSetSaveDataCDS(ADOQueryCmd, TvRGQX, CDS_RGQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
//////////////// 保存卷染缸清洗子表结束 //////////////////////
end;
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
end.

View File

@ -0,0 +1,153 @@
object frameYMList: TframeYMList
Left = 0
Top = 0
Width = 1147
Height = 61
TabOrder = 0
object Panel_zm: TPanel
Left = 0
Top = 0
Width = 1147
Height = 61
Align = alTop
TabOrder = 0
object LabelYM: TLabel
Left = 4
Top = 6
Width = 24
Height = 12
Caption = #36711#27611
Font.Charset = GB2312_CHARSET
Font.Color = clMenuHighlight
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
end
object Label11: TLabel
Left = 40
Top = 10
Width = 72
Height = 13
Caption = #36827#20986#26009'(m/min)'
end
object zm_inout: TcxTextEdit
Tag = 2
Left = 124
Top = 7
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 0
Width = 50
end
object zm_style: TcxComboBox
Tag = 2
Left = 4
Top = 31
Properties.Items.Strings = (
''
#21333#25490#38024
#21452#25490#38024)
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 1
Width = 82
end
object cxLabel336: TcxLabel
Left = 117
Top = 31
Caption = #20027#30005#26426'('#27425'/min)'
end
object zm_mainElec: TcxTextEdit
Tag = 2
Left = 211
Top = 31
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 3
Width = 50
end
object cxLabel344: TcxLabel
Left = 295
Top = 31
Caption = #38024#26495#39640#24230'(cm)'
end
object zm_needleHigh: TcxTextEdit
Tag = 2
Left = 375
Top = 31
Style.LookAndFeel.SkinName = 'WXI'
StyleDisabled.LookAndFeel.SkinName = 'WXI'
StyleFocused.LookAndFeel.SkinName = 'WXI'
StyleHot.LookAndFeel.SkinName = 'WXI'
TabOrder = 5
Width = 50
end
object cxLabel342: TcxLabel
Left = 534
Top = 20
Caption = #22791#27880
end
object zm_Precautions: TcxMemo
Tag = 2
Left = 568
Top = 5
Properties.ScrollBars = ssVertical
TabOrder = 7
Height = 50
Width = 140
end
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 187
Top = 207
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyePlan.ADOLink
Parameters = <>
Left = 284
Top = 206
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyePlan.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 361
Top = 207
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 427
Top = 193
end
object DS_HZ: TDataSource
DataSet = CDS_HZ
Left = 491
Top = 212
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 520
Top = 264
end
object PopupMenu1: TPopupMenu
Left = 146
Top = 311
object N1: TMenuItem
Caption = #20840#36873
end
object N2: TMenuItem
Caption = #20840#24323
end
end
end

View File

@ -0,0 +1,177 @@
unit U_frameYMList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit,
cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxNavigator,
dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData, cxCheckBox,
cxTextEdit, dxBarBuiltInMenu, Vcl.Menus, cxGridCustomPopupMenu,
cxGridPopupMenu, Datasnap.DBClient, Data.Win.ADODB, cxGridLevel,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
cxGridCustomView, cxGrid, Vcl.StdCtrls, Vcl.ComCtrls, Vcl.ToolWin,
Vcl.ExtCtrls, dxSkinsCore, dxSkinsDefaultPainters, cxMemo, cxLabel,
cxMaskEdit, cxDropDownEdit;
type
TframeYMList = class(TFrame)
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
CDS_HZ: TClientDataSet;
DS_HZ: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Panel_zm: TPanel;
LabelYM: TLabel;
Label11: TLabel;
zm_inout: TcxTextEdit;
zm_style: TcxComboBox;
cxLabel336: TcxLabel;
zm_mainElec: TcxTextEdit;
cxLabel344: TcxLabel;
zm_needleHigh: TcxTextEdit;
cxLabel342: TcxLabel;
zm_Precautions: TcxMemo;
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
private
{ Private declarations }
public
procedure InitGrid();
function SaveData(mPSID : string): Boolean;
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint;
{$R *.dfm}
procedure TframeYMList.InitGrid();
begin
// POSNO.SetFocus;
// try
// ADOQueryMain.DisableControls;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// sql.Add(' select A.* from BS_Position A order by POSNO ');
// Open;
// end;
// SCreateCDS(ADOQueryMain, CDS_HZ);
// SInitCDSData(ADOQueryMain, CDS_HZ);
// finally
// ADOQueryMain.EnableControls;
// ToolButton2.Click;
// end;
end;
procedure TframeYMList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TframeYMList.ToolButton5Click(Sender: TObject);
begin
if CDS_HZ.IsEmpty then
Exit;
if CDS_HZ.Locate('SSel', True, []) = False then
begin
Application.MessageBox('请先选择数据!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with CDS_HZ do
begin
while not Eof do
begin
if CDS_HZ.Locate('SSel', True, []) = True then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Position where POSID=' + QuotedStr(CDS_HZ.FieldByName('POSID').AsString));
ExecSQL;
end;
end;
CDS_HZ.Edit;
CDS_HZ.FieldByName('SSel').Value := False;
CDS_HZ.Post;
Next;
end;
end;
InitGrid();
end;
function TframeYMList.SaveData(mPSID : string): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx: string;
begin
try
//////////////// 保存主表 //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(mPSID);
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_zm, 2);
ADOQueryCmd.Post;
end;
//////////////// 保存主表结束 //////////////////////
// FPSID := maxId;
Result := True;
except
Result := False;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
end.

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas</Transaction>
@ -22,13 +22,13 @@
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.979,=D:\Dp10Repo\项目代码\红绿蓝\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.756,D:\Dp10Repo\项目代码\RTBasics\F03染色配方管理\Formula.dproj=D:\Dp10Repo\项目代码\RTBasics\F03染色配方管理\InformationBase.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\D10sxYilanbuyi"/>

View File

@ -25,7 +25,8 @@ uses
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
U_MachTaskList in 'U_MachTaskList.pas' {frmMachTaskList},
U_BS_MachineSel in 'U_BS_MachineSel.pas' {frmBS_MachineSel},
U_DyeProcessDefin in 'U_DyeProcessDefin.pas' {frmDyeProcessDefin};
U_DyeProcessDefin in 'U_DyeProcessDefin.pas' {frmDyeProcessDefin},
U_DyePCDetailsList in 'U_DyePCDetailsList.pas' {frmDyePCDetailsList};
{$R *.res}

View File

@ -139,6 +139,10 @@
<Form>frmDyeProcessDefin</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="U_DyePCDetailsList.pas">
<Form>frmDyePCDetailsList</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -1,30 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.138,=D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\U_DyeOutput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.620,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_MachTaskList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.963,=D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\U_DyeOutputList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.811,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.788,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyeOutputList.dfm=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCList.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.149,=D:\Dp10Repo\public10\ThreeFun\Form\U_ZDYHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.620,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_MachTaskList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.138,=D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\U_DyeOutput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.788,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCList.pas=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyeOutputList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.998,D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\Unit1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.326,D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\DyeProcess.dproj=D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\InformationBase.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.788,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCList.dfm=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyeOutputList.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.998,D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\Unit1.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.788,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyeOutputList.pas=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.326,D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\InformationBase.dproj=D:\Dp10Repo\项目代码\RTBasics\F04染色刷卡\DyeProcess.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>2025/09/13 17:08:13.000.517,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_BS_MachineSel.pas</Transaction>
<Transaction>2025/09/25 15:07:18.000.836,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyeProcessDefin.pas</Transaction>
<Transaction>2025/11/11 15:05:18.000.149,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\Unit2.pas</Transaction>
<Transaction>2025/11/11 15:06:44.000.606,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCDetailsList.dfm=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\Unit2.dfm</Transaction>
<Transaction>2025/11/11 15:06:44.000.606,D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\U_DyePCDetailsList.pas=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F04染色刷卡\Unit2.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\D10sxYilanbuyi"/>
@ -65,5 +68,7 @@
<File Path="U_BS_MachineSel.dfm"/>
<File Path="U_DyeProcessDefin.pas"/>
<File Path="U_DyeProcessDefin.dfm"/>
<File Path="U_DyePCDetailsList.pas"/>
<File Path="U_DyePCDetailsList.dfm"/>
</ProjectSortOrder>
</BorlandProject>

View File

@ -35,7 +35,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
ParentFont = False
ShowCaptions = True
TabOrder = 0
ExplicitTop = 2
object TBRafresh: TToolButton
Left = 0
Top = 0
@ -324,7 +323,7 @@ inherited frmDyeOutputList: TfrmDyeOutputList
Height = 482
Align = alClient
TabOrder = 2
ExplicitTop = 108
ExplicitTop = 97
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -362,7 +361,7 @@ inherited frmDyeOutputList: TfrmDyeOutputList
Width = 94
end
object Tv1Column5: TcxGridDBColumn
Caption = #27969#31243#21345#21495
Caption = #21345#32452#21495
DataBinding.FieldName = 'pcid'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -382,21 +381,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
HeaderAlignmentHorz = taCenter
Width = 95
end
object v1Column2: TcxGridDBColumn
Caption = #23458#25143
DataBinding.FieldName = 'custName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1Column10: TcxGridDBColumn
Caption = #19994#21153#21592
DataBinding.FieldName = 'Saleser'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 81
end
object v2Column1: TcxGridDBColumn
Caption = #20135#21697#21517#31216
DataBinding.FieldName = 'C_Name'
@ -404,20 +388,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
HeaderAlignmentHorz = taCenter
Width = 120
end
object v1Column9: TcxGridDBColumn
Caption = #35268#26684
DataBinding.FieldName = 'C_Spec'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1Column1: TcxGridDBColumn
Caption = #33394#21495
DataBinding.FieldName = 'C_ColorNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column2: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'C_Color'
@ -425,20 +395,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column4: TcxGridDBColumn
Caption = #22411#21495
DataBinding.FieldName = 'C_XINHAO'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 66
end
object Tv1Column7: TcxGridDBColumn
Caption = #26426#21488
DataBinding.FieldName = 'jitaino'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 66
end
object Tv1Column13: TcxGridDBColumn
Caption = #38376#24133
DataBinding.FieldName = 'C_Width'
@ -474,20 +430,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column9: TcxGridDBColumn
Caption = #29677#32452
DataBinding.FieldName = 'StaffName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 94
end
object Tv1Column10: TcxGridDBColumn
Caption = #25805#20316#21592
DataBinding.FieldName = 'Filler2'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column16: TcxGridDBColumn
Caption = #19978#26426#26102#38388
DataBinding.FieldName = 'FillTime'
@ -502,13 +444,6 @@ inherited frmDyeOutputList: TfrmDyeOutputList
HeaderAlignmentHorz = taCenter
Width = 106
end
object Tv1Column17: TcxGridDBColumn
Caption = #36710#23614#38376#24133
DataBinding.FieldName = 'sk_WidthAmplitude'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv1

View File

@ -46,20 +46,14 @@ type
Label10: TLabel;
RMGridReport1: TRMGridReport;
Label16: TLabel;
v1Column2: TcxGridDBColumn;
customerNoName: TEdit;
Label13: TLabel;
v1Column9: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
ywy: TEdit;
Label17: TLabel;
Tv1Column1: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
Tv1Column5: TcxGridDBColumn;
Tv1Column6: TcxGridDBColumn;
Tv1Column8: TcxGridDBColumn;
Tv1Column9: TcxGridDBColumn;
Tv1Column10: TcxGridDBColumn;
Tv1Column11: TcxGridDBColumn;
Tv1Column12: TcxGridDBColumn;
C_Color: TEdit;
@ -77,8 +71,6 @@ type
endTime: TDateTimePicker;
ToolButton1: TToolButton;
Tv1Column3: TcxGridDBColumn;
Tv1Column4: TcxGridDBColumn;
Tv1Column7: TcxGridDBColumn;
Tv1Column13: TcxGridDBColumn;
Tv1Column14: TcxGridDBColumn;
ToolButton2: TToolButton;
@ -88,7 +80,6 @@ type
Button2: TButton;
Edit1: TEdit;
Tv1Column16: TcxGridDBColumn;
Tv1Column17: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -165,7 +156,6 @@ begin
Filtered := False;
// sql.Add('select GOID,A.GlideName,Qty,rollnum,groupName,B.*,a.filler as filler2,a.filltime as filltime2,gotime,QtyUnit,StaffName from Dye_Plan_Glide_OutPut A ');
sql.Add('select * from V_Dye_Plan_Glide_OutPut A');
sql.Add('inner join Dye_Plan_Card B on A.PCID=B.PCID ');
sql.add('where A.GOTime>=''' + trim(mbegdate) + ''' ');
sql.Add('and A.GOTime<''' + trim(menddate) + ''' ');
sql.Add(Msql);

View File

@ -0,0 +1,605 @@
inherited frmDyePCDetailsList: TfrmDyePCDetailsList
Caption = #25490#20135#20449#24687#26126#32454
ClientHeight = 584
ClientWidth = 1180
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Height = -11
Font.Name = 'Tahoma'
OldCreateOrder = True
WindowState = wsMaximized
OnKeyDown = FormKeyDown
ExplicitLeft = -329
ExplicitWidth = 1196
ExplicitHeight = 623
PixelsPerInch = 96
TextHeight = 13
object ToolBar1: TToolBar [0]
Tag = 1
Left = 0
Top = 0
Width = 1180
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 97
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_DyeProcess.ImageList_new32
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_DyeProcess.ImageList_new32
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
ExplicitLeft = -1
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 1
OnClick = TBRafreshClick
end
object TBFind: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #36807#28388
ImageIndex = 0
OnClick = TBFindClick
end
object TBPrint: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #25171#21360
ImageIndex = 21
Visible = False
end
object ToolButton2: TToolButton
Left = 213
Top = 0
AutoSize = True
Caption = #25195#25551#25490#32568
ImageIndex = 2
OnClick = ToolButton2Click
end
object TBExport: TToolButton
Left = 308
Top = 0
AutoSize = True
Caption = #23548#20986'Excel'
ImageIndex = 20
OnClick = TBExportClick
end
object TbUpdateTime: TToolButton
Left = 409
Top = 0
AutoSize = True
Caption = #26356#26032#26102#38388
ImageIndex = 1
OnClick = TbUpdateTimeClick
end
object ToolButton1: TToolButton
Left = 504
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 599
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel1: TPanel [1]
Left = 0
Top = 38
Width = 1180
Height = 64
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = 'CCQX1'
Color = clSkyBlue
TabOrder = 1
ExplicitLeft = -1
object Label3: TLabel
Left = 260
Top = 10
Width = 48
Height = 13
Caption = #27969#31243#21345#21495
end
object Label13: TLabel
Left = 288
Top = 128
Width = 24
Height = 13
Caption = #23458#25143
end
object Label17: TLabel
Left = 440
Top = 128
Width = 36
Height = 13
Caption = #19994#21153#21592
end
object Label7: TLabel
Left = 604
Top = 124
Width = 36
Height = 13
Caption = #33457#22411#21495
end
object Label1: TLabel
Left = 23
Top = 10
Width = 48
Height = 13
Caption = #24320#22987#26102#38388
end
object Label2: TLabel
Left = 23
Top = 36
Width = 48
Height = 13
Caption = #32467#26463#26102#38388
end
object Label4: TLabel
Left = 260
Top = 36
Width = 24
Height = 13
Caption = #35774#22791
end
object pcid: TEdit
Tag = 2
Left = 314
Top = 6
Width = 154
Height = 21
TabOrder = 0
OnChange = pcidChange
end
object customerNoName: TEdit
Tag = 2
Left = 314
Top = 124
Width = 100
Height = 21
TabOrder = 1
OnChange = pcidChange
end
object ywy: TEdit
Tag = 2
Left = 478
Top = 124
Width = 100
Height = 21
TabOrder = 2
OnChange = pcidChange
end
object lbHx: TEdit
Tag = 2
Left = 642
Top = 120
Width = 80
Height = 21
TabOrder = 3
OnChange = pcidChange
end
object BegDate: TDateTimePicker
Left = 88
Top = 6
Width = 89
Height = 21
Date = 45922.000000000000000000
Time = 0.672359988428070200
TabOrder = 4
end
object EndDate: TDateTimePicker
Left = 88
Top = 33
Width = 89
Height = 21
Date = 45912.000000000000000000
Time = 0.672466979165619700
TabOrder = 5
end
object BegTime: TDateTimePicker
Left = 176
Top = 6
Width = 73
Height = 21
Date = 45912.000000000000000000
Time = 0.672359988428070200
Kind = dtkTime
TabOrder = 6
end
object EndTime: TDateTimePicker
Left = 176
Top = 33
Width = 73
Height = 21
Date = 45912.000000000000000000
Time = 0.672466979165619700
Kind = dtkTime
TabOrder = 7
end
object MCNO: TcxButtonEdit
Left = 312
Top = 33
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = MCNOPropertiesButtonClick
TabOrder = 8
Text = #38271#36710#28165#27927#26426
Width = 156
end
object MCName: TEdit
Left = 464
Top = 33
Width = 121
Height = 21
TabOrder = 9
Text = 'CCQX1'
end
end
object MovePanel2: TMovePanel [2]
Left = 351
Top = 244
Width = 289
Height = 49
BevelInner = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -14
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
Visible = False
end
object Panel2: TPanel [3]
Left = 0
Top = 102
Width = 1180
Height = 482
Align = alClient
TabOrder = 3
ExplicitTop = 98
object cxGrid1: TcxGrid
Left = 1
Top = 1
Width = 592
Height = 480
Align = alLeft
TabOrder = 0
ExplicitTop = -4
object Tv1: TcxGridDBTableView
OnKeyDown = Tv1KeyDown
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_1
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.GroupByBox = False
object Tv1PCID: TcxGridDBColumn
Caption = #27969#31243#21345#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1OrderNo: TcxGridDBColumn
Caption = #29983#20135#24037#21333#21495
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1C_Name: TcxGridDBColumn
Caption = #25104#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1PSName: TcxGridDBColumn
Caption = #24037#24207#21517#31216
DataBinding.FieldName = 'GlideName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1CALL_temperature6: TcxGridDBColumn
Caption = '6#'#28201#24230
DataBinding.FieldName = 'ALL_temperature6'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1PCQty: TcxGridDBColumn
Caption = #31859#25968
DataBinding.FieldName = 'PCQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1time: TcxGridDBColumn
Caption = #24635#29992#26102
DataBinding.FieldName = 'time'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1BegTime: TcxGridDBColumn
Caption = #36215#22987#26102#38388
DataBinding.FieldName = 'BegTime'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxDateEditProperties'
Properties.Kind = ckDateTime
Properties.OnValidate = Tv1BegTimePropertiesValidate
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1EndTime: TcxGridDBColumn
Caption = #32467#26463#26102#38388
DataBinding.FieldName = 'EndTime'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxDateEditProperties'
Properties.Kind = ckDateTime
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv1GlideID: TcxGridDBColumn
DataBinding.FieldName = 'GlideID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
end
end
object cxGrid2: TcxGrid
Left = 680
Top = 1
Width = 499
Height = 480
Align = alRight
TabOrder = 1
ExplicitTop = 6
object Tv2: TcxGridDBTableView
OnKeyDown = Tv2KeyDown
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
OnCustomDrawCell = Tv2CustomDrawCell
DataController.DataSource = DS_2
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsView.GroupByBox = False
object cxGridDBColumn1: TcxGridDBColumn
Caption = #27969#31243#21345#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn2: TcxGridDBColumn
Caption = #29983#20135#24037#21333#21495
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn3: TcxGridDBColumn
Caption = #25104#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn4: TcxGridDBColumn
Caption = #24037#24207#21517#31216
DataBinding.FieldName = 'GlideName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn5: TcxGridDBColumn
Caption = '6#'#28201#24230
DataBinding.FieldName = 'ALL_temperature6'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn6: TcxGridDBColumn
Caption = #31859#25968
DataBinding.FieldName = 'PCQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object cxGridDBColumn7: TcxGridDBColumn
Caption = #24635#29992#26102
DataBinding.FieldName = 'time'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv2PC_FLAG: TcxGridDBColumn
Caption = #25490#20135
DataBinding.FieldName = 'PC_FLAG'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv2isComplete: TcxGridDBColumn
Caption = #25253#24037
DataBinding.FieldName = 'isComplete'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 90
end
object Tv2GlideID: TcxGridDBColumn
DataBinding.FieldName = 'GlideID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGridLevel1: TcxGridLevel
GridView = Tv2
end
end
object cxButton1: TcxButton
Left = 599
Top = 6
Width = 75
Height = 25
Caption = '<--'#25490#20135'--'
TabOrder = 2
OnClick = cxButton1Click
end
object cxButton2: TcxButton
Left = 599
Top = 37
Width = 75
Height = 25
Caption = '--'#21462#28040'-->'
TabOrder = 3
OnClick = cxButton2Click
end
object cxButton3: TcxButton
Left = 599
Top = 80
Width = 75
Height = 25
Caption = #19978#31227
TabOrder = 4
end
object cxButton4: TcxButton
Left = 599
Top = 111
Width = 75
Height = 25
Caption = #19979#31227
TabOrder = 5
end
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Left = 193
Top = 360
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Left = 81
Top = 329
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Parameters = <>
Left = 652
Top = 280
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 852
Top = 280
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 468
Top = 264
end
object DS_1: TDataSource
DataSet = CDS_1
Left = 336
Top = 184
end
object GPM1: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
Left = 360
Top = 144
end
object CDS_1: TClientDataSet
Aggregates = <>
Params = <>
Left = 384
Top = 176
end
object RMGridReport1: TRMGridReport
ThreadPrepareReport = True
InitialZoom = pzDefault
PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
DefaultCollate = False
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
PreviewOptions.RulerUnit = rmutScreenPixels
PreviewOptions.RulerVisible = False
PreviewOptions.DrawBorder = False
PreviewOptions.BorderPen.Color = clGray
PreviewOptions.BorderPen.Style = psDash
CompressLevel = rmzcFastest
CompressThread = False
LaterBuildEvents = True
OnlyOwnerDataSet = False
Left = 720
Top = 56
ReportData = {}
end
object cxStyleRepository1: TcxStyleRepository
PixelsPerInch = 96
object cxStyle1: TcxStyle
AssignedValues = [svFont]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
end
end
object DS_2: TDataSource
DataSet = CDS_2
Left = 632
Top = 224
end
object CDS_2: TClientDataSet
Aggregates = <>
Params = <>
Left = 712
Top = 232
end
object GPM2: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 696
Top = 176
end
end

View File

@ -0,0 +1,868 @@
unit U_DyePCDetailsList;
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, cxContainer, cxTextEdit, cxMaskEdit,
Vcl.Menus, cxButtons;
type
TfrmDyePCDetailsList = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBExport: TToolButton;
TBPrint: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DS_1: TDataSource;
GPM1: TcxGridPopupMenu;
Label3: TLabel;
pcid: TEdit;
CDS_1: TClientDataSet;
MovePanel2: TMovePanel;
RMGridReport1: TRMGridReport;
customerNoName: TEdit;
Label13: TLabel;
ywy: TEdit;
Label17: TLabel;
lbHx: TEdit;
Label7: TLabel;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
Label2: TLabel;
BegTime: TDateTimePicker;
EndTime: TDateTimePicker;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
TbUpdateTime: TToolButton;
Panel2: TPanel;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
Tv1PCID: TcxGridDBColumn;
Tv1OrderNo: TcxGridDBColumn;
Tv1C_Name: TcxGridDBColumn;
Tv1PSName: TcxGridDBColumn;
Tv1CALL_temperature6: TcxGridDBColumn;
Tv1PCQty: TcxGridDBColumn;
Tv1time: TcxGridDBColumn;
Tv1BegTime: TcxGridDBColumn;
Tv1EndTime: TcxGridDBColumn;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn2: TcxGridDBColumn;
cxGridDBColumn3: TcxGridDBColumn;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn5: TcxGridDBColumn;
cxGridDBColumn6: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
DS_2: TDataSource;
CDS_2: TClientDataSet;
GPM2: TcxGridPopupMenu;
Tv2PC_FLAG: TcxGridDBColumn;
Tv2isComplete: TcxGridDBColumn;
MCNO: TcxButtonEdit;
MCName: TEdit;
Label4: TLabel;
cxButton1: TcxButton;
cxButton2: TcxButton;
cxButton3: TcxButton;
cxButton4: TcxButton;
Tv1GlideID: TcxGridDBColumn;
Tv2GlideID: TcxGridDBColumn;
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);
procedure ToolButton2Click(Sender: TObject);
procedure tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure TbUpdateTimeClick(Sender: TObject);
procedure MCNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure Tv2KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure Tv1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure cxButton1Click(Sender: TObject);
procedure Tv2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure cxButton2Click(Sender: TObject);
procedure Tv1BegTimePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
private
FLeft, FTop: Integer;
procedure InitGrid1();
procedure InitGrid2();
function SaveData(): boolean;
function GetLastLine(const AText: string): string;
{ Private declarations }
public
fsyrName, canshu1: string;
{ Public declarations }
end;
var
frmDyePCDetailsList: TfrmDyePCDetailsList;
implementation
uses
U_DataLink, U_RTFun, U_ZDYHelp, U_MachTaskList, U_BS_MachineSel;
{$R *.dfm}
procedure TfrmDyePCDetailsList.FormDestroy(Sender: TObject);
begin
inherited;
frmDyePCDetailsList := nil;
end;
procedure TfrmDyePCDetailsList.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
case Key of
VK_ESCAPE:
begin
Key := 0; // 清除按键,防止继续传递
Close;
end;
end;
end;
function TfrmDyePCDetailsList.SaveData(): boolean;
var
mLoopNum: Integer;
mMCName, mNewValue, mStartTime: string;
mEndTime, mBegTime: string;
begin
result := false;
ADOQueryCmd.Connection.BeginTrans;
try
mLoopNum := StrToInt(CDS_1.FieldByName('Time').AsString) div 10;
if (MCNO.Text <> '') and (CDS_1.FieldByName('BegTime').AsString <> '') then
begin
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add(' update Dye_Plan_Glide set PC_FLAG = 1 , EndTime = DATEADD(MINUTE, ' + CDS_1.FieldByName('time').AsString + ', ' + QuotedStr(trim(CDS_1.FieldByName('BegTime').AsString)) + ')');
SQL.Add(' , begTime = ' + QuotedStr(Trim(CDS_1.FieldByName('BegTime').AsString)));
SQL.Add(' , MCNO = ' + QuotedStr(Trim(MCNO.Text)));
SQL.Add(' , MCName = ' + QuotedStr(MCName.Text));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(CDS_1.FieldByName('GlideID').asString)));
// ShowMessage(sql.Text);
ExecSQL;
end;
mMCName := MCName.Text;
mStartTime := CDS_1.FieldByName('BegTime').AsString;
// mNewValue := '计划单:' + CDS_1.FieldByName('OrderNo').AsString + #13;
mNewValue := mNewValue + CDS_1.FieldByName('C_Name').AsString + #13;
mNewValue := mNewValue + '成品门幅:' + CDS_1.FieldByName('C_Width').AsString + #13;
mNewValue := mNewValue + '工序 刮胶次数:' + CDS_1.FieldByName('GlideName').AsString;
if CDS_1.FieldByName('PSType').AsString = '长车清洗' then
begin
mNewValue := mNewValue + '' + #13;
mNewValue := mNewValue + '车速:' + CDS_1.FieldByName('ccqx_speed').AsString + #13;
mNewValue := mNewValue + '温度6#:' + CDS_1.FieldByName('ccqx_temperature6').AsString + #13;
end
else if CDS_1.FieldByName('PSType').AsString = '干定型' then
begin
mNewValue := mNewValue + '' + #13;
mNewValue := mNewValue + '车速:' + CDS_1.FieldByName('dx_speed').AsString + #13;
mNewValue := mNewValue + '温度6#:' + CDS_1.FieldByName('dx_temperature6').AsString + #13;
end
else if CDS_1.FieldByName('PSType').AsString = '下水定型' then
begin
mNewValue := mNewValue + '' + #13;
mNewValue := mNewValue + '车速:' + CDS_1.FieldByName('fs_speed').AsString + #13;
mNewValue := mNewValue + '温度6#:' + CDS_1.FieldByName('fs_temperature6').AsString + #13;
end
else if CDS_1.FieldByName('PSType').AsString = '刮胶' then
begin
mNewValue := mNewValue + '' + CDS_1.FieldByName('gj_number').AsString + #13;
mNewValue := mNewValue + '车速:' + CDS_1.FieldByName('gj_speed').AsString + #13;
mNewValue := mNewValue + '温度6#:' + CDS_1.FieldByName('gj_temperature6').AsString + #13;
end
else if CDS_1.FieldByName('PSType').AsString = '发泡' then
begin
mNewValue := mNewValue + ' ' + CDS_1.FieldByName('fp_gjNumber').AsString + #13;
mNewValue := mNewValue + '车速:' + CDS_1.FieldByName('fp_speed').AsString + #13;
mNewValue := mNewValue + '温度6#:' + CDS_1.FieldByName('fp_temperature6').AsString + #13;
end
else
begin
mNewValue := mNewValue + '' + #13;
end;
//////////////////////显示助剂
mNewValue := mNewValue + '助剂:' + CDS_1.FieldByName('All_zhuji').AsString + #13;
mNewValue := mNewValue + CDS_1.FieldByName('PCID').AsString + #13;
mNewValue := mNewValue + CDS_1.FieldByName('GlideID').AsString;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('EXEC P_PC_UpdatePCAboutTime ' + '@MCName = :MCName, ' + '@NewValue = :NewValue, ' + '@StartTime = :StartTime, ' + '@LoopNum = :LoopNum');
Parameters.ParamByName('MCName').Value := mMCName;
Parameters.ParamByName('NewValue').Value := mNewValue;
Parameters.ParamByName('StartTime').Value := mStartTime;
Parameters.ParamByName('LoopNum').Value := mLoopNum;
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('select * from PCAboutTime ');
SQL.Add(' where time >= ' + quotedStr(Trim(mStartTime)));
Open;
end;
ADOQueryCmd.First;
mNewValue := ADOQueryCmd.FieldByName(mMCName).AsString;
mBegTime := ADOQueryCmd.FieldByName('time').AsString;
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
while not ADOQueryCmd.Eof do
begin
if (ADOQueryCmd.FieldByName(mMCName).AsString = null) or (ADOQueryCmd.FieldByName(mMCName).AsString = '') then
begin
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('update Dye_Plan_Glide set BegTime = ' + QuotedStr(Trim(mBegTime)));
sql.Add(' , EndTime = ' + QuotedStr(Trim(mEndTime)));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(GetLastLine(mNewValue))));
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
result := true;
Exit;
end;
if mNewValue <> ADOQueryCmd.FieldByName(mMCName).AsString then
begin
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('update Dye_Plan_Glide set BegTime = ' + QuotedStr(Trim(mBegTime)));
sql.Add(' , EndTime = ' + QuotedStr(Trim(mEndTime)));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(GetLastLine(mNewValue))));
ExecSQL;
end;
mBegTime := ADOQueryCmd.FieldByName('time').AsString;
mNewValue := ADOQueryCmd.FieldByName(mMCName).AsString;
end;
ADOQueryCmd.Next;
end;
end;
ADOQueryCmd.Connection.CommitTrans;
result := true;
except
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
result := false;
end;
end;
function TfrmDyePCDetailsList.GetLastLine(const AText: string): string;
var
StringList: TStringList;
begin
Result := '';
StringList := TStringList.Create;
try
StringList.Text := AText; // 自动按回车分割
if StringList.Count > 0 then
Result := StringList[StringList.Count - 1]; // 获取最后一行
finally
StringList.Free;
end;
end;
procedure TfrmDyePCDetailsList.cxButton1Click(Sender: TObject);
begin
if CDS_2.FieldByName('PC_FLAG').AsString = '1' then
begin
Application.MessageBox('工序已排产!', '提示信息', MB_OK);
exit;
end
else if CDS_2.FieldByName('isComplete').AsString <> '' then
begin
Application.MessageBox('工序已报工!', '提示信息', MB_OK);
exit;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryMain do
begin
close;
filtered := false;
sql.Clear;
SQL.Add('select Max(EndTime) as MaxTime from V_Dye_Cloth_PaiGang where (BegTime between :StartTime and :EndTime) and PC_FLAG = 1 and MCNO = :MCNO ');
Parameters.ParamByName('StartTime').Value := Trunc(BegDate.Date) + Frac(BegTime.Time);
Parameters.ParamByName('EndTime').Value := Trunc(EndDate.Date) + Frac(EndTime.Time);
Parameters.ParamByName('MCNO').Value := MCNO.Text;
Open;
end;
with CDS_1 do
begin
append;
FieldByName('PCID').value := CDS_2.FieldByName('PCID').AsString;
FieldByName('OrderNo').value := CDS_2.FieldByName('OrderNo').AsString;
FieldByName('GlideName').value := CDS_2.FieldByName('GlideName').AsString;
FieldByName('C_name').value := CDS_2.FieldByName('C_name').AsString;
FieldByName('ALL_temperature6').value := CDS_2.FieldByName('ALL_temperature6').AsString;
FieldByName('time').value := CDS_2.FieldByName('time').AsString;
FieldByName('GlideID').value := CDS_2.FieldByName('GlideID').AsString;
FieldByName('PCQty').value := CDS_2.FieldByName('PCQty').AsString;
FieldByName('begTime').value := ADOQueryMain.FieldByName('MaxTime').AsString;
Post;
end;
ADOQueryCmd.Connection.CommitTrans;
except
if ADOQueryCmd.Connection.InTransaction then
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
// showMessage('插入任务数据时发生错误!');
end;
if SaveData() then
begin
Application.MessageBox('排产成功', '提示信息!', MB_OK);
end;
initGrid1();
end;
procedure TfrmDyePCDetailsList.cxButton2Click(Sender: TObject);
begin
if MessageDlg('确定取消?此操作无法撤销!', mtWarning, [mbOK, mbCancel], 0) = mrOK then
begin
// 开始事务
ADOQueryCmd.Connection.BeginTrans;
try
// 第一个更新操作
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('UPDATE PCAboutTime SET ');
SQL.Add(MCName.Text + ' = null WHERE ');
SQL.Add(' time >= ' + QuotedStr(CDS_1.FieldByName('BegTime').AsString));
SQL.Add(' and time < ' + QuotedStr(CDS_1.FieldByName('EndTime').AsString));
showMessage(sql.Text);
ExecSQL;
end;
// 第二个更新操作
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add(' update Dye_Plan_Glide set PC_FLAG = 0,endTime = null,begTime = null where GlideID = ' + QuotedStr(Trim(CDS_1.FieldByName('GlideID').asString)));
ExecSQL;
end;
// 两个操作都成功,提交事务
ADOQueryCmd.Connection.CommitTrans;
Application.MessageBox('取消成功!', '提示', 0);
InitGrid1();
except
on E: Exception do
begin
// 发生异常,回滚事务
ADOQueryCmd.Connection.RollbackTrans;
ShowMessage('操作失败:' + E.Message);
end;
end;
end;
end;
procedure TfrmDyePCDetailsList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyePCDetailsList.FormCreate(Sender: TObject);
begin
inherited;
// EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
// BegDate.DateTime := EndDate.DateTime;
fsyrName := trim(DdataBase);
canshu1 := trim(DParameters1);
// SInitComBoxBySql(ADOQueryTemp, GlideName, false, 'select PSName as Name from Dye_Process');
end;
procedure TfrmDyePCDetailsList.InitGrid1();
var
mBegDate, mendDate: string;
mAction: string;
rs: _Recordset;
r: integer;
begin
// 任务时间
try
tv1.BeginUpdate;
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
close;
filtered := false;
sql.Clear;
SQL.Add('select * from V_Dye_Cloth_PaiGang where (BegTime between :StartTime and :EndTime) and PC_FLAG = 1 and MCNO = :MCNO order By BegTime ');
Parameters.ParamByName('StartTime').Value := Trunc(BegDate.Date) + Frac(BegTime.Time);
Parameters.ParamByName('EndTime').Value := Trunc(EndDate.Date) + Frac(EndTime.Time);
Parameters.ParamByName('MCNO').Value := MCNO.Text;
Open;
end;
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
finally
ADOQueryMain.EnableControls;
tv1.EndUpdate;
// tv1.ApplyBestFit();
end;
end;
procedure TfrmDyePCDetailsList.InitGrid2();
var
mBegDate, mendDate: string;
mAction: string;
rs: _Recordset;
r: integer;
begin
// 任务时间
try
tv1.BeginUpdate;
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
close;
filtered := false;
sql.Clear;
SQL.Add('select * from V_Dye_Cloth_PaiGang');
Open;
end;
SCreateCDS(ADOQueryMain, CDS_2);
SInitCDSData(ADOQueryMain, CDS_2);
finally
ADOQueryMain.EnableControls;
tv1.EndUpdate;
// tv1.ApplyBestFit();
end;
end;
procedure TfrmDyePCDetailsList.MCNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmBS_MachineSel := TfrmBS_MachineSel.Create(Application);
with frmBS_MachineSel do
begin
if ShowModal = 1 then
begin
MCNO.Text := frmBS_MachineSel.Order_Main.FieldByName('MCNO').Value;
MCName.Text := frmBS_MachineSel.Order_Main.FieldByName('MCName').Value;
Self.InitGrid1();
end;
end;
finally
frmBS_MachineSel.Free;
end;
end;
procedure TfrmDyePCDetailsList.TBRafreshClick(Sender: TObject);
begin
MovePanel2.Visible := True;
MovePanel2.Refresh;
InitGrid1();
InitGrid2();
MovePanel2.Visible := False;
end;
procedure TfrmDyePCDetailsList.TbUpdateTimeClick(Sender: TObject);
var
DeletedCount, InsertedCount: Integer;
Status, StartDate, EndDate: string;
begin
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add('exec P_InsertDelTimeToPC @MinuteInterval = 10');
Open;
if not IsEmpty then
begin
Status := FieldByName('状态').AsString;
DeletedCount := FieldByName('删除记录数').AsInteger;
InsertedCount := FieldByName('插入记录数').AsInteger;
StartDate := FieldByName('保留开始时间').AsString;
EndDate := FieldByName('保留结束时间').AsString;
ShowMessage(Format('时间数据更新成功!' + #13#10 + '删除记录:%d 条' + #13#10 + '插入记录:%d 条' + #13#10 + '时间范围:%s 至 %s', [DeletedCount, InsertedCount, StartDate, EndDate]));
end
else
begin
ShowMessage('时间数据更新完成!');
end;
Close;
end;
end;
procedure TfrmDyePCDetailsList.ToolButton1Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + tv1.Name, Tv1, '排产信息');
end;
procedure TfrmDyePCDetailsList.ToolButton2Click(Sender: TObject);
begin
// if ADOQuerymain.IsEmpty then
// exit;
frmMachTaskList := TfrmMachTaskList.create(self);
with frmMachTaskList do
begin
// fcurMachId := trim(self.adoquerymain.FieldByName('mcid').AsString);
// machName.text := trim(self.adoquerymain.FieldByName('mcName').AsString);
showModal;
free;
end;
initgrid1();
end;
procedure TfrmDyePCDetailsList.Tv1BegTimePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
var
Begtime: TDateTime;
Hour, Min, Sec, MSec: Word;
begin
try
// 使用 DisplayValue 而不是 Sender.AsString
if VarIsNull(DisplayValue) or (DisplayValue = '') then
Exit;
Begtime := VarToDateTime(DisplayValue);
DecodeTime(Begtime, Hour, Min, Sec, MSec);
if Sec <> 0 then
begin
ErrorText := '开始时间秒数必须为 0';
Error := True; // 设置错误标志
end
else if (Min mod 10) <> 0 then // 添加分钟验证
begin
ErrorText := '开始时间分钟必须为 10 的倍数!当前分钟为:' + IntToStr(Min);
Error := True;
end
else
begin
Error := False; // 清除错误标志
end;
except
on E: Exception do
begin
ErrorText := '时间格式错误:' + E.Message;
Error := True;
end;
end;
end;
procedure TfrmDyePCDetailsList.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_1.FieldByName('time').AsString;
fMCName := Self.Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
fText := self.CDS_1.FieldByName(fMCName).AsString;
showModal;
free;
end;
initgrid1();
end;
procedure TfrmDyePCDetailsList.tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
inherited;
ACanvas.Font.Size := 7;
end;
procedure TfrmDyePCDetailsList.Tv1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
case Key of
VK_LEFT:
begin
// 左方向键被按下
ShowMessage('左方向键');
// 执行向左移动的代码
end;
VK_RIGHT:
begin
// 右方向键被按下
ShowMessage('右方向键');
// 执行向右移动的代码
end;
VK_UP:
begin
// 上方向键被按下
ShowMessage('上方向键');
// 执行向上移动的代码
end;
VK_DOWN:
begin
// 下方向键被按下
ShowMessage('下方向键');
// 执行向下移动的代码
end;
end;
end;
procedure TfrmDyePCDetailsList.Tv2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
PC_FLAG, isComplete: Variant;
begin
// 获取字段值
PC_FLAG := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('PC_FLAG').Index];
isComplete := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('isComplete').Index];
// 设置不同状态的颜色和字体
if VarIsNull(PC_FLAG) or (PC_FLAG = 0) then // 未排入计划单
begin
ACanvas.Brush.Color := $00CCCCFF; // 浅红色背景
ACanvas.Font.Color := clRed;
ACanvas.Font.Style := [fsBold];
end
else if (PC_FLAG = 1) and VarIsNull(isComplete) then // 排入未报工
begin
ACanvas.Brush.Color := clWindow; // 默认窗口背景色
ACanvas.Font.Color := clWindowText; // 默认窗口文本色
ACanvas.Font.Style := [];
end
else if (PC_FLAG = 1) and (not VarIsNull(isComplete)) and (isComplete = 0) then // 生产一部分
begin
ACanvas.Brush.Color := $00E0E0E0; // 浅灰色背景
ACanvas.Font.Color := clGray;
ACanvas.Font.Style := [fsBold]; //
end
else if (PC_FLAG = 1) and (not VarIsNull(isComplete)) and (isComplete = 1) then // 成品入库
begin
ACanvas.Brush.Color := $00E0FFE0; // 浅绿色背景
ACanvas.Font.Color := $00008000;
ACanvas.Font.Style := [fsBold];
end
else // 默认情况
begin
ACanvas.Brush.Color := clWindow;
ACanvas.Font.Color := clWindowText;
ACanvas.Font.Style := [];
end;
// 如果需要自定义绘制完成,取消下面的注释
// ADone := True;
end;
procedure TfrmDyePCDetailsList.Tv2KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
case Key of
VK_LEFT:
begin
// 左方向键被按下
ShowMessage('左方向键');
// 执行向左移动的代码
end;
VK_RIGHT:
begin
// 右方向键被按下
ShowMessage('右方向键');
// 执行向右移动的代码
end;
VK_UP:
begin
// 上方向键被按下
ShowMessage('上方向键');
// 执行向上移动的代码
end;
VK_DOWN:
begin
// 下方向键被按下
ShowMessage('下方向键');
// 执行向下移动的代码
end;
end;
end;
procedure TfrmDyePCDetailsList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmDyePCDetailsList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyePCDetailsList.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(self.Caption + tv1.Name, Tv1, '排产信息明细');
ReadCxGrid(self.Caption + tv2.Name, Tv2, '排产信息明细');
canshu1 := self.fParameters1;
// 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);
BegDate.Date := Trunc(ServerDate) - 1; // 前一天
EndDate.Date := Trunc(ServerDate) + 1; // 后一天
Begtime.Time := EncodeTime(0, 0, 0, 0); // 早上8
endTime.Time := EncodeTime(0, 0, 0, 0); // 晚上6
initgrid1();
initgrid2();
KeyPreview := True;
end;
procedure TfrmDyePCDetailsList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel(self.Caption, cxGrid1);
end;
procedure TfrmDyePCDetailsList.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
end;
end;
procedure TfrmDyePCDetailsList.pcidChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyePCDetailsList.PRTColorChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyePCDetailsList.TBdelClick(Sender: TObject);
begin
if CDS_1.IsEmpty then
Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
try
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('insert into Dye_Need_Up(UType,UDataId) values(''机台刷卡'',' + quotedstr(Trim(CDS_1.fieldbyname('GOID').AsString)) + ') ');
sql.Add('delete Dye_Plan_Glide_OutPut where GOID=''' + Trim(CDS_1.fieldbyname('GOID').AsString) + '''');
ExecSQL;
end;
////////////////// 更新进度 //////////////////
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('exec P_Dye_Card_upCL @PCID=' + QuotedStr(CDS_1.fieldbyname('pcid').AsString));
execsql;
end;
////////////////// 更新进度 //////////////////
CDS_1.Delete;
except
application.MessageBox('删除失败!', '提示信息', 0);
end;
end;
end.

View File

@ -8,7 +8,6 @@ inherited frmDyePCList: TfrmDyePCList
Font.Name = 'Tahoma'
OldCreateOrder = True
WindowState = wsMaximized
ExplicitLeft = -329
ExplicitWidth = 1196
ExplicitHeight = 623
PixelsPerInch = 96
@ -76,16 +75,24 @@ inherited frmDyePCList: TfrmDyePCList
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton1: TToolButton
object TbUpdateTime: TToolButton
Left = 409
Top = 0
AutoSize = True
Caption = #26356#26032#26102#38388
ImageIndex = 1
OnClick = TbUpdateTimeClick
end
object ToolButton1: TToolButton
Left = 504
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 504
Left = 599
Top = 0
AutoSize = True
Caption = #20851#38381
@ -243,6 +250,12 @@ inherited frmDyePCList: TfrmDyePCList
Width = 1180
Height = 482
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 3
LookAndFeel.ScrollbarMode = sbmHybrid
LookAndFeel.ScrollMode = scmDefault
@ -254,6 +267,7 @@ inherited frmDyePCList: TfrmDyePCList
FindPanel.UseExtendedSyntax = True
ScrollbarAnnotations.CustomAnnotations = <>
OnCellDblClick = tv1CellDblClick
OnCustomDrawCell = tv1CustomDrawCell
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
@ -263,12 +277,12 @@ inherited frmDyePCList: TfrmDyePCList
DateTimeHandling.Grouping = dtgByDate
OptionsData.Deleting = False
OptionsData.Inserting = False
OptionsView.CellAutoHeight = True
OptionsView.ColumnAutoWidth = True
OptionsView.DataRowHeight = 40
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
OptionsView.IndicatorWidth = 30
Styles.Content = cxStyle1
Styles.Selection = DataLink_DyeProcess.SHuangSe
object tv1CraftIdx: TcxGridDBColumn
DataBinding.FieldName = 'CraftIdx'
@ -284,7 +298,7 @@ inherited frmDyePCList: TfrmDyePCList
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.Focusing = False
Width = 88
Width = 72
end
object tv1CCQX1: TcxGridDBColumn
Tag = 99
@ -294,7 +308,7 @@ inherited frmDyePCList: TfrmDyePCList
HeaderAlignmentHorz = taCenter
Options.CellMerging = True
Styles.OnGetContentStyle = tv1CCQX1StylesGetContentStyle
Width = 109
Width = 88
OnCompareRowValuesForCellMerging = tv1CCQX1CompareRowValuesForCellMerging
end
object tv1DX1: TcxGridDBColumn
@ -304,7 +318,7 @@ inherited frmDyePCList: TfrmDyePCList
HeaderAlignmentHorz = taCenter
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX1StylesGetContentStyle
Width = 125
Width = 101
OnCompareRowValuesForCellMerging = tv1DX1CompareRowValuesForCellMerging
end
object tv1DX2: TcxGridDBColumn
@ -315,7 +329,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX2StylesGetContentStyle
Width = 114
Width = 93
OnCompareRowValuesForCellMerging = tv1DX2CompareRowValuesForCellMerging
end
object tv1DX3: TcxGridDBColumn
@ -326,7 +340,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX3StylesGetContentStyle
Width = 117
Width = 94
OnCompareRowValuesForCellMerging = tv1DX3CompareRowValuesForCellMerging
end
object tv1DX4: TcxGridDBColumn
@ -337,7 +351,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX4StylesGetContentStyle
Width = 109
Width = 89
OnCompareRowValuesForCellMerging = tv1DX4CompareRowValuesForCellMerging
end
object tv1DX5: TcxGridDBColumn
@ -348,7 +362,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX5StylesGetContentStyle
Width = 103
Width = 83
OnCompareRowValuesForCellMerging = tv1DX5CompareRowValuesForCellMerging
end
object tv1DX6: TcxGridDBColumn
@ -359,7 +373,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1DX6StylesGetContentStyle
Width = 100
Width = 81
OnCompareRowValuesForCellMerging = tv1DX6CompareRowValuesForCellMerging
end
object tv1JG1: TcxGridDBColumn
@ -370,7 +384,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1JG1StylesGetContentStyle
Width = 100
Width = 81
OnCompareRowValuesForCellMerging = tv1JG1CompareRowValuesForCellMerging
end
object tv1JRG1: TcxGridDBColumn
@ -381,7 +395,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1JRG1StylesGetContentStyle
Width = 100
Width = 81
OnCompareRowValuesForCellMerging = tv1JRG1CompareRowValuesForCellMerging
end
object tv1JRG2: TcxGridDBColumn
@ -392,7 +406,7 @@ inherited frmDyePCList: TfrmDyePCList
Options.FilteringPopupIncrementalFiltering = True
Options.CellMerging = True
Styles.OnGetContentStyle = tv1JRG2StylesGetContentStyle
Width = 100
Width = 81
OnCompareRowValuesForCellMerging = tv1JRG2CompareRowValuesForCellMerging
end
object tv1JRG3: TcxGridDBColumn
@ -402,7 +416,7 @@ inherited frmDyePCList: TfrmDyePCList
HeaderAlignmentHorz = taCenter
Options.CellMerging = True
Styles.OnGetContentStyle = tv1JRG3StylesGetContentStyle
Width = 100
Width = 81
OnCompareRowValuesForCellMerging = tv1JRG3CompareRowValuesForCellMerging
end
object tv1GC_BatchNo: TcxGridDBColumn
@ -442,6 +456,20 @@ inherited frmDyePCList: TfrmDyePCList
HeaderAlignmentHorz = taCenter
Width = 80
end
object tv1ZM1: TcxGridDBColumn
Caption = #36711#27611#26426'1'
DataBinding.FieldName = 'ZM1'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 61
end
object tv1ZM2: TcxGridDBColumn
Caption = #36711#27611#26426'2'
DataBinding.FieldName = 'ZM2'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 60
end
end
object dbGrid1Level1: TcxGridLevel
GridView = tv1
@ -513,4 +541,15 @@ inherited frmDyePCList: TfrmDyePCList
Top = 56
ReportData = {}
end
object cxStyleRepository1: TcxStyleRepository
PixelsPerInch = 96
object cxStyle1: TcxStyle
AssignedValues = [svFont]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
end
end
end

View File

@ -67,6 +67,11 @@ type
tv1PCKey: TcxGridDBColumn;
BegTime: TDateTimePicker;
EndTime: TDateTimePicker;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
tv1ZM1: TcxGridDBColumn;
tv1ZM2: TcxGridDBColumn;
TbUpdateTime: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -94,36 +99,18 @@ type
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);
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);
procedure tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure TbUpdateTimeClick(Sender: TObject);
private
FLeft, FTop: Integer;
@ -211,6 +198,41 @@ begin
MovePanel2.Visible := False;
end;
procedure TfrmDyePCList.TbUpdateTimeClick(Sender: TObject);
var
DeletedCount, InsertedCount: Integer;
Status, StartDate, EndDate: string;
begin
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add('exec P_InsertDelTimeToPC @MinuteInterval = 10');
Open;
if not IsEmpty then
begin
Status := FieldByName('状态').AsString;
DeletedCount := FieldByName('删除记录数').AsInteger;
InsertedCount := FieldByName('插入记录数').AsInteger;
StartDate := FieldByName('保留开始时间').AsString;
EndDate := FieldByName('保留结束时间').AsString;
ShowMessage(Format('时间数据更新成功!' + #13#10 +
'删除记录:%d 条' + #13#10 +
'插入记录:%d 条' + #13#10 +
'时间范围:%s 至 %s',
[DeletedCount, InsertedCount, StartDate, EndDate]));
end
else
begin
ShowMessage('时间数据更新完成!');
end;
Close;
end;
end;
procedure TfrmDyePCList.ToolButton1Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + tv1.Name, Tv1, 'ÅŲúÐÅÏ¢');
@ -249,6 +271,12 @@ begin
initgrid();
end;
procedure TfrmDyePCList.tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
inherited;
ACanvas.Font.Size := 7;
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
@ -257,9 +285,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX5StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX5StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -276,9 +302,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -293,9 +322,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX2StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -312,9 +339,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -329,9 +359,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX3StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX3StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -348,9 +376,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -365,8 +396,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -383,9 +413,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -423,9 +456,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1CCQX1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1CCQX1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -442,9 +473,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -459,9 +493,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX4StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX4StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -478,9 +510,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -495,9 +530,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1DX6StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1DX6StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -514,9 +547,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -531,9 +567,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JG1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1JG1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -550,9 +584,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -568,9 +605,7 @@ begin
end;
procedure TfrmDyePCList.tv1JRG1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1JRG1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -587,9 +622,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -604,9 +642,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JRG2StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1JRG2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -623,9 +659,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;
@ -640,9 +679,7 @@ begin
AAreEqual := False;
end;
procedure TfrmDyePCList.tv1JRG3StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
procedure TfrmDyePCList.tv1JRG3StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle);
var
GroupValue: string;
ColorValue: Integer;
@ -659,9 +696,12 @@ begin
ColorValue := StrToInt(Copy(GroupValue, Length(GroupValue), 1));
AStyle := TcxStyle.Create(nil);
case ColorValue mod 3 of
0: AStyle.Color := $00CCFFFF; // µ­»ÆÉ«
1: AStyle.Color := $00CCFFCC; // µ­ÂÌÉ«
2: AStyle.Color := $00FFCCCC; // µ­À¶É«
0:
AStyle.Color := $00CCFFFF; // 淡黄色
1:
AStyle.Color := $00CCFFCC; // 淡绿色
2:
AStyle.Color := $00FFCCCC; // 淡蓝色
end;
AStyle.TextColor := clBlack;
end;

View File

@ -0,0 +1,538 @@
inherited frmDyePCMachineList: TfrmDyePCMachineList
Caption = #25490#20135#20449#24687
ClientHeight = 584
ClientWidth = 1180
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Height = -16
Font.Name = 'Tahoma'
OldCreateOrder = True
WindowState = wsMaximized
ExplicitWidth = 1196
ExplicitHeight = 623
PixelsPerInch = 96
TextHeight = 19
object ToolBar1: TToolBar [0]
Tag = 1
Left = 0
Top = 0
Width = 1180
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 97
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_DyeProcess.ImageList_new32
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_DyeProcess.ImageList_new32
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 1
OnClick = TBRafreshClick
end
object TBFind: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #36807#28388
ImageIndex = 0
OnClick = TBFindClick
end
object TBPrint: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #25171#21360
ImageIndex = 21
Visible = False
end
object ToolButton2: TToolButton
Left = 213
Top = 0
AutoSize = True
Caption = #25195#25551#25490#32568
ImageIndex = 2
OnClick = ToolButton2Click
end
object TbAdd: TToolButton
Left = 308
Top = 0
AutoSize = True
Caption = #22686#34892
ImageIndex = 2
OnClick = TbAddClick
end
object TbDel: TToolButton
Left = 379
Top = 0
AutoSize = True
Caption = #21024#34892
ImageIndex = 6
OnClick = TbDelClick
end
object TBExport: TToolButton
Left = 450
Top = 0
AutoSize = True
Caption = #23548#20986'Excel'
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton1: TToolButton
Left = 551
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 646
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel1: TPanel [1]
Left = 0
Top = 38
Width = 1180
Height = 64
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
object Label3: TLabel
Left = 288
Top = 28
Width = 32
Height = 19
Caption = #35774#22791
end
object Label13: TLabel
Left = 288
Top = 128
Width = 32
Height = 19
Caption = #23458#25143
end
object Label17: TLabel
Left = 440
Top = 128
Width = 48
Height = 19
Caption = #19994#21153#21592
end
object Label7: TLabel
Left = 604
Top = 124
Width = 48
Height = 19
Caption = #33457#22411#21495
end
object Label1: TLabel
Left = 23
Top = 6
Width = 64
Height = 19
Caption = #24320#22987#26102#38388
end
object Label2: TLabel
Left = 23
Top = 40
Width = 64
Height = 19
Caption = #32467#26463#26102#38388
end
object customerNoName: TEdit
Tag = 2
Left = 314
Top = 124
Width = 100
Height = 27
TabOrder = 0
OnChange = pcidChange
end
object ywy: TEdit
Tag = 2
Left = 478
Top = 124
Width = 100
Height = 27
TabOrder = 1
OnChange = pcidChange
end
object lbHx: TEdit
Tag = 2
Left = 642
Top = 120
Width = 80
Height = 27
TabOrder = 2
OnChange = pcidChange
end
object BegDate: TDateTimePicker
Left = 88
Top = 6
Width = 89
Height = 27
Date = 45922.000000000000000000
Time = 0.672359988428070200
TabOrder = 3
end
object EndDate: TDateTimePicker
Left = 88
Top = 33
Width = 89
Height = 27
Date = 45912.000000000000000000
Time = 0.672466979165619700
TabOrder = 4
end
object BegTime: TDateTimePicker
Left = 176
Top = 6
Width = 73
Height = 27
Date = 45912.000000000000000000
Time = 0.672359988428070200
Kind = dtkTime
TabOrder = 5
end
object EndTime: TDateTimePicker
Left = 176
Top = 33
Width = 73
Height = 27
Date = 45912.000000000000000000
Time = 0.672466979165619700
Kind = dtkTime
TabOrder = 6
end
object MCNO: TComboBox
Left = 318
Top = 24
Width = 145
Height = 27
TabOrder = 7
OnChange = MCNOChange
Items.Strings = (
#38271#36710#28165#27927#26426
#23450#22411#19968#21495#26426
#23450#22411#20108#21495#26426
#23450#22411#19977#21495#26426
#23450#22411#22235#21495#26426
#23450#22411#20116#21495#26426
#23450#22411#20845#21495#26426
#26426#32568
#21367#26579#32568'1'
#21367#26579#32568'2'
#21367#26579#32568'3'
#36711#27611#26426'1'
#36711#27611#26426'2')
end
object MCName: TEdit
Left = 551
Top = 31
Width = 121
Height = 27
TabOrder = 8
Visible = False
end
end
object MovePanel2: TMovePanel [2]
Left = 351
Top = 244
Width = 289
Height = 49
BevelInner = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -14
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
Visible = False
end
object dbGrid1: TcxGrid [3]
Left = 0
Top = 102
Width = 1180
Height = 482
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 3
LookAndFeel.ScrollbarMode = sbmHybrid
LookAndFeel.ScrollMode = scmDefault
object tv1: TcxGridDBTableView
Tag = 9999
DragMode = dmAutomatic
Navigator.Buttons.CustomButtons = <>
FindPanel.DisplayMode = fpdmAlways
FindPanel.UseExtendedSyntax = True
ScrollbarAnnotations.CustomAnnotations = <>
OnCellDblClick = tv1CellDblClick
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
DateTimeHandling.Grouping = dtgByDate
OptionsData.Appending = True
OptionsData.Inserting = False
OptionsView.ColumnAutoWidth = True
OptionsView.DataRowHeight = 40
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
OptionsView.IndicatorWidth = 30
Styles.Content = cxStyle1
Styles.Selection = DataLink_DyeProcess.SHuangSe
object tv1CraftIdx: TcxGridDBColumn
DataBinding.FieldName = 'CraftIdx'
DataBinding.IsNullValueType = True
Visible = False
end
object tv1mcName: TcxGridDBColumn
Caption = #27969#31243#21345#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Properties.OnButtonClick = tv1mcNamePropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 88
end
object tv1CCQX1: TcxGridDBColumn
Tag = 99
Caption = #29983#20135#24037#21333#21495
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 109
end
object tv1DX1: TcxGridDBColumn
Caption = #25104#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 125
end
object tv1DX2: TcxGridDBColumn
Caption = #24037#24207#21517#31216
DataBinding.FieldName = 'PSName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 114
end
object tv1DX3: TcxGridDBColumn
Caption = #28201#24230
DataBinding.FieldName = 'ALL_temperature6'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 117
end
object tv1DX4: TcxGridDBColumn
Caption = #21161#21058#21450#27604#20363
DataBinding.FieldName = 'All_zhuji'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 109
end
object tv1DX5: TcxGridDBColumn
Caption = #31859#25968
DataBinding.FieldName = 'PCQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 103
end
object tv1DX6: TcxGridDBColumn
Caption = #24635#29992#26102
DataBinding.FieldName = 'time'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 100
end
object tv1JG1: TcxGridDBColumn
Caption = #36215#22987#26102#38388
DataBinding.FieldName = 'BegTime'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxDateEditProperties'
Properties.Kind = ckDateTime
HeaderAlignmentHorz = taCenter
Options.FilteringPopupIncrementalFiltering = True
Width = 100
end
object tv1JRG1: TcxGridDBColumn
Caption = #32467#26463#26102#38388
DataBinding.FieldName = 'EndTime'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxDateEditProperties'
Properties.Kind = ckDateTime
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.FilteringPopupIncrementalFiltering = True
Width = 100
end
object tv1GC_BatchNo: TcxGridDBColumn
Caption = #22383#24067#25209#27425
DataBinding.FieldName = 'GC_BatchNo'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Filtering = False
Width = 89
end
object tv1CurGlideName: TcxGridDBColumn
Caption = #21047#21345#36827#24230
DataBinding.FieldName = 'CurGlideName'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.Focusing = False
Width = 62
end
object tv1Note: TcxGridDBColumn
Caption = #22791#27880
DataBinding.FieldName = 'Note'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.Filtering = False
Options.Focusing = False
Width = 109
end
object tv1PCKey: TcxGridDBColumn
DataBinding.FieldName = 'PCKey'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object dbGrid1Level1: TcxGridLevel
GridView = tv1
end
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Left = 225
Top = 328
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Left = 81
Top = 329
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
Parameters = <>
Left = 652
Top = 280
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 852
Top = 280
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyeProcess.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 764
Top = 288
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 896
Top = 360
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = dbGrid1
PopupMenus = <>
Left = 920
Top = 216
end
object CDS_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 768
Top = 376
end
object RMGridReport1: TRMGridReport
ThreadPrepareReport = True
InitialZoom = pzDefault
PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
DefaultCollate = False
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
PreviewOptions.RulerUnit = rmutScreenPixels
PreviewOptions.RulerVisible = False
PreviewOptions.DrawBorder = False
PreviewOptions.BorderPen.Color = clGray
PreviewOptions.BorderPen.Style = psDash
CompressLevel = rmzcFastest
CompressThread = False
LaterBuildEvents = True
OnlyOwnerDataSet = False
Left = 720
Top = 56
ReportData = {}
end
object cxStyleRepository1: TcxStyleRepository
PixelsPerInch = 96
object cxStyle1: TcxStyle
AssignedValues = [svFont]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
end
end
end

View File

@ -0,0 +1,370 @@
unit U_DyePCMachineList;
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
TfrmDyePCMachineList = 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;
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;
tv1CCQX1: TcxGridDBColumn;
tv1DX1: TcxGridDBColumn;
tv1DX2: TcxGridDBColumn;
tv1DX3: TcxGridDBColumn;
tv1DX4: TcxGridDBColumn;
tv1DX5: TcxGridDBColumn;
tv1DX6: TcxGridDBColumn;
tv1JG1: TcxGridDBColumn;
tv1JRG1: TcxGridDBColumn;
tv1GC_BatchNo: TcxGridDBColumn;
tv1CurGlideName: TcxGridDBColumn;
tv1Note: TcxGridDBColumn;
dbGrid1Level1: TcxGridLevel;
ToolButton2: TToolButton;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
Label2: TLabel;
tv1PCKey: TcxGridDBColumn;
BegTime: TDateTimePicker;
EndTime: TDateTimePicker;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
MCNO: TComboBox;
TbAdd: TToolButton;
MCName: TEdit;
TbDel: TToolButton;
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 ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure tv1mcNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure MCNOChange(Sender: TObject);
procedure TbAddClick(Sender: TObject);
procedure TbDelClick(Sender: TObject);
// procedure tv1CustomDrawCell(Sender: TcxCustomGridTableView;
// ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
// var ADone: Boolean);
private
FLeft, FTop: Integer;
procedure InitGrid();
{ Private declarations }
public
fsyrName, canshu1: string;
{ Public declarations }
end;
var
frmDyePCMachineList: TfrmDyePCMachineList;
implementation
uses
U_DataLink, U_RTFun, U_ZDYHelp, U_MachTaskList;
{$R *.dfm}
procedure TfrmDyePCMachineList.FormDestroy(Sender: TObject);
begin
inherited;
frmDyePCMachineList := nil;
end;
procedure TfrmDyePCMachineList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyePCMachineList.FormCreate(Sender: TObject);
begin
inherited;
// EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
// BegDate.DateTime := EndDate.DateTime;
fsyrName := trim(DdataBase);
canshu1 := trim(DParameters1);
// SInitComBoxBySql(ADOQueryTemp, GlideName, false, 'select PSName as Name from Dye_Process');
end;
procedure TfrmDyePCMachineList.InitGrid();
var
mBegDate, mendDate: string;
mAction: string;
rs: _Recordset;
r: integer;
begin
// 任务时间
try
tv1.BeginUpdate;
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
close;
filtered := false;
sql.Clear;
SQL.Add('select * from V_Dye_Cloth_PaiGang where (BegTime between :StartTime and :EndTime) and MCNO = :MCNO order By BegTime');
Parameters.ParamByName('StartTime').Value := Trunc(BegDate.Date) + Frac(BegTime.Time);
Parameters.ParamByName('EndTime').Value := Trunc(EndDate.Date) + Frac(EndTime.Time);
Parameters.ParamByName('MCNO').Value := MCNO.Text;
Open;
end;
SCreateCDS(ADOQueryMain, CDS_main);
SInitCDSData(ADOQueryMain, CDS_main);
finally
ADOQueryMain.EnableControls;
tv1.EndUpdate;
// tv1.ApplyBestFit();
end;
end;
procedure TfrmDyePCMachineList.MCNOChange(Sender: TObject);
begin
InitGrid();
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add(' select * from Bs_Machine where MCNO = ' + quotedStr(Trim(MCNO.Text)));
Open;
end;
MCName.Text := ADOQueryCmd.FieldByName('MCName').AsString;
end;
procedure TfrmDyePCMachineList.TBRafreshClick(Sender: TObject);
begin
MovePanel2.Visible := True;
MovePanel2.Refresh;
InitGrid();
MovePanel2.Visible := False;
end;
procedure TfrmDyePCMachineList.ToolButton1Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + tv1.Name, Tv1, '排产信息');
end;
procedure TfrmDyePCMachineList.ToolButton2Click(Sender: TObject);
begin
// if ADOQuerymain.IsEmpty then
// exit;
frmMachTaskList := TfrmMachTaskList.create(self);
with frmMachTaskList do
begin
// fcurMachId := trim(self.adoquerymain.FieldByName('mcid').AsString);
// machName.text := trim(self.adoquerymain.FieldByName('mcName').AsString);
showModal;
free;
end;
initgrid();
end;
procedure TfrmDyePCMachineList.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 TfrmDyePCMachineList.tv1mcNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
// if ADOQuerymain.IsEmpty then
// exit;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.add('select * from PCAboutTime where time = ' + QuotedStr(Trim(CDS_Main.FieldByName('begtime').AsString)));
Open;
end;
frmMachTaskList := TfrmMachTaskList.create(self);
with frmMachTaskList do
begin
fBegTime := Self.CDS_Main.FieldByName('Begtime').AsString;
fMCName := Self.MCName.Text;
fText := self.ADOQueryCmd.FieldByName(fMCName).AsString;
showModal;
free;
end;
initgrid();
end;
//procedure TfrmDyePCMachineList.tv1CustomDrawCell(Sender: TcxCustomGridTableView;
// ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
// var ADone: Boolean);
//begin
// inherited;
// ACanvas.Font.Size := 7;
//end;
procedure TfrmDyePCMachineList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmDyePCMachineList.TbAddClick(Sender: TObject);
var
mTime: TDateTime;
begin
if CDS_Main.IsEmpty then
begin
mTime := Trunc(SGetServerDateTime(ADOQueryTemp) * 144 + 1) / 144;
end
else
begin
// 移动到上一条记录获取BegTime
// CDS_Main.Prior;
CDS_Main.Last;
mTime := CDS_Main.FieldByName('EndTime').AsDateTime;
// CDS_Main.Next; // 移回当前位置
end;
with CDS_Main do
begin
Append;
FieldByName('BegTime').Value := mTime;
Post; // 保存记录
end;
end;
procedure TfrmDyePCMachineList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyePCMachineList.TbDelClick(Sender: TObject);
begin
if (CDS_Main.FieldByName('PCID').Value = null) or (CDS_Main.FieldByName('PCID').Value = '') then
begin
CDS_Main.Delete;
end
else
begin
Application.MessageBox('已排产工序不能删除!','提示信息',MB_OK);
end;
end;
procedure TfrmDyePCMachineList.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(self.Caption + tv1.Name, Tv1, '排产信息');
canshu1 := self.fParameters1;
// 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);
BegDate.Date := Trunc(ServerDate) - 1; // 前一天
EndDate.Date := Trunc(ServerDate) + 1; // 后一天
BegTime.Time := EncodeTime(0, 0, 0, 0); // 早上8
endTime.Time := EncodeTime(0, 0, 0, 0); // 晚上6
MCNO.Text := '长车清洗机';
MCName.Text := 'CCQX1';
initgrid();
end;
procedure TfrmDyePCMachineList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
// SelExportData(tv1,ADOQueryMain,self.Caption);
TcxGridToExcel(self.Caption, DBGrid1);
end;
procedure TfrmDyePCMachineList.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 TfrmDyePCMachineList.pcidChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmDyePCMachineList.PRTColorChange(Sender: TObject);
begin
TBFind.Click;
end;
end.

View File

@ -15,7 +15,8 @@ function GetsysParam(muserId: pchar; fparam1: pchar): Boolean;
implementation
uses
U_DataLink, U_iniParam, U_DyeOutput, U_DyeOutputList, U_DyePCList;
U_DataLink, U_iniParam, U_DyeOutput, U_DyeOutputList, U_DyePCList,
U_DyePCMachineList,U_DyePCDetailsList;
/////////////////////////////////////////////////////////////////
// 功能说明:取Dll中得窗体 //
@ -134,6 +135,28 @@ begin
mnewHandle := Handle;
end;
end;
2: //机台排产明细
begin
with TfrmDyePCMachineList.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
begin
fFormID := FormID;
FormStyle := mstyle;
WindowState := mstate;
BorderStyle := mborderstyle;
mnewHandle := Handle;
end;
end;
3: //排产信息明细
begin
with TfrmDyePCDetailsList.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
begin
fFormID := FormID;
FormStyle := mstyle;
WindowState := mstate;
BorderStyle := mborderstyle;
mnewHandle := Handle;
end;
end;
211: //产量登记
begin
with TfrmDyeOutput.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //

View File

@ -66,7 +66,7 @@ object frmMachTaskList: TfrmMachTaskList
Width = 59
end
object Tv1pcid: TcxGridDBColumn
Caption = #27969#31243#21345#21495
Caption = #27969#31243#21345#32452#21495
DataBinding.FieldName = 'pcid'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -94,6 +94,7 @@ object frmMachTaskList: TfrmMachTaskList
Properties.ReadOnly = True
Properties.OnButtonClick = Tv1c_colorPropertiesButtonClick
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 78
end
object Tv1taskRollNum: TcxGridDBColumn
@ -332,6 +333,52 @@ object frmMachTaskList: TfrmMachTaskList
TabOrder = 1
Width = 155
end
object Panel2: TPanel
Left = 968
Top = 6
Width = 60
Height = 25
Caption = #26410#25490#20135
Color = 13421823
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 2
end
object Panel3: TPanel
Left = 1048
Top = 6
Width = 105
Height = 25
Caption = #25490#20837#26410#25253#24037
Color = clWindow
ParentBackground = False
TabOrder = 3
end
object Panel4: TPanel
Left = 1184
Top = 6
Width = 105
Height = 25
Caption = #29983#20135#19968#37096#20998
Color = 14737632
ParentBackground = False
TabOrder = 4
end
object Panel5: TPanel
Left = 1328
Top = 6
Width = 129
Height = 25
Caption = #25104#21697#24050#20837#24211
Color = 14745568
ParentBackground = False
TabOrder = 5
end
end
object cxGrid2: TcxGrid
Left = 849
@ -345,6 +392,7 @@ object frmMachTaskList: TfrmMachTaskList
FindPanel.DisplayMode = fpdmAlways
ScrollbarAnnotations.CustomAnnotations = <>
OnCellDblClick = Tv2CellDblClick
OnCustomDrawCell = Tv2CustomDrawCell
DataController.DataSource = DS_2
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
@ -359,7 +407,7 @@ object frmMachTaskList: TfrmMachTaskList
Width = 99
end
object Tv2PCID: TcxGridDBColumn
Caption = #27969#31243#21345#21495
Caption = #27969#31243#21345#32452#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -429,6 +477,18 @@ object frmMachTaskList: TfrmMachTaskList
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv2PC_FLAG: TcxGridDBColumn
DataBinding.FieldName = 'PC_FLAG'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv2isComplete: TcxGridDBColumn
DataBinding.FieldName = 'isComplete'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv2

View File

@ -71,6 +71,12 @@ type
cxGridPopupMenu1: TcxGridPopupMenu;
cxGridPopupMenu2: TcxGridPopupMenu;
Tv2GlideID: TcxGridDBColumn;
Tv2PC_FLAG: TcxGridDBColumn;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Tv2isComplete: TcxGridDBColumn;
procedure TcloseClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
@ -88,6 +94,7 @@ type
procedure tv1BegTimePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
procedure Tv2GlideNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure Tv1c_colorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure Tv2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
private
procedure initGrid();
@ -345,7 +352,7 @@ begin
open;
if not IsEmpty then
begin
Application.MessageBox('时间段重复', '提示信息', MB_OK);
Application.MessageBox('工序时间段冲突', '提示信息', MB_OK);
Exit;
end;
end;
@ -361,17 +368,15 @@ begin
open;
if not IsEmpty then
begin
Application.MessageBox('时间段重复', '提示信息', MB_OK);
Application.MessageBox('工序时间段冲突', '提示信息', MB_OK);
Exit;
end;
end;
Result := True;
end;
procedure TfrmMachTaskList.TbSaveClick(Sender: TObject);
begin
// if CDS_1.Locate('PSName', '', []) or CDS_1.Locate('PSName', null, []) then
// begin
// Application.MessageBox('请完善工序名称!', '提示信息', MB_OK);
@ -391,6 +396,7 @@ function TfrmMachTaskList.SaveData(): boolean;
var
mLoopNum: Integer;
mMCName, mNewValue, mStartTime: string;
mEndTime, mBegTime: string;
begin
result := false;
ADOQueryCmd.Connection.BeginTrans;
@ -411,6 +417,8 @@ begin
SQL.Clear;
SQL.Add(' update Dye_Plan_Glide set PC_FLAG = 1 , EndTime = DATEADD(MINUTE, ' + CDS_1.FieldByName('time').AsString + ', ' + QuotedStr(trim(CDS_1.FieldByName('BegTime').AsString)) + ')');
SQL.Add(' , begTime = ' + QuotedStr(Trim(CDS_1.FieldByName('BegTime').AsString)));
SQL.Add(' , MCNO = ' + QuotedStr(Trim(CDS_1.FieldByName('MCNO').AsString)));
SQL.Add(' , MCName = ' + QuotedStr(Trim(CDS_1.FieldByName('MCName').AsString)));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(CDS_1.FieldByName('GlideID').asString)));
// ShowMessage(sql.Text);
ExecSQL;
@ -419,6 +427,7 @@ begin
mStartTime := CDS_1.FieldByName('BegTime').AsString;
// mNewValue := '计划单:' + CDS_1.FieldByName('OrderNo').AsString + #13;
mNewValue := mNewValue + CDS_1.FieldByName('C_Name').AsString + #13;
mNewValue := mNewValue + '成品门幅:' + CDS_1.FieldByName('C_Width').AsString + #13;
mNewValue := mNewValue + '工序 刮胶次数:' + CDS_1.FieldByName('GlideName').AsString;
if CDS_1.FieldByName('PSType').AsString = '长车清洗' then
@ -460,97 +469,7 @@ begin
end;
//////////////////////显示助剂
mNewValue := mNewValue + '助剂:' + CDS_1.FieldByName('All_zhuji').AsString + #13;
// with ADOQueryTmp do
// begin
// Close;
// sql.Clear;
// SQL.Add(' select * from BS_Cloth_GY_Sub where PSID = ' + QuotedStr(Trim(CDS_1.FieldByName('PSID').AsString)));
// Open;
//// ShowMessage(sql.Text);
// end;
//
// if not ADOQueryTmp.IsEmpty then
// begin
// ADOQueryTmp.First;
// mNewValue := mNewValue + '助剂 比率:';
// if CDS_1.FieldByName('PSType').AsString = '长车清洗' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('ccqx_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('ccqx_Name').AsString + ' ' + ADOQueryTmp.FieldByName('ccqx_rate').AsString + ',';
// end;
//
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end
// else if CDS_1.FieldByName('PSType').AsString = '卷染缸清洗' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('rgqx_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('rgqx_Name').AsString + ' ' + ADOQueryTmp.FieldByName('rgqx_rate').AsString + ',';
// end;
//
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end
// else if CDS_1.FieldByName('PSType').AsString = '机缸清洗' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('jgqx_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('jgqx_Name').AsString + ' ' + ADOQueryTmp.FieldByName('jgqx_rate').AsString + ',';
// end;
//
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end
// else if CDS_1.FieldByName('PSType').AsString = '下水定型' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('fs_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('fs_Name').AsString + ' ' + ADOQueryTmp.FieldByName('fs_rate').AsString + ',';
// end;
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end
// else if CDS_1.FieldByName('PSType').AsString = '刮胶' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('gj_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('gj_Name').AsString + ' ' + ADOQueryTmp.FieldByName('gj_rate').AsString + ',';
// end;
//
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end
// else if CDS_1.FieldByName('PSType').AsString = '发泡' then
// begin
// while not ADOQueryTmp.Eof do
// begin
// if ADOQueryTmp.FieldByName('fp_Name').AsString <> '水' then
// begin
// mNewValue := mNewValue + ADOQueryTmp.FieldByName('fp_Name').AsString + ' ' + ADOQueryTmp.FieldByName('fp_rate').AsString + ',';
// end;
//
// ADOQueryTmp.Next;
// end;
// mNewValue := mNewValue + #13;
// end;
// end;
mNewValue := mNewValue + CDS_1.FieldByName('PCID').AsString + #13;
mNewValue := mNewValue + CDS_1.FieldByName('GlideID').AsString;
@ -568,25 +487,58 @@ begin
ExecSQL;
end;
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
// sql.Add('select * from PCAboutTime where time >= ''' + Trim(CDS_1.FieldByName('BegTime').AsString) + '''');
// sql.Add(' Order By time');
// Open;
// end;
//
// var i: Integer;
//
// for i := 1 to mLoopNum do
// begin
// ADOQueryCmd.Edit;
// ADOQueryCmd.FieldByName(CDS_1.FieldByName('MCName').AsString).Value := CDS_1.FieldByName('OrderNo').AsString + #13#10 + CDS_1.FieldByName('C_Name').AsString + #13#10 + CDS_1.FieldByName('GlideName').AsString + #13#10 + CDS_1.FieldByName('GlideID').AsString;
//
// ADOQueryCmd.Post;
// ADOQueryCmd.Next;
// end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('select * from PCAboutTime ');
SQL.Add(' where time >= ' + quotedStr(Trim(mStartTime)));
Open;
end;
ADOQueryCmd.First;
mNewValue := ADOQueryCmd.FieldByName(mMCName).AsString;
mBegTime := ADOQueryCmd.FieldByName('time').AsString;
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
while not ADOQueryCmd.Eof do
begin
if (ADOQueryCmd.FieldByName(mMCName).AsString = null) or (ADOQueryCmd.FieldByName(mMCName).AsString = '') then
begin
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
with ADOQueryTmp do
begin
Close;
sql.Clear;
sql.Add('update Dye_Plan_Glide set BegTime = ' + QuotedStr(Trim(mBegTime)));
sql.Add(' , EndTime = ' + QuotedStr(Trim(mEndTime)));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(GetLastLine(mNewValue))));
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
result := true;
Exit;
end;
if mNewValue <> ADOQueryCmd.FieldByName(mMCName).AsString then
begin
mEndTime := ADOQueryCmd.FieldByName('time').AsString;
with ADOQueryTmp do
begin
Close;
sql.Clear;
sql.Add('update Dye_Plan_Glide set BegTime = ' + QuotedStr(Trim(mBegTime)));
sql.Add(' , EndTime = ' + QuotedStr(Trim(mEndTime)));
SQL.Add(' where GlideID = ' + QuotedStr(Trim(GetLastLine(mNewValue))));
ExecSQL;
end;
mBegTime := ADOQueryCmd.FieldByName('time').AsString;
mNewValue := ADOQueryCmd.FieldByName(mMCName).AsString;
end;
ADOQueryCmd.Next;
end;
end;
Next;
end;
@ -714,9 +666,10 @@ begin
FieldByName('OrderNo').value := ADOQueryCard.FieldByName('OrderNo').AsString;
FieldByName('pcid').value := ADOQueryCard.FieldByName('pcid').AsString;
FieldByName('C_name').value := ADOQueryCard.FieldByName('C_name').AsString;
FieldByName('C_Width').value := ADOQueryCard.FieldByName('C_Width').AsString;
FieldByName('GlideName').value := ADOQueryCard.FieldByName('GlideName').AsString;
FieldByName('PCPiece').value := ADOQueryCard.FieldByName('PCPiece').AsString;
FieldByName('PCQty').value := ADOQueryCard.FieldByName('PCQty').AsString;
FieldByName('PCPiece').asString := ADOQueryCard.FieldByName('PCPiece').AsString;
FieldByName('PCQty').asString := ADOQueryCard.FieldByName('PCQty').AsString;
FieldByName('time').value := ADOQueryCard.FieldByName('time').AsString;
FieldByName('PSType').value := ADOQueryCard.FieldByName('PSType').AsString;
FieldByName('PSID').value := ADOQueryCard.FieldByName('PSID').AsString;
@ -750,7 +703,51 @@ begin
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
// showMessage('插入任务数据时发生错误!');
end;
initSubGrid();
// initSubGrid();
end;
procedure TfrmMachTaskList.Tv2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
PC_FLAG, isComplete: Variant;
begin
// 获取字段值
PC_FLAG := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('PC_FLAG').Index];
isComplete := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('isComplete').Index];
// 设置不同状态的颜色和字体
if VarIsNull(PC_FLAG) or (PC_FLAG = 0) then // 未排入计划单
begin
ACanvas.Brush.Color := $00CCCCFF; // 浅红色背景
ACanvas.Font.Color := clRed;
ACanvas.Font.Style := [fsBold];
end
else if (PC_FLAG = 1) and VarIsNull(isComplete) then // 排入未报工
begin
ACanvas.Brush.Color := clWindow; // 默认窗口背景色
ACanvas.Font.Color := clWindowText; // 默认窗口文本色
ACanvas.Font.Style := [];
end
else if (PC_FLAG = 1) and (not VarIsNull(isComplete)) and (isComplete = 0) then // 生产一部分
begin
ACanvas.Brush.Color := $00E0E0E0; // 浅灰色背景
ACanvas.Font.Color := clGray;
ACanvas.Font.Style := [fsBold]; //
end
else if (PC_FLAG = 1) and (not VarIsNull(isComplete)) and (isComplete = 1) then // 成品入库
begin
ACanvas.Brush.Color := $00E0FFE0; // 浅绿色背景
ACanvas.Font.Color := $00008000;
ACanvas.Font.Style := [fsBold];
end
else // 默认情况
begin
ACanvas.Brush.Color := clWindow;
ACanvas.Font.Color := clWindowText;
ACanvas.Font.Style := [];
end;
// 如果需要自定义绘制完成,取消下面的注释
// ADone := True;
end;
procedure TfrmMachTaskList.Tv2GlideNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
@ -890,7 +887,7 @@ begin
close;
sql.Clear;
sql.Add('select * from V_Dye_Cloth_PaiGang ');
sql.Add('where PC_Flag = 0 order by PCID ASC, GlideNo ASC');
sql.Add('where isComplete <> 1 OR isComplete IS NULL order by PCID ASC, GlideNo ASC');
// ShowMessage(SQL.Text);
// a.taskDate,
open;

View File

@ -27,7 +27,8 @@ uses
U_DyeClothInspList in 'U_DyeClothInspList.pas' {frmDyeClothInspList},
U_LabelMapSet in '..\A00通用窗体\U_LabelMapSet.pas' {frmLabelMapSet},
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas';
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
U_DyeCardRoll in 'U_DyeCardRoll.pas' {frmDyeCardRoll};
{$R *.res}

View File

@ -146,6 +146,10 @@
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas"/>
<DCCReference Include="U_DyeCardRoll.pas">
<Form>frmDyeCardRoll</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -5,7 +5,7 @@
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.832,=D:\Dp10Repo\public10\design\U_BaseHelp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.048,=D:\Dp10Repo\public10\design\U_BaseList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.320,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.716,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ProcessSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.664,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LbaelMapSet.pas</Transaction>
@ -17,6 +17,7 @@
<Transaction>1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm</Transaction>
<Transaction>1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.320,=D:\Dp10Repo\public10\ThreeFun\Fun\uSZHN_JSON.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.532,=D:\Dp10Repo\项目代码\RTBasics\F05染色检验\U_DyeMachInsp.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.086,=D:\Dp10Repo\public10\design\U_cxGridCustomCss.pas</Transaction>
@ -25,14 +26,14 @@
<Transaction>1899/12/30 00:00:00.000.965,D:\Dp10Repo\项目代码\RTBasics\F05染色检验\DyeInsp.dproj=D:\Dp10Repo\项目代码\RTBasics\F05染色检验\InformationBase.dproj</Transaction>
<Transaction>1899/12/30 00:00:00.000.015,=D:\Dp10Repo\public10\ThreeFun\Fun\U_RTFun.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.909,=D:\Dp10Repo\项目代码\RTBasics\F05染色检验\U_DyeClothInspList.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.958,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas=</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.958,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LabelPrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas</Transaction>
<Transaction>1899/12/30 00:00:00.000.734,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas</Transaction>
<Transaction>2025/10/30 16:43:17.000.471,=D:\Dp10Repo\项目代码\D10sxYilanbuyi\F05染色检验\U_DyeCardRoll.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\D10sxYilanbuyi"/>
@ -77,5 +78,7 @@
<File Path="U_DyeMachInsp.dfm"/>
<File Path="U_DyeClothInspList.pas"/>
<File Path="U_DyeClothInspList.dfm"/>
<File Path="U_DyeCardRoll.pas"/>
<File Path="U_DyeCardRoll.dfm"/>
</ProjectSortOrder>
</BorlandProject>

Binary file not shown.

View File

@ -24,8 +24,8 @@ DLL
员工编号=select userid='ADMIN'
标签份数=1
米数下限=10
米数上限=99
米数下限=1
米数上限=999
重量下限=2
重量上限=50
米数小数位=1

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="DbPanel"/>
<File Path="DbPanel\MovePanel.pas"/>
<File Path="delphitwain"/>
<File Path="delphitwain\DelphiTwain.pas"/>
<File Path="delphitwain\DelphiTwainUtils.pas"/>
<File Path="delphitwain\Twain.pas"/>
<File Path="AES.pas"/>
<File Path="ElAES.pas"/>
<File Path="JDAESExtend.pas"/>
<File Path="logon.pas"/>
<File Path="logon.dfm"/>
<File Path="spmain.pas"/>
<File Path="spmain.dfm"/>
<File Path="U_iniParam.pas"/>
<File Path="U_Link.pas"/>
<File Path="U_Link.dfm"/>
<File Path="delphitwain"/>
<File Path="delphitwain\DelphiTwain.pas"/>
<File Path="delphitwain\DelphiTwainUtils.pas"/>
<File Path="delphitwain\Twain.pas"/>
<File Path="DbPanel"/>
<File Path="DbPanel\MovePanel.pas"/>
<File Path="AES.pas"/>
<File Path="ElAES.pas"/>
<File Path="U_upPassword.pas"/>
<File Path="U_upPassword.dfm"/>
<File Path="U_Link.pas"/>
<File Path="U_Link.dfm"/>
<File Path="U_iniParam.pas"/>
<File Path="JDAESExtend.pas"/>
</ProjectSortOrder>
<Transactions>
<Transaction>1899/12/30 00:00:00.000.635,D:\Dp10Repo\项目代码\RTBasics\F05染色检验\WFBProduction.dproj=D:\Dp10Repo\项目代码\RTBasics\F05染色检验\DyeInspLogin.dproj</Transaction>

View File

@ -0,0 +1,562 @@
inherited frmDyeCardRoll: TfrmDyeCardRoll
Caption = #22823#21367#26729#31649#29702
ClientHeight = 699
ClientWidth = 1401
ExplicitWidth = 1417
ExplicitHeight = 738
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar [0]
Tag = 1
Left = 0
Top = 0
Width = 1401
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 91
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_DyeInsp.ImageList_new32
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_DyeInsp.ImageList_new32
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
ExplicitTop = -6
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 1
OnClick = TBRafreshClick
end
object TBFind: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #36807#28388
ImageIndex = 0
OnClick = TBFindClick
end
object TBPrint: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #25171#21360
ImageIndex = 21
Visible = False
OnClick = TBPrintClick
end
object TBExport: TToolButton
Left = 213
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton2: TToolButton
Left = 284
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton2Click
end
object TBClose: TToolButton
Left = 379
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel1: TPanel [1]
Left = 0
Top = 38
Width = 1401
Height = 65
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
ExplicitTop = 44
object Label1: TLabel
Left = 18
Top = 17
Width = 52
Height = 12
Caption = #21046#21333#26085#26399
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label3: TLabel
Left = 223
Top = 17
Width = 52
Height = 12
Caption = #35745#21010#21333#21495
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
OnDblClick = Label3DblClick
end
object Label8: TLabel
Left = 404
Top = 17
Width = 39
Height = 12
Caption = #21367#26729#21495
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label11: TLabel
Left = 223
Top = 43
Width = 52
Height = 12
Caption = #27969#31243#21345#21495
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Left = 613
Top = 119
Width = 26
Height = 12
Caption = #20811#37325
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object BegDate: TDateTimePicker
Left = 76
Top = 13
Width = 85
Height = 20
Date = 40675.000000000000000000
Format = 'yyyy-MM-dd'
Time = 0.464742650459811600
TabOrder = 0
end
object EndDate: TDateTimePicker
Left = 75
Top = 35
Width = 86
Height = 20
Date = 40675.000000000000000000
Format = 'yyyy-MM-dd'
Time = 0.464761099538009100
TabOrder = 1
end
object OrderNo: TEdit
Tag = 2
Left = 281
Top = 13
Width = 100
Height = 20
TabOrder = 2
OnChange = OrderNoChange
end
object RollNumber: TEdit
Tag = 2
Left = 462
Top = 13
Width = 100
Height = 20
TabOrder = 3
OnChange = OrderNoChange
end
object PCID: TEdit
Tag = 2
Left = 281
Top = 39
Width = 100
Height = 20
TabOrder = 4
OnChange = OrderNoChange
end
object MPRTKZ: TEdit
Tag = 2
Left = 654
Top = 99
Width = 56
Height = 20
TabOrder = 5
OnChange = OrderNoChange
end
end
object cxGrid1: TcxGrid [2]
Left = 0
Top = 125
Width = 1401
Height = 574
Align = alClient
PopupMenu = PM_1
TabOrder = 2
ExplicitTop = 131
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <
item
Kind = skSum
end
item
Format = #20849' 0 '#34892
Kind = skCount
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.IncSearch = DataLink_DyeInsp.SHuangSe
Styles.Header = DataLink_DyeInsp.Default
Styles.Inactive = DataLink_DyeInsp.SHuangSe
Styles.Selection = DataLink_DyeInsp.SHuangSe
object Tv1RollNumber: TcxGridDBColumn
Caption = #21367#26729#21495
DataBinding.FieldName = 'RollNumber'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1OrderNo: TcxGridDBColumn
Caption = #35745#21010#21333#21495
DataBinding.FieldName = 'OrderNo'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_Name: TcxGridDBColumn
Caption = #25104#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1F_Name: TcxGridDBColumn
Caption = #22383#24067#21517#31216
DataBinding.FieldName = 'F_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1QtyOrder: TcxGridDBColumn
Caption = #35746#21333#25968#37327
DataBinding.FieldName = 'QtyOrder'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_PlanQty: TcxGridDBColumn
Caption = #35745#21010#25968#37327
DataBinding.FieldName = 'C_PlanQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1F_description: TcxGridDBColumn
Caption = #22383#24067#25551#36848
DataBinding.FieldName = 'F_description'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_description: TcxGridDBColumn
Caption = #24037#33402#35201#27714
DataBinding.FieldName = 'C_description'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1PCID: TcxGridDBColumn
Caption = #27969#31243#21345#21495
DataBinding.FieldName = 'PCID'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1PCType: TcxGridDBColumn
Caption = #27969#31243#21345#31867#22411
DataBinding.FieldName = 'PCType'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1PCTime: TcxGridDBColumn
Caption = #24320#21345#26085#26399
DataBinding.FieldName = 'PCTime'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1KaZu: TcxGridDBColumn
Caption = #21345#32452#21495
DataBinding.FieldName = 'KaZu'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1KaZuPiece: TcxGridDBColumn
Caption = #21345#32452#21305#25968
DataBinding.FieldName = 'KaZuPiece'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1KaZuQty: TcxGridDBColumn
Caption = #21345#32452#25968#37327
DataBinding.FieldName = 'KaZuQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_Width: TcxGridDBColumn
Caption = #20135#21697#38376#24133
DataBinding.FieldName = 'C_Width'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1C_GramWeight: TcxGridDBColumn
Caption = #20135#21697#20811#37325
DataBinding.FieldName = 'C_GramWeight'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1DTMPSlist: TcxGridDBColumn
Caption = #24037#33402#20449#24687
DataBinding.FieldName = 'DTMPSlist'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 120
end
object Tv1CINote: TcxGridDBColumn
Caption = #20135#21697#20449#24687#22791#27880
DataBinding.FieldName = 'CINote'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 110
end
object Tv1C_Color: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'C_Color'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1CCQXRollMeter: TcxGridDBColumn
Caption = #38271#36710#28165#27927#21518#21367#26729
DataBinding.FieldName = 'CCQXRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 121
end
object Tv1RGQXRollMeter: TcxGridDBColumn
Caption = #21367#26579#32568#28165#27927#21518#21367#26729
DataBinding.FieldName = 'RGQXRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 137
end
object Tv1JGQXRollMeter: TcxGridDBColumn
Caption = #26426#32568#28165#27927#21518#21367#26729
DataBinding.FieldName = 'JGQXRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 121
end
object Tv1DXRollMeter: TcxGridDBColumn
Caption = #24178#23450#22411#21518#21367#26729
DataBinding.FieldName = 'DXRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1FSRollMeter: TcxGridDBColumn
Caption = #19979#27700#23450#22411#21518#21367#26729
DataBinding.FieldName = 'FSRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 115
end
object Tv1FPRollMeter: TcxGridDBColumn
Caption = #21457#27873#21518#21367#26729
DataBinding.FieldName = 'FPRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1GJRollMeter: TcxGridDBColumn
Caption = #21038#33014#21518#21367#26729
DataBinding.FieldName = 'GJRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
object Tv1ZMRollMeter: TcxGridDBColumn
Caption = #36711#27611#21518#21367#26729
DataBinding.FieldName = 'ZMRollMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 100
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
end
end
object cxTabControl1: TcxTabControl [3]
Left = 0
Top = 103
Width = 1401
Height = 22
Align = alTop
TabOrder = 3
Visible = False
Properties.CustomButtons.Buttons = <>
Properties.Style = 9
Properties.TabIndex = 0
Properties.Tabs.Strings = (
#24050#35745#21010
#24050#19979#36798
#24050#32467#31639
#24050#21462#28040
#20840#37096)
OnChange = cxTabControl1Change
ClientRectBottom = 22
ClientRectRight = 1401
ClientRectTop = 19
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
Left = 89
Top = 224
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
Top = 233
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
Left = 636
Top = 328
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
Parameters = <>
Left = 672
Top = 188
end
object ADOQueryMain: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 504
Top = 192
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 580
Top = 184
end
object DataSource1: TDataSource
DataSet = Order_Main
Left = 592
Top = 288
end
object Order_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 440
Top = 308
end
object PM_1: TPopupMenu
Left = 272
Top = 376
object N2: TMenuItem
Caption = #20840#36873
OnClick = N2Click
end
object N1: TMenuItem
Caption = #20840#24323
OnClick = N1Click
end
end
object DS_2: TDataSource
DataSet = CDS_2
Left = 616
Top = 568
end
object ADOQueryImage: TADOQuery
Connection = DataLink_DyeInsp.ADOLink
EnableBCD = False
Parameters = <>
Left = 808
Top = 359
end
object DSImage: TDataSource
DataSet = ADOQueryImage
Left = 912
Top = 368
end
object IdFTP1: TIdFTP
ConnectTimeout = 0
NATKeepAlive.UseKeepAlive = False
NATKeepAlive.IdleTimeMS = 0
NATKeepAlive.IntervalMS = 0
ProxySettings.ProxyType = fpcmNone
ProxySettings.Port = 0
ReadTimeout = 0
Left = 692
Top = 394
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 600
Top = 384
end
object CDS_2: TClientDataSet
Aggregates = <>
Params = <>
Left = 560
Top = 564
end
end

View File

@ -0,0 +1,472 @@
unit U_DyeCardRoll;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
cxCurrencyEdit, cxImage, cxDBEdit, Menus, RM_Common, RM_Class, RM_e_Xls,
RM_Dataset, RM_System, RM_GridReport, cxGridCustomPopupMenu, cxGridPopupMenu,
cxPC, cxSplitter, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, ShellAPI, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxBarBuiltInMenu, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
IdExplicitTLSClientServerBase, U_BaseList, cxCheckBox, cxDropDownEdit,
dxScrollbarAnnotations;
type
TfrmDyeCardRoll = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBPrint: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
cxGridPopupMenu1: TcxGridPopupMenu;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
Label3: TLabel;
OrderNo: TEdit;
TBExport: TToolButton;
Order_Main: TClientDataSet;
PM_1: TPopupMenu;
N2: TMenuItem;
Label8: TLabel;
RollNumber: TEdit;
Label11: TLabel;
PCID: TEdit;
Label12: TLabel;
MPRTKZ: TEdit;
DS_2: TDataSource;
cxTabControl1: TcxTabControl;
ADOQueryImage: TADOQuery;
DSImage: TDataSource;
IdFTP1: TIdFTP;
cxGridPopupMenu2: TcxGridPopupMenu;
ToolButton2: TToolButton;
N1: TMenuItem;
CDS_2: TClientDataSet;
Tv1OrderNo: TcxGridDBColumn;
Tv1QtyOrder: TcxGridDBColumn;
Tv1PCID: TcxGridDBColumn;
Tv1KaZu: TcxGridDBColumn;
Tv1KaZuPiece: TcxGridDBColumn;
Tv1KaZuQty: TcxGridDBColumn;
Tv1RollNumber: TcxGridDBColumn;
Tv1CCQXRollMeter: TcxGridDBColumn;
Tv1RGQXRollMeter: TcxGridDBColumn;
Tv1JGQXRollMeter: TcxGridDBColumn;
Tv1DXRollMeter: TcxGridDBColumn;
Tv1FSRollMeter: TcxGridDBColumn;
Tv1FPRollMeter: TcxGridDBColumn;
Tv1GJRollMeter: TcxGridDBColumn;
Tv1ZMRollMeter: TcxGridDBColumn;
Tv1C_Name: TcxGridDBColumn;
Tv1F_Name: TcxGridDBColumn;
Tv1C_PlanQty: TcxGridDBColumn;
Tv1F_description: TcxGridDBColumn;
Tv1C_description: TcxGridDBColumn;
Tv1PCType: TcxGridDBColumn;
Tv1PCTime: TcxGridDBColumn;
Tv1C_Width: TcxGridDBColumn;
Tv1C_GramWeight: TcxGridDBColumn;
Tv1DTMPSlist: TcxGridDBColumn;
Tv1CINote: TcxGridDBColumn;
Tv1C_Color: TcxGridDBColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure TBFindClick(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure TBPrintClick(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure OrderNoChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure Label3DblClick(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
private
DQdate: TDateTime;
procedure InitGrid();
function DelData(): Boolean;
procedure SetStatus();
procedure InitImage(fwbid: string);
{ Private declarations }
public
FFInt, FCloth: Integer;
canshu1, canshu2, FWorkshop: string;
fFlileFlag: string;
{ Public declarations }
end;
var
frmDyeCardRoll: TfrmDyeCardRoll;
implementation
uses
U_DataLink, U_RTFun, U_LabelPrint;
{$R *.dfm}
procedure TfrmDyeCardRoll.InitImage(fwbid: string);
begin
ADOQueryImage.close;
if fwbid = '' then
exit;
with ADOQueryImage do
begin
close;
sql.Clear;
sql.Add('select * from TP_File A');
sql.Add('where WBID=' + quotedstr(trim(fwbid)));
open;
end;
end;
procedure TfrmDyeCardRoll.SetStatus();
begin
if Trim(canshu1) = '管理' then
begin
case cxTabControl1.TabIndex of
0:
begin
end;
1:
begin
end;
2:
begin
end;
3:
begin
end;
end;
end;
if Trim(canshu1) = '录入' then
begin
case cxTabControl1.TabIndex of
0:
begin
end;
1:
begin
// tnochk.Visible:=true;
end;
2:
begin
end;
3:
begin
// TBNOQX.Visible:=true;
end;
end;
end;
end;
procedure TfrmDyeCardRoll.Label3DblClick(Sender: TObject);
var
I: Integer;
Column: TcxGridDBColumn;
FieldNames: TStringList;
begin
FieldNames := TStringList.Create;
try
for I := 0 to Tv1.ColumnCount - 1 do
begin
Column := Tv1.Columns[I];
FieldNames.Add(Column.Caption + ':' + Column.DataBinding.FieldName);
end;
ShowMessage(FieldNames.Text);
finally
FieldNames.Free;
end;
end;
procedure TfrmDyeCardRoll.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyeCardRoll.FormCreate(Sender: TObject);
begin
inherited;
cxgrid1.Align := alClient;
DQdate := SGetServerDate(ADOQueryTemp);
canshu1 := trim(Self.fParameters1);
canshu2 := trim(Self.fParameters2);
FWorkshop := trim(Self.fParameters3);
end;
procedure TfrmDyeCardRoll.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyeCardRoll.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Close;
Filtered := False;
sql.Clear;
sql.Add('select A.* ');
sql.Add('from V_Dye_Card_Roll A');
sql.Add(' where 1=1');
// case cxTabControl1.TabIndex of
// 0:
// begin
// sql.Add(' and isnull(A.status,''0'') in(''已计划'') ');
// end;
// 1:
// begin
// sql.Add(' and isnull(A.status,''0'')in(''已下达'' )');
// end;
// 2:
// begin
// sql.Add(' and isnull(A.status,''0'')in(''已结算'' )');
// end;
// 3:
// begin
// sql.Add(' and isnull(A.status,''0'')in(''已取消'' )');
// end;
// 4:
// begin
// sql.Add(' and isnull(A.status,''0'')in(''已结算'' )');
// end;
// end;
sql.Add(' and fillTime>=''' + FormatDateTime('yyyy-MM-dd', begdate.DateTime) + ''' ');
sql.Add(' and fillTime<''' + FormatDateTime('yyyy-MM-dd', Enddate.DateTime + 1) + ''' ');
//// sql.Add(' and A.Workshop=''' + trim(FWorkshop) + ''' ');
// if Trim(canshu1) = '录入' then
// sql.Add('and Filler=' + QuotedStr(Trim(DName)));
//// ShowMessage(sql.Text);
Open;
end;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, Order_Main);
SInitCDSData(ADOQueryMain, Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmDyeCardRoll.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, Order_Main);
SInitCDSData(ADOQueryMain, Order_Main);
end;
function TfrmDyeCardRoll.DelData(): Boolean;
begin
try
Result := false;
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete Dye_Plan_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
sql.Add('delete Dye_Plan_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
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('指示单删除')));
sql.Add(',' + quotedstr(trim('指示单号:' + trim(Order_Main.FieldByName('OrderNO').AsString))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
Result := True;
except
ADOQueryCmd.Connection.RollbackTrans;
Result := False;
Application.MessageBox('数据删除异常!', '提示', 0);
end;
end;
procedure TfrmDyeCardRoll.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
Exit;
end;
procedure TfrmDyeCardRoll.TBPrintClick(Sender: TObject);
var
WSql: string;
begin
if Order_Main.IsEmpty then
Exit;
WSql := QuotedStr(Trim(Order_Main.fieldbyname('MainId').AsString));
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := 'DyePlanPrint';
FFiltration1 := WSql;
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TfrmDyeCardRoll.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyeCardRoll.OrderNoChange(Sender: TObject);
begin
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, Order_Main);
SInitCDSData(ADOQueryMain, Order_Main);
end;
procedure TfrmDyeCardRoll.FormShow(Sender: TObject);
begin
inherited;
fFlileFlag := UserDataFlag + 'HX';
canshu1 := self.fParameters1;
canshu2 := self.fParameters2;
FWorkshop := self.fParameters3;
BegDate.DateTime := SGetServerDate(ADOQueryTemp) - 15;
EndDate.DateTime := SGetServerDate(ADOQueryTemp);
ReadCxGrid(self.Caption + 'TV1', Tv1, '大卷桩管理');
SetStatus();
InitGrid();
end;
procedure TfrmDyeCardRoll.CheckBox1Click(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyeCardRoll.CheckBox2Click(Sender: TObject);
begin
TBRafresh.Click;
end;
procedure TfrmDyeCardRoll.Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
var
id, id10: Integer;
begin
end;
procedure TfrmDyeCardRoll.v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
if Id<0 then Exit;
if AViewInfo.GridRecord.Values[Id10]='完成' then Exit;
if AViewInfo.GridRecord.Values[Id]-SGetServerDate(ADOQueryTemp)>=4 then Exit;
if ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))>=0) and ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))<4) then
ACanvas.Brush.Color:=clYellow
else
if (AViewInfo.GridRecord.Values[id])-(SGetServerDate(ADOQueryTemp)<0) then
begin
ACanvas.Brush.Color:=clRed;
end;
begin
ACanvas.Brush.Color:=clRed;
end else
if AViewInfo.GridRecord.Values[Id]='Purple' then
begin
ACanvas.Brush.Color:=clPurple;
end else
if AViewInfo.GridRecord.Values[Id]='Olive' then
begin
ACanvas.Brush.Color:=clOlive;
end else
if AViewInfo.GridRecord.Values[Id]='Teal' then
begin
ACanvas.Brush.Color:=clTeal;
end else
if AViewInfo.GridRecord.Values[Id]='Background' then
begin
ACanvas.Brush.Color:=clBackground;
end; }
end;
procedure TfrmDyeCardRoll.N1Click(Sender: TObject);
begin
SelOKNoFiler(Tv1, false);
end;
procedure TfrmDyeCardRoll.N2Click(Sender: TObject);
begin
SelOKNoFiler(Tv1, true);
end;
procedure TfrmDyeCardRoll.ToolButton2Click(Sender: TObject);
begin
WriteCxGrid(self.Caption + 'TV1', Tv1, '大卷桩管理');
end;
procedure TfrmDyeCardRoll.cxTabControl1Change(Sender: TObject);
begin
SetStatus();
InitGrid();
end;
end.

View File

@ -7,6 +7,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
FormStyle = fsMDIChild
Position = poScreenCenter
Visible = True
ExplicitLeft = -122
ExplicitWidth = 1487
ExplicitHeight = 621
PixelsPerInch = 96
@ -20,7 +21,6 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
AutoSize = True
BorderStyle = bsSingle
TabOrder = 3
ExplicitTop = 113
DesignSize = (
1467
24)
@ -241,7 +241,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
end
object Tv1C_description: TcxGridDBColumn
Caption = #24037#33402#35201#27714
DataBinding.FieldName = 'C_description'
DataBinding.FieldName = 'C_description1'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
@ -308,6 +308,13 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Options.Editing = False
Width = 66
end
object Tv1barCode: TcxGridDBColumn
Caption = #26816#39564#21367#26465#30721
DataBinding.FieldName = 'barCode'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1Column7: TcxGridDBColumn
Caption = #23458#25143#33457#22411
DataBinding.FieldName = 'C_CustPattern'
@ -409,7 +416,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 103
ButtonWidth = 115
Caption = 'ToolBar1'
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
@ -463,16 +470,24 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
ImageIndex = 21
OnClick = btnJYBGClick
end
object TBExport: TToolButton
object ToolButton2: TToolButton
Left = 415
Top = 0
AutoSize = True
Caption = #21516#27493#26816#39564#25968#25454
ImageIndex = 1
OnClick = ToolButton2Click
end
object TBExport: TToolButton
Left = 534
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton1: TToolButton
Left = 486
Left = 605
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
@ -480,7 +495,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 581
Left = 700
Top = 0
AutoSize = True
Caption = #20851#38381
@ -530,23 +545,9 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Font.Style = [fsBold]
ParentFont = False
end
object TLabel
Left = 362
Top = 14
Width = 39
Height = 12
Hint = '0'
Caption = #21512#21516#21495
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label7: TLabel
Left = 525
Top = 14
Left = 381
Top = 13
Width = 26
Height = 12
Hint = '0'
@ -558,23 +559,9 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Font.Style = [fsBold]
ParentFont = False
end
object Label8: TLabel
Left = 825
Top = 40
Width = 53
Height = 12
Hint = '1'
Caption = #25171' '#30721' '#20154
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label10: TLabel
Left = 671
Top = 40
Left = 527
Top = 39
Width = 39
Height = 12
Hint = '1'
@ -587,8 +574,8 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
ParentFont = False
end
object Label4: TLabel
Left = 1001
Top = 14
Left = 697
Top = 13
Width = 26
Height = 12
Hint = '1'
@ -603,38 +590,10 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
object Label5: TLabel
Left = 362
Top = 40
Width = 39
Width = 52
Height = 12
Hint = '0'
Caption = #20135#21697#21517
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label6: TLabel
Left = 843
Top = 14
Width = 26
Height = 12
Hint = '1'
Caption = #29366#24577
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label20: TLabel
Left = 525
Top = 40
Width = 26
Height = 12
Hint = '0'
Caption = #33457#22411
Caption = #25104#21697#21517#31216
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
@ -648,7 +607,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Width = 52
Height = 12
Hint = '0'
Caption = #20135#21697#32534#21495
Caption = #25104#21697#32534#21495
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
@ -657,8 +616,8 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
ParentFont = False
end
object Label1: TLabel
Left = 684
Top = 14
Left = 540
Top = 13
Width = 26
Height = 12
Hint = '0'
@ -688,7 +647,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Date = 44774.000000000000000000
Format = 'yyyy-MM-dd'
Time = 0.464761099538009100
TabOrder = 6
TabOrder = 5
end
object OrderNo: TEdit
Tag = 2
@ -700,20 +659,10 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
TabOrder = 1
OnKeyPress = OrderNoKeyPress
end
object conNO: TEdit
Tag = 2
Left = 407
Top = 10
Width = 100
Height = 20
Hint = '0'
TabOrder = 7
OnKeyPress = conNOKeyPress
end
object CIID: TEdit
Tag = 2
Left = 711
Top = 36
Left = 567
Top = 35
Width = 100
Height = 20
Hint = '1'
@ -722,13 +671,13 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
end
object Grade: TComboBox
Tag = 2
Left = 1030
Top = 10
Left = 726
Top = 9
Width = 100
Height = 20
Hint = '1'
Style = csDropDownList
TabOrder = 10
TabOrder = 7
OnChange = GradeChange
OnKeyPress = KHConNOKeyPress
Items.Strings = (
@ -748,42 +697,14 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
TabOrder = 2
OnKeyPress = conNOKeyPress
end
object CIIOFlag: TComboBox
Tag = 2
Left = 872
Top = 10
Width = 100
Height = 20
Hint = '1'
Style = csDropDownList
TabOrder = 9
OnChange = CIIOFlagChange
OnKeyPress = KHConNOKeyPress
Items.Strings = (
#26410#20837#24211
#24050#20837#24211
#24050#20986#24211
'')
end
object Filler: TComboBox
Tag = 2
Left = 880
Top = 36
Width = 100
Height = 20
Hint = '1'
Style = csDropDownList
TabOrder = 4
OnKeyPress = KHConNOKeyPress
end
object C_Color: TEdit
Tag = 2
Left = 553
Top = 10
Left = 409
Top = 9
Width = 100
Height = 20
Hint = '0'
TabOrder = 8
TabOrder = 6
OnKeyPress = conNOKeyPress
end
object IsJYTime: TCheckBox
@ -800,17 +721,7 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Font.Style = [fsBold]
ParentFont = False
State = cbChecked
TabOrder = 5
end
object C_Pattern: TEdit
Tag = 2
Left = 553
Top = 36
Width = 100
Height = 20
Hint = '0'
TabOrder = 11
OnKeyPress = KHConNOKeyPress
TabOrder = 4
end
object C_Code: TEdit
Tag = 2
@ -819,17 +730,17 @@ inherited frmDyeClothInspList: TfrmDyeClothInspList
Width = 100
Height = 20
Hint = '0'
TabOrder = 12
TabOrder = 8
OnKeyPress = KHConNOKeyPress
end
object PCId: TEdit
Tag = 2
Left = 711
Top = 10
Left = 567
Top = 9
Width = 100
Height = 20
Hint = '0'
TabOrder = 13
TabOrder = 9
OnKeyPress = KHConNOKeyPress
end
end

View File

@ -71,26 +71,19 @@ type
Panel1: TPanel;
Label3: TLabel;
Label7: TLabel;
Label8: TLabel;
Label10: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label20: TLabel;
Label23: TLabel;
Label1: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
OrderNo: TEdit;
conNO: TEdit;
CIID: TEdit;
Grade: TComboBox;
C_Name: TEdit;
CIIOFlag: TComboBox;
Filler: TComboBox;
C_Color: TEdit;
IsJYTime: TCheckBox;
C_Pattern: TEdit;
C_Code: TEdit;
PCId: TEdit;
Tv1SSel: TcxGridDBColumn;
@ -100,6 +93,8 @@ type
Tv1Inspector2: TcxGridDBColumn;
Tv1C_description: TcxGridDBColumn;
Tv1checktime: TcxGridDBColumn;
ToolButton2: TToolButton;
Tv1barCode: TcxGridDBColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
@ -128,6 +123,7 @@ type
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
private
DQdate: TDateTime;
FLeft, FTop: Integer;
@ -234,10 +230,20 @@ begin
Filtered := False;
Close;
sql.Clear;
sql.Add('exec P_Dye_Insp_Get_Page ');
sql.Add('@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
sql.Add(',@criteria= ' + quotedstr(WSql));
// sql.Add('exec P_Dye_Insp_Get_Page ');
// sql.Add('@pageIndex=' + inttostr(CurrentPage));
// sql.Add(',@pageSize=' + inttostr(RecordsNumber));
// sql.Add(',@criteria= ' + quotedstr(WSql));
sql.Add(' select top ' + inttostr(RecordsNumber) + ' AA.* from (');
sql.Add(' select rownumber=CAST(row_number() over(order by A.Filltime ) AS INT)');
sql.Add(',TotalCount=CAST(COUNT(1) OVER() AS INT)');
sql.Add(',* from V_Dye_Insp_Get_Page A where 1=1 ');
sql.Add(WSql);
SQL.Add(' ) AA');
sql.Add(' where rownumber> ' + inttostr(((CurrentPage - 1) * RecordsNumber)));
sql.Add(' order by rownumber');
// ShowMessage(sql.Text);
Open;
end;
@ -272,7 +278,7 @@ begin
EndDate.DateTime := SGetServerDate(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime;
fsj := 'select distinct(Filler) name from Dye_Cloth_Inspect ';
SInitComBoxBySql(ADOQueryCmd, Filler, False, fsj);
// SInitComBoxBySql(ADOQueryCmd, Filler, False, fsj);
// Filler.ItemIndex := Filler.Items.IndexOf(trim(DName));
@ -407,7 +413,7 @@ begin
Order_Main.DisableControls;
with Order_Main do
begin
MCIID := Trim(Order_Main.fieldbyname('CIID').AsString);
MCIID := Trim(Order_Main.fieldbyname('CIID').AsString);
First;
while Order_Main.Locate('SSel', True, []) do
begin
@ -544,6 +550,25 @@ begin
WriteCxGrid(Trim(self.Caption) + 'Tv1', Tv1, 'óÒ×¼ìÑé¹ÜÀí');
end;
procedure TfrmDyeClothInspList.ToolButton2Click(Sender: TObject);
begin
try
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('exec P_Auto_InspectToStock @Filler = ' + quotedStr(Trim(DName)));
ExecSQL;
end;
Application.MessageBox('操作执行成功!', '提示', MB_OK + MB_ICONINFORMATION);
except
on E: Exception do
begin
Application.MessageBox(PChar('操作执行失败:' + E.Message), '错误', MB_OK + MB_ICONERROR);
end;
end;
end;
procedure TfrmDyeClothInspList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
Clipboard.SetTextBuf(PChar(Trim(Order_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));

View File

@ -7,7 +7,6 @@
FormStyle = fsMDIChild
Position = poScreenCenter
Visible = True
ExplicitLeft = -453
ExplicitWidth = 1556
ExplicitHeight = 859
PixelsPerInch = 96
@ -38,8 +37,6 @@
ParentBackground = False
ParentFont = False
TabOrder = 0
ExplicitLeft = 2
ExplicitTop = 174
object lblLenUnit: TLabel
Left = 231
Top = 48
@ -54,23 +51,10 @@
ParentFont = False
OnClick = lblLenUnitClick
end
object Label4: TLabel
Left = 229
Top = 104
Width = 44
Height = 34
Caption = 'KG'
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -29
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label5: TLabel
Left = 3
Top = 48
Width = 60
Width = 62
Height = 34
Caption = #38271#24230
Font.Charset = ANSI_CHARSET
@ -80,19 +64,6 @@
Font.Style = [fsBold]
ParentFont = False
end
object Label11: TLabel
Left = 3
Top = 104
Width = 60
Height = 34
Caption = #37325#37327
Font.Charset = ANSI_CHARSET
Font.Color = clRed
Font.Height = -29
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label31: TLabel
Left = 186
Top = 412
@ -110,7 +81,7 @@
object Label10: TLabel
Left = 60
Top = 186
Width = 40
Width = 42
Height = 24
Caption = #27491#21697
Font.Charset = ANSI_CHARSET
@ -123,7 +94,7 @@
object Label12: TLabel
Left = 168
Top = 186
Width = 40
Width = 42
Height = 24
Caption = #27425#21697
Font.Charset = ANSI_CHARSET
@ -136,7 +107,7 @@
object Label3: TLabel
Left = 30
Top = 11
Width = 58
Width = 62
Height = 23
Caption = #31995' '#25968
Font.Charset = ANSI_CHARSET
@ -149,7 +120,7 @@
object lblRuleConversion: TLabel
Left = 181
Top = 10
Width = 80
Width = 84
Height = 24
Caption = #31859#36716#20844#26020
Font.Charset = ANSI_CHARSET
@ -175,22 +146,6 @@
OnClick = CIFBegClick
OnKeyPress = MJstr3KeyPress
end
object InputWeight: TEdit
Left = 64
Top = 101
Width = 100
Height = 41
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
OnChange = InputWeightChange
OnClick = CIFBegClick
OnKeyPress = MJstr3KeyPress
end
object BTPrint: TButton
Left = 262
Top = 170
@ -203,7 +158,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
TabOrder = 1
OnClick = BTPrintClick
end
object Button6: TButton
@ -218,7 +173,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 3
TabOrder = 2
OnClick = Button6Click
end
object Button8: TButton
@ -233,7 +188,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 4
TabOrder = 3
OnClick = Button8Click
end
object Edit3: TEdit
@ -248,7 +203,7 @@
Font.Style = [fsBold]
ParentFont = False
ReadOnly = True
TabOrder = 5
TabOrder = 4
Text = #8730
OnClick = Edit3Click
OnKeyPress = MJstr3KeyPress
@ -265,7 +220,7 @@
Font.Style = [fsBold]
ParentFont = False
ReadOnly = True
TabOrder = 6
TabOrder = 5
OnClick = Edit4Click
OnKeyPress = MJstr3KeyPress
end
@ -280,22 +235,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 7
OnClick = CIFBegClick
OnKeyPress = MJstr3KeyPress
end
object Tare: TEdit
Left = 164
Top = 101
Width = 64
Height = 41
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 8
TabOrder = 6
OnClick = CIFBegClick
OnKeyPress = MJstr3KeyPress
end
@ -311,7 +251,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 9
TabOrder = 7
OnClick = Button3Click
end
end
@ -327,7 +267,7 @@
object Label22: TLabel
Left = 20
Top = 135
Width = 84
Width = 89
Height = 19
Caption = #24320#21345' '#25968#37327#65306
Font.Charset = ANSI_CHARSET
@ -340,7 +280,7 @@
object Label13: TLabel
Left = 225
Top = 135
Width = 84
Width = 89
Height = 19
Caption = #24320#21345' '#21305#25968#65306
Font.Charset = ANSI_CHARSET
@ -353,7 +293,7 @@
object Label14: TLabel
Left = 20
Top = 47
Width = 48
Width = 51
Height = 19
Caption = #21345#21495#65306
Font.Charset = ANSI_CHARSET
@ -366,7 +306,7 @@
object Label23: TLabel
Left = 220
Top = 104
Width = 48
Width = 51
Height = 19
Caption = #39068#33394#65306
Font.Charset = ANSI_CHARSET
@ -379,7 +319,7 @@
object Label24: TLabel
Left = 20
Top = 104
Width = 48
Width = 51
Height = 19
Caption = #33394#21495#65306
Font.Charset = ANSI_CHARSET
@ -392,7 +332,7 @@
object Label25: TLabel
Left = 20
Top = 77
Width = 48
Width = 51
Height = 19
Caption = #21697#21517#65306
Font.Charset = ANSI_CHARSET
@ -405,7 +345,7 @@
object Label1: TLabel
Left = 18
Top = 7
Width = 80
Width = 84
Height = 24
Caption = #25195#25551#20837#21475
Font.Charset = ANSI_CHARSET
@ -2262,25 +2202,25 @@
ImageIndex = 21
OnClick = ToolButton3Click
end
object btnDel: TToolButton
object ToolButton6: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #20462#25913
ImageIndex = 3
OnClick = ToolButton6Click
end
object btnDel: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 5
Wrap = True
OnClick = btnDelClick
end
object ToolButton6: TToolButton
Left = 0
Top = 38
AutoSize = True
Caption = #20462#25913
ImageIndex = 3
OnClick = ToolButton6Click
end
object ToolButton4: TToolButton
Left = 71
Left = 0
Top = 38
AutoSize = True
Caption = #30133#28857#31649#29702
@ -2514,7 +2454,7 @@
object Label35: TLabel
Left = 27
Top = 55
Width = 19
Width = 21
Height = 23
Caption = #31204
Font.Charset = ANSI_CHARSET
@ -2527,7 +2467,7 @@
object Label16: TLabel
Left = 6
Top = 15
Width = 38
Width = 42
Height = 23
Caption = #30721#34920
Font.Charset = ANSI_CHARSET
@ -2540,7 +2480,7 @@
object Label26: TLabel
Left = 6
Top = 94
Width = 38
Width = 42
Height = 23
Caption = #20986#32440
Font.Charset = ANSI_CHARSET
@ -2553,7 +2493,7 @@
object Label6: TLabel
Left = 90
Top = 94
Width = 38
Width = 42
Height = 23
Caption = #20221#25968
Font.Charset = ANSI_CHARSET
@ -2566,7 +2506,7 @@
object Label7: TLabel
Left = 90
Top = 15
Width = 38
Width = 42
Height = 23
Caption = #21333#20301
Font.Charset = ANSI_CHARSET
@ -2579,7 +2519,7 @@
object Label9: TLabel
Left = 6
Top = 136
Width = 38
Width = 42
Height = 23
Caption = #38271#24230
Font.Charset = ANSI_CHARSET
@ -2589,23 +2529,10 @@
Font.Style = [fsBold]
ParentFont = False
end
object Label15: TLabel
Left = 6
Top = 178
Width = 38
Height = 23
Caption = #37325#37327
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -20
Font.Name = 'Times New Roman'
Font.Style = [fsBold]
ParentFont = False
end
object Label19: TLabel
Left = 6
Top = 224
Width = 76
Width = 84
Height = 23
Caption = #31859#25968#20445#30041
Font.Charset = ANSI_CHARSET
@ -2618,7 +2545,7 @@
object Label20: TLabel
Left = 161
Top = 224
Width = 19
Width = 21
Height = 23
Caption = #20301
Font.Charset = ANSI_CHARSET
@ -2631,7 +2558,7 @@
object Label21: TLabel
Left = 6
Top = 255
Width = 76
Width = 84
Height = 23
Caption = #30721#25968#20445#30041
Font.Charset = ANSI_CHARSET
@ -2644,7 +2571,7 @@
object Label27: TLabel
Left = 161
Top = 255
Width = 19
Width = 21
Height = 23
Caption = #20301
Font.Charset = ANSI_CHARSET
@ -2657,7 +2584,7 @@
object Label28: TLabel
Left = 161
Top = 286
Width = 19
Width = 21
Height = 23
Caption = #20301
Font.Charset = ANSI_CHARSET
@ -2670,7 +2597,7 @@
object Label33: TLabel
Left = 6
Top = 286
Width = 76
Width = 84
Height = 23
Caption = #37325#37327#20445#30041
Font.Charset = ANSI_CHARSET
@ -2683,7 +2610,7 @@
object Label34: TLabel
Left = 6
Top = 355
Width = 76
Width = 84
Height = 23
Caption = #29233#36805#26631#31614
Font.Charset = ANSI_CHARSET
@ -2797,22 +2724,6 @@
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
end
object MinWeight: TEdit
Left = 54
Top = 175
Width = 63
Height = 28
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -20
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 6
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
end
object MaxLen: TEdit
Left = 119
Top = 133
@ -2824,23 +2735,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 7
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
end
object MaxWeight: TEdit
Left = 119
Top = 175
Width = 63
Height = 28
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -20
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 8
TabOrder = 6
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
@ -2856,7 +2751,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 9
TabOrder = 7
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
@ -2872,7 +2767,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 10
TabOrder = 8
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
@ -2888,7 +2783,7 @@
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 11
TabOrder = 9
OnClick = CIFBegClick
OnExit = MinLenExit
OnKeyPress = MJstr3KeyPress
@ -2905,7 +2800,7 @@
Font.Style = [fsBold]
ParentFont = False
ReadOnly = True
TabOrder = 12
TabOrder = 10
Visible = False
OnClick = edtaixunClick
OnKeyPress = MJstr3KeyPress

Some files were not shown because too many files have changed in this diff Show More