From e4158f64a0418d2d766253d42baa85bfd7b41998 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E401PHE\\Administrator" Date: Thu, 5 Feb 2026 17:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- A02基础产品管理/U_ClothInfo.dfm | 41 +++-- A02基础产品管理/U_ClothInfo.pas | 36 ++++- A02基础产品管理/U_ClothInfoInput.pas | 3 +- A02基础产品管理/U_SelectStore.dfm | 42 +++++ A02基础产品管理/U_SelectStore.pas | 40 +++++ T02贸易汇总仓库/TradeTotalClothStk.dpr | 3 +- T02贸易汇总仓库/TradeTotalClothStk.dproj | 4 + T02贸易汇总仓库/U_InputReceiptType.dfm | 25 ++- T02贸易汇总仓库/U_InputReceiptType.pas | 35 ++++- T02贸易汇总仓库/U_ItemizedListInPut.dfm | 2 - T02贸易汇总仓库/U_ItemizedListInPut.pas | 154 ++++++++++++++++++- T02贸易汇总仓库/U_ItemizedListList.pas | 78 +++++++++- T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm | 2 +- T02贸易汇总仓库/U_ItemizedListQtyInPut.pas | 55 +++++-- T02贸易汇总仓库/U_PlanScanInEdit.dfm | 72 ++++++--- T02贸易汇总仓库/U_PlanScanInEdit.pas | 84 +++++++--- T02贸易汇总仓库/U_TradeClothTotalInInput.dfm | 1 - T02贸易汇总仓库/U_TradeClothTotalInInput.pas | 3 + T02贸易汇总仓库/U_TradeClothTotalOutList.pas | 24 +-- T02贸易汇总仓库/U_TradeClothTotalStkList.pas | 2 +- T03贸易布匹检验/AJCYData10.INI | 9 ++ T03贸易布匹检验/DjdMachineInsp.dpr | 3 +- T03贸易布匹检验/DjdMachineInsp.dproj | 4 + T03贸易布匹检验/TradeInspFile.INI | 2 +- T03贸易布匹检验/U_GetDllForm.pas | 14 +- T03贸易布匹检验/U_MachRollMain.dfm | 11 +- T03贸易布匹检验/U_MachRollMain.pas | 72 +++++++-- T03贸易布匹检验/Unit2.dfm | 17 ++ T03贸易布匹检验/Unit2.pas | 72 +++++++++ T05贸易门市管理/TradeMarket.dpr | 3 +- T05贸易门市管理/TradeMarket.dproj | 4 + T05贸易门市管理/U_TradeMarketInPut.dfm | 112 +++++++++----- T05贸易门市管理/U_TradeMarketInPut.pas | 71 ++++++++- T05贸易门市管理/U_TradeMarketList.dfm | 6 + T05贸易门市管理/U_TradeMarketList.pas | 18 ++- T05贸易门市管理/U_TradeMarketList_JD.dfm | 14 +- T05贸易门市管理/U_TradeMarketList_JD.pas | 44 ++++-- T05贸易门市管理/U_TradeMarketList_JDT.dfm | 18 ++- T05贸易门市管理/U_TradeMarketList_JDT.pas | 45 +++--- T05贸易门市管理/U_TradeSampletList.dfm | 11 +- T05贸易门市管理/U_TradeSampletList.pas | 20 ++- 41 files changed, 1032 insertions(+), 244 deletions(-) create mode 100644 A02基础产品管理/U_SelectStore.dfm create mode 100644 A02基础产品管理/U_SelectStore.pas create mode 100644 T03贸易布匹检验/AJCYData10.INI create mode 100644 T03贸易布匹检验/Unit2.dfm create mode 100644 T03贸易布匹检验/Unit2.pas diff --git a/A02基础产品管理/U_ClothInfo.dfm b/A02基础产品管理/U_ClothInfo.dfm index 3e95eee..217f42f 100644 --- a/A02基础产品管理/U_ClothInfo.dfm +++ b/A02基础产品管理/U_ClothInfo.dfm @@ -10,6 +10,7 @@ inherited frmClothInfo: TfrmClothInfo FormStyle = fsMDIChild Position = poScreenCenter Visible = True + ExplicitLeft = -87 ExplicitWidth = 1556 ExplicitHeight = 847 PixelsPerInch = 96 @@ -22,7 +23,7 @@ inherited frmClothInfo: TfrmClothInfo Height = 30 AutoSize = True ButtonHeight = 30 - ButtonWidth = 99 + ButtonWidth = 131 Caption = 'ToolBar1' DisabledImages = DataLink_ClothInfo.cxImageList_bar Images = DataLink_ClothInfo.cxImageList_bar @@ -38,7 +39,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBRafreshClick end object TBAdd: TToolButton - Left = 71 + Left = 63 Top = 0 AutoSize = True Caption = #26032#22686 @@ -46,7 +47,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBAddClick end object TBCopy: TToolButton - Left = 142 + Left = 126 Top = 0 AutoSize = True Caption = #22797#21046 @@ -54,7 +55,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBCopyClick end object TBEdit: TToolButton - Left = 213 + Left = 189 Top = 0 AutoSize = True Caption = #20462#25913 @@ -62,7 +63,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBEditClick end object ToolButton1: TToolButton - Left = 284 + Left = 252 Top = 0 AutoSize = True Caption = #26597#30475 @@ -70,7 +71,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton1Click end object TBMLEdit: TToolButton - Left = 355 + Left = 315 Top = 0 AutoSize = True Caption = #30446#24405#20462#25913 @@ -78,7 +79,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBMLEditClick end object TBDel: TToolButton - Left = 458 + Left = 402 Top = 0 AutoSize = True Caption = #21024#38500 @@ -86,7 +87,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBDelClick end object ToolButton3: TToolButton - Left = 529 + Left = 465 Top = 0 AutoSize = True Caption = #26631#31614#25171#21360 @@ -94,7 +95,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton3Click end object ToolButton7: TToolButton - Left = 632 + Left = 552 Top = 0 AutoSize = True Caption = #25209#37327#23548#20986 @@ -102,7 +103,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton7Click end object ToolButton4: TToolButton - Left = 735 + Left = 639 Top = 0 AutoSize = True Caption = #23548#20837 @@ -110,7 +111,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton4Click end object TBExport: TToolButton - Left = 806 + Left = 702 Top = 0 AutoSize = True Caption = #23548#20986 @@ -118,7 +119,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBExportClick end object TBUP: TToolButton - Left = 877 + Left = 765 Top = 0 AutoSize = True Caption = #22270#29255#19978#20256 @@ -126,7 +127,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = TBUPClick end object ToolButton5: TToolButton - Left = 980 + Left = 852 Top = 0 AutoSize = True Caption = #25805#20316#26085#24535 @@ -134,15 +135,23 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton5Click end object ToolButton6: TToolButton - Left = 1083 + Left = 939 Top = 0 AutoSize = True Caption = #20462#25913#21382#21490 ImageIndex = 15 OnClick = ToolButton6Click end + object ToolButton8: TToolButton + Left = 1026 + Top = 0 + AutoSize = True + Caption = #19968#38190#35774#32622#35745#20215#21333#20301 + ImageIndex = 23 + OnClick = ToolButton8Click + end object ToolButton2: TToolButton - Left = 1186 + Left = 1161 Top = 0 AutoSize = True Caption = #20445#23384#26684#24335 @@ -150,7 +159,7 @@ inherited frmClothInfo: TfrmClothInfo OnClick = ToolButton2Click end object TBClose: TToolButton - Left = 1289 + Left = 1248 Top = 0 AutoSize = True Caption = #20851#38381 diff --git a/A02基础产品管理/U_ClothInfo.pas b/A02基础产品管理/U_ClothInfo.pas index 623b10e..788c1d3 100644 --- a/A02基础产品管理/U_ClothInfo.pas +++ b/A02基础产品管理/U_ClothInfo.pas @@ -137,6 +137,7 @@ type cxGridDBColumn2: TcxGridDBColumn; cxGridLevel2: TcxGridLevel; Tv1Column13: TcxGridDBColumn; + ToolButton8: TToolButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); procedure TBDelClick(Sender: TObject); @@ -200,7 +201,7 @@ implementation uses U_DataLink, U_RTFun, U_ClothInfoInput, U_CloInfoFileUp, U_ClothTypeSel, U_ZDYHelp, U_LabelPrint, U_ClothInfoImport, U_SysLogHelp, U_ClothInfoInput1, - U_ClothInfoInput2, U_ClothInfoLog; + U_ClothInfoInput2, U_ClothInfoLog, U_SelectStore; {$R *.dfm} procedure TfrmClothInfo.InitGrid2(); @@ -723,6 +724,7 @@ begin with frmClothInfoInput do begin canshu3 := Self.canshu3; + canshu4 := Self.canshu4; TypeInt := 2; FBCIID := Trim(Self.CDS_1.fieldbyname('BCIID').AsString); FCTID := Trim(Self.CDS_Tree.fieldbyname('CTID').AsString); @@ -1096,8 +1098,38 @@ end; procedure TfrmClothInfo.ToolButton8Click(Sender: TObject); var - MCTID: string; + RTValues: TArray; + StoreName: string; + frmSelectStore: TfrmSelectStore; begin + if CDS_1.IsEmpty then + exit; + RTValues := SelCDSKey(CDS_1, ['BCIID']); + if RTValues[0] = '' then + begin + Application.MessageBox('ѡ!', 'ʾ', 0); + Exit; + end; + frmSelectStore := TfrmSelectStore.Create(nil); + try + if frmSelectStore.ShowModal = mrOk then + begin + StoreName := frmSelectStore.SelectedStore; + if StoreName = '' then + Exit; + + ADOQueryCmd.Close; + ADOQueryCmd.SQL.Text := 'UPDATE BS_Cloth_Info SET qtyunit = :StoreName ' + 'WHERE EXISTS(SELECT X.RTValue ' + ' FROM [dbo].[F_Tool_SplitString](:COIDList,'','') X ' + ' WHERE BS_Cloth_Info.BCIID = X.RTValue)'; + ADOQueryCmd.Parameters.ParamByName('qtyunit').Value := StoreName; + ADOQueryCmd.Parameters.ParamByName('COIDList').Value := RTValues[0]; + ADOQueryCmd.ExecSQL; + + Application.MessageBox('üƼ۵λɹ', 'ʾ'); + TBRafresh.Click; + end; + finally + frmSelectStore.Free; + end; end; diff --git a/A02基础产品管理/U_ClothInfoInput.pas b/A02基础产品管理/U_ClothInfoInput.pas index 3418278..1607ff6 100644 --- a/A02基础产品管理/U_ClothInfoInput.pas +++ b/A02基础产品管理/U_ClothInfoInput.pas @@ -1433,9 +1433,8 @@ begin if SaveData() then begin - if FCTID = 'CT2412300005' then + if (FCTID = 'CT2412300005') or (canshu4 = 'μӹ') then begin - if CDS_1.Locate('BCISID', null, []) then SaveColor(); end; diff --git a/A02基础产品管理/U_SelectStore.dfm b/A02基础产品管理/U_SelectStore.dfm new file mode 100644 index 0000000..cc38e2b --- /dev/null +++ b/A02基础产品管理/U_SelectStore.dfm @@ -0,0 +1,42 @@ +inherited frmSelectStore: TfrmSelectStore + Caption = #36873#25321#38376#24215 + ClientHeight = 121 + ClientWidth = 509 + Position = poScreenCenter + ExplicitWidth = 525 + ExplicitHeight = 160 + PixelsPerInch = 96 + TextHeight = 17 + object btnOK: TButton [0] + Left = 308 + Top = 42 + Width = 75 + Height = 25 + Caption = #30830#23450 + ModalResult = 1 + TabOrder = 0 + end + object cbStore: TComboBox [1] + Left = 47 + Top = 42 + Width = 216 + Height = 25 + TabOrder = 1 + Items.Strings = ( + #26684#32654 + #26032#20313 + #32654#25289) + end + object btnCancel: TButton [2] + Left = 389 + Top = 42 + Width = 75 + Height = 25 + Caption = #21462#28040 + ModalResult = 2 + TabOrder = 2 + end + inherited cxImageList_bar: TcxImageList + FormatVersion = 1 + end +end diff --git a/A02基础产品管理/U_SelectStore.pas b/A02基础产品管理/U_SelectStore.pas new file mode 100644 index 0000000..fbbc8a4 --- /dev/null +++ b/A02基础产品管理/U_SelectStore.pas @@ -0,0 +1,40 @@ +unit U_SelectStore; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, U_BaseInput, cxImageList, cxGraphics, + System.ImageList, Vcl.ImgList, Data.DB, Data.Win.ADODB, Vcl.StdCtrls; + +type + TfrmSelectStore = class(TfrmBaseInput) + btnOK: TButton; + cbStore: TComboBox; + btnCancel: TButton; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + function SelectedStore: string; + end; + +var + frmSelectStore: TfrmSelectStore; + +implementation + +{$R *.dfm} + +procedure TfrmSelectStore.FormCreate(Sender: TObject); +begin + inherited; + cbStore.ItemIndex := 0; +end; +function TfrmSelectStore.SelectedStore: string; +begin + Result := Trim(cbStore.Text); +end; + +end. diff --git a/T02贸易汇总仓库/TradeTotalClothStk.dpr b/T02贸易汇总仓库/TradeTotalClothStk.dpr index 985632e..9a4f2dd 100644 --- a/T02贸易汇总仓库/TradeTotalClothStk.dpr +++ b/T02贸易汇总仓库/TradeTotalClothStk.dpr @@ -78,7 +78,8 @@ uses U_RPFun in '..\..\..\public10\ThreeFun\Fun\U_RPFun.pas', U_InputReceiptType in 'U_InputReceiptType.pas' {frmInputReceiptType}, U_MachineManageSel in '..\A00ͨô\U_MachineManageSel.pas' {frmMachineManageSel}, - U_CompanySel in '..\A00ͨô\U_CompanySel.pas' {frmCompanySel}; + U_CompanySel in '..\A00ͨô\U_CompanySel.pas' {frmCompanySel}, + U_UserSel in '..\A00ͨô\U_UserSel.pas' {frmUserSel}; {$R *.res} diff --git a/T02贸易汇总仓库/TradeTotalClothStk.dproj b/T02贸易汇总仓库/TradeTotalClothStk.dproj index 6317e36..578b27c 100644 --- a/T02贸易汇总仓库/TradeTotalClothStk.dproj +++ b/T02贸易汇总仓库/TradeTotalClothStk.dproj @@ -368,6 +368,10 @@
frmCompanySel
dfm + +
frmUserSel
+ dfm +
Cfg_2 Base diff --git a/T02贸易汇总仓库/U_InputReceiptType.dfm b/T02贸易汇总仓库/U_InputReceiptType.dfm index d6c2ef3..753b4a6 100644 --- a/T02贸易汇总仓库/U_InputReceiptType.dfm +++ b/T02贸易汇总仓库/U_InputReceiptType.dfm @@ -2,8 +2,8 @@ object frmInputReceiptType: TfrmInputReceiptType Left = 682 Top = 315 Caption = #35831#36755#20837#25991#26412 - ClientHeight = 86 - ClientWidth = 467 + ClientHeight = 159 + ClientWidth = 471 Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -17,11 +17,12 @@ object frmInputReceiptType: TfrmInputReceiptType object Panel1: TPanel Left = 0 Top = 0 - Width = 467 - Height = 86 + Width = 471 + Height = 159 Align = alClient TabOrder = 0 - ExplicitHeight = 123 + ExplicitWidth = 467 + ExplicitHeight = 86 object Button1: TButton Left = 308 Top = 14 @@ -54,5 +55,19 @@ object frmInputReceiptType: TfrmInputReceiptType TabOrder = 1 Width = 257 end + object FHDBCIONo: TEdit + Left = 24 + Top = 73 + Width = 257 + Height = 60 + TabOrder = 2 + OnKeyPress = FHDBCIONoKeyPress + end + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeTotalClothStk.ADOLink + Parameters = <> + Left = 347 + Top = 107 end end diff --git a/T02贸易汇总仓库/U_InputReceiptType.pas b/T02贸易汇总仓库/U_InputReceiptType.pas index ac086fd..a242faa 100644 --- a/T02贸易汇总仓库/U_InputReceiptType.pas +++ b/T02贸易汇总仓库/U_InputReceiptType.pas @@ -4,16 +4,19 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, ExtCtrls, DB, ADODB, cxGraphics, cxControls, - cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit, cxTextEdit, - cxMaskEdit, cxDropDownEdit; + Dialogs, StdCtrls, ExtCtrls, DB, ADODB, cxGraphics, cxControls, cxLookAndFeels, + cxLookAndFeelPainters, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, + cxDropDownEdit; type TfrmInputReceiptType = class(TForm) Panel1: TPanel; Button1: TButton; cxComboBox1: TcxComboBox; + FHDBCIONo: TEdit; + ADOQueryCmd: TADOQuery; procedure Button1Click(Sender: TObject); + procedure FHDBCIONoKeyPress(Sender: TObject; var Key: Char); private { Private declarations } public @@ -30,10 +33,32 @@ implementation procedure TfrmInputReceiptType.Button1Click(Sender: TObject); begin - - ModalResult := 1; end; +procedure TfrmInputReceiptType.FHDBCIONoKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + if trim(FHDBCIONo.Text) = '' then + exit; + + try + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('update BS_Cloth_IO '); + sql.Add(' set ReceiptType=' + quotedstr(frmInputReceiptType.cxComboBox1.Text)); + sql.Add(' where BCIONo=' + QuotedStr(Trim(FHDBCIONo.text))); + ExecSQL; + end; + except + end; + FHDBCIONo.Text := ''; + end; + +end; + end. diff --git a/T02贸易汇总仓库/U_ItemizedListInPut.dfm b/T02贸易汇总仓库/U_ItemizedListInPut.dfm index bcccc22..8b79a8a 100644 --- a/T02贸易汇总仓库/U_ItemizedListInPut.dfm +++ b/T02贸易汇总仓库/U_ItemizedListInPut.dfm @@ -133,8 +133,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut Align = alClient PopupMenu = PopupMenu2 TabOrder = 0 - ExplicitLeft = 2 - ExplicitTop = 5 object Tv1: TcxGridDBTableView OnDblClick = Tv1DblClick OnMouseDown = Tv1MouseDown diff --git a/T02贸易汇总仓库/U_ItemizedListInPut.pas b/T02贸易汇总仓库/U_ItemizedListInPut.pas index c276979..b10d4ba 100644 --- a/T02贸易汇总仓库/U_ItemizedListInPut.pas +++ b/T02贸易汇总仓库/U_ItemizedListInPut.pas @@ -120,6 +120,7 @@ type procedure InitData(); procedure ZDYHelp(FButn: TcxButtonEdit; LType: string); function SaveData(): Boolean; + function SavesubData(): Boolean; function getTMMNo(fconNo: string): string; procedure SetXH(); procedure initGrid1(MTIMID: string); @@ -552,6 +553,126 @@ begin end; end; +function TfrmItemizedListInPut.SavesubData(): Boolean; +var + maxno, Smaxno, maxTMMNo, MaxFNo, MFtyPCId, MSJQZ: string; +begin + + with ADOTemp do + begin + Close; + sql.Clear; + SQL.Add('select SJQZ=format(SYSDATETIME(),''yyMMddhhmm'')'); + Open; + MSJQZ := Trim(ADOTemp.FieldByName('SJQZ').AsString); + end; + try + ADOCmd.Connection.BeginTrans; + /// + if Trim(FTIMID) = '' then + begin + if GetLSNo(ADOCmd, maxno, 'DD', 'Trade_ItemizedList_Main', 3, 1) = False then + raise Exception.Create('ȡʧ!'); + end + else + begin + maxno := Trim(FTIMID); + end; + + if TIMNo.Text = '' then + TIMNo.Text := maxno; + + with ADOCmd do + begin + Close; + sql.Clear; + SQL.Add('select * from Trade_ItemizedList_Main where TIMID=''' + Trim(FTIMID) + ''''); + Open; + end; + with ADOCmd do + begin + if Trim(FTIMID) = '' then + begin + Append; + FieldByName('FillId').Value := Trim(DCode); + FieldByName('Filler').Value := Trim(DName); + end + else + begin + Edit; + FieldByName('EditId').Value := Trim(DCode); + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp); + end; + RTSetsavedata(ADOCmd, 'Trade_ItemizedList_Main', ScrollBox1, 0); + FieldByName('TIMID').Value := Trim(maxno); + FieldByName('OopCoNo').Value := Trim(OopCoName.Properties.LookupItems.Text); + + Post; + end; + +///////////////////// ӱ /////////////////////////// + with CDS_1 do + begin + DisableControls; +// First; +// while not Eof do +// begin + if Trim(CDS_1.fieldbyname('TISId').AsString) = '' then + begin + if GetLSNo(ADOCmd, Smaxno, 'JS', 'Trade_ItemizedList_Sub', 4, 1) = False then + raise Exception.Create('ȡˮʧ!'); + end + else + begin + Smaxno := Trim(CDS_1.fieldbyname('TISId').AsString); + end; + with ADOCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from Trade_ItemizedList_Sub where TIMID=''' + Trim(maxno) + ''''); + sql.Add(' and TISId=''' + Trim(Smaxno) + ''''); + Open; + end; + + with ADOCmd do + begin + if ADOCmd.IsEmpty then + Append + else + Edit; + + RTSetSaveDataCDS(ADOCmd, Tv1, CDS_1, 'Trade_ItemizedList_Sub', 0); + if Trim(CDS_1.FieldByName('FtyPCId').AsString) = '' then + begin + if GetLSNo(adotemp, MFtyPCId, MSJQZ, 'FtyPCId', 3, 0) = False then + raise Exception.Create('ȡ׺ʧ!'); + FieldByName('FtyPCId').Value := MFtyPCId; + end; + FieldByName('TIMID').Value := Trim(maxno); + FieldByName('TISId').Value := Trim(Smaxno); + Post; + end; +// Next; +// end; + end; +///////////////////// ӱ /////////////////////////// + + ADOCmd.Connection.CommitTrans; + + FTIMID := Trim(maxno); + + CDS_1.EnableControls; + Result := True; + except + ADOCmd.Connection.RollbackTrans; + Result := False; + CDS_1.EnableControls; + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + procedure TfrmItemizedListInPut.TBSaveClick(Sender: TObject); var MAXNO1: string; @@ -569,12 +690,26 @@ begin Application.MessageBox('λΪ!', 'ʾ', 0); Exit; end; - + if CDS_1.Locate('TISPiece', null, []) then + begin + Application.MessageBox('ƥΪ!', 'ʾ', 0); + Exit; + end; if CDS_1.Locate('TISQty', null, []) then begin Application.MessageBox('Ϊ!', 'ʾ', 0); Exit; end; + if CDS_1.Locate('C_ColorNo', null, []) then + begin + Application.MessageBox('ɫŲΪ!', 'ʾ', 0); + Exit; + end; + if CDS_1.Locate('C_Name', null, []) then + begin + Application.MessageBox('ɫƲΪ!', 'ʾ', 0); + Exit; + end; if CDS_1.Locate('Price', null, []) then begin @@ -1308,12 +1443,27 @@ begin Application.MessageBox('λΪ!', 'ʾ', 0); Exit; end; + if CDS_1.Locate('C_Name', null, []) then + begin + Application.MessageBox('ƷΪ!', 'ʾ', 0); + Exit; + end; + if CDS_1.Locate('C_colorNo', null, []) then + begin + Application.MessageBox('ɫŲΪ!', 'ʾ', 0); + Exit; + end; + if CDS_1.Locate('C_Color', null, []) then + begin + Application.MessageBox('ɫΪ!', 'ʾ', 0); + Exit; + end; MTISId := Trim(Self.CDS_1.FieldByName('TISId').AsString); MQtyUnit := Trim(Self.CDS_1.FieldByName('TISUnit').AsString); FName := CDS_1.FieldByName('C_Name').ASString; FColor := CDS_1.FieldByName('C_Color').ASString; FColorNo := CDS_1.FieldByName('C_colorNo').ASString; - if SaveData() then + if SavesubData() then begin try diff --git a/T02贸易汇总仓库/U_ItemizedListList.pas b/T02贸易汇总仓库/U_ItemizedListList.pas index 1cb9999..32c1ef7 100644 --- a/T02贸易汇总仓库/U_ItemizedListList.pas +++ b/T02贸易汇总仓库/U_ItemizedListList.pas @@ -16,7 +16,7 @@ uses cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, Math, dxDateRanges, IdExplicitTLSClientServerBase, U_BaseList, Vcl.Clipbrd, dxScrollbarAnnotations, cxProgressBar, FrameDateSel, dxSkinsCore, - dxSkinsDefaultPainters; + dxSkinsDefaultPainters, System.JSON, uSZHN_JSON; type TfrmItemizedListList = class(TfrmBaseList) @@ -251,7 +251,7 @@ begin end; end; SqlStr := SqlStr + ' order by A.filltime desc'; - +// ShowMessage(SqlStr); InitCDSData(ADOQueryMain, Order_Main, Tv1, SqlStr, SGetFilters(Panel1, 1, 2), 'TISId'); end; @@ -392,9 +392,11 @@ end; procedure TfrmItemizedListList.TBPrintClick(Sender: TObject); var - MFiltration: string; + MFiltration, FTIMID: string; MPrintJson: string; + JSONObject: TJSONObject; // JSON begin + FTIMID := Trim(Self.Order_Main.fieldbyname('TIMID').AsString); MFiltration := Trim(Self.Order_Main.fieldbyname('TIMNo').AsString); MPrintJson := ' {"LMType": "ItemizedListList1" '; MPrintJson := MPrintJson + ' ,"PreviewPrint": true '; @@ -404,6 +406,28 @@ begin MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, '; MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" } ] } '; FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson)); + JSONObject := TJSONObject.ParseJSONValue(FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson))) as TJSONObject; + if JSONObject.B['succsee'] then + begin + try + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + Sql.Clear; + sql.add('update Trade_ItemizedList_Sub set PrtCount=PrtCount+1'); + sql.Add(' where TIMID= ' + quotedstr(Trim(FTIMID))); + ExecSQL; + end; + + ADOQueryCmd.Connection.CommitTrans; + + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; + end; end; procedure TfrmItemizedListList.TBRafreshClick(Sender: TObject); @@ -606,6 +630,7 @@ procedure TfrmItemizedListList.ToolButton5Click(Sender: TObject); var MFiltration: string; MPrintJson: string; + JSONObject: TJSONObject; // JSON begin MFiltration := SelCDSKey(Order_Main, ['TISId'])[0]; MPrintJson := ' {"LMType": "ItemizedListList2" '; @@ -616,6 +641,28 @@ begin MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, '; MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" } ] } '; FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson)); + JSONObject := TJSONObject.ParseJSONValue(FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson))) as TJSONObject; + if JSONObject.B['succsee'] then + begin + try + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + Sql.Clear; + sql.add('update Trade_ItemizedList_Sub set PrtCount=PrtCount+1'); + sql.add('where exists(select * from [dbo].[F_Tool_SplitString](' + quotedstr(MFiltration) + ','','') X where X.RTVALUE=Trade_ItemizedList_Sub.TISId )'); + ExecSQL; + end; + + ADOQueryCmd.Connection.CommitTrans; + + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; + end; end; procedure TfrmItemizedListList.cxTabControl1Change(Sender: TObject); @@ -729,6 +776,7 @@ procedure TfrmItemizedListList.ToolButton1Click(Sender: TObject); var MFiltration: string; MPrintJson: string; + JSONObject: TJSONObject; // JSON begin if Order_Main.IsEmpty then Exit; @@ -760,6 +808,30 @@ begin MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, '; MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" } ] } '; FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson)); + JSONObject := TJSONObject.ParseJSONValue(FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson))) as TJSONObject; + if JSONObject.B['succsee'] then + begin + try + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + Sql.Clear; + + sql.add('update Trade_ItemizedList_Sub set PrtCount=PrtCount+1'); + sql.add('where exists(select * from [dbo].[F_Tool_SplitString](' + quotedstr(MFiltration) + ','','') X where X.RTVALUE=Trade_ItemizedList_Sub.TISId )'); + + ExecSQL; + end; + + ADOQueryCmd.Connection.CommitTrans; + + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; + end; end; procedure TfrmItemizedListList.ToolButton2Click(Sender: TObject); diff --git a/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm b/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm index c325734..de776a4 100644 --- a/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm +++ b/T02贸易汇总仓库/U_ItemizedListQtyInPut.dfm @@ -227,7 +227,7 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut end object inQty: TcxCurrencyEdit Left = 231 - Top = 3 + Top = 6 Properties.AssignedValues.DisplayFormat = True TabOrder = 1 OnKeyPress = inQtyKeyPress diff --git a/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas b/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas index 40bfe10..62bbcda 100644 --- a/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas +++ b/T02贸易汇总仓库/U_ItemizedListQtyInPut.pas @@ -62,6 +62,7 @@ type procedure TBSaveClick(Sender: TObject); procedure btnAddClick(Sender: TObject); procedure Tv1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormDestroy(Sender: TObject); private { Private declarations } function SaveData(): Boolean; @@ -232,6 +233,7 @@ end; procedure TfrmItemizedListQtyInPut.btnAddClick(Sender: TObject); begin + if CDS_Sub.IsEmpty = False then begin CopyAddRowCDS(CDS_Sub); @@ -350,6 +352,12 @@ begin Action := caFree; end; +procedure TfrmItemizedListQtyInPut.FormDestroy(Sender: TObject); +begin + inherited; + frmItemizedListQtyInPut := nil; +end; + function TfrmItemizedListQtyInPut.SaveData(): Boolean; var Maxno, MBCIOID: string; @@ -447,6 +455,8 @@ begin end; procedure TfrmItemizedListQtyInPut.FormShow(Sender: TObject); +var + i: Integer; begin inherited; ReadCxGrid('뵥Ǽ', Tv1, 'ó׻ֿܲ'); @@ -461,19 +471,43 @@ begin CreateDataSet; end; - with ADOQueryTemp do + try + tv1.BeginUpdate(); + CDS_Sub.DisableControls; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add(' select A.* '); + sql.Add(' from BS_Cloth_IO A'); + sql.Add(' where ioflag='''' and TISId=''' + Trim(FTISId) + ''''); + sql.Add(' order by qty desc '); + Open; + end; + SCreateCDS(ADOQueryTemp, CDS_Sub); + SInitCDSData(ADOQueryTemp, CDS_Sub); + finally + CDS_Sub.EnableControls; + TV1.DataController.Filter.Clear; + tv1.EndUpdate; + end; + if CDS_Sub.IsEmpty then begin - Close; - sql.Clear; - sql.Add(' select A.* '); - sql.Add(' from BS_Cloth_IO A'); - sql.Add(' where ioflag='''' and TISId=''' + Trim(FTISId) + ''''); - sql.Add(' order by qty desc '); - Open; + for i := 1 to 50 do + begin + CopyAddRowCDS(CDS_Sub); + with CDS_Sub do + begin + Edit; + FieldByName('BCIOID').Value := null; + FieldByName('StkCoNo').Value := 'ֿ'; + FieldByName('StkCoName').Value := 'ֿ'; + post; + end; + + end; end; - SCreateCDS(ADOQueryTemp, CDS_Sub); - SInitCDSData(ADOQueryTemp, CDS_Sub); end; procedure TfrmItemizedListQtyInPut.FromCoNameDblClick(Sender: TObject); @@ -488,6 +522,7 @@ var begin if Key = #13 then begin + with CDS_Sub do begin DisableControls; diff --git a/T02贸易汇总仓库/U_PlanScanInEdit.dfm b/T02贸易汇总仓库/U_PlanScanInEdit.dfm index 97f263e..4cdc6c5 100644 --- a/T02贸易汇总仓库/U_PlanScanInEdit.dfm +++ b/T02贸易汇总仓库/U_PlanScanInEdit.dfm @@ -37,8 +37,8 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit ParentFont = False end object Label1: TLabel - Left = 470 - Top = 67 + Left = 1070 + Top = 78 Width = 66 Height = 33 Caption = #21306#22495 @@ -48,10 +48,11 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit Font.Name = #23435#20307 Font.Style = [fsBold] ParentFont = False + Visible = False end object Label2: TLabel Left = 670 - Top = 67 + Top = 51 Width = 66 Height = 33 Caption = #36710#36742 @@ -64,7 +65,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object Label5: TLabel Left = 1016 - Top = 41 + Top = 148 Width = 48 Height = 17 Caption = #20837#24211#21333#21495 @@ -72,7 +73,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object Label4: TLabel Left = 1022 - Top = 72 + Top = 179 Width = 48 Height = 17 Caption = #20837#24211#26102#38388 @@ -80,12 +81,25 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object Label11: TLabel Left = 1022 - Top = 98 + Top = 205 Width = 48 Height = 17 Caption = #20837#24211#31867#22411 Visible = False end + object Label3: TLabel + Left = 471 + Top = 54 + Width = 66 + Height = 33 + Caption = #21496#26426 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -32 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end object ToolBar3: TToolBar Tag = 1 Left = 1 @@ -116,17 +130,8 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit ImageIndex = 21 OnClick = ToolButton3Click end - object ToolButton5: TToolButton - Left = 87 - Top = 0 - AutoSize = True - Caption = #24211#20301#36873#25321 - ImageIndex = 8 - Visible = False - OnClick = ToolButton5Click - end object ToolButton8: TToolButton - Left = 174 + Left = 87 Top = 0 AutoSize = True Caption = #20445#23384#26684#24335 @@ -134,7 +139,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit OnClick = ToolButton8Click end object ToolButton7: TToolButton - Left = 261 + Left = 174 Top = 0 AutoSize = True Caption = #20851#38381 @@ -142,7 +147,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit OnClick = ToolButton7Click end object btnGetOutNo: TToolButton - Left = 324 + Left = 237 Top = 0 AutoSize = True Caption = #21462#21495 @@ -167,16 +172,17 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object wlCompany: TBtnEditA Tag = 1 - Left = 535 - Top = 69 + Left = 1135 + Top = 80 Width = 121 Height = 26 TabOrder = 2 + Visible = False OnBtnClick = wlCompanyBtnClick end object InNo: TEdit Left = 1070 - Top = 37 + Top = 144 Width = 100 Height = 25 TabOrder = 3 @@ -184,7 +190,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object CRTime: TDateTimePicker Left = 1070 - Top = 68 + Top = 175 Width = 100 Height = 20 Date = 41337.000000000000000000 @@ -195,7 +201,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit end object CRType: TComboBox Left = 1070 - Top = 94 + Top = 201 Width = 100 Height = 25 Style = csDropDownList @@ -210,7 +216,7 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit object carPlate: TBtnEditA Tag = 1 Left = 742 - Top = 70 + Top = 54 Width = 121 Height = 26 TabOrder = 6 @@ -231,6 +237,24 @@ inherited frmPlanScanInEdit: TfrmPlanScanInEdit TabOrder = 7 OnClick = TquerenClick end + object Driver: TBtnEditA + Tag = 1 + Left = 536 + Top = 56 + Width = 121 + Height = 26 + TabOrder = 8 + OnBtnClick = DriverBtnClick + end + object Driverid: TEdit + Tag = 1 + Left = 1102 + Top = 26 + Width = 100 + Height = 25 + TabOrder = 9 + Visible = False + end end end object Panel2: TPanel [1] diff --git a/T02贸易汇总仓库/U_PlanScanInEdit.pas b/T02贸易汇总仓库/U_PlanScanInEdit.pas index 5f2a571..ba62f84 100644 --- a/T02贸易汇总仓库/U_PlanScanInEdit.pas +++ b/T02贸易汇总仓库/U_PlanScanInEdit.pas @@ -59,7 +59,6 @@ type edtScan: TEdit; Label6: TLabel; Label1: TLabel; - ToolButton5: TToolButton; Label2: TLabel; wlCompany: TBtnEditA; Label5: TLabel; @@ -71,6 +70,9 @@ type carPlate: TBtnEditA; Tv3Column1: TcxGridDBColumn; Tqueren: TButton; + Label3: TLabel; + Driver: TBtnEditA; + Driverid: TEdit; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormDestroy(Sender: TObject); procedure FormShow(Sender: TObject); @@ -79,15 +81,16 @@ type procedure ToolButton7Click(Sender: TObject); procedure ToolButton8Click(Sender: TObject); procedure edtScanKeyPress(Sender: TObject; var Key: Char); - procedure ToolButton5Click(Sender: TObject); procedure wlCompanyBtnClick(Sender: TObject); procedure carPlateBtnClick(Sender: TObject); procedure TquerenClick(Sender: TObject); + procedure DriverBtnClick(Sender: TObject); private { Private declarations } FScan, FSubIds, FZCID: string; procedure PlayWav(MWav: string); procedure InitKC(); + procedure InitStatus(); procedure ScanKW(); procedure ScanCIID(); function SaveData(): Boolean; @@ -102,7 +105,7 @@ var implementation uses - U_DataLink, U_RTFun, U_LabelPrint, U_ZDYHelp, U_MachineManageSel; //U_TradeClothWaitStorage, U_PositionSel + U_DataLink, U_RTFun, U_LabelPrint, U_ZDYHelp, U_MachineManageSel, U_UserSel; //U_TradeClothWaitStorage, U_PositionSel {$R *.dfm} @@ -266,25 +269,6 @@ begin end; -procedure TfrmPlanScanInEdit.ToolButton5Click(Sender: TObject); -begin - inherited; - { try - frmPositionSel := TfrmPositionSel.Create(Application); - with frmPositionSel do - begin - if ShowModal = 1 then - begin - IOPosition.Text := CDS_1.FieldByName('POSNO').AsString; - end; - end; - finally - frmPositionSel.Free; - btnGetOutNo.Click; - initkc(); - end; } -end; - procedure TfrmPlanScanInEdit.wlCompanyBtnClick(Sender: TObject); begin try @@ -321,6 +305,25 @@ begin end; end; +procedure TfrmPlanScanInEdit.DriverBtnClick(Sender: TObject); +begin + + try + frmUserSel := TfrmUserSel.Create(Application); + with frmUserSel do + begin + Fdept := 'ͻ'; + if ShowModal = 1 then + begin + self.Driverid.Text := Trim(CDS_1.fieldbyname('EECode').AsString); + self.Driver.Text := Trim(CDS_1.fieldbyname('EEName').AsString); + end; + end; + finally + frmUserSel.Free; + end; +end; + procedure TfrmPlanScanInEdit.btnGetOutNoClick(Sender: TObject); var maxNo: string; @@ -352,7 +355,7 @@ begin if SaveData() then begin Application.MessageBox('ɹ!', 'ʾ', 0); - //ModalResult:=1; + Exit; end; end; @@ -440,12 +443,11 @@ begin // RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Trade_Market_CarTransportSub', 0); FieldByName('ZCID').Value := Trim(MaxMid); FieldByName('ZCMXID').Value := Trim(MaxSid); - FieldByName('TmMno').Value := CDS_3.fieldbyname('TMMNo').Value; FieldByName('TmMid').Value := CDS_3.fieldbyname('TMMId').Value; - Post; end; + InitStatus(); CDS_3.Edit; CDS_3.FieldByName('ZCMXID').Value := Trim(MaxSid); Next; @@ -463,5 +465,37 @@ begin end; end; +procedure TfrmPlanScanInEdit.InitStatus(); +begin + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Trade_Market_Main SET status=''9'' '); + sql.Add('where TMMId=' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString))); + + sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) '); + sql.Add('values(''óײ'' '); + sql.Add(',' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString))); + sql.Add(','''' '); + sql.Add(',' + quotedstr(DName)); + sql.Add(',' + quotedstr(trim(self.Caption))); + sql.Add(',' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString))); + sql.Add(') '); + + sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( '); + sql.Add(' ' + quotedstr(trim(DName))); + sql.Add(',getdate() '); + sql.Add(',' + quotedstr(trim(self.Caption))); + sql.Add(',' + quotedstr(trim('ƻ'))); + sql.Add(',' + quotedstr(trim('ƻţ' + trim(CDS_3.FieldByName('TMMNO').AsString)))); + sql.Add(',' + quotedstr(trim('ɹ'))); + sql.Add(')'); + execsql; + end; + +end; + end. diff --git a/T02贸易汇总仓库/U_TradeClothTotalInInput.dfm b/T02贸易汇总仓库/U_TradeClothTotalInInput.dfm index 543a61e..4e9153c 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalInInput.dfm +++ b/T02贸易汇总仓库/U_TradeClothTotalInInput.dfm @@ -21,7 +21,6 @@ inherited frmTradeClothTotalInInput: TfrmTradeClothTotalInInput Height = 518 Align = alClient TabOrder = 0 - ExplicitTop = 36 object Tv1: TcxGridDBTableView OnMouseDown = Tv1MouseDown Navigator.Buttons.CustomButtons = <> diff --git a/T02贸易汇总仓库/U_TradeClothTotalInInput.pas b/T02贸易汇总仓库/U_TradeClothTotalInInput.pas index bdc5b46..40c6275 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalInInput.pas +++ b/T02贸易汇总仓库/U_TradeClothTotalInInput.pas @@ -181,8 +181,11 @@ begin FieldByName('IOTime').Value := Trim(FormatDateTime('yyyy-MM-dd', Now)); FieldByName('StkCoNo').Value := 'ֿ'; FieldByName('StkCoName').Value := 'ֿ'; + FieldByName('FromCoNo').Value := 'G0001'; + FieldByName('FromCoName').Value := 'ȾӦ'; FieldByName('QtyUnit').Value := 'Kg'; FieldByName('C_Degree').AsString := Trim(''); + FieldByName('IOType').Value := 'ɹ'; Post; end; end; diff --git a/T02贸易汇总仓库/U_TradeClothTotalOutList.pas b/T02贸易汇总仓库/U_TradeClothTotalOutList.pas index cfb0c0a..5f432f2 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalOutList.pas +++ b/T02贸易汇总仓库/U_TradeClothTotalOutList.pas @@ -197,8 +197,9 @@ type implementation uses - U_DataLink, U_RTFun, U_TradeTotallClothOutinput, U_AttachmentUpload,U_ProgressUpdate, - U_LabelPrint, U_PrintLabFun, U_dynamicsDll, U_printPdf, U_InputReceiptType; + U_DataLink, U_RTFun, U_TradeTotallClothOutinput, U_AttachmentUpload, + U_ProgressUpdate, U_LabelPrint, U_PrintLabFun, U_dynamicsDll, U_printPdf, + U_InputReceiptType; {$R *.dfm} procedure TfrmTradeClothTotalOutList.InitGrid(MWSql: string); @@ -481,16 +482,15 @@ begin if ShowModal = 1 then begin - - with ADOQueryCmd do - begin - Close; - sql.Clear; - sql.Add('update BS_Cloth_IO '); - sql.Add(' set ReceiptType=' + quotedstr(frmInputReceiptType.cxComboBox1.Text)); - sql.Add(' where BCIONo=' + QuotedStr(Trim(MBCIONo))); - ExecSQL; - end; +// with ADOQueryCmd do +// begin +// Close; +// sql.Clear; +// sql.Add('update BS_Cloth_IO '); +// sql.Add(' set ReceiptType=' + quotedstr(frmInputReceiptType.cxComboBox1.Text)); +// sql.Add(' where BCIONo=' + QuotedStr(Trim(MBCIONo))); +// ExecSQL; +// end; Self.InitGrid2(); end; end; diff --git a/T02贸易汇总仓库/U_TradeClothTotalStkList.pas b/T02贸易汇总仓库/U_TradeClothTotalStkList.pas index d8ec36d..827d2fa 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalStkList.pas +++ b/T02贸易汇总仓库/U_TradeClothTotalStkList.pas @@ -258,7 +258,7 @@ begin SqlStr := SqlStr + ' @pageIndex=' + inttostr(CurrentPage); SqlStr := SqlStr + ' ,@pageSize=' + inttostr(RecordsNumber); SqlStr := SqlStr + ' ,@criteria= ' + quotedstr(WSql); - showmessage(SqlStr); +// showmessage(SqlStr); InitCDSData(ADO_1, CDS_1, Tv1, SqlStr, SGetFilters(Panel1, 1, 2), 'C_Code'); LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(CDS_1.FieldByName('TotalCount').AsInteger / RecordsNumber)); end; diff --git a/T03贸易布匹检验/AJCYData10.INI b/T03贸易布匹检验/AJCYData10.INI new file mode 100644 index 0000000..88ddaaf --- /dev/null +++ b/T03贸易布匹检验/AJCYData10.INI @@ -0,0 +1,9 @@ +[ϵͳ] +ں=COM2 +=19200 +Уλ=0 +λ=8 +ֹͣλ=0 +Ƶ=1000 +ݶ˿=1301 +=55AA0A0B0014 \ No newline at end of file diff --git a/T03贸易布匹检验/DjdMachineInsp.dpr b/T03贸易布匹检验/DjdMachineInsp.dpr index f82111c..483343d 100644 --- a/T03贸易布匹检验/DjdMachineInsp.dpr +++ b/T03贸易布匹检验/DjdMachineInsp.dpr @@ -51,7 +51,8 @@ uses U_TradeClothTotalOutSel in 'U_TradeClothTotalOutSel.pas' {frmTradeClothTotalOutSel}, U_CustomFun in '..\A00ͨ÷\U_CustomFun.pas', uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas', - U_ProgressUpdate in '..\A00ͨ÷\U_ProgressUpdate.pas'; + U_ProgressUpdate in '..\A00ͨ÷\U_ProgressUpdate.pas', + Unit2 in 'Unit2.pas' {Form2}; {$R *.res} diff --git a/T03贸易布匹检验/DjdMachineInsp.dproj b/T03贸易布匹检验/DjdMachineInsp.dproj index debdf6f..e2018da 100644 --- a/T03贸易布匹检验/DjdMachineInsp.dproj +++ b/T03贸易布匹检验/DjdMachineInsp.dproj @@ -304,6 +304,10 @@ + +
Form2
+ dfm +
Cfg_2 Base diff --git a/T03贸易布匹检验/TradeInspFile.INI b/T03贸易布匹检验/TradeInspFile.INI index 94bd0cc..0b8ab5c 100644 --- a/T03贸易布匹检验/TradeInspFile.INI +++ b/T03贸易布匹检验/TradeInspFile.INI @@ -4,7 +4,7 @@ ˿ں= ӳӵDllļ= õӳDllļ=1 -Dllļ= +Dllļ=AJCYData10.dll Dllļ=1 λ=1 ǩ=2 diff --git a/T03贸易布匹检验/U_GetDllForm.pas b/T03贸易布匹检验/U_GetDllForm.pas index 2b2f20e..43fcc1a 100644 --- a/T03贸易布匹检验/U_GetDllForm.pas +++ b/T03贸易布匹检验/U_GetDllForm.pas @@ -16,8 +16,9 @@ implementation uses U_DataLink, U_globalVar, U_iniParam, U_TradeMachInsp, U_ProductJYHZList, - U_DeviceJkTest, U_TradeClothInspList, U_MachRollMain, U_TradePack, - U_DjdDjClList, U_TradeClothTotalCXJYOutList,U_MachRollMarket,U_MachRollMain_M; + U_DeviceJkTest, U_TradeClothInspList, U_MachRollMain, U_TradePack, Unit2, + U_DjdDjClList, U_TradeClothTotalCXJYOutList, U_MachRollMarket, + U_MachRollMain_M; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -133,7 +134,7 @@ begin 2: // begin - with TfrmDeviceJkTest.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10),formId,title) do // + with TfrmDeviceJkTest.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10), FormID, Title) do // begin fFormID := FormID; FormStyle := mstyle; @@ -157,7 +158,7 @@ begin 1: //̨ begin - with TfrmMachRollMain.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10),formId,title) do // + with TfrmMachRollMain.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10), FormID, Title) do // begin fFormID := FormID; // FormStyle := mstyle; @@ -166,9 +167,10 @@ begin mnewHandle := Handle; end; end; - 11: //̨ + + 11: //̨ begin - with TfrmMachRollMain_M.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10),formId,title) do // + with TfrmMachRollMain_M.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10), FormID, Title) do // begin fFormID := FormID; // FormStyle := mstyle; diff --git a/T03贸易布匹检验/U_MachRollMain.dfm b/T03贸易布匹检验/U_MachRollMain.dfm index 8c9d123..4d6cdb2 100644 --- a/T03贸易布匹检验/U_MachRollMain.dfm +++ b/T03贸易布匹检验/U_MachRollMain.dfm @@ -552,7 +552,7 @@ inherited frmMachRollMain: TfrmMachRollMain end object Button1: TButton Left = 309 - Top = 244 + Top = 249 Width = 150 Height = 59 Caption = #20986' '#24211 @@ -973,8 +973,8 @@ inherited frmMachRollMain: TfrmMachRollMain end end object cxGroupBox_keys: TcxGroupBox [2] - Left = 295 - Top = 321 + Left = 496 + Top = 119 Caption = #34394#25311#38190#30424 Style.LookAndFeel.NativeStyle = False StyleDisabled.LookAndFeel.NativeStyle = False @@ -997,7 +997,6 @@ inherited frmMachRollMain: TfrmMachRollMain inherited dxPanel1: TdxPanel Width = 323 Height = 257 - ExplicitTop = -3 ExplicitWidth = 323 ExplicitHeight = 257 inherited SpeedButton1: TSpeedButton @@ -1051,8 +1050,8 @@ inherited frmMachRollMain: TfrmMachRollMain end end object MovePanel1: TMovePanel - Left = 79 - Top = -28 + Left = 170 + Top = -12 Width = 237 Height = 45 BevelOuter = bvNone diff --git a/T03贸易布匹检验/U_MachRollMain.pas b/T03贸易布匹检验/U_MachRollMain.pas index 35c42b9..62d3a2d 100644 --- a/T03贸易布匹检验/U_MachRollMain.pas +++ b/T03贸易布匹检验/U_MachRollMain.pas @@ -210,6 +210,7 @@ type procedure InitGrid2(); procedure OpenCom(DllName: string); procedure CloseCom(DllName: string); + procedure clearCom(DllName: string); function SaveData(): Boolean; procedure PrtData(MCIID: string; againPring: Boolean = false); procedure BadSpeedButtonClick(Sender: TObject); @@ -237,6 +238,38 @@ uses U_ProgressUpdate, U_LabelPrint, U_TradeClothTotalOutSel; {$R *.dfm} +procedure TfrmMachRollMain.ClearCom(DllName: string); +type + TMyFunc = function(sCommName: PAnsiChar): hwnd; stdcall; +var + Tf1: TMyFunc; + Tp1: TFarProc; + Th1: Thandle; +begin + Th1 := LoadLibrary(pchar(trim(DllName))); + if Th1 > 0 then + begin + try + Tp1 := GetProcAddress(Th1, 'CommClear'); + if Tp1 <> nil then + begin + Tf1 := TMyFunc(Tp1); + newh1 := Tf1('Comm1'); + end + else + begin + + end; + finally + // FreeLibrary(Th1); + end; + end + else + begin + Application.MessageBox(pchar('Ҳ ' + trim(DllName) + ' ļ'), 'ʾ'); + end; +end; + procedure TfrmMachRollMain.InitGrid2(); var SqlStr: string; @@ -352,6 +385,10 @@ begin finally BTPrint.Enabled := true; end; + if fIsCommopen then + begin + ClearCom(MBDYDllName); + end; end; procedure TfrmMachRollMain.bt_printmdClick(Sender: TObject); @@ -421,7 +458,7 @@ var i: Integer; begin try - BTPrint.Enabled := false; + Button1.Enabled := false; MTMSId := Trim(SelTVKey(Tv2, ['TMSId'])[0]); edtScan.SetFocus; @@ -449,7 +486,10 @@ begin end; FCIID := trim(trim(ADOQueryBaseCmd.fieldbyName('MaxIOID2').AsString)); - + if trim(cds_params.fieldbyName('outPage').AsString) = '' then + begin + PrtData(FCIID); + end; ADOQueryBaseCmd.Connection.CommitTrans; TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); except @@ -463,7 +503,11 @@ begin InitGrid2(); FCIID := ''; finally - BTPrint.Enabled := true; + Button1.Enabled := true; + end; + if fIsCommopen then + begin + ClearCom(MBDYDllName); end; end; @@ -828,6 +872,7 @@ begin SQL.Clear; SQL.Add(' EXEC P_BS_Cloth_Prt2 '); SQL.Add(' @Filtration=''' + trim(FBCIOID) + ''''); + Open; end; if ADOQueryPrint.IsEmpty then @@ -1081,7 +1126,7 @@ begin fIsCommopen := false; end; finally - // FreeLibrary(Th); +// FreeLibrary(Th); end; end else @@ -1325,15 +1370,16 @@ begin // fLabVolume := trim(ADOQueryPrint.fieldbyName('SLabVolume').AsString) // else // fLabVolume := trim(ADOQueryPrint.fieldbyName('LabVolume').AsString); - - if fLabVolume = '' then - begin - Application.MessageBox('δñǩ', 'ʾϢ', MB_ICONERROR); - exit; - end; - - ExportFtErpFile(fLabVolume + '.fr3', ADOQueryBaseTemp); - fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + fLabVolume + '.fr3'; +// if fLabVolume = '' then +// begin +// Application.MessageBox('δñǩ', 'ʾϢ', MB_ICONERROR); +// exit; +// end; +// +// ExportFtErpFile(fLabVolume + '.fr3', ADOQueryBaseTemp); +// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + fLabVolume + '.fr3'; + ExportFtErpFile('ͻǩ.fr3', ADOQueryBaseTemp); + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͻǩ.fr3'; if FileExists(fPrintFile) then begin diff --git a/T03贸易布匹检验/Unit2.dfm b/T03贸易布匹检验/Unit2.dfm new file mode 100644 index 0000000..b582761 --- /dev/null +++ b/T03贸易布匹检验/Unit2.dfm @@ -0,0 +1,17 @@ +object Form2: TForm2 + Left = 0 + Top = 0 + Caption = 'Form2' + ClientHeight = 299 + ClientWidth = 635 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 +end diff --git a/T03贸易布匹检验/Unit2.pas b/T03贸易布匹检验/Unit2.pas new file mode 100644 index 0000000..721f88b --- /dev/null +++ b/T03贸易布匹检验/Unit2.pas @@ -0,0 +1,72 @@ +unit Unit2; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs; + +type + TForm2 = class(TForm) + procedure FormShow(Sender: TObject); + private + fIsCommopen: Boolean; + procedure OpenCom(DllName: string); + { Private declarations } + public + { Public declarations } + end; + +var + Form2: TForm2; + newh: hwnd; + +implementation + uses + U_iniParam; +{$R *.dfm} + procedure TForm2.OpenCom(DllName: string); +type + TMyFunc = function(fhandle: hwnd; sCommName: PAnsiChar; IntTime: Integer; IsMessage: Integer): hwnd; stdcall; +var + Tf: TMyFunc; + Tp: TFarProc; + Th: Thandle; +begin + Th := LoadLibrary(pchar(trim(DllName))); + if Th > 0 then + begin + try + Tp := GetProcAddress(Th, 'CommOpen'); + if Tp <> nil then + begin + Tf := TMyFunc(Tp); + newh := Tf(Self.Handle, 'Comm1', 500, 1); + if newh < 1 then + begin + Application.MessageBox(pchar('򿪴ʧܣ'), 'ʾ'); + end + else + fIsCommopen := true; + end + else + begin + fIsCommopen := false; + end; + finally +// FreeLibrary(Th); + end; + end + else + begin + fIsCommopen := false; + Application.MessageBox(pchar('Ҳ ' + trim(DllName) + ' ļ'), 'ʾ'); + end; +end; +procedure TForm2.FormShow(Sender: TObject); +begin + if trim(MBDYDllName) <> '' then + OpenCom(MBDYDllName); +end; + +end. diff --git a/T05贸易门市管理/TradeMarket.dpr b/T05贸易门市管理/TradeMarket.dpr index 60a6842..5b6ac6c 100644 --- a/T05贸易门市管理/TradeMarket.dpr +++ b/T05贸易门市管理/TradeMarket.dpr @@ -44,7 +44,8 @@ uses U_ProgressUpdate in '..\A00ͨ÷\U_ProgressUpdate.pas', U_RPFun in '..\..\..\public10\ThreeFun\Fun\U_RPFun.pas', U_TradeMarketQtyInPut in 'U_TradeMarketQtyInPut.pas', - U_ItemizedListQtyInPut in '..\T02ó׻ֿܲ\U_ItemizedListQtyInPut.pas' {frmItemizedListQtyInPut}; + U_ItemizedListQtyInPut in '..\T02ó׻ֿܲ\U_ItemizedListQtyInPut.pas' {frmItemizedListQtyInPut}, + U_UserSel in '..\A00ͨô\U_UserSel.pas' {frmUserSel}; {$R *.res} diff --git a/T05贸易门市管理/TradeMarket.dproj b/T05贸易门市管理/TradeMarket.dproj index 9c431c5..0d97162 100644 --- a/T05贸易门市管理/TradeMarket.dproj +++ b/T05贸易门市管理/TradeMarket.dproj @@ -238,6 +238,10 @@
frmItemizedListQtyInPut
+ +
frmUserSel
+ dfm +
Cfg_2 Base diff --git a/T05贸易门市管理/U_TradeMarketInPut.dfm b/T05贸易门市管理/U_TradeMarketInPut.dfm index f086f3a..b2abf89 100644 --- a/T05贸易门市管理/U_TradeMarketInPut.dfm +++ b/T05贸易门市管理/U_TradeMarketInPut.dfm @@ -9,7 +9,6 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Position = poMainFormCenter WindowState = wsMaximized OnClose = FormClose - ExplicitLeft = -451 ExplicitWidth = 1937 ExplicitHeight = 775 PixelsPerInch = 96 @@ -40,24 +39,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Style = tbsDropDown OnClick = TBSaveClick end - object ToolButton3: TToolButton - Left = 94 - Top = 0 - AutoSize = True - Caption = #20445#23384#26684#24335 - ImageIndex = 16 - OnClick = ToolButton3Click - end - object TBClose: TToolButton - Left = 197 - Top = 0 - AutoSize = True - Caption = #20851#38381 - ImageIndex = 7 - OnClick = TBCloseClick - end object TBAdd: TToolButton - Left = 268 + Left = 94 Top = 0 AutoSize = True Caption = #26032#22686 @@ -65,20 +48,36 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut OnClick = TBAddClick end object ToolButton6: TToolButton - Left = 339 + Left = 165 Top = 0 AutoSize = True Caption = #21024#38500 ImageIndex = 6 end object TBEdit: TToolButton - Left = 410 + Left = 236 Top = 0 AutoSize = True Caption = #20462#25913 ImageIndex = 3 OnClick = TBEditClick end + object ToolButton3: TToolButton + Left = 307 + Top = 0 + AutoSize = True + Caption = #20445#23384#26684#24335 + ImageIndex = 16 + OnClick = ToolButton3Click + end + object TBClose: TToolButton + Left = 410 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = TBCloseClick + end end object ToolBar2: TToolBar [1] Tag = 1 @@ -556,8 +555,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut TabOrder = 3 OnClick = ScrollBox1Click object Label3: TLabel - Left = 730 - Top = 70 + Left = 1080 + Top = 66 Width = 64 Height = 21 Caption = #21046#21333#26085#26399 @@ -571,14 +570,14 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Visible = False end object Label1: TLabel - Left = 29 - Top = 68 + Left = 656 + Top = 64 Width = 77 Height = 21 Caption = #22791' '#27880 end object Label2: TLabel - Left = 730 + Left = 670 Top = 21 Width = 64 Height = 21 @@ -607,8 +606,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Caption = #35746#21333#31867#22411 end object Label18: TLabel - Left = 730 - Top = 119 + Left = 338 + Top = 64 Width = 64 Height = 21 Caption = #21457#36135#22320#22336 @@ -621,15 +620,22 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Caption = #35746#21333#21495 end object Label19: TLabel - Left = 1077 - Top = 68 + Left = 33 + Top = 66 Width = 80 Height = 21 Caption = #32852#31995#26041#24335#65306 end + object lbl2: TLabel + Left = 33 + Top = 110 + Width = 62 + Height = 21 + Caption = #19994' '#21153' '#21592':' + end object TMMNo: TcxTextEdit Tag = 2 - Left = 814 + Left = 754 Top = 15 Enabled = False TabOrder = 0 @@ -637,8 +643,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut end object TMMDate: TDateTimePicker Tag = 2 - Left = 814 - Top = 66 + Left = 1164 + Top = 62 Width = 200 Height = 29 BevelInner = bvNone @@ -663,10 +669,10 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut end object OrdNote: TMemo Tag = 2 - Left = 122 - Top = 68 - Width = 511 - Height = 81 + Left = 754 + Top = 64 + Width = 320 + Height = 90 Hint = 'OrdNote/'#22791#27880 ScrollBars = ssVertical TabOrder = 3 @@ -708,8 +714,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut end object ShippingAddress: TcxButtonEdit Tag = 2 - Left = 814 - Top = 115 + Left = 416 + Top = 65 Hint = 'ShippingAddress/'#21457#36135#22320#22336 Properties.Buttons = < item @@ -745,8 +751,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut end object CONTACT: TcxButtonEdit Tag = 2 - Left = 1164 - Top = 63 + Left = 122 + Top = 61 Hint = 'CONTACT/'#32852#31995#26041#24335 Properties.Buttons = < item @@ -759,6 +765,30 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut OnDblClick = OurCoNameDblClick Width = 200 end + object Saleser: TcxButtonEdit + Tag = 2 + Left = 122 + Top = 110 + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.ReadOnly = True + Properties.OnButtonClick = SaleserPropertiesButtonClick + Style.ButtonStyle = btsDefault + TabOrder = 10 + OnDblClick = SaleserDblClick + Width = 200 + end + object SalesId: TcxTextEdit + Tag = 2 + Left = 1330 + Top = 134 + TabOrder = 11 + Visible = False + Width = 125 + end end inherited ADOQueryBaseCmd: TADOQuery Connection = DataLink_TradeMarket.ADOLink @@ -936,7 +966,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut end object PopupMenu1: TPopupMenu Left = 49 - Top = 74 + Top = 266 object N5: TMenuItem Caption = #20445#23384#21518#31435#21363#25552#20132 OnClick = N5Click diff --git a/T05贸易门市管理/U_TradeMarketInPut.pas b/T05贸易门市管理/U_TradeMarketInPut.pas index 9b578ba..5344895 100644 --- a/T05贸易门市管理/U_TradeMarketInPut.pas +++ b/T05贸易门市管理/U_TradeMarketInPut.pas @@ -138,6 +138,9 @@ type TBAdd: TToolButton; ToolButton6: TToolButton; TBEdit: TToolButton; + lbl2: TLabel; + Saleser: TcxButtonEdit; + SalesId: TcxTextEdit; procedure TBCloseClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure TBSaveClick(Sender: TObject); @@ -184,6 +187,8 @@ type procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure TBAddClick(Sender: TObject); procedure TBEditClick(Sender: TObject); + procedure SaleserPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure SaleserDblClick(Sender: TObject); private FSCXDH: string; procedure InitData(); @@ -219,7 +224,7 @@ implementation uses U_DataLink, U_ZDYHelp, U_ZDYHelpSel, U_RTFun, U_CompanySel, U_PictureUpload, U_ProgressUpdate, U_ClothInfoSel, U_ComContactSel, U_TradeMarketList, - U_LabelPrint, U_TradeMarketQtyInPut; + U_LabelPrint, U_TradeMarketQtyInPut, U_UserSel; {$R *.dfm} @@ -445,7 +450,7 @@ begin begin close; sql.Clear; - sql.Add(' select CoCode,CoAbbrName from BS_Company where CoType=''ͻ'' '); + sql.Add(' select CoCode,CoName from BS_Company where CoType=''ͻ'' '); if Trim(canshu4) = '' then sql.Add(' and Stores='''' '); @@ -455,7 +460,7 @@ begin CustName.Properties.LookupItems.Clear; while not Eof do begin - CustName.Properties.LookupItems.Add(Trim(ADO_KH.fieldByName('CoAbbrName').AsString)); + CustName.Properties.LookupItems.Add(Trim(ADO_KH.fieldByName('CoName').AsString)); Next; end; CustName.ItemIndex := -1; @@ -526,6 +531,33 @@ begin // frmTradeMarketlist := TfrmTradeMarketlist.Create(Application); end; +procedure TfrmTradeMarketInPut.SaleserDblClick(Sender: TObject); +begin + + self.Salesid.Text := ''; + self.Saleser.Text := ''; +end; + +procedure TfrmTradeMarketInPut.SaleserPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmUserSel := TfrmUserSel.Create(Application); + with frmUserSel do + begin + Fdept := 'ҵ'; + if ShowModal = 1 then + begin + + self.Saleser.Text := Trim(CDS_1.fieldbyname('EECode').AsString); + self.Saleser.Text := Trim(CDS_1.fieldbyname('EEName').AsString); + + end; + end; + finally + frmUserSel.Free; + end; +end; + function TfrmTradeMarketInPut.SaveData(): Boolean; var maxno, Smaxno, maxTMMNo, MaxFNo, MQZ, MTMMNo: string; @@ -768,7 +800,7 @@ begin Application.MessageBox('۲Ϊ!', 'ʾ', 0); Exit; end; - if not CDS_KH.Locate('CoAbbrName', self.CustName.Text, []) then + if not CDS_KH.Locate('CoName', self.CustName.Text, []) then begin Application.MessageBox('ͻ!', 'ʾ', 0); Exit; @@ -1053,9 +1085,32 @@ end; procedure TfrmTradeMarketInPut.CustNamePropertiesChange(Sender: TObject); begin inherited; - if CDS_KH.Locate('CoAbbrName', Trim(self.CustName.Text), []) then +// if CDS_KH.Locate('CoAbbrName', Trim(self.CustName.Text), []) then +// begin +// self.CustName.Hint := Trim(CDS_KH.fieldbyname('CoCode').AsString); +// end; + with ADO_KH do begin - self.CustName.Hint := Trim(CDS_KH.fieldbyname('CoCode').AsString); + close; + sql.Clear; + sql.Add(' select CoCode,CoName from BS_Company where CoType=''ͻ'' '); + + if Trim(canshu4) = '' then + sql.Add(' and Stores='''' '); + + sql.Add(' and CoName like ''%' + Trim(CustName.Text) + '%'''); + Open; + + CustName.Properties.LookupItems.Clear; + while not Eof do + begin + CustName.Properties.LookupItems.Add(Trim(ADO_KH.fieldByName('CoName').AsString)); + Next; + end; +// CustName.ItemIndex := -1; + + SCreateCDS(ADO_KH, CDS_KH); + SInitCDSData(ADO_KH, CDS_KH); end; end; @@ -1079,7 +1134,7 @@ begin // end; if canshu4 = '' then sql.Add(' and A.Stores=''' + Trim('') + ''''); - sql.Add(' and A.CoAbbrName=''' + Trim(CustName.Text) + ''''); + sql.Add(' and A.CoName=''' + Trim(CustName.Text) + ''''); Open; end; self.ShippingAddress.Text := Trim(adotemp.fieldbyname('mxaddress').AsString); @@ -1350,7 +1405,7 @@ begin if ShowModal = 1 then begin self.CustName.Hint := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString); - self.CustName.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString); + self.CustName.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoName').AsString); self.ShippingAddress.Text := Trim(frmCompanySel.CDS_1.fieldbyname('mxaddress').AsString); self.CONTACT.Text := Trim(frmCompanySel.CDS_1.fieldbyname('Telephone').AsString); diff --git a/T05贸易门市管理/U_TradeMarketList.dfm b/T05贸易门市管理/U_TradeMarketList.dfm index c0dce62..acb5688 100644 --- a/T05贸易门市管理/U_TradeMarketList.dfm +++ b/T05贸易门市管理/U_TradeMarketList.dfm @@ -506,6 +506,12 @@ inherited frmTradeMarketList: TfrmTradeMarketList HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column26: TcxGridDBColumn + Caption = #36710#21495 + DataBinding.FieldName = 'carPlate' + DataBinding.IsNullValueType = True + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/T05贸易门市管理/U_TradeMarketList.pas b/T05贸易门市管理/U_TradeMarketList.pas index 835f79f..dc6e04e 100644 --- a/T05贸易门市管理/U_TradeMarketList.pas +++ b/T05贸易门市管理/U_TradeMarketList.pas @@ -103,6 +103,7 @@ type TBZF: TToolButton; TBNOZF: TToolButton; Tv1Column25: TcxGridDBColumn; + Tv1Column26: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -525,14 +526,15 @@ begin begin if Order_Main.fieldbyname('SSel').AsBoolean then begin - if WSql <> '' then - begin - WSql := WSql + ',' + Trim(Order_Main.fieldbyname('TMSId').AsString); - end - else - begin - WSql := Trim(Order_Main.fieldbyname('TMSId').AsString); - end; +// if WSql <> '' then +// begin +// WSql := WSql + ',' + Trim(Order_Main.fieldbyname('TMSId').AsString); //TMSId +// end +// else +// begin +// WSql := Trim(Order_Main.fieldbyname('TMSId').AsString); +// end; + WSql := Trim(Order_Main.fieldbyname('TMMId').AsString); end; Next; end; diff --git a/T05贸易门市管理/U_TradeMarketList_JD.dfm b/T05贸易门市管理/U_TradeMarketList_JD.dfm index a8f1023..a04078c 100644 --- a/T05贸易门市管理/U_TradeMarketList_JD.dfm +++ b/T05贸易门市管理/U_TradeMarketList_JD.dfm @@ -9,6 +9,7 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD FormStyle = fsMDIChild Position = poScreenCenter Visible = True + ExplicitLeft = -338 ExplicitWidth = 1439 ExplicitHeight = 673 PixelsPerInch = 96 @@ -85,6 +86,7 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -159,8 +161,6 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD Height = 202 Align = alClient TabOrder = 2 - ExplicitTop = 401 - ExplicitHeight = 232 object Tv2: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> @@ -178,6 +178,7 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -340,6 +341,7 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -406,8 +408,6 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD Height = 208 Align = alClient TabOrder = 2 - ExplicitTop = 395 - ExplicitHeight = 238 object Tv4: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> @@ -425,6 +425,7 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -678,4 +679,9 @@ inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD Left = 860 Top = 464 end + object Timer1: TTimer + OnTimer = Timer1Timer + Left = 832 + Top = 200 + end end diff --git a/T05贸易门市管理/U_TradeMarketList_JD.pas b/T05贸易门市管理/U_TradeMarketList_JD.pas index 09f706d..caace47 100644 --- a/T05贸易门市管理/U_TradeMarketList_JD.pas +++ b/T05贸易门市管理/U_TradeMarketList_JD.pas @@ -98,8 +98,10 @@ type Label4: TLabel; ToolBar4: TToolBar; Label5: TLabel; + Timer1: TTimer; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); + procedure Timer1Timer(Sender: TObject); private DQdate: TDateTime; procedure InitGrid(); @@ -147,22 +149,11 @@ end; procedure TfrmTradeMarketList_JD.InitGrid(); begin - with ADO_1 do - begin - Close; - sql.clear; - sql.add('select cast((case when isnull(Urgent,'''')<>'''' then 0 else 1 end )as int) as Urgent,* from Trade_Market_Main A inner join Trade_Market_Sub B on B.TMMId=A.TMMId '); - sql.add('where 1=1'); - Open; - end; - SCreateCDS(ADO_1, CDS_1); - SInitCDSData(ADO_1, CDS_1); - SCreateCDS(ADO_1, CDS_2); - SInitCDSData(ADO_1, CDS_2); - SCreateCDS(ADO_1, CDS_3); - SInitCDSData(ADO_1, CDS_3); - SCreateCDS(ADO_1, CDS_4); - SInitCDSData(ADO_1, CDS_4); + InitGrid1(); + InitGrid2(); + InitGrid3(); + InitGrid4(); + end; procedure TfrmTradeMarketList_JD.InitGrid1(); @@ -225,5 +216,26 @@ begin SInitCDSData(ADO_4, CDS_4); end; +procedure TfrmTradeMarketList_JD.Timer1Timer(Sender: TObject); +begin + for var v in TArray.Create(TV1, TV2, TV3, TV4) do + begin + if v.DataController.RecordCount = 0 then + Continue; + + if v.Controller.FocusedRowIndex < v.DataController.RecordCount - 1 then + begin + v.Controller.FocusedRowIndex := v.Controller.FocusedRowIndex + 1; + v.Controller.MakeFocusedItemVisible; + end + else + begin + InitGrid(); + v.Controller.FocusedRowIndex := 0; + v.Controller.MakeFocusedItemVisible; + end; + end; +end; + end. diff --git a/T05贸易门市管理/U_TradeMarketList_JDT.dfm b/T05贸易门市管理/U_TradeMarketList_JDT.dfm index 73a357b..4ce88e3 100644 --- a/T05贸易门市管理/U_TradeMarketList_JDT.dfm +++ b/T05贸易门市管理/U_TradeMarketList_JDT.dfm @@ -85,6 +85,7 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -159,8 +160,6 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT Height = 202 Align = alClient TabOrder = 2 - ExplicitTop = 401 - ExplicitHeight = 232 object Tv2: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> @@ -178,6 +177,7 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -340,6 +340,7 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -406,8 +407,6 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT Height = 208 Align = alClient TabOrder = 2 - ExplicitTop = 395 - ExplicitHeight = 238 object Tv4: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> @@ -425,6 +424,7 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT DataController.Summary.SummaryGroups = <> OptionsBehavior.CellHints = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.Footer = True OptionsView.GroupByBox = False OptionsView.IndicatorWidth = 30 @@ -450,6 +450,7 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT DataBinding.IsNullValueType = True PropertiesClassName = 'TcxDateEditProperties' HeaderAlignmentHorz = taCenter + Options.Editing = False Width = 80 end object Tv4Column4: TcxGridDBColumn @@ -501,9 +502,9 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT object Label4: TLabel Left = 0 Top = 0 - Width = 38 + Width = 57 Height = 30 - Caption = #26032#20313 + Caption = #26410#22238#21333 Font.Charset = GB2312_CHARSET Font.Color = clRed Font.Height = -19 @@ -678,4 +679,9 @@ inherited frmTradeMarketList_JDT: TfrmTradeMarketList_JDT Left = 860 Top = 464 end + object Timer1: TTimer + OnTimer = Timer1Timer + Left = 832 + Top = 200 + end end diff --git a/T05贸易门市管理/U_TradeMarketList_JDT.pas b/T05贸易门市管理/U_TradeMarketList_JDT.pas index 572b6cb..4febc48 100644 --- a/T05贸易门市管理/U_TradeMarketList_JDT.pas +++ b/T05贸易门市管理/U_TradeMarketList_JDT.pas @@ -98,8 +98,10 @@ type Label4: TLabel; ToolBar4: TToolBar; Label5: TLabel; + Timer1: TTimer; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); + procedure Timer1Timer(Sender: TObject); private DQdate: TDateTime; procedure InitGrid(); @@ -147,22 +149,10 @@ end; procedure TfrmTradeMarketList_JDT.InitGrid(); begin - with ADO_1 do - begin - Close; - sql.clear; - sql.add('select cast((case when isnull(Urgent,'''')<>'''' then 0 else 1 end )as int) as Urgent,* from Trade_Market_Main A inner join Trade_Market_Sub B on B.TMMId=A.TMMId '); - sql.add('where 1=1'); - Open; - end; - SCreateCDS(ADO_1, CDS_1); - SInitCDSData(ADO_1, CDS_1); - SCreateCDS(ADO_1, CDS_2); - SInitCDSData(ADO_1, CDS_2); - SCreateCDS(ADO_1, CDS_3); - SInitCDSData(ADO_1, CDS_3); - SCreateCDS(ADO_1, CDS_4); - SInitCDSData(ADO_1, CDS_4); + InitGrid1(); + InitGrid2(); + InitGrid3(); + InitGrid4(); end; procedure TfrmTradeMarketList_JDT.InitGrid1(); @@ -217,13 +207,32 @@ begin Close; sql.clear; sql.add('select cast((case when isnull(Urgent,'''')<>'''' then 0 else 1 end )as int) as Urgent,* from Trade_Market_Main A inner join Trade_Market_Sub B on B.TMMId=A.TMMId '); - sql.add('where 1=1'); - sql.add('and AddressArea='''' '); + sql.add('where 1=1 and isnull(Status,0)=''9'' '); Open; end; SCreateCDS(ADO_4, CDS_4); SInitCDSData(ADO_4, CDS_4); end; +procedure TfrmTradeMarketList_JDT.Timer1Timer(Sender: TObject); + +begin + for var v in TArray.Create(TV1,TV2, TV3, TV4) do + begin + if v.DataController.RecordCount = 0 then Continue; + if v.Controller.FocusedRowIndex < v.DataController.RecordCount - 1 then + begin + v.Controller.FocusedRowIndex := v.Controller.FocusedRowIndex + 1; + v.Controller.MakeFocusedItemVisible; + end + else + begin + InitGrid(); + v.Controller.FocusedRowIndex := 0; + v.Controller.MakeFocusedItemVisible; + end; + end; +end; + end. diff --git a/T05贸易门市管理/U_TradeSampletList.dfm b/T05贸易门市管理/U_TradeSampletList.dfm index fa513e1..093f5eb 100644 --- a/T05贸易门市管理/U_TradeSampletList.dfm +++ b/T05贸易门市管理/U_TradeSampletList.dfm @@ -9,7 +9,7 @@ inherited frmTradeSampleList: TfrmTradeSampleList FormStyle = fsMDIChild Position = poScreenCenter Visible = True - ExplicitLeft = -793 + ExplicitLeft = -454 ExplicitWidth = 1940 ExplicitHeight = 633 PixelsPerInch = 96 @@ -276,11 +276,14 @@ inherited frmTradeSampleList: TfrmTradeSampleList Align = alClient PopupMenu = PM_1 TabOrder = 3 + ExplicitLeft = -8 + ExplicitTop = 158 object Tv1: TcxGridDBTableView OnDblClick = Tv1DblClick Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell DataController.DataSource = DataSource1 DataController.Filter.AutoDataSetFilter = True DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] @@ -518,6 +521,12 @@ inherited frmTradeSampleList: TfrmTradeSampleList HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column26: TcxGridDBColumn + DataBinding.FieldName = 'PrintStatus' + DataBinding.IsNullValueType = True + Visible = False + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/T05贸易门市管理/U_TradeSampletList.pas b/T05贸易门市管理/U_TradeSampletList.pas index 2f9f2fa..6b8fecf 100644 --- a/T05贸易门市管理/U_TradeSampletList.pas +++ b/T05贸易门市管理/U_TradeSampletList.pas @@ -103,6 +103,7 @@ type TBZF: TToolButton; TBNOZF: TToolButton; Tv1Column25: TcxGridDBColumn; + Tv1Column26: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -145,6 +146,7 @@ type procedure TBZFClick(Sender: TObject); procedure TBNOZFClick(Sender: TObject); procedure Tv1DblClick(Sender: TObject); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); private DQdate: TDateTime; procedure InitGrid(); @@ -516,11 +518,11 @@ begin begin if WSql <> '' then begin - WSql := WSql + ',' + Trim(Order_Main.fieldbyname('TMSId').AsString); + WSql := WSql + ',' + Trim(Order_Main.fieldbyname('TMMId').AsString); end else begin - WSql := Trim(Order_Main.fieldbyname('TMSId').AsString); + WSql := Trim(Order_Main.fieldbyname('TMMId').AsString); end; end; Next; @@ -537,6 +539,14 @@ begin if ShowModal = 1 then begin // Self.InitGrid(); + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Trade_Market_Main SET PrintStatus=1 '); + sql.Add(' where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](''' + WSql + ''','','') X where X.RTValue=TMMId) '); + execsql; + end; end; end; finally @@ -738,6 +748,12 @@ begin Clipboard.SetTextBuf(PChar(Trim(Order_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString))); end; +procedure TfrmTradeSampleList.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin + if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('PrintStatus').Index] = '1' then + ACanvas.Brush.Color := clInfoBk; +end; + procedure TfrmTradeSampleList.Tv1DblClick(Sender: TObject); begin if Order_Main.IsEmpty then