diff --git a/A02基础产å“�管ç�†/ClothInfo.dpr b/A02基础产å“�管ç�†/ClothInfo.dpr index de15c18..e9ca23a 100644 --- a/A02基础产å“�管ç�†/ClothInfo.dpr +++ b/A02基础产å“�管ç�†/ClothInfo.dpr @@ -25,13 +25,17 @@ uses U_ClothType in 'U_ClothType.pas' {frmClothType}, U_CloInfoFileUp in 'U_CloInfoFileUp.pas' {frmCloInfoFileUp}, U_TatClothInfo in 'U_TatClothInfo.pas' {frmTatClothInfo}, + U_CraftInfoInput in 'U_CraftInfoInput.pas' {frmCraftInfoInput}, + U_CraftInfoSel in 'U_CraftInfoSel.pas' {frmCraftInfoSel}, + U_CraftSync in 'U_CraftSync.pas', U_LabelMapSet in '..\A00ͨÓô°Ìå\U_LabelMapSet.pas' {frmLabelMapSet}, U_LabelPrint in '..\A00ͨÓô°Ìå\U_LabelPrint.pas' {frmLabelPrint}, U_KnitClothInfoSel in '..\A00ͨÓô°Ìå\U_KnitClothInfoSel.pas' {frmKnitClothInfoSel}, U_TatClothInfoSel in '..\A00ͨÓô°Ìå\U_TatClothInfoSel.pas' {frmTatClothInfoSel}, U_ClothInfoSel in '..\A00ͨÓô°Ìå\U_ClothInfoSel.pas' {frmClothInfoSel}, U_YarnInfoSel in '..\A00ͨÓô°Ìå\U_YarnInfoSel.pas' {frmYarnInfoSel}, - uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas'; + uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas', + U_CraftInfo in 'U_CraftInfo.pas'; {$R *.res} diff --git a/A02基础产å“�管ç�†/ClothInfo.dproj b/A02基础产å“�管ç�†/ClothInfo.dproj index 4e5a17e..9dd126d 100644 --- a/A02基础产å“�管ç�†/ClothInfo.dproj +++ b/A02基础产å“�管ç�†/ClothInfo.dproj @@ -137,6 +137,13 @@
frmTatClothInfo
dfm + +
frmCraftInfoInput
+
+ +
frmCraftInfoSel
+
+
frmLabelMapSet
dfm @@ -162,6 +169,7 @@ dfm
+ Cfg_2 Base diff --git a/A02基础产å“�管ç�†/U_CraftInfo.dfm b/A02基础产å“�管ç�†/U_CraftInfo.dfm new file mode 100644 index 0000000..7bc503d --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfo.dfm @@ -0,0 +1,361 @@ +inherited frmCraftInfo: TfrmCraftInfo + Left = 117 + Top = 154 + Caption = #20135#21697#24037#33402#31649#29702 + ClientHeight = 620 + ClientWidth = 1200 + FormStyle = fsMDIChild + Visible = True + ExplicitWidth = 1216 + ExplicitHeight = 659 + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar [0] + Tag = 1 + Left = 0 + Top = 0 + Width = 1200 + Height = 38 + AutoSize = True + ButtonHeight = 38 + ButtonWidth = 91 + Caption = 'ToolBar1' + Color = clSkyBlue + DisabledImages = DataLink_ClothInfo.ImageList_new32 + Images = DataLink_ClothInfo.ImageList_new32 + List = True + ParentColor = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 1 + OnClick = TBRafreshClick + end + object TBAdd: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 9 + OnClick = TBAddClick + end + object TBEdit: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 3 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 213 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 5 + OnClick = TBDelClick + end + object TBExport: TToolButton + Left = 284 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 20 + OnClick = TBExportClick + end + object ToolButton2: TToolButton + Left = 355 + Top = 0 + AutoSize = True + Caption = #20445#23384#26684#24335 + ImageIndex = 16 + OnClick = ToolButton2Click + end + object TBClose: TToolButton + Left = 450 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = TBCloseClick + end + end + object Panel1: TPanel [1] + Left = 0 + Top = 38 + Width = 1200 + Height = 45 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = 16242829 + ParentBackground = False + TabOrder = 1 + object Label1: TLabel + Left = 22 + Top = 15 + Width = 60 + Height = 12 + Caption = #24037#33402#32534#21495#65306 + end + object Label2: TLabel + Left = 262 + Top = 15 + Width = 60 + Height = 12 + Caption = #24037#33402#21517#31216#65306 + end + object CR_Code: TEdit + Tag = 2 + Left = 88 + Top = 11 + Width = 150 + Height = 20 + TabOrder = 0 + OnKeyPress = CRCodeKeyPress + end + object CR_Name: TEdit + Tag = 2 + Left = 328 + Top = 11 + Width = 220 + Height = 20 + TabOrder = 1 + OnKeyPress = CRCodeKeyPress + end + end + object cxGrid1: TcxGrid [2] + Left = 0 + Top = 83 + Width = 1200 + Height = 537 + Align = alClient + PopupMenu = PM_1 + TabOrder = 2 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_1 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsData.DeletingConfirmation = False + OptionsView.GroupByBox = False + Styles.IncSearch = DataLink_ClothInfo.SHuangSe + Styles.Header = DataLink_ClothInfo.Default + Styles.Inactive = DataLink_ClothInfo.SHuangSe + Styles.Selection = DataLink_ClothInfo.SHuangSe + object Tv1SSel: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + HeaderAlignmentHorz = taCenter + Width = 41 + 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 + object Tv1FILLER: TcxGridDBColumn + Caption = #24405#20837#20154 + DataBinding.FieldName = 'FILLER' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 66 + end + object Tv1FILLTIME: TcxGridDBColumn + Caption = #24405#20837#26102#38388 + DataBinding.FieldName = 'FILLTIME' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_ClothInfo.Default + Width = 90 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + inherited ADOQueryBaseCmd: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + end + inherited ADOQueryBaseTemp: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + Left = 201 + Top = 105 + end + object GPM_1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 880 + Top = 16 + end + object PM_1: TPopupMenu + Left = 960 + Top = 80 + object N1: TMenuItem + Caption = #20840#36873 + OnClick = N1Click + end + object N2: TMenuItem + Caption = #20840#24323 + OnClick = N2Click + end + end + object DS_1: TDataSource + DataSet = CDS_1 + Left = 640 + Top = 16 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 720 + Top = 16 + end + object CDS_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 560 + Top = 16 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 800 + Top = 80 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + Parameters = <> + Left = 720 + Top = 80 + end +end diff --git a/A02基础产å“�管ç�†/U_CraftInfo.pas b/A02基础产å“�管ç�†/U_CraftInfo.pas new file mode 100644 index 0000000..a7bfcba --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfo.pas @@ -0,0 +1,323 @@ +unit U_CraftInfo; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxGraphics, cxCustomData, cxStyles, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, ADODB, DBClient, ComCtrls, ToolWin, StdCtrls, ExtCtrls, Menus, + cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, + cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu, + cxGridPopupMenu, cxNavigator, dxDateRanges, dxBarBuiltInMenu, cxCheckBox, + dxScrollbarAnnotations, U_BaseList, cxLookAndFeels, cxLookAndFeelPainters, + dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI; + +type + TfrmCraftInfo = class(TfrmBaseList) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBExport: TToolButton; + ToolButton2: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + Label2: TLabel; + CR_Code: TEdit; + CR_Name: TEdit; + GPM_1: TcxGridPopupMenu; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + Tv1SSel: TcxGridDBColumn; + Tv1CR_Code: TcxGridDBColumn; + Tv1CR_Name: TcxGridDBColumn; + Tv1C_Width: TcxGridDBColumn; + Tv1C_GramWeight: TcxGridDBColumn; + Tv1C_Color: TcxGridDBColumn; + Tv1C_YarnQty: TcxGridDBColumn; + Tv1head_count: TcxGridDBColumn; + Tv1strip_width: TcxGridDBColumn; + Tv1C_MachLatitudeDensity: TcxGridDBColumn; + Tv1row_count_top: TcxGridDBColumn; + Tv1displace: TcxGridDBColumn; + Tv1reed_width: TcxGridDBColumn; + Tv1C_ReedNo: TcxGridDBColumn; + Tv1FILLER: TcxGridDBColumn; + Tv1FILLTIME: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + DS_1: TDataSource; + ADOQueryMain: TADOQuery; + CDS_1: TClientDataSet; + ADOQueryTemp: TADOQuery; + ADOQueryCmd: TADOQuery; + PM_1: TPopupMenu; + N1: TMenuItem; + N2: TMenuItem; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure CRCodeKeyPress(Sender: TObject; var Key: Char); + procedure N1Click(Sender: TObject); + procedure N2Click(Sender: TObject); + private + { Private declarations } + procedure InitGrid(); + public + { Public declarations } + end; + +var + frmCraftInfo: TfrmCraftInfo; + +implementation + +uses + U_DataLink, U_RTFun, U_CraftInfoInput; + +{$R *.dfm} + +procedure TfrmCraftInfo.InitGrid(); +var + fwhere, Pwhere: string; +begin + Panel1.Refresh; + fwhere := ''; + Pwhere := SGetFilters(Panel1, 1, 2); + + if trim(Pwhere) <> '' then + fwhere := ' where ' + trim(Pwhere); + + try + ADOQueryMain.DisableControls; + + with ADOQueryMain do + begin + Close; + Filtered := False; + sql.Clear; + sql.Add('select A.* from BS_Craft_Info A' + fwhere + ' order by CR_Code'); + Open; + end; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS(ADOQueryMain, CDS_1); + SInitCDSData(ADOQueryMain, CDS_1); + TV1.DataController.Filter.Clear; + finally + ADOQueryMain.EnableControls; + TV1.DataController.Filter.Clear; + end; +end; + +procedure TfrmCraftInfo.FormClose(Sender: TObject; var Action: TCloseAction); +begin + inherited; + Action := caFree; +end; + +procedure TfrmCraftInfo.FormDestroy(Sender: TObject); +begin + inherited; + frmCraftInfo := nil; +end; + +procedure TfrmCraftInfo.FormShow(Sender: TObject); +begin + inherited; + ReadCxGrid(self.Caption + 'TV1', Tv1, '¹¤ÒÕ¹ÜÀí'); + InitGrid(); +end; + +procedure TfrmCraftInfo.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmCraftInfo.TBAddClick(Sender: TObject); +begin + try + frmCraftInfoInput := TfrmCraftInfoInput.Create(Application); + with frmCraftInfoInput do + begin + FCRID := ''; + if ShowModal = 1 then + begin + Self.InitGrid(); + end; + end; + finally + frmCraftInfoInput.Free; + end; +end; + +procedure TfrmCraftInfo.TBEditClick(Sender: TObject); +begin + if CDS_1.IsEmpty then + Exit; + try + frmCraftInfoInput := TfrmCraftInfoInput.Create(Application); + with frmCraftInfoInput do + begin + FCRID := Trim(Self.CDS_1.fieldbyname('CRID').AsString); + if ShowModal = 1 then + begin + Self.InitGrid(); + end; + end; + finally + frmCraftInfoInput.Free; + end; +end; + +procedure TfrmCraftInfo.TBDelClick(Sender: TObject); +var + MRefCodes: string; +begin + if CDS_1.IsEmpty then + Exit; + if not CDS_1.Locate('SSel', True, []) then + begin + Application.MessageBox('ûÓÐÑ¡ÔñÊý¾Ý!', 'Ìáʾ', 0); + Exit; + end; + if Application.MessageBox('È·¶¨ÒªÉ¾³ýÊý¾ÝÂð£¿', 'Ìáʾ', 32 + 4) <> IDYES then + Exit; + + //ÏÈÕûÌå¼ì²é:¹´Ñ¡ÖÐÈÎÒ»¹¤ÒÕ±»²úÆ·ÒýÓÃÔòÈ«²¿×èÖ¹(±ÜÃâɾһ°ë) + MRefCodes := ''; + CDS_1.DisableControls; + try + CDS_1.First; + while not CDS_1.Eof do + begin + if CDS_1.fieldbyname('SSel').AsBoolean then + begin + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select count(*) as AA from BS_Cloth_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString))); + Open; + end; + if ADOQueryTemp.FieldByName('AA').AsInteger > 0 then + begin + if MRefCodes <> '' then + MRefCodes := MRefCodes + ','; + MRefCodes := MRefCodes + Trim(CDS_1.fieldbyname('CR_Code').AsString); + end; + end; + CDS_1.Next; + end; + CDS_1.Locate('SSel', True, []); + finally + CDS_1.EnableControls; + end; + if MRefCodes <> '' then + begin + Application.MessageBox(PChar('¹¤ÒÕ ' + MRefCodes + ' Òѱ»²úƷʹÓÃ,²»ÄÜɾ³ý!ÇëÏȽâ³ý²úÆ·µÄ¹¤Òհ󶨡£'), 'Ìáʾ', 0); + Exit; + end; + + try + ADOQueryCmd.Connection.BeginTrans; + //Óë²úƷɾ³ýÒ»ÖÂ:Ñ­»·É¾³ý¹´Ñ¡ÐÐ(Ö÷±í+Åä±È×Ó±í+ÎÆ°æÍ¼×Ó±í) + while CDS_1.Locate('SSel', true, []) do + begin + if Trim(CDS_1.fieldbyname('CRID').AsString) <> '' then + begin + //Ïȱ¸·Ýµ½¹¤ÒÕɾ³ý±í(±¸·Ý±íÓëÖ÷±í½á¹¹ÍêȫһÖÂ,select * ÃâÁÐÇåµ¥,Ö÷±í¼Ó×Ö¶ÎÎÞÐè¸Ä´úÂë) + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into BS_Craft_Info_Del select * from BS_Craft_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString))); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('delete BS_Craft_Yarn where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString))); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('delete BS_Craft_Info_WB where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString))); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('delete BS_Craft_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString))); + 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(CDS_1.fieldbyname('CRID').AsString))); + SQL.Add(',' + QuotedStr(Trim('³É¹¦'))); + SQL.Add(')'); + ExecSQL; + end; + end; + CDS_1.Delete; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɾ³ý³É¹¦£¡', 'ÌáʾÐÅÏ¢'); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ɾ³ýʧ°Ü!', 'ÌáʾÐÅÏ¢', 0); + end; +end; + +procedure TfrmCraftInfo.N1Click(Sender: TObject); +begin + SelOKNoFiler(Tv1, True); +end; + +procedure TfrmCraftInfo.N2Click(Sender: TObject); +begin + SelOKNoFiler(Tv1, False); +end; + +procedure TfrmCraftInfo.TBExportClick(Sender: TObject); +begin + if CDS_1.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxGrid1); +end; + +procedure TfrmCraftInfo.ToolButton2Click(Sender: TObject); +begin + WriteCxGrid(self.Caption + 'TV1', Tv1, '¹¤ÒÕ¹ÜÀí'); +end; + +procedure TfrmCraftInfo.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmCraftInfo.CRCodeKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + InitGrid(); +end; + +end. diff --git a/A02基础产å“�管ç�†/U_CraftInfoInput.dfm b/A02基础产å“�管ç�†/U_CraftInfoInput.dfm new file mode 100644 index 0000000..21dd31b --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfoInput.dfm @@ -0,0 +1,2118 @@ +object frmCraftInfoInput: TfrmCraftInfoInput + Left = 459 + Top = 231 + Caption = #20135#21697#24037#33402#24405#20837 + ClientHeight = 620 + ClientWidth = 1533 + Color = clWhite + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = True + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Tag = 1 + Left = 0 + Top = 0 + Width = 1533 + Height = 38 + AutoSize = True + ButtonHeight = 38 + ButtonWidth = 91 + Caption = 'ToolBar1' + Color = clWhite + DisabledImages = DataLink_ClothInfo.ImageList_new32 + Images = DataLink_ClothInfo.ImageList_new32 + List = True + ParentColor = False + ShowCaptions = True + TabOrder = 0 + object ToolButton1: TToolButton + Tag = 1 + Left = 0 + Top = 0 + AutoSize = True + Caption = #20445#23384 + ImageIndex = 16 + OnClick = ToolButton1Click + end + object ToolButton9: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #20445#23384#26684#24335 + ImageIndex = 16 + OnClick = ToolButton9Click + end + object TBClose: TToolButton + Left = 166 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = TBCloseClick + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 38 + Width = 1533 + Height = 160 + Align = alTop + BevelInner = bvNone + BevelOuter = bvNone + Color = clWhite + Ctl3D = False + ParentColor = False + ParentCtl3D = False + TabOrder = 1 + object Label1: TLabel + Left = 31 + Top = 11 + Width = 65 + Height = 12 + Caption = #24037#33402#32534#21495#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 362 + Top = 11 + Width = 65 + Height = 12 + Caption = #24037#33402#21517#31216#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label3: TLabel + Left = 29 + Top = 42 + Width = 39 + Height = 12 + Caption = #38376#24133#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 360 + Top = 42 + Width = 39 + Height = 12 + Caption = #20811#37325#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 675 + Top = 40 + Width = 39 + Height = 12 + Caption = #39068#33394#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 29 + Top = 68 + Width = 39 + Height = 12 + Caption = #22836#32441#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 360 + Top = 68 + Width = 39 + 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 Label8: TLabel + Left = 675 + Top = 70 + Width = 39 + 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 Label9: TLabel + Left = 29 + Top = 102 + Width = 65 + Height = 12 + Caption = #19978#26426#32428#23494#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label10: TLabel + Left = 360 + Top = 102 + Width = 52 + 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 Label11: TLabel + Left = 675 + Top = 101 + Width = 39 + 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 Label12: TLabel + Left = 29 + Top = 130 + Width = 52 + 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 Label13: TLabel + Left = 360 + Top = 130 + Width = 39 + 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 CR_Code: TEdit + Tag = 2 + Left = 93 + Top = 8 + Width = 234 + Height = 18 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + ReadOnly = True + TabOrder = 0 + end + object CR_Name: TEdit + Tag = 2 + Left = 426 + Top = 8 + Width = 340 + Height = 18 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 1 + end + object C_Width: TBtnEditC + Tag = 2 + Left = 93 + Top = 38 + Width = 234 + Height = 20 + Hint = 'CYMF/'#38376#24133 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnBtnUpClick = C_WidthBtnUpClick + OnBtnDnClick = C_WidthBtnDnClick + end + object C_GramWeight: TBtnEditC + Tag = 2 + Left = 426 + Top = 38 + Width = 234 + Height = 20 + Hint = 'CYKZ/'#20811#37325 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnBtnUpClick = C_WidthBtnUpClick + OnBtnDnClick = C_WidthBtnDnClick + end + object C_Color: TEdit + Tag = 2 + Left = 738 + Top = 38 + Width = 234 + Height = 18 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnKeyPress = CYColorKeyPress + end + object C_YarnQty: 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 = 5 + end + object head_count: TEdit + Tag = 2 + Left = 426 + 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 = 6 + end + object strip_width: TEdit + Tag = 2 + Left = 738 + 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 = 7 + end + object C_MachLatitudeDensity: TEdit + Tag = 2 + Left = 93 + 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 = 8 + end + object row_count_top: 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 = 9 + end + object displace: TEdit + Tag = 2 + Left = 738 + 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 = 10 + end + object reed_width: TEdit + Tag = 2 + Left = 93 + Top = 127 + Width = 234 + Height = 18 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 11 + end + object C_ReedNo: TEdit + Tag = 2 + Left = 426 + Top = 127 + Width = 234 + Height = 18 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 12 + end + end + object cxPageControl3: TcxPageControl + Left = 0 + Top = 198 + Width = 1533 + Height = 422 + Align = alClient + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + TabOrder = 2 + Properties.ActivePage = cxTabSheet7 + Properties.CustomButtons.Buttons = <> + ClientRectBottom = 420 + ClientRectLeft = 2 + ClientRectRight = 1531 + ClientRectTop = 30 + object cxTabSheet1: TcxTabSheet + Caption = ' '#32463#32428#32433#21407#26009' ' + ImageIndex = 0 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 737 + Height = 390 + Align = alLeft + TabOrder = 0 + object cxPageControl2: TcxPageControl + Left = 1 + Top = 42 + Width = 735 + Height = 347 + Align = alClient + Color = clWhite + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = #23435#20307 + Font.Style = [] + ParentBackground = False + ParentColor = False + ParentFont = False + TabOrder = 0 + Visible = False + Properties.CustomButtons.Buttons = <> + Properties.Style = 6 + ClientRectBottom = 347 + ClientRectRight = 735 + ClientRectTop = 0 + end + object cxGrid1: TcxGrid + Left = 1 + Top = 42 + Width = 735 + Height = 347 + Align = alClient + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + TabOrder = 1 + object TV1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_1 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = cxGridDBColumn7 + end + item + Kind = skSum + Column = TV1Column1 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + 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' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 131 + end + object cxGridDBColumn4: TcxGridDBColumn + Caption = #21407#26009#21517#31216 + DataBinding.FieldName = 'Y_Name' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Options.Moving = False + Options.Sorting = False + Width = 138 + end + object cxGridDBColumn5: TcxGridDBColumn + Caption = #32433#32447#21697#29260 + DataBinding.FieldName = 'Brand' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Options.Moving = False + Options.Sorting = False + Width = 111 + end + object cxGridDBColumn8: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'Y_Color' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 99 + end + object cxGridDBColumn7: TcxGridDBColumn + Caption = #37197#27604 + DataBinding.FieldName = 'Y_Ratio' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV1YRatioPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 116 + end + object TV1Column1: TcxGridDBColumn + Caption = #29992#37327 + DataBinding.FieldName = 'Y_Qty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV1Column2: TcxGridDBColumn + Caption = 'D'#25968 + DataBinding.FieldName = 'Denier' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 66 + end + end + object cxGridLevel2: TcxGridLevel + GridView = TV1 + end + end + object Panel3: TPanel + Left = 1 + Top = 1 + Width = 735 + Height = 41 + Align = alTop + TabOrder = 2 + object Panel4: TPanel + Left = 1 + Top = 1 + Width = 184 + Height = 39 + Align = alLeft + TabOrder = 0 + object Label20: TLabel + Left = 37 + Top = 7 + Width = 84 + Height = 20 + Caption = #32463#32433#37197#27604 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -20 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + end + object ToolBar2: TToolBar + Tag = 1 + Left = 185 + Top = 1 + Width = 237 + Height = 39 + Align = alLeft + AutoSize = True + ButtonHeight = 38 + ButtonWidth = 91 + Caption = 'ToolBar1' + Color = clWhite + DisabledImages = DataLink_ClothInfo.ImageList_new32 + EdgeInner = esNone + EdgeOuter = esNone + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_ClothInfo.ImageList_new32 + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 1 + object ToolButton2: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 2 + OnClick = ToolButton2Click + end + object ToolButton3: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 6 + OnClick = ToolButton3Click + end + object ToolButton5: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #35745#31639#29992#37327 + ImageIndex = 23 + OnClick = ToolButton5Click + end + end + end + end + object Panel2: TPanel + Left = 737 + Top = 0 + Width = 792 + Height = 390 + Align = alClient + TabOrder = 1 + object cxPageControl1: TcxPageControl + Left = 1 + Top = 42 + Width = 790 + Height = 347 + Align = alClient + Color = clWhite + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = #23435#20307 + Font.Style = [] + ParentBackground = False + ParentColor = False + ParentFont = False + TabOrder = 0 + Visible = False + Properties.CustomButtons.Buttons = <> + Properties.Style = 6 + ClientRectBottom = 347 + ClientRectRight = 790 + ClientRectTop = 0 + end + object cxGrid2: TcxGrid + Left = 1 + Top = 42 + Width = 790 + Height = 347 + Align = alClient + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + TabOrder = 1 + object Tv2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_2 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v2Column5 + end + item + Kind = skSum + Column = Tv2Column1 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + 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' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_ClothInfo.Default + Width = 131 + end + object cxGridDBColumn1: TcxGridDBColumn + Caption = #21407#26009#21517#31216 + DataBinding.FieldName = 'Y_Name' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Options.Moving = False + Options.Sorting = False + Styles.Header = DataLink_ClothInfo.Default + Width = 138 + end + object v2Column2: TcxGridDBColumn + Caption = #32433#32447#21697#29260 + DataBinding.FieldName = 'Brand' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Options.Moving = False + Options.Sorting = False + Styles.Header = DataLink_ClothInfo.Default + Width = 111 + end + object v2Column5: TcxGridDBColumn + Caption = #37197#27604 + DataBinding.FieldName = 'Y_Ratio' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = Tv2YRatioPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_ClothInfo.Default + Width = 116 + end + object v2Column6: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'Y_Color' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_ClothInfo.Default + Width = 99 + end + object Tv2Column1: TcxGridDBColumn + Caption = #29992#37327 + DataBinding.FieldName = 'Y_Qty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 75 + end + object Tv2Column2: TcxGridDBColumn + Caption = 'D'#25968 + DataBinding.FieldName = 'Denier' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 66 + end + end + object cxGridLevel1: TcxGridLevel + GridView = Tv2 + end + end + object Panel5: TPanel + Left = 1 + Top = 1 + Width = 790 + Height = 41 + Align = alTop + TabOrder = 2 + object Panel6: TPanel + Left = 1 + Top = 1 + Width = 184 + Height = 39 + Align = alLeft + TabOrder = 0 + object Label21: TLabel + Left = 37 + Top = 7 + Width = 84 + Height = 20 + Caption = #32428#32433#37197#27604 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -20 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + end + object ToolBar3: TToolBar + Tag = 1 + Left = 185 + Top = 1 + Width = 237 + Height = 39 + Align = alLeft + AutoSize = True + ButtonHeight = 38 + ButtonWidth = 91 + Caption = 'ToolBar1' + Color = clWhite + DisabledImages = DataLink_ClothInfo.ImageList_new32 + EdgeInner = esNone + EdgeOuter = esNone + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_ClothInfo.ImageList_new32 + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 1 + object ToolButton4: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 2 + OnClick = ToolButton4Click + end + object ToolButton7: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 6 + OnClick = ToolButton7Click + end + object ToolButton8: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #35745#31639#29992#37327 + ImageIndex = 23 + OnClick = ToolButton8Click + end + end + end + end + end + object cxTabSheet2: TcxTabSheet + Caption = #32441#29256#22270 + ImageIndex = 1 + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 1529 + Height = 390 + Align = alClient + TabOrder = 0 + object Label35: TLabel + Left = 30 + Top = 17 + Width = 15 + Height = 27 + Caption = '1' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label34: TLabel + Left = 198 + Top = 17 + Width = 15 + Height = 27 + Caption = '2' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label36: TLabel + Left = 358 + Top = 17 + Width = 15 + Height = 27 + Caption = '3' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label37: TLabel + Left = 523 + Top = 17 + Width = 15 + Height = 27 + Caption = '4' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label38: TLabel + Left = 699 + Top = 17 + Width = 15 + Height = 27 + Caption = '5' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label39: TLabel + Left = 870 + Top = 17 + Width = 15 + Height = 27 + Caption = '6' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label40: TLabel + Left = 1038 + Top = 17 + Width = 15 + Height = 27 + Caption = '7' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label41: TLabel + Left = 1203 + Top = 17 + Width = 15 + Height = 27 + Caption = '8' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label42: TLabel + Left = 1363 + Top = 17 + Width = 15 + Height = 27 + Caption = '9' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label44: TLabel + Left = 15 + Top = 82 + Width = 30 + Height = 27 + Caption = '10' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label45: TLabel + Left = 183 + Top = 85 + Width = 30 + Height = 27 + Caption = '11' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label46: TLabel + Left = 350 + Top = 85 + Width = 30 + Height = 27 + Caption = '12' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label48: TLabel + Left = 510 + Top = 85 + Width = 30 + Height = 27 + Caption = '13' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label49: TLabel + Left = 684 + Top = 85 + Width = 30 + Height = 27 + Caption = '14' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label50: TLabel + Left = 855 + Top = 85 + Width = 30 + Height = 27 + Caption = '15' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label51: TLabel + Left = 1023 + Top = 89 + Width = 30 + Height = 27 + Caption = '16' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label52: TLabel + Left = 1188 + Top = 89 + Width = 30 + Height = 27 + Caption = '17' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label53: TLabel + Left = 1348 + Top = 89 + Width = 30 + Height = 27 + Caption = '18' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label54: TLabel + Left = 15 + Top = 160 + Width = 30 + Height = 27 + Caption = '19' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label55: TLabel + Left = 183 + Top = 160 + Width = 30 + Height = 27 + Caption = '20' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label57: TLabel + Left = 350 + Top = 160 + Width = 30 + Height = 27 + Caption = '21' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label58: TLabel + Left = 510 + Top = 160 + Width = 30 + Height = 27 + Caption = '22' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label59: TLabel + Left = 684 + Top = 160 + Width = 30 + Height = 27 + Caption = '23' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label60: TLabel + Left = 855 + Top = 160 + Width = 30 + Height = 27 + Caption = '24' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label61: TLabel + Left = 1023 + Top = 164 + Width = 30 + Height = 27 + Caption = '25' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label62: TLabel + Left = 1188 + Top = 164 + Width = 30 + Height = 27 + Caption = '26' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label63: TLabel + Left = 1348 + Top = 164 + Width = 30 + Height = 27 + Caption = '27' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label64: TLabel + Left = 15 + Top = 239 + Width = 30 + Height = 27 + Caption = '28' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label65: TLabel + Left = 183 + Top = 239 + Width = 30 + Height = 27 + Caption = '29' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label66: TLabel + Left = 350 + Top = 239 + Width = 30 + Height = 27 + Caption = '30' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label67: TLabel + Left = 510 + Top = 239 + Width = 30 + Height = 27 + Caption = '31' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label68: TLabel + Left = 684 + Top = 239 + Width = 30 + Height = 27 + Caption = '32' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label69: TLabel + Left = 855 + Top = 239 + Width = 30 + Height = 27 + Caption = '33' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label70: TLabel + Left = 1023 + Top = 243 + Width = 30 + Height = 27 + Caption = '34' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label71: TLabel + Left = 1188 + Top = 243 + Width = 30 + Height = 27 + Caption = '35' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label72: TLabel + Left = 1348 + Top = 243 + Width = 30 + Height = 27 + Caption = '36' + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -27 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object WB_2: TEdit + Tag = 2 + Left = 58 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 0 + end + object WB_1: TEdit + Tag = 2 + Left = 58 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 1 + end + object WB_4: TEdit + Tag = 2 + Left = 226 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 2 + end + object WB_3: TEdit + Tag = 2 + Left = 226 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 3 + end + object WB_6: TEdit + Tag = 2 + Left = 386 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 4 + end + object WB_5: TEdit + Tag = 2 + Left = 386 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 5 + end + object WB_8: TEdit + Tag = 2 + Left = 551 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 6 + end + object WB_7: TEdit + Tag = 2 + Left = 551 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 7 + end + object WB_10: TEdit + Tag = 2 + Left = 727 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 8 + end + object WB_9: TEdit + Tag = 2 + Left = 727 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 9 + end + object WB_12: TEdit + Tag = 2 + Left = 898 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 10 + end + object WB_11: TEdit + Tag = 2 + Left = 898 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 11 + end + object WB_14: TEdit + Tag = 2 + Left = 1066 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 12 + end + object WB_13: TEdit + Tag = 2 + Left = 1066 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 13 + end + object WB_16: TEdit + Tag = 2 + Left = 1226 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 14 + end + object WB_15: TEdit + Tag = 2 + Left = 1226 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 15 + end + object WB_18: TEdit + Tag = 2 + Left = 1391 + Top = 42 + Width = 120 + Height = 29 + TabOrder = 16 + end + object WB_17: TEdit + Tag = 2 + Left = 1391 + Top = 14 + Width = 120 + Height = 29 + TabOrder = 17 + end + object WB_20: TEdit + Tag = 2 + Left = 58 + Top = 107 + Width = 120 + Height = 29 + TabOrder = 18 + end + object WB_19: TEdit + Tag = 2 + Left = 58 + Top = 79 + Width = 120 + Height = 29 + TabOrder = 19 + end + object WB_22: TEdit + Tag = 2 + Left = 226 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 20 + end + object WB_21: TEdit + Tag = 2 + Left = 226 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 21 + end + object WB_24: TEdit + Tag = 2 + Left = 386 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 22 + end + object WB_23: TEdit + Tag = 2 + Left = 386 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 23 + end + object WB_26: TEdit + Tag = 2 + Left = 553 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 24 + end + object WB_25: TEdit + Tag = 2 + Left = 553 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 25 + end + object WB_28: TEdit + Tag = 2 + Left = 727 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 26 + end + object WB_27: TEdit + Tag = 2 + Left = 727 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 27 + end + object WB_30: TEdit + Tag = 2 + Left = 898 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 28 + end + object WB_29: TEdit + Tag = 2 + Left = 898 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 29 + end + object WB_32: TEdit + Tag = 2 + Left = 1066 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 30 + end + object WB_31: TEdit + Tag = 2 + Left = 1066 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 31 + end + object WB_34: TEdit + Tag = 2 + Left = 1226 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 32 + end + object WB_33: TEdit + Tag = 2 + Left = 1226 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 33 + end + object WB_36: TEdit + Tag = 2 + Left = 1391 + Top = 110 + Width = 120 + Height = 29 + TabOrder = 34 + end + object WB_35: TEdit + Tag = 2 + Left = 1391 + Top = 82 + Width = 120 + Height = 29 + TabOrder = 35 + end + object WB_38: TEdit + Tag = 2 + Left = 58 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 36 + end + object WB_37: TEdit + Tag = 2 + Left = 58 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 37 + end + object WB_40: TEdit + Tag = 2 + Left = 226 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 38 + end + object WB_39: TEdit + Tag = 2 + Left = 226 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 39 + end + object WB_42: TEdit + Tag = 2 + Left = 386 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 40 + end + object WB_41: TEdit + Tag = 2 + Left = 386 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 41 + end + object WB_44: TEdit + Tag = 2 + Left = 553 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 42 + end + object WB_43: TEdit + Tag = 2 + Left = 553 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 43 + end + object WB_46: TEdit + Tag = 2 + Left = 727 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 44 + end + object WB_45: TEdit + Tag = 2 + Left = 727 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 45 + end + object WB_48: TEdit + Tag = 2 + Left = 898 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 46 + end + object WB_47: TEdit + Tag = 2 + Left = 898 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 47 + end + object WB_50: TEdit + Tag = 2 + Left = 1066 + Top = 188 + Width = 120 + Height = 29 + TabOrder = 48 + end + object WB_49: TEdit + Tag = 2 + Left = 1066 + Top = 158 + Width = 120 + Height = 29 + TabOrder = 49 + end + object WB_52: TEdit + Tag = 2 + Left = 1226 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 50 + end + object WB_51: TEdit + Tag = 2 + Left = 1226 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 51 + end + object WB_54: TEdit + Tag = 2 + Left = 1391 + Top = 187 + Width = 120 + Height = 29 + TabOrder = 52 + end + object WB_53: TEdit + Tag = 2 + Left = 1391 + Top = 157 + Width = 120 + Height = 29 + TabOrder = 53 + end + object WB_56: TEdit + Tag = 2 + Left = 58 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 54 + end + object WB_55: TEdit + Tag = 2 + Left = 58 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 55 + end + object WB_58: TEdit + Tag = 2 + Left = 226 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 56 + end + object WB_57: TEdit + Tag = 2 + Left = 226 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 57 + end + object WB_60: TEdit + Tag = 2 + Left = 386 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 58 + end + object WB_59: TEdit + Tag = 2 + Left = 386 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 59 + end + object WB_62: TEdit + Tag = 2 + Left = 553 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 60 + end + object WB_61: TEdit + Tag = 2 + Left = 553 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 61 + end + object WB_64: TEdit + Tag = 2 + Left = 727 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 62 + end + object WB_63: TEdit + Tag = 2 + Left = 727 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 63 + end + object WB_66: TEdit + Tag = 2 + Left = 898 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 64 + end + object WB_65: TEdit + Tag = 2 + Left = 898 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 65 + end + object WB_68: TEdit + Tag = 2 + Left = 1066 + Top = 267 + Width = 120 + Height = 29 + TabOrder = 66 + end + object WB_67: TEdit + Tag = 2 + Left = 1066 + Top = 237 + Width = 120 + Height = 29 + TabOrder = 67 + end + object WB_70: TEdit + Tag = 2 + Left = 1226 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 68 + end + object WB_69: TEdit + Tag = 2 + Left = 1226 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 69 + end + object WB_72: TEdit + Tag = 2 + Left = 1391 + Top = 266 + Width = 120 + Height = 29 + TabOrder = 70 + end + object WB_71: TEdit + Tag = 2 + Left = 1391 + Top = 236 + Width = 120 + Height = 29 + TabOrder = 71 + end + end + end + object cxTabSheet5: TcxTabSheet + Caption = #32463#32433#25490#21015 + ImageIndex = 4 + object warp_arrange: TMemo + Left = 0 + Top = 0 + Width = 1529 + Height = 390 + 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 + object weft_arrange: TMemo + Left = 0 + Top = 0 + Width = 1529 + Height = 390 + 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 cxTabSheet7: TcxTabSheet + Caption = #31359#32508#27861 + ImageIndex = 6 + object Panel9: TPanel + Left = 0 + Top = 0 + Width = 1529 + Height = 390 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label26: TLabel + Left = 0 + Top = 0 + Width = 1529 + Height = 33 + Align = alTop + AutoSize = False + Caption = #31359#32508#27861#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Layout = tlCenter + end + object threading_method: TMemo + Left = 0 + Top = 33 + Width = 1529 + Height = 357 + 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 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + Parameters = <> + Left = 505 + Top = 9 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 613 + Top = 17 + end + object CDS_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 344 + Top = 488 + end + object DS_1: TDataSource + DataSet = CDS_1 + Left = 432 + Top = 488 + end + object CDS_2: TClientDataSet + Aggregates = <> + Params = <> + Left = 895 + Top = 474 + end + object DS_2: TDataSource + DataSet = CDS_2 + Left = 1000 + Top = 488 + end +end diff --git a/A02基础产å“�管ç�†/U_CraftInfoInput.pas b/A02基础产å“�管ç�†/U_CraftInfoInput.pas new file mode 100644 index 0000000..0424bc2 --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfoInput.pas @@ -0,0 +1,744 @@ +unit U_CraftInfoInput; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel, cxGridCustomTableView, + cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, + cxGrid, ComCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, + cxButtonEdit, StdCtrls, ExtCtrls, cxCurrencyEdit, BtnEdit, U_BaseList, + cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, + cxNavigator, dxDateRanges, dxBarBuiltInMenu, cxPC, dxScrollbarAnnotations, + cxCheckBox, dxSkinWXI; + +type + TfrmCraftInfoInput = class(TForm) + ToolBar1: TToolBar; + ToolButton1: TToolButton; + ToolButton9: TToolButton; + TBClose: TToolButton; + ADOQueryCmd: TADOQuery; + ADOQueryTemp: TADOQuery; + ScrollBox1: TScrollBox; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + Label10: TLabel; + Label11: TLabel; + Label12: TLabel; + Label13: TLabel; + CR_Code: TEdit; + CR_Name: TEdit; + C_Width: TBtnEditC; + C_GramWeight: TBtnEditC; + C_Color: TEdit; + C_YarnQty: TEdit; + head_count: TEdit; + strip_width: TEdit; + C_MachLatitudeDensity: TEdit; + row_count_top: TEdit; + displace: TEdit; + reed_width: TEdit; + C_ReedNo: TEdit; + cxPageControl3: TcxPageControl; + cxTabSheet1: TcxTabSheet; + Panel1: TPanel; + cxPageControl2: TcxPageControl; + cxGrid1: TcxGrid; + TV1: TcxGridDBTableView; + TV1SeqNo: TcxGridDBColumn; + cxGridDBColumn3: TcxGridDBColumn; + cxGridDBColumn4: TcxGridDBColumn; + cxGridDBColumn5: TcxGridDBColumn; + cxGridDBColumn8: TcxGridDBColumn; + cxGridDBColumn7: TcxGridDBColumn; + TV1Column1: TcxGridDBColumn; + TV1Column2: TcxGridDBColumn; + cxGridLevel2: TcxGridLevel; + Panel3: TPanel; + Panel4: TPanel; + Label20: TLabel; + ToolBar2: TToolBar; + ToolButton2: TToolButton; + ToolButton3: TToolButton; + ToolButton5: TToolButton; + Panel2: TPanel; + cxPageControl1: TcxPageControl; + cxGrid2: TcxGrid; + Tv2: TcxGridDBTableView; + Tv2SeqNo: TcxGridDBColumn; + v2Column10: TcxGridDBColumn; + cxGridDBColumn1: TcxGridDBColumn; + v2Column2: TcxGridDBColumn; + v2Column5: TcxGridDBColumn; + v2Column6: TcxGridDBColumn; + Tv2Column1: TcxGridDBColumn; + Tv2Column2: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + Panel5: TPanel; + Panel6: TPanel; + Label21: TLabel; + ToolBar3: TToolBar; + ToolButton4: TToolButton; + ToolButton7: TToolButton; + ToolButton8: TToolButton; + cxTabSheet2: TcxTabSheet; + Panel7: TPanel; + Label35: TLabel; + Label34: TLabel; + Label36: TLabel; + Label37: TLabel; + Label38: TLabel; + Label39: TLabel; + Label40: TLabel; + Label41: TLabel; + Label42: TLabel; + Label44: TLabel; + Label45: TLabel; + Label46: TLabel; + Label48: TLabel; + Label49: TLabel; + Label50: TLabel; + Label51: TLabel; + Label52: TLabel; + Label53: TLabel; + Label54: TLabel; + Label55: TLabel; + Label57: TLabel; + Label58: TLabel; + Label59: TLabel; + Label60: TLabel; + Label61: TLabel; + Label62: TLabel; + Label63: TLabel; + Label64: TLabel; + Label65: TLabel; + Label66: TLabel; + Label67: TLabel; + Label68: TLabel; + Label69: TLabel; + Label70: TLabel; + Label71: TLabel; + Label72: TLabel; + WB_2: TEdit; + WB_1: TEdit; + WB_4: TEdit; + WB_3: TEdit; + WB_6: TEdit; + WB_5: TEdit; + WB_8: TEdit; + WB_7: TEdit; + WB_10: TEdit; + WB_9: TEdit; + WB_12: TEdit; + WB_11: TEdit; + WB_14: TEdit; + WB_13: TEdit; + WB_16: TEdit; + WB_15: TEdit; + WB_18: TEdit; + WB_17: TEdit; + WB_20: TEdit; + WB_19: TEdit; + WB_22: TEdit; + WB_21: TEdit; + WB_24: TEdit; + WB_23: TEdit; + WB_26: TEdit; + WB_25: TEdit; + WB_28: TEdit; + WB_27: TEdit; + WB_30: TEdit; + WB_29: TEdit; + WB_32: TEdit; + WB_31: TEdit; + WB_34: TEdit; + WB_33: TEdit; + WB_36: TEdit; + WB_35: TEdit; + WB_38: TEdit; + WB_37: TEdit; + WB_40: TEdit; + WB_39: TEdit; + WB_42: TEdit; + WB_41: TEdit; + WB_44: TEdit; + WB_43: TEdit; + WB_46: TEdit; + WB_45: TEdit; + WB_48: TEdit; + WB_47: TEdit; + WB_50: TEdit; + WB_49: TEdit; + WB_52: TEdit; + WB_51: TEdit; + WB_54: TEdit; + WB_53: TEdit; + WB_56: TEdit; + WB_55: TEdit; + WB_58: TEdit; + WB_57: TEdit; + WB_60: TEdit; + WB_59: TEdit; + WB_62: TEdit; + WB_61: TEdit; + WB_64: TEdit; + WB_63: TEdit; + WB_66: TEdit; + WB_65: TEdit; + WB_68: TEdit; + WB_67: TEdit; + WB_70: TEdit; + WB_69: TEdit; + WB_72: TEdit; + WB_71: TEdit; + cxTabSheet5: TcxTabSheet; + warp_arrange: TMemo; + cxTabSheet6: TcxTabSheet; + weft_arrange: TMemo; + cxTabSheet7: TcxTabSheet; + Panel9: TPanel; + Label26: TLabel; + threading_method: TMemo; + CDS_1: TClientDataSet; + DS_1: TDataSource; + CDS_2: TClientDataSet; + DS_2: TDataSource; + procedure FormShow(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure CYColorKeyPress(Sender: TObject; var Key: Char); + procedure C_WidthBtnDnClick(Sender: TObject); + procedure C_WidthBtnUpClick(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure ToolButton7Click(Sender: TObject); + procedure ToolButton4Click(Sender: TObject); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton8Click(Sender: TObject); + procedure ToolButton9Click(Sender: TObject); + procedure TV1YRatioPropertiesEditValueChanged(Sender: TObject); + procedure Tv2YRatioPropertiesEditValueChanged(Sender: TObject); + private + { Private declarations } + procedure InitGrid(); + procedure AddPresetYarnRows(ACDS: TClientDataSet); + function SaveData(): Boolean; + procedure CALCYarnQty(); + procedure CalcGramWeight(); + procedure SyncYRatioFromEditor(ACDS: TClientDataSet; Sender: TObject); + public + FCRID: string; + { Public declarations } + end; + +var + frmCraftInfoInput: TfrmCraftInfoInput; + +implementation + +uses + U_DataLink, U_RTFun, U_ZDYHelp, U_CraftSync; + +{$R *.dfm} + +procedure TfrmCraftInfoInput.CALCYarnQty(); +var + MYarnQty, MOrdQty, MWidth, MMachLatitudeDensity: Double; +begin + MYarnQty := STRTOFLOATDEF(C_YarnQty.Text, 0); + MOrdQty := 10000; + MWidth := STRTOFLOATDEF(StringReplace(C_Width.Text, 'CM', '', [rfReplaceAll, rfIgnoreCase]), 0); + MMachLatitudeDensity := STRTOFLOATDEF(C_MachLatitudeDensity.Text, 0); + with CDS_1 do + begin + DisableControls; + First; + while not Eof do + begin + Edit; + FieldByName('Y_Qty').Value := MYarnQty * MOrdQty * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000; + Next; + end; + EnableControls; + end; + + with CDS_2 do + begin + DisableControls; + First; + while not Eof do + begin + Edit; + FieldByName('Y_Qty').Value := MMachLatitudeDensity * MOrdQty * MWidth * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000; + Next; + end; + EnableControls; + end; + +end; + +procedure TfrmCraftInfoInput.SyncYRatioFromEditor(ACDS: TClientDataSet; Sender: TObject); +var + MValue: Double; +begin + MValue := StrToFloatDef(Trim(TcxTextEdit(Sender).EditingText), -1); + if MValue < 0 then + Exit; + if ACDS.FieldByName('Y_Ratio').AsFloat <> MValue then + begin + ACDS.Edit; + ACDS.FieldByName('Y_Ratio').AsFloat := MValue; + ACDS.Post; + end; +end; + +procedure TfrmCraftInfoInput.CalcGramWeight(); + + function SumViewRatio(AView: TcxGridDBTableView; ARatioColumn: TcxGridDBColumn): Double; + var + i: Integer; + v: Variant; + begin + Result := 0; + for i := 0 to AView.DataController.RecordCount - 1 do + begin + v := AView.DataController.Values[i, ARatioColumn.Index]; + if not VarIsNull(v) then + Result := Result + v; + end; + end; + +begin + C_GramWeight.Text := FormatFloat('0.######', + (SumViewRatio(TV1, cxGridDBColumn7) + SumViewRatio(Tv2, v2Column5)) / 1000); +end; + +procedure TfrmCraftInfoInput.TV1YRatioPropertiesEditValueChanged(Sender: TObject); +begin + SyncYRatioFromEditor(CDS_1, Sender); + CalcGramWeight(); +end; + +procedure TfrmCraftInfoInput.Tv2YRatioPropertiesEditValueChanged(Sender: TObject); +begin + SyncYRatioFromEditor(CDS_2, Sender); + CalcGramWeight(); +end; + +procedure TfrmCraftInfoInput.InitGrid(); +begin + + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select * from BS_Craft_Info where CRID=''' + Trim(FCRID) + ''''); + 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); + threading_method.Text := Trim(ADOQueryTemp.fieldbyname('threading_method').AsString); + SCSHData(ADOQueryTemp, ScrollBox1, 2); + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select * from BS_Craft_Info_WB where CRID=''' + Trim(FCRID) + ''''); + Open; + end; + + SCSHData(ADOQueryTemp, PANEL7, 2); + + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select A.* from BS_Craft_Yarn A '); + sql.Add(' where YRType=' + quotedstr('¾­Ë¿') + ' and A.CRID=''' + Trim(FCRID) + ''''); + Open; + end; + SCreateCDS(ADOQueryTemp, CDS_1); + SInitCDSData(ADOQueryTemp, CDS_1); + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select A.* from BS_Craft_Yarn A '); + sql.Add(' where YRType=' + quotedstr('γ˿') + ' and A.CRID=''' + Trim(FCRID) + ''''); + Open; + end; + SCreateCDS(ADOQueryTemp, CDS_2); + SInitCDSData(ADOQueryTemp, CDS_2); +end; + +procedure TfrmCraftInfoInput.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 TfrmCraftInfoInput.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption + 'TV1', Tv1, '¾­É´Åä±È'); + ReadCxGrid(self.Caption + 'TV2', Tv2, 'γɴÅä±È'); + InitGrid(); +end; + +procedure TfrmCraftInfoInput.TBCloseClick(Sender: TObject); +begin + Close; +end; + +function TfrmCraftInfoInput.SaveData(): Boolean; +var + maxId, maxpbno: string; +begin + try + ADOQueryCmd.Connection.BeginTrans; + if Trim(FCRID) = '' then + begin + if GetLSNo(ADOQueryCmd, maxId, 'GY', 'BS_Craft_Info', 4, 1) = False then + begin + Result := False; + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('È¡¹¤ÒÕ±àºÅʧ°Ü£¡', 'Ìáʾ', 0); + Exit; + end; + end + else + begin + maxId := Trim(FCRID); + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BS_Craft_Info where CRID=''' + Trim(FCRID) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if IsEmpty then + begin + Append; + FieldByName('FILLID').Value := Trim(DCode); + FieldByName('FILLER').Value := Trim(DName); + FieldByName('FILLTIME').Value := SGetServerDateTime(ADOQueryTemp); + end + else + begin + Edit; + FieldByName('EDITER').Value := Trim(DName); + FieldByName('EDITTIME').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('CRID').Value := Trim(maxId); + if trim(CR_Code.Text) = '' then + CR_Code.Text := Trim(maxId); + RTSetsavedata(ADOQueryCmd, 'BS_Craft_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(threading_method.Text) = '' then + ADOQueryCmd.FieldByName('threading_method').Value := null + else + ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text); + Post; + end; + + ////////////////////////// ±£´æÎưæÍ¼ ////////////////////////// + + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BS_Craft_Info_WB where CRID=''' + Trim(FCRID) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if IsEmpty then + Append + else + Edit; + FieldByName('CRID').Value := Trim(maxId); + + RTSetsavedata(ADOQueryCmd, 'BS_Craft_Info_WB', Panel7, 2); + Post; + end; + + ////////////////////////// ±£´æÎưæÍ¼ ////////////////////////// + + ////////////////////////// ±£´æ¾­Ë¿Åä±È±í ////////////////////////// + with CDS_1 do + begin + First; + while not Eof do + begin + if Trim(CDS_1.fieldbyname('YRId').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, maxpbno, 'RJ', 'BS_Craft_Yarn', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('È¡Åä±È×ÓÁ÷Ë®ºÅʧ°Ü£¡', 'Ìáʾ', 0); + Exit; + end; + end + else + begin + maxpbno := Trim(CDS_1.fieldbyname('YRId').AsString); + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BS_Craft_Yarn where '); + sql.Add(' YRId=''' + Trim(maxpbno) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(CDS_1.fieldbyname('YRId').AsString) = '' then + begin + Append; + FieldByName('Filler').Value := Trim(DName); + FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); + end + else + begin + Edit; + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('YRType').Value := '¾­Ë¿'; + FieldByName('CRID').Value := Trim(maxId); + FieldByName('YRId').Value := Trim(maxpbno); + RTSetSaveDataCDS(ADOQueryCmd, TV1, CDS_1, 'BS_Craft_Yarn', 0); + Post; + end; + CDS_1.Edit; + CDS_1.FieldByName('CRID').Value := Trim(maxId); + CDS_1.FieldByName('YRId').Value := Trim(maxpbno); + + Next; + end; + end; +////////////////////////// ±£´æ¾­Ë¿Åä±È±í ////////////////////////// + +////////////////////////// ±£´æÎ³Ë¿Åä±È±í ////////////////////////// + with CDS_2 do + begin + First; + while not Eof do + begin + if Trim(CDS_2.fieldbyname('YRId').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, maxpbno, 'RJ', 'BS_Craft_Yarn', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('È¡Åä±È×ÓÁ÷Ë®ºÅʧ°Ü£¡', 'Ìáʾ', 0); + Exit; + end; + end + else + begin + maxpbno := Trim(CDS_2.fieldbyname('YRId').AsString); + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BS_Craft_Yarn where '); + sql.Add(' YRId=''' + Trim(maxpbno) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(CDS_2.fieldbyname('YRId').AsString) = '' then + begin + Append; + FieldByName('Filler').Value := Trim(DName); + FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); + end + else + begin + Edit; + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('YRType').Value := 'γ˿'; + FieldByName('CRID').Value := Trim(maxId); + FieldByName('YRId').Value := Trim(maxpbno); + RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_2, 'BS_Craft_Yarn', 0); + Post; + end; + CDS_2.Edit; + CDS_2.FieldByName('CRID').Value := Trim(maxId); + CDS_2.FieldByName('YRId').Value := Trim(maxpbno); + + Next; + end; + end; +////////////////////////// ±£´æÎ³Ë¿Åä±È±í ////////////////////////// + + ////////////////////////// ¹¤ÒÕ±£´æºó¾²Ä¬Í¬²½µ½ËùÓа󶨲úÆ· ////////////////////////// + SyncCraftToProduct(Trim(maxId)); + + ADOQueryCmd.Connection.CommitTrans; + FCRID := maxId; + Result := True; + except + Result := False; + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('±£´æÊ§°Ü!', 'Ìáʾ', 0); + end; +end; + +procedure TfrmCraftInfoInput.ToolButton1Click(Sender: TObject); +begin + CR_Name.SetFocus; + if Trim(CR_Name.Text) = '' then + begin + Application.MessageBox('¹¤ÒÕÃû³Æ²»ÄÜΪ¿Õ£¡', 'Ìáʾ', 0); + Exit; + end; + if SaveData() then + begin + Application.MessageBox('±£´æ³É¹¦£¡', 'Ìáʾ', 0); + ModalResult := 1; + end; +end; + +procedure TfrmCraftInfoInput.C_WidthBtnDnClick(Sender: TObject); +begin + TBtnEditC(Sender).Text := ''; + TBtnEditC(Sender).TxtCode := ''; +end; + +procedure TfrmCraftInfoInput.C_WidthBtnUpClick(Sender: TObject); +var + fsj: string; + FWZ: Integer; +begin + fsj := Trim(TEdit(Sender).Hint); + FWZ := Pos('/', fsj); + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := Copy(fsj, 1, FWZ - 1); + flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ); + if ShowModal = 1 then + begin + TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmCraftInfoInput.ToolButton2Click(Sender: TObject); +begin + //ÔöÐй̶¨ÐÂÔö¼×ÒÒ±û¶¡Î켺ÁùÐÐ(ÎÞÂÛ±íÖÐÊÇ·ñÒÑÓÐÊý¾Ý) + AddPresetYarnRows(CDS_1); +end; + +procedure TfrmCraftInfoInput.ToolButton3Click(Sender: TObject); +begin + if CDS_1.IsEmpty then + Exit; + if Trim(CDS_1.fieldbyname('YRId').AsString) <> '' then + begin + if Application.MessageBox('È·¶¨ÒªÉ¾³ýÊý¾ÝÂð£¿', 'Ìáʾ', 32 + 4) <> IDYES then + Exit; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete BS_Craft_Yarn where YRId=''' + Trim(CDS_1.fieldbyname('YRId').AsString) + ''''); + ExecSQL; + end; + end; + CDS_1.Delete; + CalcGramWeight(); +end; + +procedure TfrmCraftInfoInput.ToolButton4Click(Sender: TObject); +begin + //ÔöÐй̶¨ÐÂÔö¼×ÒÒ±û¶¡Î켺ÁùÐÐ(ÎÞÂÛ±íÖÐÊÇ·ñÒÑÓÐÊý¾Ý) + AddPresetYarnRows(CDS_2); +end; + +procedure TfrmCraftInfoInput.ToolButton5Click(Sender: TObject); +begin + CR_Name.SetFocus; + CALCYarnQty(); +end; + +procedure TfrmCraftInfoInput.CYColorKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + Key := #0; + SelectNext(ActiveControl as TWinControl, True, True); + end; +end; + +procedure TfrmCraftInfoInput.ToolButton7Click(Sender: TObject); +begin + if CDS_2.IsEmpty then + Exit; + if Trim(CDS_2.fieldbyname('YRId').AsString) <> '' then + begin + if Application.MessageBox('È·¶¨ÒªÉ¾³ýÊý¾ÝÂð£¿', 'Ìáʾ', 32 + 4) <> IDYES then + Exit; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete BS_Craft_Yarn where YRId=''' + Trim(CDS_2.fieldbyname('YRId').AsString) + ''''); + ExecSQL; + end; + end; + CDS_2.Delete; + CalcGramWeight(); +end; + +procedure TfrmCraftInfoInput.ToolButton8Click(Sender: TObject); +begin + CR_Name.SetFocus; + CALCYarnQty(); +end; + +procedure TfrmCraftInfoInput.ToolButton9Click(Sender: TObject); +begin + WriteCxGrid(self.Caption + 'TV1', Tv1, '¾­É´Åä±È'); + WriteCxGrid(self.Caption + 'TV2', Tv2, 'γɴÅä±È'); +end; + +end. diff --git a/A02基础产å“�管ç�†/U_CraftInfoSel.dfm b/A02基础产å“�管ç�†/U_CraftInfoSel.dfm new file mode 100644 index 0000000..bd7c534 --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfoSel.dfm @@ -0,0 +1,265 @@ +object frmCraftInfoSel: TfrmCraftInfoSel + Left = 400 + Top = 200 + Caption = #36873#25321#24037#33402 + ClientHeight = 520 + ClientWidth = 980 + Color = clWhite + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Position = poScreenCenter + OnShow = FormShow + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Tag = 1 + Left = 0 + Top = 0 + Width = 980 + Height = 38 + AutoSize = True + ButtonHeight = 38 + ButtonWidth = 91 + Caption = 'ToolBar1' + Color = clSkyBlue + DisabledImages = DataLink_ClothInfo.ImageList_new32 + Images = DataLink_ClothInfo.ImageList_new32 + List = True + ParentColor = False + ShowCaptions = True + TabOrder = 0 + object TBFind: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #26597#35810 + ImageIndex = 0 + OnClick = TBFindClick + end + object TBSave: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #30830#23450 + ImageIndex = 16 + OnClick = TBSaveClick + end + object TBClose: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 38 + Width = 980 + Height = 45 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = 16242829 + ParentBackground = False + TabOrder = 1 + object Label1: TLabel + Left = 22 + Top = 15 + Width = 60 + Height = 12 + Caption = #24037#33402#32534#21495#65306 + end + object Label2: TLabel + Left = 262 + Top = 15 + Width = 60 + Height = 12 + Caption = #24037#33402#21517#31216#65306 + end + object CR_Code: TEdit + Tag = 2 + Left = 88 + Top = 11 + Width = 150 + Height = 20 + TabOrder = 0 + OnKeyPress = CRCodeKeyPress + end + object CR_Name: TEdit + Tag = 2 + Left = 328 + Top = 11 + Width = 220 + Height = 20 + TabOrder = 1 + OnKeyPress = CRCodeKeyPress + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 83 + Width = 980 + Height = 437 + Align = alClient + TabOrder = 2 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnDblClick = Tv1DblClick + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_1 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + 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 + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object DS_1: TDataSource + DataSet = CDS_1 + Left = 640 + Top = 16 + end + object CDS_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 560 + Top = 16 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 720 + Top = 16 + end +end diff --git a/A02基础产å“�管ç�†/U_CraftInfoSel.pas b/A02基础产å“�管ç�†/U_CraftInfoSel.pas new file mode 100644 index 0000000..fb003f3 --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftInfoSel.pas @@ -0,0 +1,134 @@ +unit U_CraftInfoSel; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, ADODB, DBClient, ToolWin, ComCtrls, StdCtrls, ExtCtrls, + cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, + cxClasses, cxControls, cxGridCustomView, cxGrid, cxLookAndFeels, + cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator, + dxDateRanges, dxBarBuiltInMenu, dxScrollbarAnnotations, cxCheckBox; + +type + TfrmCraftInfoSel = class(TForm) + ToolBar1: TToolBar; + TBFind: TToolButton; + TBSave: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + Label2: TLabel; + CR_Code: TEdit; + CR_Name: TEdit; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + Tv1CR_Code: TcxGridDBColumn; + Tv1CR_Name: TcxGridDBColumn; + Tv1C_Width: TcxGridDBColumn; + Tv1C_GramWeight: TcxGridDBColumn; + Tv1C_Color: TcxGridDBColumn; + Tv1C_YarnQty: TcxGridDBColumn; + Tv1head_count: TcxGridDBColumn; + Tv1strip_width: TcxGridDBColumn; + Tv1C_MachLatitudeDensity: TcxGridDBColumn; + Tv1row_count_top: TcxGridDBColumn; + Tv1displace: TcxGridDBColumn; + Tv1reed_width: TcxGridDBColumn; + Tv1C_ReedNo: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + DS_1: TDataSource; + CDS_1: TClientDataSet; + ADOQueryMain: TADOQuery; + procedure FormShow(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure Tv1DblClick(Sender: TObject); + procedure CRCodeKeyPress(Sender: TObject; var Key: Char); + private + procedure InitGrid(); + { Private declarations } + public + { Public declarations } + end; + +var + frmCraftInfoSel: TfrmCraftInfoSel; + +implementation + +uses + U_DataLink, U_RTFun; + +{$R *.dfm} + +procedure TfrmCraftInfoSel.InitGrid(); +var + fwhere: string; +begin + fwhere := ' where 1=1 '; + if Trim(CR_Code.Text) <> '' then + fwhere := fwhere + ' and CR_Code like ' + QuotedStr('%' + Trim(CR_Code.Text) + '%'); + if Trim(CR_Name.Text) <> '' then + fwhere := fwhere + ' and CR_Name like ' + QuotedStr('%' + Trim(CR_Name.Text) + '%'); + + with ADOQueryMain do + begin + Close; + Filtered := False; + SQL.Clear; + SQL.Add('select * from BS_Craft_Info' + fwhere + ' order by CR_Code'); + Open; + end; + SCreateCDS(ADOQueryMain, CDS_1); + SInitCDSData(ADOQueryMain, CDS_1); + TV1.DataController.Filter.Clear; +end; + +procedure TfrmCraftInfoSel.FormShow(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmCraftInfoSel.FormDestroy(Sender: TObject); +begin + frmCraftInfoSel := nil; +end; + +procedure TfrmCraftInfoSel.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmCraftInfoSel.TBSaveClick(Sender: TObject); +begin + if CDS_1.IsEmpty then + Exit; + ModalResult := 1; +end; + +procedure TfrmCraftInfoSel.TBFindClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmCraftInfoSel.Tv1DblClick(Sender: TObject); +begin + if CDS_1.IsEmpty then + Exit; + ModalResult := 1; +end; + +procedure TfrmCraftInfoSel.CRCodeKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + Key := #0; + InitGrid(); + end; +end; + +end. diff --git a/A02基础产å“�管ç�†/U_CraftSync.pas b/A02基础产å“�管ç�†/U_CraftSync.pas new file mode 100644 index 0000000..3dd2c7a --- /dev/null +++ b/A02基础产å“�管ç�†/U_CraftSync.pas @@ -0,0 +1,170 @@ +unit U_CraftSync; + +interface + +uses + SysUtils, Classes, Variants, DB, ADODB; + +//½«¹¤ÒÕÊý¾Ý¾²Ä¬Í¬²½µ½ËùÓа󶨸ù¤ÒյIJúÆ·: +// Ö÷±í¹¤ÒÕ×Ö¶Î(º¬¹¤ÒÕ±àºÅ/Ãû³Æ) + ¾­Î³É´Åä±È×Ó±í + ÎÆ°æÍ¼×Ó±í +//×¢Òâ:±ØÐëÔÚµ÷Ó÷½µÄÊÂÎñÄÚÖ´ÐÐ,±¾¹ý³Ì²»×Ô¼º¿ªÊÂÎñ +procedure SyncCraftToProduct(const ACRID: string); + +implementation + +uses + U_DataLink, U_RTFun; + +function StrSQL(const AValue: Variant): string; +begin + if VarIsNull(AValue) then + Result := 'null' + else + Result := QuotedStr(Trim(VarToStr(AValue))); +end; + +function NumSQL(const AValue: Variant): string; +begin + if VarIsNull(AValue) then + Result := 'null' + else + Result := FormatFloat('0.##########', VarAsType(AValue, varDouble)); +end; + +function WBColList(const APrefix: string): string; +var + i: Integer; +begin + Result := ''; + for i := 1 to 72 do + begin + if Result <> '' then + Result := Result + ','; + Result := Result + APrefix + 'WB_' + IntToStr(i); + end; +end; + +procedure SyncCraftToProduct(const ACRID: string); +var + Qry, QryYarn: TADOQuery; + Products: TStringList; + i: Integer; + NewNo: string; +begin + if Trim(ACRID) = '' then + Exit; + Qry := TADOQuery.Create(nil); + QryYarn := TADOQuery.Create(nil); + Products := TStringList.Create; + try + Qry.Connection := DataLink_ClothInfo.ADOLink; + QryYarn.Connection := DataLink_ClothInfo.ADOLink; + + //1.Ö÷±í¹¤ÒÕ×ֶξµÏñ(Ö»¸üй¤ÒÕ¹ÜϽÁÐ,²»Åö²úÆ·×ÔÓÐ×Ö¶Î) + with Qry do + begin + Close; + SQL.Clear; + SQL.Add('update B set B.CRID=C.CRID,B.CR_Code=C.CR_Code,B.CR_Name=C.CR_Name'); + SQL.Add(',B.C_Width=C.C_Width,B.C_GramWeight=C.C_GramWeight,B.C_Color=C.C_Color'); + SQL.Add(',B.C_YarnQty=C.C_YarnQty,B.head_count=C.head_count,B.strip_width=C.strip_width'); + SQL.Add(',B.C_MachLatitudeDensity=C.C_MachLatitudeDensity,B.row_count_top=C.row_count_top'); + SQL.Add(',B.displace=C.displace,B.reed_width=C.reed_width,B.C_ReedNo=C.C_ReedNo'); + SQL.Add(',B.warp_arrange=C.warp_arrange,B.weft_arrange=C.weft_arrange,B.threading_method=C.threading_method'); + SQL.Add('from BS_Cloth_Info B join BS_Craft_Info C on C.CRID=B.CRID'); + SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID))); + ExecSQL; + end; + + //2.ÎÆ°æÍ¼¾µÏñ(ÿ²úÆ·Ò»ÐÐ,ÕûÐÐÌæ»») + with Qry do + begin + Close; + SQL.Clear; + SQL.Add('delete W from Bs_Cloth_Info_WB W join BS_Cloth_Info B on B.BCIID=W.BCIID'); + SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID))); + ExecSQL; + + Close; + SQL.Clear; + SQL.Add('insert into Bs_Cloth_Info_WB (BCIID,' + WBColList('') + ')'); + SQL.Add('select B.BCIID,' + WBColList('C.')); + SQL.Add('from BS_Cloth_Info B join BS_Craft_Info_WB C on C.CRID=B.CRID'); + SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID))); + ExecSQL; + end; + + //3.¾­Î³É´Åä±È¾µÏñ(Öð²úÆ·ÕûɾÕû²å,YRId°´²úÆ·±í×Ô¼ºµÄÁ÷ˮȡºÅ) + with Qry do + begin + Close; + SQL.Clear; + SQL.Add('select BCIID from BS_Cloth_Info where CRID=' + QuotedStr(Trim(ACRID))); + Open; + while not Eof do + begin + Products.Add(Trim(FieldByName('BCIID').AsString)); + Next; + end; + Close; + end; + + if Products.Count > 0 then + begin + with QryYarn do + begin + Close; + SQL.Clear; + SQL.Add('select * from BS_Craft_Yarn where CRID=' + QuotedStr(Trim(ACRID))); + SQL.Add('order by YRType,seq_no,YRId'); + Open; + end; + try + for i := 0 to Products.Count - 1 do + begin + with Qry do + begin + Close; + SQL.Clear; + SQL.Add('delete BS_Cloth_Yarn where BCIID=' + QuotedStr(Products[i])); + ExecSQL; + end; + + QryYarn.First; + while not QryYarn.Eof do + begin + if GetLSNo(Qry, NewNo, 'RJ', 'BS_Cloth_Yarn', 4, 1) = False then + raise Exception.Create('È¡²úÆ·Åä±ÈÁ÷Ë®ºÅʧ°Ü'); + with Qry do + begin + Close; + SQL.Clear; + SQL.Add('insert into BS_Cloth_Yarn (YRId,BCIID,YRType,seq_no,Y_Code,Y_Name,Brand,Y_Color,Denier,Y_Ratio,Y_Qty,Filler,FillTime)'); + SQL.Add('values (' + QuotedStr(Trim(NewNo)) + ',' + QuotedStr(Products[i])); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('YRType').Value)); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('seq_no').Value)); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Code').Value)); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Name').Value)); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('Brand').Value)); + SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Color').Value)); + SQL.Add(',' + NumSQL(QryYarn.FieldByName('Denier').Value)); + SQL.Add(',' + NumSQL(QryYarn.FieldByName('Y_Ratio').Value)); + SQL.Add(',' + NumSQL(QryYarn.FieldByName('Y_Qty').Value)); + SQL.Add(',' + QuotedStr(Trim(DName)) + ',getdate())'); + ExecSQL; + end; + QryYarn.Next; + end; + end; + finally + QryYarn.Close; + end; + end; + finally + Products.Free; + QryYarn.Free; + Qry.Free; + end; +end; + +end. diff --git a/A02基础产å“�管ç�†/U_GetDllForm.pas b/A02基础产å“�管ç�†/U_GetDllForm.pas index f8ddba3..65bfa49 100644 --- a/A02基础产å“�管ç�†/U_GetDllForm.pas +++ b/A02基础产å“�管ç�†/U_GetDllForm.pas @@ -16,7 +16,7 @@ implementation uses U_DataLink, U_iniParam, U_ClothType, U_ClothInfo, U_TatClothInfo, - U_KnitClothInfoList; + U_KnitClothInfoList, U_CraftInfo; ///////////////////////////////////////////////////////////////// // ¹¦ÄÜ˵Ã÷:È¡DllÖеô°Ìå // @@ -174,6 +174,18 @@ begin end; end; + 142: // ²úÆ·¹¤ÒÕ¹ÜÀí + begin + with TfrmCraftInfo.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do // + begin + fFormID := FormID; + FormStyle := mstyle; + WindowState := mstate; + BorderStyle := mborderstyle; + mnewHandle := Handle; + end; + end; + 10000: begin for i := 0 to application.MainForm.MDIChildCount - 1 do diff --git a/A02基础产å“�管ç�†/U_TatClothInfo.dfm b/A02基础产å“�管ç�†/U_TatClothInfo.dfm index 5de4c2d..50ebd60 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfo.dfm +++ b/A02基础产å“�管ç�†/U_TatClothInfo.dfm @@ -84,6 +84,14 @@ inherited frmTatClothInfo: TfrmTatClothInfo ImageIndex = 3 OnClick = TBMLEditClick end + object TBBindCraft: TToolButton + Left = 497 + Top = 0 + AutoSize = True + Caption = #32465#23450#24037#33402 + ImageIndex = 4 + OnClick = TBBindCraftClick + end object tbStart: TToolButton Left = 521 Top = 0 @@ -537,6 +545,78 @@ inherited frmTatClothInfo: TfrmTatClothInfo Options.Editing = False Width = 80 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 = 120 + 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 end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/A02基础产å“�管ç�†/U_TatClothInfo.pas b/A02基础产å“�管ç�†/U_TatClothInfo.pas index 1efde86..6082d7a 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfo.pas +++ b/A02基础产å“�管ç�†/U_TatClothInfo.pas @@ -75,6 +75,7 @@ type TBAdd: TToolButton; TBEdit: TToolButton; TBMLEdit: TToolButton; + TBBindCraft: TToolButton; OpenDialog1: TOpenDialog; Label9: TLabel; C_GramWeight: TEdit; @@ -122,6 +123,14 @@ type ToolButton4: TToolButton; Tv1C_Color: TcxGridDBColumn; Tv1estimated_diff: TcxGridDBColumn; + Tv1CR_Code: TcxGridDBColumn; + Tv1CR_Name: TcxGridDBColumn; + Tv1head_count: TcxGridDBColumn; + Tv1strip_width: TcxGridDBColumn; + Tv1C_MachLatitudeDensity: TcxGridDBColumn; + Tv1row_count_top: TcxGridDBColumn; + Tv1displace: TcxGridDBColumn; + Tv1reed_width: TcxGridDBColumn; cxTabControl1: TcxTabControl; tbStart: TToolButton; tbPause: TToolButton; @@ -142,6 +151,7 @@ type procedure TBAddClick(Sender: TObject); procedure TBEditClick(Sender: TObject); procedure TBMLEditClick(Sender: TObject); + procedure TBBindCraftClick(Sender: TObject); procedure N1Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure TCBNOR1Change(Sender: TObject); @@ -186,7 +196,7 @@ implementation uses U_DataLink, U_RTFun, U_TatClothInfoInput, U_CloInfoFileUp, U_ClothTypeSel, - U_ZDYHelp, U_LabelPrint; + U_ZDYHelp, U_LabelPrint, U_CraftInfoSel, U_CraftSync; {$R *.dfm} procedure TfrmTatClothInfo.LookImage(FileName: string); @@ -976,6 +986,90 @@ begin WriteCxGrid(self.Caption + 'TV1', Tv1, 'ÑùÆ·¹ÜÀí'); end; +procedure TfrmTatClothInfo.TBBindCraftClick(Sender: TObject); +var + MBCIIDS, MCRID: string; +begin + if CDS_1.IsEmpty then + Exit; + + //¹´Ñ¡ÓÅÏÈ,δ¹´Ñ¡Ê±È¡µ±Ç°ÐÐ + MBCIIDS := ''; + CDS_1.DisableControls; + try + CDS_1.First; + while not CDS_1.Eof do + begin + if CDS_1.fieldbyname('SSel').AsBoolean then + begin + if MBCIIDS <> '' then + MBCIIDS := MBCIIDS + ',' + QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)) + else + MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)); + end; + CDS_1.Next; + end; + finally + CDS_1.EnableControls; + end; + if MBCIIDS = '' then + MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString)); + + MCRID := ''; + try + frmCraftInfoSel := TfrmCraftInfoSel.Create(Application); + with frmCraftInfoSel do + begin + if ShowModal = 1 then + begin + if not CDS_1.IsEmpty then + MCRID := Trim(CDS_1.fieldbyname('CRID').AsString); + end; + end; + finally + frmCraftInfoSel.Free; + end; + if Trim(MCRID) = '' then + Exit; + + try + ADOQueryCmd.Connection.BeginTrans; + //°ó¶¨¶¯×÷±¾ÉíֻдCRID(¹¤ÒÕ×Ö¶ÎÖµÓɾ²Ä¬Í¬²½Î¬»¤) + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('update BS_Cloth_Info set CRID=' + QuotedStr(Trim(MCRID))); + SQL.Add(',EDITER=' + QuotedStr(Trim(DName)) + ',EDITTIME=getdate()'); + SQL.Add(' where BCIID in (' + MBCIIDS + ')'); + ExecSQL; + end; + //¾²Ä¬Í¬²½¹¤ÒÕÊý¾Ýµ½°ó¶¨²úÆ·(Ö÷±í×Ö¶Î+¾­Î³É´Åä±È+ÎÆ°æÍ¼) + SyncCraftToProduct(Trim(MCRID)); + 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(MBCIIDS + ' -> ' + MCRID))); + SQL.Add(',' + QuotedStr(Trim('³É¹¦'))); + SQL.Add(')'); + ExecSQL; + end; + ADOQueryCmd.Connection.CommitTrans; + + InitGrid(); + Application.MessageBox('°ó¶¨¹¤Òճɹ¦£¡', 'ÌáʾÐÅÏ¢'); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox(PChar(Exception(ExceptObject).Message), 'ÌáʾÐÅÏ¢', 0); + end; +end; + procedure TfrmTatClothInfo.ToolButton3Click(Sender: TObject); var WSql: string; diff --git a/A02基础产å“�管ç�†/U_TatClothInfoInput.pas b/A02基础产å“�管ç�†/U_TatClothInfoInput.pas index 6d1d1cb..e47bddb 100644 --- a/A02基础产å“�管ç�†/U_TatClothInfoInput.pas +++ b/A02基础产å“�管ç�†/U_TatClothInfoInput.pas @@ -274,6 +274,8 @@ type private canshu1: string; Fint: Integer; + FBound: Boolean; + procedure SetCraftFieldsReadOnly(AReadOnly: Boolean); procedure InitGrid(); procedure AddPresetYarnRows(ACDS: TClientDataSet); function SaveData(): Boolean; @@ -421,6 +423,8 @@ end; procedure TfrmTatClothInfoInput.InitGrid(); begin + //ÏȻָ´¹¤ÒÕ×ֶοÉÌî³ä״̬(°ó¶¨Ì¬ÔÚĩβͳһÖÃÖ»¶Á) + SetCraftFieldsReadOnly(False); with ADOQueryTemp do begin @@ -430,6 +434,9 @@ begin Open; end; + //ÊÇ·ñÒѰ󶨹¤ÒÕ + FBound := Trim(ADOQueryTemp.fieldbyname('CRID').AsString) <> ''; + //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); @@ -479,6 +486,17 @@ begin end; SCreateCDS(ADOQueryTemp, CDS_3); SInitCDSData(ADOQueryTemp, CDS_3); + + //°ó¶¨¹¤ÒÕºó:¹¤ÒÕ¹ÜϽ×Ö¶Î/Åä±ÈÍø¸ñ/Ïà¹Ø°´Å¥È«²¿Ö»¶Á + SetCraftFieldsReadOnly(FBound); + TV1.OptionsData.Editing := not FBound; + Tv2.OptionsData.Editing := not FBound; + ToolButton2.Enabled := not FBound; + ToolButton3.Enabled := not FBound; + ToolButton4.Enabled := not FBound; + ToolButton5.Enabled := not FBound; + ToolButton7.Enabled := not FBound; + ToolButton8.Enabled := not FBound; end; procedure TfrmTatClothInfoInput.AddPresetYarnRows(ACDS: TClientDataSet); @@ -495,6 +513,82 @@ begin end; end; +procedure TfrmTatClothInfoInput.SetCraftFieldsReadOnly(AReadOnly: Boolean); +var + i: Integer; +begin + //°ó¶¨¹¤ÒÕºó,¹¤ÒÕ¹ÜϽ×Ö¶ÎÖ»×÷չʾ: + //TagÔÚ2/0¼äÇл»,ʹRTSetsavedata±£´æ²úƷʱ×Ô¶¯Ìø¹ýÕâЩ¿Ø¼þ;½ûÓ÷ÀÊÖ¹¤±à¼­ + if AReadOnly then + begin + C_Width.Tag := 0; + C_GramWeight.Tag := 0; + C_Color.Tag := 0; + C_YarnQty.Tag := 0; + head_count.Tag := 0; + strip_width.Tag := 0; + C_MachLatitudeDensity.Tag := 0; + row_count_top.Tag := 0; + displace.Tag := 0; + reed_width.Tag := 0; + C_ReedNo.Tag := 0; + + C_Width.Enabled := False; + C_GramWeight.Enabled := False; + C_Color.Enabled := False; + C_YarnQty.Enabled := False; + head_count.Enabled := False; + strip_width.Enabled := False; + C_MachLatitudeDensity.Enabled := False; + row_count_top.Enabled := False; + displace.Enabled := False; + reed_width.Enabled := False; + C_ReedNo.Enabled := False; + + warp_arrange.ReadOnly := True; + weft_arrange.ReadOnly := True; + threading_method.ReadOnly := True; + + for i := 0 to Panel7.ControlCount - 1 do + if Panel7.Controls[i] is TEdit then + Panel7.Controls[i].Enabled := False; + end + else + begin + C_Width.Tag := 2; + C_GramWeight.Tag := 2; + C_Color.Tag := 2; + C_YarnQty.Tag := 2; + head_count.Tag := 2; + strip_width.Tag := 2; + C_MachLatitudeDensity.Tag := 2; + row_count_top.Tag := 2; + displace.Tag := 2; + reed_width.Tag := 2; + C_ReedNo.Tag := 2; + + C_Width.Enabled := True; + C_GramWeight.Enabled := True; + C_Color.Enabled := True; + C_YarnQty.Enabled := True; + head_count.Enabled := True; + strip_width.Enabled := True; + C_MachLatitudeDensity.Enabled := True; + row_count_top.Enabled := True; + displace.Enabled := True; + reed_width.Enabled := True; + C_ReedNo.Enabled := True; + + warp_arrange.ReadOnly := False; + weft_arrange.ReadOnly := False; + threading_method.ReadOnly := False; + + for i := 0 to Panel7.ControlCount - 1 do + if Panel7.Controls[i] is TEdit then + Panel7.Controls[i].Enabled := True; + end; +end; + procedure TfrmTatClothInfoInput.FormShow(Sender: TObject); begin inherited; @@ -506,6 +600,11 @@ begin FBCIID := ''; BCIID.text := ''; C_Code.text := ''; + //¸´ÖƳöµÄвúÆ·ÊÓΪδ°ó¶¨,½çÃæÖµ×÷Ϊ³õʼÊý¾ÝÕÕ³£±£´æ + FBound := False; + SetCraftFieldsReadOnly(False); + TV1.OptionsData.Editing := True; + Tv2.OptionsData.Editing := True; ClearCDSColumn(CDS_2, ['YRId', 'bciid']); ClearCDSColumn(CDS_1, ['YRId', 'bciid']); ClearCDSColumn(CDS_3, ['QZID', 'bciid']); @@ -600,22 +699,28 @@ begin 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 not FBound then + begin + 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); + end; 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); - if Trim(threading_method.Text) = '' then - ADOQueryCmd.FieldByName('threading_method').Value := null - else - ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text); + if not FBound then + begin + if Trim(threading_method.Text) = '' then + ADOQueryCmd.FieldByName('threading_method').Value := null + else + ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text); + end; if Trim(lifting_method.Text) = '' then ADOQueryCmd.FieldByName('lifting_method').Value := null else @@ -638,7 +743,8 @@ begin end; ////////////////////////// ±£´æÎưæÍ¼ ////////////////////////// - + if not FBound then + begin with ADOQueryCmd do begin Close; @@ -663,11 +769,14 @@ begin RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_Info_WB', Panel7, 2); Post; end; + end; ////////////////////////// ±£´æÎưæÍ¼ ////////////////////////// ////////////////////////// ±£´æ¾­Ë¿Åä±È±í ////////////////////////// + if not FBound then + begin with CDS_1 do begin First; @@ -721,9 +830,12 @@ begin Next; end; end; + end; ////////////////////////// ±£´æ¾­Ë¿Åä±È±í ////////////////////////// ////////////////////////// ±£´æÎ³Ë¿Åä±È±í ////////////////////////// + if not FBound then + begin with CDS_2 do begin First; @@ -777,6 +889,7 @@ begin Next; end; end; + end; ////////////////////////// ±£´æÎ³Ë¿Åä±È±í ////////////////////////// /// ///