diff --git a/A02基础产å“�管ç�†/U_CraftInfoInput.dfm b/A02基础产å“�管ç�†/U_CraftInfoInput.dfm index 21dd31b..0e93fae 100644 --- a/A02基础产å“�管ç�†/U_CraftInfoInput.dfm +++ b/A02基础产å“�管ç�†/U_CraftInfoInput.dfm @@ -444,7 +444,7 @@ object frmCraftInfoInput: TfrmCraftInfoInput Font.Style = [] ParentFont = False TabOrder = 2 - Properties.ActivePage = cxTabSheet7 + Properties.ActivePage = cxTabSheet1 Properties.CustomButtons.Buttons = <> ClientRectBottom = 420 ClientRectLeft = 2 @@ -944,6 +944,10 @@ object frmCraftInfoInput: TfrmCraftInfoInput object cxTabSheet2: TcxTabSheet Caption = #32441#29256#22270 ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object Panel7: TPanel Left = 0 Top = 0 @@ -2000,6 +2004,10 @@ object frmCraftInfoInput: TfrmCraftInfoInput 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 @@ -2019,6 +2027,10 @@ object frmCraftInfoInput: TfrmCraftInfoInput 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 diff --git a/A02基础产å“�管ç�†/U_CraftInfoSel.dfm b/A02基础产å“�管ç�†/U_CraftInfoSel.dfm index bd7c534..f4ba09b 100644 --- a/A02基础产å“�管ç�†/U_CraftInfoSel.dfm +++ b/A02基础产å“�管ç�†/U_CraftInfoSel.dfm @@ -10,9 +10,10 @@ object frmCraftInfoSel: TfrmCraftInfoSel Font.Height = -12 Font.Name = #23435#20307 Font.Style = [] + OldCreateOrder = True Position = poScreenCenter - OnShow = FormShow OnDestroy = FormDestroy + OnShow = FormShow PixelsPerInch = 96 TextHeight = 12 object ToolBar1: TToolBar @@ -23,7 +24,7 @@ object frmCraftInfoSel: TfrmCraftInfoSel Height = 38 AutoSize = True ButtonHeight = 38 - ButtonWidth = 91 + ButtonWidth = 75 Caption = 'ToolBar1' Color = clSkyBlue DisabledImages = DataLink_ClothInfo.ImageList_new32 @@ -109,8 +110,8 @@ object frmCraftInfoSel: TfrmCraftInfoSel Align = alClient TabOrder = 2 object Tv1: TcxGridDBTableView - Navigator.Buttons.CustomButtons = <> OnDblClick = Tv1DblClick + Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> DataController.DataSource = DS_1 DataController.Filter.AutoDataSetFilter = True @@ -122,123 +123,123 @@ object frmCraftInfoSel: TfrmCraftInfoSel OptionsData.Editing = False OptionsView.GroupByBox = False Styles.Header = DataLink_ClothInfo.Default - object Tv1CR_Code: TcxGridDBColumn - Caption = #24037#33402#32534#21495 - DataBinding.FieldName = 'CR_Code' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 92 - end - object Tv1CR_Name: TcxGridDBColumn - Caption = #24037#33402#21517#31216 - DataBinding.FieldName = 'CR_Name' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 150 - end - object Tv1C_Width: TcxGridDBColumn - Caption = #38376#24133 - DataBinding.FieldName = 'C_Width' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1C_GramWeight: TcxGridDBColumn - Caption = #20811#37325 - DataBinding.FieldName = 'C_GramWeight' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 81 - end - object Tv1C_Color: TcxGridDBColumn - Caption = #39068#33394 - DataBinding.FieldName = 'C_Color' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1C_YarnQty: TcxGridDBColumn - Caption = #22836#32441 - DataBinding.FieldName = 'C_YarnQty' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1head_count: TcxGridDBColumn - Caption = #22836#20221 - DataBinding.FieldName = 'head_count' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1strip_width: TcxGridDBColumn - Caption = #26465#23485 - DataBinding.FieldName = 'strip_width' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1C_MachLatitudeDensity: TcxGridDBColumn - Caption = #19978#26426#32428#23494 - DataBinding.FieldName = 'C_MachLatitudeDensity' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 81 - end - object Tv1row_count_top: TcxGridDBColumn - Caption = #19978#25490#25968 - DataBinding.FieldName = 'row_count_top' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1displace: TcxGridDBColumn - Caption = #20301#31227 - DataBinding.FieldName = 'displace' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end - object Tv1reed_width: TcxGridDBColumn - Caption = #23450#24133#31576 - DataBinding.FieldName = 'reed_width' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 81 - end - object Tv1C_ReedNo: TcxGridDBColumn - Caption = #31576#21495 - DataBinding.FieldName = 'C_ReedNo' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Header = DataLink_ClothInfo.Default - Width = 66 - end + object Tv1CR_Code: TcxGridDBColumn + Caption = #24037#33402#32534#21495 + DataBinding.FieldName = 'CR_Code' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 92 + end + object Tv1CR_Name: TcxGridDBColumn + Caption = #24037#33402#21517#31216 + DataBinding.FieldName = 'CR_Name' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 150 + end + object Tv1C_Width: TcxGridDBColumn + Caption = #38376#24133 + DataBinding.FieldName = 'C_Width' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1C_GramWeight: TcxGridDBColumn + Caption = #20811#37325 + DataBinding.FieldName = 'C_GramWeight' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 81 + end + object Tv1C_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1C_YarnQty: TcxGridDBColumn + Caption = #22836#32441 + DataBinding.FieldName = 'C_YarnQty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1head_count: TcxGridDBColumn + Caption = #22836#20221 + DataBinding.FieldName = 'head_count' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1strip_width: TcxGridDBColumn + Caption = #26465#23485 + DataBinding.FieldName = 'strip_width' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1C_MachLatitudeDensity: TcxGridDBColumn + Caption = #19978#26426#32428#23494 + DataBinding.FieldName = 'C_MachLatitudeDensity' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 81 + end + object Tv1row_count_top: TcxGridDBColumn + Caption = #19978#25490#25968 + DataBinding.FieldName = 'row_count_top' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1displace: TcxGridDBColumn + Caption = #20301#31227 + DataBinding.FieldName = 'displace' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1reed_width: TcxGridDBColumn + Caption = #23450#24133#31576 + DataBinding.FieldName = 'reed_width' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 81 + end + object Tv1C_ReedNo: TcxGridDBColumn + Caption = #31576#21495 + DataBinding.FieldName = 'C_ReedNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/A02基础产å“�管ç�†/U_CraftInfoSel.pas b/A02基础产å“�管ç�†/U_CraftInfoSel.pas index fb003f3..42c3d33 100644 --- a/A02基础产å“�管ç�†/U_CraftInfoSel.pas +++ b/A02基础产å“�管ç�†/U_CraftInfoSel.pas @@ -9,7 +9,7 @@ uses cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGrid, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator, - dxDateRanges, dxBarBuiltInMenu, dxScrollbarAnnotations, cxCheckBox; + dxDateRanges, dxBarBuiltInMenu, dxScrollbarAnnotations, cxCheckBox, dxSkinWXI; type TfrmCraftInfoSel = class(TForm) diff --git a/A02基础产å“�管ç�†/U_TatClothInfo.dfm b/A02基础产å“�管ç�†/U_TatClothInfo.dfm index 50ebd60..1ff0291 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfo.dfm +++ b/A02基础产å“�管ç�†/U_TatClothInfo.dfm @@ -85,7 +85,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = TBMLEditClick end object TBBindCraft: TToolButton - Left = 497 + Left = 521 Top = 0 AutoSize = True Caption = #32465#23450#24037#33402 @@ -93,7 +93,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = TBBindCraftClick end object tbStart: TToolButton - Left = 521 + Left = 616 Top = 0 AutoSize = True Caption = #21551#29992 @@ -101,7 +101,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = tbStartClick end object tbPause: TToolButton - Left = 592 + Left = 687 Top = 0 AutoSize = True Caption = #26242#20572#20351#29992 @@ -109,7 +109,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = tbPauseClick end object TBDel: TToolButton - Left = 687 + Left = 782 Top = 0 AutoSize = True Caption = #21024#38500 @@ -117,7 +117,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = TBDelClick end object ToolButton3: TToolButton - Left = 758 + Left = 853 Top = 0 AutoSize = True Caption = #26631#31614#25171#21360 @@ -125,7 +125,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = ToolButton3Click end object ToolButton4: TToolButton - Left = 853 + Left = 948 Top = 0 AutoSize = True Caption = #24037#33402#25171#21360 @@ -133,7 +133,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = ToolButton4Click end object TBExport: TToolButton - Left = 948 + Left = 1043 Top = 0 AutoSize = True Caption = #23548#20986 @@ -141,7 +141,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = TBExportClick end object TBUP: TToolButton - Left = 1019 + Left = 1114 Top = 0 AutoSize = True Caption = #22270#29255#19978#20256 @@ -149,7 +149,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = TBUPClick end object ToolButton2: TToolButton - Left = 1114 + Left = 1209 Top = 0 AutoSize = True Caption = #20445#23384#26684#24335 @@ -157,7 +157,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo OnClick = ToolButton2Click end object TBClose: TToolButton - Left = 1209 + Left = 1304 Top = 0 AutoSize = True Caption = #20851#38381 @@ -354,6 +354,8 @@ inherited frmTatClothInfo: TfrmTatClothInfo Align = alClient PopupMenu = PM_1 TabOrder = 0 + ExplicitLeft = 6 + ExplicitTop = 66 object Tv1: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> Navigator.Buttons.Delete.Enabled = False @@ -379,6 +381,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo DataBinding.FieldName = 'SSel' DataBinding.IsNullValueType = True PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True HeaderAlignmentHorz = taCenter Styles.Header = DataLink_ClothInfo.Default Width = 41 @@ -429,6 +432,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo Caption = #32428#23494 DataBinding.FieldName = 'C_FinishLatitudeDensity' DataBinding.IsNullValueType = True + Visible = False HeaderAlignmentHorz = taCenter Options.Editing = False Width = 66 @@ -437,6 +441,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo Caption = #32463#23494 DataBinding.FieldName = 'C_FinishLongitudeDensity' DataBinding.IsNullValueType = True + Visible = False HeaderAlignmentHorz = taCenter Options.Editing = False Width = 80 @@ -445,6 +450,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo Caption = #32428#32433#35268#26684 DataBinding.FieldName = 'C_LatitudeSpec' DataBinding.IsNullValueType = True + Visible = False HeaderAlignmentHorz = taCenter Options.Editing = False Width = 80 @@ -453,6 +459,7 @@ inherited frmTatClothInfo: TfrmTatClothInfo Caption = #32463#32433#35268#26684 DataBinding.FieldName = 'C_LongitudeSpec' DataBinding.IsNullValueType = True + Visible = False HeaderAlignmentHorz = taCenter Width = 80 end diff --git a/A02基础产å“�管ç�†/U_TatClothInfo.pas b/A02基础产å“�管ç�†/U_TatClothInfo.pas index 6082d7a..8a96bd9 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfo.pas +++ b/A02基础产å“�管ç�†/U_TatClothInfo.pas @@ -636,7 +636,6 @@ begin adoqueryPicture.EnableControls; finally jpg.free; - application.ProcessMessages; end; end; @@ -747,7 +746,12 @@ var 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); + cbbHX.OnChange := nil; + try + SInitComBoxBySql(ADOQueryTemp, cbbHX, True, fsj); + finally + cbbHX.OnChange := cbbHXChange; + end; InitImage(); end; @@ -988,34 +992,66 @@ end; procedure TfrmTatClothInfo.TBBindCraftClick(Sender: TObject); var - MBCIIDS, MCRID: string; + MBCIIDS, MCRID, MCRCode, MCodeList: string; + MIds: TStringList; + i, MCount: Integer; begin if CDS_1.IsEmpty then Exit; - //¹´Ñ¡ÓÅÏÈ,δ¹´Ñ¡Ê±È¡µ±Ç°ÐÐ - MBCIIDS := ''; - CDS_1.DisableControls; + //¶µµ×Ìá½»»¹´¦Óڱ༭״̬µÄ¹´Ñ¡Öµ + if CDS_1.State in dsEditModes then + CDS_1.Post; + + if not CDS_1.Locate('SSel', True, []) then + begin + Application.MessageBox('ûÓÐÑ¡ÔñÊý¾Ý!', 'Ìáʾ', 0); + Exit; + end; + + //Ö±½Ó±éÀúCDSÊÕ¼¯¹´Ñ¡ÐÐ(ÓëÆôÓÃ/ÔÝÍ£Ò»ÖÂ),²»¾­SelCDSKeyÆ´´®Ôٲ𴮠+ MIds := TStringList.Create; try - CDS_1.First; - while not CDS_1.Eof do - begin - if CDS_1.fieldbyname('SSel').AsBoolean then + MCodeList := ''; + CDS_1.DisableControls; + try + CDS_1.First; + while not CDS_1.Eof do begin - if MBCIIDS <> '' then - MBCIIDS := MBCIIDS + ',' + QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)) - else - MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)); + if CDS_1.fieldbyname('SSel').AsBoolean then + begin + MIds.Add(Trim(CDS_1.fieldbyname('BCIID').AsString)); + if MCodeList <> '' then + MCodeList := MCodeList + #13#10; + MCodeList := MCodeList + Trim(CDS_1.fieldbyname('C_Code').AsString); + end; + CDS_1.Next; end; - CDS_1.Next; + CDS_1.Locate('SSel', True, []); + finally + CDS_1.EnableControls; + end; + + MCount := MIds.Count; + if MCount = 0 then + begin + Application.MessageBox('ûÓÐÑ¡ÔñÊý¾Ý!', 'Ìáʾ', 0); + Exit; + end; + + MBCIIDS := ''; + for i := 0 to MCount - 1 do + begin + if MBCIIDS <> '' then + MBCIIDS := MBCIIDS + ','; + MBCIIDS := MBCIIDS + QuotedStr(MIds[i]); end; finally - CDS_1.EnableControls; + MIds.Free; end; - if MBCIIDS = '' then - MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)); MCRID := ''; + MCRCode := ''; try frmCraftInfoSel := TfrmCraftInfoSel.Create(Application); with frmCraftInfoSel do @@ -1023,7 +1059,10 @@ begin if ShowModal = 1 then begin if not CDS_1.IsEmpty then + begin MCRID := Trim(CDS_1.fieldbyname('CRID').AsString); + MCRCode := Trim(CDS_1.fieldbyname('CR_Code').AsString); + end; end; end; finally @@ -1032,6 +1071,11 @@ begin if Trim(MCRID) = '' then Exit; + if Application.MessageBox( + PChar('È·¶¨½«¹¤ÒÕ [' + MCRCode + '] °ó¶¨µ½ÒÔÏ ' + IntToStr(MCount) + ' ¸ö²úÆ·Âð?' + #13#10 + MCodeList), + 'Ìáʾ', 32 + 4) <> IDYES then + Exit; + try ADOQueryCmd.Connection.BeginTrans; //°ó¶¨¶¯×÷±¾ÉíֻдCRID(¹¤ÒÕ×Ö¶ÎÖµÓɾ²Ä¬Í¬²½Î¬»¤) @@ -1055,7 +1099,7 @@ begin SQL.Add(',getdate() '); SQL.Add(',' + QuotedStr(Trim(self.Caption))); SQL.Add(',' + QuotedStr(Trim('°ó¶¨¹¤ÒÕ'))); - SQL.Add(',' + QuotedStr(Trim(MBCIIDS + ' -> ' + MCRID))); + SQL.Add(',' + QuotedStr(Trim(MCRID + ':' + MBCIIDS))); SQL.Add(',' + QuotedStr(Trim('³É¹¦'))); SQL.Add(')'); ExecSQL; diff --git a/A02基础产å“�管ç�†/U_TatClothInfoInput.dfm b/A02基础产å“�管ç�†/U_TatClothInfoInput.dfm index 7460648..bb88989 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfoInput.dfm +++ b/A02基础产å“�管ç�†/U_TatClothInfoInput.dfm @@ -676,7 +676,7 @@ object frmTatClothInfoInput: TfrmTatClothInfoInput object reed_width: TEdit Tag = 2 Left = 93 - Top = 127 + Top = 124 Width = 567 Height = 18 Font.Charset = GB2312_CHARSET diff --git a/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.dfm b/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.dfm index b13a4f7..beaa80d 100644 --- a/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.dfm +++ b/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.dfm @@ -11,7 +11,6 @@ inherited frmSalesConInPut: TfrmSalesConInPut OldCreateOrder = True Position = poScreenCenter WindowState = wsMaximized - ExplicitLeft = -200 ExplicitWidth = 1522 ExplicitHeight = 730 PixelsPerInch = 96 diff --git a/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.pas b/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.pas index 02639b9..8b98cb7 100644 --- a/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.pas +++ b/B01基础å�ˆå�Œç®¡ç�†/U_SalesConInPut.pas @@ -843,7 +843,7 @@ begin begin Close; sql.Clear; - sql.Add('select * from Trade_Plan_Sub where ConSId=''' + Trim(Order_Sub.fieldbyname('ConSId').AsString) + ''''); + sql.Add('select * from Tat_Plan_Sub where ConSId=''' + Trim(Order_Sub.fieldbyname('ConSId').AsString) + ''''); open; end; if ADOTemp.IsEmpty = false then diff --git a/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.dfm b/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.dfm index f16949a..4c97819 100644 --- a/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.dfm +++ b/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.dfm @@ -2767,6 +2767,14 @@ Options.Editing = False Width = 50 end + object Tv3CARNO: TcxGridDBColumn + Caption = #26426#21488#21495 + DataBinding.FieldName = 'CARNO' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end end object cxGridLevel2: TcxGridLevel GridView = Tv3 @@ -2925,6 +2933,10 @@ object 查看: TcxTabSheet Caption = #26597#30475 ImageIndex = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object cxGrid1: TcxGrid Left = 0 Top = 0 @@ -3609,7 +3621,7 @@ object Panel3: TPanel [4] Left = 8 Top = 508 - Width = 1086 + Width = 361 Height = 209 BevelInner = bvRaised BevelOuter = bvLowered @@ -3796,6 +3808,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton84: TSpeedButton @@ -3810,6 +3823,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton85: TSpeedButton @@ -3824,6 +3838,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton86: TSpeedButton @@ -3838,6 +3853,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton87: TSpeedButton @@ -3852,6 +3868,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton88: TSpeedButton @@ -3866,6 +3883,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton89: TSpeedButton @@ -3880,6 +3898,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton90: TSpeedButton @@ -3894,6 +3913,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton91: TSpeedButton @@ -3908,6 +3928,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton92: TSpeedButton @@ -3922,6 +3943,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton93: TSpeedButton @@ -3937,6 +3959,7 @@ Font.Name = #40657#20307 Font.Style = [fsBold] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton94: TSpeedButton @@ -3951,6 +3974,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton95: TSpeedButton @@ -3965,6 +3989,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton96: TSpeedButton @@ -3979,6 +4004,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton97: TSpeedButton @@ -3993,6 +4019,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton98: TSpeedButton @@ -4007,6 +4034,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton99: TSpeedButton @@ -4021,6 +4049,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton100: TSpeedButton @@ -4035,6 +4064,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton101: TSpeedButton @@ -4049,6 +4079,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton102: TSpeedButton @@ -4063,6 +4094,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton103: TSpeedButton @@ -4077,6 +4109,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton104: TSpeedButton @@ -4091,6 +4124,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton105: TSpeedButton @@ -4106,6 +4140,7 @@ Font.Name = #40657#20307 Font.Style = [fsBold] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton106: TSpeedButton @@ -4120,6 +4155,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton107: TSpeedButton @@ -4135,6 +4171,7 @@ Font.Name = #40657#20307 Font.Style = [fsBold] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton108: TSpeedButton @@ -4149,6 +4186,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton109: TSpeedButton @@ -4163,6 +4201,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton110: TSpeedButton @@ -4177,6 +4216,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton111: TSpeedButton @@ -4191,6 +4231,7 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton112: TSpeedButton @@ -4205,10 +4246,11 @@ Font.Name = #40657#20307 Font.Style = [] ParentFont = False + Visible = False OnClick = SpeedButton1Click end object SpeedButton113: TSpeedButton - Left = 1013 + Left = 288 Top = 1 Width = 70 Height = 70 diff --git a/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.pas b/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.pas index f9976d4..0c8f9d5 100644 --- a/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.pas +++ b/E03梭织å�¯å¸ƒæ£€éªŒ/U_TatMachInsp.pas @@ -1,7 +1,5 @@ unit U_TatMachInsp; - interface - uses Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, @@ -16,7 +14,6 @@ uses IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase, ShellAPI, IdFTP, FireDAC.Stan.StorageXML, cxPC, XMLDoc, XMLIntf, DateUtils, cxMaskEdit, cxButtonEdit, BtnEdit, dxScrollbarAnnotations, dxCoreGraphics, dxSkinWXI; - type TfrmTatMachInsp = class(TfrmBaseList) cxStyleRepository1: TcxStyleRepository; @@ -351,6 +348,7 @@ type Label60: TLabel; Label61: TLabel; Tv3c_name: TcxGridDBColumn; + Tv3CARNO: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); @@ -461,30 +459,24 @@ type fFlileFlag: string; { Public declarations } end; - var frmTatMachInsp: TfrmTatMachInsp; newh, newh1: hwnd; - implementation - uses U_DataLink, U_RTFun, U_ZDYHelp, U_iniParam, U_EmployeeSel, U_TatClothInfoSel, U_SCPersonColor, U_SCPersonColor5, U_TatConSel; - {$R *.dfm} function TfrmTatMachInsp.FormatQty2(AValue: Double): string; var S: string; begin S := FormatFloat('0.00', AValue); - if (Length(S) >= 3) and (Copy(S, Length(S) - 2, 3) = '.00') then Result := Copy(S, 1, Length(S) - 3) else Result := S; end; - procedure TfrmTatMachInsp.CalcInputLenByWeightKZ; var W, AW, KZValue: Double; @@ -493,84 +485,68 @@ begin Exit; if Trim(KZ.Text) = '' then Exit; - if not TryStrToFloat(Trim(InputWeight.Text), W) then Exit; if not TryStrToFloat(Trim(add_weight.Text), AW) then AW := 0; if not TryStrToFloat(Trim(KZ.Text), KZValue) then Exit; - if KZValue = 0 then begin InputLen.Text := ''; Exit; end; - // InputLen.Text := FormatFloat('0.##', (W + AW) / KZValue); - InputLen.Text := FormatFloat('0.#', RoundUpToHalf(RoundFloat((W + AW) / KZValue, 1))); +// InputLen.Text := FormatFloat('0.#', RoundUpToHalf(RoundFloat((W + AW) / KZValue, 1))); + InputLen.Text := FormatFloat('0.#', RoundFloat((W + AW) / KZValue, 1)); end; - procedure TfrmTatMachInsp.SetINIFile(); begin if edtChen.Text = '¡Ì' then IsDZCDYDll := '1' else IsDZCDYDll := '0'; - if edtMaBiao.Text = '¡Ì' then IsMBDYDll := '1' else IsMBDYDll := '0'; - if edtMBDW.Text = '¡Ì' then IsMBDYDllUnit := '1' else IsMBDYDllUnit := '0'; - LabQty := ComboBox1.Text; FMinLen := MinLen.Text; FMaxLen := MaxLen.Text; FMinWeight := MinWeight.Text; FMaxWeight := MaxWeight.Text; - FMPlace := MPlace.Text; FYPlace := YPlace.Text; FKgPlace := KgPlace.Text; - WriteINIFile(); - end; - procedure TfrmTatMachInsp.GetINIFile(); begin if IsDZCDYDll = '1' then edtChen.Text := '¡Ì' else edtChen.Text := ''; - if IsMBDYDll = '1' then edtMaBiao.Text := '¡Ì' else edtMaBiao.Text := ''; - if IsMBDYDllUnit = '1' then edtMBDW.Text := '¡Ì' else edtMBDW.Text := ''; - ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(trim(LabQty)); - MinLen.Text := FMinLen; MaxLen.Text := FMaxLen; MinWeight.Text := FMinWeight; MaxWeight.Text := FMaxWeight; - MPlace.Text := FMPlace; YPlace.Text := FYPlace; KgPlace.Text := FKgPlace; end; - procedure TfrmTatMachInsp.SetDdetails(); begin // AOrdDefNote1.Text := ''; @@ -578,15 +554,12 @@ begin // AOrdDefNote1.Text := AOrdDefNote1.Text + 'Æ·Ãû:' + FC_Name + #13; // AOrdDefNote1.Text := AOrdDefNote1.Text + 'ÑÕÉ«:' + FC_Color + #13; // AOrdDefNote1.Text := AOrdDefNote1.Text + 'É«ºÅ:' + FC_ColorNo + #13; - end; - procedure TfrmTatMachInsp.SetUnit(MUnit: string); begin lblLenUnit.Caption := MUnit; lblLenUnit1.Caption := MUnit; end; - procedure TfrmTatMachInsp.InitImage(YFTPName: string); begin // with ADOQueryImage do @@ -599,7 +572,6 @@ begin // open; // end; end; - procedure TfrmTatMachInsp.InitImageHX(HXSID: string); begin // with Qry_ImgHX do @@ -612,7 +584,6 @@ begin // open; // end; end; - procedure TfrmTatMachInsp.QuantityConversion(); begin if lblRuleConversion.Caption = 'Ã×ת¹«½ï' then @@ -624,7 +595,6 @@ begin InputLen.Text := floattostr(StrToFloatdef(trim(InputWeight.Text), 0) * StrToFloatdef(trim(Coefficient.Text), 0)); end; end; - function TfrmTatMachInsp.CheckData(CKType: string): Boolean; var mvalue: Double; @@ -632,7 +602,6 @@ begin try // if Trim(FPCId) = '' then // raise Exception.Create('ÇëɨÃèÁ÷³Ì¿¨£¡'); - if Trim(CKType) = 'Ìá½»' then begin if trim(CodeName.text) = '' then @@ -641,14 +610,12 @@ begin raise Exception.Create('»ų́ºÅ²»ÄÜΪ¿Õ!'); // if trim(SCPerson.text) = '' then // raise Exception.Create('µ²³µ1²»ÄÜΪ¿Õ!'); - if trim(JBSCPerson.text) <> '' then begin if OutPutQty2.Text = '' then begin raise Exception.Create('µ²³µ2²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; if trim(JBSCPerson3.text) <> '' then begin @@ -656,7 +623,6 @@ begin begin raise Exception.Create('µ²³µ3²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; if trim(JBSCPerson4.text) <> '' then begin @@ -664,7 +630,6 @@ begin begin raise Exception.Create('µ²³µ4²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; if trim(JBSCPerson5.text) <> '' then begin @@ -672,7 +637,6 @@ begin begin raise Exception.Create('µ²³µ5²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; if trim(JBSCPerson6.text) <> '' then begin @@ -680,7 +644,6 @@ begin begin raise Exception.Create('µ²³µ6²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; if trim(JBSCPerson7.text) <> '' then begin @@ -688,12 +651,9 @@ begin begin raise Exception.Create('µ²³µ7²»Îª¿ÕʱÃ×Êý²»ÄÜΪ¿Õ!'); end; - end; - if trim(lblLenUnit.Caption) = '' then raise Exception.Create('³¤¶Èµ¥Î»²»ÄÜΪ¿Õ!'); - if Trim(InputWeight.Text) <> '' then begin if TryStrToFloat(InputWeight.Text, mvalue) = False then @@ -703,13 +663,11 @@ begin if strtofloatdef(trim(InputWeight.Text), 0) > Strtofloatdef(MaxWeight.Text, 0) then raise Exception.Create('ÖØÁ¿²»ÄÜ´óÓÚ' + MaxWeight.Text + '!'); end; - if Trim(add_weight.Text) <> '' then begin if TryStrToFloat(add_weight.Text, mvalue) = False then raise Exception.Create('¼ÓÖØÂ¼Èë´íÎó!'); end; - if Trim(InputLen.Text) <> '' then begin if TryStrToFloat(InputLen.Text, mvalue) = False then @@ -719,7 +677,6 @@ begin if strtofloatdef(trim(InputLen.Text), 0) > Strtofloatdef(MaxLen.Text, 0) then raise Exception.Create('³¤¶È²»ÄÜ´óÓÚ' + MaxLen.Text + 'Ã×!'); end; - if (strtofloatdef(trim(InputLen.Text), 0) = 0) and (strtofloatdef(trim(InputWeight.Text), 0) = 0) then raise Exception.Create('³¤¶ÈºÍÖØÁ¿²»Äܶ¼Îª0!!'); end; @@ -729,7 +686,6 @@ begin application.MessageBox(PChar(Exception(ExceptObject).Message), 'ÌáʾÐÅÏ¢', 0); end; end; - procedure TfrmTatMachInsp.ClearGlobal(); begin FOrderNo := ''; @@ -767,7 +723,6 @@ begin C_LongitudeBatchNo.Text := ''; C_LatitudeBatchNo.Text := ''; end; - procedure TfrmTatMachInsp.LookImage(FileName: string); var sFieldName: string; @@ -804,14 +759,12 @@ begin IdFTP1.Quit; ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL); end; - procedure TfrmTatMachInsp.Pic_Image1DblClick(Sender: TObject); begin if TcxDBImage(Sender).Picture.Height = 0 then exit; LookImage(ADOQueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring); end; - procedure TfrmTatMachInsp.InitLCK(MPCId: string); begin with ADOTmp do @@ -822,7 +775,6 @@ begin sql.Add('EXEC P_Tat_Insp_Get_ORDERNO @MAINID=''' + Trim(MPCId) + ''''); Open; end; - if ADOTmp.IsEmpty = False then begin // if Trim(ADOTmp.fieldbyname('Status').AsString) <> '9' then @@ -841,7 +793,6 @@ begin FMainId := Trim(ADOTmp.fieldbyname('MainId').AsString); FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString); // FPCId := Trim(ADOTmp.fieldbyname('PCId').AsString); - // FWorkshop := Trim(ADOTmp.fieldbyname('Workshop').AsString); FC_Code := Trim(ADOTmp.fieldbyname('C_Code').AsString); FC_Name := Trim(ADOTmp.fieldbyname('C_Name').AsString); @@ -853,10 +804,8 @@ begin FC_Pattern := Trim(ADOTmp.fieldbyname('C_Pattern').AsString); // FLoom := Trim(ADOTmp.fieldbyname('Loom').AsString); // FBatchNO := Trim(ADOTmp.fieldbyname('BatchNO').AsString); - // PieceNo.Text := Trim(ADOTmp.fieldbyname('maxRoll').AsString); Coefficient.Text := '0'; - CodeName.Text := FC_Name; // BatchNO.Text := FBatchNO; spec.Text := FC_Spec; @@ -865,31 +814,25 @@ begin KZ.Text := FC_GramWeight; Label14.Caption := Trim(ADOTmp.fieldbyname('orderno').AsString); Loom.Text := FLoom; - // Repairer.Text := Trim(ADOTmp.fieldbyname('Repairer').AsString); SetDdetails(); InputLen.SetFocus; CIFBegClick(InputLen); end; - end else begin application.MessageBox('¼Æ»®µ¥²»´æÔÚ£¡', 'ÌáʾÐÅÏ¢', MB_ICONERROR); ClearGlobal(); end; - InitJYGrid(); InitCDGrid(FCIID); edtScan.Text := ''; - end; - procedure TfrmTatMachInsp.InputWeightChange(Sender: TObject); begin CalcInputLenByWeightKZ; end; - procedure TfrmTatMachInsp.AllocWeaverMeter(AIdx: Integer); const CAdj = 4; @@ -902,27 +845,22 @@ 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: OutPutQty1.Text := FormatQty2(L); - 2: begin OutPutQty1.Text := FormatQty2(M1 + CAdj); OutPutQty2.Text := FormatQty2(L - M1 - CAdj); end; - 3: begin OutPutQty2.Text := FormatQty2(M2 + CAdj); OutPutQty3.Text := FormatQty2(L - M1 - M2 - CAdj); end; - 4: begin OutPutQty3.Text := FormatQty2(M3 + CAdj); @@ -930,7 +868,6 @@ begin end; end; end; - procedure TfrmTatMachInsp.JBSCPerson3Click(Sender: TObject); begin inherited; @@ -949,7 +886,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPerson4Click(Sender: TObject); begin inherited; @@ -968,7 +904,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPerson5Click(Sender: TObject); begin inherited; @@ -987,7 +922,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPerson6Click(Sender: TObject); begin try @@ -1005,7 +939,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPerson7Click(Sender: TObject); begin try @@ -1023,7 +956,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPersonClick(Sender: TObject); begin inherited; @@ -1042,7 +974,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.JBSCPersonPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try @@ -1060,17 +991,14 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.KZChange(Sender: TObject); begin CalcInputLenByWeightKZ; end; - procedure TfrmTatMachInsp.add_weightChange(Sender: TObject); begin CalcInputLenByWeightKZ; end; - procedure TfrmTatMachInsp.InitJTM(MCIID: string); begin with ADOTmp do @@ -1110,9 +1038,7 @@ begin FCIID := MCIID; InitCDGrid(MCIID); end; - end; - procedure TfrmTatMachInsp.CloseCom(DllName: string); type TMyFunc = function(sCommName: PAnsiChar): HWND; stdcall; @@ -1133,7 +1059,6 @@ begin end else begin - end; finally // FreeLibrary(Th1); @@ -1144,7 +1069,6 @@ begin application.MessageBox(Pchar('ÕÒ²»µ½ ' + trim(DllName) + ' Îļþ£¡'), 'Ìáʾ'); end; end; - procedure TfrmTatMachInsp.codeClick(Sender: TObject); var i: Integer; @@ -1152,7 +1076,6 @@ begin panel3.Visible := true; with Panel3 do begin - for i := 0 to ControlCount - 1 do begin if Controls[i] is TSpeedButton then @@ -1162,14 +1085,11 @@ begin end; end; end; - procedure TfrmTatMachInsp.codeExit(Sender: TObject); begin if Trim(code.Text) = '' then Exit; - code.Text := Trim(code.Text); - with ADOTmp do begin Close; @@ -1177,7 +1097,6 @@ begin SQL.Add('SELECT * FROM Bs_Cloth_Info WHERE C_Code = ' + QuotedStr(code.Text)); Open; end; - if (not ADOTmp.IsEmpty) and (ADOTmp.FieldByName('Status').AsInteger = 5) then begin code.Text := Trim(ADOTmp.FieldByName('C_Code').AsString); @@ -1187,7 +1106,6 @@ begin SPEC.Text := Trim(ADOTmp.FieldByName('C_SPEC').AsString); C_LongitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LongitudeBatchNo').AsString); C_LatitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LatitudeBatchNo').AsString); - FMainId := ''; FSubId := ''; Label14.Caption := '¶©µ¥ºÅ'; @@ -1206,14 +1124,11 @@ begin C_LatitudeBatchNo.Text := ''; end; end; - procedure TfrmTatMachInsp.CodeNameExit(Sender: TObject); begin if Trim(CodeName.Text) = '' then Exit; - CodeName.Text := Trim(CodeName.Text); - with ADOTmp do begin Close; @@ -1221,7 +1136,6 @@ begin SQL.Add('SELECT * FROM Bs_Cloth_Info WHERE C_Name = ' + QuotedStr(CodeName.Text)); Open; end; - if (not ADOTmp.IsEmpty) and (ADOTmp.FieldByName('Status').AsInteger = 5) then begin code.Text := Trim(ADOTmp.FieldByName('C_Code').AsString); @@ -1231,7 +1145,6 @@ begin SPEC.Text := Trim(ADOTmp.FieldByName('C_SPEC').AsString); C_LongitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LongitudeBatchNo').AsString); C_LatitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LatitudeBatchNo').AsString); - FMainId := ''; FSubId := ''; Label14.Caption := '¶©µ¥ºÅ'; @@ -1250,12 +1163,10 @@ begin C_LatitudeBatchNo.Text := ''; end; end; - procedure TfrmTatMachInsp.ComboBox1Change(Sender: TObject); begin SetINIFile(); end; - procedure TfrmTatMachInsp.OpenCom(DllName: string); type TMyFunc = function(fhandle: hwnd; sCommName: PAnsiChar; IntTime: integer; IsMessage: integer): HWND; stdcall; @@ -1295,7 +1206,6 @@ begin application.MessageBox(Pchar('ÕÒ²»µ½ ' + trim(DllName) + ' Îļþ£¡'), 'Ìáʾ'); end; end; - procedure TfrmTatMachInsp.OutPutQty1Change(Sender: TObject); begin inherited; @@ -1303,9 +1213,7 @@ begin begin OutPutQty2.Text := floattostr(strtofloatdef(InputLen.Text, 0) - strtofloatdef(OutPutQty1.Text, 0)); end; - end; - procedure TfrmTatMachInsp.OutPutQty1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; @@ -1314,7 +1222,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤1!'); end; end; - procedure TfrmTatMachInsp.OutPutQty2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; @@ -1323,7 +1230,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤2!'); end; end; - procedure TfrmTatMachInsp.OutPutQty3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; @@ -1332,7 +1238,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤3!'); end; end; - procedure TfrmTatMachInsp.OutPutQty4MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; @@ -1341,7 +1246,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤4!'); end; end; - procedure TfrmTatMachInsp.OutPutQty5MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; @@ -1350,7 +1254,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤5!'); end; end; - procedure TfrmTatMachInsp.OutPutQty6MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Trim(JBSCPerson6.Text) = '' then @@ -1358,7 +1261,6 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤6!'); end; end; - procedure TfrmTatMachInsp.OutPutQty7MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Trim(JBSCPerson7.Text) = '' then @@ -1366,36 +1268,34 @@ begin raise Exception.Create('ÏÈÊäÈëµ²³µ¹¤7!'); end; end; - procedure TfrmTatMachInsp.FormDestroy(Sender: TObject); begin inherited; frmTatMachInsp := nil; end; - procedure TfrmTatMachInsp.On1301(var Message: Tmessage); var i1, i2: integer; unitname: string; fdata: double; - MLen: string; begin i1 := Message.WParam; i2 := Message.LParam; - if (trim(edtMaBiao.Text) = '¡Ì') then begin // InputLen.Text := format('%.1f', [i1 / 100000]); // MLen := Format('%.1f', [i1 / 100000]); - MLen := FormatFloat('0.#', RoundUpToHalf(RoundFloat(i1 / 100000, 1))); +// MLen := FormatFloat('0.#', RoundUpToHalf(RoundFloat(i1 / 100000, 1))); + MLen := FormatFloat('0.#', RoundFloat(i1 / 100000, 1)); if Trim(edtMax.Text) = '¡Ì' then begin code_table_length.Text := MLen; end else begin - InputLen.Text := MLen; +// InputLen.Text := MLen; + InputLen.Text := FormatFloat('0.#', RoundFloat(i1 / 100000, 1)); code_table_length.Text := MLen; end; end; @@ -1411,7 +1311,6 @@ begin end; end; end; - procedure TfrmTatMachInsp.On1201(var Message: Tmessage); var i1, i2: integer; @@ -1420,14 +1319,11 @@ var begin i1 := Message.WParam; i2 := Message.LParam; - if trim(edtChen.Text) = '¡Ì' then begin InputWeight.Text := format('%.2f', [i1 / 100000]); end; - end; - procedure TfrmTatMachInsp.FormClose(Sender: TObject; var Action: TCloseAction); begin inherited; @@ -1438,7 +1334,6 @@ begin end; Action := caFree; end; - procedure TfrmTatMachInsp.InitCDGrid(MCIID: string); begin cxPageControl1.ActivePageIndex := 0; @@ -1452,7 +1347,6 @@ begin SCreateCDS(ADOTmp, CDS_2); SInitCDSData(ADOTmp, CDS_2); end; - procedure TfrmTatMachInsp.InitCDGridCX(MCIID: string); begin cxPageControl1.ActivePageIndex := 1; @@ -1466,7 +1360,6 @@ begin SCreateCDS(ADOTmp, CDS_1); SInitCDSData(ADOTmp, CDS_1); end; - function TfrmTatMachInsp.RoundUpToHalf(AValue: Double): Double; var MIntPart: Double; @@ -1482,7 +1375,6 @@ begin else Result := MIntPart + 1; //decimal 0.6-0.9 -> next integer end; - procedure TfrmTatMachInsp.InitJYGrid(); var MNetWeight, MJYLen: double; @@ -1502,10 +1394,11 @@ begin sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.NetWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS NetWeightWithAdd'); sql.Add('from Tat_Cloth_Inspect A '); sql.Add('outer apply (select ROUND(ISNULL((ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM'); - sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))'); - sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))'); - sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5'); - sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2'); +// sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))'); +// sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))'); +// sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5'); +// sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2'); + sql.Add('outer apply (select CAST(CM.CalcMeterRaw AS decimal(18,1)) as CalcMeter) CM2'); sql.Add('where mainid=' + quotedstr(fmainid)); sql.Add('and filler=' + quotedstr(dname)); sql.Add('order by filltime desc'); @@ -1521,22 +1414,21 @@ begin sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.NetWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS NetWeightWithAdd'); sql.Add('from Tat_Cloth_Inspect A '); sql.Add('outer apply (select ROUND(ISNULL((ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM'); - sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))'); - sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))'); - sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5'); - sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2'); +// sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))'); +// sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))'); +// sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5'); +// sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2'); + sql.Add('outer apply (select CAST(CM.CalcMeterRaw AS decimal(18,1)) as CalcMeter) CM2'); sql.Add('where convert(varchar(10),filltime,120)=convert(varchar(10),getdate(),120)'); sql.Add('and filler=' + quotedstr(dname)); sql.Add('and mainid=''ÎÞ¶©µ¥'''); sql.Add('order by filltime desc'); end; - // showmessage(sql.text); Open; end; SCreateCDS(ADOQueryMain, CDS_3); SInitCDSData(ADOQueryMain, CDS_3); - with ADOTmp do begin Close; @@ -1554,7 +1446,6 @@ begin LABEL44.Caption := '½ñÈÕÒÑ´ò³¤¶È:' + ADOTmp.FieldByName('METER').AsString; end; end; - procedure TfrmTatMachInsp.FormShow(Sender: TObject); begin inherited; @@ -1576,12 +1467,9 @@ begin OpenCom(DZCDYDllName); if trim(MBDYDllName) <> '' then OpenCom(MBDYDllName); - // edtScan.SetFocus; - end; end; - procedure TfrmTatMachInsp.InitCDPanel(); var AA: array[0..100] of string; @@ -1630,7 +1518,6 @@ begin end; end; end; - procedure TfrmTatMachInsp.Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); var ATableView: TcxGridDBTableView; @@ -1642,7 +1529,6 @@ begin 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'); @@ -1657,20 +1543,16 @@ begin ACanvas.Brush.Color := $00C0C0FF; end; end; - //defective roll keeps red if AViewInfo.GridRecord.Values[ATableView.GetColumnByFieldName('Grade').Index] = '´ÎÆ·' then ACanvas.Brush.Color := clRed; end; - procedure TfrmTatMachInsp.Tv3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if CDS_3.isEmpty then exit; - InitCDGridCX(CDS_3.FieldByName('CIID').AsString); end; - procedure TfrmTatMachInsp.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); begin if CDS_2.IsEmpty then @@ -1708,7 +1590,6 @@ begin end; CDS_2.Delete; end; - function TfrmTatMachInsp.SaveData(): Boolean; var maxno, MCIID, strsql: string; @@ -1716,6 +1597,7 @@ var MInputLen, MMeter, MYardage: Double; MInputWeight, MGrossWeight, MNetWeight, MTare: Double; MUseLen: Double; + MMeterInput, MMeterCodeTable: Double; begin fmainid := ''; fsubid := ''; @@ -1756,9 +1638,7 @@ begin FieldByName('Editer').Value := Trim(DName); FieldByName('EditTime').Value := SGetServerDateTime(ADOTmp); end; - ///////////////////////// ±£´æÖØÁ¿ ///////////////////////// - MTare := StrToFloatdef(trim(Tare.Text), 0); MInputWeight := RoundFloat(StrToFloatdef(trim(InputWeight.Text), 0), StrTointdef(KgPlace.Text, 0)); MGrossWeight := MInputWeight + MTare; //Ã«ÖØ @@ -1772,23 +1652,36 @@ begin /// ///////////////////////// ±£´æ³¤¶È ///////////////////////// MInputLen := RoundFloat(StrToFloatdef(trim(InputLen.Text), 0), 1); - // Âë±í³¤¶ÈδÁ¬Âë±íÊÖÌîʱ£¬ÌύͬÑù°´Âë±í½øÎ»Âß¼­±£ÁôһλСÊý if Trim(code_table_length.Text) <> '' then code_table_length.Text := - FormatFloat('0.#', RoundUpToHalf(RoundFloat(StrToFloatdef(Trim(code_table_length.Text), 0), 1))); - +// FormatFloat('0.#', RoundUpToHalf(RoundFloat(StrToFloatdef(Trim(code_table_length.Text), 0), 1))); + FormatFloat('0.#', RoundFloat(StrToFloatdef(Trim(code_table_length.Text), 0), 1)); // ¹´Ñ¡ edtMax ʱ£ºÈ¡Â¼È볤¶ÈÓëÂë±í³¤¶ÈÖеĽϴóÖµ²ÎÓë»»Ëã +// if Trim(edtMax.Text) = '¡Ì' then +// begin +// if StrToFloatdef(trim(InputLen.Text), 0) >= StrToFloatdef(trim(code_table_length.Text), 0) then +// MUseLen := StrToFloatdef(trim(InputLen.Text), 0) +// else +// MUseLen := StrToFloatdef(trim(code_table_length.Text), 0); +// end +// else +// MUseLen := StrToFloatdef(trim(InputLen.Text), 0); if Trim(edtMax.Text) = '¡Ì' then begin - if StrToFloatdef(trim(InputLen.Text), 0) >= StrToFloatdef(trim(code_table_length.Text), 0) then - MUseLen := StrToFloatdef(trim(InputLen.Text), 0) + // ¡ý ¸ÄÕâÀÁ½±ß¶¼°´½øÎ»Âß¼­´¦Àíºó±È½Ï +// MMeterInput := RoundUpToHalf(RoundFloat(StrToFloatdef(Trim(InputLen.Text), 0), 1)); +// MMeterCodeTable := RoundUpToHalf(RoundFloat(StrToFloatdef(Trim(code_table_length.Text), 0), 1)); + MMeterInput := RoundFloat(StrToFloatdef(Trim(InputLen.Text), 0), 1); + MMeterCodeTable := RoundFloat(StrToFloatdef(Trim(code_table_length.Text), 0), 1); + if MMeterInput >= MMeterCodeTable then + MUseLen := MMeterInput else - MUseLen := StrToFloatdef(trim(code_table_length.Text), 0); + MUseLen := MMeterCodeTable; end else - MUseLen := StrToFloatdef(trim(InputLen.Text), 0); - + // ²»È¡×î´ó£ºÖ±½ÓÓà InputLen Ô­Öµ£¨ÆÕͨһλСÊý£© + MUseLen := StrToFloatdef(Trim(InputLen.Text), 0); if lblLenUnit.Caption = 'M' then begin MMeter := RoundFloat(MUseLen, StrTointdef(MPlace.Text, 0)); @@ -1799,21 +1692,16 @@ begin MYardage := RoundFloat(MUseLen, StrTointdef(YPlace.Text, 0)); MMeter := RoundFloat(MYardage * 0.9144, StrTointdef(MPlace.Text, 0)); end; - FieldByName('InputLen').Value := RoundFloat(StrToFloatdef(trim(InputLen.Text), 0), 1); FieldByName('Meter').Value := RoundUpToHalf(MMeter); FieldByName('Yardage').Value := MYardage; FieldByName('LenUnit').Value := TRIM(lblLenUnit.Caption); - FieldByName('code_table_length').Value := StrToFloatdef(Trim(code_table_length.Text), 0); ///////////////////////// ±£´æ³¤¶È ///////////////////////// FieldByName('Coefficient').Value := StrToFloatdef(Coefficient.text, 0); - FieldByName('Grade').Value := Grade.text; - FieldByName('PieceNo').Value := 0; - FieldByName('OrderNo').value := Trim(FOrderNo); if fmainid = '' then begin @@ -1831,7 +1719,6 @@ begin begin FieldByName('SubId').value := Trim(FSubId); end; - FieldByName('Workshop').value := Trim(FWorkshop); FieldByName('CIIOFlag').Value := 'δÈë¿â'; FieldByName('PCId').value := FPCId; @@ -1839,7 +1726,6 @@ begin FieldByName('C_Name').value := trim(codename.Text); FieldByName('C_LongBatchNo').Value := Trim(C_LongitudeBatchNo.Text); FieldByName('C_LatBatchNo').Value := Trim(C_LatitudeBatchNo.Text); - FieldByName('C_Spec').value := trim(Spec.Text); FieldByName('C_Color').value := FC_Color; FieldByName('C_ColorNo').value := FC_ColorNo; @@ -1850,10 +1736,8 @@ begin FieldByName('C_CustPattern').value := FC_CustPattern; FieldByName('C_ColorDepth').value := C_ColorDepth.Text; FieldByName('CIMachNo').Value := Trim(SCXFlag); - FieldByName('CARNO').Value := Trim(CARNO.Text); FieldByName('WorkShift').Value := Trim(WorkShift.Text); - FieldByName('SCPerson').Value := Trim(SCPerson.Text); FieldByName('JBSCPerson').Value := Trim(JBSCPerson.Text); FieldByName('JBSCPerson3').Value := Trim(JBSCPerson3.Text); @@ -1861,7 +1745,6 @@ begin FieldByName('JBSCPerson5').Value := Trim(JBSCPerson5.Text); FieldByName('JBSCPerson6').Value := Trim(JBSCPerson6.Text); FieldByName('JBSCPerson7').Value := Trim(JBSCPerson7.Text); - FieldByName('OutPutQty1').Value := strtofloatdef(OutPutQty1.Text, 0); FieldByName('OutPutQty2').Value := strtofloatdef(OutPutQty2.Text, 0); FieldByName('OutPutQty3').Value := strtofloatdef(OutPutQty3.Text, 0); @@ -1871,13 +1754,10 @@ begin FieldByName('OutPutQty7').Value := strtofloatdef(OutPutQty7.Text, 0); Post; end; - MCIID := Trim(maxno); //¾íÌõÂë FCIID := Trim(maxno); - //±£´æµ²³µ¹¤ÐÅÏ¢ - with ADOCmd do begin Close; @@ -1889,7 +1769,6 @@ begin sql.Add('values(' + quotedstr(maxno) + ',' + quotedstr(maxno + '2') + ',' + quotedstr(JBSCPerson.Hint) + ',' + quotedstr(JBSCPerson.Text) + ',' + quotedstr(IntToStr(StrtoIntdef(OutPutQty2.Text, 0))) + ')'); execsql; end; - ////////////////// ±£´æ´ÃµãÐÅÏ¢ ////////////////// with CDS_2 do begin @@ -1957,7 +1836,6 @@ begin ////////////////// ¸üнø¶È ////////////////// /// ADOCmd.Connection.CommitTrans; - ////////////////// ³öÈë¿â¼°¿â´æ ////////////////// with ADOCmd do begin @@ -1983,7 +1861,6 @@ begin Result := False; end; end; - procedure TfrmTatMachInsp.SCPersonClick(Sender: TObject); begin inherited; @@ -2002,7 +1879,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.BTPrintClick(Sender: TObject); var fPrintFile: string; @@ -2013,7 +1889,6 @@ begin Code.SetFocus; if CheckData('Ìá½»') = False then exit; - if SaveData() then begin InputLen.Text := ''; @@ -2023,7 +1898,6 @@ begin begin PrtData(FCIID); end; - end; InputLen.SetFocus; CIFBegClick(InputLen); @@ -2031,10 +1905,8 @@ begin InitJYGrid(); InitCDGrid(''); FCIID := ''; - // Code.Text := ''; carno.Text := ''; - SCPerson.Text := ''; JBSCPerson.Text := ''; JBSCPerson3.Text := ''; @@ -2049,12 +1921,10 @@ begin OutPutQty5.Text := ''; OutPutQty6.Text := ''; OutPutQty7.Text := ''; - weaver_name.Text := ''; weaver_name.Hint := ''; points.Text := ''; end; - procedure TfrmTatMachInsp.PrtData(MCIID: string); var fPrintFile, FLBName: string; @@ -2072,12 +1942,9 @@ begin application.MessageBox('±êÇ©ÄÚÈÝδÕÒµ½£¡', 'ÌáʾÐÅÏ¢', MB_ICONERROR); exit; end; - FLBName := Trim(ADOQueryPrint.fieldbyname('LBName').AsString); - ExportFtErpFile(FLBName + '.rmf', ADOTmp); fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + FLBName + '.rmf'; - if FileExists(fPrintFile) then begin RM1.LoadFromFile(fPrintFile); @@ -2089,7 +1956,6 @@ begin Application.MessageBox(PChar('ûÓÐÕÒ' + fPrintFile), 'Ìáʾ', 0); end; end; - procedure TfrmTatMachInsp.SpeedButton1Click(Sender: TObject); var fsj: string; @@ -2103,13 +1969,11 @@ begin TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption); TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll; end; - procedure TfrmTatMachInsp.SpeedButton113Click(Sender: TObject); begin inherited; panel3.Visible := False; end; - procedure TfrmTatMachInsp.SpeedButton12Click(Sender: TObject); var fsj: string; @@ -2120,18 +1984,15 @@ begin TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1); TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll; end; - procedure TfrmTatMachInsp.SpeedButton13Click(Sender: TObject); var i: Integer; begin if CheckData('´Ãµã') = False then exit; - FCIFName := Trim(TSpeedButton(Sender).Hint); MovePanel1.Visible := True; lblCIFName.Caption := Trim(FCIFName); - //ÏÔʾÊý×Ö¼üÅÌ CIFBeg.Text := InputLen.Text; with Panel3 do @@ -2144,9 +2005,7 @@ begin end; end; end; - end; - procedure TfrmTatMachInsp.weaver_nameClick(Sender: TObject); begin try @@ -2164,7 +2023,6 @@ begin frmEmployeeSel.Free; end; end; - procedure TfrmTatMachInsp.cxButtonEdit1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try @@ -2182,7 +2040,6 @@ begin frmEmployeeSel.Free; end; end; - //procedure TfrmTatMachInsp.Button10Click(Sender: TObject); //begin // try @@ -2214,14 +2071,12 @@ end; //// fsubid := ''; //// Label14.Caption := '¶©µ¥ºÅ'; //end; - procedure TfrmTatMachInsp.Button10Click(Sender: TObject); var FCode, FProductName: string; begin FCode := ''; FProductName := ''; - try frmSCPersonColor5 := TfrmSCPersonColor5.Create(Self); try @@ -2233,12 +2088,10 @@ begin finally frmSCPersonColor5.Close; end; - if FCode <> '' then begin Self.Code.Text := FCode; Self.CodeName.Text := FProductName; - with Self.ADOTmp do begin Close; @@ -2246,7 +2099,6 @@ begin SQL.Add('SELECT A.* FROM Bs_Cloth_Info A WHERE A.C_Code = ' + QuotedStr(FCode)); Open; end; - if not Self.ADOTmp.IsEmpty then begin Self.Code.Text := Self.ADOTmp.FieldByName('C_Code').AsString; @@ -2262,12 +2114,10 @@ begin if Assigned(frmSCPersonColor5) then frmSCPersonColor5.Close; end; - FMainId := ''; FSubId := ''; Label14.Caption := '¶©µ¥ºÅ'; end; - procedure TfrmTatMachInsp.BtnConClick(Sender: TObject); begin try @@ -2290,7 +2140,6 @@ begin FC_Width := Trim(FieldByName('C_Width').AsString); FC_GramWeight := Trim(FieldByName('C_GramWeight').AsString); FC_Pattern := Trim(FieldByName('C_Pattern').AsString); - Code.Text := FC_Code; CodeName.Text := FC_Name; SPEC.Text := FC_Spec; @@ -2298,7 +2147,6 @@ begin KZ.Text := FC_GramWeight; Coefficient.Text := '0'; Label14.Caption := Trim(FieldByName('ConNo').AsString); - with ADOTmp do begin Close; @@ -2316,7 +2164,6 @@ begin C_LongitudeBatchNo.Text := ''; C_LatitudeBatchNo.Text := ''; end; - SetDdetails(); InitJYGrid(); InitCDGrid(''); @@ -2328,12 +2175,10 @@ begin frmTatConSel.Free; end; end; - procedure TfrmTatMachInsp.Button1Click(Sender: TObject); var mvalue: Double; begin - if Trim(CIFBeg.Text) <> '' then begin if Trim(CIFEnd.Text) <> '' then @@ -2365,7 +2210,6 @@ begin FieldByName('CIFbeg').Value := Trim(CIFBeg.Text); FieldByName('CIFEnd').Value := Trim(CIFEnd.Text); FieldByName('CIFPoints').Value := 0; - if RadioGroup1.ItemIndex > -1 then begin if RadioGroup1.ItemIndex < 3 then @@ -2378,19 +2222,14 @@ begin end; end; FieldByName('CIFQty').Value := StrToFloatdef(trim(CIFQty.Text), 0); - if FindField('weaver_code') <> nil then FieldByName('weaver_code').AsString := Trim(Self.weaver_name.Hint); - if FindField('weaver_name') <> nil then FieldByName('weaver_name').AsString := Trim(Self.weaver_name.Text); - if FindField('points') <> nil then FieldByName('points').AsFloat := StrToFloatDef(Trim(Self.points.Text), 0); - if FindField('CIFNumber') <> nil then FieldByName('CIFNumber').AsString := Trim(Self.CIFNumber.Text); - Post; end; CIFBeg.Text := ''; @@ -2398,12 +2237,10 @@ begin CIFQty.Text := ''; MovePanel1.Visible := False; cxPageControl1.ActivePageIndex := 0; - weaver_name.Text := ''; weaver_name.Hint := ''; points.Text := ''; end; - procedure TfrmTatMachInsp.edtScanKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then @@ -2419,7 +2256,6 @@ begin InputLen.SetFocus; end; end; - procedure TfrmTatMachInsp.CIFBegClick(Sender: TObject); var i: Integer; @@ -2427,7 +2263,6 @@ begin panel3.Visible := true; with Panel3 do begin - for i := 0 to ControlCount - 1 do begin if Controls[i] is TSpeedButton then @@ -2437,7 +2272,6 @@ begin end; end; end; - procedure TfrmTatMachInsp.CIFEndChange(Sender: TObject); var mvalue: Double; @@ -2468,7 +2302,6 @@ begin end; CIFQty.Text := FloatToStr(StrToFloat(CIFEnd.Text) - StrToFloat(CIFBeg.Text)); end; - procedure TfrmTatMachInsp.Edit6Click(Sender: TObject); begin if Trim(Edit6.Text) = '' then @@ -2480,12 +2313,10 @@ begin Edit6.Text := ''; end; end; - procedure TfrmTatMachInsp.MinLenExit(Sender: TObject); begin SetINIFile(); end; - procedure TfrmTatMachInsp.MJstr3KeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then @@ -2494,12 +2325,10 @@ begin SelectNext(ActiveControl as TWinControl, True, True); end; end; - procedure TfrmTatMachInsp.Button2Click(Sender: TObject); begin RadioGroup1.ItemIndex := -1; end; - procedure TfrmTatMachInsp.Button3Click(Sender: TObject); begin if Panel6.Visible then @@ -2507,7 +2336,6 @@ begin else Panel6.Visible := True; end; - procedure TfrmTatMachInsp.edtScanClick(Sender: TObject); var i: Integer; @@ -2524,7 +2352,6 @@ begin end; end; end; - procedure TfrmTatMachInsp.NetWeightKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then @@ -2532,13 +2359,11 @@ begin BTPrint.Click; end; end; - procedure TfrmTatMachInsp.FormCreate(Sender: TObject); begin inherited; IsCommopen := false; end; - procedure TfrmTatMachInsp.lblLenUnitClick(Sender: TObject); begin // if Trim(lblLenUnit.Caption) = 'M' then @@ -2546,12 +2371,10 @@ begin // else // SetUnit('M'); end; - procedure TfrmTatMachInsp.Button4Click(Sender: TObject); begin MovePanel1.Visible := false; end; - procedure TfrmTatMachInsp.Button5Click(Sender: TObject); begin inherited; @@ -2590,9 +2413,7 @@ begin Self.CodeName.Text := ADOTmp.fieldbyname('C_Name').AsString; Self.MF.Text := ADOTmp.fieldbyname('C_Width').AsString; Self.KZ.Text := ADOTmp.fieldbyname('C_GramWeight').AsString; - Self.SPEC.Text := ADOTmp.fieldbyname('C_SPEC').AsString; - end; end; finally @@ -2602,15 +2423,12 @@ begin fsubid := ''; Label14.Caption := '¶©µ¥ºÅ'; end; - procedure TfrmTatMachInsp.ToolButton3Click(Sender: TObject); begin if CDS_3.IsEmpty then Exit; PrtData(CDS_3.fieldbyname('CIID').AsString); - end; - procedure TfrmTatMachInsp.ToolButton4Click(Sender: TObject); begin try @@ -2630,9 +2448,7 @@ begin finally frmZDYHelp.Free; end; - end; - procedure TfrmTatMachInsp.ToolButton5Click(Sender: TObject); begin if CDS_3.IsEmpty then @@ -2641,7 +2457,6 @@ begin Exit; ADOCmd.Connection.BeginTrans; try - with ADOCmd do begin Close; @@ -2654,12 +2469,10 @@ begin // ShowMessage(sql.Text); Open; end; - if ADOCmd.FieldByName('intReturn').AsInteger = -1 then begin raise Exception.Create(pchar(trim(ADOCmd.FieldByName('ShowMsg').AsString))); end; - with ADOCmd do begin Close; @@ -2689,7 +2502,6 @@ begin application.MessageBox(PChar(Exception(ExceptObject).Message), 'ÌáʾÐÅÏ¢', 0); end; end; - procedure TfrmTatMachInsp.ToolButton6Click(Sender: TObject); begin if CDS_3.IsEmpty then @@ -2720,20 +2532,16 @@ begin end; InitJTM(CDS_3.fieldbyname('CIID').AsString); end; - procedure TfrmTatMachInsp.ToolButton7Click(Sender: TObject); begin WriteCxGrid(trim(Self.Caption) + 'Tv1', Tv1, 'óÒ×¼ìÑé¹ÜÀí'); WriteCxGrid(trim(Self.Caption) + 'Tv2', Tv2, 'óÒ×¼ìÑé¹ÜÀí'); WriteCxGrid(trim(Self.Caption) + 'Tv3', Tv3, 'óÒ×¼ìÑé¹ÜÀí'); - end; - procedure TfrmTatMachInsp.ToolButton8Click(Sender: TObject); begin Close; end; - procedure TfrmTatMachInsp.edtChenClick(Sender: TObject); begin if Trim(TEdit(Sender).Text) = '' then @@ -2746,7 +2554,6 @@ begin end; SetINIFile(); end; - procedure TfrmTatMachInsp.edtMaxClick(Sender: TObject); begin if Trim(TEdit(Sender).Text) = '' then @@ -2754,7 +2561,6 @@ begin else TEdit(Sender).Text := ''; end; - procedure TfrmTatMachInsp.edtYJClick(Sender: TObject); begin if Trim(TEdit(Sender).Text) = '' then @@ -2766,7 +2572,6 @@ begin TEdit(Sender).Text := ''; end; end; - procedure TfrmTatMachInsp.Button6Click(Sender: TObject); begin if ScrollBox1.Visible then @@ -2774,7 +2579,6 @@ begin else ScrollBox1.Visible := True; end; - procedure TfrmTatMachInsp.Button7Click(Sender: TObject); var K: Integer; @@ -2797,7 +2601,6 @@ begin end; AllocWeaverMeter(K); end; - procedure TfrmTatMachInsp.Button8Click(Sender: TObject); begin // if Panel7.Visible then @@ -2805,7 +2608,6 @@ begin // else // Panel7.Visible := True; end; - function TfrmTatMachInsp.SelBoundProduct(AMCNO: string): string; var frm, OldFrm: TfrmSCPersonColor; @@ -2825,12 +2627,10 @@ begin frmSCPersonColor := OldFrm; end; end; - procedure TfrmTatMachInsp.Button9Click(Sender: TObject); var MCode, MCode2: string; begin - try frmSCPersonColor := TfrmSCPersonColor.Create(self); with frmSCPersonColor do @@ -2839,7 +2639,6 @@ begin if ShowModal = 1 then begin carno.text := trim(fname); - //´ø³ö»ų́°ó¶¨µÄ²úÆ·ÐÅÏ¢£¬ÓÐÖµÖ±½Ó¸²¸Ç£»°ó¶¨Á½¸ö²úƷʱÈÃÓû§Ñ¡Ôñ´øÈëÄĸö MCode := ''; MCode2 := ''; @@ -2860,15 +2659,12 @@ begin MCode2 := Trim(FieldByName('C_CodeName2').AsString); end; end; - //Ö»ÔÚ²úÆ·2°ó¶¨Ê±£¬Í¬ÑùÖ±½Ó´øÈë if (MCode = '') and (MCode2 <> '') then MCode := MCode2; - //Á½¸ö²úÆ·¶¼°ó¶¨Ê±µ¯³ö´ó°´Å¥Ñ¡Ôñ´°£¬µãÑ¡Äĸö´øÈëÄĸö£¬È¡ÏûÔò²»´øÈë if (MCode <> '') and (MCode2 <> '') then MCode := SelBoundProduct(Trim(fname)); - if MCode <> '' then begin with Self.ADOTmp do @@ -2878,7 +2674,6 @@ begin SQL.Add('SELECT A.* FROM Bs_Cloth_Info A WHERE A.C_Code=' + QuotedStr(MCode)); Open; end; - if not Self.ADOTmp.IsEmpty then begin Self.Code.Text := Self.ADOTmp.FieldByName('C_Code').AsString; @@ -2888,20 +2683,17 @@ begin Self.SPEC.Text := Self.ADOTmp.FieldByName('C_SPEC').AsString; Self.C_LongitudeBatchNo.Text := Self.ADOTmp.fieldbyname('C_LongitudeBatchNo').AsString; Self.C_LatitudeBatchNo.Text := Self.ADOTmp.fieldbyname('C_LatitudeBatchNo').AsString; - FMainId := ''; FSubId := ''; Label14.Caption := '¶©µ¥ºÅ'; end; end; - end; end; finally frmSCPersonColor.close; end; end; - procedure TfrmTatMachInsp.carnoBtnClick(Sender: TObject); begin inherited; @@ -2913,14 +2705,12 @@ begin if ShowModal = 1 then begin carno.text := trim(fname); - end; end; finally frmSCPersonColor.close; end; end; - procedure TfrmTatMachInsp.carnoClick(Sender: TObject); begin inherited; @@ -2932,13 +2722,10 @@ begin if ShowModal = 1 then begin carno.text := trim(fname); - end; end; finally frmSCPersonColor.close; end; end; - end. -