diff --git a/A02基础产品管理/U_ClothInfo.pas b/A02基础产品管理/U_ClothInfo.pas index 66bb799..87b82c8 100644 --- a/A02基础产品管理/U_ClothInfo.pas +++ b/A02基础产品管理/U_ClothInfo.pas @@ -365,7 +365,15 @@ begin cxDBTreeList1.Items[0].Expand(False); end; - Self.cds_tree.Locate('CTName', 'Ʒ', []); + if canshu4 = 'μӹ' then + begin + Self.cds_tree.Locate('CTName', 'Ʒ', []); + end + else + begin + Self.cds_tree.Locate('CTName', 'Ʒ', []); + end; + end; procedure TfrmClothInfo.InitGrid(); diff --git a/A02基础产品管理/U_ClothInfoInput.dfm b/A02基础产品管理/U_ClothInfoInput.dfm index 2d729c9..af14e62 100644 --- a/A02基础产品管理/U_ClothInfoInput.dfm +++ b/A02基础产品管理/U_ClothInfoInput.dfm @@ -580,23 +580,30 @@ object frmClothInfoInput: TfrmClothInfoInput Height = 30 AutoSize = True ButtonHeight = 30 - ButtonWidth = 67 + ButtonWidth = 99 Caption = 'ToolBar1' DisabledImages = DataLink_ClothInfo.cxImageList_bar Images = DataLink_ClothInfo.cxImageList_bar List = True ShowCaptions = True TabOrder = 0 - object ToolButton8: TToolButton + object ToolButton13: TToolButton Left = 0 Top = 0 + Caption = #35774#20026#40664#35748 + ImageIndex = 15 + OnClick = ToolButton13Click + end + object ToolButton8: TToolButton + Left = 99 + Top = 0 AutoSize = True Caption = #22686#34892 ImageIndex = 2 OnClick = ToolButton8Click end object ToolButton9: TToolButton - Left = 71 + Left = 170 Top = 0 AutoSize = True Caption = #21024#34892 @@ -652,6 +659,15 @@ object frmClothInfoInput: TfrmClothInfoInput HeaderAlignmentHorz = taCenter Width = 117 end + object TV3Column1: TcxGridDBColumn + Caption = #40664#35748 + DataBinding.FieldName = 'IsDefault' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 69 + end end object cxGridLevel3: TcxGridLevel GridView = TV3 @@ -993,6 +1009,7 @@ object frmClothInfoInput: TfrmClothInfoInput OptionsBehavior.GoToNextCellOnEnter = True OptionsBehavior.FocusCellOnCycle = True OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False OptionsView.GroupByBox = False object TV1Column1: TcxGridDBColumn Caption = #39068#33394 diff --git a/A02基础产品管理/U_ClothInfoInput.pas b/A02基础产品管理/U_ClothInfoInput.pas index 68b6a9f..b31c8ed 100644 --- a/A02基础产品管理/U_ClothInfoInput.pas +++ b/A02基础产品管理/U_ClothInfoInput.pas @@ -138,6 +138,8 @@ type Process4: TcxButtonEdit; Process5: TcxButtonEdit; Process: TcxButtonEdit; + ToolButton13: TToolButton; + TV3Column1: TcxGridDBColumn; procedure FormShow(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure ToolButton1Click(Sender: TObject); @@ -173,6 +175,7 @@ type procedure C_FromName4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure C_FromName5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure CostPriceClick(Sender: TObject); + procedure ToolButton13Click(Sender: TObject); private canshu1: string; Fint: Integer; @@ -1321,6 +1324,23 @@ begin CDS_1.EmptyDataSet; end; +procedure TfrmClothInfoInput.ToolButton13Click(Sender: TObject); +var + DwFlag: string; +begin + DwFlag := trim(CDS_3.FieldByName('CICID').AsString); + if CDS_3.Locate('IsDefault', true, []) then + begin + CDS_3.edit; + CDS_3.FieldByName('IsDefault').value := false; + end; + if CDS_3.Locate('CICID', DwFlag, []) then + begin + CDS_3.edit; + CDS_3.FieldByName('IsDefault').value := true; + end; +end; + procedure TfrmClothInfoInput.ToolButton1Click(Sender: TObject); var MC_Code: string; @@ -1372,6 +1392,21 @@ begin Application.MessageBox('Ƽ۵λ!', 'ʾ', 0); Exit; end; + if cds_3.IsEmpty then + begin + Application.MessageBox('뵥λ!', 'ʾ', 0); + Exit; + end + else + begin + if CDS_3.Locate('CICUnit', null, []) = True then + begin + Application.MessageBox('뵥λ!', 'ʾ', 0); + Exit; + end; + end; + + // if CDS_1.Locate('C_Color', null, []) = True then // begin diff --git a/T02贸易汇总仓库/TradeTotalClothStk.dpr b/T02贸易汇总仓库/TradeTotalClothStk.dpr index 15864fa..600c1ff 100644 --- a/T02贸易汇总仓库/TradeTotalClothStk.dpr +++ b/T02贸易汇总仓库/TradeTotalClothStk.dpr @@ -71,6 +71,7 @@ uses U_dynamicsDll in '..\..\..\public10\ThreeFun\Fun\U_dynamicsDll.pas', U_printPdf in '..\..\..\public10\ThreeFun\Fun\U_printPdf.pas', U_CustomFun in '..\A00ͨ÷\U_CustomFun.pas', + U_ProgressUpdate in '..\A00ͨ÷\U_ProgressUpdate.pas', U_TradeClothSplit in 'U_TradeClothSplit.pas' {frmTradeClothSplit}, uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas', U_TradeRRList in 'U_TradeRRList.pas' {frmTradeRRList}, diff --git a/T02贸易汇总仓库/TradeTotalClothStk.dproj b/T02贸易汇总仓库/TradeTotalClothStk.dproj index 4b68693..aa165cb 100644 --- a/T02贸易汇总仓库/TradeTotalClothStk.dproj +++ b/T02贸易汇总仓库/TradeTotalClothStk.dproj @@ -349,23 +349,20 @@ +
frmTradeClothSplit
- dfm
frmTradeRRList
- dfm
frmTradeRRInPut
- dfm
frmInputReceiptType
- dfm
Cfg_2 diff --git a/T02贸易汇总仓库/U_GetDllForm.pas b/T02贸易汇总仓库/U_GetDllForm.pas index df1c200..06f92cd 100644 --- a/T02贸易汇总仓库/U_GetDllForm.pas +++ b/T02贸易汇总仓库/U_GetDllForm.pas @@ -84,7 +84,7 @@ begin pswd := 'rightsoft@5740'; DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server; - Parameters1 := ''; +// Parameters1 := ''; // Parameters2 := 'óײƥ'; // Parameters2 := 'ŵ'; // Parameters2 := ''; diff --git a/T02贸易汇总仓库/U_TradeClothTotalOutList.dfm b/T02贸易汇总仓库/U_TradeClothTotalOutList.dfm index a660d65..4a1f29c 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalOutList.dfm +++ b/T02贸易汇总仓库/U_TradeClothTotalOutList.dfm @@ -2,16 +2,15 @@ inherited frmTradeClothTotalOutList: TfrmTradeClothTotalOutList Left = 65 Top = 98 Caption = #36152#26131#24067#21305#20986#24211#21015#34920 - ClientHeight = 736 + ClientHeight = 618 ClientWidth = 1281 Color = clBtnFace Font.Height = -16 FormStyle = fsMDIChild Position = poScreenCenter Visible = True - ExplicitTop = -112 ExplicitWidth = 1297 - ExplicitHeight = 775 + ExplicitHeight = 657 PixelsPerInch = 96 TextHeight = 21 object ToolBar1: TToolBar [0] @@ -318,27 +317,26 @@ inherited frmTradeClothTotalOutList: TfrmTradeClothTotalOutList end object cxPageControl1: TcxPageControl [4] Left = 0 - Top = 177 + Top = 214 Width = 1281 - Height = 559 + Height = 404 Align = alClient TabOrder = 4 Properties.ActivePage = cxTabSheet1 Properties.CustomButtons.Buttons = <> Properties.Style = 5 OnChange = cxPageControl1Change - ClientRectBottom = 559 + ClientRectBottom = 404 ClientRectRight = 1281 ClientRectTop = 32 object cxTabSheet1: TcxTabSheet Caption = ' '#20135#21697#27719#24635' ' ImageIndex = 0 - ExplicitTop = 0 object cxGrid2: TcxGrid Left = 0 Top = 0 Width = 1281 - Height = 527 + Height = 372 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 @@ -513,7 +511,7 @@ inherited frmTradeClothTotalOutList: TfrmTradeClothTotalOutList Left = 0 Top = 0 Width = 1281 - Height = 527 + Height = 372 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 @@ -1070,6 +1068,75 @@ inherited frmTradeClothTotalOutList: TfrmTradeClothTotalOutList ClientRectRight = 0 ClientRectTop = 0 end + object Panel6: TPanel [6] + Left = 0 + Top = 177 + Width = 1281 + Height = 37 + Align = alTop + AutoSize = True + BevelInner = bvLowered + BorderStyle = bsSingle + TabOrder = 6 + DesignSize = ( + 1277 + 33) + object Label31: TLabel + Left = 14 + Top = 7 + Width = 96 + Height = 21 + Alignment = taCenter + Anchors = [akLeft] + Caption = #27599#39029#35760#24405#26465#25968 + Layout = tlCenter + ExplicitTop = 8 + end + object LBCPAP: TLabel + Left = 478 + Top = 6 + Width = 100 + Height = 20 + Alignment = taCenter + Anchors = [akLeft] + AutoSize = False + Caption = #24403#21069#39029'/'#24635#39029#25968 + Layout = tlCenter + ExplicitTop = 7 + end + object BTLP: TButton + Left = 391 + Top = 4 + Width = 78 + Height = 27 + Anchors = [akLeft] + Caption = #19978#19968#39029 + TabOrder = 0 + end + object BTNP: TButton + Left = 585 + Top = 3 + Width = 78 + Height = 28 + Anchors = [akLeft] + Caption = #19979#19968#39029 + TabOrder = 1 + end + object TCBNOR: TcxComboBox + Tag = 2 + Left = 122 + Top = 2 + Properties.DropDownListStyle = lsEditFixedList + Properties.Items.Strings = ( + '500' + '1000' + '5000' + '10000') + TabOrder = 2 + Text = '500' + Width = 94 + end + end inherited ADOQueryBaseCmd: TADOQuery Connection = DataLink_TradeTotalClothStk.ADOLink Left = 504 diff --git a/T02贸易汇总仓库/U_TradeClothTotalOutList.pas b/T02贸易汇总仓库/U_TradeClothTotalOutList.pas index d9c01ab..cfb0c0a 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalOutList.pas +++ b/T02贸易汇总仓库/U_TradeClothTotalOutList.pas @@ -14,7 +14,7 @@ uses cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu, U_BaseList, Clipbrd, dxScrollbarAnnotations, FrameDateSel, cxContainer, cxMaskEdit, cxProgressBar, cxButtons, dxSkinsCore, - dxSkinsDefaultPainters; + dxSkinsDefaultPainters, System.Math; type TfrmTradeClothTotalOutList = class(TfrmBaseList) @@ -141,6 +141,12 @@ type Tv1Column36: TcxGridDBColumn; ToolButton5: TToolButton; cxTabControl1: TcxTabControl; + Panel6: TPanel; + Label31: TLabel; + LBCPAP: TLabel; + BTLP: TButton; + BTNP: TButton; + TCBNOR: TcxComboBox; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); procedure TBRafreshClick(Sender: TObject); @@ -175,9 +181,11 @@ type procedure TV2DblClick(Sender: TObject); procedure ToolButton5Click(Sender: TObject); private + CurrentPage, RecordsNumber: Integer; canshu1, FSTKName, canshu3, canshu4: string; procedure InitGrid1(); procedure InitGrid2(); + procedure InitGrid(MWSql: string); { Private declarations } public { Public declarations } @@ -189,10 +197,108 @@ type implementation uses - U_DataLink, U_RTFun, U_TradeTotallClothOutinput, U_AttachmentUpload, + 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); +var + WSql, WDateSql: string; + SqlStr: string; +begin + + WDateSql := ' and A.Filltime>' + quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)); + WDateSql := WDateSql + ' and A.Filltime<=' + quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date + 1)); + WDateSql := WDateSql + ' and isnull(STKNAME,'''')=''' + Trim(FSTKNAME) + ''''; + if Trim(canshu4) <> '' then + WDateSql := WDateSql + ' and isnull(StkCoName,'''')=''' + Trim(canshu4) + ''''; + case cxTabControl1.TabIndex of + 0: + begin + WDateSql := WDateSql + ' and Status=''0'' '; + end; + 1: + begin + WDateSql := WDateSql + ' and Status=''1'' '; + end; + end; + + case cxPageControl1.ActivePageIndex of + 0: + begin +// WSql := CommonFiltersByContainer(dxLayoutControl_query, ' {"EquTag": 1,"LikeTag": 2,"Fields": "OrderNo|FtyPCId|FtyPCId|C_Color|C_Code|C_Name"}'); + if trim(WSql) <> '' then + begin + WSql := WDateSql + ' and ' + trim(WSql); + end + else + WSql := WDateSql; + + SqlStr := ' select A.ReceiptType,A.BCIONO,A.ToCoName,A.C_Code,C_Name,C_Color,C_ColorNo,C_Degree,C_Pattern,QtyUnit '; + SqlStr := SqlStr + ' ,Pieceint=sum(CEILING(A.Piece)),Qty=sum(Qty),QtyUnit '; + SqlStr := SqlStr + ' from BS_Cloth_IO A '; + SqlStr := SqlStr + ' where 1=1 ' + (WSql); + SqlStr := SqlStr + ' and ioFlag='''' '; + SqlStr := SqlStr + ' group by A.ReceiptType,A.BCIONO,A.ToCoName,C_Code,C_Name,C_Color,C_ColorNo,C_Degree,C_Pattern,QtyUnit'; +// ShowMessage(SqlStr); + InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, SGetFilters(Panel1, 1, 2), 'C_Code'); + end; + 1: + begin + if MWSql = '' then + WSql := CommonFiltersByContainer(panel1, ' {"EquTag": 1,"LikeTag": 2,"Fields": ""}') + else + WSql := MWSql; + + if trim(WSql) <> '' then + begin + WSql := WDateSql + ' and ' + trim(WSql); + end + else + WSql := WDateSql; + + SqlStr := 'exec P_Trade_Totaloutlist_Get_Page '; + SqlStr := SqlStr + ' @pageIndex=' + inttostr(CurrentPage); + SqlStr := SqlStr + ' ,@pageSize=' + inttostr(RecordsNumber); + SqlStr := SqlStr + ' ,@criteria= ' + quotedstr(WSql); +// 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; + end; + +end; + +procedure TfrmTradeClothTotalOutList.InitGrid1(); +var + SqlStr, WSqlStr: string; +begin + + SqlStr := ' select A.* ,Pieceint=CEILING(A.Piece)'; + SqlStr := SqlStr + ',FJFlag=CAST((CASE WHEN (SELECT COUNT(X.FileName) FROM FJ_File X where X.TFType=''ó׻ܲ'' and X.WBID=A.BCIOID)>0 THEN 1 ELSE 0 END) AS BIT) '; + SqlStr := SqlStr + ' from BS_Cloth_IO A'; + SqlStr := SqlStr + ' where A.IOTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)) + ''''; + SqlStr := SqlStr + ' and A.IOTime<''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date + 1)) + ''''; + SqlStr := SqlStr + ' and isnull(stkName,'''')=''' + Trim(FstkName) + ''''; + SqlStr := SqlStr + ' and ioFlag='''' '; + case cxTabControl1.TabIndex of + 0: + begin + SqlStr := SqlStr + ' and Status=''0'' '; + end; + 1: + begin + SqlStr := SqlStr + ' and Status=''1'' '; + end; + end; + WSqlStr := CommonFiltersByTv(Tv2, '{"RemovalNull":true,"Fields":"BCIONO"}'); + if TRIM(WSqlStr) <> '' then + SqlStr := SqlStr + ' and ' + WSqlStr; + if Trim(canshu4) <> '' then + SqlStr := SqlStr + ' and isnull(StkCoName,'''')=''' + Trim(canshu4) + ''''; + + InitCDSData(ADO_1, CDS_1, Tv1, SqlStr, SGetFilters(Panel1, 1, 2), 'BCIOID'); +end; procedure TfrmTradeClothTotalOutList.InitGrid2(); var @@ -243,38 +349,6 @@ begin frmFrameDateSel1.BegDate.Date := frmFrameDateSel1.EndDate.Date - 90; end; -procedure TfrmTradeClothTotalOutList.InitGrid1(); -var - SqlStr, WSqlStr: string; -begin - - SqlStr := ' select A.* ,Pieceint=CEILING(A.Piece)'; - SqlStr := SqlStr + ',FJFlag=CAST((CASE WHEN (SELECT COUNT(X.FileName) FROM FJ_File X where X.TFType=''ó׻ܲ'' and X.WBID=A.BCIOID)>0 THEN 1 ELSE 0 END) AS BIT) '; - - SqlStr := SqlStr + ' from BS_Cloth_IO A'; - SqlStr := SqlStr + ' where A.IOTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)) + ''''; - SqlStr := SqlStr + ' and A.IOTime<''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date + 1)) + ''''; - SqlStr := SqlStr + ' and isnull(stkName,'''')=''' + Trim(FstkName) + ''''; - SqlStr := SqlStr + ' and ioFlag='''' '; - case cxTabControl1.TabIndex of - 0: - begin - SqlStr := SqlStr + ' and Status=''0'' '; - end; - 1: - begin - SqlStr := SqlStr + ' and Status=''1'' '; - end; - end; - WSqlStr := CommonFiltersByTv(Tv2, '{"RemovalNull":true,"Fields":"BCIONO"}'); - if TRIM(WSqlStr) <> '' then - SqlStr := SqlStr + ' and ' + WSqlStr; - if Trim(canshu4) <> '' then - SqlStr := SqlStr + ' and isnull(StkCoName,'''')=''' + Trim(canshu4) + ''''; - - InitCDSData(ADO_1, CDS_1, Tv1, SqlStr, SGetFilters(Panel1, 1, 2), 'BCIOID'); -end; - procedure TfrmTradeClothTotalOutList.IOTypePropertiesChange(Sender: TObject); begin TBFind.Click; @@ -283,7 +357,9 @@ end; procedure TfrmTradeClothTotalOutList.TBRafreshClick(Sender: TObject); begin ToolBar1.SetFocus; - InitGrid2(); +// InitGrid2(); + CurrentPage := 1; + InitGrid(''); end; procedure TfrmTradeClothTotalOutList.ToolButton1Click(Sender: TObject); @@ -452,12 +528,15 @@ var mSql: string; begin inherited; + CurrentPage := 1; + RecordsNumber := 500; mSql := 'select distinct name=A.IOType from BS_Cloth_IO A where IOFlag='''' and isnull(STKNAME,'''')=''' + Trim(FSTKNAME) + ''' '; SInitTcxComBoxBySql(ADOQueryTemp, IOType, false, mSql); ReadCxGrid(trim(Self.Caption) + 'Tv1', Tv1, 'ó׻ֿܲ'); ReadCxGrid(trim(Self.Caption) + 'Tv2', Tv2, 'ó׻ֿܲ'); - InitGrid2(); + InitGrid(''); +// InitGrid2(); end; procedure TfrmTradeClothTotalOutList.TBExportClick(Sender: TObject); @@ -513,7 +592,7 @@ end; procedure TfrmTradeClothTotalOutList.TBDelClick(Sender: TObject); var - MBCIOID, MBCIONO: string; + MBCIOID, MBCIONO, MTMSId: string; begin if cxPageControl1.ActivePageIndex <> 1 then Exit; @@ -530,6 +609,7 @@ begin Exit; MBCIOID := SelCDSKey(CDS_1, ['BCIOID'])[0]; MBCIONO := SelCDSKey(CDS_1, ['BCIONO'])[0]; + MTMSId := SelCDSKey(CDS_1, ['TMSId'])[0]; with ADOQueryTemp do begin Close; @@ -583,6 +663,7 @@ begin if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString))); ADOQueryCmd.Connection.CommitTrans; + TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); InitGrid2(); InitGrid1(); except diff --git a/T02贸易汇总仓库/U_TradeClothTotalStkList.dfm b/T02贸易汇总仓库/U_TradeClothTotalStkList.dfm index 2c8a47a..90ec222 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalStkList.dfm +++ b/T02贸易汇总仓库/U_TradeClothTotalStkList.dfm @@ -178,29 +178,33 @@ inherited frmTradeClothTotalStkList: TfrmTradeClothTotalStkList end object cxPageControl1: TcxPageControl [4] Left = 0 - Top = 89 + Top = 126 Width = 1404 - Height = 426 + Height = 389 Align = alClient TabOrder = 4 Properties.ActivePage = cxTabSheet1 Properties.CustomButtons.Buttons = <> Properties.Style = 5 OnChange = cxPageControl1Change - ClientRectBottom = 426 + ExplicitTop = 89 + ExplicitHeight = 426 + ClientRectBottom = 389 ClientRectRight = 1404 ClientRectTop = 32 object cxTabSheet1: TcxTabSheet Caption = ' '#20135#21697#27719#24635' ' ImageIndex = 0 + ExplicitHeight = 394 object cxGrid2: TcxGrid Left = 0 Top = 0 Width = 1404 - Height = 394 + Height = 357 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 + ExplicitHeight = 394 object TV2: TcxGridDBTableView OnDblClick = TV2DblClick Navigator.Buttons.CustomButtons = <> @@ -352,14 +356,16 @@ inherited frmTradeClothTotalStkList: TfrmTradeClothTotalStkList object cxTabSheet2: TcxTabSheet Caption = #20135#21697#26126#32454 ImageIndex = 1 + ExplicitHeight = 394 object cxGrid1: TcxGrid Left = 0 Top = 0 Width = 1404 - Height = 394 + Height = 357 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 + ExplicitHeight = 394 object Tv1: TcxGridDBTableView Navigator.Buttons.CustomButtons = <> ScrollbarAnnotations.CustomAnnotations = <> @@ -797,6 +803,77 @@ inherited frmTradeClothTotalStkList: TfrmTradeClothTotalStkList end end end + object Panel6: TPanel [5] + Left = 0 + Top = 89 + Width = 1404 + Height = 37 + Align = alTop + AutoSize = True + BevelInner = bvLowered + BorderStyle = bsSingle + TabOrder = 5 + ExplicitTop = 149 + ExplicitWidth = 1234 + DesignSize = ( + 1400 + 33) + object Label31: TLabel + Left = 14 + Top = 7 + Width = 96 + Height = 21 + Alignment = taCenter + Anchors = [akLeft] + Caption = #27599#39029#35760#24405#26465#25968 + Layout = tlCenter + ExplicitTop = 8 + end + object LBCPAP: TLabel + Left = 478 + Top = 6 + Width = 100 + Height = 20 + Alignment = taCenter + Anchors = [akLeft] + AutoSize = False + Caption = #24403#21069#39029'/'#24635#39029#25968 + Layout = tlCenter + ExplicitTop = 7 + end + object BTLP: TButton + Left = 391 + Top = 4 + Width = 78 + Height = 27 + Anchors = [akLeft] + Caption = #19978#19968#39029 + TabOrder = 0 + end + object BTNP: TButton + Left = 585 + Top = 3 + Width = 78 + Height = 28 + Anchors = [akLeft] + Caption = #19979#19968#39029 + TabOrder = 1 + end + object TCBNOR: TcxComboBox + Tag = 2 + Left = 122 + Top = 2 + Properties.DropDownListStyle = lsEditFixedList + Properties.Items.Strings = ( + '500' + '1000' + '5000' + '10000') + TabOrder = 2 + Text = '500' + Width = 94 + end + end inherited ADOQueryBaseCmd: TADOQuery Connection = DataLink_TradeTotalClothStk.ADOLink Left = 524 diff --git a/T02贸易汇总仓库/U_TradeClothTotalStkList.pas b/T02贸易汇总仓库/U_TradeClothTotalStkList.pas index a5dff72..6d803ec 100644 --- a/T02贸易汇总仓库/U_TradeClothTotalStkList.pas +++ b/T02贸易汇总仓库/U_TradeClothTotalStkList.pas @@ -14,7 +14,7 @@ uses cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu, U_BaseList, dxScrollbarAnnotations, cxContainer, cxProgressBar, cxButtons, cxMaskEdit, dxSkinsCore, dxSkinsDefaultPainters, - cxPC; + cxPC, System.Math; type TfrmTradeClothTotalStkList = class(TfrmBaseList) @@ -110,6 +110,12 @@ type Label1: TLabel; StkPosition: TcxTextEdit; TV2Column1: TcxGridDBColumn; + Panel6: TPanel; + Label31: TLabel; + LBCPAP: TLabel; + BTLP: TButton; + BTNP: TButton; + TCBNOR: TcxComboBox; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBRafreshClick(Sender: TObject); @@ -128,8 +134,10 @@ type procedure TV2DblClick(Sender: TObject); procedure cxPageControl1Change(Sender: TObject); private + CurrentPage, RecordsNumber: Integer; canshu1, FSTKName, canshu3, canshu4: string; - procedure InitGrid(); +// procedure InitGrid(); + procedure InitGrid(MWSql: string); procedure InitGrid1(); procedure InitGrid2(); { Private declarations } @@ -180,17 +188,79 @@ begin canshu4 := Trim(self.fParameters4); end; -procedure TfrmTradeClothTotalStkList.InitGrid(); +//procedure TfrmTradeClothTotalStkList.InitGrid(); +//begin +// case cxPageControl1.ActivePageIndex of +// 0: +// begin +// InitGrid2(); +// end; +// 1: +// begin +// +// InitGrid1(); +// end; +// end; +// +//end; +procedure TfrmTradeClothTotalStkList.InitGrid(MWSql: string); +var + WSql, WDateSql: string; + SqlStr: string; begin + + WDateSql := ' and isnull(STKNAME,'''')=''' + Trim(FSTKNAME) + ''''; + if Trim(canshu4) <> '' then + WDateSql := WDateSql + ' and isnull(StkCoName,'''')=''' + Trim(canshu4) + ''''; + case cxPageControl1.ActivePageIndex of 0: begin - InitGrid2(); +// WSql := CommonFiltersByContainer(dxLayoutControl_query, ' {"EquTag": 1,"LikeTag": 2,"Fields": "OrderNo|FtyPCId|FtyPCId|C_Color|C_Code|C_Name"}'); + + if trim(WSql) <> '' then + begin + WSql := WDateSql + ' and ' + trim(WSql); + end + else + WSql := WDateSql; + + SqlStr := ' select A.C_Code,C_Name,C_Color,C_ColorNo,C_Degree,C_Pattern,QtyUnit,StkPieceint=sum(CEILING(A.StkPiece)),StkQty=sum(StkQty),QtyUnit,StkPosition '; + SqlStr := SqlStr + ' from BS_Cloth_IO A '; + SqlStr := SqlStr + ' where A.IOFlag='''' and (isnull(StkQty,0)>0 or isnull(StkPiece,0)>0) '; + SqlStr := SqlStr + ' and isnull(stkName,'''')=''' + Trim(FstkName) + ''''; + + if Trim(canshu4) <> '' then + SqlStr := SqlStr + ' and isnull(StkCoName,'''')=''' + Trim(canshu4) + ''''; + + SqlStr := SqlStr + ' group by C_Code,C_Name,C_Color,C_ColorNo,C_Degree,C_Pattern,QtyUnit,StkPosition'; + +// ShowMessage(SqlStr); + InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, SGetFilters(Panel1, 1, 2), 'C_Code'); + end; + 1: begin + if MWSql = '' then + WSql := CommonFiltersByContainer(panel1, ' {"EquTag": 1,"LikeTag": 2,"Fields": ""}') + else + WSql := MWSql; - InitGrid1(); + if trim(WSql) <> '' then + begin + WSql := WDateSql + ' and ' + trim(WSql); + end + else + WSql := WDateSql; + + SqlStr := 'exec P_Trade_Totalstk_Get_Page '; + SqlStr := SqlStr + ' @pageIndex=' + inttostr(CurrentPage); + SqlStr := SqlStr + ' ,@pageSize=' + inttostr(RecordsNumber); + SqlStr := SqlStr + ' ,@criteria= ' + quotedstr(WSql); + 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; end; @@ -239,7 +309,8 @@ end; procedure TfrmTradeClothTotalStkList.TBRafreshClick(Sender: TObject); begin - InitGrid2(); + InitGrid(''); +// InitGrid2(); end; procedure TfrmTradeClothTotalStkList.TBCloseClick(Sender: TObject); @@ -251,7 +322,8 @@ end; procedure TfrmTradeClothTotalStkList.FormShow(Sender: TObject); begin inherited; - + CurrentPage := 1; + RecordsNumber := 500; ReadCxGrid(trim(Self.Caption) + 'Tv1', Tv1, 'ó׻ֿܲ'); ReadCxGrid(trim(Self.Caption) + 'Tv2', Tv2, 'ó׻ֿܲ'); canshu4 := Trim(self.fParameters4); diff --git a/T03贸易布匹检验/DjdMachineInsp.dpr b/T03贸易布匹检验/DjdMachineInsp.dpr index f262757..f82111c 100644 --- a/T03贸易布匹检验/DjdMachineInsp.dpr +++ b/T03贸易布匹检验/DjdMachineInsp.dpr @@ -27,7 +27,7 @@ uses U_cxGridCustomSet in '..\..\..\public10\design\U_cxGridCustomSet.pas', U_LabelMapSet in '..\A00ͨô\U_LabelMapSet.pas' {frmLabelMapSet}, U_BaseDataLink in '..\..\..\public10\design\U_BaseDataLink.pas' {BaseDataLink: TDataModule}, - U_MachRollMain in 'U_MachRollMain.pas' {frmMachRollMain}, + U_MachRollMarket in 'U_MachRollMarket.pas' {frmMachRollMarket}, U_frameBads in 'U_frameBads.pas' {frameBads: TFrame}, U_frameParam in 'U_frameParam.pas' {FrameParam: TFrame}, U_ParamSet in 'U_ParamSet.pas' {frmParamSet}, diff --git a/T03贸易布匹检验/DjdMachineInsp.dproj b/T03贸易布匹检验/DjdMachineInsp.dproj index e721798..debdf6f 100644 --- a/T03贸易布匹检验/DjdMachineInsp.dproj +++ b/T03贸易布匹检验/DjdMachineInsp.dproj @@ -221,8 +221,8 @@ dfm TDataModule
- -
frmMachRollMain
+ +
frmMachRollMarket
dfm
diff --git a/T03贸易布匹检验/U_GetDllForm.pas b/T03贸易布匹检验/U_GetDllForm.pas index a8fab3d..2b2f20e 100644 --- a/T03贸易布匹检验/U_GetDllForm.pas +++ b/T03贸易布匹检验/U_GetDllForm.pas @@ -17,7 +17,7 @@ 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_DjdDjClList, U_TradeClothTotalCXJYOutList,U_MachRollMarket,U_MachRollMain_M; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -166,6 +166,17 @@ begin mnewHandle := Handle; end; end; + 11: //̨ + begin + 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; + WindowState := mstate; + BorderStyle := mborderstyle; + mnewHandle := Handle; + end; + end; 121: //ƥ begin diff --git a/T03贸易布匹检验/U_MachRollMain.dfm b/T03贸易布匹检验/U_MachRollMain.dfm index 4965419..8c9d123 100644 --- a/T03贸易布匹检验/U_MachRollMain.dfm +++ b/T03贸易布匹检验/U_MachRollMain.dfm @@ -643,7 +643,7 @@ inherited frmMachRollMain: TfrmMachRollMain DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 96 + Width = 65 end object TV2Column4: TcxGridDBColumn Caption = #23458#25143 @@ -651,7 +651,7 @@ inherited frmMachRollMain: TfrmMachRollMain DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 72 + Width = 58 end object TV2Column1: TcxGridDBColumn Caption = #20135#21697#32534#21495 @@ -659,7 +659,7 @@ inherited frmMachRollMain: TfrmMachRollMain DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 93 + Width = 85 end object TV2Column2: TcxGridDBColumn Caption = #33394#24067#21517#31216 @@ -682,7 +682,7 @@ inherited frmMachRollMain: TfrmMachRollMain Properties.ReadOnly = False HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 79 + Width = 64 end object TV2Column5: TcxGridDBColumn Caption = #33394#21495 @@ -714,7 +714,13 @@ inherited frmMachRollMain: TfrmMachRollMain PropertiesClassName = 'TcxTextEditProperties' HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 84 + Width = 68 + end + object TV2Column10: TcxGridDBColumn + Caption = #24212#37197#25968#37327 + DataBinding.FieldName = 'TMSQty' + DataBinding.IsNullValueType = True + Width = 76 end object v1OrderUnit: TcxGridDBColumn Caption = #24211#23384#21333#20301 @@ -727,7 +733,19 @@ inherited frmMachRollMain: TfrmMachRollMain 'Kg') HeaderAlignmentHorz = taCenter Options.Editing = False - Width = 110 + Width = 74 + end + object TV2Column6: TcxGridDBColumn + Caption = #35745#20215#21333#20301 + DataBinding.FieldName = 'TMSUnit' + DataBinding.IsNullValueType = True + Width = 75 + end + object TV2Column9: TcxGridDBColumn + Caption = #24050#37197#25968#37327 + DataBinding.FieldName = 'OutQty' + DataBinding.IsNullValueType = True + Width = 79 end object cxGridDBColumn7: TcxGridDBColumn Caption = #22791#27880 @@ -882,6 +900,13 @@ inherited frmMachRollMain: TfrmMachRollMain Options.Sorting = False Width = 112 end + object Tv3Column1: TcxGridDBColumn + Caption = #24211#20301 + DataBinding.FieldName = 'StkCoName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel2: TcxGridLevel GridView = Tv3 @@ -948,8 +973,8 @@ inherited frmMachRollMain: TfrmMachRollMain end end object cxGroupBox_keys: TcxGroupBox [2] - Left = 778 - Top = 61 + Left = 295 + Top = 321 Caption = #34394#25311#38190#30424 Style.LookAndFeel.NativeStyle = False StyleDisabled.LookAndFeel.NativeStyle = False @@ -972,6 +997,7 @@ inherited frmMachRollMain: TfrmMachRollMain inherited dxPanel1: TdxPanel Width = 323 Height = 257 + ExplicitTop = -3 ExplicitWidth = 323 ExplicitHeight = 257 inherited SpeedButton1: TSpeedButton diff --git a/T03贸易布匹检验/U_MachRollMain.pas b/T03贸易布匹检验/U_MachRollMain.pas index aab48ae..35c42b9 100644 --- a/T03贸易布匹检验/U_MachRollMain.pas +++ b/T03贸易布匹检验/U_MachRollMain.pas @@ -18,7 +18,7 @@ uses U_KeyBoard, cxGroupBox, cxGridCustomPopupMenu, cxGridPopupMenu, MovePanel, RM_RichEdit, cxProgressBar, cxCurrencyEdit, dxSkinsCore, frxBarcode, frxRich, frxOLE, frxTableObject, frxExportXLSX, frxClass, frxExportBaseDialog, - frxExportPPTX, frxDBSet, dxSkinWXI, dxSkinsDefaultPainters; + frxExportPPTX, frxDBSet, dxSkinWXI, dxSkinsDefaultPainters, System.StrUtils; type TfrmMachRollMain = class(TfrmBaseList) @@ -156,6 +156,10 @@ type Tlog: TToolButton; ToolButton8: TToolButton; ToolButton2: TButton; + Tv3Column1: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); @@ -181,7 +185,7 @@ type procedure Button1Click(Sender: TObject); private FCIID, FCIFName, FWorkshop: string; - FBCIOID, FC_Code, FC_ColorNo, FQtyUnit, FLenUnit: string; + FBCIOID, FC_Code, FC_ColorNo, FQtyUnit, FLenUnit, FTMSId, FTMMId: string; Faddwet, faddlen: double; FFtyPCId, FGangNo, FRulePieceNo, FCDUnit: string; FPieceNo: Integer; @@ -218,7 +222,7 @@ type public fmanage: string; - fFlileFlag: string; + fFlileFlag, FCKLX: string; //FCKLX վ end; var @@ -237,10 +241,19 @@ procedure TfrmMachRollMain.InitGrid2(); var SqlStr: string; begin + if FCKLX = '' then + begin + SqlStr := ' exec P_Trade_Market_WaitOut_Market '; + SqlStr := SqlStr + ' @TMSId =' + quotedstr(trim(FTMSId)); + end + else + begin + SqlStr := ' exec P_Trade_Market_WaitOut '; + SqlStr := SqlStr + ' @C_Code =' + quotedstr(trim(FC_Code)); + SqlStr := SqlStr + ' ,@C_ColorNo =' + quotedstr(trim(FC_ColorNo)); + end; - SqlStr := ' exec P_Trade_Market_WaitOut '; - SqlStr := SqlStr + ' @C_Code =' + quotedstr(trim(FC_Code)); - SqlStr := SqlStr + ' ,@C_ColorNo =' + quotedstr(trim(FC_ColorNo)); +// showmessage(SqlStr); InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, '', ''); end; @@ -641,16 +654,35 @@ end; procedure TfrmMachRollMain.InitPlan(MSubID: string); begin + if leftstr(MSubID, 2) = 'JS' then + begin + FCKLX := ''; + Button1.visible := false; + ToolButton2.visible := False; + end + else + begin + FCKLX := ''; + Button1.visible := true; + ToolButton2.visible := true; + end; + with ADOQueryBaseTemp do begin Close; SQL.Clear; - SQL.Add('EXEC P_Trade_Insp_Get_plan @BCIOID=''' + trim(MSubID) + ''''); + if FCKLX = '' then + begin + SQL.Add('EXEC P_Trade_Insp_Get_Market @TMSId=''' + trim(MSubID) + ''''); + end + else + begin + SQL.Add('EXEC P_Trade_Insp_Get_plan @BCIOID=''' + trim(MSubID) + ''''); + end; Open; if not IsEmpty then begin - FLenUnit := trim(ADOQueryBaseTemp.fieldbyName('LenUnit').AsString); if FLenUnit = '' then begin @@ -665,11 +697,10 @@ begin // fLabVolume := trim(ADOQueryBaseTemp.fieldbyName('LabVolume').AsString); SetUnit(FLenUnit); - FCDUnit := lblLenUnit.Caption; - + FTMSId := trim(fieldbyName('TMSId').AsString); + FTMMId := trim(fieldbyName('TMMId').AsString); FBCIOID := trim(fieldbyName('BCIOID').AsString); - FQtyUnit := trim(fieldbyName('QtyUnit').AsString); OrderNo.Text := trim(fieldbyName('FromOrdNo').AsString); CodeName.Text := trim(fieldbyName('C_Name').AsString); @@ -698,9 +729,6 @@ begin fTareType := ''; -// if fieldbyName('RuleYardstick').AsInteger > 0 then -// RuleYardstick.Text := trim(fieldbyName('RuleYardstick').AsString) -// else RuleYardstick.Text := '100'; packnote.Lines.Clear; @@ -990,15 +1018,31 @@ var begin try cds_3.DisableControls; - with ADOQueryMain do + if FCKLX = '' then begin - Close; - SQL.Clear; - SQL.Add('select A.*'); - SQL.Add('from Bs_Cloth_IO A where IOType=''۳'' and STKID=''' + trim(FBCIOID) + ''''); - SQL.Add('order by filltime desc'); - Open; + with ADOQueryMain do + begin + Close; + SQL.Clear; + SQL.Add('select A.*'); + SQL.Add('from Bs_Cloth_IO A where IOType=''۳'' and TMSId=''' + trim(FTMSId) + ''''); + SQL.Add('order by filltime desc'); + Open; + end; + end + else + begin + with ADOQueryMain do + begin + Close; + SQL.Clear; + SQL.Add('select A.*'); + SQL.Add('from Bs_Cloth_IO A where IOType=''۳'' and STKID=''' + trim(FBCIOID) + ''''); + SQL.Add('order by filltime desc'); + Open; + end; end; + SCreateCDS(ADOQueryMain, cds_3); SInitCDSData(ADOQueryMain, cds_3); @@ -1195,23 +1239,47 @@ begin MYardage := RoundFloat((MInputLen + maddLen + mPresentLen) / (mYardStick / 100), cds_params.fieldbyName('YPlace').AsInteger); MMeter := RoundFloat(MYardage * 0.9144, cds_params.fieldbyName('MPlace').AsInteger); end; - - with ADOQueryBaseCmd do + if FCKLX = '' then begin - Close; - sql.Clear; - Sql.Add('exec P_BS_Cloth_Out_Distribution '); - Sql.Add(' @GrossWeight=' + quotedstr(Trim(FloatToStr(MGrossWeight)))); - Sql.Add(' ,@Tare=' + quotedstr(Trim(FloatToStr(MTare)))); - Sql.Add(' ,@NetWeight=' + quotedstr(Trim(FloatToStr(MNetWeight)))); - Sql.Add(' ,@Meter=' + quotedstr(Trim(FloatToStr(MMeter)))); - Sql.Add(' ,@Yardage=' + quotedstr(Trim(FloatToStr(MYardage)))); - Sql.Add(' ,@StkID=' + quotedstr(Trim(FBCIOID))); - Sql.Add(' ,@TMSId =' + quotedstr(MTMSId)); - Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); - Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + Sql.Add('exec P_BS_Cloth_Out_Distribution_KC '); + Sql.Add(' @GrossWeight=' + quotedstr(Trim(FloatToStr(MGrossWeight)))); + Sql.Add(' ,@Tare=' + quotedstr(Trim(FloatToStr(MTare)))); + Sql.Add(' ,@NetWeight=' + quotedstr(Trim(FloatToStr(MNetWeight)))); + Sql.Add(' ,@Meter=' + quotedstr(Trim(FloatToStr(MMeter)))); + Sql.Add(' ,@Yardage=' + quotedstr(Trim(FloatToStr(MYardage)))); + Sql.Add(' ,@QtyUnit=' + quotedstr(Trim(lblLenUnit.caption))); + Sql.Add(' ,@StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(FTMSId)); + Sql.Add(' ,@TMMId =' + quotedstr(FTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); // ShowMessage(sql.Text); - open; + open; + end; + end + else + begin + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + Sql.Add('exec P_BS_Cloth_Out_Distribution '); + Sql.Add(' @GrossWeight=' + quotedstr(Trim(FloatToStr(MGrossWeight)))); + Sql.Add(' ,@Tare=' + quotedstr(Trim(FloatToStr(MTare)))); + Sql.Add(' ,@NetWeight=' + quotedstr(Trim(FloatToStr(MNetWeight)))); + Sql.Add(' ,@Meter=' + quotedstr(Trim(FloatToStr(MMeter)))); + Sql.Add(' ,@Yardage=' + quotedstr(Trim(FloatToStr(MYardage)))); + Sql.Add(' ,@StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(MTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); +// ShowMessage(sql.Text); + open; + end; end; if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then diff --git a/T03贸易布匹检验/U_MachRollMain_M.dfm b/T03贸易布匹检验/U_MachRollMain_M.dfm new file mode 100644 index 0000000..91c0cdb --- /dev/null +++ b/T03贸易布匹检验/U_MachRollMain_M.dfm @@ -0,0 +1,1334 @@ +inherited frmMachRollMain_M: TfrmMachRollMain_M + Caption = #26426#21488#37197#36135 + ClientHeight = 756 + ClientWidth = 1443 + Color = clBtnFace + Font.Charset = ANSI_CHARSET + Font.Height = -16 + FormStyle = fsMDIChild + Visible = True + ExplicitWidth = 1459 + ExplicitHeight = 795 + PixelsPerInch = 96 + TextHeight = 21 + object Panel1: TPanel [0] + Left = 0 + Top = 0 + Width = 499 + Height = 756 + Align = alLeft + TabOrder = 4 + object Label1: TLabel + Left = 15 + Top = 30 + Width = 64 + Height = 21 + Caption = #25195#25551#20837#21475 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label2: TLabel + Left = 31 + Top = 85 + Width = 48 + Height = 21 + Caption = #25351#31034#21333 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label3: TLabel + Left = 47 + Top = 119 + Width = 32 + Height = 21 + Caption = #33394#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label4: TLabel + Left = 15 + Top = 154 + Width = 64 + Height = 21 + Caption = #26579#21378#32568#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label5: TLabel + Left = 47 + Top = 188 + Width = 32 + Height = 21 + Caption = #25968#37327 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label6: TLabel + Left = 271 + Top = 85 + Width = 32 + Height = 21 + Caption = #21697#21517 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label7: TLabel + Left = 271 + Top = 119 + Width = 32 + Height = 21 + Caption = #39068#33394 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label8: TLabel + Left = 271 + Top = 154 + Width = 32 + Height = 21 + Caption = #21345#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label9: TLabel + Left = 33 + Top = 259 + Width = 42 + Height = 28 + Caption = #38271#24230 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -21 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object lblLenUnit: TLabel + Left = 250 + Top = 262 + Width = 16 + Height = 21 + Caption = 'M' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label10: TLabel + Left = 33 + Top = 318 + Width = 42 + Height = 28 + Caption = #37325#37327 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -21 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label11: TLabel + Left = 250 + Top = 321 + Width = 22 + Height = 21 + Caption = 'KG' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label12: TLabel + Left = 41 + Top = 388 + Width = 32 + Height = 21 + Caption = #31995#25968 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object edtScan: TcxTextEdit + Tag = 999 + Left = 85 + Top = 27 + Properties.CharCase = ecUpperCase + Style.HotTrack = False + Style.LookAndFeel.Kind = lfUltraFlat + Style.LookAndFeel.SkinName = 'WXI' + Style.TransparentBorder = False + StyleDisabled.LookAndFeel.Kind = lfUltraFlat + StyleDisabled.LookAndFeel.SkinName = 'WXI' + StyleFocused.LookAndFeel.Kind = lfUltraFlat + StyleFocused.LookAndFeel.SkinName = 'WXI' + StyleHot.LookAndFeel.Kind = lfUltraFlat + StyleHot.LookAndFeel.SkinName = 'WXI' + TabOrder = 0 + OnClick = edtScanEnter + OnDblClick = edtScanDblClick + OnKeyPress = edtScanKeyPress + Width = 384 + end + object OrderNo: TcxTextEdit + Left = 85 + Top = 81 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 1 + Width = 160 + end + object ColorNo: TcxTextEdit + Left = 85 + Top = 115 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 2 + Width = 160 + end + object FtyPCId: TcxTextEdit + Left = 85 + Top = 150 + Properties.ReadOnly = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 3 + OnClick = edtScanEnter + Width = 160 + end + object Qty: TcxTextEdit + Left = 85 + Top = 184 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 4 + Width = 160 + end + object BCIOID: TcxTextEdit + Left = 309 + Top = 150 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 5 + Width = 160 + end + object Color: TcxTextEdit + Left = 309 + Top = 115 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 6 + Width = 160 + end + object CodeName: TcxTextEdit + Left = 309 + Top = 81 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 7 + Width = 160 + end + object InputLen: TcxTextEdit + Tag = 999 + Left = 85 + Top = 255 + AutoSize = False + Properties.ReadOnly = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 8 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 158 + end + object InputWeight: TcxTextEdit + Tag = 999 + Left = 85 + Top = 314 + AutoSize = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 9 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 96 + end + object Tare: TcxTextEdit + Tag = 999 + Left = 187 + Top = 314 + AutoSize = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 10 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 57 + end + object BTPrint: TButton + Left = 309 + Top = 314 + Width = 150 + Height = 59 + Caption = #24320' '#35009 + TabOrder = 11 + OnClick = BTPrintClick + end + object Coefficient: TcxTextEdit + Tag = 999 + Left = 83 + Top = 381 + AutoSize = False + Properties.ReadOnly = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 12 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 84 + end + object lblRuleConversion: TcxComboBox + Tag = 2 + Left = 187 + Top = 381 + AutoSize = False + Properties.DropDownListStyle = lsEditFixedList + Properties.Items.Strings = ( + #26080#38656#36716#25442 + #38271#24230#36716#20844#26020 + #20928#37325#36716#38271#24230 + '') + Properties.OnChange = lblRuleConversionPropertiesChange + Style.HotTrack = False + Style.LookAndFeel.SkinName = 'WXI' + Style.TransparentBorder = False + StyleDisabled.LookAndFeel.SkinName = 'WXI' + StyleFocused.LookAndFeel.SkinName = 'WXI' + StyleHot.LookAndFeel.SkinName = 'WXI' + TabOrder = 13 + Text = #26080#38656#36716#25442 + Height = 35 + Width = 102 + end + object AOrdDefNote1: TcxRichEdit + Left = 33 + Top = 483 + Properties.ReadOnly = True + Properties.ScrollBars = ssBoth + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 14 + Height = 206 + Width = 181 + end + object packnote: TcxMemo + Tag = 999 + Left = 259 + Top = 483 + Properties.ReadOnly = True + Properties.ScrollBars = ssVertical + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 15 + Height = 206 + Width = 199 + end + object unitPieces: TcxTextEdit + Left = 632 + Top = 769 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 16 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object presentWeight: TcxTextEdit + Left = 632 + Top = 725 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 17 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object presentLen: TcxTextEdit + Left = 632 + Top = 703 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 18 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object bt_printmd: TButton + Left = 632 + Top = 681 + Width = 48 + Height = 33 + Caption = #30721#21333 + TabOrder = 19 + Visible = False + OnClick = bt_printmdClick + end + object addWet: TcxTextEdit + Left = 632 + Top = 659 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 20 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object addLen: TcxTextEdit + Left = 632 + Top = 637 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 21 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_GramWeight: TcxTextEdit + Left = 632 + Top = 615 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 22 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_Width: TcxTextEdit + Left = 632 + Top = 593 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 23 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object customStrField2: TcxTextEdit + Left = 632 + Top = 571 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 24 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object customStrField1: TcxTextEdit + Left = 632 + Top = 549 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 25 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_StyleNo: TcxTextEdit + Left = 680 + Top = 505 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 26 + Visible = False + Width = 168 + end + object RuleYardstick: TcxTextEdit + Left = 632 + Top = 505 + AutoSize = False + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 27 + Text = '100' + Visible = False + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 29 + Width = 69 + end + object C_Pattern: TcxTextEdit + Left = 632 + Top = 483 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 28 + Visible = False + Width = 124 + end + object OutPutWeight: TcxTextEdit + Tag = 999 + Left = 632 + Top = 439 + AutoSize = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 29 + Visible = False + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 44 + Width = 191 + end + object cxDBImage1: TcxDBImage + Left = 592 + Top = 263 + Hint = 'FileName' + DataBinding.DataField = 'FilesOther' + DataBinding.DataSource = DS_IMAGE + Properties.GraphicClassName = 'TdxSmartImage' + Properties.GraphicTransparency = gtTransparent + Properties.ReadOnly = True + Properties.ShowFocusRect = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 30 + Visible = False + Height = 122 + Width = 280 + end + object Button1: TButton + Left = 309 + Top = 244 + Width = 150 + Height = 59 + Caption = #20986' '#24211 + TabOrder = 31 + Visible = False + OnClick = Button1Click + end + object ToolButton2: TButton + Left = 309 + Top = 388 + Width = 150 + Height = 68 + Caption = #25171#21360#24211#23384#26631#31614 + TabOrder = 32 + Visible = False + OnClick = ToolButton2Click + end + end + object Panel_right: TPanel [1] + Left = 499 + Top = 0 + Width = 944 + Height = 756 + Align = alClient + Caption = 'Panel_right' + DoubleBuffered = False + ParentDoubleBuffered = False + TabOrder = 3 + object cxGrid2: TcxGrid + Left = 1 + Top = 1 + Width = 942 + Height = 421 + Align = alClient + TabOrder = 0 + 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 = '0' + Position = spFooter + end + item + Format = '0' + Position = spFooter + Column = v1PRTOrderQty + end + item + Format = '0' + Position = spFooter + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsSelection.CheckBoxVisibility = [cbvDataRow] + OptionsView.Footer = True + OptionsView.GroupByBox = False + object cxGridDBColumn1: TcxGridDBColumn + Tag = 99 + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 66 + end + object TV2Column3: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 96 + end + object TV2Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 72 + end + object TV2Column1: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'C_Code' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 93 + end + object TV2Column2: TcxGridDBColumn + Caption = #33394#24067#21517#31216 + DataBinding.FieldName = 'C_Name' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 91 + end + object v1PRTColor: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.ReadOnly = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 79 + end + object TV2Column5: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object TV2Column7: TcxGridDBColumn + Caption = #25253#21333#25968 + DataBinding.FieldName = 'OrderQty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 76 + end + object TV2Column8: TcxGridDBColumn + Caption = #25253#21333#21333#20301 + DataBinding.FieldName = 'OrderUnit' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 78 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #27424#21333#25968 + DataBinding.FieldName = 'OrderOweQty' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 84 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #24211#23384#21333#20301 + DataBinding.FieldName = 'TMSUnit' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxComboBoxProperties' + Properties.Items.Strings = ( + 'M' + 'Y' + 'Kg') + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 110 + end + object cxGridDBColumn7: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdSNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 66 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end + end + object Panel2: TPanel + Left = 1 + Top = 422 + Width = 942 + Height = 333 + Align = alBottom + TabOrder = 1 + object cxGrid3: TcxGrid + Tag = 9999 + Left = 1 + Top = 31 + Width = 940 + Height = 301 + Align = alClient + TabOrder = 0 + object Tv3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + OnCustomDrawCell = Tv3CustomDrawCell + DataController.DataSource = ds_3 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v3GrossWeight + end + item + Kind = skSum + Column = v3NetWeight + end + item + Format = #21367#25968':0' + Kind = skCount + Column = tv3CIID + end + item + Kind = skSum + end + item + Kind = skSum + Column = Tv3Yardage + end + item + Kind = skSum + Column = Tv3Meter + end + item + Kind = skSum + end + item + Kind = skCount + Column = v3PieceNo + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + object v3PieceNo: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'PieceNo' + DataBinding.IsNullValueType = True + FixedKind = fkLeftDynamic + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 71 + end + object Tv3Yardage: TcxGridDBColumn + Caption = #30721#25968 + DataBinding.FieldName = 'Yardage' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 69 + end + object Tv3Meter: TcxGridDBColumn + Caption = #31859#25968 + DataBinding.FieldName = 'Meter' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 79 + end + object v3NetWeight: TcxGridDBColumn + Caption = #20928#37325 + DataBinding.FieldName = 'NetWeight' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 62 + end + object v3GrossWeight: TcxGridDBColumn + Caption = #27611#37325 + DataBinding.FieldName = 'GrossWeight' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 61 + end + object Tv3Grade: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'Grade' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 54 + end + object tv3CIID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'BCIOID' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 112 + end + object Tv3Column1: TcxGridDBColumn + Caption = #24211#20301 + DataBinding.FieldName = 'StkCoName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGridLevel2: TcxGridLevel + GridView = Tv3 + end + end + object ToolBar2: TToolBar + Tag = 1000 + Left = 1 + Top = 1 + Width = 940 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 99 + Caption = 'ToolBar1' + DoubleBuffered = False + EdgeInner = esNone + EdgeOuter = esNone + Images = DataLink_TradeInsp.cxImageList_bar + List = True + ParentDoubleBuffered = False + ShowCaptions = True + TabOrder = 1 + object ToolButton3: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #37325#25171 + ImageIndex = 21 + OnClick = ToolButton3Click + end + object Trolldel: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 5 + OnClick = TrolldelClick + end + object ToolButton1: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #25171#21367#35774#32622 + ImageIndex = 25 + OnClick = ToolButton1Click + end + object Tlog: TToolButton + Left = 245 + Top = 0 + AutoSize = True + Caption = #26085#24535 + ImageIndex = 30 + end + object ToolButton8: TToolButton + Left = 316 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = ToolButton8Click + end + end + end + end + object cxGroupBox_keys: TcxGroupBox [2] + Left = 778 + Top = 61 + Caption = #34394#25311#38190#30424 + Style.LookAndFeel.NativeStyle = False + StyleDisabled.LookAndFeel.NativeStyle = False + TabOrder = 2 + Transparent = True + Visible = False + Height = 285 + Width = 327 + inline FrameKeyBoard1: TFrameKeyBoard + Left = 2 + Top = 26 + Width = 323 + Height = 257 + Align = alClient + TabOrder = 0 + ExplicitLeft = 2 + ExplicitTop = 26 + ExplicitWidth = 323 + ExplicitHeight = 257 + inherited dxPanel1: TdxPanel + Width = 323 + Height = 257 + ExplicitWidth = 323 + ExplicitHeight = 257 + inherited SpeedButton1: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton4: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton7: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton2: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton5: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton8: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton3: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton6: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton9: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_back: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton0: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_dot: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_yc: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton_ycClick + end + inherited SpeedButton_zdykey2: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_zdykey1: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton10: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + end + end + object MovePanel1: TMovePanel + Left = 79 + Top = -28 + Width = 237 + Height = 45 + BevelOuter = bvNone + DockSite = True + ParentBackground = False + TabOrder = 1 + end + end + inherited loadProcess: TPanel + Left = 560 + Top = 326 + Width = 177 + ExplicitLeft = 560 + ExplicitTop = 326 + ExplicitWidth = 177 + end + inherited cxProgressBar2: TcxProgressBar + Left = 560 + Top = 238 + ExplicitLeft = 560 + ExplicitTop = 238 + ExplicitHeight = 29 + end + inherited ADOQueryBaseCmd: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + Left = 456 + Top = 311 + end + inherited ADOQueryBaseTemp: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + Left = 539 + Top = 311 + end + object cds_params: TClientDataSet + Aggregates = <> + Params = <> + Left = 788 + Top = 361 + object cds_paramsdabao: TStringField + FieldName = 'dabao' + Size = 10 + end + object cds_paramspackRolls: TIntegerField + FieldName = 'packRolls' + end + object cds_paramsrollNoMake: TStringField + FieldName = 'rollNoMake' + end + object cds_paramsMinWeight: TIntegerField + FieldName = 'MinWeight' + end + object cds_paramsMaxWeight: TIntegerField + FieldName = 'MaxWeight' + end + object cds_paramslblLenUnit: TStringField + FieldName = 'lblLenUnit' + end + object cds_paramsMinLen: TIntegerField + FieldName = 'MinLen' + end + object cds_paramsmaxLen: TIntegerField + FieldName = 'maxLen' + end + object cds_paramsweightRule: TIntegerField + FieldName = 'weightRule' + end + object cds_paramschen: TStringField + FieldName = 'chen' + Size = 10 + end + object cds_paramsmabiao: TStringField + FieldName = 'mabiao' + end + object cds_paramsmbunit: TStringField + FieldName = 'mbunit' + end + object cds_paramsmplace: TIntegerField + FieldName = 'mplace' + end + object cds_paramsyplace: TIntegerField + FieldName = 'yplace' + end + object cds_paramskgplace: TIntegerField + FieldName = 'kgplace' + end + object cds_paramslabNumber: TIntegerField + FieldName = 'labNumber' + end + object cds_paramsoutPage: TStringField + FieldName = 'outPage' + Size = 10 + end + object cds_paramsEndPieceNo: TIntegerField + FieldName = 'EndPieceNo' + end + object cds_paramsBeginPieceNo: TIntegerField + FieldName = 'BeginPieceNo' + end + object cds_paramsFixedLength: TIntegerField + FieldName = 'FixedLength' + end + object cds_paramspacknoMake: TStringField + FieldName = 'packnoMake' + Size = 30 + end + object cds_paramspieceOrder: TBooleanField + FieldName = 'pieceOrder' + end + object cds_paramsLabVolume: TStringField + FieldName = 'LabVolume' + Size = 60 + end + object cds_paramsLabPackage: TStringField + FieldName = 'LabPackage' + Size = 60 + end + object cds_paramsAddwetPresent: TFloatField + FieldName = 'AddwetPresent' + end + object cds_paramsAddLenPresent: TFloatField + FieldName = 'AddLenPresent' + end + object cds_paramspackPrintPreview: TBooleanField + FieldName = 'packPrintPreview' + end + object cds_paramspacklabNumber: TIntegerField + FieldName = 'packlabNumber' + end + object cds_paramspackPostAction: TStringField + FieldName = 'packPostAction' + end + end + object CDS_2: TClientDataSet + Aggregates = <> + Params = <> + Left = 622 + Top = 361 + end + object DS_2: TDataSource + DataSet = CDS_2 + Left = 622 + Top = 411 + end + object cds_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 539 + Top = 361 + end + object cds_3: TClientDataSet + Aggregates = <> + Params = <> + Left = 705 + Top = 361 + end + object ds_3: TDataSource + DataSet = cds_3 + Left = 705 + Top = 411 + end + object ds_1: TDataSource + DataSet = cds_1 + Left = 539 + Top = 411 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 705 + Top = 311 + end + object ADOQueryPrint: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 788 + Top = 311 + end + object GPM_3: TcxGridPopupMenu + PopupMenus = <> + Left = 456 + Top = 411 + end + object ADOQueryImage: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + CommandTimeout = 300 + Parameters = <> + Left = 622 + Top = 303 + end + object DS_IMAGE: TDataSource + DataSet = ADOQueryImage + Left = 788 + Top = 411 + end + object ADO_CJ: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 456 + Top = 361 + end + object fRMDB_1: TfrxDBDataset + UserName = 'fRMDB_1' + CloseDataSource = False + DataSet = ADOQueryPrint + BCDToCurrency = False + Left = 539 + Top = 461 + end + object frxReport1: TfrxReport + Version = '6.9.12' + DataSet = fRMDB_1 + DataSetName = 'fRMDB_1' + DotMatrixReport = False + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick, pbCopy, pbSelection] + PreviewOptions.Zoom = 1.000000000000000000 + PrintOptions.Printer = 'Default' + PrintOptions.PrintOnSheet = 0 + ReportOptions.CreateDate = 45471.682319444440000000 + ReportOptions.LastChange = 45471.682319444440000000 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'begin' + '' + 'end.') + ShowProgress = False + Left = 788 + Top = 461 + Datasets = <> + Variables = <> + Style = <> + object Data: TfrxDataPage + Height = 1000.000000000000000000 + Width = 1000.000000000000000000 + end + object Page1: TfrxReportPage + PaperWidth = 70.000000000000000000 + PaperHeight = 50.000000000000000000 + PaperSize = 256 + LeftMargin = 10.000000000000000000 + RightMargin = 10.000000000000000000 + TopMargin = 10.000000000000000000 + BottomMargin = 10.000000000000000000 + Frame.Typ = [] + MirrorMode = [] + end + end + object frxPPTXExport1: TfrxPPTXExport + UseFileCache = True + ShowProgress = True + OverwritePrompt = False + DataOnly = False + OpenAfterExport = False + PictureType = gpPNG + Left = 705 + Top = 461 + end + object frxXLSXExport1: TfrxXLSXExport + UseFileCache = True + ShowProgress = True + OverwritePrompt = False + DataOnly = False + ChunkSize = 0 + OpenAfterExport = False + PictureType = gpPNG + Left = 622 + Top = 511 + end + object frxReportTableObject1: TfrxReportTableObject + Left = 456 + Top = 511 + end + object frxOLEObject1: TfrxOLEObject + Left = 622 + Top = 461 + end + object frxRichObject1: TfrxRichObject + Left = 539 + Top = 511 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 456 + Top = 461 + end + object ADO_2: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 884 + Top = 383 + end +end diff --git a/T03贸易布匹检验/U_MachRollMain_M.pas b/T03贸易布匹检验/U_MachRollMain_M.pas new file mode 100644 index 0000000..a007144 --- /dev/null +++ b/T03贸易布匹检验/U_MachRollMain_M.pas @@ -0,0 +1,1389 @@ +unit U_MachRollMain_M; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, mmsystem, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, + cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxClasses, + dxLayoutContainer, dxLayoutControl, dxLayoutcxEditAdapters, cxContainer, + cxEdit, Vcl.StdCtrls, cxTextEdit, Vcl.ExtCtrls, dxLayoutControlAdapters, + U_BaseList, Data.DB, Data.Win.ADODB, Vcl.Buttons, Vcl.ComCtrls, Vcl.ToolWin, + cxImage, cxDBEdit, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, + cxNavigator, dxDateRanges, dxScrollbarAnnotations, cxDBData, dxBarBuiltInMenu, + cxPC, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGridCustomView, cxGrid, cxMemo, cxRichEdit, U_frameBads, Datasnap.DBClient, + RM_Common, RM_Class, RM_GridReport, cxCheckBox, cxMaskEdit, cxDropDownEdit, + Vcl.Menus, cxButtonEdit, RM_Dataset, cxGeometry, dxFramedControl, dxPanel, + U_KeyBoard, cxGroupBox, cxGridCustomPopupMenu, cxGridPopupMenu, MovePanel, + RM_RichEdit, cxProgressBar, cxCurrencyEdit, dxSkinsCore, frxBarcode, frxRich, + frxOLE, frxTableObject, frxExportXLSX, frxClass, frxExportBaseDialog, + frxExportPPTX, frxDBSet, dxSkinWXI, dxSkinsDefaultPainters; + +type + TfrmMachRollMain_M = class(TfrmBaseList) + Panel_right: TPanel; + cds_params: TClientDataSet; + cds_paramsdabao: TStringField; + cds_paramspackRolls: TIntegerField; + cds_paramsrollNoMake: TStringField; + cds_paramsMinWeight: TIntegerField; + cds_paramsMaxWeight: TIntegerField; + cds_paramslblLenUnit: TStringField; + cds_paramsMinLen: TIntegerField; + cds_paramsmaxLen: TIntegerField; + cds_paramsweightRule: TIntegerField; + cds_paramschen: TStringField; + cds_paramsmabiao: TStringField; + cds_paramsmbunit: TStringField; + cds_paramsmplace: TIntegerField; + cds_paramsyplace: TIntegerField; + cds_paramskgplace: TIntegerField; + cds_paramslabNumber: TIntegerField; + CDS_2: TClientDataSet; + DS_2: TDataSource; + cds_1: TClientDataSet; + cds_3: TClientDataSet; + ds_3: TDataSource; + ds_1: TDataSource; + ADOQueryMain: TADOQuery; + cds_paramsoutPage: TStringField; + ADOQueryPrint: TADOQuery; + cds_paramsEndPieceNo: TIntegerField; + cds_paramsBeginPieceNo: TIntegerField; + cds_paramsFixedLength: TIntegerField; + cds_paramspacknoMake: TStringField; + cds_paramspieceOrder: TBooleanField; + cds_paramsLabVolume: TStringField; + cds_paramsLabPackage: TStringField; + cxGroupBox_keys: TcxGroupBox; + FrameKeyBoard1: TFrameKeyBoard; + cds_paramsAddwetPresent: TFloatField; + cds_paramsAddLenPresent: TFloatField; + GPM_3: TcxGridPopupMenu; + MovePanel1: TMovePanel; + ADOQueryImage: TADOQuery; + DS_IMAGE: TDataSource; + cds_paramspackPrintPreview: TBooleanField; + cds_paramspacklabNumber: TIntegerField; + cds_paramspackPostAction: TStringField; + ADO_CJ: TADOQuery; + fRMDB_1: TfrxDBDataset; + frxReport1: TfrxReport; + frxPPTXExport1: TfrxPPTXExport; + frxXLSXExport1: TfrxXLSXExport; + frxReportTableObject1: TfrxReportTableObject; + frxOLEObject1: TfrxOLEObject; + frxRichObject1: TfrxRichObject; + frxBarCodeObject1: TfrxBarCodeObject; + cxGrid2: TcxGrid; + TV2: TcxGridDBTableView; + cxGridDBColumn1: TcxGridDBColumn; + TV2Column1: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + v1PRTColor: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGridDBColumn7: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + ADO_2: TADOQuery; + TV2Column5: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + Panel1: TPanel; + edtScan: TcxTextEdit; + Label1: TLabel; + OrderNo: TcxTextEdit; + ColorNo: TcxTextEdit; + FtyPCId: TcxTextEdit; + Qty: TcxTextEdit; + BCIOID: TcxTextEdit; + Color: TcxTextEdit; + CodeName: TcxTextEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + InputLen: TcxTextEdit; + lblLenUnit: TLabel; + Label10: TLabel; + InputWeight: TcxTextEdit; + Tare: TcxTextEdit; + Label11: TLabel; + BTPrint: TButton; + Coefficient: TcxTextEdit; + lblRuleConversion: TcxComboBox; + Label12: TLabel; + AOrdDefNote1: TcxRichEdit; + packnote: TcxMemo; + unitPieces: TcxTextEdit; + presentWeight: TcxTextEdit; + presentLen: TcxTextEdit; + bt_printmd: TButton; + addWet: TcxTextEdit; + addLen: TcxTextEdit; + C_GramWeight: TcxTextEdit; + C_Width: TcxTextEdit; + customStrField2: TcxTextEdit; + customStrField1: TcxTextEdit; + C_StyleNo: TcxTextEdit; + RuleYardstick: TcxTextEdit; + C_Pattern: TcxTextEdit; + OutPutWeight: TcxTextEdit; + cxDBImage1: TcxDBImage; + Button1: TButton; + TV2Column8: TcxGridDBColumn; + Panel2: TPanel; + cxGrid3: TcxGrid; + Tv3: TcxGridDBTableView; + v3PieceNo: TcxGridDBColumn; + Tv3Yardage: TcxGridDBColumn; + Tv3Meter: TcxGridDBColumn; + v3NetWeight: TcxGridDBColumn; + v3GrossWeight: TcxGridDBColumn; + Tv3Grade: TcxGridDBColumn; + tv3CIID: TcxGridDBColumn; + cxGridLevel2: TcxGridLevel; + ToolBar2: TToolBar; + ToolButton3: TToolButton; + Trolldel: TToolButton; + ToolButton1: TToolButton; + Tlog: TToolButton; + ToolButton8: TToolButton; + ToolButton2: TButton; + Tv3Column1: TcxGridDBColumn; + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure edtScanDblClick(Sender: TObject); + procedure edtScanKeyPress(Sender: TObject; var Key: Char); + procedure ToolButton8Click(Sender: TObject); + procedure edtScanEnter(Sender: TObject); + procedure BTPrintClick(Sender: TObject); + procedure TrolldelClick(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure InputLenKeyPress(Sender: TObject; var Key: Char); + procedure InputLenPropertiesChange(Sender: TObject); + procedure FrameKeyBoard1SpeedButton_ycClick(Sender: TObject); + procedure dxLayoutItem1CaptionClick(Sender: TObject); + procedure lblRuleConversionPropertiesChange(Sender: TObject); + procedure bt_printmdClick(Sender: TObject); + procedure dxLayoutControl_packDblClick(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure FrameKeyBoard1SpeedButton1Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + private + FCIID, FCIFName, FWorkshop: string; + FBCIOID, FC_Code, FC_ColorNo, FQtyUnit, FLenUnit: string; + Faddwet, faddlen: double; + FFtyPCId, FGangNo, FRulePieceNo, FCDUnit, FTMSId, FTMMId: string; + FPieceNo: Integer; + fIsPack: string; + fIsCommopen: Boolean; + FPacketCIID: string; + fLabPackage, fLabVolume: string; + FPacketCount: Integer; + fAddwetVirtual: double; + fAddLenVirtual: double; + fTareType: string; + funitPiecesStr: string; //ƴƥ + procedure setFocusCtrol(controlName: string); + procedure QuantityConversion(); + procedure ClearGlobal(); + procedure InitPlan(MSubID: string); + procedure SetUnit(MUnit: string); + procedure SetDdetails(); + procedure SetINIFile(); + procedure GetINIFile(); + procedure InitJYGrid(); + procedure InitGrid2(); + procedure OpenCom(DllName: string); + procedure CloseCom(DllName: string); + function SaveData(): Boolean; + procedure PrtData(MCIID: string; againPring: Boolean = false); + procedure BadSpeedButtonClick(Sender: TObject); + procedure setFormCtrol(); + procedure On1201(var Message: Tmessage); message 1201; // ӳ + procedure On1301(var Message: Tmessage); message 1301; // + function CheckData(CKType: string): Boolean; + function deletePack(packId: string): boolean; + type + + public + fmanage: string; + fFlileFlag: string; + end; + +var + frmMachRollMain_M: TfrmMachRollMain_M; + newh, newh1: hwnd; + +implementation + +uses + U_DataLink, U_ControlData, U_ParamSet, U_RTFun, U_globalVar, + U_FormLayOutDesign, U_ZDYHelp, U_iniParam, U_ProductListHelp, U_SysLogList, + U_ProgressUpdate, U_LabelPrint, U_TradeClothTotalOutSel; +{$R *.dfm} + +procedure TfrmMachRollMain_M.InitGrid2(); +var + SqlStr: string; +begin + + SqlStr := ' exec P_Trade_Market_WaitOut_Market '; + SqlStr := SqlStr + ' @TMSId =' + quotedstr(trim(FTMSId)); +// showmessage(SqlStr); + InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, '', ''); +end; + +function TfrmMachRollMain_M.CheckData(CKType: string): Boolean; +var + mvalue: double; + mCurPieceNo: Integer; +begin + Result := false; + + try + if trim(FTMSId) = '' then + raise Exception.create('ɨ̿'); + + if trim(CKType) = 'ύ' then + begin + + if trim(lblLenUnit.Caption) = '' then + raise Exception.create('ȵλΪ!'); + + if trim(InputWeight.Text) <> '' then + begin + if TryStrToFloat(InputWeight.Text, mvalue) = false then + raise Exception.create('¼!'); + if strtofloatdef(trim(InputWeight.Text), 0) < cds_params.fieldbyName('minWeight').AsInteger then + raise Exception.create('С' + cds_params.fieldbyName('minWeight').AsString + '!'); + if strtofloatdef(trim(InputWeight.Text), 0) > cds_params.fieldbyName('maxWeight').AsInteger then + raise Exception.create('ܴ' + cds_params.fieldbyName('maxWeight').AsString + '!'); + end; + + if trim(InputLen.Text) <> '' then + begin + if TryStrToFloat(InputLen.Text, mvalue) = false then + raise Exception.create('¼!'); + if strtofloatdef(trim(InputLen.Text), 0) < cds_params.fieldbyName('minLen').AsInteger then + raise Exception.create('ȲС' + cds_params.fieldbyName('minLen').AsString + '!'); + if strtofloatdef(trim(InputLen.Text), 0) > cds_params.fieldbyName('maxLen').AsInteger then + raise Exception.create('Ȳܴ' + cds_params.fieldbyName('maxLen').AsString + '!'); + end; + + if FQtyUnit = 'Kg' then + begin + if (strtofloatdef(trim(InputWeight.Text), 0) = 0) then + raise Exception.create('Ϊ0!!'); + end + else + begin + if (strtofloatdef(trim(InputLen.Text), 0) = 0) then + raise Exception.create('ȲΪ0!!'); + end; + + end; + Result := true; + except + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + +procedure TfrmMachRollMain_M.BTPrintClick(Sender: TObject); +var + fPrintFile, MPacketId: string; + mvalue: double; + i: Integer; +begin + try + BTPrint.Enabled := false; + + edtScan.SetFocus; + + if CheckData('ύ') = false then + exit; + + if SaveData() then + begin + InputLen.Text := ''; + presentLen.Text := ''; + funitPiecesStr := ''; + presentWeight.Text := ''; + + if fileexists(ExtractFilePath(Application.ExeName) + 'ȷ.wav') then + playSound(pwidechar('ȷ.wav'), 0, SND_FILENAME or SND_ASYNC); + + InputWeight.Text := ''; + + if trim(cds_params.fieldbyName('outPage').AsString) = '' then + begin + PrtData(FCIID); + end; + + end; + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + InitJYGrid(); + InitGrid2(); + FCIID := ''; + finally + BTPrint.Enabled := true; + end; +end; + +procedure TfrmMachRollMain_M.bt_printmdClick(Sender: TObject); +var + WSql: string; +begin + if cds_3.IsEmpty then + Exit; + + WSql := ''; + cds_3.DisableControls; + with cds_3 do + begin + First; + while not Eof do + begin + + if WSql <> '' then + begin + WSql := WSql + ',' + Trim(cds_3.fieldbyname('CIID').AsString); + end + else + begin + WSql := Trim(cds_3.fieldbyname('CIID').AsString); + end; + + Next; + end; + end; + + cds_3.EnableControls; +// try +// frmMdPrint := TfrmMdPrint.Create(Application); +// with frmMdPrint do +// begin +// FLMType := '뵥'; +// FFiltration1 := WSql; +// FFiltration2 := WSql; +// if ShowModal = 1 then +// begin +//// Self.InitGrid(); +// end; +// end; +// finally +// frmMdPrint.Free; +// end; + try + frmLabelPrint := TfrmLabelPrint.Create(Application); + with frmLabelPrint do + begin + FLMType := '뵥'; + FFiltration1 := WSql; + if ShowModal = 1 then + begin +// Self.InitGrid(); + end; + end; + finally + frmLabelPrint.Free; + end; +end; + +procedure TfrmMachRollMain_M.Button1Click(Sender: TObject); +var + fPrintFile, MPacketId, MTMSId: string; + mvalue: double; + i: Integer; +begin + try + BTPrint.Enabled := false; + MTMSId := Trim(SelTVKey(Tv2, ['TMSId'])[0]); + edtScan.SetFocus; + + try + ADOQueryBaseCmd.Connection.BeginTrans; + + if trim(FBCIOID) = '' then + raise Exception.create('ɨ̿'); + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + Sql.Add('exec P_BS_Cloth_Out_DistributionAll '); + Sql.Add(' @StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(MTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); +// showmessage(sql.Text); + open; + end; + + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + + FCIID := trim(trim(ADOQueryBaseCmd.fieldbyName('MaxIOID2').AsString)); + + ADOQueryBaseCmd.Connection.CommitTrans; + TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + InitJYGrid(); + InitGrid2(); + FCIID := ''; + finally + BTPrint.Enabled := true; + end; +end; + +procedure TfrmMachRollMain_M.FormClose(Sender: TObject; var Action: TCloseAction); +begin + inherited; + if fIsCommopen then + begin + CloseCom(DZCDYDllName); + CloseCom(MBDYDllName); + end; + Action := caFree; +end; + +procedure TfrmMachRollMain_M.FormCreate(Sender: TObject); +begin + inherited; + fIsCommopen := false; + cds_params.Close; + cds_params.CreateDataSet; + Panel_right.Align := alClient; +end; + +procedure TfrmMachRollMain_M.FormDestroy(Sender: TObject); +begin + inherited; + frmMachRollMain_M := nil; +end; + +procedure TfrmMachRollMain_M.FormShow(Sender: TObject); +var + i: Integer; +begin + inherited; + gIsCanDesign := gIsCanDesign; + gGridNativeSet := true; + + ReadCxGrid(trim(Self.Caption) + 'Tv3', Tv3, gDllFileCaption); + + if IsINIFile() then + ReadINIFile() + else + WriteINIFile; + + GetINIFile(); + setFormCtrol(); + if trim(fmanage) <> 'Ȩ' then + begin + if trim(DZCDYDllName) <> '' then + OpenCom(DZCDYDllName); + if trim(MBDYDllName) <> '' then + OpenCom(MBDYDllName); + + end; + if trim(fCanInputFs) = '1' then + begin +// cxGroupBox_keys.ClientHeight := round(cxGrid3.ClientHeight * 0.6); + frameKeyBoard1.SpeedButton10.Visible := true; + end + else + begin +// cxGroupBox_keys.ClientHeight := round(cxGrid3.ClientHeight * 0.55); + frameKeyBoard1.SpeedButton10.Visible := false; + end; +end; + +procedure TfrmMachRollMain_M.FrameKeyBoard1SpeedButton1Click(Sender: TObject); +var + fsj: string; + mComponent: TComponent; + mkey: Char; +begin + fsj := trim(TSpeedButton(Sender).Hint); + if trim(fsj) = '' then + exit; + mComponent := FindComponent(trim(TSpeedButton(Sender).Hint)); + + if mComponent = nil then + exit; + if TcxTextEdit(mComponent).Name = 'KuangHao' then + exit; + if (TcxTextEdit(mComponent).Name = 'edtScan') and (trim(TSpeedButton(Sender).Caption) = 'س') then + begin + mkey := #13; + edtScanKeyPress(edtScan, mkey); + exit; + end; + fsj := trim(TcxTextEdit(mComponent).Text); + if mComponent is TcxCurrencyEdit then + begin + TcxCurrencyEdit(mComponent).text := fsj + trim(TSpeedButton(Sender).Caption); + TcxCurrencyEdit(mComponent).SelectAll; + end + else if mComponent is TcxTextEdit then + begin + TcxTextEdit(mComponent).Text := fsj + trim(TSpeedButton(Sender).Caption); + TcxTextEdit(mComponent).SelectAll; + end + else if mComponent is TcxComboBox then + begin + TcxComboBox(mComponent).Text := fsj + trim(TSpeedButton(Sender).Caption); + TcxComboBox(mComponent).SelectAll; + end; + +end; + +procedure TfrmMachRollMain_M.FrameKeyBoard1SpeedButton_ycClick(Sender: TObject); +begin + inherited; + cxGroupBox_keys.Visible := false; +end; + +procedure TfrmMachRollMain_M.ClearGlobal(); +begin + FBCIOID := ''; + + FQtyUnit := ''; + + FCIID := ''; + FWorkshop := ''; + InputLen.Text := ''; + Coefficient.Text := ''; + AOrdDefNote1.Text := ''; + Tare.Text := ''; + InputWeight.Text := ''; + FLenUnit := ''; + Faddwet := 0; + faddlen := 0; + FPacketCIID := ''; + FPacketCount := 0; + FC_ColorNo := ''; + FC_Code := ''; +end; + +procedure TfrmMachRollMain_M.QuantityConversion(); +begin + // if trim(OrderNo.Text)='' then exit; + + if cds_params.fieldbyName('weightRule').AsInteger = 0 then + // InputWeight ë OutPutWeight + begin + if lblRuleConversion.Text <> 'ת' then + begin + if lblRuleConversion.Text = 'ת' then + begin + InputWeight.Text := floattostr(strtofloatdef(trim(InputLen.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0) + strtofloatdef(trim(Tare.Text), 0)); + end; + if lblRuleConversion.Text = 'ëת' then + begin + InputLen.Text := floattostr(strtofloatdef(trim(InputWeight.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ת' then + begin + InputLen.Text := floattostr((RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), 1) - strtofloatdef(trim(Tare.Text), 0)) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + end; + if strtofloatdef(trim(InputWeight.Text), 0) > 0 then + begin + OutPutWeight.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) - strtofloatdef(trim(Tare.Text), 0))); // + end; + end; + + if cds_params.fieldbyName('weightRule').AsInteger = 1 then + // InputWeight OutPutWeight ë + begin + if lblRuleConversion.Text <> 'ת' then + begin + if lblRuleConversion.Text = 'ת' then + begin + InputWeight.Text := floattostr(strtofloatdef(trim(InputLen.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ëת' then + begin + InputLen.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) + strtofloatdef(trim(Tare.Text), 0)) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ת' then + begin + InputLen.Text := floattostr(RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), 1) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + end; + if strtofloatdef(trim(InputWeight.Text), 0) > 0 then + begin + OutPutWeight.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) + strtofloatdef(trim(Tare.Text), 0))); // ë + end; + end; + +end; + +procedure TfrmMachRollMain_M.InitPlan(MSubID: string); +begin + with ADOQueryBaseTemp do + begin + Close; + SQL.Clear; + SQL.Add('EXEC P_Trade_Insp_Get_Market @TMSId=''' + trim(MSubID) + ''''); + Open; + + if not IsEmpty then + begin + + FLenUnit := trim(ADOQueryBaseTemp.fieldbyName('LenUnit').AsString); + if FLenUnit = '' then + begin + FLenUnit := 'M'; + end; + + fLabPackage := 'Ĭϰǩ'; + fLabVolume := 'ͻǩ'; + + +// fLabPackage := trim(ADOQueryBaseTemp.fieldbyName('LabPackage').AsString); +// fLabVolume := trim(ADOQueryBaseTemp.fieldbyName('LabVolume').AsString); + + SetUnit(FLenUnit); + + FCDUnit := lblLenUnit.Caption; + +// FBCIOID := trim(fieldbyName('BCIOID').AsString); + FTMSId := trim(fieldbyName('TMSId').AsString); + FTMMId := trim(fieldbyName('TMMId').AsString); + FQtyUnit := trim(fieldbyName('OrderUnit').AsString); + OrderNo.Text := trim(fieldbyName('BuyOrdNo').AsString); + CodeName.Text := trim(fieldbyName('C_Name').AsString); + C_width.Text := trim(fieldbyName('C_width').AsString); + C_GramWeight.Text := trim(fieldbyName('C_GramWeight').AsString); + ColorNo.Text := trim(fieldbyName('C_ColorNo').AsString); + Color.Text := trim(fieldbyName('C_Color').AsString); + C_Pattern.Text := trim(fieldbyName('C_Pattern').AsString); +// FFtyPCId := trim(fieldbyName('FtyPCId').AsString); + FC_Code := trim(fieldbyName('C_Code').AsString); + FC_ColorNo := trim(fieldbyName('C_ColorNo').AsString); + cds_params.Edit; + cds_params.fieldbyName('outPage').value := ''; + cds_params.Post; + +// Coefficient.Text := trim(fieldbyName('Coefficient').AsString); + // תϵ +// lblRuleConversion.ItemIndex := lblRuleConversion.Properties.Items.IndexOf(fieldbyName('RuleConversion').AsString); + + FtyPCId.Text := FFtyPCId; + BCIOID.Text := FBCIOID; + + Qty.Text := trim(fieldbyName('OrderQty').AsString) + trim(fieldbyName('OrderUnit').AsString); + +// Tare.Text := trim(fieldbyName('RuleLaterTare').AsString); + + fTareType := ''; + +// if fieldbyName('RuleYardstick').AsInteger > 0 then +// RuleYardstick.Text := trim(fieldbyName('RuleYardstick').AsString) +// else + RuleYardstick.Text := '100'; + + packnote.Lines.Clear; + + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + SetDdetails(); + end + else + begin + // ClearGlobal(); + application.MessageBox('쳣,ϢǷδ״̬!', 'Ϣ'); + end; + end; + InitJYGrid(); + + edtScan.Text := ''; + + // ʾ + setFormCtrol(); + +end; + +procedure TfrmMachRollMain_M.InputLenKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + Key := #0; + SelectNext(ActiveControl as TWinControl, true, true); + end; + +end; + +procedure TfrmMachRollMain_M.InputLenPropertiesChange(Sender: TObject); +begin + + // if StrToIntDef(trim(InputWeight.Text), 0) = 0 then + // begin + // exit; + // end; + QuantityConversion(); +end; + +procedure TfrmMachRollMain_M.lblRuleConversionPropertiesChange(Sender: TObject); +begin + inherited; + if lblRuleConversion.Text = 'ת' then + begin + OutPutWeight.Text := ''; + InputLen.Text := ''; + InputWeight.Text := ''; + end; + QuantityConversion(); +end; + +procedure TfrmMachRollMain_M.SetUnit(MUnit: string); +begin + + lblLenUnit.Caption := MUnit; + +end; + +procedure TfrmMachRollMain_M.ToolButton1Click(Sender: TObject); +begin + + frmParamSet := TfrmParamSet.create(Self); + with frmParamSet do + begin + cds_params.Data := Self.cds_params.Data; + if ShowModal = 1 then + begin + Self.cds_params.Data := cds_params.Data; + setFormCtrol(); + end; + free; + end; + SetINIFile(); + if trim(fmanage) <> 'Ȩ' then + begin + if (trim(MBDYDllName) <> '') and not fIsCommopen then + OpenCom(MBDYDllName); + + end; +end; + +procedure TfrmMachRollMain_M.ToolButton2Click(Sender: TObject); +var + fPrintFile: string; + Txt, fImagePath, Txt2, fImagePath2: string; + Moudle: Thandle; + Makebar: TMakebar; + Mixtext: TMixtext; +begin + with ADOQueryPrint do + begin + Close; + SQL.Clear; + SQL.Add(' EXEC P_BS_Cloth_Prt2 '); + SQL.Add(' @Filtration=''' + trim(FCIID) + ''''); + Open; + end; + if ADOQueryPrint.IsEmpty then + begin + Application.MessageBox('ǩδҵ', 'ʾϢ', MB_ICONERROR); + exit; + end; + + ExportFtErpFile('ǩ.fr3', ADOQueryBaseTemp); + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ǩ.fr3'; + if FileExists(fPrintFile) then + begin + + frxReport1.LoadFromFile(fPrintFile); + frxReport1.PrintOptions.Copies := cds_params.fieldbyName('labNumber').AsInteger; + frxReport1.PrintOptions.ShowDialog := false; + frxReport1.PrepareReport(True); + frxReport1.Print(); + + end + else + begin + Application.MessageBox(PChar('ûҵ' + fPrintFile), 'ʾ', 0); + end; +end; + +procedure TfrmMachRollMain_M.ToolButton3Click(Sender: TObject); +begin + if cds_3.IsEmpty then + exit; + PrtData(cds_3.fieldbyName('BCIOID').AsString); + +end; + +procedure TfrmMachRollMain_M.TrolldelClick(Sender: TObject); +var + MBCIOID: string; +begin + if cds_3.IsEmpty then + exit; + + if Application.MessageBox('ȷҪɾѡľ', 'ʾ', 32 + 4) <> IDYES then + exit; + + ADOQueryBaseCmd.Connection.BeginTrans; + try + MBCIOID := trim(cds_3.fieldbyName('BCIOID').AsString); + + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + Sql.Add('exec P_BS_Cloth_Out_Del '); + Sql.Add(' @BCIOIDS=' + quotedstr(MBCIOID)); + Sql.Add(',@DCode=' + quotedstr(Trim(DCode))); + Sql.Add(',@DName=' + quotedstr(Trim(DName))); + Open; + end; + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + ADOQueryBaseCmd.Connection.CommitTrans; + + cds_3.Delete; + Application.MessageBox('ɾɹ', 'ʾϢ'); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; + +end; + +procedure TfrmMachRollMain_M.Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin + if AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('Grade').Index] = 'Ʒ' then + ACanvas.Brush.Color := clRed; +end; + +procedure TfrmMachRollMain_M.ToolButton8Click(Sender: TObject); +begin + inherited; + Close; +end; + +procedure TfrmMachRollMain_M.setFocusCtrol(controlName: string); +var + i: Integer; +begin + with FrameKeyBoard1.dxPanel1 do + begin + for i := 0 to ControlCount - 1 do + begin + if Controls[i] is TSpeedButton then + begin + TSpeedButton(Controls[i]).Hint := trim(controlName); + if (trim(controlName) = 'edtScan') and (TSpeedButton(Controls[i]).Name = 'SpeedButton_dot') then + begin + TSpeedButton(Controls[i]).Caption := 'س'; + end + else if (TSpeedButton(Controls[i]).Name = 'SpeedButton_dot') then + begin + TSpeedButton(Controls[i]).Caption := '.'; + end; + end; + end; + end; + cxGroupBox_keys.Left := Panel_right.Left + 5; + cxGroupBox_keys.Visible := true; +end; + +procedure TfrmMachRollMain_M.SetDdetails(); +begin + AOrdDefNote1.Text := ''; + + AOrdDefNote1.Text := AOrdDefNote1.Text + ':' + FBCIOID + #13; + + if FRulePieceNo <> '' then + AOrdDefNote1.Text := AOrdDefNote1.Text + 'Ź:' + FRulePieceNo + #13; + + if gMachOperators <> '' then + AOrdDefNote1.Text := AOrdDefNote1.Text + '̨Ա:' + gMachOperators + #13; + +end; + +procedure TfrmMachRollMain_M.SetINIFile(); +begin + IsDZCDYDll := trim(cds_params.fieldbyName('chen').AsString); + IsMBDYDll := trim(cds_params.fieldbyName('mabiao').AsString); + IsMBDYDllUnit := trim(cds_params.fieldbyName('mbunit').AsString); + + LabQty := trim(cds_params.fieldbyName('labNumber').AsString); + FMinLen := trim(cds_params.fieldbyName('minLen').AsString); + FMaxLen := trim(cds_params.fieldbyName('maxLen').AsString); + FMinWeight := trim(cds_params.fieldbyName('minweight').AsString); + FMaxWeight := trim(cds_params.fieldbyName('maxweight').AsString); + + FMPlace := trim(cds_params.fieldbyName('mplace').AsString); + FYPlace := trim(cds_params.fieldbyName('yplace').AsString); + FKgPlace := trim(cds_params.fieldbyName('kgplace').AsString); + + WriteINIFile(); + +end; + +procedure TfrmMachRollMain_M.setFormCtrol(); +begin + + FrameKeyBoard1.SpeedButton_zdykey1.Caption := gZdyKey1; + // FrameKeyBoard1.SpeedButton_zdykey2.Caption := gZdyKey2; + FrameKeyBoard1.SpeedButton_zdykey2.Caption := gZdyKey2; + + // + presentlen.text := trim(cds_params.fieldbyName('AddLenPresent').AsString); + presentWeight.text := trim(cds_params.fieldbyName('AddwetPresent').AsString); +end; + +procedure TfrmMachRollMain_M.GetINIFile(); +begin + with cds_params do + begin + if IsEmpty then + Append + else + edit; + fieldbyName('chen').value := IsDZCDYDll; + fieldbyName('mabiao').value := IsMBDYDll; + fieldbyName('mbunit').value := IsMBDYDllUnit; + + fieldbyName('MinLen').value := strtointdef(FMinLen, 0); + fieldbyName('MaxLen').value := strtointdef(FMaxLen, 100); + fieldbyName('MinWeight').value := strtointdef(FMinWeight, 0); + fieldbyName('MaxWeight').value := strtointdef(FMaxWeight, 50); + + fieldbyName('MPlace').value := strtointdef(FMPlace, 1); + fieldbyName('YPlace').value := strtointdef(FYPlace, 1); + fieldbyName('KgPlace').value := strtointdef(FKgPlace, 1); + + fieldbyName('labNumber').value := strtointdef(trim(LabQty), 1); + Post; + end; + +end; + +procedure TfrmMachRollMain_M.InitJYGrid(); +var + MNetWeight, MJYLen: double; +begin + try + cds_3.DisableControls; + with ADOQueryMain do + begin + Close; + SQL.Clear; + SQL.Add('select A.*'); + SQL.Add('from Bs_Cloth_IO A where IOType=''۳'' and CIID=''' + trim(FCIID) + ''''); //STKID=''' + trim(FBCIOID) + ''' + SQL.Add('order by filltime desc'); + Open; + end; + SCreateCDS(ADOQueryMain, cds_3); + SInitCDSData(ADOQueryMain, cds_3); + + finally + cds_3.EnableControls; + end; + +end; + +procedure TfrmMachRollMain_M.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 TfrmMachRollMain_M.CloseCom(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, 'CommClose'); + 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_M.dxLayoutControl_packDblClick(Sender: TObject); +begin + if gIsCanDesign then + layoutDesign(TdxLayoutControl(Sender), ADOQueryBaseCmd, PWideChar(dcode)); +end; + +procedure TfrmMachRollMain_M.dxLayoutItem1CaptionClick(Sender: TObject); +var + mkey: Char; +begin + inherited; +// frmProductListHelp := TfrmProductListHelp.create(Self); +// with frmProductListHelp do +// begin +// fType := '10'; +// if ShowModal = 1 then +// begin +// edtScan.Text := trim(order_main.fieldbyName('Subid').AsString); +// mkey := #13; +// edtScanKeyPress(edtScan, mkey); +// end; +// free; +// end; + + frmTradeClothTotalOutSel := TfrmTradeClothTotalOutSel.create(Self); + with frmTradeClothTotalOutSel do + begin + + if ShowModal = 1 then + begin + edtScan.Text := trim(CDS_Main.fieldbyName('BCIOID').AsString); + end; + free; + end; + + mkey := #13; + edtScanKeyPress(edtScan, mkey); +end; + +procedure TfrmMachRollMain_M.edtScanDblClick(Sender: TObject); +begin + inherited; + edtScan.Text := ''; +end; + +procedure TfrmMachRollMain_M.edtScanEnter(Sender: TObject); +begin + inherited; + setFocusCtrol(TWinControl(Sender).Name); +end; + +procedure TfrmMachRollMain_M.edtScanKeyPress(Sender: TObject; var Key: Char); +begin + inherited; + if Key = #13 then + begin + if trim(edtScan.Text) = '' then + exit; + if trim(edtScan.Text) = FBCIOID then + exit; + ClearGlobal(); + + InitPlan(edtScan.Text); + InitGrid2(); + if trim(OrderNo.Text) <> '' then + InputLen.SetFocus; + cxGroupBox_keys.Visible := false; + end; +end; + +function TfrmMachRollMain_M.SaveData(): Boolean; +var + MInputLen, MMeter, MYardage: double; + MInputWeight, MGrossWeight, MNetWeight, MTare, Maddwet, maddLen: double; + mYardStick: double; + mPresentLen, mpresentWeight: double; + MTMSId: string; +begin + Result := false; + MTMSId := Trim(SelTVKey(Tv2, ['TMSId'])[0]); + Maddwet := strTofloatDef(trim(addwet.text), 0); // Faddwet; + maddLen := strTofloatDef(trim(addlen.text), 0); // faddlen; + mYardStick := strtofloatdef(trim(RuleYardstick.Text), 100); + mPresentLen := strTofloatDef(trim(presentlen.text), 0); + mpresentWeight := strTofloatDef(trim(presentWeight.text), 0); + if (strtoIntdef(Trim(unitPieces.Text), 0) > 0) and (strtoIntdef(trim(InputLen.Text), 0) > 0) then + begin + if strtoIntdef(trim(InputLen.Text), 0) > strtoIntdef(Trim(unitPieces.Text), 0) then + funitPiecesStr := intTostr((strtoIntdef(trim(InputLen.Text), 0)) - strtoIntdef(Trim(unitPieces.Text), 0)) + '+' + Trim(unitPieces.Text); + end; + //0:䣻1ȥ + if gPresentNumFlag = 1 then + begin + mPresentLen := -1 * mPresentLen; + mpresentWeight := -1 * mpresentWeight; + end; + + try + ADOQueryBaseCmd.Connection.BeginTrans; + MTare := strtofloatdef(trim(Tare.Text), 0); // Ƥ + MInputWeight := RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), cds_params.fieldbyName('KgPlace').AsInteger); // + MGrossWeight := MInputWeight + MTare + Maddwet + mpresentWeight; // ë + MNetWeight := MInputWeight + Maddwet + mpresentWeight; // + + + MInputLen := RoundFloat(strtofloatdef(trim(InputLen.Text), 0), 4); + // +mAddLen + if (uppercase(lblLenUnit.Caption) = 'M') or (lblLenUnit.Caption = '') then + begin + MMeter := RoundFloat((MInputLen + maddLen + mPresentLen) / (mYardStick / 100), cds_params.fieldbyName('MPlace').AsInteger); + MYardage := RoundFloat(MMeter / 0.9144, cds_params.fieldbyName('YPlace').AsInteger); + end + else + begin + MYardage := RoundFloat((MInputLen + maddLen + mPresentLen) / (mYardStick / 100), cds_params.fieldbyName('YPlace').AsInteger); + MMeter := RoundFloat(MYardage * 0.9144, cds_params.fieldbyName('MPlace').AsInteger); + end; + + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + Sql.Add('exec P_BS_Cloth_Out_Distribution_KC '); + Sql.Add(' @GrossWeight=' + quotedstr(Trim(FloatToStr(MGrossWeight)))); + Sql.Add(' ,@Tare=' + quotedstr(Trim(FloatToStr(MTare)))); + Sql.Add(' ,@NetWeight=' + quotedstr(Trim(FloatToStr(MNetWeight)))); + Sql.Add(' ,@Meter=' + quotedstr(Trim(FloatToStr(MMeter)))); + Sql.Add(' ,@Yardage=' + quotedstr(Trim(FloatToStr(MYardage)))); + Sql.Add(' ,@QtyUnit=' + quotedstr(Trim(lblLenUnit.caption))); + Sql.Add(' ,@StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(FTMSId)); + Sql.Add(' ,@TMMId =' + quotedstr(FTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); +// ShowMessage(sql.Text); + open; + end; + + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + + FCIID := trim(trim(ADOQueryBaseCmd.fieldbyName('MaxIOID2').AsString)); + + ADOQueryBaseCmd.Connection.CommitTrans; + TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); + Result := true; + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; +end; + +procedure TfrmMachRollMain_M.PrtData(MCIID: string; againPring: Boolean = false); +var + fPrintFile: string; + Txt, fImagePath, Txt2, fImagePath2: string; + Moudle: Thandle; + Makebar: TMakebar; + Mixtext: TMixtext; +begin + with ADOQueryPrint do + begin + Close; + SQL.Clear; + SQL.Add(' EXEC P_BS_Cloth_Prt2 '); + SQL.Add(' @Filtration=''' + trim(MCIID) + ''''); + Open; + end; + if ADOQueryPrint.IsEmpty then + begin + Application.MessageBox('ǩδҵ', 'ʾϢ', MB_ICONERROR); + exit; + end; + +// if trim(ADOQueryPrint.fieldbyName('SLabVolume').AsString) <> '' then +// 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 FileExists(fPrintFile) then + begin + + frxReport1.LoadFromFile(fPrintFile); + frxReport1.PrintOptions.Copies := cds_params.fieldbyName('labNumber').AsInteger; + frxReport1.PrintOptions.ShowDialog := false; + frxReport1.PrepareReport(True); + frxReport1.Print(); + + end + else + begin + Application.MessageBox(PChar('ûҵ' + fPrintFile), 'ʾ', 0); + end; +end; + +procedure TfrmMachRollMain_M.BadSpeedButtonClick(Sender: TObject); +begin + +end; + +procedure TfrmMachRollMain_M.On1301(var Message: Tmessage); +var + i1, i2: Integer; + unitname: string; + fdata: double; +begin + i1 := Message.WParam; + i2 := Message.LParam; + + if (trim(cds_params.fieldbyName('mabiao').AsString) = '1') then + begin + InputLen.Text := format('%.2f', [i1 / 100000]); + if trim(cds_params.fieldbyName('mbunit').AsString) = '1' then + begin + if i2 = 0 then + begin + SetUnit('M'); + end + else + begin + SetUnit('Y'); + end; + end; + end; +end; + +procedure TfrmMachRollMain_M.On1201(var Message: Tmessage); +var + i1, i2: Integer; + unitname: string; + fdata: double; +begin + i1 := Message.WParam; + i2 := Message.LParam; + + if trim(cds_params.fieldbyName('chen').AsString) = '1' then + begin + InputWeight.Text := format('%.2f', [i1 / 100000]); + end; + +end; + + +///////////////////////////////////// +function TfrmMachRollMain_M.deletePack(packId: string): boolean; +var + ccids: string; + packNo: integer; +begin + try + ccids := ''; + packNo := strtointdef(Trim(cds_3.FieldByName('packetNo').AsString), 0); + ADOQueryBaseCmd.Connection.BeginTrans; + cds_3.First; + while not cds_3.eof do + begin + if Trim(cds_3.FieldByName('packetid').AsString) = packId then + begin + ccids := ccids + ',' + Trim(cds_3.FieldByName('CIID').AsString); + end; + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into Trade_Need_Up(UType,UOperation,UDataId,uoperator) values('''',''ɾ'',' + QuotedStr(Trim(cds_3.FieldByName('CIID').AsString)) + ',' + QuotedStr(DName) + ') '); + ExecSQL; + end; + cds_3.Next; + end; + + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + SQL.Add('exec P_Trade_Insp_Del '); + SQL.Add('@CIIDS=' + QuotedStr(ccids)); + SQL.Add(',@DCode=' + QuotedStr(DCode)); + SQL.Add(',@DName=' + QuotedStr(DName)); + Open; + end; + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + ADOQueryBaseCmd.Connection.CommitTrans; + + InitJYGrid(); + Application.MessageBox('ɾɹ', 'ʾϢ'); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + +end. + diff --git a/T03贸易布匹检验/U_MachRollMarket.dfm b/T03贸易布匹检验/U_MachRollMarket.dfm new file mode 100644 index 0000000..50623f2 --- /dev/null +++ b/T03贸易布匹检验/U_MachRollMarket.dfm @@ -0,0 +1,1331 @@ +inherited frmMachRollMarket: TfrmMachRollMarket + Caption = #21457#36135#21333#37197#36135 + ClientHeight = 756 + ClientWidth = 1443 + Color = clBtnFace + Font.Charset = ANSI_CHARSET + Font.Height = -16 + FormStyle = fsMDIChild + Visible = True + ExplicitWidth = 1459 + ExplicitHeight = 795 + PixelsPerInch = 96 + TextHeight = 21 + object Panel1: TPanel [0] + Left = 0 + Top = 0 + Width = 499 + Height = 756 + Align = alLeft + TabOrder = 4 + object Label1: TLabel + Left = 15 + Top = 30 + Width = 64 + Height = 21 + Caption = #25195#25551#20837#21475 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label2: TLabel + Left = 31 + Top = 85 + Width = 48 + Height = 21 + Caption = #25351#31034#21333 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label3: TLabel + Left = 47 + Top = 119 + Width = 32 + Height = 21 + Caption = #33394#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label4: TLabel + Left = 15 + Top = 154 + Width = 64 + Height = 21 + Caption = #26579#21378#32568#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label5: TLabel + Left = 47 + Top = 188 + Width = 32 + Height = 21 + Caption = #25968#37327 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label6: TLabel + Left = 271 + Top = 85 + Width = 32 + Height = 21 + Caption = #21697#21517 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label7: TLabel + Left = 271 + Top = 119 + Width = 32 + Height = 21 + Caption = #39068#33394 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label8: TLabel + Left = 271 + Top = 154 + Width = 32 + Height = 21 + Caption = #21345#21495 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label9: TLabel + Left = 33 + Top = 259 + Width = 42 + Height = 28 + Caption = #38271#24230 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -21 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object lblLenUnit: TLabel + Left = 250 + Top = 262 + Width = 16 + Height = 21 + Caption = 'M' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label10: TLabel + Left = 33 + Top = 318 + Width = 42 + Height = 28 + Caption = #37325#37327 + Font.Charset = ANSI_CHARSET + Font.Color = clRed + Font.Height = -21 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label11: TLabel + Left = 250 + Top = 321 + Width = 22 + Height = 21 + Caption = 'KG' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object Label12: TLabel + Left = 41 + Top = 388 + Width = 32 + Height = 21 + Caption = #31995#25968 + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + ParentFont = False + end + object edtScan: TcxTextEdit + Tag = 999 + Left = 85 + Top = 27 + Properties.CharCase = ecUpperCase + Style.HotTrack = False + Style.LookAndFeel.Kind = lfUltraFlat + Style.LookAndFeel.SkinName = 'WXI' + Style.TransparentBorder = False + StyleDisabled.LookAndFeel.Kind = lfUltraFlat + StyleDisabled.LookAndFeel.SkinName = 'WXI' + StyleFocused.LookAndFeel.Kind = lfUltraFlat + StyleFocused.LookAndFeel.SkinName = 'WXI' + StyleHot.LookAndFeel.Kind = lfUltraFlat + StyleHot.LookAndFeel.SkinName = 'WXI' + TabOrder = 0 + OnClick = edtScanEnter + OnDblClick = edtScanDblClick + OnKeyPress = edtScanKeyPress + Width = 384 + end + object OrderNo: TcxTextEdit + Left = 85 + Top = 81 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 1 + Width = 160 + end + object ColorNo: TcxTextEdit + Left = 85 + Top = 115 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 2 + Width = 160 + end + object FtyPCId: TcxTextEdit + Left = 85 + Top = 150 + Properties.ReadOnly = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 3 + OnClick = edtScanEnter + Width = 160 + end + object Qty: TcxTextEdit + Left = 85 + Top = 184 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 4 + Width = 160 + end + object BCIOID: TcxTextEdit + Left = 309 + Top = 150 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 5 + Width = 160 + end + object Color: TcxTextEdit + Left = 309 + Top = 115 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 6 + Width = 160 + end + object CodeName: TcxTextEdit + Left = 309 + Top = 81 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 7 + Width = 160 + end + object InputLen: TcxTextEdit + Tag = 999 + Left = 85 + Top = 255 + AutoSize = False + Properties.ReadOnly = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 8 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 158 + end + object InputWeight: TcxTextEdit + Tag = 999 + Left = 85 + Top = 314 + AutoSize = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 9 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 96 + end + object Tare: TcxTextEdit + Tag = 999 + Left = 187 + Top = 314 + AutoSize = False + Properties.OnChange = InputLenPropertiesChange + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 10 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 57 + end + object BTPrint: TButton + Left = 309 + Top = 314 + Width = 150 + Height = 59 + Caption = #20986' '#24211 + TabOrder = 11 + OnClick = BTPrintClick + end + object Coefficient: TcxTextEdit + Tag = 999 + Left = 83 + Top = 381 + AutoSize = False + Properties.ReadOnly = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 12 + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 35 + Width = 84 + end + object lblRuleConversion: TcxComboBox + Tag = 2 + Left = 187 + Top = 381 + AutoSize = False + Properties.DropDownListStyle = lsEditFixedList + Properties.Items.Strings = ( + #26080#38656#36716#25442 + #38271#24230#36716#20844#26020 + #20928#37325#36716#38271#24230 + '') + Properties.OnChange = lblRuleConversionPropertiesChange + Style.HotTrack = False + Style.LookAndFeel.SkinName = 'WXI' + Style.TransparentBorder = False + StyleDisabled.LookAndFeel.SkinName = 'WXI' + StyleFocused.LookAndFeel.SkinName = 'WXI' + StyleHot.LookAndFeel.SkinName = 'WXI' + TabOrder = 13 + Text = #26080#38656#36716#25442 + Height = 35 + Width = 102 + end + object AOrdDefNote1: TcxRichEdit + Left = 33 + Top = 483 + Properties.ReadOnly = True + Properties.ScrollBars = ssBoth + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 14 + Height = 206 + Width = 181 + end + object packnote: TcxMemo + Tag = 999 + Left = 259 + Top = 483 + Properties.ReadOnly = True + Properties.ScrollBars = ssVertical + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 15 + Height = 206 + Width = 199 + end + object unitPieces: TcxTextEdit + Left = 632 + Top = 769 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 16 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object presentWeight: TcxTextEdit + Left = 632 + Top = 725 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 17 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object presentLen: TcxTextEdit + Left = 632 + Top = 703 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 18 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object bt_printmd: TButton + Left = 632 + Top = 681 + Width = 48 + Height = 33 + Caption = #30721#21333 + TabOrder = 19 + Visible = False + OnClick = bt_printmdClick + end + object addWet: TcxTextEdit + Left = 632 + Top = 659 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 20 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object addLen: TcxTextEdit + Left = 632 + Top = 637 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 21 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_GramWeight: TcxTextEdit + Left = 632 + Top = 615 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 22 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_Width: TcxTextEdit + Left = 632 + Top = 593 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 23 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object customStrField2: TcxTextEdit + Left = 632 + Top = 571 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 24 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object customStrField1: TcxTextEdit + Left = 632 + Top = 549 + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 25 + Visible = False + OnClick = edtScanEnter + Width = 121 + end + object C_StyleNo: TcxTextEdit + Left = 680 + Top = 505 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 26 + Visible = False + Width = 168 + end + object RuleYardstick: TcxTextEdit + Left = 632 + Top = 505 + AutoSize = False + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 27 + Text = '100' + Visible = False + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 29 + Width = 69 + end + object C_Pattern: TcxTextEdit + Left = 632 + Top = 483 + Properties.ReadOnly = True + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 28 + Visible = False + Width = 124 + end + object OutPutWeight: TcxTextEdit + Tag = 999 + Left = 632 + Top = 439 + AutoSize = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 29 + Visible = False + OnClick = edtScanEnter + OnKeyPress = InputLenKeyPress + Height = 44 + Width = 191 + end + object cxDBImage1: TcxDBImage + Left = 592 + Top = 263 + Hint = 'FileName' + DataBinding.DataField = 'FilesOther' + DataBinding.DataSource = DS_IMAGE + Properties.GraphicClassName = 'TdxSmartImage' + Properties.GraphicTransparency = gtTransparent + Properties.ReadOnly = True + Properties.ShowFocusRect = False + Style.HotTrack = False + Style.TransparentBorder = False + TabOrder = 30 + Visible = False + Height = 122 + Width = 280 + end + object Button1: TButton + Left = 309 + Top = 244 + Width = 150 + Height = 59 + Caption = #20986' '#24211'1' + TabOrder = 31 + Visible = False + OnClick = Button1Click + end + object ToolButton2: TButton + Left = 309 + Top = 388 + Width = 150 + Height = 68 + Caption = #25171#21360#24211#23384#26631#31614 + TabOrder = 32 + Visible = False + OnClick = ToolButton2Click + end + end + object Panel_right: TPanel [1] + Left = 499 + Top = 0 + Width = 944 + Height = 756 + Align = alClient + Caption = 'Panel_right' + DoubleBuffered = False + ParentDoubleBuffered = False + TabOrder = 3 + object cxGrid2: TcxGrid + Left = 1 + Top = 1 + Width = 942 + Height = 421 + Align = alClient + TabOrder = 0 + 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 = '0' + Position = spFooter + end + item + Format = '0' + Position = spFooter + Column = v1PRTOrderQty + end + item + Format = '0' + Position = spFooter + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsSelection.CheckBoxVisibility = [cbvDataRow] + OptionsView.Footer = True + OptionsView.GroupByBox = False + object cxGridDBColumn1: TcxGridDBColumn + Tag = 99 + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 66 + end + object TV2Column3: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 96 + end + object TV2Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 72 + end + object TV2Column1: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'C_Code' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 93 + end + object TV2Column2: TcxGridDBColumn + Caption = #33394#24067#21517#31216 + DataBinding.FieldName = 'C_Name' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 91 + end + object v1PRTColor: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.ReadOnly = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 79 + end + object TV2Column5: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object TV2Column7: TcxGridDBColumn + Caption = #25253#21333#25968 + DataBinding.FieldName = 'OrderQty' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 76 + end + object TV2Column8: TcxGridDBColumn + Caption = #25253#21333#21333#20301 + DataBinding.FieldName = 'OrderUnit' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 78 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #27424#21333#25968 + DataBinding.FieldName = 'OrderOweQty' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 84 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #24211#23384#21333#20301 + DataBinding.FieldName = 'TMSUnit' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxComboBoxProperties' + Properties.Items.Strings = ( + 'M' + 'Y' + 'Kg') + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 110 + end + object cxGridDBColumn7: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdSNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 66 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end + end + object Panel2: TPanel + Left = 1 + Top = 422 + Width = 942 + Height = 333 + Align = alBottom + TabOrder = 1 + object cxGrid3: TcxGrid + Tag = 9999 + Left = 1 + Top = 31 + Width = 940 + Height = 301 + Align = alClient + TabOrder = 0 + object Tv3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + OnCustomDrawCell = Tv3CustomDrawCell + DataController.DataSource = ds_3 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v3GrossWeight + end + item + Kind = skSum + Column = v3NetWeight + end + item + Format = #21367#25968':0' + Kind = skCount + Column = tv3CIID + end + item + Kind = skSum + end + item + Kind = skSum + Column = Tv3Yardage + end + item + Kind = skSum + Column = Tv3Meter + end + item + Kind = skSum + end + item + Kind = skCount + Column = v3PieceNo + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + object v3PieceNo: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'PieceNo' + DataBinding.IsNullValueType = True + FixedKind = fkLeftDynamic + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 71 + end + object Tv3Yardage: TcxGridDBColumn + Caption = #30721#25968 + DataBinding.FieldName = 'Yardage' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 69 + end + object Tv3Meter: TcxGridDBColumn + Caption = #31859#25968 + DataBinding.FieldName = 'Meter' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 79 + end + object v3NetWeight: TcxGridDBColumn + Caption = #20928#37325 + DataBinding.FieldName = 'NetWeight' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 62 + end + object v3GrossWeight: TcxGridDBColumn + Caption = #27611#37325 + DataBinding.FieldName = 'GrossWeight' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 61 + end + object Tv3Grade: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'Grade' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 54 + end + object tv3CIID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'BCIOID' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 112 + end + object Tv3Column1: TcxGridDBColumn + Caption = #24211#20301 + DataBinding.IsNullValueType = True + end + end + object cxGridLevel2: TcxGridLevel + GridView = Tv3 + end + end + object ToolBar2: TToolBar + Tag = 1000 + Left = 1 + Top = 1 + Width = 940 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 99 + Caption = 'ToolBar1' + DoubleBuffered = False + EdgeInner = esNone + EdgeOuter = esNone + Images = DataLink_TradeInsp.cxImageList_bar + List = True + ParentDoubleBuffered = False + ShowCaptions = True + TabOrder = 1 + object ToolButton3: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #37325#25171 + ImageIndex = 21 + OnClick = ToolButton3Click + end + object Trolldel: TToolButton + Left = 71 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 5 + OnClick = TrolldelClick + end + object ToolButton1: TToolButton + Left = 142 + Top = 0 + AutoSize = True + Caption = #25171#21367#35774#32622 + ImageIndex = 25 + OnClick = ToolButton1Click + end + object Tlog: TToolButton + Left = 245 + Top = 0 + AutoSize = True + Caption = #26085#24535 + ImageIndex = 30 + end + object ToolButton8: TToolButton + Left = 316 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = ToolButton8Click + end + end + end + end + object cxGroupBox_keys: TcxGroupBox [2] + Left = 778 + Top = 61 + Caption = #34394#25311#38190#30424 + Style.LookAndFeel.NativeStyle = False + StyleDisabled.LookAndFeel.NativeStyle = False + TabOrder = 2 + Transparent = True + Visible = False + Height = 285 + Width = 327 + inline FrameKeyBoard1: TFrameKeyBoard + Left = 2 + Top = 26 + Width = 323 + Height = 257 + Align = alClient + TabOrder = 0 + ExplicitLeft = 2 + ExplicitTop = 26 + ExplicitWidth = 323 + ExplicitHeight = 257 + inherited dxPanel1: TdxPanel + Width = 323 + Height = 257 + ExplicitWidth = 323 + ExplicitHeight = 257 + inherited SpeedButton1: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton4: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton7: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton2: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton5: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton8: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton3: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton6: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton9: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_back: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton0: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_dot: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_yc: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton_ycClick + end + inherited SpeedButton_zdykey2: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton_zdykey1: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + inherited SpeedButton10: TSpeedButton + OnClick = FrameKeyBoard1SpeedButton1Click + end + end + end + object MovePanel1: TMovePanel + Left = 79 + Top = -28 + Width = 237 + Height = 45 + BevelOuter = bvNone + DockSite = True + ParentBackground = False + TabOrder = 1 + end + end + inherited loadProcess: TPanel + Left = 560 + Top = 326 + Width = 177 + ExplicitLeft = 560 + ExplicitTop = 326 + ExplicitWidth = 177 + end + inherited cxProgressBar2: TcxProgressBar + Left = 560 + Top = 238 + ExplicitLeft = 560 + ExplicitTop = 238 + ExplicitHeight = 29 + end + inherited ADOQueryBaseCmd: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + Left = 456 + Top = 311 + end + inherited ADOQueryBaseTemp: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + Left = 539 + Top = 311 + end + object cds_params: TClientDataSet + Aggregates = <> + Params = <> + Left = 788 + Top = 361 + object cds_paramsdabao: TStringField + FieldName = 'dabao' + Size = 10 + end + object cds_paramspackRolls: TIntegerField + FieldName = 'packRolls' + end + object cds_paramsrollNoMake: TStringField + FieldName = 'rollNoMake' + end + object cds_paramsMinWeight: TIntegerField + FieldName = 'MinWeight' + end + object cds_paramsMaxWeight: TIntegerField + FieldName = 'MaxWeight' + end + object cds_paramslblLenUnit: TStringField + FieldName = 'lblLenUnit' + end + object cds_paramsMinLen: TIntegerField + FieldName = 'MinLen' + end + object cds_paramsmaxLen: TIntegerField + FieldName = 'maxLen' + end + object cds_paramsweightRule: TIntegerField + FieldName = 'weightRule' + end + object cds_paramschen: TStringField + FieldName = 'chen' + Size = 10 + end + object cds_paramsmabiao: TStringField + FieldName = 'mabiao' + end + object cds_paramsmbunit: TStringField + FieldName = 'mbunit' + end + object cds_paramsmplace: TIntegerField + FieldName = 'mplace' + end + object cds_paramsyplace: TIntegerField + FieldName = 'yplace' + end + object cds_paramskgplace: TIntegerField + FieldName = 'kgplace' + end + object cds_paramslabNumber: TIntegerField + FieldName = 'labNumber' + end + object cds_paramsoutPage: TStringField + FieldName = 'outPage' + Size = 10 + end + object cds_paramsEndPieceNo: TIntegerField + FieldName = 'EndPieceNo' + end + object cds_paramsBeginPieceNo: TIntegerField + FieldName = 'BeginPieceNo' + end + object cds_paramsFixedLength: TIntegerField + FieldName = 'FixedLength' + end + object cds_paramspacknoMake: TStringField + FieldName = 'packnoMake' + Size = 30 + end + object cds_paramspieceOrder: TBooleanField + FieldName = 'pieceOrder' + end + object cds_paramsLabVolume: TStringField + FieldName = 'LabVolume' + Size = 60 + end + object cds_paramsLabPackage: TStringField + FieldName = 'LabPackage' + Size = 60 + end + object cds_paramsAddwetPresent: TFloatField + FieldName = 'AddwetPresent' + end + object cds_paramsAddLenPresent: TFloatField + FieldName = 'AddLenPresent' + end + object cds_paramspackPrintPreview: TBooleanField + FieldName = 'packPrintPreview' + end + object cds_paramspacklabNumber: TIntegerField + FieldName = 'packlabNumber' + end + object cds_paramspackPostAction: TStringField + FieldName = 'packPostAction' + end + end + object CDS_2: TClientDataSet + Aggregates = <> + Params = <> + Left = 622 + Top = 361 + end + object DS_2: TDataSource + DataSet = CDS_2 + Left = 622 + Top = 411 + end + object cds_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 539 + Top = 361 + end + object cds_3: TClientDataSet + Aggregates = <> + Params = <> + Left = 705 + Top = 361 + end + object ds_3: TDataSource + DataSet = cds_3 + Left = 705 + Top = 411 + end + object ds_1: TDataSource + DataSet = cds_1 + Left = 539 + Top = 411 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 705 + Top = 311 + end + object ADOQueryPrint: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 788 + Top = 311 + end + object GPM_3: TcxGridPopupMenu + PopupMenus = <> + Left = 456 + Top = 411 + end + object ADOQueryImage: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + CommandTimeout = 300 + Parameters = <> + Left = 622 + Top = 303 + end + object DS_IMAGE: TDataSource + DataSet = ADOQueryImage + Left = 788 + Top = 411 + end + object ADO_CJ: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 456 + Top = 361 + end + object fRMDB_1: TfrxDBDataset + UserName = 'fRMDB_1' + CloseDataSource = False + DataSet = ADOQueryPrint + BCDToCurrency = False + Left = 539 + Top = 461 + end + object frxReport1: TfrxReport + Version = '6.9.12' + DataSet = fRMDB_1 + DataSetName = 'fRMDB_1' + DotMatrixReport = False + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick, pbCopy, pbSelection] + PreviewOptions.Zoom = 1.000000000000000000 + PrintOptions.Printer = 'Default' + PrintOptions.PrintOnSheet = 0 + ReportOptions.CreateDate = 45471.682319444440000000 + ReportOptions.LastChange = 45471.682319444440000000 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'begin' + '' + 'end.') + ShowProgress = False + Left = 788 + Top = 461 + Datasets = <> + Variables = <> + Style = <> + object Data: TfrxDataPage + Height = 1000.000000000000000000 + Width = 1000.000000000000000000 + end + object Page1: TfrxReportPage + PaperWidth = 70.000000000000000000 + PaperHeight = 50.000000000000000000 + PaperSize = 256 + LeftMargin = 10.000000000000000000 + RightMargin = 10.000000000000000000 + TopMargin = 10.000000000000000000 + BottomMargin = 10.000000000000000000 + Frame.Typ = [] + MirrorMode = [] + end + end + object frxPPTXExport1: TfrxPPTXExport + UseFileCache = True + ShowProgress = True + OverwritePrompt = False + DataOnly = False + OpenAfterExport = False + PictureType = gpPNG + Left = 705 + Top = 461 + end + object frxXLSXExport1: TfrxXLSXExport + UseFileCache = True + ShowProgress = True + OverwritePrompt = False + DataOnly = False + ChunkSize = 0 + OpenAfterExport = False + PictureType = gpPNG + Left = 622 + Top = 511 + end + object frxReportTableObject1: TfrxReportTableObject + Left = 456 + Top = 511 + end + object frxOLEObject1: TfrxOLEObject + Left = 622 + Top = 461 + end + object frxRichObject1: TfrxRichObject + Left = 539 + Top = 511 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 456 + Top = 461 + end + object ADO_2: TADOQuery + Connection = DataLink_TradeInsp.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 884 + Top = 383 + end +end diff --git a/T03贸易布匹检验/U_MachRollMarket.pas b/T03贸易布匹检验/U_MachRollMarket.pas new file mode 100644 index 0000000..512e194 --- /dev/null +++ b/T03贸易布匹检验/U_MachRollMarket.pas @@ -0,0 +1,1388 @@ +unit U_MachRollMarket; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, mmsystem, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, + cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxClasses, + dxLayoutContainer, dxLayoutControl, dxLayoutcxEditAdapters, cxContainer, + cxEdit, Vcl.StdCtrls, cxTextEdit, Vcl.ExtCtrls, dxLayoutControlAdapters, + U_BaseList, Data.DB, Data.Win.ADODB, Vcl.Buttons, Vcl.ComCtrls, Vcl.ToolWin, + cxImage, cxDBEdit, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, + cxNavigator, dxDateRanges, dxScrollbarAnnotations, cxDBData, dxBarBuiltInMenu, + cxPC, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGridCustomView, cxGrid, cxMemo, cxRichEdit, U_frameBads, Datasnap.DBClient, + RM_Common, RM_Class, RM_GridReport, cxCheckBox, cxMaskEdit, cxDropDownEdit, + Vcl.Menus, cxButtonEdit, RM_Dataset, cxGeometry, dxFramedControl, dxPanel, + U_KeyBoard, cxGroupBox, cxGridCustomPopupMenu, cxGridPopupMenu, MovePanel, + RM_RichEdit, cxProgressBar, cxCurrencyEdit, dxSkinsCore, frxBarcode, frxRich, + frxOLE, frxTableObject, frxExportXLSX, frxClass, frxExportBaseDialog, + frxExportPPTX, frxDBSet, dxSkinWXI, dxSkinsDefaultPainters; + +type + TfrmMachRollMarket = class(TfrmBaseList) + Panel_right: TPanel; + cds_params: TClientDataSet; + cds_paramsdabao: TStringField; + cds_paramspackRolls: TIntegerField; + cds_paramsrollNoMake: TStringField; + cds_paramsMinWeight: TIntegerField; + cds_paramsMaxWeight: TIntegerField; + cds_paramslblLenUnit: TStringField; + cds_paramsMinLen: TIntegerField; + cds_paramsmaxLen: TIntegerField; + cds_paramsweightRule: TIntegerField; + cds_paramschen: TStringField; + cds_paramsmabiao: TStringField; + cds_paramsmbunit: TStringField; + cds_paramsmplace: TIntegerField; + cds_paramsyplace: TIntegerField; + cds_paramskgplace: TIntegerField; + cds_paramslabNumber: TIntegerField; + CDS_2: TClientDataSet; + DS_2: TDataSource; + cds_1: TClientDataSet; + cds_3: TClientDataSet; + ds_3: TDataSource; + ds_1: TDataSource; + ADOQueryMain: TADOQuery; + cds_paramsoutPage: TStringField; + ADOQueryPrint: TADOQuery; + cds_paramsEndPieceNo: TIntegerField; + cds_paramsBeginPieceNo: TIntegerField; + cds_paramsFixedLength: TIntegerField; + cds_paramspacknoMake: TStringField; + cds_paramspieceOrder: TBooleanField; + cds_paramsLabVolume: TStringField; + cds_paramsLabPackage: TStringField; + cxGroupBox_keys: TcxGroupBox; + FrameKeyBoard1: TFrameKeyBoard; + cds_paramsAddwetPresent: TFloatField; + cds_paramsAddLenPresent: TFloatField; + GPM_3: TcxGridPopupMenu; + MovePanel1: TMovePanel; + ADOQueryImage: TADOQuery; + DS_IMAGE: TDataSource; + cds_paramspackPrintPreview: TBooleanField; + cds_paramspacklabNumber: TIntegerField; + cds_paramspackPostAction: TStringField; + ADO_CJ: TADOQuery; + fRMDB_1: TfrxDBDataset; + frxReport1: TfrxReport; + frxPPTXExport1: TfrxPPTXExport; + frxXLSXExport1: TfrxXLSXExport; + frxReportTableObject1: TfrxReportTableObject; + frxOLEObject1: TfrxOLEObject; + frxRichObject1: TfrxRichObject; + frxBarCodeObject1: TfrxBarCodeObject; + cxGrid2: TcxGrid; + TV2: TcxGridDBTableView; + cxGridDBColumn1: TcxGridDBColumn; + TV2Column1: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + v1PRTColor: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGridDBColumn7: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + ADO_2: TADOQuery; + TV2Column5: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + Panel1: TPanel; + edtScan: TcxTextEdit; + Label1: TLabel; + OrderNo: TcxTextEdit; + ColorNo: TcxTextEdit; + FtyPCId: TcxTextEdit; + Qty: TcxTextEdit; + BCIOID: TcxTextEdit; + Color: TcxTextEdit; + CodeName: TcxTextEdit; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + InputLen: TcxTextEdit; + lblLenUnit: TLabel; + Label10: TLabel; + InputWeight: TcxTextEdit; + Tare: TcxTextEdit; + Label11: TLabel; + BTPrint: TButton; + Coefficient: TcxTextEdit; + lblRuleConversion: TcxComboBox; + Label12: TLabel; + AOrdDefNote1: TcxRichEdit; + packnote: TcxMemo; + unitPieces: TcxTextEdit; + presentWeight: TcxTextEdit; + presentLen: TcxTextEdit; + bt_printmd: TButton; + addWet: TcxTextEdit; + addLen: TcxTextEdit; + C_GramWeight: TcxTextEdit; + C_Width: TcxTextEdit; + customStrField2: TcxTextEdit; + customStrField1: TcxTextEdit; + C_StyleNo: TcxTextEdit; + RuleYardstick: TcxTextEdit; + C_Pattern: TcxTextEdit; + OutPutWeight: TcxTextEdit; + cxDBImage1: TcxDBImage; + Button1: TButton; + TV2Column8: TcxGridDBColumn; + Panel2: TPanel; + cxGrid3: TcxGrid; + Tv3: TcxGridDBTableView; + v3PieceNo: TcxGridDBColumn; + Tv3Yardage: TcxGridDBColumn; + Tv3Meter: TcxGridDBColumn; + v3NetWeight: TcxGridDBColumn; + v3GrossWeight: TcxGridDBColumn; + Tv3Grade: TcxGridDBColumn; + tv3CIID: TcxGridDBColumn; + cxGridLevel2: TcxGridLevel; + ToolBar2: TToolBar; + ToolButton3: TToolButton; + Trolldel: TToolButton; + ToolButton1: TToolButton; + Tlog: TToolButton; + ToolButton8: TToolButton; + ToolButton2: TButton; + Tv3Column1: TcxGridDBColumn; + procedure FormCreate(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure edtScanDblClick(Sender: TObject); + procedure edtScanKeyPress(Sender: TObject; var Key: Char); + procedure ToolButton8Click(Sender: TObject); + procedure edtScanEnter(Sender: TObject); + procedure BTPrintClick(Sender: TObject); + procedure TrolldelClick(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure InputLenKeyPress(Sender: TObject; var Key: Char); + procedure InputLenPropertiesChange(Sender: TObject); + procedure FrameKeyBoard1SpeedButton_ycClick(Sender: TObject); + procedure dxLayoutItem1CaptionClick(Sender: TObject); + procedure lblRuleConversionPropertiesChange(Sender: TObject); + procedure bt_printmdClick(Sender: TObject); + procedure dxLayoutControl_packDblClick(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure FrameKeyBoard1SpeedButton1Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + private + FCIID, FCIFName, FWorkshop: string; + FBCIOID, FC_Code, FC_ColorNo, FQtyUnit, FLenUnit, FTMSId: string; + Faddwet, faddlen: double; + FFtyPCId, FGangNo, FRulePieceNo, FCDUnit: string; + FPieceNo: Integer; + fIsPack: string; + fIsCommopen: Boolean; + FPacketCIID: string; + fLabPackage, fLabVolume: string; + FPacketCount: Integer; + fAddwetVirtual: double; + fAddLenVirtual: double; + fTareType: string; + funitPiecesStr: string; //ƴƥ + procedure setFocusCtrol(controlName: string); + procedure QuantityConversion(); + procedure ClearGlobal(); + procedure InitPlan(MSubID: string); + procedure SetUnit(MUnit: string); + procedure SetDdetails(); + procedure SetINIFile(); + procedure GetINIFile(); + procedure InitJYGrid(); + procedure InitGrid2(); + procedure OpenCom(DllName: string); + procedure CloseCom(DllName: string); + function SaveData(): Boolean; + procedure PrtData(MCIID: string; againPring: Boolean = false); + procedure BadSpeedButtonClick(Sender: TObject); + procedure setFormCtrol(); + procedure On1201(var Message: Tmessage); message 1201; // ӳ + procedure On1301(var Message: Tmessage); message 1301; // + function CheckData(CKType: string): Boolean; + function deletePack(packId: string): boolean; + type + + public + fmanage: string; + fFlileFlag: string; + end; + +var + frmMachRollMarket: TfrmMachRollMarket; + newh, newh1: hwnd; + +implementation + +uses + U_DataLink, U_ControlData, U_ParamSet, U_RTFun, U_globalVar, + U_FormLayOutDesign, U_ZDYHelp, U_iniParam, U_ProductListHelp, U_SysLogList, + U_ProgressUpdate, U_LabelPrint, U_TradeClothTotalOutSel; +{$R *.dfm} + +procedure TfrmMachRollMarket.InitGrid2(); +var + SqlStr: string; +begin + + SqlStr := ' exec P_Trade_Market_WaitOut_Market '; + SqlStr := SqlStr + ' @TMSId =' + quotedstr(trim(FTMSId)); + + InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, '', ''); +end; + +function TfrmMachRollMarket.CheckData(CKType: string): Boolean; +var + mvalue: double; + mCurPieceNo: Integer; +begin + Result := false; + + try + if trim(FBCIOID) = '' then + raise Exception.create('ɨ̿'); + + if trim(CKType) = 'ύ' then + begin + + if trim(lblLenUnit.Caption) = '' then + raise Exception.create('ȵλΪ!'); + + if trim(InputWeight.Text) <> '' then + begin + if TryStrToFloat(InputWeight.Text, mvalue) = false then + raise Exception.create('¼!'); + if strtofloatdef(trim(InputWeight.Text), 0) < cds_params.fieldbyName('minWeight').AsInteger then + raise Exception.create('С' + cds_params.fieldbyName('minWeight').AsString + '!'); + if strtofloatdef(trim(InputWeight.Text), 0) > cds_params.fieldbyName('maxWeight').AsInteger then + raise Exception.create('ܴ' + cds_params.fieldbyName('maxWeight').AsString + '!'); + end; + + if trim(InputLen.Text) <> '' then + begin + if TryStrToFloat(InputLen.Text, mvalue) = false then + raise Exception.create('¼!'); + if strtofloatdef(trim(InputLen.Text), 0) < cds_params.fieldbyName('minLen').AsInteger then + raise Exception.create('ȲС' + cds_params.fieldbyName('minLen').AsString + '!'); + if strtofloatdef(trim(InputLen.Text), 0) > cds_params.fieldbyName('maxLen').AsInteger then + raise Exception.create('Ȳܴ' + cds_params.fieldbyName('maxLen').AsString + '!'); + end; + + if FQtyUnit = 'Kg' then + begin + if (strtofloatdef(trim(InputWeight.Text), 0) = 0) then + raise Exception.create('Ϊ0!!'); + end + else + begin + if (strtofloatdef(trim(InputLen.Text), 0) = 0) then + raise Exception.create('ȲΪ0!!'); + end; + + end; + Result := true; + except + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + +procedure TfrmMachRollMarket.BTPrintClick(Sender: TObject); +var + fPrintFile, MPacketId: string; + mvalue: double; + i: Integer; +begin + try + BTPrint.Enabled := false; + + edtScan.SetFocus; + + if CheckData('ύ') = false then + exit; + + if SaveData() then + begin + InputLen.Text := ''; + presentLen.Text := ''; + funitPiecesStr := ''; + presentWeight.Text := ''; + + if fileexists(ExtractFilePath(Application.ExeName) + 'ȷ.wav') then + playSound(pwidechar('ȷ.wav'), 0, SND_FILENAME or SND_ASYNC); + + InputWeight.Text := ''; + + if trim(cds_params.fieldbyName('outPage').AsString) = '' then + begin + PrtData(FCIID); + end; + + end; + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + InitJYGrid(); + InitGrid2(); + FCIID := ''; + finally + BTPrint.Enabled := true; + end; +end; + +procedure TfrmMachRollMarket.bt_printmdClick(Sender: TObject); +var + WSql: string; +begin + if cds_3.IsEmpty then + Exit; + + WSql := ''; + cds_3.DisableControls; + with cds_3 do + begin + First; + while not Eof do + begin + + if WSql <> '' then + begin + WSql := WSql + ',' + Trim(cds_3.fieldbyname('CIID').AsString); + end + else + begin + WSql := Trim(cds_3.fieldbyname('CIID').AsString); + end; + + Next; + end; + end; + + cds_3.EnableControls; +// try +// frmMdPrint := TfrmMdPrint.Create(Application); +// with frmMdPrint do +// begin +// FLMType := '뵥'; +// FFiltration1 := WSql; +// FFiltration2 := WSql; +// if ShowModal = 1 then +// begin +//// Self.InitGrid(); +// end; +// end; +// finally +// frmMdPrint.Free; +// end; + try + frmLabelPrint := TfrmLabelPrint.Create(Application); + with frmLabelPrint do + begin + FLMType := '뵥'; + FFiltration1 := WSql; + if ShowModal = 1 then + begin +// Self.InitGrid(); + end; + end; + finally + frmLabelPrint.Free; + end; +end; + +procedure TfrmMachRollMarket.Button1Click(Sender: TObject); +var + fPrintFile, MPacketId, MTMSId: string; + mvalue: double; + i: Integer; +begin + try + BTPrint.Enabled := false; + MTMSId := Trim(SelTVKey(Tv2, ['TMSId'])[0]); + edtScan.SetFocus; + + try + ADOQueryBaseCmd.Connection.BeginTrans; + + if trim(FBCIOID) = '' then + raise Exception.create('ɨ̿'); + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + + Sql.Add('exec P_BS_Cloth_Out_DistributionAll '); + Sql.Add(' @StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(MTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); +// showmessage(sql.Text); + open; + end; + + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + + FCIID := trim(trim(ADOQueryBaseCmd.fieldbyName('MaxIOID2').AsString)); + + ADOQueryBaseCmd.Connection.CommitTrans; + TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + InitJYGrid(); + InitGrid2(); + FCIID := ''; + finally + BTPrint.Enabled := true; + end; +end; + +procedure TfrmMachRollMarket.FormClose(Sender: TObject; var Action: TCloseAction); +begin + inherited; + if fIsCommopen then + begin + CloseCom(DZCDYDllName); + CloseCom(MBDYDllName); + end; + Action := caFree; +end; + +procedure TfrmMachRollMarket.FormCreate(Sender: TObject); +begin + inherited; + fIsCommopen := false; + cds_params.Close; + cds_params.CreateDataSet; + Panel_right.Align := alClient; +end; + +procedure TfrmMachRollMarket.FormDestroy(Sender: TObject); +begin + inherited; + frmMachRollMarket := nil; +end; + +procedure TfrmMachRollMarket.FormShow(Sender: TObject); +var + i: Integer; +begin + inherited; + gIsCanDesign := gIsCanDesign; + gGridNativeSet := true; + + ReadCxGrid(trim(Self.Caption) + 'Tv3', Tv3, gDllFileCaption); + + if IsINIFile() then + ReadINIFile() + else + WriteINIFile; + + GetINIFile(); + setFormCtrol(); + if trim(fmanage) <> 'Ȩ' then + begin + if trim(DZCDYDllName) <> '' then + OpenCom(DZCDYDllName); + if trim(MBDYDllName) <> '' then + OpenCom(MBDYDllName); + + end; + if trim(fCanInputFs) = '1' then + begin +// cxGroupBox_keys.ClientHeight := round(cxGrid3.ClientHeight * 0.6); + frameKeyBoard1.SpeedButton10.Visible := true; + end + else + begin +// cxGroupBox_keys.ClientHeight := round(cxGrid3.ClientHeight * 0.55); + frameKeyBoard1.SpeedButton10.Visible := false; + end; +end; + +procedure TfrmMachRollMarket.FrameKeyBoard1SpeedButton1Click(Sender: TObject); +var + fsj: string; + mComponent: TComponent; + mkey: Char; +begin + fsj := trim(TSpeedButton(Sender).Hint); + if trim(fsj) = '' then + exit; + mComponent := FindComponent(trim(TSpeedButton(Sender).Hint)); + + if mComponent = nil then + exit; + if TcxTextEdit(mComponent).Name = 'KuangHao' then + exit; + if (TcxTextEdit(mComponent).Name = 'edtScan') and (trim(TSpeedButton(Sender).Caption) = 'س') then + begin + mkey := #13; + edtScanKeyPress(edtScan, mkey); + exit; + end; + fsj := trim(TcxTextEdit(mComponent).Text); + if mComponent is TcxCurrencyEdit then + begin + TcxCurrencyEdit(mComponent).text := fsj + trim(TSpeedButton(Sender).Caption); + TcxCurrencyEdit(mComponent).SelectAll; + end + else if mComponent is TcxTextEdit then + begin + TcxTextEdit(mComponent).Text := fsj + trim(TSpeedButton(Sender).Caption); + TcxTextEdit(mComponent).SelectAll; + end + else if mComponent is TcxComboBox then + begin + TcxComboBox(mComponent).Text := fsj + trim(TSpeedButton(Sender).Caption); + TcxComboBox(mComponent).SelectAll; + end; + +end; + +procedure TfrmMachRollMarket.FrameKeyBoard1SpeedButton_ycClick(Sender: TObject); +begin + inherited; + cxGroupBox_keys.Visible := false; +end; + +procedure TfrmMachRollMarket.ClearGlobal(); +begin + FBCIOID := ''; + + FQtyUnit := ''; + + FCIID := ''; + FWorkshop := ''; + InputLen.Text := ''; + Coefficient.Text := ''; + AOrdDefNote1.Text := ''; + Tare.Text := ''; + InputWeight.Text := ''; + FLenUnit := ''; + Faddwet := 0; + faddlen := 0; + FPacketCIID := ''; + FPacketCount := 0; + FC_ColorNo := ''; + FC_Code := ''; +end; + +procedure TfrmMachRollMarket.QuantityConversion(); +begin + // if trim(OrderNo.Text)='' then exit; + + if cds_params.fieldbyName('weightRule').AsInteger = 0 then + // InputWeight ë OutPutWeight + begin + if lblRuleConversion.Text <> 'ת' then + begin + if lblRuleConversion.Text = 'ת' then + begin + InputWeight.Text := floattostr(strtofloatdef(trim(InputLen.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0) + strtofloatdef(trim(Tare.Text), 0)); + end; + if lblRuleConversion.Text = 'ëת' then + begin + InputLen.Text := floattostr(strtofloatdef(trim(InputWeight.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ת' then + begin + InputLen.Text := floattostr((RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), 1) - strtofloatdef(trim(Tare.Text), 0)) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + end; + if strtofloatdef(trim(InputWeight.Text), 0) > 0 then + begin + OutPutWeight.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) - strtofloatdef(trim(Tare.Text), 0))); // + end; + end; + + if cds_params.fieldbyName('weightRule').AsInteger = 1 then + // InputWeight OutPutWeight ë + begin + if lblRuleConversion.Text <> 'ת' then + begin + if lblRuleConversion.Text = 'ת' then + begin + InputWeight.Text := floattostr(strtofloatdef(trim(InputLen.Text), 0) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ëת' then + begin + InputLen.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) + strtofloatdef(trim(Tare.Text), 0)) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + if lblRuleConversion.Text = 'ת' then + begin + InputLen.Text := floattostr(RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), 1) * strtofloatdef(trim(Coefficient.Text), 0)); + end; + end; + if strtofloatdef(trim(InputWeight.Text), 0) > 0 then + begin + OutPutWeight.Text := floattostr((strtofloatdef(trim(InputWeight.Text), 0) + strtofloatdef(trim(Tare.Text), 0))); // ë + end; + end; + +end; + +procedure TfrmMachRollMarket.InitPlan(MSubID: string); +begin + with ADOQueryBaseTemp do + begin + Close; + SQL.Clear; + SQL.Add('EXEC P_Trade_Insp_Get_Market @TMSId=''' + trim(MSubID) + ''''); + Open; + + if not IsEmpty then + begin + + FLenUnit := trim(ADOQueryBaseTemp.fieldbyName('LenUnit').AsString); + if FLenUnit = '' then + begin + FLenUnit := 'M'; + end; + + fLabPackage := 'Ĭϰǩ'; + fLabVolume := 'ͻǩ'; + + +// fLabPackage := trim(ADOQueryBaseTemp.fieldbyName('LabPackage').AsString); +// fLabVolume := trim(ADOQueryBaseTemp.fieldbyName('LabVolume').AsString); + + SetUnit(FLenUnit); + + FCDUnit := lblLenUnit.Caption; + FTMSId := trim(fieldbyName('TMSId').AsString); + FBCIOID := trim(fieldbyName('BCIOID').AsString); + + FQtyUnit := trim(fieldbyName('QtyUnit').AsString); + OrderNo.Text := trim(fieldbyName('FromOrdNo').AsString); + CodeName.Text := trim(fieldbyName('C_Name').AsString); + C_width.Text := trim(fieldbyName('C_width').AsString); + C_GramWeight.Text := trim(fieldbyName('C_GramWeight').AsString); + ColorNo.Text := trim(fieldbyName('C_ColorNo').AsString); + Color.Text := trim(fieldbyName('C_Color').AsString); + C_Pattern.Text := trim(fieldbyName('C_Pattern').AsString); + FFtyPCId := trim(fieldbyName('FtyPCId').AsString); + FC_Code := trim(fieldbyName('C_Code').AsString); + FC_ColorNo := trim(fieldbyName('C_ColorNo').AsString); + cds_params.Edit; + cds_params.fieldbyName('outPage').value := ''; + cds_params.Post; + +// Coefficient.Text := trim(fieldbyName('Coefficient').AsString); + // תϵ +// lblRuleConversion.ItemIndex := lblRuleConversion.Properties.Items.IndexOf(fieldbyName('RuleConversion').AsString); + + FtyPCId.Text := FFtyPCId; + BCIOID.Text := FBCIOID; + + Qty.Text := trim(fieldbyName('StkQty').AsString) + trim(fieldbyName('QtyUnit').AsString); + +// Tare.Text := trim(fieldbyName('RuleLaterTare').AsString); + + fTareType := ''; + +// if fieldbyName('RuleYardstick').AsInteger > 0 then +// RuleYardstick.Text := trim(fieldbyName('RuleYardstick').AsString) +// else + RuleYardstick.Text := '100'; + + packnote.Lines.Clear; + + InputLen.SetFocus; + setFocusCtrol(InputLen.Name); + SetDdetails(); + end + else + begin + // ClearGlobal(); + application.MessageBox('쳣,Ϣʹ!', 'Ϣ'); + end; + end; + InitJYGrid(); + + edtScan.Text := ''; + + // ʾ + setFormCtrol(); + +end; + +procedure TfrmMachRollMarket.InputLenKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + Key := #0; + SelectNext(ActiveControl as TWinControl, true, true); + end; + +end; + +procedure TfrmMachRollMarket.InputLenPropertiesChange(Sender: TObject); +begin + + // if StrToIntDef(trim(InputWeight.Text), 0) = 0 then + // begin + // exit; + // end; + QuantityConversion(); +end; + +procedure TfrmMachRollMarket.lblRuleConversionPropertiesChange(Sender: TObject); +begin + inherited; + if lblRuleConversion.Text = 'ת' then + begin + OutPutWeight.Text := ''; + InputLen.Text := ''; + InputWeight.Text := ''; + end; + QuantityConversion(); +end; + +procedure TfrmMachRollMarket.SetUnit(MUnit: string); +begin + + lblLenUnit.Caption := MUnit; + +end; + +procedure TfrmMachRollMarket.ToolButton1Click(Sender: TObject); +begin + + frmParamSet := TfrmParamSet.create(Self); + with frmParamSet do + begin + cds_params.Data := Self.cds_params.Data; + if ShowModal = 1 then + begin + Self.cds_params.Data := cds_params.Data; + setFormCtrol(); + end; + free; + end; + SetINIFile(); + if trim(fmanage) <> 'Ȩ' then + begin + if (trim(MBDYDllName) <> '') and not fIsCommopen then + OpenCom(MBDYDllName); + + end; +end; + +procedure TfrmMachRollMarket.ToolButton2Click(Sender: TObject); +var + fPrintFile: string; + Txt, fImagePath, Txt2, fImagePath2: string; + Moudle: Thandle; + Makebar: TMakebar; + Mixtext: TMixtext; +begin + with ADOQueryPrint do + begin + Close; + SQL.Clear; + SQL.Add(' EXEC P_BS_Cloth_Prt2 '); + SQL.Add(' @Filtration=''' + trim(FBCIOID) + ''''); + Open; + end; + if ADOQueryPrint.IsEmpty then + begin + Application.MessageBox('ǩδҵ', 'ʾϢ', MB_ICONERROR); + exit; + end; + + ExportFtErpFile('ǩ.fr3', ADOQueryBaseTemp); + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ǩ.fr3'; + if FileExists(fPrintFile) then + begin + + frxReport1.LoadFromFile(fPrintFile); + frxReport1.PrintOptions.Copies := cds_params.fieldbyName('labNumber').AsInteger; + frxReport1.PrintOptions.ShowDialog := false; + frxReport1.PrepareReport(True); + frxReport1.Print(); + + end + else + begin + Application.MessageBox(PChar('ûҵ' + fPrintFile), 'ʾ', 0); + end; +end; + +procedure TfrmMachRollMarket.ToolButton3Click(Sender: TObject); +begin + if cds_3.IsEmpty then + exit; + PrtData(cds_3.fieldbyName('BCIOID').AsString); + +end; + +procedure TfrmMachRollMarket.TrolldelClick(Sender: TObject); +var + MBCIOID: string; +begin + if cds_3.IsEmpty then + exit; + + if Application.MessageBox('ȷҪɾѡľ', 'ʾ', 32 + 4) <> IDYES then + exit; + + ADOQueryBaseCmd.Connection.BeginTrans; + try + MBCIOID := trim(cds_3.fieldbyName('BCIOID').AsString); + + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + Sql.Add('exec P_BS_Cloth_Out_Del '); + Sql.Add(' @BCIOIDS=' + quotedstr(MBCIOID)); + Sql.Add(',@DCode=' + quotedstr(Trim(DCode))); + Sql.Add(',@DName=' + quotedstr(Trim(DName))); + Open; + end; + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + ADOQueryBaseCmd.Connection.CommitTrans; + + cds_3.Delete; + Application.MessageBox('ɾɹ', 'ʾϢ'); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; + +end; + +procedure TfrmMachRollMarket.Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin + if AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('Grade').Index] = 'Ʒ' then + ACanvas.Brush.Color := clRed; +end; + +procedure TfrmMachRollMarket.ToolButton8Click(Sender: TObject); +begin + inherited; + Close; +end; + +procedure TfrmMachRollMarket.setFocusCtrol(controlName: string); +var + i: Integer; +begin + with FrameKeyBoard1.dxPanel1 do + begin + for i := 0 to ControlCount - 1 do + begin + if Controls[i] is TSpeedButton then + begin + TSpeedButton(Controls[i]).Hint := trim(controlName); + if (trim(controlName) = 'edtScan') and (TSpeedButton(Controls[i]).Name = 'SpeedButton_dot') then + begin + TSpeedButton(Controls[i]).Caption := 'س'; + end + else if (TSpeedButton(Controls[i]).Name = 'SpeedButton_dot') then + begin + TSpeedButton(Controls[i]).Caption := '.'; + end; + end; + end; + end; + cxGroupBox_keys.Left := Panel_right.Left + 5; + cxGroupBox_keys.Visible := true; +end; + +procedure TfrmMachRollMarket.SetDdetails(); +begin + AOrdDefNote1.Text := ''; + + AOrdDefNote1.Text := AOrdDefNote1.Text + ':' + FBCIOID + #13; + + if FRulePieceNo <> '' then + AOrdDefNote1.Text := AOrdDefNote1.Text + 'Ź:' + FRulePieceNo + #13; + + if gMachOperators <> '' then + AOrdDefNote1.Text := AOrdDefNote1.Text + '̨Ա:' + gMachOperators + #13; + +end; + +procedure TfrmMachRollMarket.SetINIFile(); +begin + IsDZCDYDll := trim(cds_params.fieldbyName('chen').AsString); + IsMBDYDll := trim(cds_params.fieldbyName('mabiao').AsString); + IsMBDYDllUnit := trim(cds_params.fieldbyName('mbunit').AsString); + + LabQty := trim(cds_params.fieldbyName('labNumber').AsString); + FMinLen := trim(cds_params.fieldbyName('minLen').AsString); + FMaxLen := trim(cds_params.fieldbyName('maxLen').AsString); + FMinWeight := trim(cds_params.fieldbyName('minweight').AsString); + FMaxWeight := trim(cds_params.fieldbyName('maxweight').AsString); + + FMPlace := trim(cds_params.fieldbyName('mplace').AsString); + FYPlace := trim(cds_params.fieldbyName('yplace').AsString); + FKgPlace := trim(cds_params.fieldbyName('kgplace').AsString); + + WriteINIFile(); + +end; + +procedure TfrmMachRollMarket.setFormCtrol(); +begin + + FrameKeyBoard1.SpeedButton_zdykey1.Caption := gZdyKey1; + // FrameKeyBoard1.SpeedButton_zdykey2.Caption := gZdyKey2; + FrameKeyBoard1.SpeedButton_zdykey2.Caption := gZdyKey2; + + // + presentlen.text := trim(cds_params.fieldbyName('AddLenPresent').AsString); + presentWeight.text := trim(cds_params.fieldbyName('AddwetPresent').AsString); +end; + +procedure TfrmMachRollMarket.GetINIFile(); +begin + with cds_params do + begin + if IsEmpty then + Append + else + edit; + fieldbyName('chen').value := IsDZCDYDll; + fieldbyName('mabiao').value := IsMBDYDll; + fieldbyName('mbunit').value := IsMBDYDllUnit; + + fieldbyName('MinLen').value := strtointdef(FMinLen, 0); + fieldbyName('MaxLen').value := strtointdef(FMaxLen, 100); + fieldbyName('MinWeight').value := strtointdef(FMinWeight, 0); + fieldbyName('MaxWeight').value := strtointdef(FMaxWeight, 50); + + fieldbyName('MPlace').value := strtointdef(FMPlace, 1); + fieldbyName('YPlace').value := strtointdef(FYPlace, 1); + fieldbyName('KgPlace').value := strtointdef(FKgPlace, 1); + + fieldbyName('labNumber').value := strtointdef(trim(LabQty), 1); + Post; + end; + +end; + +procedure TfrmMachRollMarket.InitJYGrid(); +var + MNetWeight, MJYLen: double; +begin + try + cds_3.DisableControls; + with ADOQueryMain do + begin + Close; + SQL.Clear; + SQL.Add('select A.*'); + SQL.Add('from Bs_Cloth_IO A where IOType=''۳'' and STKID=''' + trim(FBCIOID) + ''''); + SQL.Add('order by filltime desc'); + Open; + end; + SCreateCDS(ADOQueryMain, cds_3); + SInitCDSData(ADOQueryMain, cds_3); + + finally + cds_3.EnableControls; + end; + +end; + +procedure TfrmMachRollMarket.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 TfrmMachRollMarket.CloseCom(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, 'CommClose'); + 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 TfrmMachRollMarket.dxLayoutControl_packDblClick(Sender: TObject); +begin + if gIsCanDesign then + layoutDesign(TdxLayoutControl(Sender), ADOQueryBaseCmd, PWideChar(dcode)); +end; + +procedure TfrmMachRollMarket.dxLayoutItem1CaptionClick(Sender: TObject); +var + mkey: Char; +begin + inherited; +// frmProductListHelp := TfrmProductListHelp.create(Self); +// with frmProductListHelp do +// begin +// fType := '10'; +// if ShowModal = 1 then +// begin +// edtScan.Text := trim(order_main.fieldbyName('Subid').AsString); +// mkey := #13; +// edtScanKeyPress(edtScan, mkey); +// end; +// free; +// end; + + frmTradeClothTotalOutSel := TfrmTradeClothTotalOutSel.create(Self); + with frmTradeClothTotalOutSel do + begin + + if ShowModal = 1 then + begin + edtScan.Text := trim(CDS_Main.fieldbyName('BCIOID').AsString); + end; + free; + end; + + mkey := #13; + edtScanKeyPress(edtScan, mkey); +end; + +procedure TfrmMachRollMarket.edtScanDblClick(Sender: TObject); +begin + inherited; + edtScan.Text := ''; +end; + +procedure TfrmMachRollMarket.edtScanEnter(Sender: TObject); +begin + inherited; + setFocusCtrol(TWinControl(Sender).Name); +end; + +procedure TfrmMachRollMarket.edtScanKeyPress(Sender: TObject; var Key: Char); +begin + inherited; + if Key = #13 then + begin + if trim(edtScan.Text) = '' then + exit; + if trim(edtScan.Text) = FBCIOID then + exit; + ClearGlobal(); + + InitPlan(edtScan.Text); + InitGrid2(); + if trim(OrderNo.Text) <> '' then + InputLen.SetFocus; + cxGroupBox_keys.Visible := false; + end; +end; + +function TfrmMachRollMarket.SaveData(): Boolean; +var + MInputLen, MMeter, MYardage: double; + MInputWeight, MGrossWeight, MNetWeight, MTare, Maddwet, maddLen: double; + mYardStick: double; + mPresentLen, mpresentWeight: double; + MTMSId: string; +begin + Result := false; + MTMSId := Trim(SelTVKey(Tv2, ['TMSId'])[0]); + Maddwet := strTofloatDef(trim(addwet.text), 0); // Faddwet; + maddLen := strTofloatDef(trim(addlen.text), 0); // faddlen; + mYardStick := strtofloatdef(trim(RuleYardstick.Text), 100); + mPresentLen := strTofloatDef(trim(presentlen.text), 0); + mpresentWeight := strTofloatDef(trim(presentWeight.text), 0); + if (strtoIntdef(Trim(unitPieces.Text), 0) > 0) and (strtoIntdef(trim(InputLen.Text), 0) > 0) then + begin + if strtoIntdef(trim(InputLen.Text), 0) > strtoIntdef(Trim(unitPieces.Text), 0) then + funitPiecesStr := intTostr((strtoIntdef(trim(InputLen.Text), 0)) - strtoIntdef(Trim(unitPieces.Text), 0)) + '+' + Trim(unitPieces.Text); + end; + //0:䣻1ȥ + if gPresentNumFlag = 1 then + begin + mPresentLen := -1 * mPresentLen; + mpresentWeight := -1 * mpresentWeight; + end; + + try + ADOQueryBaseCmd.Connection.BeginTrans; + MTare := strtofloatdef(trim(Tare.Text), 0); // Ƥ + MInputWeight := RoundFloat(strtofloatdef(trim(InputWeight.Text), 0), cds_params.fieldbyName('KgPlace').AsInteger); // + MGrossWeight := MInputWeight + MTare + Maddwet + mpresentWeight; // ë + MNetWeight := MInputWeight + Maddwet + mpresentWeight; // + + + MInputLen := RoundFloat(strtofloatdef(trim(InputLen.Text), 0), 4); + // +mAddLen + if (uppercase(lblLenUnit.Caption) = 'M') or (lblLenUnit.Caption = '') then + begin + MMeter := RoundFloat((MInputLen + maddLen + mPresentLen) / (mYardStick / 100), cds_params.fieldbyName('MPlace').AsInteger); + MYardage := RoundFloat(MMeter / 0.9144, cds_params.fieldbyName('YPlace').AsInteger); + end + else + begin + MYardage := RoundFloat((MInputLen + maddLen + mPresentLen) / (mYardStick / 100), cds_params.fieldbyName('YPlace').AsInteger); + MMeter := RoundFloat(MYardage * 0.9144, cds_params.fieldbyName('MPlace').AsInteger); + end; + + with ADOQueryBaseCmd do + begin + Close; + sql.Clear; + Sql.Add('exec P_BS_Cloth_Out_Distribution_KC '); + Sql.Add(' @GrossWeight=' + quotedstr(Trim(FloatToStr(MGrossWeight)))); + Sql.Add(' ,@Tare=' + quotedstr(Trim(FloatToStr(MTare)))); + Sql.Add(' ,@NetWeight=' + quotedstr(Trim(FloatToStr(MNetWeight)))); + Sql.Add(' ,@Meter=' + quotedstr(Trim(FloatToStr(MMeter)))); + Sql.Add(' ,@Yardage=' + quotedstr(Trim(FloatToStr(MYardage)))); + Sql.Add(' ,@QtyUnit=' + quotedstr(Trim(lblLenUnit.caption))); + Sql.Add(' ,@StkID=' + quotedstr(Trim(FBCIOID))); + Sql.Add(' ,@TMSId =' + quotedstr(MTMSId)); + Sql.Add(' ,@Dcode=' + quotedstr(Trim(Dcode))); + Sql.Add(' ,@DName=' + quotedstr(Trim(DName))); +// ShowMessage(sql.Text); + open; + end; + + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + + FCIID := trim(trim(ADOQueryBaseCmd.fieldbyName('MaxIOID2').AsString)); + + ADOQueryBaseCmd.Connection.CommitTrans; + TradeMarketProgressUpdate(ADOQueryBaseCmd, MTMSId); + Result := true; + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + + end; +end; + +procedure TfrmMachRollMarket.PrtData(MCIID: string; againPring: Boolean = false); +var + fPrintFile: string; + Txt, fImagePath, Txt2, fImagePath2: string; + Moudle: Thandle; + Makebar: TMakebar; + Mixtext: TMixtext; +begin + with ADOQueryPrint do + begin + Close; + SQL.Clear; + SQL.Add(' EXEC P_BS_Cloth_Prt2 '); + SQL.Add(' @Filtration=''' + trim(MCIID) + ''''); + Open; + end; + if ADOQueryPrint.IsEmpty then + begin + Application.MessageBox('ǩδҵ', 'ʾϢ', MB_ICONERROR); + exit; + end; + +// if trim(ADOQueryPrint.fieldbyName('SLabVolume').AsString) <> '' then +// 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 FileExists(fPrintFile) then + begin + + frxReport1.LoadFromFile(fPrintFile); + frxReport1.PrintOptions.Copies := cds_params.fieldbyName('labNumber').AsInteger; + frxReport1.PrintOptions.ShowDialog := false; + frxReport1.PrepareReport(True); + frxReport1.Print(); + + end + else + begin + Application.MessageBox(PChar('ûҵ' + fPrintFile), 'ʾ', 0); + end; +end; + +procedure TfrmMachRollMarket.BadSpeedButtonClick(Sender: TObject); +begin + +end; + +procedure TfrmMachRollMarket.On1301(var Message: Tmessage); +var + i1, i2: Integer; + unitname: string; + fdata: double; +begin + i1 := Message.WParam; + i2 := Message.LParam; + + if (trim(cds_params.fieldbyName('mabiao').AsString) = '1') then + begin + InputLen.Text := format('%.2f', [i1 / 100000]); + if trim(cds_params.fieldbyName('mbunit').AsString) = '1' then + begin + if i2 = 0 then + begin + SetUnit('M'); + end + else + begin + SetUnit('Y'); + end; + end; + end; +end; + +procedure TfrmMachRollMarket.On1201(var Message: Tmessage); +var + i1, i2: Integer; + unitname: string; + fdata: double; +begin + i1 := Message.WParam; + i2 := Message.LParam; + + if trim(cds_params.fieldbyName('chen').AsString) = '1' then + begin + InputWeight.Text := format('%.2f', [i1 / 100000]); + end; + +end; + + +///////////////////////////////////// +function TfrmMachRollMarket.deletePack(packId: string): boolean; +var + ccids: string; + packNo: integer; +begin + try + ccids := ''; + packNo := strtointdef(Trim(cds_3.FieldByName('packetNo').AsString), 0); + ADOQueryBaseCmd.Connection.BeginTrans; + cds_3.First; + while not cds_3.eof do + begin + if Trim(cds_3.FieldByName('packetid').AsString) = packId then + begin + ccids := ccids + ',' + Trim(cds_3.FieldByName('CIID').AsString); + end; + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into Trade_Need_Up(UType,UOperation,UDataId,uoperator) values('''',''ɾ'',' + QuotedStr(Trim(cds_3.FieldByName('CIID').AsString)) + ',' + QuotedStr(DName) + ') '); + ExecSQL; + end; + cds_3.Next; + end; + + with ADOQueryBaseCmd do + begin + Close; + SQL.Clear; + SQL.Add('exec P_Trade_Insp_Del '); + SQL.Add('@CIIDS=' + QuotedStr(ccids)); + SQL.Add(',@DCode=' + QuotedStr(DCode)); + SQL.Add(',@DName=' + QuotedStr(DName)); + Open; + end; + if ADOQueryBaseCmd.fieldbyName('intReturn').AsInteger = -1 then + begin + raise Exception.create(pchar(trim(ADOQueryBaseCmd.fieldbyName('ShowMsg').AsString))); + end; + ADOQueryBaseCmd.Connection.CommitTrans; + + InitJYGrid(); + Application.MessageBox('ɾɹ', 'ʾϢ'); + except + ADOQueryBaseCmd.Connection.RollbackTrans; + Application.MessageBox(pchar(Exception(ExceptObject).Message), 'ʾϢ', 0); + end; +end; + +end. + diff --git a/T05贸易门市管理/TradeMarket.dpr b/T05贸易门市管理/TradeMarket.dpr index c648721..b573105 100644 --- a/T05贸易门市管理/TradeMarket.dpr +++ b/T05贸易门市管理/TradeMarket.dpr @@ -1,4 +1,4 @@ - library TradeMarket; +library TradeMarket; uses SysUtils, diff --git a/T05贸易门市管理/TradeMarket.dproj b/T05贸易门市管理/TradeMarket.dproj index 04b894e..7b4bd95 100644 --- a/T05贸易门市管理/TradeMarket.dproj +++ b/T05贸易门市管理/TradeMarket.dproj @@ -237,7 +237,6 @@
frmItemizedListQtyInPut
- dfm
Cfg_2 diff --git a/T05贸易门市管理/U_GetDllForm.pas b/T05贸易门市管理/U_GetDllForm.pas index 1bc56bc..1c16d6f 100644 --- a/T05贸易门市管理/U_GetDllForm.pas +++ b/T05贸易门市管理/U_GetDllForm.pas @@ -15,7 +15,8 @@ function GetsysParam(muserId: pchar; fparam1: pchar): Boolean; implementation uses - U_DataLink, U_iniParam, U_TradeMarketList, U_TradeDispatchedList; + U_DataLink, U_iniParam, U_TradeMarketList, U_TradeDispatchedList, + U_TradeMarketList_JD; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -76,7 +77,7 @@ begin DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server; // DParameters1:='Ȩ'; //Parameters1 := ''; - Parameters1 := 'ѯ'; +// Parameters1 := 'ѯ'; // Parameters2 := '֯'; // Parameters4 := ''; DCode := 'ADMIN'; @@ -141,6 +142,18 @@ begin mnewHandle := Handle; end; end; + 112: // + begin + with TfrmTradeMarketList_JD.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10), FormID, Title) do // + begin + fFormID := FormID; + FOrdType := ''; + FormStyle := mstyle; + WindowState := mstate; + BorderStyle := mborderstyle; + mnewHandle := Handle; + end; + end; // 112: // // begin diff --git a/T05贸易门市管理/U_TradeMarketInPut.dfm b/T05贸易门市管理/U_TradeMarketInPut.dfm index f088296..e977b43 100644 --- a/T05贸易门市管理/U_TradeMarketInPut.dfm +++ b/T05贸易门市管理/U_TradeMarketInPut.dfm @@ -9,6 +9,8 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Position = poMainFormCenter WindowState = wsMaximized OnClose = FormClose + ExplicitLeft = -391 + ExplicitTop = -123 ExplicitWidth = 1937 ExplicitHeight = 775 PixelsPerInch = 96 @@ -417,7 +419,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut object Tv1Column19: TcxGridDBColumn Tag = 2 Caption = #20986#24211#25968#37327 - DataBinding.FieldName = 'Qty' + DataBinding.FieldName = 'OutQty' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False @@ -437,6 +439,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut Align = alRight Caption = 'Panel4' TabOrder = 1 + Visible = False object Panel5: TPanel Left = 1 Top = 1 diff --git a/T05贸易门市管理/U_TradeMarketInPut.pas b/T05贸易门市管理/U_TradeMarketInPut.pas index 85e44aa..78b447e 100644 --- a/T05贸易门市管理/U_TradeMarketInPut.pas +++ b/T05贸易门市管理/U_TradeMarketInPut.pas @@ -492,7 +492,7 @@ begin sql.Add(' SELECT distinct A.C_Code,A.C_Name,A.qtyunit,A.HotQty,StkQty = SUM(B.StkQty) '); SQL.ADD(' FROM Bs_Cloth_Info A LEFT JOIN Bs_Cloth_Io B on A.C_Code=B.C_Code'); sql.add(' where B.ioflag='''' '); - if Trim(canshu4) = '' then + if Trim(canshu4) = '' then sql.Add(' and isnull(STKNAME,'''')='''' '); SQL.add('group by A.C_Code,A.C_Name,A.qtyunit,A.HotQty'); SQL.ADD('order by A.C_Code '); @@ -1478,7 +1478,6 @@ begin // Ƿ˫ Qty Уͨжϣ if AColumn.Name = 'Tv1Column19' then begin - if not CDS_1.IsEmpty then begin // ȡǰеID diff --git a/T05贸易门市管理/U_TradeMarketList.dfm b/T05贸易门市管理/U_TradeMarketList.dfm index a482992..8f60edd 100644 --- a/T05贸易门市管理/U_TradeMarketList.dfm +++ b/T05贸易门市管理/U_TradeMarketList.dfm @@ -21,7 +21,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList Height = 30 AutoSize = True ButtonHeight = 30 - ButtonWidth = 99 + ButtonWidth = 107 Caption = 'ToolBar1' Images = DataLink_TradeMarket.cxImageList_bar List = True @@ -36,7 +36,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBRafreshClick end object TBAdd: TToolButton - Left = 71 + Left = 63 Top = 0 AutoSize = True Caption = #26032#22686 @@ -44,7 +44,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBAddClick end object btnCopy: TToolButton - Left = 142 + Left = 126 Top = 0 AutoSize = True Caption = #22797#21046 @@ -52,7 +52,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = btnCopyClick end object TBEdit: TToolButton - Left = 213 + Left = 189 Top = 0 AutoSize = True Caption = #20462#25913 @@ -60,7 +60,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBEditClick end object TBDel: TToolButton - Left = 284 + Left = 252 Top = 0 AutoSize = True Caption = #21024#38500 @@ -68,7 +68,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBDelClick end object TBPrint: TToolButton - Left = 355 + Left = 315 Top = 0 AutoSize = True Caption = #25171#21360 @@ -76,7 +76,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBPrintClick end object TBCK: TToolButton - Left = 426 + Left = 378 Top = 0 AutoSize = True Caption = #26597#30475 @@ -84,7 +84,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBCKClick end object ToolButton4: TToolButton - Left = 497 + Left = 441 Top = 0 AutoSize = True Caption = #38468#20214 @@ -92,39 +92,39 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = ToolButton4Click end object TBTJ: TToolButton - Left = 568 + Left = 504 Top = 0 AutoSize = True - Caption = #25552#20132 + Caption = #37197#36135#23436#25104 ImageIndex = 12 OnClick = TBTJClick end object TBTJCX: TToolButton - Left = 639 + Left = 591 Top = 0 AutoSize = True - Caption = #25764#38144#25552#20132 + Caption = #25764#38144#37197#36135#23436#25104 ImageIndex = 11 OnClick = TBTJCXClick end object TWC: TToolButton - Left = 742 + Left = 702 Top = 0 AutoSize = True - Caption = #23436#25104 + Caption = #24050#35013#36710 ImageIndex = 12 OnClick = TWCClick end object TNowc: TToolButton - Left = 813 + Left = 777 Top = 0 AutoSize = True - Caption = #25764#38144#23436#25104 + Caption = #25764#38144#35013#36710 ImageIndex = 11 OnClick = TNowcClick end object ToolButton2: TToolButton - Left = 916 + Left = 864 Top = 0 AutoSize = True Caption = #20445#23384#26684#24335 @@ -132,7 +132,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = ToolButton2Click end object ToolButton1: TToolButton - Left = 1019 + Left = 951 Top = 0 AutoSize = True Caption = #23548#20986 @@ -140,7 +140,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = ToolButton1Click end object TBClose: TToolButton - Left = 1090 + Left = 1014 Top = 0 AutoSize = True Caption = #20851#38381 @@ -148,7 +148,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBCloseClick end object TBZF: TToolButton - Left = 1161 + Left = 1077 Top = 0 AutoSize = True Caption = #20316#24223 @@ -156,7 +156,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList OnClick = TBZFClick end object TBNOZF: TToolButton - Left = 1232 + Left = 1140 Top = 0 AutoSize = True Caption = #25764#38144#20316#24223 @@ -499,6 +499,13 @@ inherited frmTradeMarketList: TfrmTradeMarketList Options.Editing = False Width = 88 end + object Tv1Column25: TcxGridDBColumn + Caption = #35746#21333#31867#22411 + DataBinding.FieldName = 'OrdType' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 @@ -513,11 +520,12 @@ inherited frmTradeMarketList: TfrmTradeMarketList TabOrder = 2 Properties.CustomButtons.Buttons = <> Properties.Style = 9 - Properties.TabIndex = 3 + Properties.TabIndex = 0 Properties.Tabs.Strings = ( - ' '#24453#25552#20132' ' - ' '#24453#23457#26680' ' - ' '#24050#23436#25104' ' + ' '#26410#37197#36135' ' + ' '#24050#37197#36135' ' + ' '#24050#35013#36710' ' + ' '#24050#22238#21333' ' ' '#24050#20316#24223' ' ' '#20840#37096' ') OnChange = cxTabControl1Change diff --git a/T05贸易门市管理/U_TradeMarketList.pas b/T05贸易门市管理/U_TradeMarketList.pas index e03a541..2f0353e 100644 --- a/T05贸易门市管理/U_TradeMarketList.pas +++ b/T05贸易门市管理/U_TradeMarketList.pas @@ -102,6 +102,7 @@ type Tv1Column24: TcxGridDBColumn; TBZF: TToolButton; TBNOZF: TToolButton; + Tv1Column25: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -281,20 +282,24 @@ begin SqlStr := SqlStr + ' ,@Filler= ' + QuotedStr(Trim(DName)); SqlStr := SqlStr + ' ,@Stores= ' + QuotedStr(Trim(canshu4)); - case cxTabControl1.TabIndex of + case cxTabControl1.TabIndex of // 1δ29װ 10ѻص 0: begin - SqlStr := SqlStr + ' , @Status=''0'' '; //ύ + SqlStr := SqlStr + ' , @Status=''1'' '; //ύ end; 1: begin - SqlStr := SqlStr + ' , @Status=''1'' '; // + SqlStr := SqlStr + ' , @Status=''2'' '; // end; 2: begin - SqlStr := SqlStr + ' , @Status=''10'' '; // + SqlStr := SqlStr + ' , @Status=''9'' '; // end; 3: + begin + SqlStr := SqlStr + ' , @Status=''10'' '; //ѻص + end; + 4: begin SqlStr := SqlStr + ' , @Status=''11'' '; // end; @@ -414,7 +419,7 @@ begin begin close; sql.Clear; - sql.Add('update Trade_Market_Main SET status=''10'' '); + sql.Add('update Trade_Market_Main SET status=''1'' '); sql.Add('where TMMId=' + quotedstr(trim(Order_Main.fieldbyname('TMMId').AsString))); sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) '); @@ -501,10 +506,39 @@ begin end; procedure TfrmTradeMarketList.TBPrintClick(Sender: TObject); +var + WSql: string; begin if Order_Main.IsEmpty then Exit; - + if Order_Main.Locate('SSel', True, []) = False then + begin + Application.MessageBox('ûѡ', 'ʾ', 0); + Exit; + end; + WSql := ''; + Order_Main.DisableControls; + with Order_Main do + begin + First; + while not Eof do + 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; + end; + Next; + end; + end; + Order_Main.Locate('SSel', True, []); + Order_Main.EnableControls; try frmLabelPrint := TfrmLabelPrint.Create(Application); with frmLabelPrint do @@ -513,7 +547,7 @@ begin FLMType := 'TradePlanPrintxy' else FLMType := 'TradePlanPrint'; - FFiltration1 := Trim(Order_Main.fieldbyname('TMMId').AsString); + FFiltration1 := Trim(WSql); if ShowModal = 1 then begin // Self.InitGrid(); @@ -859,7 +893,7 @@ begin begin close; sql.Clear; - sql.Add('update Trade_Market_Main SET status=''10'' '); + sql.Add('update Trade_Market_Main SET status=''9'' '); sql.Add('where TMMId=' + quotedstr(trim(Order_Main.fieldbyname('TMMId').AsString))); sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) '); @@ -905,7 +939,7 @@ begin begin close; sql.Clear; - sql.Add('update Trade_Market_Main SET status=''1'' '); + sql.Add('update Trade_Market_Main SET status=''2'' '); sql.Add('where TMMId=' + quotedstr(trim(Order_Main.fieldbyname('TMMId').AsString))); sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) '); @@ -960,7 +994,7 @@ begin begin close; sql.Clear; - sql.Add('update Trade_Market_Main SET status=''1'' '); + sql.Add('update Trade_Market_Main SET status=''2'' '); sql.Add(' where TMMId=' + quotedstr(trim(Order_Main.fieldbyname('TMMId').AsString))); sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( '); sql.Add(' ' + quotedstr(trim(DName))); @@ -1019,7 +1053,7 @@ begin begin close; sql.Clear; - sql.Add('update Trade_Market_Main SET status=''0'' '); + sql.Add('update Trade_Market_Main SET status=''1'' '); sql.Add(' where TMMId=' + quotedstr(trim(Order_Main.fieldbyname('TMMId').AsString))); sql.Add(' and isnull(status,''0'')=''1'' '); sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( '); diff --git a/T05贸易门市管理/U_TradeMarketList_JD.dfm b/T05贸易门市管理/U_TradeMarketList_JD.dfm new file mode 100644 index 0000000..0bff5c1 --- /dev/null +++ b/T05贸易门市管理/U_TradeMarketList_JD.dfm @@ -0,0 +1,591 @@ +inherited frmTradeMarketList_JD: TfrmTradeMarketList_JD + Left = 165 + Top = 13 + Caption = #22823#36135#21333 + ClientHeight = 634 + ClientWidth = 1423 + Color = clBtnFace + Font.Height = -16 + FormStyle = fsMDIChild + Position = poScreenCenter + Visible = True + ExplicitWidth = 1439 + ExplicitHeight = 673 + PixelsPerInch = 96 + TextHeight = 21 + inherited loadProcess: TPanel + Left = 720 + Top = 354 + ExplicitLeft = 720 + ExplicitTop = 354 + end + inherited cxProgressBar2: TcxProgressBar + Left = 720 + Top = 296 + ExplicitLeft = 720 + ExplicitTop = 296 + ExplicitHeight = 29 + end + object Panel1: TPanel [2] + Left = 0 + Top = 0 + Width = 784 + Height = 634 + Align = alLeft + TabOrder = 2 + object ToolBar1: TToolBar + Tag = 1 + Left = 1 + Top = 1 + Width = 782 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 67 + Caption = 'ToolBar1' + Images = DataLink_TradeMarket.cxImageList_bar + List = True + ShowCaptions = True + TabOrder = 0 + end + object cxGrid1: TcxGrid + Left = 1 + Top = 31 + Width = 782 + Height = 370 + Align = alTop + TabOrder = 1 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DataSource1 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.CellHints = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.IndicatorWidth = 30 + object v1Column16: TcxGridDBColumn + Caption = #26159#21542#21152#24613 + DataBinding.FieldName = 'Urgent' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 77 + end + object Tv1Column7: TcxGridDBColumn + Caption = #21333#25454#32534#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 77 + end + object v1OrdDate: TcxGridDBColumn + Caption = #21046#21333#26085#26399 + DataBinding.FieldName = 'TMMDate' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxDateEditProperties' + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object Tv1Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object Tv1Column8: TcxGridDBColumn + Caption = #37197#36135#20154 + DataBinding.FieldName = 'C_Code' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object Tv1Column6: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'FILLER' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object Tv1Column1: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object cxGrid2: TcxGrid + Left = 1 + Top = 401 + Width = 782 + Height = 232 + Align = alClient + TabOrder = 2 + ExplicitTop = 407 + ExplicitHeight = 226 + object Tv2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DataSource2 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.CellHints = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.IndicatorWidth = 30 + object Tv2Column1: TcxGridDBColumn + Caption = #26159#21542#21152#24613 + DataBinding.FieldName = 'Urgent' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv2Column2: TcxGridDBColumn + Caption = #21333#25454#32534#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv2Column3: TcxGridDBColumn + Caption = #21046#21333#26085#26399 + DataBinding.FieldName = 'TMMDate' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxDateEditProperties' + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv2Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv2Column5: TcxGridDBColumn + Caption = #37197#36135#20154 + DataBinding.FieldName = 'C_Code' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv2Column6: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'FILLER' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv2Column7: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + end + object cxGridLevel1: TcxGridLevel + GridView = Tv2 + end + end + end + object Panel2: TPanel [3] + Left = 784 + Top = 0 + Width = 639 + Height = 634 + Align = alClient + TabOrder = 3 + ExplicitLeft = 789 + ExplicitWidth = 634 + object ToolBar2: TToolBar + Tag = 1 + Left = 1 + Top = 1 + Width = 637 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 67 + Caption = 'ToolBar1' + Images = DataLink_TradeMarket.cxImageList_bar + List = True + ShowCaptions = True + TabOrder = 0 + ExplicitWidth = 632 + end + object cxGrid3: TcxGrid + Left = 1 + Top = 31 + Width = 637 + Height = 364 + Align = alTop + TabOrder = 1 + object Tv3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DataSource3 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.CellHints = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.IndicatorWidth = 30 + object Tv3Column1: TcxGridDBColumn + Caption = #26159#21542#21152#24613 + DataBinding.FieldName = 'Urgent' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column2: TcxGridDBColumn + Caption = #21333#25454#32534#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column3: TcxGridDBColumn + Caption = #21046#21333#26085#26399 + DataBinding.FieldName = 'TMMDate' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxDateEditProperties' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column5: TcxGridDBColumn + Caption = #37197#36135#20154 + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column6: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'FILLER' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv3Column7: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + end + object cxGridLevel2: TcxGridLevel + GridView = Tv3 + end + end + object cxGrid4: TcxGrid + Left = 1 + Top = 395 + Width = 637 + Height = 238 + Align = alClient + TabOrder = 2 + ExplicitTop = 407 + ExplicitWidth = 632 + ExplicitHeight = 226 + object Tv4: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + ScrollbarAnnotations.CustomAnnotations = <> + DataController.DataSource = DataSource4 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.CellHints = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.IndicatorWidth = 30 + object Tv4Column1: TcxGridDBColumn + Caption = #26159#21542#21152#24613 + DataBinding.FieldName = 'Urgent' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column2: TcxGridDBColumn + Caption = #21333#25454#32534#21495 + DataBinding.FieldName = 'TMMNo' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column3: TcxGridDBColumn + Caption = #21046#21333#26085#26399 + DataBinding.FieldName = 'TMMDate' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxDateEditProperties' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column4: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustName' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column5: TcxGridDBColumn + Caption = #37197#36135#20154 + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column6: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'FILLER' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv4Column7: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'OrdNote' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + end + object cxGridLevel3: TcxGridLevel + GridView = Tv4 + end + end + end + inherited ADOQueryBaseCmd: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + Left = 255 + Top = 314 + end + inherited ADOQueryBaseTemp: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + Left = 37 + Top = 280 + end + object cxgrdpmn1: TcxGridPopupMenu + PopupMenus = <> + Left = 220 + Top = 284 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + Parameters = <> + Left = 568 + Top = 240 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 292 + Top = 128 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 320 + Top = 224 + end + object DataSource1: TDataSource + DataSet = CDS_1 + Left = 468 + Top = 112 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 156 + Top = 144 + end + object DataSource2: TDataSource + DataSet = CDS_2 + Left = 152 + Top = 476 + end + object ADOQueryImage: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + EnableBCD = False + Parameters = <> + Left = 316 + Top = 283 + end + object DSImage: TDataSource + DataSet = ADOQueryImage + Left = 256 + Top = 192 + end + object IdFTP1: TIdFTP + ConnectTimeout = 0 + NATKeepAlive.UseKeepAlive = False + NATKeepAlive.IdleTimeMS = 0 + NATKeepAlive.IntervalMS = 0 + ProxySettings.ProxyType = fpcmNone + ProxySettings.Port = 0 + ReadTimeout = 0 + Left = 36 + Top = 170 + end + object PopupMenu2: TPopupMenu + Left = 532 + Top = 636 + object N3: TMenuItem + Caption = #20840#36873 + end + object N4: TMenuItem + Caption = #20840#24323 + end + object N2: TMenuItem + Caption = #22797#21046 + end + end + object cxgrdpmn2: TcxGridPopupMenu + PopupMenus = <> + Left = 660 + Top = 636 + end + object CDS_WXTS: TClientDataSet + Aggregates = <> + Params = <> + Left = 252 + Top = 240 + end + object GPM_3: TcxGridPopupMenu + PopupMenus = <> + Left = 188 + Top = 236 + end + object CDS_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 524 + Top = 96 + end + object DataSource3: TDataSource + DataSet = CDS_3 + Left = 932 + Top = 176 + end + object CDS_2: TClientDataSet + Aggregates = <> + Params = <> + Left = 228 + Top = 464 + end + object DataSource4: TDataSource + DataSet = CDS_4 + Left = 940 + Top = 472 + end + object CDS_4: TClientDataSet + Aggregates = <> + Params = <> + Left = 996 + Top = 464 + end + object CDS_3: TClientDataSet + Aggregates = <> + Params = <> + Left = 1012 + Top = 216 + end + object ADO_1: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 452 + Top = 176 + end + object ADO_2: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 308 + Top = 464 + end + object ADO_3: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 884 + Top = 120 + end + object ADO_4: TADOQuery + Connection = DataLink_TradeMarket.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 860 + Top = 464 + end +end diff --git a/T05贸易门市管理/U_TradeMarketList_JD.pas b/T05贸易门市管理/U_TradeMarketList_JD.pas new file mode 100644 index 0000000..e963b94 --- /dev/null +++ b/T05贸易门市管理/U_TradeMarketList_JD.pas @@ -0,0 +1,214 @@ +unit U_TradeMarketList_JD; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo, + cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit, + StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils, + cxCurrencyEdit, cxImage, cxDBEdit, Menus, RM_Common, RM_Class, RM_e_Xls, + RM_Dataset, RM_System, RM_GridReport, cxGridCustomPopupMenu, cxGridPopupMenu, + cxPC, cxSplitter, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, + IdFTP, ShellAPI, cxDropDownEdit, cxCheckBox, RM_e_Graphic, RM_e_Jpeg, + cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, Math, + dxDateRanges, IdExplicitTLSClientServerBase, U_BaseList, Vcl.Clipbrd, + dxScrollbarAnnotations, cxProgressBar, FrameDateSel, dxSkinsCore, + dxSkinsDefaultPainters; + +type + TfrmTradeMarketList_JD = class(TfrmBaseList) + cxgrdpmn1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Order_Main: TClientDataSet; + DataSource2: TDataSource; + ADOQueryImage: TADOQuery; + DSImage: TDataSource; + IdFTP1: TIdFTP; + PopupMenu2: TPopupMenu; + N3: TMenuItem; + N4: TMenuItem; + cxgrdpmn2: TcxGridPopupMenu; + CDS_WXTS: TClientDataSet; + N2: TMenuItem; + GPM_3: TcxGridPopupMenu; + Panel1: TPanel; + ToolBar1: TToolBar; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1Column16: TcxGridDBColumn; + Tv1Column7: TcxGridDBColumn; + v1OrdDate: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column8: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + cxGrid2: TcxGrid; + Tv2: TcxGridDBTableView; + cxGridLevel1: TcxGridLevel; + Panel2: TPanel; + ToolBar2: TToolBar; + cxGrid3: TcxGrid; + Tv3: TcxGridDBTableView; + cxGridLevel2: TcxGridLevel; + cxGrid4: TcxGrid; + Tv4: TcxGridDBTableView; + cxGridLevel3: TcxGridLevel; + CDS_1: TClientDataSet; + DataSource3: TDataSource; + CDS_2: TClientDataSet; + DataSource4: TDataSource; + CDS_4: TClientDataSet; + CDS_3: TClientDataSet; + Tv2Column1: TcxGridDBColumn; + Tv2Column2: TcxGridDBColumn; + Tv2Column3: TcxGridDBColumn; + Tv2Column4: TcxGridDBColumn; + Tv2Column5: TcxGridDBColumn; + Tv2Column6: TcxGridDBColumn; + Tv2Column7: TcxGridDBColumn; + Tv3Column1: TcxGridDBColumn; + Tv3Column2: TcxGridDBColumn; + Tv3Column3: TcxGridDBColumn; + Tv3Column4: TcxGridDBColumn; + Tv3Column5: TcxGridDBColumn; + Tv3Column6: TcxGridDBColumn; + Tv4Column1: TcxGridDBColumn; + Tv4Column2: TcxGridDBColumn; + Tv4Column3: TcxGridDBColumn; + Tv4Column4: TcxGridDBColumn; + Tv4Column5: TcxGridDBColumn; + Tv4Column6: TcxGridDBColumn; + Tv4Column7: TcxGridDBColumn; + Tv3Column7: TcxGridDBColumn; + ADO_1: TADOQuery; + ADO_2: TADOQuery; + ADO_3: TADOQuery; + ADO_4: TADOQuery; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormShow(Sender: TObject); + private + DQdate: TDateTime; + procedure InitGrid(); + procedure InitGrid1(); + procedure InitGrid2(); + procedure InitGrid3(); + procedure InitGrid4(); +// procedure InitForm(); + + { Private declarations } + public + canshu1, canshu2, canshu4, FOrdType: string; + + { Public declarations } + end; + +var + frmTradeMarketList_JD: TfrmTradeMarketList_JD; + +implementation + +uses + U_DataLink, U_RTFun, U_ZDYHelp, U_LabelPrint, U_AttachmentUpload, + U_TradeMarketInPut; + +{$R *.dfm} + +procedure TfrmTradeMarketList_JD.FormClose(Sender: TObject; var Action: TCloseAction); +begin + inherited; + inherited; + Action := caFree; +end; + +procedure TfrmTradeMarketList_JD.FormShow(Sender: TObject); +begin + inherited; + InitGrid(); +// InitForm(); +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); +end; + +procedure TfrmTradeMarketList_JD.InitGrid1(); +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); +end; + +procedure TfrmTradeMarketList_JD.InitGrid2(); +begin + with ADO_2 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_2, CDS_2); + SInitCDSData(ADO_2, CDS_2); +end; + +procedure TfrmTradeMarketList_JD.InitGrid3(); +begin + with ADO_3 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_3, CDS_3); + SInitCDSData(ADO_3, CDS_3); +end; + +procedure TfrmTradeMarketList_JD.InitGrid4(); +begin + with ADO_4 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_4, CDS_4); + SInitCDSData(ADO_4, CDS_4); +end; + +end. + diff --git a/T05贸易门市管理/U_TradeMarketQtyInPut.dfm b/T05贸易门市管理/U_TradeMarketQtyInPut.dfm index d93a50a..319588c 100644 --- a/T05贸易门市管理/U_TradeMarketQtyInPut.dfm +++ b/T05贸易门市管理/U_TradeMarketQtyInPut.dfm @@ -48,6 +48,7 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut AutoSize = True Caption = #20445#23384 ImageIndex = 16 + Visible = False OnClick = TBSaveClick end object btnAdd: TToolButton @@ -56,6 +57,7 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut AutoSize = True Caption = #26032#22686 ImageIndex = 2 + Visible = False OnClick = btnAddClick end object TBClose: TToolButton @@ -81,6 +83,7 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut Height = 41 Align = alTop TabOrder = 1 + Visible = False object Label9: TLabel Left = 33 Top = 7 @@ -129,7 +132,7 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut Width = 1079 Height = 603 Align = alClient - Caption = #21452#20987#21024#38500#26126#32454#20449#24687 + Caption = #26126#32454#20449#24687 TabOrder = 2 object cxGrid1: TcxGrid Left = 2 @@ -138,6 +141,8 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut Height = 578 Align = alClient TabOrder = 0 + ExplicitLeft = 4 + ExplicitTop = 22 object Tv1: TcxGridDBTableView OnDblClick = Tv1DblClick Navigator.Buttons.CustomButtons = <> @@ -189,6 +194,13 @@ inherited frmTradeMarketQtyInPut: TfrmTradeMarketQtyInPut Options.Sorting = False Width = 66 end + object Tv1Column1: TcxGridDBColumn + Caption = #20986#24211#26465#30721 + DataBinding.FieldName = 'StkID' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 95 + end end object cxGridLevel1: TcxGridLevel GridView = Tv1 diff --git a/T05贸易门市管理/U_TradeMarketQtyInPut.pas b/T05贸易门市管理/U_TradeMarketQtyInPut.pas index 0560636..376ddc6 100644 --- a/T05贸易门市管理/U_TradeMarketQtyInPut.pas +++ b/T05贸易门市管理/U_TradeMarketQtyInPut.pas @@ -41,6 +41,7 @@ type cxGridDBColumn8: TcxGridDBColumn; cxGridLevel1: TcxGridLevel; btnAdd: TToolButton; + Tv1Column1: TcxGridDBColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure FromCoNameDblClick(Sender: TObject); @@ -241,13 +242,15 @@ begin inherited; ReadCxGrid('', Tv1, 'óй'); - with ADOQueryTemp do begin Close; SQL.Clear; - sql.Add(' select A.* from Trade_Market_Sub_Qty A'); - sql.Add('where TMSId=''' + Trim(PMTMSId) + ''''); +// sql.Add(' select A.* from Trade_Market_Sub_Qty A'); +// sql.Add('where A.TMSId=''' + Trim(PMTMSId) + ''''); + sql.Add(' select * from Bs_Cloth_IO A inner join Trade_Market_Sub B on A.TMMID=B.TMMId and A.TMSId=B.TMSId'); + sql.Add('where A.TMSId=''' + Trim(MTMSId) + ''''); +// showmessage(sql.text); Open; end; SCreateCDS(ADOQueryTemp, CDS_1); @@ -311,8 +314,6 @@ begin end; end; - - procedure TfrmTradeMarketQtyInPut.TBCloseClick(Sender: TObject); begin inherited;