产品 检验

This commit is contained in:
funa 2026-10-10 17:25:31 +08:00
parent 6e6c8e13de
commit e68b22ec0a
10 changed files with 626 additions and 166 deletions

View File

@ -17,6 +17,19 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object Label18: TLabel
Left = 37
Top = 166
Width = 67
Height = 12
Caption = #31576' '#21495#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object ToolBar1: TToolBar
Left = 0
Top = 0
@ -146,8 +159,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
ParentFont = False
end
object Label4: TLabel
Left = 29
Top = 71
Left = 964
Top = 40
Width = 67
Height = 12
Caption = #32428' '#23494#65306
@ -157,6 +170,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label3: TLabel
Left = 46
@ -173,8 +187,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Visible = False
end
object Label12: TLabel
Left = 360
Top = 71
Left = 964
Top = 64
Width = 67
Height = 12
Caption = #32463' '#23494#65306
@ -184,6 +198,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label6: TLabel
Left = 29
@ -199,8 +214,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
ParentFont = False
end
object Label7: TLabel
Left = 31
Top = 127
Left = 966
Top = 130
Width = 65
Height = 12
Caption = #32428#32433#35268#26684#65306
@ -210,10 +225,11 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label8: TLabel
Left = 362
Top = 127
Left = 966
Top = 112
Width = 65
Height = 12
Caption = #32463#32433#35268#26684#65306
@ -223,10 +239,11 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label9: TLabel
Left = 29
Top = 102
Left = 964
Top = 94
Width = 67
Height = 12
Caption = #35268' '#26684#65306
@ -236,6 +253,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label10: TLabel
Left = 675
@ -302,6 +320,71 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
end
object Label17: TLabel
Left = 29
Top = 68
Width = 67
Height = 12
Caption = #22836' '#20221#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label19: TLabel
Left = 30
Top = 102
Width = 66
Height = 12
Caption = #19978' '#25490' '#25968#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label23: TLabel
Left = 29
Top = 130
Width = 66
Height = 12
Caption = #23450' '#24133' '#31576#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label24: TLabel
Left = 360
Top = 68
Width = 67
Height = 12
Caption = #26465' '#23485#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label25: TLabel
Left = 362
Top = 102
Width = 67
Height = 12
Caption = #20301' '#31227#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object C_Code: TEdit
Tag = 2
Left = 93
@ -348,8 +431,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
end
object C_FinishLatitudeDensity: TEdit
Tag = 2
Left = 93
Top = 68
Left = 1037
Top = 40
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
@ -359,6 +442,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 5
Visible = False
end
object C_Width: TBtnEditC
Tag = 2
@ -396,8 +480,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
end
object C_FinishLongitudeDensity: TEdit
Tag = 2
Left = 426
Top = 68
Left = 1050
Top = 64
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
@ -407,6 +491,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 6
Visible = False
OnKeyPress = CYColorKeyPress
end
object BCIID: TEdit
@ -426,8 +511,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
end
object C_LatitudeSpec: TEdit
Tag = 2
Left = 93
Top = 124
Left = 1037
Top = 136
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
@ -437,11 +522,12 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 8
Visible = False
end
object C_LongitudeSpec: TEdit
Tag = 2
Left = 426
Top = 124
Left = 1037
Top = 112
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
@ -451,12 +537,13 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 9
Visible = False
OnKeyPress = CYColorKeyPress
end
object C_ReedNo: TEdit
object strip_width: TEdit
Tag = 2
Left = 93
Top = 155
Left = 426
Top = 68
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
@ -469,8 +556,8 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
end
object C_Spec: TEdit
Tag = 2
Left = 93
Top = 99
Left = 1037
Top = 88
Width = 567
Height = 18
Font.Charset = GB2312_CHARSET
@ -480,6 +567,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Font.Style = [fsBold]
ParentFont = False
TabOrder = 11
Visible = False
OnKeyPress = CYColorKeyPress
end
object C_MachLatitudeDensity: TEdit
@ -529,6 +617,76 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
Height = 18
TabOrder = 16
end
object head_count: TEdit
Tag = 2
Left = 93
Top = 68
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 17
end
object C_ReedNo: TEdit
Tag = 2
Left = 93
Top = 155
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 18
end
object row_count_top: TEdit
Tag = 2
Left = 93
Top = 100
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 19
end
object displace: TEdit
Tag = 2
Left = 426
Top = 99
Width = 234
Height = 18
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 20
end
object reed_width: TEdit
Tag = 2
Left = 93
Top = 127
Width = 567
Height = 18
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 21
end
end
object cxPageControl3: TcxPageControl
Left = 0
@ -637,6 +795,14 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.Header = DataLink_ClothInfo.Default
object TV1SeqNo: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'seq_no'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 46
end
object cxGridDBColumn3: TcxGridDBColumn
Caption = #21407#26009#20195#21495
DataBinding.FieldName = 'Y_Code'
@ -869,6 +1035,14 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.Header = DataLink_ClothInfo.Default
object Tv2SeqNo: TcxGridDBColumn
Caption = #24207#21495
DataBinding.FieldName = 'seq_no'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 46
end
object v2Column10: TcxGridDBColumn
Caption = #21407#26009#20195#21495
DataBinding.FieldName = 'Y_Code'
@ -1025,6 +1199,10 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
object cxTabSheet2: TcxTabSheet
Caption = ' '#32441#29256#22270' '
ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object Panel7: TPanel
Left = 0
Top = 0
@ -2081,6 +2259,10 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
object cxTabSheet3: TcxTabSheet
Caption = ' '#36215#32508#24037#33402#21333' '
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object Panel8: TPanel
Left = 0
Top = 0
@ -2213,6 +2395,75 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput
end
end
end
object cxTabSheet4: TcxTabSheet
Caption = #31359#31576#27861
ImageIndex = 3
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object reed_weave_method: TMemo
Left = 0
Top = 0
Width = 1529
Height = 350
Align = alClient
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
end
end
object cxTabSheet5: TcxTabSheet
Caption = #32463#32433#25490#21015
ImageIndex = 4
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object warp_arrange: TMemo
Left = 0
Top = 0
Width = 600
Height = 280
Align = alClient
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
end
end
object cxTabSheet6: TcxTabSheet
Caption = #32428#25490#21015
ImageIndex = 5
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object weft_arrange: TMemo
Left = 0
Top = 0
Width = 600
Height = 280
Align = alClient
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
end
end
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_ClothInfo.ADOLink

View File

@ -43,7 +43,7 @@ type
Label8: TLabel;
C_LatitudeSpec: TEdit;
C_LongitudeSpec: TEdit;
C_ReedNo: TEdit;
strip_width: TEdit;
Label9: TLabel;
C_Spec: TEdit;
CDS_1: TClientDataSet;
@ -224,6 +224,23 @@ type
Label14: TLabel;
Label16: TLabel;
ToolButton9: TToolButton;
cxTabSheet4: TcxTabSheet;
cxTabSheet5: TcxTabSheet;
head_count: TEdit;
C_ReedNo: TEdit;
row_count_top: TEdit;
displace: TEdit;
reed_width: TEdit;
warp_arrange: TMemo;
reed_weave_method: TMemo;
weft_arrange: TMemo;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label23: TLabel;
cxTabSheet6: TcxTabSheet;
Label24: TLabel;
Label25: TLabel;
procedure FormShow(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
@ -248,6 +265,7 @@ type
canshu1: string;
Fint: Integer;
procedure InitGrid();
procedure AddPresetYarnRows(ACDS: TClientDataSet);
function SaveData(): Boolean;
procedure CALCYarnQty();
{ Private declarations }
@ -352,6 +370,10 @@ begin
Open;
end;
//memo fields on tab sheets are not reached by SCSHData, load manually
warp_arrange.Text := Trim(ADOQueryTemp.fieldbyname('warp_arrange').AsString);
weft_arrange.Text := Trim(ADOQueryTemp.fieldbyname('weft_arrange').AsString);
reed_weave_method.Text := Trim(ADOQueryTemp.fieldbyname('reed_weave_method').AsString);
SCSHData(ADOQueryTemp, ScrollBox1, 2);
SCSHData(ADOQueryTemp, ScrollBox1, 0);
with ADOQueryTemp do
@ -397,6 +419,20 @@ begin
SInitCDSData(ADOQueryTemp, CDS_3);
end;
procedure TfrmTatClothInfoInput.AddPresetYarnRows(ACDS: TClientDataSet);
const
CSeq: array[0..5] of string = ('¼×', 'ÒÒ', '±û', '¶¡', 'Îì', '¼º');
var
i: Integer;
begin
for i := 0 to 5 do
begin
ACDS.Append;
ACDS.FieldByName('seq_no').Value := CSeq[i];
ACDS.Post;
end;
end;
procedure TfrmTatClothInfoInput.FormShow(Sender: TObject);
begin
inherited;
@ -501,6 +537,19 @@ begin
if trim(C_Code.Text) = '' then
C_Code.Text := Trim(maxId);
RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', ScrollBox1, 2);
//memo fields on tab sheets, save manually
if Trim(warp_arrange.Text) = '' then
ADOQueryCmd.FieldByName('warp_arrange').Value := null
else
ADOQueryCmd.FieldByName('warp_arrange').Value := Trim(warp_arrange.Text);
if Trim(weft_arrange.Text) = '' then
ADOQueryCmd.FieldByName('weft_arrange').Value := null
else
ADOQueryCmd.FieldByName('weft_arrange').Value := Trim(weft_arrange.Text);
if Trim(reed_weave_method.Text) = '' then
ADOQueryCmd.FieldByName('reed_weave_method').Value := null
else
ADOQueryCmd.FieldByName('reed_weave_method').Value := Trim(reed_weave_method.Text);
Post;
end;
with ADOQueryTemp do
@ -782,6 +831,13 @@ begin
// frmYarnInfoSel.Free;
// end;
//first click on empty grid: create the six preset rows with seq no
if CDS_1.IsEmpty then
begin
AddPresetYarnRows(CDS_1);
Exit;
end;
with self.CDS_1 do
begin
Append;
@ -836,6 +892,13 @@ begin
// frmYarnInfoSel.Free;
// end;
//first click on empty grid: create the six preset rows with seq no
if CDS_2.IsEmpty then
begin
AddPresetYarnRows(CDS_2);
Exit;
end;
with self.CDS_2 do
begin
Append;

View File

@ -133,6 +133,9 @@
<Form>frmTatMachInsp</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="U_TatConSel.pas">
<Form>frmTatConSel</Form>
</DCCReference>
<DCCReference Include="U_TatClothInspList.pas">
<Form>frmTatClothInspList</Form>
<FormType>dfm</FormType>

View File

@ -77,6 +77,7 @@ begin
DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server;
DParameters1 := '¹ÜÀí';
dname := '666';
// dname := '777';
end
else
begin

View File

@ -83,7 +83,7 @@ begin
begin
Close;
sql.Clear;
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT MCNO as name from Bs_Machine )AA');
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT MCNO as name from Bs_Machine where ISNULL(Status,0)=5 )AA');
// showmessage(sql.text);
Open;
end;

View File

@ -152,7 +152,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
item
Kind = skSum
Column = v1Column10
Column = v1MeterWithAddLength
end
item
Kind = skSum
@ -352,9 +352,9 @@ inherited frmTatClothInspList: TfrmTatClothInspList
Options.Editing = False
Width = 66
end
object v1Column10: TcxGridDBColumn
object v1MeterWithAddLength: TcxGridDBColumn
Caption = #31859#25968
DataBinding.FieldName = 'Meter'
DataBinding.FieldName = 'MeterWithAddLength'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
@ -408,10 +408,19 @@ inherited frmTatClothInspList: TfrmTatClothInspList
Options.Editing = False
Width = 66
end
object Tv1CARNO: TcxGridDBColumn
Caption = #19979#24067#26426#21488#21495
DataBinding.FieldName = 'CARNO'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80
end
object v1Column14: TcxGridDBColumn
Caption = #25187#20998
DataBinding.FieldName = 'KouFenQty'
DataBinding.IsNullValueType = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
VisibleForCustomization = False
@ -596,16 +605,24 @@ inherited frmTatClothInspList: TfrmTatClothInspList
ImageIndex = 3
OnClick = ToolButton2Click
end
object btnJBQ: TToolButton
object tbAddLen: TToolButton
Left = 332
Top = 0
AutoSize = True
Caption = #21152#38271
ImageIndex = 3
OnClick = tbAddLenClick
end
object btnJBQ: TToolButton
Left = 403
Top = 0
AutoSize = True
Caption = #25171#21360#21367#26631#31614
ImageIndex = 21
OnClick = btnJBQClick
end
object btnJYBG: TToolButton
Left = 439
Left = 510
Top = 0
AutoSize = True
Caption = #21333#25454#25171#21360
@ -613,7 +630,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
OnClick = btnJYBGClick
end
object TBExport: TToolButton
Left = 534
Left = 605
Top = 0
AutoSize = True
Caption = #23548#20986
@ -621,7 +638,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
OnClick = TBExportClick
end
object ToolButton1: TToolButton
Left = 605
Left = 676
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
@ -629,7 +646,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 700
Left = 771
Top = 0
AutoSize = True
Caption = #20851#38381
@ -694,8 +711,8 @@ inherited frmTatClothInspList: TfrmTatClothInspList
ParentFont = False
end
object Label7: TLabel
Left = 525
Top = 14
Left = 1204
Top = 31
Width = 26
Height = 12
Hint = '0'
@ -706,10 +723,11 @@ inherited frmTatClothInspList: TfrmTatClothInspList
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label8: TLabel
Left = 825
Top = 40
Left = 657
Top = 14
Width = 53
Height = 12
Hint = '1'
@ -736,8 +754,8 @@ inherited frmTatClothInspList: TfrmTatClothInspList
ParentFont = False
end
object Label4: TLabel
Left = 1001
Top = 14
Left = 515
Top = 13
Width = 26
Height = 12
Hint = '1'
@ -778,8 +796,8 @@ inherited frmTatClothInspList: TfrmTatClothInspList
ParentFont = False
end
object Label20: TLabel
Left = 525
Top = 40
Left = 1204
Top = 49
Width = 26
Height = 12
Hint = '0'
@ -790,6 +808,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label23: TLabel
Left = 195
@ -806,8 +825,8 @@ inherited frmTatClothInspList: TfrmTatClothInspList
ParentFont = False
end
object Label1: TLabel
Left = 684
Top = 14
Left = 1204
Top = 13
Width = 26
Height = 12
Hint = '0'
@ -818,6 +837,21 @@ inherited frmTatClothInspList: TfrmTatClothInspList
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label9: TLabel
Left = 515
Top = 39
Width = 26
Height = 12
Hint = '1'
Caption = #30133#28857
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object BegDate: TDateTimePicker
Left = 96
@ -871,7 +905,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
object Grade: TComboBox
Tag = 2
Left = 1030
Left = 547
Top = 10
Width = 100
Height = 20
@ -881,11 +915,9 @@ inherited frmTatClothInspList: TfrmTatClothInspList
OnChange = GradeChange
OnKeyPress = KHConNOKeyPress
Items.Strings = (
#27491#21697
#27425#21697
#22810#25340
#24453#23450
'')
'A'#21697
'B'#21697
'C'#21697)
end
object C_Name: TEdit
Tag = 2
@ -916,8 +948,8 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
object Filler: TComboBox
Tag = 2
Left = 880
Top = 36
Left = 712
Top = 10
Width = 100
Height = 20
Hint = '1'
@ -927,12 +959,13 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
object C_Color: TEdit
Tag = 2
Left = 553
Top = 10
Left = 1255
Top = 26
Width = 100
Height = 20
Hint = '0'
TabOrder = 8
Visible = False
OnKeyPress = conNOKeyPress
end
object IsJYTime: TCheckBox
@ -953,12 +986,13 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
object C_Pattern: TEdit
Tag = 2
Left = 553
Top = 36
Left = 1255
Top = 43
Width = 100
Height = 20
Hint = '0'
TabOrder = 11
Visible = False
OnKeyPress = KHConNOKeyPress
end
object C_Code: TEdit
@ -973,14 +1007,32 @@ inherited frmTatClothInspList: TfrmTatClothInspList
end
object PCId: TEdit
Tag = 2
Left = 711
Left = 1255
Top = 10
Width = 100
Height = 20
Hint = '0'
TabOrder = 13
Visible = False
OnKeyPress = KHConNOKeyPress
end
object ComboBox1: TComboBox
Left = 547
Top = 36
Width = 100
Height = 20
Hint = '1'
Style = csDropDownList
ItemIndex = 0
TabOrder = 14
Text = #20840#37096
OnChange = GradeChange
OnKeyPress = KHConNOKeyPress
Items.Strings = (
#20840#37096
#26377#30133#28857
#26080#30133#28857)
end
end
object MovePanel1: TMovePanel [5]
Left = 325

View File

@ -55,7 +55,7 @@ type
v1Column8: TcxGridDBColumn;
v1Column27: TcxGridDBColumn;
v1Column28: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1MeterWithAddLength: TcxGridDBColumn;
v1Column20: TcxGridDBColumn;
v1Column14: TcxGridDBColumn;
v1Column12: TcxGridDBColumn;
@ -108,6 +108,7 @@ type
C_Code: TEdit;
PCId: TEdit;
ToolButton2: TToolButton;
tbAddLen: TToolButton;
MovePanel1: TMovePanel;
Button1: TButton;
Button2: TButton;
@ -124,6 +125,9 @@ type
Tv1ActualDiff: TcxGridDBColumn;
Tv1C_LongBatchNo: TcxGridDBColumn;
Tv1C_LatBatchNo: TcxGridDBColumn;
Tv1CARNO: TcxGridDBColumn;
ComboBox1: TComboBox;
Label9: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
@ -157,6 +161,7 @@ type
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure tbAddLenClick(Sender: TObject);
private
DQdate: TDateTime;
FLeft, FTop: Integer;
@ -233,6 +238,85 @@ begin
TcxGridToExcel(self.Caption, cxgrid1);
end;
procedure TfrmTatClothInspList.tbAddLenClick(Sender: TObject);
var
MLen: string;
MAddLen: Double;
MCIIDS: string;
begin
if Order_Main.IsEmpty then
Exit;
if not Order_Main.Locate('SSel', True, []) then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Exit;
end;
MLen := '';
if not InputQuery('加长', '请输入加长数量:', MLen) then
Exit;
if Trim(MLen) = '' then
Exit;
if not TryStrToFloat(Trim(MLen), MAddLen) then
begin
Application.MessageBox('请输入正确的数量!', '提示', 0);
Exit;
end;
MCIIDS := '';
Order_Main.DisableControls;
try
Order_Main.First;
while not Order_Main.Eof do
begin
if Order_Main.FieldByName('SSel').AsBoolean then
begin
if MCIIDS <> '' then
MCIIDS := MCIIDS + ',' + QuotedStr(Trim(Order_Main.fieldbyname('CIID').AsString))
else
MCIIDS := QuotedStr(Trim(Order_Main.fieldbyname('CIID').AsString));
end;
Order_Main.Next;
end;
finally
Order_Main.EnableControls;
end;
if MCIIDS = '' then
Exit;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('update Tat_Cloth_Inspect set add_length=' + FloatToStr(MAddLen));
SQL.Add(' where CIID in (' + MCIIDS + ')');
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
SQL.Add(' ' + QuotedStr(Trim(DName)));
SQL.Add(',getdate() ');
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
SQL.Add(',' + QuotedStr(Trim('加长')));
SQL.Add(',' + QuotedStr(Trim(MLen + ' ' + MCIIDS)));
SQL.Add(',' + QuotedStr(Trim('成功')));
SQL.Add(')');
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
Application.MessageBox('保存成功!', '提示', 0);
InitGrid();
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
end;
end;
procedure TfrmTatClothInspList.PrintCKMDG(MRKOrdID: string);
begin
@ -254,6 +338,12 @@ begin
if trim(FWorkshop) <> '' then
WSql := WSql + ' and A.Workshop=''' + trim(FWorkshop) + '''';
//flaw filter: 0=all, 1=has flaw, 2=no flaw; F is the flaw summary join in P_Tat_Insp_Get_Page
if ComboBox1.ItemIndex = 1 then
WSql := WSql + ' and F.CIID is not null'
else if ComboBox1.ItemIndex = 2 then
WSql := WSql + ' and F.CIID is null';
if IsJYTime.Checked then
begin
WSql := WSql + ' and A.Filltime>' + quotedstr(FormatDateTime('yyyy-MM-dd', BegDate.DateTime));

View File

@ -222,6 +222,7 @@ object frmTatInspEdit: TfrmTatInspEdit
Width = 54
Height = 20
TabOrder = 4
OnChange = GrossWeightChange
end
object Meter: TEdit
Left = 373
@ -276,8 +277,9 @@ object frmTatInspEdit: TfrmTatInspEdit
Top = 41
Width = 54
Height = 20
Color = clBtnFace
ReadOnly = True
TabOrder = 8
OnChange = CalcMeterChange
end
object CodeTableLen: TEdit
Left = 261

View File

@ -72,11 +72,13 @@ type
procedure ToolButton4Click(Sender: TObject);
procedure cxGridDBColumn3PropertiesEditValueChanged(Sender: TObject);
procedure TV1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure CalcMeterChange(Sender: TObject);
procedure GrossWeightChange(Sender: TObject);
private
{ Private declarations }
FGramW: Double;
function SaveData(): Boolean;
procedure GetJYXK(FJYIP: string);
procedure UpdateCalcMeter();
public
{ Public declarations }
end;
@ -91,8 +93,6 @@ uses
{$R *.dfm}
procedure TfrmTatInspEdit.GetJYXK(FJYIP: string);
var
MGramW, MGrossW: Double;
begin
with ADOTmp do
begin
@ -112,19 +112,14 @@ begin
end;
PieceNo.Text := Trim(ADOTmp.fieldbyname('PieceNo').AsString);
//gram weight snapshot first, GrossWeight OnChange recalcs CalcMeter with it
FGramW := StrToFloatdef(Trim(ADOTmp.fieldbyname('C_GramWeight').AsString), 0);
GrossWeight.Text := Trim(ADOTmp.fieldbyname('GrossWeight').AsString);
NetWeight.Text := Trim(ADOTmp.fieldbyname('NetWeight').AsString);
Meter.Text := Trim(ADOTmp.fieldbyname('Meter').AsString);
Yardage.Text := Trim(ADOTmp.fieldbyname('Yardage').AsString);
//CalcMeter = GrossWeight / C_GramWeight (same as TV3), manual editable
MGrossW := StrToFloatdef(Trim(ADOTmp.fieldbyname('GrossWeight').AsString), 0);
MGramW := StrToFloatdef(Trim(ADOTmp.fieldbyname('C_GramWeight').AsString), 0);
if MGramW > 0 then
CalcMeter.Text := Format('%.1f', [MGrossW / MGramW])
else
CalcMeter.Text := '';
//set after CalcMeter: OnChange would sync CodeTableLen, keep DB value on load
UpdateCalcMeter();
CodeTableLen.Text := Trim(ADOTmp.fieldbyname('code_table_length').AsString);
RadioGroup1.ItemIndex := RadioGroup1.Items.IndexOf(Trim(ADOTmp.fieldbyname('Grade').AsString));
@ -413,11 +408,21 @@ begin
end;
end;
procedure TfrmTatInspEdit.CalcMeterChange(Sender: TObject);
procedure TfrmTatInspEdit.UpdateCalcMeter();
var
MGrossW: Double;
begin
//code_table_length follows the CalcMeter input
if Trim(CalcMeter.Text) <> '' then
CodeTableLen.Text := Trim(CalcMeter.Text);
//CalcMeter = GrossWeight / C_GramWeight (same as TV3), read-only display
MGrossW := StrToFloatdef(Trim(GrossWeight.Text), 0);
if FGramW > 0 then
CalcMeter.Text := Format('%.1f', [MGrossW / FGramW])
else
CalcMeter.Text := '';
end;
procedure TfrmTatInspEdit.GrossWeightChange(Sender: TObject);
begin
UpdateCalcMeter();
end;
procedure TfrmTatInspEdit.ToolButton2Click(Sender: TObject);

View File

@ -445,6 +445,7 @@ type
procedure On1201(var Message: Tmessage); message 1201; //电子称
procedure On1301(var Message: Tmessage); message 1301; //码表
procedure CalcInputLenByWeightKZ;
procedure AllocWeaverMeter(AIdx: Integer);
function RoundUpToHalf(AValue: Double): Double; //decimal 0.1-0.4 -> 0.5, 0.6-0.9 -> next integer
public
@ -860,6 +861,42 @@ begin
CalcInputLenByWeightKZ;
end;
procedure TfrmTatMachInsp.AllocWeaverMeter(AIdx: Integer);
const
CAdj = 4; //compensation meters, rule confirmed by workshop
var
L, M1, M2, M3: Double;
begin
L := StrToFloatdef(Trim(code_table_length.Text), 0);
if L <= 0 then
begin
Application.MessageBox('码表长度为空!', '提示', 0);
Exit;
end;
M1 := StrToFloatdef(Trim(OutPutQty1.Text), 0);
M2 := StrToFloatdef(Trim(OutPutQty2.Text), 0);
M3 := StrToFloatdef(Trim(OutPutQty3.Text), 0);
case AIdx of
1: //weaver1: meter = code table length
OutPutQty1.Text := FloatToStr(L);
2:
begin //weaver2: meter1+=4; meter2 = L - meter1
OutPutQty1.Text := FloatToStr(M1 + CAdj);
OutPutQty2.Text := FloatToStr(L - M1 - CAdj);
end;
3:
begin //weaver3: meter2+=4; meter3 = L - meter1 - meter2
OutPutQty2.Text := FloatToStr(M2 + CAdj);
OutPutQty3.Text := FloatToStr(L - M1 - M2 - CAdj);
end;
4:
begin //weaver4: meter3+=4; meter4 = L - meter1 - meter2 - meter3
OutPutQty3.Text := FloatToStr(M3 + CAdj);
OutPutQty4.Text := FloatToStr(L - M1 - M2 - M3 - CAdj);
end;
end;
end;
procedure TfrmTatMachInsp.JBSCPerson3Click(Sender: TObject);
begin
inherited;
@ -1511,8 +1548,34 @@ begin
end;
procedure TfrmTatMachInsp.Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
ATableView: TcxGridDBTableView;
AColActual, AColEstimated: TcxGridDBColumn;
vActual, vEstimated: Variant;
begin
if AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('Grade').Index] = '´ÎÆ·' then
if AViewInfo.GridRecord = nil then
Exit;
if not (Sender is TcxGridDBTableView) then
Exit;
ATableView := TcxGridDBTableView(Sender);
//actual diff > estimated diff: light pink, same as U_TatClothInspList
AColActual := ATableView.GetColumnByFieldName('ActualDiff');
AColEstimated := ATableView.GetColumnByFieldName('EstimatedDiff');
if (AColActual <> nil) and (AColEstimated <> nil) then
begin
vActual := AViewInfo.GridRecord.Values[AColActual.Index];
vEstimated := AViewInfo.GridRecord.Values[AColEstimated.Index];
if not (VarIsNull(vActual) or VarIsEmpty(vActual)) and
not (VarIsNull(vEstimated) or VarIsEmpty(vEstimated)) then
begin
if StrToFloatDef(VarToStr(vActual), 0) > StrToFloatDef(VarToStr(vEstimated), 0) then
ACanvas.Brush.Color := $00C0C0FF;
end;
end;
//defective roll keeps red
if AViewInfo.GridRecord.Values[ATableView.GetColumnByFieldName('Grade').Index] = '次品' then
ACanvas.Brush.Color := clRed;
end;
@ -1565,12 +1628,14 @@ end;
function TfrmTatMachInsp.SaveData(): Boolean;
var
maxno, MCIID, strsql: string;
MNewRoll: Boolean;
MInputLen, MMeter, MYardage: Double;
MInputWeight, MGrossWeight, MNetWeight, MTare: Double;
MUseLen: Double;
begin
fmainid := '';
fsubid := '';
MNewRoll := False;
if FOperationStatus = '卷条码' then
begin
MCIID := FCIID;
@ -1593,6 +1658,7 @@ begin
begin
if Trim(MCIID) = '' then
begin
MNewRoll := True; //MCIID is reassigned to the new barcode below
if not GetLSNo(ADOTmp, maxno, 'T' + Trim(SCXFlag), 'Tat_Cloth_Inspect', 4, 1) then
raise Exception.Create('获取条码失败!');
Append;
@ -1782,7 +1848,8 @@ begin
Close;
sql.Clear;
sql.Add('exec P_Tat_Insp_Up @CIID=''' + trim(MCIID) + '''');
if FOperationStatus = '²¼Æ±' then
//assign PieceNo for every new roll; editing an existing roll keeps its number
if MNewRoll then
sql.Add(',@InspType=' + QuotedStr('布票'))
else
sql.Add(',@InspType=' + QuotedStr('单卷修改'));
@ -2619,100 +2686,26 @@ begin
end;
procedure TfrmTatMachInsp.Button7Click(Sender: TObject);
var
K: Integer;
begin
inherited;
if OutPutQty1.Text = '' then
//update weaver meters on click: allocate for the highest selected weaver
K := 0;
if Trim(SCPerson.Text) <> '' then
K := 1;
if Trim(JBSCPerson.Text) <> '' then
K := 2;
if Trim(JBSCPerson3.Text) <> '' then
K := 3;
if Trim(JBSCPerson4.Text) <> '' then
K := 4;
if K = 0 then
begin
if SCPerson.Text <> '' then
begin
OutPutQty1.Text := InputLen.Text;
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤1!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty2.Text = '' then
begin
if JBSCPerson.Text <> '' then
begin
OutPutQty2.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤2!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty3.Text = '' then
begin
if JBSCPerson3.Text <> '' then
begin
OutPutQty3.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0) - STRTOFLOATDEF(OutPutQty2.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤3!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty4.Text = '' then
begin
if JBSCPerson4.Text <> '' then
begin
OutPutQty4.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0) - STRTOFLOATDEF(OutPutQty2.Text, 0) - STRTOFLOATDEF(OutPutQty3.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤4!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty5.Text = '' then
begin
if JBSCPerson5.Text <> '' then
begin
OutPutQty5.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0) - STRTOFLOATDEF(OutPutQty2.Text, 0) - STRTOFLOATDEF(OutPutQty3.Text, 0) - STRTOFLOATDEF(OutPutQty4.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤5!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty6.Text = '' then
begin
if JBSCPerson6.Text <> '' then
begin
OutPutQty6.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0) - STRTOFLOATDEF(OutPutQty2.Text, 0) - STRTOFLOATDEF(OutPutQty3.Text, 0) - STRTOFLOATDEF(OutPutQty4.Text, 0) - STRTOFLOATDEF(OutPutQty5.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤6!', 'Ìáʾ', 0);
Exit;
end;
end
else if OutPutQty7.Text = '' then
begin
if JBSCPerson7.Text <> '' then
begin
OutPutQty7.Text := FLOATTOSTR(STRTOFLOATDEF(InputLen.Text, 0) - STRTOFLOATDEF(OutPutQty1.Text, 0) - STRTOFLOATDEF(OutPutQty2.Text, 0) - STRTOFLOATDEF(OutPutQty3.Text, 0) - STRTOFLOATDEF(OutPutQty4.Text, 0) - STRTOFLOATDEF(OutPutQty5.Text, 0) - STRTOFLOATDEF(OutPutQty6.Text, 0));
end
else
begin
Application.MessageBox('ÇëÏÈÑ¡Ôñµ²³µ¹¤7!', 'Ìáʾ', 0);
Exit;
end;
Application.MessageBox('请先选择挡车工!', '提示', 0);
Exit;
end;
AllocWeaverMeter(K);
end;
procedure TfrmTatMachInsp.Button8Click(Sender: TObject);