From 0a5d2461f5db8061564dbfcf05c3e5063e10dd85 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E401PHE\\Administrator" Date: Thu, 8 May 2025 10:12:23 +0800 Subject: [PATCH] 0508 --- A02基础产品管理/U_ClothInfo.dfm | 4 +- A02基础产品管理/U_ClothInfoInput.dfm | 426 ++++++++++++++---- A02基础产品管理/U_ClothInfoInput.pas | 483 +++++++++++++++++---- T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm | 7 + T02贸易汇总仓库/U_ItemizedListQtyInPut.pas | 23 +- 5 files changed, 769 insertions(+), 174 deletions(-) diff --git a/A02基础产品管理/U_ClothInfo.dfm b/A02基础产品管理/U_ClothInfo.dfm index bf02d79..eabf76e 100644 --- a/A02基础产品管理/U_ClothInfo.dfm +++ b/A02基础产品管理/U_ClothInfo.dfm @@ -10,8 +10,8 @@ inherited frmClothInfo: TfrmClothInfo FormStyle = fsMDIChild Position = poScreenCenter Visible = True - ExplicitWidth = 1548 - ExplicitHeight = 612 + ExplicitWidth = 1556 + ExplicitHeight = 620 PixelsPerInch = 96 TextHeight = 21 object ToolBar1: TToolBar [0] diff --git a/A02基础产品管理/U_ClothInfoInput.dfm b/A02基础产品管理/U_ClothInfoInput.dfm index ebb805e..600867d 100644 --- a/A02基础产品管理/U_ClothInfoInput.dfm +++ b/A02基础产品管理/U_ClothInfoInput.dfm @@ -470,7 +470,7 @@ object frmClothInfoInput: TfrmClothInfoInput object CostPrice: TcxCurrencyEdit Tag = 2 Left = 119 - Top = 207 + Top = 210 EditValue = 0.000000000000000000 Properties.AssignedValues.DisplayFormat = True Properties.OnEditValueChanged = CostPricePropertiesEditValueChanged @@ -547,91 +547,196 @@ object frmClothInfoInput: TfrmClothInfoInput Height = 259 Align = alClient TabOrder = 2 - ExplicitTop = 357 - ExplicitHeight = 287 - object ToolBar3: TToolBar + object Panel4: TPanel Left = 1 Top = 1 - Width = 747 - Height = 30 - AutoSize = True - ButtonHeight = 30 - ButtonWidth = 67 - Caption = 'ToolBar1' - DisabledImages = DataLink_ClothInfo.cxImageList_bar - Images = DataLink_ClothInfo.cxImageList_bar - List = True - ShowCaptions = True + Width = 395 + Height = 257 + Align = alLeft + Caption = 'Panel4' TabOrder = 0 - object ToolButton5: TToolButton - Left = 0 - Top = 0 + object ToolBar3: TToolBar + Left = 1 + Top = 1 + Width = 393 + Height = 30 AutoSize = True - Caption = #22686#34892 - ImageIndex = 2 - OnClick = ToolButton5Click + ButtonHeight = 30 + ButtonWidth = 67 + Caption = 'ToolBar1' + DisabledImages = DataLink_ClothInfo.cxImageList_bar + Images = DataLink_ClothInfo.cxImageList_bar + List = True + ShowCaptions = True + TabOrder = 0 + object ToolButton5: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 2 + OnClick = ToolButton5Click + end + object ToolButton7: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 6 + OnClick = ToolButton7Click + end end - object ToolButton7: TToolButton - Left = 71 - Top = 0 - AutoSize = True - Caption = #21024#34892 - ImageIndex = 6 - OnClick = ToolButton7Click + object cxGrid2: TcxGrid + Left = 1 + Top = 31 + Width = 393 + Height = 225 + Align = alClient + TabOrder = 1 + ExplicitLeft = -3 + ExplicitTop = 37 + 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> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.GroupByBox = False + object cxGridDBColumn1: TcxGridDBColumn + Caption = #20379#24212#21830 + DataBinding.FieldName = 'FACTORYNAME' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = cxGridDBColumn1PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 104 + end + object cxGridDBColumn2: TcxGridDBColumn + Caption = #20379#24212#21830#21697#21517 + DataBinding.FieldName = 'C_GYSNAME' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 117 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end end end - object cxGrid2: TcxGrid - Left = 1 - Top = 31 - Width = 747 - Height = 227 + object Panel5: TPanel + Left = 396 + Top = 1 + Width = 352 + Height = 257 Align = alClient + Caption = 'Panel5' TabOrder = 1 - ExplicitHeight = 255 - 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> - DataController.Summary.SummaryGroups = <> - OptionsBehavior.FocusCellOnTab = True - OptionsBehavior.GoToNextCellOnEnter = True - OptionsBehavior.FocusCellOnCycle = True - OptionsCustomize.ColumnFiltering = False - OptionsView.GroupByBox = False - object cxGridDBColumn1: TcxGridDBColumn - Caption = #20379#24212#21830 - DataBinding.FieldName = 'FACTORYNAME' - DataBinding.IsNullValueType = True - PropertiesClassName = 'TcxButtonEditProperties' - Properties.Buttons = < - item - Default = True - Kind = bkEllipsis - end> - Properties.OnButtonClick = cxGridDBColumn1PropertiesButtonClick - HeaderAlignmentHorz = taCenter - Width = 104 + ExplicitLeft = 393 + ExplicitTop = 6 + object ToolBar4: TToolBar + Left = 1 + Top = 1 + Width = 350 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 67 + Caption = 'ToolBar1' + DisabledImages = DataLink_ClothInfo.cxImageList_bar + Images = DataLink_ClothInfo.cxImageList_bar + List = True + ShowCaptions = True + TabOrder = 0 + object ToolButton8: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 2 + OnClick = ToolButton8Click end - object cxGridDBColumn2: TcxGridDBColumn - Caption = #20379#24212#21830#21697#21517 - DataBinding.FieldName = 'C_GYSNAME' - DataBinding.IsNullValueType = True - HeaderAlignmentHorz = taCenter - Width = 117 + object ToolButton9: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 6 + OnClick = ToolButton9Click end end - object cxGridLevel1: TcxGridLevel - GridView = TV2 + object cxGrid3: TcxGrid + Left = 1 + Top = 31 + Width = 350 + Height = 225 + Align = alClient + TabOrder = 1 + ExplicitLeft = -2 + ExplicitTop = 37 + object TV3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_3 + 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> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.GroupByBox = False + object cxGridDBColumn3: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'CICUnit' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = cxGridDBColumn3PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 104 + end + object cxGridDBColumn4: TcxGridDBColumn + Caption = #31995#25968 + DataBinding.FieldName = 'CICQty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 117 + end + end + object cxGridLevel3: TcxGridLevel + GridView = TV3 + end end end end @@ -665,10 +770,18 @@ object frmClothInfoInput: TfrmClothInfoInput ImageIndex = 2 OnClick = ToolButton3Click end - object ToolButton4: TToolButton + object ToolButton10: TToolButton Left = 71 Top = 0 AutoSize = True + Caption = #20462#25913 + ImageIndex = 3 + OnClick = ToolButton10Click + end + object ToolButton4: TToolButton + Left = 142 + Top = 0 + AutoSize = True Caption = #21024#34892 ImageIndex = 6 OnClick = ToolButton4Click @@ -751,6 +864,132 @@ object frmClothInfoInput: TfrmClothInfoInput GridView = TV1 end end + object Panel6: TPanel + Left = 6 + Top = 182 + Width = 523 + Height = 294 + Caption = 'Panel6' + TabOrder = 2 + Visible = False + object Panel7: TPanel + Left = 1 + Top = 1 + Width = 521 + Height = 35 + Align = alTop + Color = clGradientActiveCaption + ParentBackground = False + TabOrder = 0 + object Button1: TButton + Left = 224 + Top = 2 + Width = 91 + Height = 35 + Caption = #20445#23384#24182#20851#38381 + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 337 + Top = 2 + Width = 88 + Height = 35 + Caption = #20445#23384#24182#32487#32493 + TabOrder = 1 + OnClick = Button2Click + end + object Button3: TButton + Left = 447 + Top = 2 + Width = 74 + Height = 35 + Caption = #20851#38381 + TabOrder = 2 + OnClick = Button1Click + end + end + object cxGrid4: TcxGrid + Left = 1 + Top = 36 + Width = 521 + Height = 257 + Align = alClient + TabOrder = 1 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitHeight = 251 + object TV4: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DS_4 + 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> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.GroupByBox = False + object cxGridDBColumn5: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 54 + end + object cxGridDBColumn6: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object cxGridDBColumn7: TcxGridDBColumn + Caption = #28014#21160#20215 + DataBinding.FieldName = 'floatPrice' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV1Column5PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 68 + end + object cxGridDBColumn8: TcxGridDBColumn + Caption = #21442#32771#23450#20215 + DataBinding.FieldName = 'referencePrice' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 94 + end + object cxGridDBColumn9: TcxGridDBColumn + Caption = #20215#26684#19978#38480'(%)' + DataBinding.FieldName = 'MAXPRICE' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 106 + end + object cxGridDBColumn10: TcxGridDBColumn + Caption = #20215#26684#19979#38480'(%)' + DataBinding.FieldName = 'MinPRICE' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 100 + end + end + object cxGridLevel4: TcxGridLevel + GridView = TV4 + end + end + end end object ADOQueryCmd: TADOQuery Connection = DataLink_ClothInfo.ADOLink @@ -794,7 +1033,6 @@ object frmClothInfoInput: TfrmClothInfoInput Top = 371 end object cxGridPopupMenu1: TcxGridPopupMenu - Grid = cxGrid2 PopupMenus = <> Left = 816 Top = 277 @@ -813,4 +1051,40 @@ object frmClothInfoInput: TfrmClothInfoInput Left = 576 Top = 481 end + object ADO_3: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 658 + Top = 465 + end + object DS_3: TDataSource + DataSet = CDS_3 + Left = 716 + Top = 363 + end + object CDS_3: TClientDataSet + Aggregates = <> + Params = <> + Left = 778 + Top = 373 + end + object DS_4: TDataSource + DataSet = CDS_4 + Left = 1030 + Top = 283 + end + object CDS_4: TClientDataSet + Aggregates = <> + Params = <> + Left = 972 + Top = 285 + end + object ADO_4: TADOQuery + Connection = DataLink_ClothInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 690 + Top = 473 + end end diff --git a/A02基础产品管理/U_ClothInfoInput.pas b/A02基础产品管理/U_ClothInfoInput.pas index e7d63b9..10a65cb 100644 --- a/A02基础产品管理/U_ClothInfoInput.pas +++ b/A02基础产品管理/U_ClothInfoInput.pas @@ -90,6 +90,12 @@ type Label12: TLabel; C_YarnSpec: TcxTextEdit; Panel3: TPanel; + CDS_2: TClientDataSet; + DS_2: TDataSource; + cxGridPopupMenu1: TcxGridPopupMenu; + ADO_2: TADOQuery; + ADO_1: TADOQuery; + Panel4: TPanel; ToolBar3: TToolBar; ToolButton5: TToolButton; ToolButton7: TToolButton; @@ -98,11 +104,36 @@ type cxGridDBColumn1: TcxGridDBColumn; cxGridDBColumn2: TcxGridDBColumn; cxGridLevel1: TcxGridLevel; - CDS_2: TClientDataSet; - DS_2: TDataSource; - cxGridPopupMenu1: TcxGridPopupMenu; - ADO_2: TADOQuery; - ADO_1: TADOQuery; + Panel5: TPanel; + ToolBar4: TToolBar; + ToolButton8: TToolButton; + ToolButton9: TToolButton; + cxGrid3: TcxGrid; + TV3: TcxGridDBTableView; + cxGridDBColumn3: TcxGridDBColumn; + cxGridDBColumn4: TcxGridDBColumn; + cxGridLevel3: TcxGridLevel; + ADO_3: TADOQuery; + DS_3: TDataSource; + CDS_3: TClientDataSet; + Panel6: TPanel; + Panel7: TPanel; + cxGrid4: TcxGrid; + TV4: TcxGridDBTableView; + cxGridDBColumn5: TcxGridDBColumn; + cxGridDBColumn6: TcxGridDBColumn; + cxGridDBColumn7: TcxGridDBColumn; + cxGridDBColumn8: TcxGridDBColumn; + cxGridDBColumn9: TcxGridDBColumn; + cxGridDBColumn10: TcxGridDBColumn; + cxGridLevel4: TcxGridLevel; + DS_4: TDataSource; + CDS_4: TClientDataSet; + Button1: TButton; + Button2: TButton; + ADO_4: TADOQuery; + ToolButton10: TToolButton; + Button3: TButton; procedure FormShow(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure ToolButton1Click(Sender: TObject); @@ -122,11 +153,18 @@ type procedure ToolButton5Click(Sender: TObject); procedure ToolButton7Click(Sender: TObject); procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton8Click(Sender: TObject); + procedure ToolButton9Click(Sender: TObject); + procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure Button1Click(Sender: TObject); + procedure ToolButton10Click(Sender: TObject); + procedure Button2Click(Sender: TObject); private canshu1: string; Fint: Integer; procedure InitGrid(); procedure InitGrid1(); +// procedure InitGrid2(); function SaveData(): Boolean; procedure setName(); procedure addColor(); @@ -224,6 +262,10 @@ begin InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, '', ''); + SqlStr := 'select A.* from Bs_Cloth_Info_Coefficient A '; + SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + ''''; + + InitCDSData(ADO_3, CDS_3, Tv3, SqlStr, '', ''); end; procedure TfrmClothInfoInput.InitGrid(); @@ -398,6 +440,7 @@ begin qtyunit.ItemIndex := -1; end; +// InitGrid2(); InitGrid1(); InitGrid(); @@ -423,7 +466,7 @@ end; function TfrmClothInfoInput.SaveData(): Boolean; var - MaxBCIID, MaxBCPID, maxId2, MAXID3: string; + MaxBCIID, MaxBCPID, maxId2, MAXID3, MAXID4: string; begin try ADOQueryCmd.Connection.BeginTrans; @@ -545,75 +588,74 @@ begin ////////////////////////// ӱ ////////////////////////// - with CDS_1 do - begin - First; - while not Eof do - begin - if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then - begin - if GetLSNo(ADOQueryTemp, maxId2, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then - begin - ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); - Exit; - end; - end - else - begin - maxId2 := Trim(CDS_1.fieldbyname('BCISID').AsString); - end; - - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add(' select * from BS_Cloth_Info_Sub where '); - sql.Add(' BCISID=''' + Trim(maxId2) + ''''); - Open; - end; - with ADOQueryCmd do - begin - if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then - begin - Append; - FieldByName('FillID').Value := Trim(DCode); - FieldByName('Filler').Value := Trim(DName); - FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); - end - else - begin - Edit; - FieldByName('EditID').Value := Trim(DCode); - FieldByName('Editer').Value := Trim(DName); - FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); - end; - FieldByName('BCIID').Value := Trim(MaxBCIID); - FieldByName('BCISID').Value := Trim(maxId2); - RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'BS_Cloth_Info_Sub', 0); - Post; - end; - Next; - end; - end; - - with ADOQueryTemp do - begin - Close; - sql.Clear; - sql.Add('select count(BCISID) as AA from BS_Cloth_Info_Sub where BCIID=''' + Trim(MaxBCIID) + ''''); - sql.Add(' group by C_Color,C_ColorNo having count(BCISID)>1'); -// ShowMessage(sql.Text); - Open; - - end; - if StrToFloatDef(ADOQueryTemp.fieldbyname('AA').asstring, 1) > 1 then - begin - ADOQueryCmd.Connection.RollbackTrans; - Result := False; - Application.MessageBox('ɫɫظ', 'ʾ', 0); - Exit; - end; +// with CDS_1 do +// begin +// First; +// while not Eof do +// begin +// if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then +// begin +// if GetLSNo(ADOQueryTemp, maxId2, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); +// Exit; +// end; +// end +// else +// begin +// maxId2 := Trim(CDS_1.fieldbyname('BCISID').AsString); +// end; +// +// with ADOQueryCmd do +// begin +// Close; +// SQL.Clear; +// sql.Add(' select * from BS_Cloth_Info_Sub where '); +// sql.Add(' BCISID=''' + Trim(maxId2) + ''''); +// Open; +// end; +// with ADOQueryCmd do +// begin +// if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then +// begin +// Append; +// FieldByName('FillID').Value := Trim(DCode); +// FieldByName('Filler').Value := Trim(DName); +// FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); +// end +// else +// begin +// Edit; +// FieldByName('EditID').Value := Trim(DCode); +// FieldByName('Editer').Value := Trim(DName); +// FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); +// end; +// FieldByName('BCIID').Value := Trim(MaxBCIID); +// FieldByName('BCISID').Value := Trim(maxId2); +// RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'BS_Cloth_Info_Sub', 0); +// Post; +// end; +// Next; +// end; +// end; +// with ADOQueryTemp do +// begin +// Close; +// sql.Clear; +// sql.Add('select count(BCISID) as AA from BS_Cloth_Info_Sub where BCIID=''' + Trim(MaxBCIID) + ''''); +// sql.Add(' group by C_Color,C_ColorNo having count(BCISID)>1'); +//// ShowMessage(sql.Text); +// Open; +// +// end; +// if StrToFloatDef(ADOQueryTemp.fieldbyname('AA').asstring, 1) > 1 then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// Result := False; +// Application.MessageBox('ɫɫظ', 'ʾ', 0); +// Exit; +// end; ////////////////////////// ӱ ////////////////////////// /// /// @@ -669,6 +711,57 @@ begin end; end; + ////////////////////////// 浥λϵӱ ////////////////////////// + with CDS_3 do + begin + First; + while not Eof do + begin + if Trim(CDS_3.fieldbyname('CICID').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, MAXID4, 'CIC', 'Bs_Cloth_Info_Coefficient', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + MAXID4 := Trim(CDS_3.fieldbyname('CICID').AsString); + end; + + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add(' select * from Bs_Cloth_Info_Coefficient where '); + sql.Add(' CICID=''' + Trim(MAXID4) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(CDS_3.fieldbyname('CICID').AsString) = '' then + begin + Append; +// FieldByName('FillID').Value := Trim(DCode); +// FieldByName('Filler').Value := Trim(DName); +// FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); + end + else + begin + Edit; + + end; + FieldByName('BCIID').Value := Trim(MaxBCIID); + FieldByName('CICID').Value := Trim(MAXID4); + RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Bs_Cloth_Info_Coefficient', 0); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; // with ADOQueryCmd do @@ -697,6 +790,46 @@ begin TBtnEditC(Sender).Text := ''; end; +procedure TfrmClothInfoInput.ToolButton10Click(Sender: TObject); +var + maxno: string; + SqlStr: string; +begin + if FBCIID = '' then + begin + Application.MessageBox('ȱƷϢ!', 'ʾ', 0); + Exit; + end; +// if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then +// begin +// Application.MessageBox('ȡʧ!', 'ʾ', 0); +// Exit; +// end; + SqlStr := 'select A.* from BS_Cloth_Info_Sub A '; + SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + ''''; + SqlStr := SqlStr + ' ORDER BY CASE WHEN C_COLORNO NOT LIKE ''%[^0-9]%'' THEN dbo.getNum(C_Colorno) ELSE 9999999999 '; + SqlStr := SqlStr + ' END ,C_ColorNo'; + + InitCDSData(ADO_4, CDS_4, Tv4, SqlStr, '', ''); + + Panel6.Visible := True; + +// CopyAddRow(Tv4, CDS_4); + +// with CDS_4 do +// begin +// append; +// fieldbyname('BCIID').Value := FBCIID; +// fieldbyname('BCISID').Value := maxno; +// fieldbyname('floatPrice').Value := 0; +// fieldbyname('referencePrice').value := StrToFloatDef(CostPrice.Text, 0); +// Post; +// end; + +// TV1Column5PropertiesEditValueChanged(Sender); + +end; + procedure TfrmClothInfoInput.ToolButton1Click(Sender: TObject); var MC_Code: string; @@ -747,11 +880,11 @@ begin // Application.MessageBox('ɫ!', 'ʾ', 0); // Exit; // end; - if CDS_1.Locate('C_ColorNo', null, []) = True then - begin - Application.MessageBox('ɫ!', 'ʾ', 0); - Exit; - end; +// if CDS_1.Locate('C_ColorNo', null, []) = True then +// begin +// Application.MessageBox('ɫ!', 'ʾ', 0); +// Exit; +// end; setName(); if SaveData() then begin @@ -768,20 +901,33 @@ end; procedure TfrmClothInfoInput.ToolButton3Click(Sender: TObject); var maxno: string; + SqlStr: string; begin - + if FBCIID = '' then + begin + Application.MessageBox('ȱƷϢ!', 'ʾ', 0); + Exit; + end; // if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then // begin // Application.MessageBox('ȡʧ!', 'ʾ', 0); // Exit; // end; + SqlStr := 'select A.* from BS_Cloth_Info_Sub A '; + SqlStr := SqlStr + ' where 1<>1 '; - CopyAddRow(Tv1, CDS_1); - with CDS_1 do + InitCDSData(ADO_4, CDS_4, Tv4, SqlStr, '', ''); + + Panel6.Visible := True; + +// CopyAddRow(Tv4, CDS_4); + + with CDS_4 do begin - Edit; - fieldbyname('BCISID').Value := NULL; + append; + fieldbyname('BCIID').Value := FBCIID; + fieldbyname('BCISID').Value := maxno; fieldbyname('floatPrice').Value := 0; fieldbyname('referencePrice').value := StrToFloatDef(CostPrice.Text, 0); Post; @@ -834,6 +980,108 @@ begin end; end; +procedure TfrmClothInfoInput.Button1Click(Sender: TObject); +begin + CDS_4.EmptyDataSet; + Panel6.Visible:=False; +end; + +procedure TfrmClothInfoInput.Button2Click(Sender: TObject); +var + maxId4 :string; +begin +try + ADOQueryCmd.Connection.BeginTrans; + + + + //////////////////////// ӱ ////////////////////////// + with CDS_4 do + begin + First; + while not Eof do + begin + if Trim(CDS_4.fieldbyname('BCISID').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, maxId4, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxId4 := Trim(CDS_4.fieldbyname('BCISID').AsString); + end; + + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add(' select * from BS_Cloth_Info_Sub where '); + sql.Add(' BCISID=''' + Trim(maxId4) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(CDS_4.fieldbyname('BCISID').AsString) = '' then + begin + Append; + FieldByName('FillID').Value := Trim(DCode); + FieldByName('Filler').Value := Trim(DName); + FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); + end + else + begin + Edit; + FieldByName('EditID').Value := Trim(DCode); + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('BCIID').Value := Trim(FBCIID); + FieldByName('BCISID').Value := Trim(maxId4); + RTSetSaveDataCDS(ADOQueryCmd, Tv4, CDS_4, 'BS_Cloth_Info_Sub', 0); + Post; + end; + Next; + end; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select count(BCISID) as AA from BS_Cloth_Info_Sub where BCIID=''' + Trim(FBCIID) + ''''); + sql.Add(' group by C_Color,C_ColorNo having count(BCISID)>1'); +// ShowMessage(sql.Text); + Open; + + end; + if StrToFloatDef(ADOQueryTemp.fieldbyname('AA').asstring, 1) > 1 then + begin + ADOQueryCmd.Connection.RollbackTrans; +// Result := False; + Application.MessageBox('ɫɫظ', 'ʾ', 0); + Exit; + end; +//////////////////////// ӱ ////////////////////////// + + + ADOQueryCmd.Connection.CommitTrans; + + + InitGrid1(); + ToolButton3.Click; +// Panel6.Visible:=false; +// Result := True; + except +// Result := False; + ADOQueryCmd.Connection.RollbackTrans; + InitGrid1(); + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + procedure TfrmClothInfoInput.CostPricePropertiesEditValueChanged(Sender: TObject); var mvalue, FFieldName: string; @@ -887,6 +1135,29 @@ begin end; end; +procedure TfrmClothInfoInput.cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'CICUnit'; + flagname := 'λ'; + MainType := 'λϵ'; + if ShowModal = 1 then + begin + with Self.CDS_3 do + begin + Edit; + FieldByName('CICUnit').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + procedure TfrmClothInfoInput.CYColorKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then @@ -938,6 +1209,48 @@ begin CDS_2.Delete; end; +procedure TfrmClothInfoInput.ToolButton8Click(Sender: TObject); +var + maxno: string; +begin + +// if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then +// begin +// Application.MessageBox('ȡʧ!', 'ʾ', 0); +// Exit; +// end; + + + with CDS_3 do + begin + APPEND; + fieldbyname('CICID').Value := NULL; + + Post; + end; +end; + +procedure TfrmClothInfoInput.ToolButton9Click(Sender: TObject); +begin + if CDS_3.IsEmpty then + Exit; + + if Trim(CDS_3.fieldbyname('CICID').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from Bs_Cloth_Info_Coefficient where CICID=''' + Trim(CDS_1.fieldbyname('CICID').AsString) + ''''); + ExecSQL; + end; + end; + + CDS_3.Delete; +end; + procedure TfrmClothInfoInput.TV1Column5PropertiesEditValueChanged(Sender: TObject); var mvalue, FFieldName: string; diff --git a/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm b/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm index 6c7b008..be36590 100644 --- a/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm +++ b/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm @@ -297,4 +297,11 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut OnClick = N1Click end end + object ADOQueryBatch: TADOQuery + Connection = DataLink_TradeTotalClothStk.ADOLink + LockType = ltBatchOptimistic + Parameters = <> + Left = 60 + Top = 274 + end end diff --git a/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas b/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas index 59332f1..623b04c 100644 --- a/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas +++ b/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas @@ -48,6 +48,7 @@ type TBSave: TToolButton; TBClose: TToolButton; Tv1Column1: TcxGridDBColumn; + ADOQueryBatch: TADOQuery; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure TBDelClick(Sender: TObject); @@ -354,7 +355,7 @@ var Maxno, MBCIOID: string; begin try - ADOQueryCmd.Connection.BeginTrans; + ADOQueryBatch.Connection.BeginTrans; CDS_Sub.DisableControls; with CDS_Sub do begin @@ -371,21 +372,21 @@ begin MBCIOID := Trim(ADOQueryTemp.fieldbyname('BCIOID').AsString); if Trim(MBCIOID) = '' then begin - if not GetLSNo(ADOQueryCmd, Maxno, 'MR', 'BS_Cloth_IO', 4, 1) then + if not GetLSNo(ADOQueryBatch, Maxno, 'MR', 'BS_Cloth_IO', 4, 1) then raise Exception.Create('ȡȾɫʧܣ'); end else begin Maxno := Trim(MBCIOID); end; - with ADOQueryCmd do + with ADOQueryBatch do begin Close; sql.Clear; sql.Add('select * from BS_Cloth_IO where BCIOID=''' + Trim(Maxno) + ''''); Open; end; - with ADOQueryCmd do + with ADOQueryBatch do begin if Trim(MBCIOID) = '' then begin @@ -403,7 +404,7 @@ begin FieldByName('Editer').Value := Trim(DName); FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp); end; - RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'BS_Cloth_IO', 0); + RTSetSaveDataCDS(ADOQueryBatch, Tv1, CDS_Sub, 'BS_Cloth_IO', 0); FieldByName('STKName').Value := 'óײƥ'; FieldByName('IOFlag').Value := ''; FieldByName('IOQtyFlag').Value := 1; @@ -420,7 +421,7 @@ begin end; CDS_Sub.EnableControls; - with ADOQueryCmd do + with ADOQueryBatch do begin Close; Sql.Clear; @@ -431,15 +432,15 @@ begin Sql.Add(',@DName=' + quotedstr(Trim(DName))); Open; end; - if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then - raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString))); - - ADOQueryCmd.Connection.CommitTrans; + if ADOQueryBatch.FieldByName('intReturn').AsInteger = -1 then + raise Exception.Create(pchar(trim(ADOQueryBatch.FieldByName('ShowMsg').AsString))); + ADOQueryBatch.UpdateBatch; + ADOQueryBatch.Connection.CommitTrans; Result := True; except Result := False; - ADOQueryCmd.Connection.RollbackTrans; + ADOQueryBatch.Connection.RollbackTrans; application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); end;