From 1971993b0302496ceaadf4d9bb7566d96bb862e5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E401PHE\\Administrator" Date: Wed, 11 Jun 2025 11:06:19 +0800 Subject: [PATCH] ~ --- 基础数据/SYSTEMSET.ini | 7 +- 基础数据/U_CPTypeBM.dfm | 11 +- 基础数据/U_CPTypeBM.pas | 23 +- 基础数据/U_DataLink.pas | 17 +- 基础数据/U_FileUp.dfm | 190 +++ 基础数据/U_FileUp.pas | 375 +++++ 基础资料维护(BaseInfo.dll)/U_GetDllForm.pas | 6 +- 基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.dfm | 227 +++ 基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.pas | 481 ++++++ .../U_ZdyAttInputCP.dfm | 13 - .../U_ZdyAttInputCP.pas | 2 - .../U_ZdyAttInputGYS.dfm | 4 +- .../U_ZdyAttInputGYS.pas | 62 +- .../U_ZdyAttInputPB.dfm | 23 +- .../U_ZdyAttInputPB.pas | 7 +- 基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.dfm | 22 - 基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.pas | 5 +- 基础资料维护(BaseInfo.dll)/U_ZdyAttachGYS.pas | 6 +- 基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm | 31 +- 基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas | 307 ++-- 管理系统/U_ClothContractCPCKList.dfm | 770 ++++++++++ 管理系统/U_ClothContractCPCKList.pas | 870 +++++++++++ 管理系统/U_ClothContractCPInPut.dfm | 628 ++++++++ 管理系统/U_ClothContractCPInPut.pas | 1317 +++++++++++++++++ 管理系统/U_ClothContractCPRKList.dfm | 770 ++++++++++ 管理系统/U_ClothContractCPRKList.pas | 889 +++++++++++ 管理系统/U_ClothContractInPut.dfm | 10 - 管理系统/U_ClothContractInPut.pas | 2 - 管理系统/U_ClothContractInPut_CG.dfm | 12 +- 管理系统/U_ClothContractInPut_CG.pas | 22 +- 管理系统/U_ClothContractInPut_Tp.dfm | 56 +- 管理系统/U_ClothContractInPut_Tp.pas | 29 +- 管理系统/U_ClothContractList.dfm | 6 +- 管理系统/U_ClothContractList_CG.dfm | 2 +- 管理系统/U_ClothContractList_CK.dfm | 29 +- 管理系统/U_ClothContractList_CK.pas | 14 +- 管理系统/U_ClothContractList_CK_help.dfm | 813 ++++++++++ 管理系统/U_ClothContractList_CK_help.pas | 962 ++++++++++++ 管理系统/U_ClothContractList_DY.dfm | 8 + 管理系统/U_ClothContractList_DY.pas | 7 +- 管理系统/U_ClothContractList_TP.dfm | 30 + 管理系统/U_ClothContractList_TP.pas | 9 +- 管理系统/U_ClothContractList_TPXZ.dfm | 863 +++++++++++ 管理系统/U_ClothContractList_TPXZ.pas | 919 ++++++++++++ 管理系统/U_ClothContractList_help.pas | 7 +- 管理系统/U_ClothTPHWZYInput.dfm | 696 +++++++++ 管理系统/U_ClothTPHWZYInput.pas | 1066 +++++++++++++ 管理系统/U_ClothTP_HWZY.dfm | 822 ++++++++++ 管理系统/U_ClothTP_HWZY.pas | 962 ++++++++++++ 管理系统/U_GetDllForm.pas | 79 +- 50 files changed, 14101 insertions(+), 387 deletions(-) create mode 100644 基础数据/U_FileUp.dfm create mode 100644 基础数据/U_FileUp.pas create mode 100644 基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.dfm create mode 100644 基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.pas create mode 100644 管理系统/U_ClothContractCPCKList.dfm create mode 100644 管理系统/U_ClothContractCPCKList.pas create mode 100644 管理系统/U_ClothContractCPInPut.dfm create mode 100644 管理系统/U_ClothContractCPInPut.pas create mode 100644 管理系统/U_ClothContractCPRKList.dfm create mode 100644 管理系统/U_ClothContractCPRKList.pas create mode 100644 管理系统/U_ClothContractList_CK_help.dfm create mode 100644 管理系统/U_ClothContractList_CK_help.pas create mode 100644 管理系统/U_ClothContractList_TPXZ.dfm create mode 100644 管理系统/U_ClothContractList_TPXZ.pas create mode 100644 管理系统/U_ClothTPHWZYInput.dfm create mode 100644 管理系统/U_ClothTPHWZYInput.pas create mode 100644 管理系统/U_ClothTP_HWZY.dfm create mode 100644 管理系统/U_ClothTP_HWZY.pas diff --git a/基础数据/SYSTEMSET.ini b/基础数据/SYSTEMSET.ini index 576e966..298b3a5 100644 --- a/基础数据/SYSTEMSET.ini +++ b/基础数据/SYSTEMSET.ini @@ -1,6 +1,5 @@ [SERVER] -ַ=122.226.88.254 -ַ=10 +ַ=101.132.143.144 +ַ=943 ǷԶ=1 -= -122.226.88.254 \ No newline at end of file +=֯ \ No newline at end of file diff --git a/基础数据/U_CPTypeBM.dfm b/基础数据/U_CPTypeBM.dfm index 610c2d2..cdb0999 100644 --- a/基础数据/U_CPTypeBM.dfm +++ b/基础数据/U_CPTypeBM.dfm @@ -22,7 +22,7 @@ object frmCPTypeBM: TfrmCPTypeBM Width = 854 Height = 33 ButtonHeight = 30 - ButtonWidth = 83 + ButtonWidth = 107 Caption = 'ToolBar1' Color = clSkyBlue DisabledImages = BaseData10_DataLink.ThreeImgList @@ -64,9 +64,16 @@ object frmCPTypeBM: TfrmCPTypeBM ImageIndex = 17 OnClick = TBDelClick end - object TBClose: TToolButton + object ToolButton2: TToolButton Left = 276 Top = 0 + Caption = #39029#22836#22270#29255#19978#20256 + ImageIndex = 68 + OnClick = ToolButton2Click + end + object TBClose: TToolButton + Left = 383 + Top = 0 AutoSize = True Caption = #20851#38381 ImageIndex = 55 diff --git a/基础数据/U_CPTypeBM.pas b/基础数据/U_CPTypeBM.pas index eeb2eb6..db95fa1 100644 --- a/基础数据/U_CPTypeBM.pas +++ b/基础数据/U_CPTypeBM.pas @@ -42,6 +42,7 @@ type CPTopName: TEdit; CPName: TEdit; CPNo: TEdit; + ToolButton2: TToolButton; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBRafreshClick(Sender: TObject); @@ -52,6 +53,7 @@ type procedure TBDelClick(Sender: TObject); procedure CPNameKeyPress(Sender: TObject; var Key: Char); procedure FormShow(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); private { Private declarations } PState: Integer; @@ -68,7 +70,7 @@ var implementation uses - U_DataLink, U_Fun; + U_DataLink, U_Fun,U_FileUp; {$R *.dfm} @@ -265,6 +267,25 @@ begin end; InitTree(); end; + +procedure TfrmCPTypeBM.ToolButton2Click(Sender: TObject); +begin + try + frmFileUp := TfrmFileUp.Create(Application); + with frmFileUp do + begin + Code.Text :='ҳͷͼƬ'; + CYID :='YTTP20250101'; + if ShowModal = 1 then + begin +// Self.InitGrid(); +// Self.CDS_Main.Locate('CYID', CYID, []); + end; + end; + finally + frmFileUp.Free; + end; +end; end. diff --git a/基础数据/U_DataLink.pas b/基础数据/U_DataLink.pas index 5ab228d..b3803f5 100644 --- a/基础数据/U_DataLink.pas +++ b/基础数据/U_DataLink.pas @@ -4,7 +4,21 @@ interface uses SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels, - Windows,Messages,forms,OleCtnrs,DateUtils, ExtCtrls, AppEvnts, cxClasses; + Windows,Messages,forms,OleCtnrs,DateUtils, ExtCtrls, AppEvnts, cxClasses, + dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, + dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, + dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, + dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, + dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, + dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, + dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, + dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, + dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, + dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue; var DConString:String; {ȫַ} server, dtbase, user, pswd: String; {ݿӲ} @@ -13,6 +27,7 @@ var DCode:string ; //#û#// Ddatabase:string; //#ݿ#// DTitCaption:string; //##// + UserDataFlag:string; PicSvr:string; DParameters1,DParameters2,DParameters3,DParameters4,DParameters5:string;// ⲿ DParameters6,DParameters7,DParameters8,DParameters9,DParameters10:string;//ⲿ diff --git a/基础数据/U_FileUp.dfm b/基础数据/U_FileUp.dfm new file mode 100644 index 0000000..0e1c284 --- /dev/null +++ b/基础数据/U_FileUp.dfm @@ -0,0 +1,190 @@ +object frmFileUp: TfrmFileUp + Left = 247 + Top = 162 + Width = 660 + Height = 441 + Caption = #19978#20256#25991#20214 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object cxGrid7: TcxGrid + Left = 0 + Top = 41 + Width = 581 + Height = 361 + Align = alClient + TabOrder = 0 + object TV7: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False + OptionsView.GroupByBox = False + OptionsView.Indicator = True + object FileName: TcxGridDBColumn + Tag = 1 + Caption = #25991#20214#21517#31216 + DataBinding.FieldName = 'FileName' + FooterAlignmentHorz = taCenter + HeaderAlignmentHorz = taCenter + Width = 121 + end + object FileDate: TcxGridDBColumn + Tag = 1 + Caption = #19978#20256#26085#26399 + DataBinding.FieldName = 'FileDate' + FooterAlignmentHorz = taCenter + HeaderAlignmentHorz = taCenter + Width = 104 + end + end + object cxGridLevel6: TcxGridLevel + GridView = TV7 + end + end + object Panel16: TPanel + Left = 190 + Top = 126 + Width = 138 + Height = 30 + BevelInner = bvRaised + Caption = #27491#22312#19978#20256#12290#12290#12290 + Color = clSkyBlue + TabOrder = 1 + Visible = False + end + object ToolBar6: TToolBar + Left = 581 + Top = 41 + Width = 63 + Height = 361 + Align = alRight + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Flat = True + Images = BaseData10_DataLink.ThreeImgList + List = True + ShowCaptions = True + TabOrder = 2 + object FileUp: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #19978#20256 + ImageIndex = 109 + Wrap = True + OnClick = FileUpClick + end + object FileDel: TToolButton + Left = 0 + Top = 30 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Wrap = True + OnClick = FileDelClick + end + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 644 + Height = 41 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 3 + object Label1: TLabel + Left = 8 + Top = 14 + Width = 68 + Height = 16 + Caption = #20135#21697#32534#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -16 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Image2: TImage + Left = 445 + Top = 9 + Width = 60 + Height = 28 + end + object Code: TEdit + Left = 78 + Top = 9 + Width = 211 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -16 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + ReadOnly = True + TabOrder = 0 + Visible = False + end + end + object ODPat: TOpenDialog + Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing] + Left = 404 + Top = 197 + end + object IdFTP1: TIdFTP + MaxLineAction = maException + ReadTimeout = 0 + ProxySettings.ProxyType = fpcmNone + ProxySettings.Port = 0 + Left = 405 + Top = 236 + end + object SaveDialog1: TSaveDialog + Left = 409 + Top = 285 + end + object ADOQueryFile: TADOQuery + Connection = BaseData10_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 488 + Top = 144 + end + object DataSource1: TDataSource + DataSet = ADOQueryFile + Left = 392 + Top = 168 + end + object ADOQueryCmd: TADOQuery + Connection = BaseData10_DataLink.ADOLink + Parameters = <> + Left = 496 + Top = 216 + end + object ADOQueryTemp: TADOQuery + Connection = BaseData10_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 504 + Top = 264 + end +end diff --git a/基础数据/U_FileUp.pas b/基础数据/U_FileUp.pas new file mode 100644 index 0000000..3ac6470 --- /dev/null +++ b/基础数据/U_FileUp.pas @@ -0,0 +1,375 @@ +unit U_FileUp; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls, cxGridLevel, + cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses, + cxControls, cxGridCustomView, cxGrid, IdBaseComponent, IdComponent, + IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB, jpeg, BtnEdit, IniFiles, + strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, + dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, + dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, + dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, + dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, + dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, + dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, + dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, + dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, + dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, + dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, + dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, + dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, + dxSkinXmas2008Blue, dxSkinscxPCPainter; + +type + TfrmFileUp = class(TForm) + cxGrid7: TcxGrid; + TV7: TcxGridDBTableView; + FileName: TcxGridDBColumn; + FileDate: TcxGridDBColumn; + cxGridLevel6: TcxGridLevel; + Panel16: TPanel; + ToolBar6: TToolBar; + FileUp: TToolButton; + FileDel: TToolButton; + Panel1: TPanel; + Label1: TLabel; + Code: TEdit; + ODPat: TOpenDialog; + IdFTP1: TIdFTP; + SaveDialog1: TSaveDialog; + ADOQueryFile: TADOQuery; + DataSource1: TDataSource; + ADOQueryCmd: TADOQuery; + ADOQueryTemp: TADOQuery; + Image2: TImage; + procedure FileUpClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FileDelClick(Sender: TObject); + procedure FormShow(Sender: TObject); + private + lstPat: TStringList; + AJpeg: TJPEGImage; + procedure CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer); + procedure SaveImageOther(FTFID: string); + procedure ReadINIFile10(); + { Private declarations } + public + CYID: string; + { Public declarations } + end; + +var + frmFileUp: TfrmFileUp; + +implementation + +uses + U_DataLink, U_Fun; + +{$R *.dfm} + +procedure TfrmFileUp.ReadINIFile10(); +var + programIni: Tinifile; //ļ + FileName: string; +begin + FileName := ExtractFilePath(Paramstr(0)) + 'SYSTEMSET.INI'; + programIni := Tinifile.create(FileName); + server := programIni.ReadString('SERVER', 'ַ', '127.0.0.1'); + programIni.Free; +end; + +procedure TfrmFileUp.FileUpClick(Sender: TObject); +var + i, j: Integer; + PatFile: string; + FTPPath, FConNo, MaxNo: string; + AJpeg: TJPEGImage; + myStream: TADOBlobStream; +begin + if Trim(Code.Text) = '' then + begin + Application.MessageBox('ŲΪգ', 'ʾ', 0); + Exit; + end; + lstPat.Clear; + if ODPat.Execute then + begin + lstPat.AddStrings(ODPat.Files); + end; + if lstPat.Count > 0 then + begin + try + ReadINIFile10(); + server := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', 'ַ', '127.0.0.1'); +// IdFTP1.Host := server; //PicSvr; + IdFTP1.Host := PicSvr; //PicSvr; + IdFTP1.Username := 'three'; + IdFTP1.Password := '641010'; + IdFTP1.Connect(); + except + IdFTP1.Quit; + Application.MessageBox('޷ӵļ飡', 'ʾ', MB_ICONWARNING); + Exit; + end; + end; + Panel16.Visible := True; + Panel16.Refresh; + + try + AJpeg := TJpegImage.Create(); + ADOQueryCmd.Connection.BeginTrans; + + for i := 0 to lstPat.Count - 1 do + begin + + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select isnull(max(abs(cast(right(left(FileName,charindex(''.'',FileName)-1),2) as int))),0)+1 as BH from XD_File'); + sql.Add('where CYID=''' + trim(CYID) + ''' '); + open; + end; + // PatFile:=Copy(ExtractFileName(lstPat[i]),(Pos('.',ExtractFileName(lstPat[i]))+1),(Length(ExtractFileName(lstPat[i]))-Pos('.',ExtractFileName(lstPat[i]))) ) ; + PatFile := trim(Code.Text) + '-' + inttostr(ADOQueryTemp.fieldbyname('BH').AsInteger) + '.' + Copy(ExtractFileName(lstPat[i]), (Pos('.', ExtractFileName(lstPat[i])) + 1), (Length(ExtractFileName(lstPat[i])) - Pos('.', ExtractFileName(lstPat[i])))); + + AJpeg.LoadFromFile(ExtractFileName(lstPat[i])); + CreThumb(AJpeg, Image2, 160, 120); + + if IdFTP1.Connected then + begin + try + IdFTP1.Put(lstPat[i], Trim(UserDataFlag + 'YMTP') + '\' + Trim(PatFile)); + + if GetLSNo(ADOQueryCmd, MaxNo, 'YP', 'XD_File', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡͼƬʧܣ', 'ʾ', 0); + Exit; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('select * from XD_File where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('XFID').Value := Trim(MaxNo); + FieldByName('CYID').Value := Trim(CYID); + FieldByName('CYNO').Value := Trim(Code.Text); + FieldByName('filename').Value := Trim(PatFile); + FieldByName('FileDate').Value := SGetServerDate(ADOQueryTemp); + fieldbyname('FileType').value := Trim('ҳͼƬ'); + Post; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add(' select * from TP_File where TFID=''' + Trim(MaxNo) + ''''); + open; + end; + with ADOQueryCmd do + begin + if ADOQueryCmd.IsEmpty then + begin + Append; + FieldByName('Filler').Value := Trim(DName); + end + else + begin + Edit; + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('TFID').Value := Trim(MaxNo); + FieldByName('WBID').Value := Trim(CYID); + FieldByName('TFType').Value := 'Ʒ'; + myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite); + AJpeg.Assign(Image2.Picture.Graphic); + AJpeg.SaveToStream(myStream); + myStream.Free; + Post; + end; + except + end; + end; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update CP_YDang Set TPFlag=1 where CYID=''' + Trim(CYID) + ''''); + ExecSQL; + end; + + ADOQueryCmd.Connection.CommitTrans; + AJpeg.Free; + except + AJpeg.Free; + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ͼƬϴʧܣ', 'ʾ', 0); + end; + if IdFTP1.Connected then + IdFTP1.Quit; + with ADOQueryFile do + begin + Close; + SQL.Clear; + SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + ''''); + open; + end; + { with ADOQueryFile do + begin + Close; + SQL.Clear; + SQL.Add('select * from XD_File where CYID='''+Trim(CYID)+''''); + SQL.Add(' and FileType=''YP'''); + Open; + end;} + Panel16.Visible := False; + if i > 0 then + Application.MessageBox(PChar(inttostr(i) + 'ļϴɹ'), 'ʾ', 0); + ModalResult := 1; +end; + +procedure TfrmFileUp.CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer); +var + Bitmap: TBitmap; + Ratio: Double; + ARect: TRect; + AHeight, AHeightOffset: Integer; + AWidth, AWidthOffset: Integer; +begin + Bitmap := TBitmap.Create; + try + Ratio := AJPeg.Width / AJPeg.Height; + if Ratio > 1.333 then + begin + AHeight := Round(Width / Ratio); + AHeightOffset := (Height - AHeight) div 2; + AWidth := Width; + AWidthOffset := 0; + end + else + begin + AWidth := Round(Height * Ratio); + AWidthOffset := (Width - AWidth) div 2; + AHeight := Height; + AHeightOffset := 0; + end; + Bitmap.Width := Width; + Bitmap.Height := Height; + Bitmap.Canvas.Brush.Color := clBtnFace; + Bitmap.Canvas.FillRect(Rect(0, 0, Width, Height)); + ARect := Rect(AWidthOffset, AHeightOffset, AWidth + AWidthOffset, AHeight + AHeightOffset); + Bitmap.Canvas.StretchDraw(ARect, AJPeg); + Image1.Picture.Assign(Bitmap); + finally + Bitmap.Free; + end; +end; + +procedure TfrmFileUp.SaveImageOther(FTFID: string); +var + AJpeg: TJPEGImage; + myStream: TADOBlobStream; + ImgMaxNo: string; + i, j: Integer; + PatFile: string; + FConNo, MaxNo: string; +begin + if Image2.Picture = nil then + Exit; + AJpeg := TJpegImage.Create(); + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add(' select * from TP_File where TFID=''' + Trim(FTFID) + ''''); + open; + end; + with ADOQueryCmd do + begin + if Trim(FTFID) = '' then + begin + Append; + FieldByName('Filler').Value := Trim(DName); + end + else + begin + Edit; + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('TFID').Value := Trim(FTFID); + FieldByName('WBID').Value := Trim(CYID); + FieldByName('TFType').Value := 'Ʒ'; + AJpeg.Assign(Image2.Picture.Graphic); + myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite); + AJpeg.Assign(Image2.Picture.Graphic); + AJpeg.SaveToStream(myStream); + myStream.Free; + Post; + end; +end; + +procedure TfrmFileUp.FormCreate(Sender: TObject); +begin + lstPat := TStringList.Create; + +end; + +procedure TfrmFileUp.FileDelClick(Sender: TObject); +begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + SQL.Add(' Delete XD_File where XFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + ''''); + SQL.Add(' Delete TP_File where TFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryFile do + begin + Close; + SQL.Clear; + SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + ''''); + SQL.Add(' and FileType=''ҳͼƬ'''); + open; + end; + if ADOQueryFile.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update CP_YDang Set TPFlag=0 where CYID=''' + Trim(CYID) + ''''); + ExecSQL; + end; + end; +end; + +procedure TfrmFileUp.FormShow(Sender: TObject); +begin + with ADOQueryFile do + begin + Close; + SQL.Clear; + SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + ''''); + SQL.Add(' and FileType=''ҳͼƬ'''); + Open; + end; +end; + +end. + diff --git a/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas b/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas index 181ecba..3901324 100644 --- a/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas +++ b/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas @@ -69,7 +69,7 @@ begin DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server; if trim(DataBaseStr) <> '' then DConString := DataBaseStr; - +// DParameters2:=''; // DParameters1:='ѯ'; // DParameters1:='1'; // DataBase:='ӹ'; @@ -128,8 +128,8 @@ begin with frmZdyAttachGYS do begin caption := Trim(Title); - // fDEFstr5:=trim(''); - fDEFstr5 := trim(DataBase); + fDEFstr5:=trim(DParameters2); +// fDEFstr5 := trim(DataBase); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; diff --git a/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.dfm b/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.dfm new file mode 100644 index 0000000..ad9f8ff --- /dev/null +++ b/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.dfm @@ -0,0 +1,227 @@ +object frmZDYHelpSel: TfrmZDYHelpSel + Left = 392 + Top = 169 + Width = 574 + Height = 598 + Caption = #39033#30446#32500#25252 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object cxGrid1: TcxGrid + Left = 0 + Top = 73 + Width = 558 + Height = 486 + Align = alClient + TabOrder = 0 + object TV1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = TV1CellDblClick + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.GroupByBox = False + object V1Code: TcxGridDBColumn + Caption = #32534#21495 + DataBinding.FieldName = 'ZDYNo' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 97 + end + object V1Column1: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 48 + end + object V1Name: TcxGridDBColumn + Tag = 2 + Caption = #21517#31216 + DataBinding.FieldName = 'ZDYName' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = V1NamePropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 208 + end + object V1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 57 + end + object V1OrderNo: TcxGridDBColumn + Caption = #39034#24207#21495 + DataBinding.FieldName = 'OrderNo' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 53 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = TV1 + end + end + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 558 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_BaseInfo.ThreeImgList + List = True + ParentFont = False + ShowCaptions = True + TabOrder = 1 + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Caption = #30830#23450 + ImageIndex = 41 + OnClick = ToolButton1Click + end + object TBAdd: TToolButton + Left = 59 + Top = 0 + Caption = #22686#34892 + ImageIndex = 103 + Visible = False + OnClick = TBAddClick + end + object TBDel: TToolButton + Left = 118 + Top = 0 + Caption = #21024#34892 + ImageIndex = 107 + Visible = False + OnClick = TBDelClick + end + object TBEdit: TToolButton + Left = 177 + Top = 0 + Caption = #20462#25913 + ImageIndex = 54 + Visible = False + OnClick = TBEditClick + end + object TBSave: TToolButton + Left = 236 + Top = 0 + Caption = #20445#23384 + ImageIndex = 8 + Visible = False + OnClick = TBSaveClick + end + object TBClose: TToolButton + Left = 295 + Top = 0 + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 29 + Width = 558 + Height = 44 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + TabOrder = 2 + object Label1: TLabel + Left = 19 + Top = 17 + Width = 24 + Height = 12 + Caption = #21517#31216 + end + object Label2: TLabel + Left = 240 + Top = 11 + Width = 120 + Height = 24 + Caption = #27880#65306#28966#28857#31163#24320#24403#21069#32534#36753#13#10' '#21333#20803#26684#20445#23384#25968#25454#12290 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentColor = False + ParentFont = False + end + object ZDYName: TEdit + Tag = 2 + Left = 54 + Top = 12 + Width = 169 + Height = 20 + TabOrder = 0 + OnChange = ZDYNameChange + end + end + object ADOQueryMain: TADOQuery + Connection = DataLink_BaseInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 48 + Top = 136 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_BaseInfo.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 80 + Top = 144 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_BaseInfo.ADOLink + Parameters = <> + Left = 112 + Top = 152 + end + object DataSource1: TDataSource + DataSet = ClientDataSet1 + Left = 280 + Top = 144 + end + object ClientDataSet1: TClientDataSet + Aggregates = <> + Params = <> + Left = 200 + Top = 144 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 352 + Top = 248 + end +end diff --git a/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.pas b/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.pas new file mode 100644 index 0000000..a762500 --- /dev/null +++ b/基础资料维护(BaseInfo.dll)/U_ZDYHelpSel.pas @@ -0,0 +1,481 @@ +unit U_ZDYHelpSel; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, ToolWin, ComCtrls, cxGridCustomTableView, + cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls, + cxCheckBox, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, + cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter, cxNavigator; + +type + TfrmZDYHelpSel = class(TForm) + TV1: TcxGridDBTableView; + cxGrid1Level1: TcxGridLevel; + cxGrid1: TcxGrid; + V1Code: TcxGridDBColumn; + V1Name: TcxGridDBColumn; + ToolBar1: TToolBar; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + ADOQueryCmd: TADOQuery; + DataSource1: TDataSource; + ClientDataSet1: TClientDataSet; + TBAdd: TToolButton; + TBSave: TToolButton; + TBDel: TToolButton; + TBClose: TToolButton; + ToolButton1: TToolButton; + TBEdit: TToolButton; + V1Note: TcxGridDBColumn; + V1OrderNo: TcxGridDBColumn; + Panel1: TPanel; + Label1: TLabel; + ZDYName: TEdit; + V1Column1: TcxGridDBColumn; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure TBAddClick(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure ZDYNameChange(Sender: TObject); + procedure V1NamePropertiesEditValueChanged(Sender: TObject); + private + procedure InitGrid(); + { Private declarations } + public + flag, flagname, snote, MainType, ReturnStr, FGStr: string; + fnote, forderno: Boolean; + PPSTE, JiangeStr: integer; + { Public declarations } + end; + +var + frmZDYHelpSel: TfrmZDYHelpSel; + +implementation + +uses + U_DataLink, U_Fun; + +{$R *.dfm} + +procedure TfrmZDYHelpSel.FormClose(Sender: TObject; var Action: TCloseAction); +begin + ZDYName.SetFocus; + Action := caFree; +end; + +procedure TfrmZDYHelpSel.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Close; + sql.Clear; +// sql.Add('select * from KH_ZDY where Type='''+flag+''''); +// if Trim(MainType)<>'' then +// begin +// sql.Add(' and MainType='''+Trim(MainType)+''''); +// end; + sql.Add('select UserName as ZDYName from SY_User where UType='''''); + Open; + end; + SCreateCDS20(ADOQueryMain, ClientDataSet1); + SInitCDSData20(ADOQueryMain, ClientDataSet1); + finally + ADOQueryMain.EnableControls; + end; +end; + +procedure TfrmZDYHelpSel.TBAddClick(Sender: TObject); +var + i: Integer; +begin + ZDYName.SetFocus; + TV1.OptionsData.Editing := True; + TV1.OptionsSelection.CellSelect := True; + for i := 0 to 5 do + begin + with ClientDataSet1 do + begin + Append; + Post; + end; + end; + +end; + +procedure TfrmZDYHelpSel.TBSaveClick(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet1.IsEmpty then + Exit; + try + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + ''''); + open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType '); + Parameters.ParamByName('ZDYNo').Value := Trim(flag); + Parameters.ParamByName('ZDYName').Value := Trim(flagname); + Parameters.ParamByName('Type').Value := 'Main'; + Parameters.ParamByName('MainType').Value := Trim(MainType); + ExecSQL; + end; + end; + with ADOQueryCmd do + begin + with ClientDataSet1 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from KH_ZDY where 1<>1'); + Open; + end; + if Trim(ClientDataSet1.FieldByName('ZDYName').AsString) = '' then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ƲΪգ', 'ʾ', 0); + Exit; + end; + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno); + ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString; + ADOQueryCmd.FieldByName('note').Value := Trim(snote); + //ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString; + ADOQueryCmd.FieldByName('Type').Value := flag; + ADOQueryCmd.FieldByName('valid').Value := 'Y'; + if Trim(MainType) <> '' then + ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType); + //ADOQueryCmd.FieldByName('sel').Value:=0; + ADOQueryCmd.Post; + ClientDataSet1.Edit; + ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno); + ClientDataSet1.Post; + Next; + end; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ʧܣ', 'ʾ', 0); + end; + // TV1.OptionsData.Editing:=False; +end; + +procedure TfrmZDYHelpSel.TBDelClick(Sender: TObject); +begin + if ClientDataSet1.IsEmpty then + Exit; + if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString) <> '') or (Trim(ClientDataSet1.FieldByName('ZDYname').AsString) <> '') then + begin + if application.MessageBox('ȷҪɾ?', 'ʾϢ', 1) = 2 then + exit; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete KH_ZDY where ZDYNo=''' + Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString) + ''''); + SQL.Add(' and Type=''' + Trim(flag) + ''''); + ExecSQL; + end; + end; + ClientDataSet1.Delete; +end; + +procedure TfrmZDYHelpSel.TBCloseClick(Sender: TObject); +begin + ModalResult := 2; + ZDYName.SetFocus; + WriteCxGrid('Զ' + Trim(flag), TV1, 'Զ'); + Close; +end; + +procedure TfrmZDYHelpSel.FormShow(Sender: TObject); +var + fsj, fsj1: string; +begin + {if PPSTE=1 then + begin + Application.Terminate; + Exit; + end; } + InitGrid(); + fsj := Trim(flag) + '01'; + fsj1 := Trim(flagname) + '01'; + ReadCxGrid('Զ' + Trim(flag), TV1, 'Զ'); + {if ClientDataSet1.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)'); + sql.Add('select '''+Trim(fsj)+''''); + sql.Add(','''+Trim(fsj1)+''''); + SQL.Add(','''+Trim(flag)+''''); + sql.Add(','''+Trim(snote)+''''); + ExecSQL; + end; + InitGrid(); + end;} + //frmZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>'; + frmZDYHelpSel.Caption := Trim(flagname); +end; + +procedure TfrmZDYHelpSel.ToolButton1Click(Sender: TObject); +begin + ReturnStr := ''; + with ClientDataSet1 do + begin + First; + while not Eof do + begin + if FieldByName('SSel').AsBoolean = True then + begin + if JiangeStr <> 99 then + begin + if FGStr <> '' then + ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + FGStr + else + ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + ';' + end + else + ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString); + end; + Next; + end; + end; + if JiangeStr <> 99 then + ReturnStr := Copy(ReturnStr, 1, Length(ReturnStr) - 1); + ModalResult := 1; +end; + +procedure TfrmZDYHelpSel.TBEditClick(Sender: TObject); +begin + TV1.OptionsData.Editing := True; +end; + +procedure TfrmZDYHelpSel.TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + if TV1.OptionsData.Editing = False then + begin + ModalResult := 1; + end; +end; + +procedure TfrmZDYHelpSel.ZDYNameChange(Sender: TObject); +begin + if ADOQueryMain.Active then + begin + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, ClientDataSet1); + SInitCDSData20(ADOQueryMain, ClientDataSet1); + end; +end; + +procedure TfrmZDYHelpSel.V1NamePropertiesEditValueChanged(Sender: TObject); +var + maxno, mvalue: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + //Application.MessageBox('ƲΪգ','ʾ',0); + Exit; + end; + with ClientDataSet1 do + begin + Edit; + FieldByName('ZdyName').Value := Trim(mvalue); + //Post; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + ''''); + open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType '); + Parameters.ParamByName('ZDYNo').Value := Trim(flag); + Parameters.ParamByName('ZDYName').Value := Trim(flagname); + Parameters.ParamByName('Type').Value := 'Main'; + Parameters.ParamByName('MainType').Value := Trim(MainType); + ExecSQL; + end; + end; + with ADOQueryCmd do + begin + //ClientDataSet1.DisableControls; + //with ClientDataSet1 do + //begin + //First; + //while not eof do + //begin + if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then + begin + if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + //ClientDataSet1.EnableControls; + Application.MessageBox('ȡʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + ''''); + if Trim(MainType) <> '' then + SQL.Add(' and MainType=''' + Trim(MainType) + ''''); + sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty = False then + begin + if ADOQueryTemp.RecordCount > 1 then + begin + ADOQueryCmd.Connection.RollbackTrans; + //ClientDataSet1.EnableControls; + Application.MessageBox('ظ', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then + begin + ADOQueryCmd.Connection.RollbackTrans; + //ClientDataSet1.EnableControls; + Application.MessageBox('ظ', 'ʾ', 0); + Exit; + end + else + begin + if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then + begin + ADOQueryCmd.Connection.RollbackTrans; + //ClientDataSet1.EnableControls; + Application.MessageBox('ظ', 'ʾ', 0); + Exit; + end; + end; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from KH_ZDY where 1<>1'); + Open; + end; + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno); + ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString; + ADOQueryCmd.FieldByName('note').Value := Trim(snote); + //ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString; + ADOQueryCmd.FieldByName('Type').Value := flag; + ADOQueryCmd.FieldByName('valid').Value := 'Y'; + if Trim(MainType) <> '' then + ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType); + //ADOQueryCmd.FieldByName('sel').Value:=0; + ADOQueryCmd.Post; + ClientDataSet1.Edit; + ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno); + //ClientDataSet1.Post; + // Next; + //end; + //end; + // ClientDataSet1.EnableControls; + end; + ADOQueryCmd.Connection.CommitTrans; + //Application.MessageBox('ɹ','ʾ',0); + //TV1.OptionsData.Editing:=False; + //TV1.OptionsSelection.CellSelect:=False; + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ʧܣ', 'ʾ', 0); + end; +end; + +end. + diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.dfm index 70af049..2eeffcb 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.dfm @@ -91,13 +91,6 @@ object frmZdyAttInputCP: TfrmZdyAttInputCP HeaderAlignmentHorz = taCenter Width = 124 end - object v2defstr9: TcxGridDBColumn - Caption = #20013#25991#21517#31216 - DataBinding.FieldName = 'defNote3' - PropertiesClassName = 'TcxTextEditProperties' - HeaderAlignmentHorz = taCenter - Width = 103 - end object v2Column11: TcxGridDBColumn Caption = #31867#22411 DataBinding.FieldName = 'DEFstr5' @@ -178,12 +171,6 @@ object frmZdyAttInputCP: TfrmZdyAttInputCP HeaderAlignmentHorz = taCenter Width = 114 end - object Tv2Column1: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - HeaderAlignmentHorz = taCenter - Width = 60 - end object Tv2Column2: TcxGridDBColumn Caption = #38376#24133'(cm)' DataBinding.FieldName = 'DEFstr1' diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.pas index 1d98153..f3fe52b 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP.pas @@ -53,7 +53,6 @@ type v2Column1: TcxGridDBColumn; cxGridLevel1: TcxGridLevel; v2Column11: TcxGridDBColumn; - v2defstr9: TcxGridDBColumn; v2Column13: TcxGridDBColumn; v2Mrate: TcxGridDBColumn; ToolBar2: TToolBar; @@ -68,7 +67,6 @@ type ADOQueryGC: TADOQuery; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; - Tv2Column1: TcxGridDBColumn; Tv2Column2: TcxGridDBColumn; Tv2Column3: TcxGridDBColumn; Tv2Column4: TcxGridDBColumn; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.dfm index a783ab6..e25be80 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.dfm @@ -1,6 +1,6 @@ object frmZdyAttInputGYS: TfrmZdyAttInputGYS - Left = 619 - Top = 426 + Left = 467 + Top = 415 Width = 920 Height = 370 Caption = #20379#24212#21830#36164#26009#24405#20837 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.pas index f63bfc4..7ea2d48 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputGYS.pas @@ -15,18 +15,17 @@ uses cxTextEdit, cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, - dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, - dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, - dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, - dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, - dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, - dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, - dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, - dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, - dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, - dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, - dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, - dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter; + dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, + dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, + dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, + dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, + dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, + dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, + dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, + dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, + dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, + dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, + dxSkinXmas2008Blue, dxSkinscxPCPainter; type TfrmZdyAttInputGYS = class(TForm) @@ -78,7 +77,7 @@ var implementation uses - U_DataLink, U_Fun, U_ZDYHelp; + U_DataLink, U_Fun, U_ZDYHelp, U_ZDYHelpSel; {$R *.dfm} @@ -221,14 +220,14 @@ begin begin Close; sql.Clear; - sql.Add('select * from KH_Zdy_Attachment where ZdyCode=''' + Trim(CDS_HZ.fieldbyname('ZdyCode').AsString) + ''''); + sql.Add('select * from KH_Zdy_Attachment where ZdyName=''' + Trim(CDS_HZ.fieldbyname('ZdyName').AsString) + ''''); sql.Add(' and Type=''GYS'' '); Open; end; if ADOQueryCmd.RecordCount > 1 then begin ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ظ!', 'ʾ', 0); + Application.MessageBox('ظ!', 'ʾ', 0); Exit; end; with CDS_HZ do @@ -267,20 +266,43 @@ end; procedure TfrmZdyAttInputGYS.Tv2Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp := TfrmZDYHelp.Create(Application); - with frmZDYHelp do + frmZDYHelpSel := TfrmZDYHelpSel.Create(Application); + with frmZDYHelpSel do begin flag := 'PRTCodeName'; flagname := ''; if ShowModal = 1 then begin - Self.CDS_hz.Edit; - Self.CDS_hz.FieldByName('DEFNote2').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + ClientDataSet1.DisableControls; + with ClientDataSet1 do + begin + First; + while not Eof do + begin + if FieldByName('SSel').AsBoolean = True then + begin + Self.CDS_hz.Edit; + if Self.CDS_hz.FieldByName('DEFNote2').AsString = '' then + begin + Self.CDS_hz.FieldByName('DEFNote2').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end + else + begin + Self.CDS_hz.FieldByName('DEFNote2').Value := Trim(Self.CDS_hz.fieldbyname('DEFNote2').AsString) + ',' + Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + next; + end; +//// Self.CDS_hz.Edit; +//// Self.CDS_hz.FieldByName('DEFNote2').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + ClientDataSet1.EnableControls; end; end; finally - frmZDYHelp.Free; + frmZDYHelpSel.Free; end; +// Self.CDS_hz.Edit; end; end. diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm index 177bce3..df95e28 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm @@ -91,13 +91,6 @@ object frmZdyAttInputPB: TfrmZdyAttInputPB HeaderAlignmentHorz = taCenter Width = 124 end - object v2defstr9: TcxGridDBColumn - Caption = #20013#25991#21517#31216 - DataBinding.FieldName = 'defNote3' - PropertiesClassName = 'TcxTextEditProperties' - HeaderAlignmentHorz = taCenter - Width = 103 - end object v2Column11: TcxGridDBColumn Caption = #31867#22411 DataBinding.FieldName = 'DEFstr5' @@ -163,14 +156,6 @@ object frmZdyAttInputPB: TfrmZdyAttInputPB VisibleForCustomization = False Width = 61 end - object v2Column15: TcxGridDBColumn - Caption = #20215#26684#22686#24133 - DataBinding.FieldName = 'defflt1' - PropertiesClassName = 'TcxCurrencyEditProperties' - Properties.DisplayFormat = '0.##;-,0.##' - HeaderAlignmentHorz = taCenter - Width = 92 - end object v2Column1: TcxGridDBColumn Caption = #22791#27880 DataBinding.FieldName = 'Note' @@ -192,12 +177,6 @@ object frmZdyAttInputPB: TfrmZdyAttInputPB HeaderAlignmentHorz = taCenter Width = 60 end - object Tv2Column2: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - HeaderAlignmentHorz = taCenter - Width = 60 - end object Tv2Column3: TcxGridDBColumn Caption = #38376#24133'(cm)' DataBinding.FieldName = 'DEFstr1' @@ -205,7 +184,7 @@ object frmZdyAttInputPB: TfrmZdyAttInputPB Width = 60 end object Tv2Column4: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' + Caption = #31859#20811#37325 DataBinding.FieldName = 'DEFstr2' HeaderAlignmentHorz = taCenter Width = 60 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas index a22ebcd..9ec93c0 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas @@ -31,10 +31,10 @@ uses type TfrmZdyAttInputPB = class(TForm) ToolBar1: TToolBar; - TBClose: TToolButton; + TBClose: TToolButton; ADOQueryTemp: TADOQuery; ADOQueryCmd: TADOQuery; - ADOQueryMain: TADOQuery; + ADOQueryMain: TADOQuery; RM1: TRMGridReport; RMDB_Main: TRMDBDataSet; cxGridPopupMenu2: TcxGridPopupMenu; @@ -52,12 +52,9 @@ type v2Column1: TcxGridDBColumn; cxGridLevel1: TcxGridLevel; v2Column11: TcxGridDBColumn; - v2defstr9: TcxGridDBColumn; v2Column13: TcxGridDBColumn; v2Mrate: TcxGridDBColumn; - v2Column15: TcxGridDBColumn; Tv2Column1: TcxGridDBColumn; - Tv2Column2: TcxGridDBColumn; Tv2Column3: TcxGridDBColumn; Tv2Column4: TcxGridDBColumn; Tv2Column5: TcxGridDBColumn; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.dfm index 55bb819..bee4e98 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.dfm @@ -209,15 +209,6 @@ object frmZdyAttachCP: TfrmZdyAttachCP Styles.IncSearch = DataLink_BaseInfo.SHuangSe Styles.Selection = DataLink_BaseInfo.SHuangSe Styles.Header = DataLink_BaseInfo.handBlack - object v2Column2: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - PropertiesClassName = 'TcxTextEditProperties' - Visible = False - HeaderAlignmentHorz = taCenter - Options.Sorting = False - Width = 94 - end object v2Column6: TcxGridDBColumn Caption = #20135#21697#21517#31216 DataBinding.FieldName = 'ZdyName' @@ -233,13 +224,6 @@ object frmZdyAttachCP: TfrmZdyAttachCP Options.Sorting = False Width = 120 end - object v2Column12: TcxGridDBColumn - Caption = #20013#25991#21517#31216 - DataBinding.FieldName = 'defNote3' - HeaderAlignmentHorz = taCenter - Options.Sorting = False - Width = 100 - end object v2Column5: TcxGridDBColumn Caption = #39068#33394 DataBinding.FieldName = 'DEFstr3' @@ -334,12 +318,6 @@ object frmZdyAttachCP: TfrmZdyAttachCP Options.Sorting = False Width = 188 end - object Tv2Column1: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - HeaderAlignmentHorz = taCenter - Width = 60 - end object Tv2Column2: TcxGridDBColumn Caption = #38376#24133'(cm)' DataBinding.FieldName = 'DEFstr1' diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.pas index 56c9831..d2cd7a4 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP.pas @@ -32,7 +32,7 @@ type FdDy = record inc: integer; //ͻ׽־ FDdys: string[32]; //ͻ׽ - FdDysName: string[32]; //ͻ׽ + FdDysName: string[32]; //ͻ׽ end; TfrmZdyAttachCP = class(TForm) @@ -59,7 +59,6 @@ type ToolButton3: TToolButton; v2Column6: TcxGridDBColumn; v2Column1: TcxGridDBColumn; - v2Column2: TcxGridDBColumn; v2Column3: TcxGridDBColumn; v2Column4: TcxGridDBColumn; v2Column5: TcxGridDBColumn; @@ -71,7 +70,6 @@ type DEFstr5: TComboBox; v2Column7: TcxGridDBColumn; v2Column11: TcxGridDBColumn; - v2Column12: TcxGridDBColumn; v2Column13: TcxGridDBColumn; OpenDialog1: TOpenDialog; ToolButton5: TToolButton; @@ -92,7 +90,6 @@ type DS_GC: TDataSource; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; - Tv2Column1: TcxGridDBColumn; Tv2Column2: TcxGridDBColumn; Tv2Column3: TcxGridDBColumn; Tv2Column4: TcxGridDBColumn; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachGYS.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachGYS.pas index 6d42a5a..f8743e0 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachGYS.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachGYS.pas @@ -47,9 +47,9 @@ type cxGrid2: TcxGrid; Tv2: TcxGridDBTableView; cxGridLevel1: TcxGridLevel; - cxGridPopupMenu2: TcxGridPopupMenu; + cxGridPopupMenu2: TcxGridPopupMenu; DS_HZ: TDataSource; - CDS_HZ: TClientDataSet; + CDS_HZ: TClientDataSet; ToolButton3: TToolButton; v2Column6: TcxGridDBColumn; v2Column1: TcxGridDBColumn; @@ -58,7 +58,7 @@ type v2Column4: TcxGridDBColumn; v2Column5: TcxGridDBColumn; v2Column7: TcxGridDBColumn; - v2Column9: TcxGridDBColumn; + v2Column9: TcxGridDBColumn; Label1: TLabel; ZdyCode: TEdit; ToolButton4: TToolButton; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm index 08af7ba..c842d46 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm @@ -208,15 +208,6 @@ object frmZdyAttachPB: TfrmZdyAttachPB Styles.IncSearch = DataLink_BaseInfo.SHuangSe Styles.Selection = DataLink_BaseInfo.SHuangSe Styles.Header = DataLink_BaseInfo.handBlack - object v2Column2: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - PropertiesClassName = 'TcxTextEditProperties' - Visible = False - HeaderAlignmentHorz = taCenter - Options.Sorting = False - Width = 94 - end object v2Column6: TcxGridDBColumn Caption = #20135#21697#21517#31216 DataBinding.FieldName = 'ZdyName' @@ -232,13 +223,6 @@ object frmZdyAttachPB: TfrmZdyAttachPB Options.Sorting = False Width = 120 end - object v2Column12: TcxGridDBColumn - Caption = #20013#25991#21517#31216 - DataBinding.FieldName = 'defNote3' - HeaderAlignmentHorz = taCenter - Options.Sorting = False - Width = 100 - end object v2Column11: TcxGridDBColumn Caption = #31867#22411 DataBinding.FieldName = 'DEFstr5' @@ -303,13 +287,6 @@ object frmZdyAttachPB: TfrmZdyAttachPB VisibleForCustomization = False Width = 61 end - object v2defflt1: TcxGridDBColumn - Caption = #20215#26684#22686#24133 - DataBinding.FieldName = 'defflt1' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Width = 60 - end object v2Column1: TcxGridDBColumn Caption = #22791#27880 DataBinding.FieldName = 'Note' @@ -338,12 +315,6 @@ object frmZdyAttachPB: TfrmZdyAttachPB HeaderAlignmentHorz = taCenter Width = 60 end - object Tv2Column2: TcxGridDBColumn - Caption = #20135#21697#32534#21495 - DataBinding.FieldName = 'ZdyCode' - HeaderAlignmentHorz = taCenter - Width = 60 - end object Tv2Column3: TcxGridDBColumn Caption = #38376#24133'(cm)' DataBinding.FieldName = 'DEFstr1' @@ -351,7 +322,7 @@ object frmZdyAttachPB: TfrmZdyAttachPB Width = 60 end object Tv2Column4: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' + Caption = #31859#20811#37325 DataBinding.FieldName = 'DEFstr2' HeaderAlignmentHorz = taCenter Width = 60 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas index 1a95e9c..b1c2321 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas @@ -3,38 +3,38 @@ unit U_ZdyAttachPB; interface uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, ComObj, - Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB, - cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + ComObj, Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, + ADODB, cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls, cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid, cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection, - IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, cxCalendar, - cxButtonEdit, cxTextEdit, Menus, cxLookAndFeelPainters, cxButtons, - cxLookAndFeels, cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, - dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, - dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, - dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, - dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, - dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, - dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, - dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, - dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, - dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, - dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, - dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, - dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, - dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter; + IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit, + cxTextEdit, Menus, cxLookAndFeelPainters, cxButtons, cxLookAndFeels, + cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; type + FdDy = record + inc: integer; //ͻ׽־ + FDdys: string[32]; //ͻ׽ + FdDysName: string[32]; //ͻ׽ + end; - FdDy=record - inc: integer; //ͻ׽־ - FDdys:string[32]; //ͻ׽ - FdDysName:string[32]; //ͻ׽ - end; TfrmZdyAttachPB = class(TForm) ToolBar1: TToolBar; TBRafresh: TToolButton; @@ -59,7 +59,6 @@ type ToolButton3: TToolButton; v2Column6: TcxGridDBColumn; v2Column1: TcxGridDBColumn; - v2Column2: TcxGridDBColumn; v2Column3: TcxGridDBColumn; v2Column4: TcxGridDBColumn; v2Column9: TcxGridDBColumn; @@ -70,14 +69,12 @@ type DEFstr5: TComboBox; v2Column7: TcxGridDBColumn; v2Column11: TcxGridDBColumn; - v2Column12: TcxGridDBColumn; v2Column13: TcxGridDBColumn; OpenDialog1: TOpenDialog; ToolButton5: TToolButton; v2Mrate: TcxGridDBColumn; v2Column14: TcxGridDBColumn; v2Column15: TcxGridDBColumn; - v2defflt1: TcxGridDBColumn; ToolButton6: TToolButton; Panel2: TPanel; RadioGroup1: TRadioGroup; @@ -85,7 +82,6 @@ type cxButton1: TcxButton; cxButton2: TcxButton; Tv2Column1: TcxGridDBColumn; - Tv2Column2: TcxGridDBColumn; Tv2Column3: TcxGridDBColumn; Tv2Column4: TcxGridDBColumn; Tv2Column5: TcxGridDBColumn; @@ -107,9 +103,8 @@ type private { Private declarations } procedure InitGrid(); - public - fkhType:string; + fkhType: string; dFdDy: array[0..20] of FdDy; //ͻ end; @@ -117,74 +112,75 @@ var frmZdyAttachPB: TfrmZdyAttachPB; implementation + uses - U_DataLink,U_Fun,U_ZDYHelp,U_ZdyAttInputPB; + U_DataLink, U_Fun, U_ZDYHelp, U_ZdyAttInputPB; {$R *.dfm} - - procedure TfrmZdyAttachPB.InitGrid(); begin try ADOQueryMain.DisableControls; with ADOQueryMain do begin - Filtered:=False; + Filtered := False; Close; SQL.Clear; sql.Add(' select ATID,ZdyName,ZdyCode,DEFstr1,DEFstr2,defNote1,Mrate,defNote2,defNote3,DEFstr3,DEFstr5,DEFstr4,'); sql.Add(' DEFstr6,DEFstr7,DEFstr8,Note,DEFstr4,DEFstr5,defflt1,CPhh,Filler,FillTime '); sql.Add(' from KH_Zdy_Attachment where Type=''CP'' and DEFstr5='''' '); - sql.Add(' and isnull(khType,'''')='+quotedstr(trim(fkhType))); + sql.Add(' and isnull(khType,'''')=' + quotedstr(trim(fkhType))); sql.Add(' order by zdyName,dbo.getNum(Defstr3) '); // sql.Add(' order by zdyName '); Open; end; - SCreateCDS20(ADOQueryMain,CDS_HZ); - SInitCDSData20(ADOQueryMain,CDS_HZ); + SCreateCDS20(ADOQueryMain, CDS_HZ); + SInitCDSData20(ADOQueryMain, CDS_HZ); finally ADOQueryMain.EnableControls; end; end; - procedure TfrmZdyAttachPB.FormDestroy(Sender: TObject); begin - frmZdyAttachPB:=nil; + frmZdyAttachPB := nil; end; procedure TfrmZdyAttachPB.FormClose(Sender: TObject; var Action: TCloseAction); begin - Action:=caFree; + Action := caFree; end; procedure TfrmZdyAttachPB.TBCloseClick(Sender: TObject); begin - WriteCxGrid('Ʒ13',Tv2,'ͻԶ'); + WriteCxGrid('Ʒ131', Tv2, 'ͻԶ131'); Close; end; + procedure TfrmZdyAttachPB.TBDelClick(Sender: TObject); begin - if CDS_HZ.IsEmpty then Exit; - if Application.MessageBox('ȷҪɾ','ʾ',32+4)<>IDYES then Exit; - if Trim(CDS_HZ.fieldbyname('ATID').AsString)<>'' then + if CDS_HZ.IsEmpty then + Exit; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if Trim(CDS_HZ.fieldbyname('ATID').AsString) <> '' then begin with ADOQueryCmd do begin Close; SQL.Clear; - sql.Add('delete KH_Zdy_Attachment where ATID='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+''''); - sql.Add('delete KH_Zdy where ZdyNo='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+''''); + sql.Add('delete KH_Zdy_Attachment where ATID=''' + Trim(CDS_HZ.fieldbyname('ATID').AsString) + ''''); + sql.Add('delete KH_Zdy where ZdyNo=''' + Trim(CDS_HZ.fieldbyname('ATID').AsString) + ''''); ExecSQL; end; - end; + end; CDS_HZ.Delete; end; procedure TfrmZdyAttachPB.FormShow(Sender: TObject); begin - ReadCxGrid('Ʒ13',Tv2,'ͻԶ'); + ReadCxGrid('Ʒ131', Tv2, 'ͻԶ131'); InitGrid(); end; @@ -197,9 +193,9 @@ procedure TfrmZdyAttachPB.ToolButton2Click(Sender: TObject); begin if ADOQueryMain.Active then begin - SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); - SCreateCDS20(ADOQueryMain,CDS_HZ); - SInitCDSData20(ADOQueryMain,CDS_HZ); + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, CDS_HZ); + SInitCDSData20(ADOQueryMain, CDS_HZ); end; end; @@ -208,23 +204,23 @@ begin ToolButton2.Click; end; - procedure TfrmZdyAttachPB.ToolButton1Click(Sender: TObject); begin - if ADOQueryMain.IsEmpty then Exit; - TcxGridToExcel(self.Caption,cxgrid2); + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxgrid2); // SelExportData(Tv2,ADOQueryMain,'Ʒб'); end; procedure TfrmZdyAttachPB.ToolButton4Click(Sender: TObject); begin try - frmZdyAttInputPB:=TfrmZdyAttInputPB.Create(Application); + frmZdyAttInputPB := TfrmZdyAttInputPB.Create(Application); with frmZdyAttInputPB do begin - FCYID:=Trim(Self.CDS_HZ.fieldbyname('ATID').AsString); - fkhType:=self.fkhType; - if ShowModal=1 then + FCYID := Trim(Self.CDS_HZ.fieldbyname('ATID').AsString); + fkhType := self.fkhType; + if ShowModal = 1 then begin TBRafresh.Click; end; @@ -237,116 +233,116 @@ end; procedure TfrmZdyAttachPB.ToolButton3Click(Sender: TObject); begin try - frmZdyAttInputPB:=TfrmZdyAttInputPB.Create(Application); + frmZdyAttInputPB := TfrmZdyAttInputPB.Create(Application); with frmZdyAttInputPB do begin - FCYID:=''; - fkhType:=self.fkhType; - if ShowModal=1 then + FCYID := ''; + fkhType := self.fkhType; + if ShowModal = 1 then begin TBRafresh.Click; - end; - end; + end; + end; finally - frmZdyAttInputPB.Free; + frmZdyAttInputPB.Free; end; end; procedure TfrmZdyAttachPB.ToolButton5Click(Sender: TObject); var - excelApp,WorkBook:Variant; - i,j,k,ExcelRowCount:integer; - maxId:string; + excelApp, WorkBook: Variant; + i, j, k, ExcelRowCount: integer; + maxId: string; begin try - ExcelApp := CreateOleObject('Excel.Application'); - openDialog1.Filter:='*.CSV;*.xls'; - if opendialog1.Execute then + excelApp := CreateOleObject('Excel.Application'); + openDialog1.Filter := '*.CSV;*.xls'; + if opendialog1.Execute then begin - WorkBook :=ExcelApp.WorkBooks.Open(OpenDialog1.FileName); + WorkBook := excelApp.WorkBooks.Open(OpenDialog1.FileName); end else exit; - ExcelApp.Visible := false; - ExcelRowCount := WorkBook.WorkSheets[1].UsedRange.Rows.Count; + excelApp.Visible := false; + ExcelRowCount := WorkBook.WorkSheets[1].UsedRange.Rows.Count; except - application.MessageBox('EXCEL','Ϣ',MB_ICONERROR); + application.MessageBox('EXCEL', 'Ϣ', MB_ICONERROR); exit; end; try - k:=0; - for i:=1 to 20 do + k := 0; + for i := 1 to 20 do begin - if trim(excelapp.Cells[1,i].value)='' then break; - if trim(excelapp.Cells[1,i].value)='Ʒ' then + if trim(excelApp.Cells[1, i].value) = '' then + break; + if trim(excelApp.Cells[1, i].value) = 'Ʒ' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='ZdyCode'; - dFdDy[k].FdDysName:='Ʒ'; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'ZdyCode'; + dFdDy[k].FdDysName := 'Ʒ'; end; - if trim(excelapp.Cells[1,i].value)='Ʒ' then + if trim(excelApp.Cells[1, i].value) = 'Ʒ' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='ZdyName'; - dFdDy[k].FdDysName:='Ʒ'; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'ZdyName'; + dFdDy[k].FdDysName := 'Ʒ'; end; - if trim(excelapp.Cells[1,i].value)='' then + if trim(excelApp.Cells[1, i].value) = '' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='defNote3'; - dFdDy[k].FdDysName:=''; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'defNote3'; + dFdDy[k].FdDysName := ''; end; - if trim(excelapp.Cells[1,i].value)='ɫ' then + if trim(excelApp.Cells[1, i].value) = 'ɫ' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='DEFstr3'; - dFdDy[k].FdDysName:='ɫ'; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'DEFstr3'; + dFdDy[k].FdDysName := 'ɫ'; end; - if trim(excelapp.Cells[1,i].value)='ɫ' then + if trim(excelApp.Cells[1, i].value) = 'ɫ' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='DEFstr6'; - dFdDy[k].FdDysName:='ɫ'; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'DEFstr6'; + dFdDy[k].FdDysName := 'ɫ'; end; - - if trim(excelapp.Cells[1,i].value)='' then + if trim(excelApp.Cells[1, i].value) = '' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='DEFstr5'; - dFdDy[k].FdDysName:=''; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'DEFstr5'; + dFdDy[k].FdDysName := ''; end; - if trim(excelapp.Cells[1,i].value)='' then + if trim(excelApp.Cells[1, i].value) = '' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='DEFstr1'; - dFdDy[k].FdDysName:=''; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'DEFstr1'; + dFdDy[k].FdDysName := ''; end; - if trim(excelapp.Cells[1,i].value)='ɷ' then + if trim(excelApp.Cells[1, i].value) = 'ɷ' then begin - dFdDy[k].inc:=i; - dFdDy[k].FDdys:='DEFstr2'; - dFdDy[k].FdDysName:='ɷ'; + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'DEFstr2'; + dFdDy[k].FdDysName := 'ɷ'; end; - k:=k+1; + k := k + 1; end; except end; ADOQueryCmd.Connection.BeginTrans; try - for i := 2 to excelrowcount do + for i := 2 to ExcelRowCount do begin - if GetLSNo(ADOQueryCmd,maxId,'AT','KH_Zdy_Attachment',4,1)=False then + if GetLSNo(ADOQueryCmd, maxId, 'AT', 'KH_Zdy_Attachment', 4, 1) = False then begin ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ȡʧܣ','ʾ',0); + Application.MessageBox('ȡʧܣ', 'ʾ', 0); Exit; end; @@ -358,83 +354,84 @@ begin open; end; ADOQueryCmd.Append; - for j:=0 to k-1 do + for j := 0 to k - 1 do begin - ADOQueryCmd.fieldbyname(dFdDy[j].FDdys).Value:=excelapp.Cells[i,dFdDy[j].inc].Value; + ADOQueryCmd.fieldbyname(dFdDy[j].FDdys).Value := excelApp.Cells[i, dFdDy[j].inc].Value; end; - ADOQueryCmd.FieldByName('ATID').Value:=Trim(maxId); - ADOQueryCmd.FieldByName('zdyCode').Value:=Trim(maxId); - ADOQueryCmd.FieldByName('khType').Value:=Trim(fkhType); - ADOQueryCmd.FieldByName('Type').Value:='CP'; - ADOQueryCmd.FieldByName('Filler').Value:=Trim(DName); + ADOQueryCmd.FieldByName('ATID').Value := Trim(maxId); + ADOQueryCmd.FieldByName('zdyCode').Value := Trim(maxId); + ADOQueryCmd.FieldByName('khType').Value := Trim(fkhType); + ADOQueryCmd.FieldByName('Type').Value := 'CP'; + ADOQueryCmd.FieldByName('Filler').Value := Trim(DName); ADOQueryCmd.Post; end; WorkBook.Close; - ExcelApp.Quit; - ExcelApp := Unassigned; + excelApp.Quit; + excelApp := Unassigned; WorkBook := Unassigned; ADOQueryCmd.Connection.CommitTrans; InitGrid(); except WorkBook.Close; - ExcelApp.Quit; - ExcelApp := Unassigned; + excelApp.Quit; + excelApp := Unassigned; WorkBook := Unassigned; - ADOQueryCmd.Connection.RollbackTrans; + ADOQueryCmd.Connection.RollbackTrans; end; end; procedure TfrmZdyAttachPB.cxButton2Click(Sender: TObject); begin - Panel2.Visible:=false; + Panel2.Visible := false; end; procedure TfrmZdyAttachPB.cxButton1Click(Sender: TObject); var - fPrintFile:string; - Txt,fImagePath:string; - Moudle: THandle; - Makebar:TMakebar; - Mixtext:TMixtext; + fPrintFile: string; + Txt, fImagePath: string; + Moudle: THandle; + Makebar: TMakebar; + Mixtext: TMixtext; begin - IF CDS_HZ.IsEmpty then exit; - try - Moudle:=LoadLibrary('MakeQRBarcode.dll'); - @Makebar:=GetProcAddress(Moudle,'Make'); - @Mixtext:=GetProcAddress(Moudle,'MixText'); - Txt:=Trim(CDS_HZ.fieldbyname('ZDYCODE').AsString); - fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp' ; - if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then - CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil); - if FileExists(fImagePath) then DeleteFile(fImagePath); - Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3); - except - application.MessageBox('ʧܣ','ʾϢ',MB_ICONERROR); - exit; - end; + if CDS_HZ.IsEmpty then + exit; + try + Moudle := LoadLibrary('MakeQRBarcode.dll'); + @Makebar := GetProcAddress(Moudle, 'Make'); + @Mixtext := GetProcAddress(Moudle, 'MixText'); + Txt := Trim(CDS_HZ.fieldbyname('ZDYCODE').AsString); + fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp'; + if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then + CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil); + if FileExists(fImagePath) then + DeleteFile(fImagePath); + Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3); + except + application.MessageBox('ʧܣ', 'ʾϢ', MB_ICONERROR); + exit; + end; - fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\'+trim(RadioGroup1.Items[RadioGroup1.ItemIndex])+'.rmf' ; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + trim(RadioGroup1.Items[RadioGroup1.ItemIndex]) + '.rmf'; if FileExists(fPrintFile) then begin - RMVariables['QRBARCODE']:=fImagePath; + RMVariables['QRBARCODE'] := fImagePath; RM1.LoadFromFile(fPrintFile); // Rm2.DefaultCopies:=strtointdef(trim(ComboBox1.Text),1); // RM1.ShowReport; RM1.PrintReport; end else - Application.MessageBox(PChar('ûҵļ'+fPrintFile),'ʾ',0); + Application.MessageBox(PChar('ûҵļ' + fPrintFile), 'ʾ', 0); end; procedure TfrmZdyAttachPB.ToolButton6Click(Sender: TObject); begin - Panel2.Left:=(self.Width-Panel2.Width) div 2; - Panel2.Top:=(self.Height-Panel2.Height) div 2 -100; - Panel2.Visible:=true; + Panel2.Left := (self.Width - Panel2.Width) div 2; + Panel2.Top := (self.Height - Panel2.Height) div 2 - 100; + Panel2.Visible := true; end; end. - diff --git a/管理系统/U_ClothContractCPCKList.dfm b/管理系统/U_ClothContractCPCKList.dfm new file mode 100644 index 0000000..ed8dce7 --- /dev/null +++ b/管理系统/U_ClothContractCPCKList.dfm @@ -0,0 +1,770 @@ +object frmClothContractCPCKList: TfrmClothContractCPCKList + Left = 309 + Top = 284 + Width = 1222 + Height = 738 + Caption = #25104#21697#20986#24211#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + Visible = False + OnClick = TBAddClick + end + object TBEdit: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + Visible = False + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Visible = False + OnClick = TBDelClick + end + object ToolButton1: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 378 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 441 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 504 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #20219#21153#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #35268#26684 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 26 + Height = 12 + Caption = #20379#26041 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 836 + Top = 22 + Width = 52 + Height = 12 + Caption = #21040#36135#22320#28857 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + OnKeyPress = conPress + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Spec: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 732 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + object JHPlace: TEdit + Tag = 2 + Left = 892 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 6 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 85 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + 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 + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1OrderNo: TcxGridDBColumn + Caption = #20219#21153#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1Column8: TcxGridDBColumn + Caption = #37319#36141#35745#21010#21333#21495 + DataBinding.FieldName = 'fromConNo' + Options.Editing = False + Width = 86 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 58 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #21040#36135#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #20379#26041 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MF' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZ' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'T_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column7: TcxGridDBColumn + Caption = #21040#36135#22320#28857 + DataBinding.FieldName = 'JHPlace' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 101 + end + object v1Column18: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column20: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column19: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column21: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Column2: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column3: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 1096 + Top = 8 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 1112 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 880 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 920 + Top = 224 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 680 + Top = 32 + end + object cxStyleRepository1: TcxStyleRepository + Left = 305 + Top = 310 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractCPCKList.pas b/管理系统/U_ClothContractCPCKList.pas new file mode 100644 index 0000000..cf6fc83 --- /dev/null +++ b/管理系统/U_ClothContractCPCKList.pas @@ -0,0 +1,870 @@ +unit U_ClothContractCPCKList; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxCurrencyEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, + dxBarBuiltInMenu, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothContractCPCKList = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Spec: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + v1Column8: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + ToolButton1: TToolButton; + Label7: TLabel; + JHPlace: TEdit; + v1Column18: TcxGridDBColumn; + v1Column19: TcxGridDBColumn; + v1Column20: TcxGridDBColumn; + v1Column21: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure conPress(Sender: TObject; var Key: Char); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure tchkClick(Sender: TObject); + procedure TnochkClick(Sender: TObject); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure cxTabControl1Change(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractCPCKList: TfrmClothContractCPCKList; + +implementation + +uses + U_DataLink, U_ClothContractCPInPut, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractCPCKList.FormDestroy(Sender: TObject); +begin + frmClothContractCPCKList := nil; +end; + +procedure TfrmClothContractCPCKList.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractCPCKList.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractCPCKList.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractCPCKList.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('exec P_Get_Contract_CP'); + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); + sql.Add(',@conType=''Ʒ'' '); + sql.Add(',@status=''2'' '); + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + TBFind.Click; + end; +end; + +procedure TfrmClothContractCPCKList.InitForm(); +begin + if fDParameters1 = 'ѯ' then + begin + TBADD.Visible := false; + // TBEdit.Visible:=false; + TBDel.Visible := false; + // Tchk.Visible:=false; + // TNochk.Visible:=false; +// v1T_money.Visible := false; +// v1T_money.Hidden := true; + ToolButton1.Visible := false; + end; + +// TBEdit.Enabled := false; +// TBDel.Enabled := false; + + + InitGrid(); +end; + +procedure TfrmClothContractCPCKList.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractCPCKList.TBEditClick(Sender: TObject); +var + i: integer; +begin + if Order_Main.IsEmpty then + Exit; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; +// with ADOQueryTemp do +// begin +// close; +// sql.Clear; +// sql.Add('select * from contract_sub '); +// sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); +//// sql.Add(' '); +// open; +// if not IsEmpty then +// begin +// application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); +// exit; +// end; +// end; + try + frmClothContractCPInPut := TfrmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + // TBRafresh.Click; + end; + end; + finally + frmClothContractCPInPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractCPCKList.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣɾ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select * from contract_sub '); + sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); + open; + if not IsEmpty then + begin + application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractCPCKList.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractCPCKList.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); +end; + +procedure TfrmClothContractCPCKList.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\.rmf'), 'ʾ', 0); + end; + +end; + +procedure TfrmClothContractCPCKList.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractCPCKList.TBAddClick(Sender: TObject); +var + i: integer; +begin + try + frmClothContractCPInPut := frmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + PState := 0; + FMainId := ''; + FConType := 'ԤͶ'; + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractCPInPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractCPCKList.ConNoChange(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractCPCKList.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + initForm(); + +end; + +procedure TfrmClothContractCPCKList.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractCPCKList.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractCPCKList.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractCPCKList.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractCPCKList.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPCKList.conPress(Sender: TObject; var Key: Char); +begin + { if Key=#13 then + begin + if Length(Trim(ConNoM.Text))<4 then Exit; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add('exec ClothContract_QryList :MainId,:WSql'); + Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNoM.Text)+'%'+''''; + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; + end; } +end; + +procedure TfrmClothContractCPCKList.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractCPInPut := TfrmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + PState := 3; + TBSave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractCPInPut.Free; + end; +end; + +procedure TfrmClothContractCPCKList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractCPCKList.tchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + { try + frmClothContractInPut := TfrmClothContractInPut.Create(Application); + with frmClothContractInPut do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + with self.ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(self.Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(self.Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + self.InitGrid(); + end + else + begin + end; + end; + finally + frmClothContractInPut.Free; + // TBRafresh.Click; + end; } + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractCPCKList.TnochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + {with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; } + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractCPCKList.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin +// FBounds := AViewInfo.Bounds; +// if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then +// begin +// ACanvas.FillRect(FBounds); +// ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); +// FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); +// InflateRect(FBounds, -1, -1); +// ACanvas.Font.Color := clBlack; +// ACanvas.Brush.Style := bsClear; +// ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); +// ADone := True; +// end; +end; + +procedure TfrmClothContractCPCKList.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +// if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('H_PS').Index] >= AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Qty1').Index] then +// begin +// ACanvas.Brush.Color := clSkyBlue; +// end; +end; + +procedure TfrmClothContractCPCKList.cxTabControl1Change(Sender: TObject); +begin + initForm(); +end; + +end. + diff --git a/管理系统/U_ClothContractCPInPut.dfm b/管理系统/U_ClothContractCPInPut.dfm new file mode 100644 index 0000000..923d31a --- /dev/null +++ b/管理系统/U_ClothContractCPInPut.dfm @@ -0,0 +1,628 @@ +object frmClothContractCPInPut: TfrmClothContractCPInPut + Left = 725 + Top = 322 + Width = 1030 + Height = 478 + Caption = #25104#21697#21457#36135#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1014 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBSave: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #20445#23384 + ImageIndex = 14 + OnClick = TBSaveClick + end + object TBClose: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 29 + Width = 1014 + Height = 92 + Align = alTop + BevelInner = bvNone + BevelOuter = bvNone + Ctl3D = False + ParentCtl3D = False + TabOrder = 1 + object Label1: TLabel + Left = 20 + Top = 14 + Width = 65 + Height = 12 + Caption = #20219#21153#21333#21495#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 290 + Top = 14 + Width = 65 + Height = 12 + Caption = #23436#25104#26085#26399#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 502 + Top = 14 + Width = 65 + Height = 12 + Caption = #25237#22383#35760#24405#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 28 + Top = 166 + Width = 65 + Height = 12 + Caption = #31614#35746#26085#26399#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label3: TLabel + Left = 268 + Top = 150 + Width = 67 + Height = 12 + Caption = #38656' '#26041#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label6: TLabel + Left = 231 + Top = 270 + Width = 65 + Height = 12 + Caption = #31614#35746#22320#28857#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label8: TLabel + Left = 274 + Top = 178 + Width = 65 + Height = 12 + Caption = #20132#36135#22320#28857#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label10: TLabel + Left = 510 + Top = 146 + Width = 91 + Height = 12 + Caption = #37319#36141#35745#21010#21333#21495#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label11: TLabel + Left = 20 + Top = 46 + Width = 65 + Height = 12 + Caption = #23436#25104#22791#27880#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label14: TLabel + Left = 723 + Top = 13 + Width = 65 + Height = 12 + Caption = #23384#25918#26579#21378#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object ConNo: TEdit + Left = 86 + Top = 11 + Width = 137 + Height = 18 + Enabled = False + TabOrder = 0 + end + object DeliveryDate: TDateTimePicker + Left = 353 + Top = 10 + Width = 134 + Height = 20 + BevelInner = bvNone + Date = 40916.000000000000000000 + Format = 'yyyy-MM-dd' + Time = 40916.000000000000000000 + TabOrder = 1 + end + object FactoryNoName: TcxButtonEdit + Left = 790 + Top = 10 + Hint = 'FactoryNo' + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = FactoryNoNamePropertiesButtonClick + Properties.OnChange = FactoryNoNamePropertiesChange + Style.BorderStyle = ebsSingle + TabOrder = 2 + Width = 134 + end + object PanZDY: TPanel + Left = 861 + Top = 128 + Width = 202 + Height = 153 + TabOrder = 3 + Visible = False + object CXGridZDY: TcxGrid + Left = 3 + Top = 4 + Width = 197 + Height = 113 + TabOrder = 0 + object TVZDY: TcxGridDBTableView + OnKeyPress = TVZDYKeyPress + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = TVZDYCellDblClick + DataController.DataSource = DataSource2 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsSelection.CellSelect = False + OptionsView.GroupByBox = False + object VHelpZDYName: TcxGridDBColumn + DataBinding.FieldName = 'ZDYName' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.handBlack + Width = 163 + IsCaptionAssigned = True + end + end + object CXGridZDYLevel1: TcxGridLevel + GridView = TVZDY + end + end + object Button1: TButton + Left = 64 + Top = 120 + Width = 65 + Height = 25 + Caption = #20851#38381 + TabOrder = 1 + OnClick = Button1Click + end + end + object QDTime: TDateTimePicker + Left = 90 + Top = 162 + Width = 140 + Height = 20 + BevelInner = bvNone + Date = 40916.670856296290000000 + Format = 'yyyy-MM-dd' + Time = 40916.670856296290000000 + ShowCheckbox = True + TabOrder = 4 + Visible = False + end + object CompanyName: TcxButtonEdit + Left = 333 + Top = 146 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = CompanyNamePropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 5 + Visible = False + Width = 132 + end + object QDPalce: TEdit + Left = 311 + Top = 271 + Width = 131 + Height = 18 + TabOrder = 6 + Visible = False + end + object JHPlace: TcxButtonEdit + Left = 341 + Top = 174 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = JHPlacePropertiesButtonClick + TabOrder = 7 + Visible = False + Width = 388 + end + object fromConNo: TcxButtonEdit + Tag = 1 + Left = 565 + Top = 10 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = fromConNoPropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 8 + OnKeyPress = fromConNoKeyPress + Width = 116 + end + object GxNote1: TEdit + Left = 86 + Top = 45 + Width = 595 + Height = 18 + TabOrder = 9 + end + end + object ToolBar2: TToolBar + Left = 0 + Top = 121 + Width = 1014 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentFont = False + ShowCaptions = True + TabOrder = 2 + object ToolButton1: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 103 + OnClick = ToolButton1Click + end + object ToolButton2: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 107 + OnClick = ToolButton2Click + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 150 + Width = 1014 + Height = 179 + Align = alTop + TabOrder = 3 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1Column1 + end> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsView.GroupByBox = False + Styles.Header = DataLink_TradeManage.Default + object v1Column1: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column1PropertiesButtonClick + Properties.OnEditValueChanged = v1Column1PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 100 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684#22411#21495 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Focusing = False + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + Width = 103 + end + object Tv1Column3: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1C_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1C_ColorPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1PRTColor: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Focusing = False + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + Width = 78 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MFQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Focusing = False + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + Width = 90 + end + object v1Qty2: TcxGridDBColumn + Caption = #32568#25968 + DataBinding.FieldName = 'Qty2' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column5: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1ClothUnit: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'C_Qty' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1ClothUnitPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.handBlack + Width = 69 + end + object v1Column2: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'C_Unit' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'M' + 'Kg') + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Focusing = False + Styles.Header = DataLink_TradeManage.Default + Width = 77 + end + object v1Column3: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + Visible = False + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 46 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 137 + end + object Tv1Column4: TcxGridDBColumn + Caption = #24037#33402 + DataBinding.FieldName = 'gongyi' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object Panel1: TPanel + Left = 716 + Top = 125 + Width = 289 + Height = 25 + BevelOuter = bvNone + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + object Label22: TLabel + Left = 32 + Top = 4 + Width = 45 + Height = 14 + Caption = #21305#25968#65306 + end + object Label23: TLabel + Left = 144 + Top = 4 + Width = 45 + Height = 14 + Caption = #25968#37327#65306 + end + end + object ADOTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 816 + Top = 85 + end + object ADOCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 800 + Top = 109 + end + object DataSource1: TDataSource + DataSet = Order_Sub + Left = 356 + Top = 192 + end + object Order_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 424 + Top = 192 + end + object DataSource2: TDataSource + DataSet = ADOZDY + Left = 240 + Top = 8 + end + object ADOZDY: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 280 + Top = 5 + end + object CDS_ZDY: TClientDataSet + Aggregates = <> + Params = <> + Left = 208 + Top = 16 + end + object ADOQueryTmp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 744 + Top = 129 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 528 + Top = 97 + end +end diff --git a/管理系统/U_ClothContractCPInPut.pas b/管理系统/U_ClothContractCPInPut.pas new file mode 100644 index 0000000..fd345d2 --- /dev/null +++ b/管理系统/U_ClothContractCPInPut.pas @@ -0,0 +1,1317 @@ +unit U_ClothContractCPInPut; + +interface + +uses + Windows, Messages, strUtils, SysUtils, cxTextEdit, 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, cxMaskEdit, cxButtonEdit, + StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxDropDownEdit, + cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters, + cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothContractCPInPut = class(TForm) + ToolBar1: TToolBar; + TBSave: TToolButton; + TBClose: TToolButton; + ScrollBox1: TScrollBox; + Label1: TLabel; + ConNo: TEdit; + Label4: TLabel; + DeliveryDate: TDateTimePicker; + Label5: TLabel; + ToolBar2: TToolBar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1PRTSpec: TcxGridDBColumn; + v1PRTColor: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + v1PRTKZ: TcxGridDBColumn; + v1ClothUnit: TcxGridDBColumn; + ADOTemp: TADOQuery; + ADOCmd: TADOQuery; + DataSource1: TDataSource; + Order_Sub: TClientDataSet; + DataSource2: TDataSource; + ADOZDY: TADOQuery; + CDS_ZDY: TClientDataSet; + FactoryNoName: TcxButtonEdit; + ADOQueryTmp: TADOQuery; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + PanZDY: TPanel; + CXGridZDY: TcxGrid; + TVZDY: TcxGridDBTableView; + VHelpZDYName: TcxGridDBColumn; + CXGridZDYLevel1: TcxGridLevel; + Button1: TButton; + v1Column4: TcxGridDBColumn; + Label2: TLabel; + QDTime: TDateTimePicker; + Label3: TLabel; + CompanyName: TcxButtonEdit; + Label6: TLabel; + QDPalce: TEdit; + v1Column5: TcxGridDBColumn; + Label8: TLabel; + JHPlace: TcxButtonEdit; + Label10: TLabel; + fromConNo: TcxButtonEdit; + GxNote1: TEdit; + Label11: TLabel; + v1Qty2: TcxGridDBColumn; + v1C_Color: TcxGridDBColumn; + Panel1: TPanel; + Label22: TLabel; + Label23: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + Label14: TLabel; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + procedure TBCloseClick(Sender: TObject); + procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure Button1Click(Sender: TObject); + procedure TVZDYKeyPress(Sender: TObject; var Key: Char); + procedure FormShow(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton2Click(Sender: TObject); + procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure FactoryNoNamePropertiesChange(Sender: TObject); + procedure CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesEditValueChanged(Sender: TObject); + procedure fromConNoKeyPress(Sender: TObject; var Key: Char); + procedure v1ClothUnitPropertiesEditValueChanged(Sender: TObject); + procedure fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column6PropertiesEditValueChanged(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure v1C_ColorPropertiesEditValueChanged(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure OrdPerson1BtnClick(Sender: TObject); + private + FXS: Integer; + procedure InitData(); + procedure ZDYHelp(FButn: TcxButtonEdit; LType: string); + function SaveData(): Boolean; + function YFData(fMainID, FsubID: string): Boolean; + procedure DoQuery(fkeyNo: string); + procedure DoKc(); + { Private declarations } + public + PState: Integer; + FMainId, FConType: string; + + { Public declarations } + end; + +var + frmClothContractCPInPut: TfrmClothContractCPInPut; + +implementation + +uses + U_DataLink, U_ZDYHelp, U_Fun, U_ZdyAttachGYS, U_ClothContractList_help, + U_UserHelp, U_ZdyAttachCP,U_ClothContractList_CK_help; + +{$R *.dfm} +procedure TfrmClothContractCPInPut.DoKc(); +begin + Label22.Caption := 'ƥ0'; + Label23.Caption := '0'; + if Order_Sub.IsEmpty then + exit; + if trim(Order_Sub.fieldbyname('C_CodeName').AsString) = '' then + exit; +// IF trim(Order_Sub.fieldbyname('C_Color').AsString)='' then exit; + if trim(FactoryNoName.Text) = '' then + exit; + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('exec P_Get_Contract'); + sql.Add('@begdate=''' + Trim(Order_Sub.fieldbyname('C_CodeName').AsString) + ''' '); + sql.Add(',@enddate=''' + trim(FactoryNoName.Text) + ''' '); + sql.Add(',@conType=''ѯ'' '); + sql.Add(',@status=''' + inttostr(1) + ''' '); + open; + end; + if not ADOTemp.IsEmpty then + begin + Label22.Caption := 'ƥ' + trim(ADOTemp.fieldbyname('N_PS').AsString); + Label23.Caption := '' + trim(ADOTemp.fieldbyname('N_Qty').AsString); + end; +end; + +procedure TfrmClothContractCPInPut.DoQuery(fkeyNo: string); +begin + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * from Contract_Main '); + sql.Add('where conNo=' + quotedstr(trim(fkeyNo))); + open; + if not IsEmpty then + begin + FactoryNoName.Text := fieldbyname('FactoryNoName').AsString; + + fromConNo.Hint := fieldbyname('mainID').AsString; + end + else + begin + application.MessageBox('˲ɹƻŴ', 'ʾϢ', 0); + exit; + end; + end; + + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.conNo=' + quotedstr(trim(fkeyNo))); + open; + if not IsEmpty then + begin + SCreateCDS20(ADOTemp, Order_Sub); + SInitCDSData20(ADOTemp, Order_Sub); + end + else + begin + end; + end; + with Order_Sub do + begin + DisableControls; + First; + while not eof do + begin + edit; + fieldbyname('fromMainID').Value := fieldbyname('MainID').AsString; + fieldbyname('fromsubID').Value := fieldbyname('subID').AsString; + fieldbyname('MainID').Value := ''; + fieldbyname('subID').Value := ''; + post; + next; + end; + First; + EnableControls; + end; + +end; + +function TfrmClothContractCPInPut.YFData(fMainID, FsubID: string): Boolean; +var + CRID, OrdMainId, YFID, FComTaiTou, FCRID, FFactoryName: string; +begin + Result := False; + try + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(FactoryNoName.Text) + ''''); + Open; + end; + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_CRID set CRID=CRID+1'); + sql.Add('select * from YF_Money_CRID '); + Open; + end; + CRID := ADOCmd.fieldbyname('CRID').AsString; + with ADOCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC '); + sql.add('where CRID=' + quotedstr(trim(CRID))); + Open; + end; + with ADOCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(FactoryNoName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where mainID=''' + Trim(fMainID) + ''''); + sql.Add('and subID=''' + Trim(FsubID) + ''''); + sql.Add('and YFName='''' '); + Open; + end; + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOCmd, YFID, 'YF', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + end; + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where YFID=''' + Trim(YFID) + ''''); + Open; + end; + with ADOCmd do + begin + if ADOQueryTmp.IsEmpty then + Append + else + Edit; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(ConNo.Text); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(FactoryNoName.Text); + FieldByName('CRTime').Value := formatDateTime('yyyy-MM-dd', DeliveryDate.Date); + FieldByName('Qty').Value := Order_Sub.fieldbyname('C_Qty').Value; + FieldByName('PS').Value := Order_Sub.fieldbyname('Qty1').Value; + FieldByName('T_Qty').Value := Order_Sub.fieldbyname('T_Qty').Value; + FieldByName('YFType').Value := 'Զ'; + FieldByName('Price').Value := Order_Sub.fieldbyname('Price').asfloat; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('ComTaiTou').Value := Trim(FComTaiTou); + FieldByName('QtyUnit').Value := Trim(Order_Sub.fieldbyname('C_Unit').AsString); + FieldByName('YFName').Value := ''; + FieldByName('MainId').Value := Trim(fMainID); + FieldByName('subID').Value := Trim(FsubID); + Post; + end; + + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty,T_money=Price*T_Qty '); + sql.Add(' where YFID=''' + Trim(YFID) + ''''); + ExecSQL; + end; + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add(' Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(' where CRID=' + CRID); + ExecSQL; + end; + Result := True; + except + end; +end; + +procedure TfrmClothContractCPInPut.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmClothContractCPInPut.InitData(); +begin + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * '); + sql.Add('from Contract_Main A'); + sql.Add('where A.mainID= ''' + Trim(fMainID) + ''' '); + Open; + if not ADOQueryTmp.IsEmpty then + begin + SCSHData(ADOQueryTmp, ScrollBox1, 0); + end; + end; + + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select *,Gf=(select factoryNoName from Contract_Main X where X.mainID=A.frommainID), '); + sql.Add('fdhNO=(select conNo from Contract_Main X where X.mainID=A.frommainID) '); + sql.Add('from Contract_sub A'); + sql.Add('where A.mainID= ''' + Trim(fMainID) + ''' '); + Open; + SCreateCDS20(ADOQueryTmp, Order_Sub); + SInitCDSData20(ADOQueryTmp, Order_Sub); + + end; + + if PState = 0 then + begin + with ADOTemp do + begin + Close; + SQL.Clear; + sql.Add('select Top 1* from Contract_Main order by FillTime desc '); + Open; + end; + QDTime.DateTime := SGetServerDate(ADOTemp); + DeliveryDate.DateTime := SGetServerDate(ADOTemp); + QDTime.Checked := True; + DeliveryDate.Checked := False; + ConNo.Text := 'Զ'; + end; + PanZDY.Visible := False; +end; + +procedure TfrmClothContractCPInPut.ZDYHelp(FButn: TcxButtonEdit; LType: string); +var + FType, ZDYName, FText: string; +begin + PanZDY.Visible := True; + PanZDY.Left := FButn.Left; + PanZDY.Top := FButn.Top + FButn.Height; + with ADOZDY do + begin + Filtered := False; + Close; + SQL.Clear; + SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type=''' + Trim(LType) + ''''); + Open; + end; + FText := Trim(FButn.Text); + if FText <> '' then + SDofilter(ADOZDY, ' ZDYName like ' + QuotedStr('%' + Trim(FText) + '%')) + else + SDofilter(ADOZDY, ''); + VHelpZDYName.Summary.GroupFormat := Trim(FButn.Name); +end; + +procedure TfrmClothContractCPInPut.TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +var + FName: string; +begin + if ADOZDY.IsEmpty then + Exit; + FName := Trim(VHelpZDYName.Summary.GroupFormat); + TcxButtonEdit(FindComponent(FName)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(FName)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; +end; + +procedure TfrmClothContractCPInPut.Button1Click(Sender: TObject); +begin + PanZDY.Visible := False; +end; + +procedure TfrmClothContractCPInPut.TVZDYKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + if ADOZDY.IsEmpty then + Exit; + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; + ADOZDY.Active := False; + end; +end; + +procedure TfrmClothContractCPInPut.FormShow(Sender: TObject); +begin + { if Trim(DParameters1)='1' then + begin + v1Price.Visible:=False; + v1ClothQty.Visible:=False; + v1PRTQty.Visible:=False; + end else + begin + v1Price.Visible:=True; + v1ClothQty.Visible:=True; + v1PRTQty.Visible:=True; + end; } + + readCXgrid(self.Caption, tv1); + InitData(); +end; + +function TfrmClothContractCPInPut.SaveData(): Boolean; +var + maxno: string; +begin + try + ADOCmd.Connection.BeginTrans; + /// + with ADOCmd do + begin + Close; + sql.Clear; + SQL.Add('select * from Contract_Main where MainId=''' + Trim(fMainID) + ''''); + Open; + end; + with ADOCmd do + begin + if FConType = 'ԤͶ' then + begin + if Trim(fMainID) = '' then + begin + Append; + if GetLSNo(ADOTemp, maxno, 'T', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + end + else + begin + maxno := Trim(fMainID); + Edit; + end; + end + else if FConType = 'Ʒ' then + begin + if Trim(fMainID) = '' then + begin + Append; + if GetLSNo(ADOTemp, maxno, 'XP', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + end + else + begin + maxno := Trim(fMainID); + Edit; + end; + + end + else if FConType = 'ƻ' then + begin + if Trim(fMainID) = '' then + begin + Append; + if GetLSNo(ADOTemp, maxno, 'DY', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + end + else + begin + maxno := Trim(fMainID); + Edit; + end; + end + else + begin + if Trim(fMainID) = '' then + begin + Append; + if GetLSNo(ADOTemp, maxno, 'H', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + end + else + begin + maxno := Trim(fMainID); + Edit; + end; + end; + + FieldByName('MainId').Value := Trim(maxno); + SSetsaveSql(ADOCmd, 'Contract_Main', ScrollBox1, 0); + + FieldByName('FactoryNoName').Value := Trim(FactoryNoName.Text); +// FieldByName('CustomerNoName').Value := Trim(CustomerNoName.Text); +// FieldByName('OrdPerson1').Value := Trim(OrdPerson1.Text); + + if Trim(fMainID) = '' then + begin + FieldByName('Filler').Value := Trim(DName); + end + else + begin + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp); + end; +// FieldByName('ConType').Value := 'ԤͶ'; + FieldByName('ConType').Value := FConType; + FieldByName('status').Value := '0'; + FieldByName('fromconNo').Value := Trim(fromConNo.Text); + FieldByName('fromMainID').Value := Trim(fromConNo.Hint); + Post; + end; + fMainID := Trim(maxno); + ///ӱ + with Order_Sub do + begin + First; + while not Eof do + begin + if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then + begin + end; + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then + begin + if GetLSNo(ADOTemp, maxno, 'CS', 'Contract_Sub', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(Order_Sub.fieldbyname('SubId').AsString); + end; + with ADOCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(fMainID) + ''''); + sql.Add(' and SubId=''' + Trim(maxno) + ''''); + Open; + end; + with ADOCmd do + begin + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then + Append + else + Edit; + FieldByName('MainId').Value := Trim(fMainID); + FieldByName('SubId').Value := Trim(maxno); + FieldByName('ConNo').Value := Trim(ConNo.Text); + RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'Contract_Sub', 0); + FieldByName('fromMainID').Value := Trim(Order_Sub.fieldbyname('fromMainID').AsString); + FieldByName('fromsubID').Value := Trim(Order_Sub.fieldbyname('fromsubID').AsString); + FieldByName('C_Status').Value := '0'; + FieldByName('Qty2').Value := Order_Sub.fieldbyname('Qty2').AsFloat; + FieldByName('Qty1').Value := Order_Sub.fieldbyname('Qty1').AsFloat; + FieldByName('C_Qty').Value := Order_Sub.fieldbyname('C_Qty').AsFloat; + if Trim(Order_Sub.fieldbyname('C_Qty').AsString) = '' then + begin + FieldByName('C_Qty').Value := 0; + end; + + if Trim(Order_Sub.fieldbyname('Price').AsString) = '' then + begin + FieldByName('Price').Value := 0; + end; + Post; + end; + Order_Sub.Edit; + Order_Sub.FieldByName('SubId').Value := Trim(maxno); + + //Order_Sub.Post; + Next; + end; + end; + ADOCmd.Connection.CommitTrans; + Result := True; + except + Result := False; + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ʧܣ', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractCPInPut.TBSaveClick(Sender: TObject); +begin + DeliveryDate.SetFocus; + if Trim(ConNo.Text) = '' then + begin + Application.MessageBox('ͬŲΪգ', 'ʾ', 0); + Exit; + end; + if Trim(FactoryNoName.Text) = '' then + begin + Application.MessageBox('ӹΪգ', 'ʾ', 0); + Exit; + end; + if Order_Sub.IsEmpty then + begin + Application.MessageBox('ϸΪգ', 'ʾ', 0); + exit; + end; + + if Order_Sub.Locate('C_CodeName', null, []) = True then + begin + Application.MessageBox('ƷΪ!', 'ʾ', 0); + Exit; + end; + if Order_Sub.Locate('C_CodeName', '', []) = True then + begin + Application.MessageBox('ƷΪ!', 'ʾ', 0); + Exit; + end; + if Order_Sub.Locate('C_Color', null, []) = True then + begin + Application.MessageBox('ɫΪ!', 'ʾ', 0); + Exit; + end; + if Order_Sub.Locate('C_Color', '', []) = True then + begin + Application.MessageBox('ɫΪ!', 'ʾ', 0); + Exit; + end; + { if Order_Sub.Locate('C_Qty',null,[]) then + begin + Application.MessageBox('Ϊ!','ʾ',0); + Exit; + end; } + if Order_Sub.Locate('C_Unit', null, []) then + begin + Application.MessageBox('λΪ!', 'ʾ', 0); + Exit; + end; +{ if Order_Sub.Locate('KZQty',null,[]) then + begin + Application.MessageBox('زΪ!','ʾ',0); + Exit; + end; + if Order_Sub.Locate('MFQty',null,[]) then + begin + Application.MessageBox('ŷΪ!','ʾ',0); + Exit; + end; } + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * from KH_Zdy_Attachment A where Type=''GYS'''); + sql.Add('and zdyName=''' + trim(FactoryNoName.text) + ''' '); + open; + end; + if ADOTemp.IsEmpty then + begin + application.MessageBox('ӹڣ', 'ʾϢ', 0); + exit; + end; + + if SaveData() then + begin + Application.MessageBox('ɹ', 'ʾ', 0); + ConNo.Text := ''; + FactoryNoName.Text := ''; + CompanyName.Text := ''; +// LXPerson.Text := ''; +// LXTel.Text := ''; + JHPlace.Text := ''; + Order_Sub.EmptyDataSet; + PState := 0; + fMainID := ''; + ConNo.Text := 'Զ'; + end; +end; + +procedure TfrmClothContractCPInPut.v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('OrderUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PRTUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdColor'; + flagname := 'ɫ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PRTColor').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.ToolButton2Click(Sender: TObject); +begin + if Order_Sub.IsEmpty then + Exit; + if Trim(Order_Sub.fieldbyname('SubId').AsString) <> '' then + begin + with ADOCmd do + begin + close; + sql.Clear; + sql.Add('select * from JYOrder_Sub_AnPai '); + sql.Add('where subID=''' + Trim(Order_Sub.fieldbyname('subID').AsString) + ''''); + open; + end; + if not ADOCmd.IsEmpty then + begin + Application.MessageBox('ѻز֣ɾͶƻ', 'ʾ', 0); + Exit; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + end; + Order_Sub.Delete; +end; + +procedure TfrmClothContractCPInPut.FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + if Trim(fMainID) <> '' then + begin + with ADOTemp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR A where exists('); + sql.Add('select * from Contract_Sub_MX B inner join Contract_Sub C on B.SubId=C.SubId '); + sql.Add(' where C.Mainid=''' + Trim(fMainID) + ''''); + sql.Add(' and B.MXID=A.YFTypeId)'); + Open; + end; + if ADOTemp.IsEmpty = False then + begin + Application.MessageBox('ѾӦ޸ĹӦ!', 'ʾ', 0); + Exit; + end; + end; + + try + frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); + with frmZdyAttachGYS do + begin + if ShowModal = 1 then + begin + FactoryNoName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + FactoryNoName.Hint := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); +// LXTel.Text := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); +// LXPerson.Text := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); + end; + end; + finally + frmZdyAttachGYS.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZdyAttachCP := TfrmZdyAttachCP.Create(Application); + with frmZdyAttachCP do + begin + FType := 'Ʒ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('C_Color').Value := Trim(CDS_HZ.fieldbyname('DEFstr3').AsString); + Self.Order_Sub.FieldByName('C_ColorNo').Value := Trim(CDS_HZ.fieldbyname('DEFstr10').AsString); + Self.Order_Sub.FieldByName('C_Spec').Value := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); + Self.Order_Sub.FieldByName('KZQty').Value := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); + Self.Order_Sub.FieldByName('MFQty').Value := Trim(CDS_HZ.fieldbyname('DEFstr1').AsString); + Self.Order_Sub.Post; + + end; + end; + finally + frmZdyAttachCP.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); + DoKc(); + { try + frmZDYHelp:=TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag:='MPRTCodeName'; + flagname:='Ʒ'; + V1Name.Caption:=''; + V1Note.Caption:='Ӣ'; +// MainType:=Trim(DName); + fnote:=FALSE; + // flag:='Cloth'; + // flagname:='Ʒ'; + if ShowModal=1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_CodeName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString)+'#'; + Self.Order_Sub.FieldByName('C_Code').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; } +end; + +procedure TfrmClothContractCPInPut.v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'KZ'; + flagname := 'صλ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('KZUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'MF'; + flagname := 'ŷλ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('MFUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'PriceUnit'; + flagname := 'Ƽ۵λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PriceUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrderUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_Unit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.FactoryNoNamePropertiesChange(Sender: TObject); +begin + {if FXS=99 then + begin + PanZDY.Visible:=False; + FXS:=0; + Exit; + end; + ZDYHelp(FactoryNoName,'FactoryNo1Name'); } +end; + +procedure TfrmClothContractCPInPut.CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdDefStr2'; + flagname := '跽'; + if ShowModal = 1 then + begin + FXS := 99; + CompanyName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPInPut.JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin +{try + frmZdyAttachGYS:=TfrmZdyAttachGYS.Create(Application); + with frmZdyAttachGYS do + begin + if ShowModal=1 then + begin + JHPlace.Text:=Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + // FactoryNoName.Text:=Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + // FactoryNoName.Hint:=Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + // LXTel.Text:=Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); + // LXPerson.Text:=Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); + end; + end; + finally + frmZdyAttachGYS.Free; + end; + } +end; + +procedure TfrmClothContractCPInPut.v1Column1PropertiesEditValueChanged(Sender: TObject); +var + mvalue: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + + if trim(mvalue) = '' then + exit; + +// if rightBstr(trim(mvalue), 1) <> '#' then +// begin +// mvalue := trim(mvalue) + '#'; +// end; + mvalue := trim(mvalue); + with Order_Sub do + begin + Edit; + FieldByName('C_CodeName').Value := Trim(mvalue); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit(); + DoKc(); +end; + +procedure TfrmClothContractCPInPut.fromConNoKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + DoQuery(fromConNo.text); + end; +end; + +procedure TfrmClothContractCPInPut.v1ClothUnitPropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; +begin + if Trim(TcxTextEdit(Sender).EditingText) <> '' then + begin + mvalue := TcxTextEdit(Sender).EditingText; + end + else + begin + mvalue := '0'; + end; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + with Order_Sub do + begin + Edit; + FieldByName(Trim(fieldname)).Value := mvalue; + Post; + end; + with Order_Sub do + begin + Edit; + FieldByName('money').Value := strtofloat(format('%.2f', [FieldByName('C_Qty').AsFloat * FieldByName('Price').AsFloat])); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothContractCPInPut.fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmClothContractList_CK_help := TfrmClothContractList_CK_help.Create(Application); + with frmClothContractList_CK_help do + begin + if ShowModal = 1 then + begin + fromConNO.Text := Trim(Order_Main.fieldbyname('ConNO').AsString); + end; + end; + finally + frmClothContractList_CK_help.Free; + end; +// DoQuery(fromConNo.text); +end; + +procedure TfrmClothContractCPInPut.v1Column6PropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; +begin + if Trim(TcxTextEdit(Sender).EditingText) <> '' then + begin + mvalue := TcxTextEdit(Sender).EditingText; + end + else + begin + mvalue := '0'; + end; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + with Order_Sub do + begin + Edit; + FieldByName(Trim(fieldname)).Value := mvalue; + Post; + end; + with Order_Sub do + begin + Edit; + FieldByName('T_money').Value := strtofloat(format('%.2f', [FieldByName('T_Qty').AsFloat * FieldByName('Price').AsFloat])); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothContractCPInPut.ToolButton1Click(Sender: TObject); +begin + with Order_Sub do + begin + Append; + fieldbyname('PriceUnit').Value := ''; + fieldbyname('C_UNit').Value := 'M'; + Post; + end; +{ frmClothContractList_Help:=TfrmClothContractList_Help.create(self); + with frmClothContractList_Help do + begin + if showmodal=1 then + begin + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + IF fieldbyname('ssel').AsBoolean then + begin + Order_Sub.Append; + Order_Sub.Fieldbyname('gf').Value:=trim(Fieldbyname('FactoryNoName').AsString); + Order_Sub.Fieldbyname('fdhNO').Value:=trim(Fieldbyname('conNo').AsString); + Order_Sub.Fieldbyname('fromMainID').Value:=trim(Fieldbyname('MainID').AsString); + Order_Sub.Fieldbyname('fromsubID').Value:=trim(Fieldbyname('subID').AsString); + Order_Sub.Fieldbyname('C_CodeName').Value:=trim(Fieldbyname('C_CodeName').AsString); + Order_Sub.Fieldbyname('C_spec').Value:=trim(Fieldbyname('C_spec').AsString); +// Order_Sub.Fieldbyname('KZQty').Value:=Fieldbyname('KZQty').AsFloat; +// Order_Sub.Fieldbyname('MFQty').Value:=Fieldbyname('MFQty').AsFloat; + // Order_Sub.Fieldbyname('Qty1').Value:=Fieldbyname('N_ps').AsFloat ; + // Order_Sub.Fieldbyname('C_Qty').Value:=Fieldbyname('N_Qty').AsFloat ; + Order_Sub.Fieldbyname('C_Unit').Value:=trim(Fieldbyname('C_Unit').AsString); + Order_Sub.Post; + end; + next; + end; + First; + EnableControls; + end; + end; + end; } +end; + +procedure TfrmClothContractCPInPut.v1C_ColorPropertiesEditValueChanged(Sender: TObject); +var + mvalue: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + + if trim(mvalue) = '' then + exit; + + if rightBstr(trim(mvalue), 1) <> '#' then + begin + mvalue := trim(mvalue) + '#'; + end; + + with Order_Sub do + begin + Edit; + FieldByName('C_Color').Value := Trim(mvalue); + Post; + end; + + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * from KH_Zdy_Attachment A '); + sql.Add('where zdyName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); + sql.Add('and DEFstr3=' + quotedstr(trim(Order_Sub.fieldbyname('C_Color').AsString))); + open; + end; + if ADOTemp.IsEmpty then + begin + application.MessageBox('ɫڣ', 'ʾϢ', 0); + with Order_Sub do + begin + Edit; + FieldByName('C_Color').Value := ''; + Post; + end; + end; + with Order_Sub do + begin + Edit; + FieldByName('C_Code').Value := trim(ADOTemp.fieldbyname('ZDYCode').AsString); + Post; + end; + + self.tv1.Controller.EditingController.ShowEdit(); + +end; + +procedure TfrmClothContractCPInPut.FormCreate(Sender: TObject); +begin + cxGrid1.Align := Alclient; +end; + +procedure TfrmClothContractCPInPut.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCXgrid(self.Caption, tv1); +end; + +procedure TfrmClothContractCPInPut.OrdPerson1BtnClick(Sender: TObject); +begin + frmUserHelp := TfrmUserHelp.create(self); + with frmUserHelp do + begin + if showmodal = 1 then + begin +// OrdPerson1.Text := trim(ADOQueryHelp.fieldbyname('UserName').AsString); + end; + free; + end; +end; + +end. + diff --git a/管理系统/U_ClothContractCPRKList.dfm b/管理系统/U_ClothContractCPRKList.dfm new file mode 100644 index 0000000..6651148 --- /dev/null +++ b/管理系统/U_ClothContractCPRKList.dfm @@ -0,0 +1,770 @@ +object frmClothContractCPRKList: TfrmClothContractCPRKList + Left = 309 + Top = 284 + Width = 1222 + Height = 738 + Caption = #25104#21697#20837#24211#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + OnClick = TBAddClick + end + object TBEdit: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + Visible = False + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Visible = False + OnClick = TBDelClick + end + object ToolButton1: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 378 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 441 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 504 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #20219#21153#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #35268#26684 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 26 + Height = 12 + Caption = #20379#26041 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 836 + Top = 22 + Width = 52 + Height = 12 + Caption = #21040#36135#22320#28857 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + OnKeyPress = conPress + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Spec: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 732 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + object JHPlace: TEdit + Tag = 2 + Left = 892 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 6 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 85 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + 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 + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1OrderNo: TcxGridDBColumn + Caption = #20219#21153#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1Column8: TcxGridDBColumn + Caption = #25237#22383#21333#21495 + DataBinding.FieldName = 'fromConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 86 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 58 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #21040#36135#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #23384#25918#26579#21378 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MF' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZ' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'T_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column7: TcxGridDBColumn + Caption = #21040#36135#22320#28857 + DataBinding.FieldName = 'JHPlace' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 101 + end + object v1Column18: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column20: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column19: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column21: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Column2: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column3: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 1096 + Top = 8 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 1112 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 880 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 920 + Top = 224 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 680 + Top = 32 + end + object cxStyleRepository1: TcxStyleRepository + Left = 305 + Top = 310 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractCPRKList.pas b/管理系统/U_ClothContractCPRKList.pas new file mode 100644 index 0000000..562e755 --- /dev/null +++ b/管理系统/U_ClothContractCPRKList.pas @@ -0,0 +1,889 @@ +unit U_ClothContractCPRKList; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxCurrencyEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, + dxBarBuiltInMenu, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothContractCPRKList = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Spec: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + v1Column8: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + ToolButton1: TToolButton; + Label7: TLabel; + JHPlace: TEdit; + v1Column18: TcxGridDBColumn; + v1Column19: TcxGridDBColumn; + v1Column20: TcxGridDBColumn; + v1Column21: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure conPress(Sender: TObject; var Key: Char); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure tchkClick(Sender: TObject); + procedure TnochkClick(Sender: TObject); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure cxTabControl1Change(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractCPRKList: TfrmClothContractCPRKList; + +implementation + +uses + U_DataLink, U_ClothContractCPInPut, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractCPRKList.FormDestroy(Sender: TObject); +begin + frmClothContractCPRKList := nil; +end; + +procedure TfrmClothContractCPRKList.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractCPRKList.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractCPRKList.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractCPRKList.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('exec P_Get_Contract_CP'); + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); + sql.Add(',@conType=''Ʒ'' '); + sql.Add(',@status=''2'' '); +// ShowMessage(SQL.text); + + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + TBFind.Click; + end; +end; + +procedure TfrmClothContractCPRKList.InitForm(); +begin + if fDParameters1 = 'ѯ' then + begin + TBADD.Visible := false; + // TBEdit.Visible:=false; + TBDel.Visible := false; + // Tchk.Visible:=false; + // TNochk.Visible:=false; +// v1T_money.Visible := false; +// v1T_money.Hidden := true; + ToolButton1.Visible := false; + end; + +// TBEdit.Enabled := false; +// TBDel.Enabled := false; + + + InitGrid(); +end; + +procedure TfrmClothContractCPRKList.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractCPRKList.TBEditClick(Sender: TObject); +var + i: integer; +begin + if Order_Main.IsEmpty then + Exit; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; +// with ADOQueryTemp do +// begin +// close; +// sql.Clear; +// sql.Add('select * from contract_sub '); +// sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); +//// sql.Add(' '); +// open; +// if not IsEmpty then +// begin +// application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); +// exit; +// end; +// end; + try + frmClothContractCPInPut := TfrmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + // TBRafresh.Click; + end; + end; + finally + frmClothContractCPInPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractCPRKList.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣɾ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select * from contract_sub '); + sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); + open; + if not IsEmpty then + begin + application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractCPRKList.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractCPRKList.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); +end; + +procedure TfrmClothContractCPRKList.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\.rmf'), 'ʾ', 0); + end; + +end; + +procedure TfrmClothContractCPRKList.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractCPRKList.TBAddClick(Sender: TObject); +var + i: integer; +begin + try + frmClothContractCPInPut := TfrmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + frmClothContractCPInPut.Caption := 'Ʒ'; + PState := 0; + FMainId := ''; + FConType := 'Ʒ'; + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractCPInPut.Free; + TBRafresh.Click; + end; +// try +// frmClothContractCPInPut := frmClothContractCPInPut.Create(Application); +// with frmClothContractCPInPut do +// begin +// PState := 0; +// FMainId := ''; +// FConType := 'Ʒ'; +// if ShowModal = 1 then +// begin +// +// end; +// end; +// finally +// frmClothContractCPInPut.Free; +// TBRafresh.Click; +// end; +end; + +procedure TfrmClothContractCPRKList.ConNoChange(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractCPRKList.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + initForm(); + +end; + +procedure TfrmClothContractCPRKList.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractCPRKList.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractCPRKList.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractCPRKList.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractCPRKList.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractCPRKList.conPress(Sender: TObject; var Key: Char); +begin + { if Key=#13 then + begin + if Length(Trim(ConNoM.Text))<4 then Exit; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add('exec ClothContract_QryList :MainId,:WSql'); + Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNoM.Text)+'%'+''''; + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; + end; } +end; + +procedure TfrmClothContractCPRKList.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractCPInPut := TfrmClothContractCPInPut.Create(Application); + with frmClothContractCPInPut do + begin + PState := 3; + TBSave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractCPInPut.Free; + end; +end; + +procedure TfrmClothContractCPRKList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractCPRKList.tchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + { try + frmClothContractInPut := TfrmClothContractInPut.Create(Application); + with frmClothContractInPut do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + with self.ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(self.Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(self.Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + self.InitGrid(); + end + else + begin + end; + end; + finally + frmClothContractInPut.Free; + // TBRafresh.Click; + end; } + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractCPRKList.TnochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + {with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; } + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractCPRKList.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin +// FBounds := AViewInfo.Bounds; +// if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then +// begin +// ACanvas.FillRect(FBounds); +// ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); +// FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); +// InflateRect(FBounds, -1, -1); +// ACanvas.Font.Color := clBlack; +// ACanvas.Brush.Style := bsClear; +// ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); +// ADone := True; +// end; +end; + +procedure TfrmClothContractCPRKList.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +// if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('H_PS').Index] >= AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Qty1').Index] then +// begin +// ACanvas.Brush.Color := clSkyBlue; +// end; +end; + +procedure TfrmClothContractCPRKList.cxTabControl1Change(Sender: TObject); +begin + initForm(); +end; + +end. + diff --git a/管理系统/U_ClothContractInPut.dfm b/管理系统/U_ClothContractInPut.dfm index 060eaff..cfb2d9d 100644 --- a/管理系统/U_ClothContractInPut.dfm +++ b/管理系统/U_ClothContractInPut.dfm @@ -587,16 +587,6 @@ object frmClothContractInPut: TfrmClothContractInPut HeaderAlignmentHorz = taCenter Width = 118 end - object Tv1Column2: TcxGridDBColumn - Caption = #24211#23384#35843#25972#21305#25968 - DataBinding.FieldName = 'kctzps' - Width = 90 - end - object Tv1Column3: TcxGridDBColumn - Caption = #24211#23384#35843#25972#25968#37327 - DataBinding.FieldName = 'kctzsl' - Width = 90 - end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractInPut.pas b/管理系统/U_ClothContractInPut.pas index 5f432fa..034836a 100644 --- a/管理系统/U_ClothContractInPut.pas +++ b/管理系统/U_ClothContractInPut.pas @@ -91,8 +91,6 @@ type Panel1: TPanel; Label11: TLabel; Tv1Column1: TcxGridDBColumn; - Tv1Column2: TcxGridDBColumn; - Tv1Column3: TcxGridDBColumn; procedure TBCloseClick(Sender: TObject); procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure Button1Click(Sender: TObject); diff --git a/管理系统/U_ClothContractInPut_CG.dfm b/管理系统/U_ClothContractInPut_CG.dfm index 0f3b8b4..8015e08 100644 --- a/管理系统/U_ClothContractInPut_CG.dfm +++ b/管理系统/U_ClothContractInPut_CG.dfm @@ -424,7 +424,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG Width = 103 end object v1PRTColor: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' + Caption = #31859#20811#37325 DataBinding.FieldName = 'KZQty' HeaderAlignmentHorz = taCenter Options.Sorting = False @@ -444,6 +444,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG DataBinding.FieldName = 'Price' PropertiesClassName = 'TcxTextEditProperties' Properties.OnEditValueChanged = v1PricePropertiesEditValueChanged + Visible = False HeaderAlignmentHorz = taCenter Styles.Header = DataLink_TradeManage.handBlack Width = 58 @@ -459,6 +460,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG end> Properties.ReadOnly = True Properties.OnButtonClick = v1ClothQtyPropertiesButtonClick + Visible = False HeaderAlignmentHorz = taCenter Options.Sorting = False Styles.Header = DataLink_TradeManage.handBlack @@ -503,6 +505,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG object v1PRTQty: TcxGridDBColumn Caption = #24635#20215 DataBinding.FieldName = 'Money' + Visible = False HeaderAlignmentHorz = taCenter Options.Focusing = False Options.Sorting = False @@ -512,6 +515,13 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG object v1Column4: TcxGridDBColumn Caption = #22791#27880 DataBinding.FieldName = 'C_Note' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column4PropertiesButtonClick HeaderAlignmentHorz = taCenter Styles.Header = DataLink_TradeManage.Default Width = 85 diff --git a/管理系统/U_ClothContractInPut_CG.pas b/管理系统/U_ClothContractInPut_CG.pas index 6ae8629..08e77e6 100644 --- a/管理系统/U_ClothContractInPut_CG.pas +++ b/管理系统/U_ClothContractInPut_CG.pas @@ -106,6 +106,7 @@ type procedure v1PricePropertiesEditValueChanged(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure v1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); private FXS: Integer; procedure InitData(); @@ -290,7 +291,7 @@ begin Open; end; QDTime.DateTime := SGetServerDate(ADOTemp); - DeliveryDate.DateTime := QDTime.DateTime; + DeliveryDate.DateTime := SGetServerDate(ADOTemp); QDTime.Checked := True; DeliveryDate.Checked := False; ConNo.Text := 'Զ'; @@ -977,5 +978,24 @@ begin writeCXgrid(self.Caption, tv1); end; +procedure TfrmClothContractInPut_CG.v1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'C_Note'; + flagname := 'ע'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_Note').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + end. diff --git a/管理系统/U_ClothContractInPut_Tp.dfm b/管理系统/U_ClothContractInPut_Tp.dfm index 8475d37..a184984 100644 --- a/管理系统/U_ClothContractInPut_Tp.dfm +++ b/管理系统/U_ClothContractInPut_Tp.dfm @@ -262,17 +262,6 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Enabled = False TabOrder = 0 end - object DeliveryDate: TDateTimePicker - Left = 353 - Top = 10 - Width = 134 - Height = 20 - BevelInner = bvNone - Date = 40916.000000000000000000 - Format = 'yyyy-MM-dd' - Time = 40916.000000000000000000 - TabOrder = 1 - end object FactoryNoName: TcxButtonEdit Left = 574 Top = 10 @@ -286,7 +275,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Properties.OnButtonClick = FactoryNoNamePropertiesButtonClick Properties.OnChange = FactoryNoNamePropertiesChange Style.BorderStyle = ebsSingle - TabOrder = 2 + TabOrder = 1 Width = 134 end object PanZDY: TPanel @@ -294,7 +283,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Top = 128 Width = 202 Height = 153 - TabOrder = 3 + TabOrder = 2 Visible = False object CXGridZDY: TcxGrid Left = 3 @@ -345,7 +334,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Format = 'yyyy-MM-dd' Time = 40916.670856296290000000 ShowCheckbox = True - TabOrder = 4 + TabOrder = 3 Visible = False end object CompanyName: TcxButtonEdit @@ -359,7 +348,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp end> Properties.OnButtonClick = CompanyNamePropertiesButtonClick Style.BorderStyle = ebsSingle - TabOrder = 5 + TabOrder = 4 Visible = False Width = 132 end @@ -368,7 +357,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Top = 271 Width = 131 Height = 18 - TabOrder = 6 + TabOrder = 5 Visible = False end object LXPerson: TEdit @@ -376,14 +365,14 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Top = 35 Width = 134 Height = 18 - TabOrder = 7 + TabOrder = 6 end object LXTel: TEdit Left = 354 Top = 35 Width = 135 Height = 18 - TabOrder = 8 + TabOrder = 7 end object JHPlace: TcxButtonEdit Left = 341 @@ -395,7 +384,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Kind = bkEllipsis end> Properties.OnButtonClick = JHPlacePropertiesButtonClick - TabOrder = 9 + TabOrder = 8 Visible = False Width = 388 end @@ -411,7 +400,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp end> Properties.OnButtonClick = fromConNoPropertiesButtonClick Style.BorderStyle = ebsSingle - TabOrder = 10 + TabOrder = 9 Visible = False OnKeyPress = fromConNoKeyPress Width = 116 @@ -421,7 +410,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Top = 67 Width = 627 Height = 18 - TabOrder = 11 + TabOrder = 10 end object OrdPerson1: TBtnEditA Left = 572 @@ -429,7 +418,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Width = 137 Height = 20 Hint = 'OrdPerson1' - TabOrder = 12 + TabOrder = 11 OnBtnClick = OrdPerson1BtnClick end object CustomerNoName: TBtnEditC @@ -438,7 +427,7 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Width = 140 Height = 20 Hint = 'CustomerNoname' - TabOrder = 13 + TabOrder = 12 OnBtnUpClick = CustomerNoNameBtnUpClick end object DYer: TBtnEditC @@ -447,10 +436,16 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Width = 140 Height = 20 Hint = 'DYer' - TabOrder = 14 + TabOrder = 13 Visible = False OnBtnUpClick = DYerBtnUpClick end + object DeliveryDate: TcxDateEdit + Left = 356 + Top = 8 + TabOrder = 14 + Width = 131 + end end object ToolBar2: TToolBar Left = 0 @@ -646,6 +641,19 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column5: TcxGridDBColumn + Caption = #26159#21542#25340#32568 + DataBinding.FieldName = 'ISPG' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + '' + #26159 + #21542) + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractInPut_Tp.pas b/管理系统/U_ClothContractInPut_Tp.pas index 39c2876..322782c 100644 --- a/管理系统/U_ClothContractInPut_Tp.pas +++ b/管理系统/U_ClothContractInPut_Tp.pas @@ -23,7 +23,7 @@ uses dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, - dxSkinscxPCPainter; + dxSkinscxPCPainter, dxCore, cxDateUtils, cxCalendar; type TfrmClothContractInPut_Tp = class(TForm) @@ -34,7 +34,6 @@ type Label1: TLabel; ConNo: TEdit; Label4: TLabel; - DeliveryDate: TDateTimePicker; Label5: TLabel; ToolBar2: TToolBar; ToolButton1: TToolButton; @@ -98,6 +97,8 @@ type Label13: TLabel; DYer: TBtnEditC; Tv1Column4: TcxGridDBColumn; + DeliveryDate: TcxDateEdit; + Tv1Column5: TcxGridDBColumn; procedure TBCloseClick(Sender: TObject); procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure Button1Click(Sender: TObject); @@ -417,9 +418,15 @@ begin Open; end; QDTime.DateTime := SGetServerDate(ADOTemp); - DeliveryDate.DateTime := SGetServerDate(ADOTemp); +// DeliveryDate.DateTime := SGetServerDate(ADOTemp); + if FConType = 'ԤͶ' then + begin + + end + else + DeliveryDate.Date := SGetServerDate(ADOTemp); QDTime.Checked := True; - DeliveryDate.Checked := False; +// DeliveryDate.Checked := False; ConNo.Text := 'Զ'; end; PanZDY.Visible := False; @@ -491,16 +498,20 @@ begin v1ClothQty.Visible:=True; v1PRTQty.Visible:=True; end; } - if Trim(FConType) = 'ƻ' then + if Trim(FConType) = 'ƻ' then begin Label13.Visible := True; DYer.Visible := True; end; - if Trim(FConType) = 'Ʒӹ' then + if Trim(FConType) = 'Ʒӹ' then begin Tv1Column4.Visible := True; // DYer.Visible := True; end; + if Trim(FConType) = 'ԤͶ' then + begin + Tv1Column5.Visible := True; + end; readCXgrid(self.Caption, tv1); InitData(); end; @@ -730,6 +741,11 @@ begin Application.MessageBox('ͬŲΪգ', 'ʾ', 0); Exit; end; + if Trim(DeliveryDate.Text) = '' then + begin + Application.MessageBox('ͶڲΪգ', 'ʾ', 0); + Exit; + end; if Trim(FactoryNoName.Text) = '' then begin Application.MessageBox('ӹΪգ', 'ʾ', 0); @@ -801,6 +817,7 @@ begin ConNo.Text := ''; FactoryNoName.Text := ''; CompanyName.Text := ''; + DeliveryDate.text := ''; LXPerson.Text := ''; LXTel.Text := ''; JHPlace.Text := ''; diff --git a/管理系统/U_ClothContractList.dfm b/管理系统/U_ClothContractList.dfm index 607360e..bc63dba 100644 --- a/管理系统/U_ClothContractList.dfm +++ b/管理系统/U_ClothContractList.dfm @@ -438,15 +438,15 @@ object frmClothContractList: TfrmClothContractList end object v1PRTMF: TcxGridDBColumn Caption = #38376#24133'(cm)' - DataBinding.FieldName = 'MFQty' + DataBinding.FieldName = 'MF' HeaderAlignmentHorz = taCenter Options.Editing = False Styles.Header = DataLink_TradeManage.Default Width = 61 end object v1PRTKZ: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' - DataBinding.FieldName = 'KZQty' + Caption = #31859#20811#37325 + DataBinding.FieldName = 'KZ' HeaderAlignmentHorz = taCenter Options.Editing = False Styles.Header = DataLink_TradeManage.Default diff --git a/管理系统/U_ClothContractList_CG.dfm b/管理系统/U_ClothContractList_CG.dfm index 0866878..286fa54 100644 --- a/管理系统/U_ClothContractList_CG.dfm +++ b/管理系统/U_ClothContractList_CG.dfm @@ -387,7 +387,7 @@ object frmClothContractList_CG: TfrmClothContractList_CG Width = 61 end object v1PRTKZ: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' + Caption = #31859#20811#37325 DataBinding.FieldName = 'KZQty' HeaderAlignmentHorz = taCenter Styles.Header = DataLink_TradeManage.Default diff --git a/管理系统/U_ClothContractList_CK.dfm b/管理系统/U_ClothContractList_CK.dfm index fd03b56..07f9690 100644 --- a/管理系统/U_ClothContractList_CK.dfm +++ b/管理系统/U_ClothContractList_CK.dfm @@ -131,6 +131,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK AutoSize = True Caption = #25171#21360 ImageIndex = 12 + Visible = False OnClick = TBPrintClick end object TBClose: TToolButton @@ -349,11 +350,9 @@ object frmClothContractList_CK: TfrmClothContractList_CK end item Kind = skSum - Column = v1Column16 end item Kind = skSum - Column = v1Column17 end item Kind = skSum @@ -441,15 +440,15 @@ object frmClothContractList_CK: TfrmClothContractList_CK end object v1PRTMF: TcxGridDBColumn Caption = #38376#24133'(cm)' - DataBinding.FieldName = 'MFQty' + DataBinding.FieldName = 'MF' HeaderAlignmentHorz = taCenter Options.Editing = False Styles.Header = DataLink_TradeManage.Default Width = 61 end object v1PRTKZ: TcxGridDBColumn - Caption = #20811#37325'(g/'#13217')' - DataBinding.FieldName = 'KZQty' + Caption = #31859#20811#37325 + DataBinding.FieldName = 'KZ' HeaderAlignmentHorz = taCenter Options.Editing = False Styles.Header = DataLink_TradeManage.Default @@ -515,26 +514,6 @@ object frmClothContractList_CK: TfrmClothContractList_CK Styles.Header = DataLink_TradeManage.Default Width = 101 end - object v1Column16: TcxGridDBColumn - Caption = #24211#23384#21305#25968 - DataBinding.FieldName = 'N_Ps' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclFuchsia - Styles.Footer = cxStyle_fontclFuchsia - Styles.Header = cxStyle_fontclFuchsia - Width = 60 - end - object v1Column17: TcxGridDBColumn - Caption = #24211#23384#25968#37327 - DataBinding.FieldName = 'N_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclFuchsia - Styles.Footer = cxStyle_fontclFuchsia - Styles.Header = cxStyle_fontclFuchsia - Width = 60 - end object v1Column18: TcxGridDBColumn Caption = #21046#21333#20154 DataBinding.FieldName = 'Filler' diff --git a/管理系统/U_ClothContractList_CK.pas b/管理系统/U_ClothContractList_CK.pas index 04a73d0..0841dd1 100644 --- a/管理系统/U_ClothContractList_CK.pas +++ b/管理系统/U_ClothContractList_CK.pas @@ -26,12 +26,12 @@ uses dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter; -type - TfrmClothContractList_CK = class(TForm) - ToolBar1: TToolBar; +type + TfrmClothContractList_CK = class(TForm) + ToolBar1: TToolBar; TBRafresh: TToolButton; TBFind: TToolButton; - TBAdd: TToolButton; + TBAdd: TToolButton; TBEdit: TToolButton; TBDel: TToolButton; TBPrint: TToolButton; @@ -105,8 +105,6 @@ type cxTabControl1: TcxTabControl; tchk: TToolButton; Tnochk: TToolButton; - v1Column16: TcxGridDBColumn; - v1Column17: TcxGridDBColumn; Label7: TLabel; JHPlace: TEdit; v1Column18: TcxGridDBColumn; @@ -192,13 +190,13 @@ begin begin Filtered := False; Close; - sql.Clear; + sql.Clear; sql.Add('exec P_Get_Contract'); sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); sql.Add(',@conType='''' '); sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' '); - ShowMessage(SQL.text); +// ShowMessage(SQL.text); { sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); sql.Add('from Contract_Main A'); sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); diff --git a/管理系统/U_ClothContractList_CK_help.dfm b/管理系统/U_ClothContractList_CK_help.dfm new file mode 100644 index 0000000..e309db3 --- /dev/null +++ b/管理系统/U_ClothContractList_CK_help.dfm @@ -0,0 +1,813 @@ +object frmClothContractList_CK_help: TfrmClothContractList_CK_help + Left = 309 + Top = 284 + Width = 1222 + Height = 738 + Caption = #22383#24067#20986#24211#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + Visible = False + OnClick = TBAddClick + end + object TBEdit: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + Visible = False + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Visible = False + OnClick = TBDelClick + end + object tchk: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #30830#35748#23436#25104 + ImageIndex = 41 + Visible = False + OnClick = tchkClick + end + object Tnochk: TToolButton + Left = 402 + Top = 0 + AutoSize = True + Caption = #25764#38144#23436#25104 + Enabled = False + ImageIndex = 56 + Visible = False + OnClick = TnochkClick + end + object Tth: TToolButton + Left = 489 + Top = 0 + AutoSize = True + Caption = #36864#36135 + ImageIndex = 129 + Visible = False + OnClick = TthClick + end + object ToolButton1: TToolButton + Left = 552 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 615 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 678 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + Visible = False + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 741 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #20219#21153#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #35268#26684 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 26 + Height = 12 + Caption = #20379#26041 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 836 + Top = 22 + Width = 52 + Height = 12 + Caption = #21040#36135#22320#28857 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + OnKeyPress = conPress + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Spec: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 732 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + object JHPlace: TEdit + Tag = 2 + Left = 892 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 6 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 107 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + 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 + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1OrderNo: TcxGridDBColumn + Caption = #20219#21153#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1Column8: TcxGridDBColumn + Caption = #37319#36141#35745#21010#21333#21495 + DataBinding.FieldName = 'fromConNo' + Options.Editing = False + Width = 86 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 58 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #21040#36135#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #20379#26041 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MF' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZ' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'T_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column7: TcxGridDBColumn + Caption = #21040#36135#22320#28857 + DataBinding.FieldName = 'JHPlace' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 101 + end + object v1Column18: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column20: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column19: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column21: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Column1: TcxGridDBColumn + Caption = #25104#21697#21697#21517 + DataBinding.FieldName = 'CP_CodeName' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv1Column2: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 85 + Width = 1206 + Height = 22 + Align = alTop + TabOrder = 3 + Visible = False + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 0 + Properties.Tabs.Strings = ( + #26410#23436#25104 + #24050#23436#25104 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectBottom = 22 + ClientRectRight = 1206 + ClientRectTop = 19 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 1096 + Top = 8 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 1112 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 880 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 920 + Top = 224 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 680 + Top = 32 + end + object cxStyleRepository1: TcxStyleRepository + Left = 305 + Top = 310 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractList_CK_help.pas b/管理系统/U_ClothContractList_CK_help.pas new file mode 100644 index 0000000..1df08d6 --- /dev/null +++ b/管理系统/U_ClothContractList_CK_help.pas @@ -0,0 +1,962 @@ +unit U_ClothContractList_CK_help; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxCurrencyEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, + dxBarBuiltInMenu, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothContractList_CK_help = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Spec: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + v1Column8: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + ToolButton1: TToolButton; + Tth: TToolButton; + cxTabControl1: TcxTabControl; + tchk: TToolButton; + Tnochk: TToolButton; + Label7: TLabel; + JHPlace: TEdit; + v1Column18: TcxGridDBColumn; + v1Column19: TcxGridDBColumn; + v1Column20: TcxGridDBColumn; + v1Column21: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure conPress(Sender: TObject; var Key: Char); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure TthClick(Sender: TObject); + procedure tchkClick(Sender: TObject); + procedure TnochkClick(Sender: TObject); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure cxTabControl1Change(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractList_CK_help: TfrmClothContractList_CK_help; + +implementation + +uses + U_DataLink, U_ClothContractOutPut, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractList_CK_help.FormDestroy(Sender: TObject); +begin + frmClothContractList_CK_help := nil; +end; + +procedure TfrmClothContractList_CK_help.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractList_CK_help.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractList_CK_help.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractList_CK_help.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('exec P_Get_Contract'); + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); + sql.Add(',@conType='''' '); + sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' '); +// ShowMessage(SQL.text); + { sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= '''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''' '); + sql.Add('and A.FillTime< '''+Trim(FormatDateTime('yyyy-MM-dd',endDate.DateTime+1))+''' '); + sql.Add('and A.conType='''' '); + IF cxTabControl1.TabIndex<2 then + sql.Add('and isnull(B.C_status,''0'')='''+inttostr(cxTabControl1.TabIndex)+''' '); } + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + TBFind.Click; + end; +end; + +procedure TfrmClothContractList_CK_help.InitForm(); +begin +// if fDParameters1 = 'ѯ' then +// begin +// TBADD.Visible := false; +// // TBEdit.Visible:=false; +// TBDel.Visible := false; +// // Tchk.Visible:=false; +// // TNochk.Visible:=false; +// Tth.Visible := false; +// v1Price.Visible := false; +// v1Price.Hidden := true; +// v1money.Visible := false; +// v1money.Hidden := true; +//// v1T_money.Visible := false; +//// v1T_money.Hidden := true; +// ToolButton1.Visible := false; +// end; +// +// TBEdit.Enabled := false; +// TBDel.Enabled := false; +// Tchk.Enabled := false; +// TNochk.Enabled := false; +// Tth.Enabled := false; +// if cxTabControl1.TabIndex = 0 then +// begin +//// TBEdit.Enabled := true; +// TBDel.Enabled := true; +// Tchk.Enabled := true; +// Tth.Enabled := true; +// end; +// if cxTabControl1.TabIndex = 1 then +// begin +// TNochk.Enabled := true; +// end; + InitGrid(); +end; + +procedure TfrmClothContractList_CK_help.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_CK_help.TBEditClick(Sender: TObject); +var + i: integer; +begin + if Order_Main.IsEmpty then + Exit; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; +// with ADOQueryTemp do +// begin +// close; +// sql.Clear; +// sql.Add('select * from contract_sub '); +// sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); +//// sql.Add(' '); +// open; +// if not IsEmpty then +// begin +// application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); +// exit; +// end; +// end; + try + frmClothContractOutPut := TfrmClothContractOutPut.Create(Application); + with frmClothContractOutPut do + begin + if trim(fDParameters1) = 'ѯ' then + begin + frmClothContractOutPut.Caption := 'Ϣѯ'; +// v1Money.Visible := false; +// v1Price.Visible := false; +// v1Money.Hidden := true; +// v1Price.Hidden := true; + v1T_money.Visible := false; + v1T_money.Hidden := true; + v1T_price.Visible := false; + v1T_price.Hidden := true; + ScrollBox1.Enabled := false; + for i := 0 to tv1.ColumnCount - 1 do + begin + tv1.Columns[i].Options.Editing := false; + end; +// v1Mrate.Options.Editing := true; + ToolBar2.Enabled := false; + end; + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + // TBRafresh.Click; + end; + end; + finally + frmClothContractOutPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_CK_help.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣɾ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select * from contract_sub '); + sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); + open; + if not IsEmpty then + begin + application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractList_CK_help.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_CK_help.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); +end; + +procedure TfrmClothContractList_CK_help.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\.rmf'), 'ʾ', 0); + end; + +end; + +procedure TfrmClothContractList_CK_help.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractList_CK_help.TBAddClick(Sender: TObject); +var + i: integer; +begin + try + frmClothContractOutPut := TfrmClothContractOutPut.Create(Application); + with frmClothContractOutPut do + begin + if trim(fDParameters1) = 'ѯ' then + begin +// frmClothContractOutPut.Caption := 'Ϣѯ'; +// v1Money.Visible := false; +// v1Price.Visible := false; +// v1Money.Hidden := true; +// v1Price.Hidden := true; + v1T_money.Visible := false; + v1T_money.Hidden := true; + ScrollBox1.Enabled := false; + for i := 0 to tv1.ColumnCount - 2 do + begin + tv1.Columns[i].Options.Editing := false; + end; +// v1Mrate.Options.Editing := true; + ToolBar2.Enabled := false; + end; + PState := 0; + FMainId := ''; + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractOutPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_CK_help.ConNoChange(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_CK_help.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + initForm(); + +end; + +procedure TfrmClothContractList_CK_help.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractList_CK_help.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractList_CK_help.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_CK_help.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractList_CK_help.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractList_CK_help.conPress(Sender: TObject; var Key: Char); +begin + { if Key=#13 then + begin + if Length(Trim(ConNoM.Text))<4 then Exit; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add('exec ClothContract_QryList :MainId,:WSql'); + Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNoM.Text)+'%'+''''; + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; + end; } +end; + +procedure TfrmClothContractList_CK_help.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractOutPut := TfrmClothContractOutPut.Create(Application); + with frmClothContractOutPut do + begin + PState := 3; + TBSave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractOutPut.Free; + end; +end; + +procedure TfrmClothContractList_CK_help.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin +// ToolButton1.Click; + if Order_Main.IsEmpty then exit; + ModalResult:=1; +end; + +procedure TfrmClothContractList_CK_help.TthClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractOutPut := TfrmClothContractOutPut.Create(Application); + with frmClothContractOutPut do + begin + Caption := '˻'; + PState := 1; + v1T_money.Visible := true; + v1T_ps.Visible := true; + v1T_Qty.Visible := true; + v1T_Price.Visible := true; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractOutPut.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_CK_help.tchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + { try + frmClothContractInPut := TfrmClothContractInPut.Create(Application); + with frmClothContractInPut do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + with self.ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(self.Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(self.Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + self.InitGrid(); + end + else + begin + end; + end; + finally + frmClothContractInPut.Free; + // TBRafresh.Click; + end; } + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_CK_help.TnochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + {with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; } + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_CK_help.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin +// FBounds := AViewInfo.Bounds; +// if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then +// begin +// ACanvas.FillRect(FBounds); +// ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); +// FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); +// InflateRect(FBounds, -1, -1); +// ACanvas.Font.Color := clBlack; +// ACanvas.Brush.Style := bsClear; +// ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); +// ADone := True; +// end; +end; + +procedure TfrmClothContractList_CK_help.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +// if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('H_PS').Index] >= AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Qty1').Index] then +// begin +// ACanvas.Brush.Color := clSkyBlue; +// end; +end; + +procedure TfrmClothContractList_CK_help.cxTabControl1Change(Sender: TObject); +begin + initForm(); +end; + +end. + diff --git a/管理系统/U_ClothContractList_DY.dfm b/管理系统/U_ClothContractList_DY.dfm index 2fb4d6b..124e684 100644 --- a/管理系统/U_ClothContractList_DY.dfm +++ b/管理系统/U_ClothContractList_DY.dfm @@ -68,6 +68,7 @@ object frmClothContractList_DY: TfrmClothContractList_DY AutoSize = True Caption = #21152#24613 ImageIndex = 60 + Visible = False OnClick = TJjClick end object TnoJj: TToolButton @@ -76,6 +77,7 @@ object frmClothContractList_DY: TfrmClothContractList_DY AutoSize = True Caption = #25764#38144#21152#24613 ImageIndex = 99 + Visible = False OnClick = TnoJjClick end object ToolButton2: TToolButton @@ -577,6 +579,12 @@ object frmClothContractList_DY: TfrmClothContractList_DY HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column4: TcxGridDBColumn + Caption = #23436#25104#22825#25968 + DataBinding.FieldName = 'WCTS' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractList_DY.pas b/管理系统/U_ClothContractList_DY.pas index a59f41c..66b989e 100644 --- a/管理系统/U_ClothContractList_DY.pas +++ b/管理系统/U_ClothContractList_DY.pas @@ -117,6 +117,7 @@ type Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -199,10 +200,10 @@ begin strwhere := strwhere + ' and A.Filler=''''' + Trim(DName) + ''''' '; try ADOQueryMain.DisableControls; - with ADOQueryMain do + with ADOQueryMain do begin - Filtered := False; - Close; + Filtered := False; + Close; sql.Clear; sql.Add('exec P_Get_Contract'); sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); diff --git a/管理系统/U_ClothContractList_TP.dfm b/管理系统/U_ClothContractList_TP.dfm index 981c6b0..98ca920 100644 --- a/管理系统/U_ClothContractList_TP.dfm +++ b/管理系统/U_ClothContractList_TP.dfm @@ -571,6 +571,36 @@ object frmClothContractList_Tp: TfrmClothContractList_Tp HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column3: TcxGridDBColumn + Caption = #21344#29992#26102#38388 + DataBinding.FieldName = 'ZYtime' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column4: TcxGridDBColumn + Caption = #21344#29992#20154 + DataBinding.FieldName = 'ZYer' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column5: TcxGridDBColumn + Caption = #21344#29992#32568#25968 + DataBinding.FieldName = 'ZYgs' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column6: TcxGridDBColumn + Caption = #21344#29992#21305#25968 + DataBinding.FieldName = 'ZYps' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column7: TcxGridDBColumn + Caption = #21344#29992#25968#37327 + DataBinding.FieldName = 'ZYQty' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractList_TP.pas b/管理系统/U_ClothContractList_TP.pas index 912f32c..453e006 100644 --- a/管理系统/U_ClothContractList_TP.pas +++ b/管理系统/U_ClothContractList_TP.pas @@ -116,6 +116,11 @@ type TnoJj: TToolButton; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + Tv1Column7: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -199,7 +204,7 @@ begin try ADOQueryMain.DisableControls; with ADOQueryMain do - begin + begin Filtered := False; Close; sql.Clear; @@ -446,7 +451,7 @@ begin SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); SCreateCDS20(ADOQueryMain, Order_Main); - SInitCDSData20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); end; procedure TfrmClothContractList_Tp.FormShow(Sender: TObject); diff --git a/管理系统/U_ClothContractList_TPXZ.dfm b/管理系统/U_ClothContractList_TPXZ.dfm new file mode 100644 index 0000000..9ef4e6b --- /dev/null +++ b/管理系统/U_ClothContractList_TPXZ.dfm @@ -0,0 +1,863 @@ +object frmClothContractList_TpXZ: TfrmClothContractList_TpXZ + Left = 314 + Top = 348 + Width = 1222 + Height = 663 + Caption = #22383#24067#28857#33394#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object ToolButton4: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #36873#25321 + ImageIndex = 41 + OnClick = ToolButton4Click + end + object TBAdd: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + Visible = False + OnClick = TBAddClick + end + object TJj: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #21152#24613 + ImageIndex = 60 + Visible = False + OnClick = TJjClick + end + object TnoJj: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #25764#38144#21152#24613 + ImageIndex = 99 + Visible = False + OnClick = TnoJjClick + end + object ToolButton2: TToolButton + Left = 402 + Top = 0 + Caption = #22238#20462#26032#22686 + ImageIndex = 57 + Visible = False + OnClick = ToolButton2Click + end + object TBEdit: TToolButton + Left = 485 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + Visible = False + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 548 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Visible = False + OnClick = TBDelClick + end + object Tchk: TToolButton + Left = 611 + Top = 0 + AutoSize = True + Caption = #30830#35748#23436#25104 + ImageIndex = 41 + Visible = False + OnClick = TchkClick + end + object TNochk: TToolButton + Left = 698 + Top = 0 + AutoSize = True + Caption = #25764#38144#23436#25104 + ImageIndex = 48 + Visible = False + OnClick = TNochkClick + end + object ToolButton1: TToolButton + Left = 785 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + Visible = False + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 848 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + Visible = False + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 911 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + Visible = False + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 974 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #25237#22383#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #39068#33394 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 39 + Height = 12 + Caption = #21152#24037#21378 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Color: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 748 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 107 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = Tv1Column3 + end + item + Kind = skSum + Column = Tv1Column4 + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1Ssel: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'Ssel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 50 + end + object v1OrderNo: TcxGridDBColumn + Caption = #25237#22383#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #25237#22383#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 73 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1C_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MF' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZ' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty2: TcxGridDBColumn + Caption = #32568#21495 + DataBinding.FieldName = 'BCgangno' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'T_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object Tv1Column3: TcxGridDBColumn + Caption = #24050#21344#29992#21305#25968 + DataBinding.FieldName = 'Yzyps' + HeaderAlignmentHorz = taCenter + Styles.Content = cxStyle_fontclFuchsia + Styles.Footer = cxStyle_fontclFuchsia + Styles.Header = cxStyle_fontclFuchsia + Width = 90 + end + object Tv1Column4: TcxGridDBColumn + Caption = #24050#21344#26377#25968#37327 + DataBinding.FieldName = 'Yzysl' + HeaderAlignmentHorz = taCenter + Styles.Content = cxStyle_fontclFuchsia + Styles.Footer = cxStyle_fontclFuchsia + Styles.Header = cxStyle_fontclFuchsia + Width = 90 + end + object v1C_Unit: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column10: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column11: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column12: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column13: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column1: TcxGridDBColumn + DataBinding.FieldName = 'IsZt' + Visible = False + end + object Tv1Column1: TcxGridDBColumn + Caption = #21152#24613 + DataBinding.FieldName = 'Jiaji' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column2: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 85 + Width = 1206 + Height = 22 + Align = alTop + TabOrder = 3 + Visible = False + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 2 + Properties.Tabs.Strings = ( + #26410#23436#25104 + #24050#23436#25104 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectBottom = 22 + ClientRectRight = 1206 + ClientRectTop = 19 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 992 + Top = 64 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 624 + Top = 248 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 944 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 888 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 924 + Top = 212 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 804 + Top = 44 + end + object cxStyleRepository1: TcxStyleRepository + Left = 69 + Top = 130 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractList_TPXZ.pas b/管理系统/U_ClothContractList_TPXZ.pas new file mode 100644 index 0000000..3937c8a --- /dev/null +++ b/管理系统/U_ClothContractList_TPXZ.pas @@ -0,0 +1,919 @@ +unit U_ClothContractList_TPXZ; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, + dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, + dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, + dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, + dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, + dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, + dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, + dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, + dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, + dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, + dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, + dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, + dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, + dxSkinXmas2008Blue, dxSkinscxPCPainter; + +type + TfrmClothContractList_TpXZ = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Color: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + cxTabControl1: TcxTabControl; + v1C_Unit: TcxGridDBColumn; + Tchk: TToolButton; + TNochk: TToolButton; + ToolButton1: TToolButton; + v1Qty2: TcxGridDBColumn; + v1C_Color: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + v1Ssel: TcxGridDBColumn; + v1Column10: TcxGridDBColumn; + v1Column11: TcxGridDBColumn; + v1Column12: TcxGridDBColumn; + v1Column13: TcxGridDBColumn; + v1Column1: TcxGridDBColumn; + ToolButton2: TToolButton; + TJj: TToolButton; + TnoJj: TToolButton; + Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + ToolButton4: TToolButton; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure cxTabControl1Change(Sender: TObject); + procedure TchkClick(Sender: TObject); + procedure TNochkClick(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure ToolButton2Click(Sender: TObject); + procedure TJjClick(Sender: TObject); + procedure TnoJjClick(Sender: TObject); + procedure ToolButton4Click(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractList_TpXZ: TfrmClothContractList_TpXZ; + +implementation + +uses + U_DataLink, U_ClothContractInPut_TP, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractList_TpXZ.FormDestroy(Sender: TObject); +begin + frmClothContractList_TpXZ := nil; +end; + +procedure TfrmClothContractList_TpXZ.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractList_TpXZ.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractList_TpXZ.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractList_TpXZ.InitGrid(); +var + strwhere: string; +begin + strwhere := ''; + if cxTabControl1.TabIndex < 2 then +// strwhere := strwhere + ' and isnull(A.status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + strwhere := strwhere + ' and isnull(B.C_status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + if (trim(fDParameters1) = 'ѯ') then + strwhere := strwhere + ' and A.Filler=''''' + Trim(DName) + ''''' '; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add(' select * '); + sql.Add(',Yzyps=(select sum(ZYPS) from contract_sub X where X.fromsubid=B.subid and X.ZYGangNo=B.BCgangno) '); + sql.Add(',Yzysl=(select sum(ZYQty) from contract_sub X where X.fromsubid=B.subid and X.ZYGangNo=B.BCgangno) '); + sql.Add(' from Contract_Main A'); + + sql.Add(' inner join Contract_Sub B on A.mainid=B.mainid'); + sql.Add(' where conType=''Ͷ'''); +// sql.Add(' where conType=''ԤͶ'''); +// sql.Add('exec P_Get_Contract_TG'); +// sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); +// sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); +//// sql.Add(',@conType= '''+TconType+''' '); +// sql.Add(',@status=''' + strwhere + ''' '); +// ShowMessage(sql.text); + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + end; +end; + +procedure TfrmClothContractList_TpXZ.InitForm(); +begin +// if fDParameters1 = 'ѯ' then +// begin +// TBADD.Visible := false; +// TBEdit.Visible := false; +// TBDel.Visible := false; +// Tchk.Visible := false; +// TNochk.Visible := false; +// // Tth.Visible:=false; +// //ToolButton1.Visible:=false; +// end; + + TBEdit.Enabled := false; + TBDel.Enabled := false; + Tchk.Enabled := false; + TNochk.Enabled := false; + if cxTabControl1.TabIndex = 0 then + begin + TBEdit.Enabled := true; + TBDel.Enabled := true; + Tchk.Enabled := true; + end; + if cxTabControl1.TabIndex = 1 then + begin + TNochk.Enabled := true; + end; +end; + +procedure TfrmClothContractList_TpXZ.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_TpXZ.TBEditClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + FConType := Trim(Self.Order_Main.fieldbyname('ConType').AsString); + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_TpXZ.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from JYOrder_Sub_AnPai '); + sql.Add('where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('ѻز֣ɾͶƻ', 'ʾ', 0); + Exit; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractList_TpXZ.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ɫƻб', cxGrid1); +end; + +procedure TfrmClothContractList_TpXZ.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'), 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractList_TpXZ.TBAddClick(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'ԤͶ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_TpXZ.ConNoChange(Sender: TObject); +var + str1: string; +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_TpXZ.FormShow(Sender: TObject); +begin + InitForm(); + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp); + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + InitGrid(); +end; + +procedure TfrmClothContractList_TpXZ.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractList_TpXZ.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractList_TpXZ.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractList_TpXZ.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractList_TpXZ.cxTabControl1Change(Sender: TObject); +begin + initForm(); + InitGrid(); +end; + +procedure TfrmClothContractList_TpXZ.TchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.TNochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractList_TpXZ.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + tbsave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractInPut_Tp.Free; + end; +end; + +procedure TfrmClothContractList_TpXZ.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +{ IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('N_Qty').Index]=0 then + begin + ACanvas.Brush.Color:=clSkyBlue; + end; } + if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Jiaji').Index] = 'Ӽ' then + begin + ACanvas.Brush.Color := Clred; + end; + +end; + +procedure TfrmClothContractList_TpXZ.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin + FBounds := AViewInfo.Bounds; + if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then + begin + ACanvas.FillRect(FBounds); + ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); + FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); + InflateRect(FBounds, -1, -1); + ACanvas.Font.Color := clBlack; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); + ADone := True; + end; +end; + +procedure TfrmClothContractList_TpXZ.ToolButton2Click(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'ɫƻ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_TpXZ.TJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji=''Ӽ'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.TnoJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji='''' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_TpXZ.ToolButton4Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + ModalResult := 1; +end; + +end. + diff --git a/管理系统/U_ClothContractList_help.pas b/管理系统/U_ClothContractList_help.pas index b1e6e42..e375131 100644 --- a/管理系统/U_ClothContractList_help.pas +++ b/管理系统/U_ClothContractList_help.pas @@ -176,8 +176,9 @@ begin end; // sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); // sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); - sql.Add(',@conType='''' '); - sql.Add(',@status=''' + inttostr(0) + ''' '); + sql.Add(',@conType='''' '); + sql.Add(',@status=''' + inttostr(2) + ''' '); +// showmessage(sql.Text); Open; end; SCreateCDS20(ADOQueryMain, Order_Main); @@ -278,7 +279,7 @@ end; procedure TfrmClothContractList_Help.TBRafreshClick(Sender: TObject); begin - InitGrid(); + InitGrid(); end; procedure TfrmClothContractList_Help.ConNoChange(Sender: TObject); diff --git a/管理系统/U_ClothTPHWZYInput.dfm b/管理系统/U_ClothTPHWZYInput.dfm new file mode 100644 index 0000000..1451d7c --- /dev/null +++ b/管理系统/U_ClothTPHWZYInput.dfm @@ -0,0 +1,696 @@ +object frmClothTPHWZYInput: TfrmClothTPHWZYInput + Left = 404 + Top = 253 + Width = 1046 + Height = 541 + Caption = #36135#29289#21344#29992#24405#20837 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1030 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBSave: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #20445#23384 + ImageIndex = 14 + OnClick = TBSaveClick + end + object TBClose: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 29 + Width = 1030 + Height = 52 + Align = alTop + BevelInner = bvNone + BevelOuter = bvNone + Ctl3D = False + ParentCtl3D = False + TabOrder = 1 + object Label1: TLabel + Left = -20 + Top = 30 + Width = 91 + Height = 12 + Caption = #28857#33394#35745#21010#21333#21495#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label4: TLabel + Left = 130 + Top = 14 + Width = 65 + Height = 12 + Caption = #21344#29992#26085#26399#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 290 + Top = 54 + Width = 67 + Height = 12 + Caption = #20379' '#26041#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label2: TLabel + Left = 28 + Top = 166 + Width = 65 + Height = 12 + Caption = #31614#35746#26085#26399#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label3: TLabel + Left = 20 + Top = 54 + Width = 67 + Height = 12 + Caption = #38656' '#26041#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label6: TLabel + Left = 231 + Top = 270 + Width = 65 + Height = 12 + Caption = #31614#35746#22320#28857#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label7: TLabel + Left = 380 + Top = 14 + Width = 52 + Height = 12 + Caption = #21344#29992#20154#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label8: TLabel + Left = 290 + Top = 78 + Width = 65 + Height = 12 + Caption = #21040#36135#22320#28857#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label9: TLabel + Left = 20 + Top = 78 + Width = 65 + Height = 12 + Caption = #32852#31995#26041#24335#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label10: TLabel + Left = 778 + Top = 14 + Width = 91 + Height = 12 + Caption = #37319#36141#35745#21010#21333#21495#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object ConNo: TEdit + Left = 70 + Top = 27 + Width = 137 + Height = 18 + TabOrder = 0 + Visible = False + end + object ZYtime: TDateTimePicker + Tag = 22 + Left = 193 + Top = 10 + Width = 134 + Height = 20 + BevelInner = bvNone + Date = 40916.000000000000000000 + Format = 'yyyy-MM-dd' + Time = 40916.000000000000000000 + TabOrder = 1 + end + object FactoryNoName: TcxButtonEdit + Left = 353 + Top = 50 + Hint = 'FactoryNo' + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.ReadOnly = True + Properties.OnButtonClick = FactoryNoNamePropertiesButtonClick + Properties.OnChange = FactoryNoNamePropertiesChange + Style.BorderStyle = ebsSingle + TabOrder = 2 + Visible = False + Width = 134 + end + object PanZDY: TPanel + Left = 861 + Top = 128 + Width = 202 + Height = 153 + TabOrder = 3 + Visible = False + object CXGridZDY: TcxGrid + Left = 3 + Top = 4 + Width = 197 + Height = 113 + TabOrder = 0 + object TVZDY: TcxGridDBTableView + OnKeyPress = TVZDYKeyPress + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = TVZDYCellDblClick + DataController.DataSource = DataSource2 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsSelection.CellSelect = False + OptionsView.GroupByBox = False + object VHelpZDYName: TcxGridDBColumn + DataBinding.FieldName = 'ZDYName' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.handBlack + Width = 163 + IsCaptionAssigned = True + end + end + object CXGridZDYLevel1: TcxGridLevel + GridView = TVZDY + end + end + object Button1: TButton + Left = 64 + Top = 120 + Width = 65 + Height = 25 + Caption = #20851#38381 + TabOrder = 1 + OnClick = Button1Click + end + end + object QDTime: TDateTimePicker + Left = 90 + Top = 162 + Width = 140 + Height = 20 + BevelInner = bvNone + Date = 40916.670856296290000000 + Format = 'yyyy-MM-dd' + Time = 40916.670856296290000000 + ShowCheckbox = True + TabOrder = 4 + Visible = False + end + object CompanyName: TcxButtonEdit + Left = 85 + Top = 50 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = CompanyNamePropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 5 + Visible = False + Width = 136 + end + object QDPalce: TEdit + Left = 311 + Top = 271 + Width = 131 + Height = 18 + TabOrder = 6 + Visible = False + end + object ZYer: TEdit + Tag = 22 + Left = 433 + Top = 11 + Width = 134 + Height = 18 + TabOrder = 7 + end + object LXTel: TEdit + Left = 85 + Top = 75 + Width = 136 + Height = 18 + TabOrder = 8 + Visible = False + end + object JHPlace: TcxButtonEdit + Left = 353 + Top = 74 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = JHPlacePropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 9 + Visible = False + Width = 392 + end + object fromConNo: TcxButtonEdit + Left = 865 + Top = 10 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = fromConNoPropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 10 + Visible = False + OnKeyPress = fromConNoKeyPress + Width = 116 + end + end + object ToolBar2: TToolBar + Left = 0 + Top = 81 + Width = 1030 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentFont = False + ShowCaptions = True + TabOrder = 2 + object ToolButton1: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 103 + OnClick = ToolButton1Click + end + object ToolButton2: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 107 + OnClick = ToolButton2Click + end + object Panel1: TPanel + Left = 126 + Top = 0 + Width = 467 + Height = 30 + BevelOuter = bvNone + TabOrder = 0 + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 110 + Width = 1030 + Height = 219 + Align = alTop + TabOrder = 3 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnCellClick = Tv1CellClick + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1Column1 + end> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsView.GroupByBox = False + Styles.Header = DataLink_TradeManage.Default + object v1Column1: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column1PropertiesButtonClick + Properties.OnEditValueChanged = v1Column1PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 100 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684#22411#21495 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + Width = 103 + end + object v1PRTColor: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + VisibleForCustomization = False + Width = 78 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MFQty' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Styles.Header = DataLink_TradeManage.handBlack + VisibleForCustomization = False + Width = 80 + end + object Tv1Column5: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_ColorNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column6: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column5: TcxGridDBColumn + Caption = #25237#22383#21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Styles.Header = cxStyle2 + Width = 89 + end + object Tv1Column2: TcxGridDBColumn + Caption = #35745#21010#32568#25968 + DataBinding.FieldName = 'Qty2' + Styles.Header = cxStyle2 + Width = 60 + end + object v1ClothUnit: TcxGridDBColumn + Caption = #35745#21010#25968#37327 + DataBinding.FieldName = 'C_Qty' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1ClothUnitPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Styles.Header = cxStyle2 + Width = 69 + end + object v1Column2: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'C_Unit' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsFixedList + Properties.Items.Strings = ( + 'M' + 'Kg') + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 64 + end + object v1Column3: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + Visible = False + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 46 + end + object v1T_Ps: TcxGridDBColumn + Caption = #36864#36135#21305#25968 + DataBinding.FieldName = 'T_Ps' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1T_Qty: TcxGridDBColumn + Caption = #36864#36135#25968#37327 + DataBinding.FieldName = 'T_Qty' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1Column6PropertiesEditValueChanged + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1T_Price: TcxGridDBColumn + Caption = #36864#36135#21333#20215 + DataBinding.FieldName = 'T_Price' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1Column6PropertiesEditValueChanged + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1T_money: TcxGridDBColumn + Caption = #36864#36135#37329#39069 + DataBinding.FieldName = 'T_money' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Focusing = False + Width = 60 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + Visible = False + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 177 + end + object Tv1Column1: TcxGridDBColumn + Caption = #21344#29992#25968#37327 + DataBinding.FieldName = 'ZYQty' + HeaderAlignmentHorz = taCenter + Styles.Header = cxStyle3 + Width = 60 + end + object Tv1Column3: TcxGridDBColumn + Caption = #21344#29992#32568#21495 + DataBinding.FieldName = 'ZYGangNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = cxStyle3 + Width = 60 + end + object Tv1Column4: TcxGridDBColumn + Caption = #21344#29992#21305#25968 + DataBinding.FieldName = 'ZYPS' + HeaderAlignmentHorz = taCenter + Styles.Header = cxStyle3 + Width = 60 + end + object Tv1Column9: TcxGridDBColumn + Caption = #25237#22383#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object ADOTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 816 + Top = 85 + end + object ADOCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 800 + Top = 109 + end + object DataSource1: TDataSource + DataSet = Order_Sub + Left = 356 + Top = 192 + end + object Order_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 424 + Top = 192 + end + object DataSource2: TDataSource + DataSet = ADOZDY + Left = 240 + Top = 8 + end + object ADOZDY: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 280 + Top = 5 + end + object CDS_ZDY: TClientDataSet + Aggregates = <> + Params = <> + Left = 208 + Top = 16 + end + object ADOQueryTmp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 792 + Top = 125 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 528 + Top = 200 + end + object cxStyleRepository1: TcxStyleRepository + PixelsPerInch = 96 + object cxStyle1: TcxStyle + end + object cxStyle2: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle3: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + end +end diff --git a/管理系统/U_ClothTPHWZYInput.pas b/管理系统/U_ClothTPHWZYInput.pas new file mode 100644 index 0000000..2842237 --- /dev/null +++ b/管理系统/U_ClothTPHWZYInput.pas @@ -0,0 +1,1066 @@ +unit U_ClothTPHWZYInput; + +interface + +uses + Windows, Messages, strUtils, SysUtils, cxTextEdit, 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, cxMaskEdit, cxButtonEdit, + StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxDropDownEdit, + cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters, + cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothTPHWZYInput = class(TForm) + ToolBar1: TToolBar; + TBSave: TToolButton; + TBClose: TToolButton; + ScrollBox1: TScrollBox; + Label1: TLabel; + ConNo: TEdit; + Label4: TLabel; + ZYtime: TDateTimePicker; + Label5: TLabel; + ToolBar2: TToolBar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1PRTSpec: TcxGridDBColumn; + v1PRTColor: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + v1PRTKZ: TcxGridDBColumn; + v1ClothUnit: TcxGridDBColumn; + ADOTemp: TADOQuery; + ADOCmd: TADOQuery; + DataSource1: TDataSource; + Order_Sub: TClientDataSet; + DataSource2: TDataSource; + ADOZDY: TADOQuery; + CDS_ZDY: TClientDataSet; + FactoryNoName: TcxButtonEdit; + ADOQueryTmp: TADOQuery; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + PanZDY: TPanel; + CXGridZDY: TcxGrid; + TVZDY: TcxGridDBTableView; + VHelpZDYName: TcxGridDBColumn; + CXGridZDYLevel1: TcxGridLevel; + Button1: TButton; + v1Column4: TcxGridDBColumn; + Label2: TLabel; + QDTime: TDateTimePicker; + Label3: TLabel; + CompanyName: TcxButtonEdit; + Label6: TLabel; + QDPalce: TEdit; + v1Column5: TcxGridDBColumn; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + ZYer: TEdit; + LXTel: TEdit; + JHPlace: TcxButtonEdit; + Label10: TLabel; + fromConNo: TcxButtonEdit; + v1T_Qty: TcxGridDBColumn; + v1T_money: TcxGridDBColumn; + v1T_Ps: TcxGridDBColumn; + cxGridPopupMenu1: TcxGridPopupMenu; + v1T_Price: TcxGridDBColumn; + Panel1: TPanel; + Tv1Column2: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle3: TcxStyle; + Tv1Column5: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + Tv1Column9: TcxGridDBColumn; + procedure TBCloseClick(Sender: TObject); + procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure Button1Click(Sender: TObject); + procedure TVZDYKeyPress(Sender: TObject; var Key: Char); + procedure FormShow(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton1Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure FactoryNoNamePropertiesChange(Sender: TObject); + procedure CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesEditValueChanged(Sender: TObject); + procedure fromConNoKeyPress(Sender: TObject; var Key: Char); + procedure v1ClothUnitPropertiesEditValueChanged(Sender: TObject); + procedure fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column6PropertiesEditValueChanged(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + private + FXS: Integer; + procedure InitData(); + procedure ZDYHelp(FButn: TcxButtonEdit; LType: string); + function SaveData(): Boolean; + procedure DoQuery(fkeyNo: string); + procedure DoKc(); + { Private declarations } + public + PState: Integer; + FMainId: string; + + { Public declarations } + end; + +var + frmClothTPHWZYInput: TfrmClothTPHWZYInput; + +implementation + +uses + U_DataLink, U_ZDYHelp, U_Fun, U_ZdyAttachGYS, U_ClothContractList_CG_help, + U_ClothContractList_TPXZ, U_ZdyAttachCP; + +{$R *.dfm} +procedure TfrmClothTPHWZYInput.DoKc(); +begin + + if Order_Sub.IsEmpty then + exit; + if trim(Order_Sub.fieldbyname('C_CodeName').AsString) = '' then + exit; + + with ADOTemp do + begin + close; + sql.Clear; + SQL.Add(' SELECT Top 1 Price FROM YF_Money_CR A'); + sql.Add(' where P_CodeName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); + sql.Add(' and factoryName=' + quotedstr(trim(FactoryNoName.Text))); + sql.Add(' and CRType=''ӦǼ'' '); + sql.Add(' and price>0 '); + sql.Add(' order by FillTime desc'); + open; + end; + +end; + +procedure TfrmClothTPHWZYInput.DoQuery(fkeyNo: string); +begin + if trim(fkeyNo) = '' then + exit; + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select A.* from Contract_Main A '); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.conNo=' + quotedstr(trim(fkeyNo))); + sql.Add('and Isnull(B.C_status,''0'')=''0'' '); + open; + if not IsEmpty then + begin +// FactoryNoName.Text := fieldbyname('FactoryNoName').AsString; +// LXPerson.Text := fieldbyname('LXPerson').AsString; +// LXPerson.Text := fieldbyname('LXPerson').AsString; +// LXTel.Text := fieldbyname('LXPerson').AsString; +// fromConNo.Hint := fieldbyname('mainID').AsString; +// JHPlace.Text := fieldbyname('QDPalce').AsString; + end + else + begin + application.MessageBox('˲ɹƻŴ', 'ʾϢ', 0); + exit; + end; + end; + + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.conNo=' + quotedstr(trim(fkeyNo))); + sql.Add('and Isnull(B.C_status,''0'')=''0'' '); + open; + if not IsEmpty then + begin + SCreateCDS20(ADOTemp, Order_Sub); + SInitCDSData20(ADOTemp, Order_Sub); + end + else + begin + end; + end; + with Order_Sub do + begin + DisableControls; + First; + while not eof do + begin + edit; + fieldbyname('fromMainID').Value := fieldbyname('MainID').AsString; + fieldbyname('fromsubID').Value := fieldbyname('subID').AsString; + fieldbyname('MainID').Value := ''; + fieldbyname('subID').Value := ''; + post; + next; + end; + First; + EnableControls; + end; + +end; + +procedure TfrmClothTPHWZYInput.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmClothTPHWZYInput.InitData(); +begin + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.mainID= ''' + Trim(fMainID) + ''' '); +// sql.Add('and A.conType=''Ͷ'' '); + Open; + end; + + SCreateCDS20(ADOQueryTmp, Order_Sub); + SInitCDSData20(ADOQueryTmp, Order_Sub); + SCSHData(ADOQueryTmp, ScrollBox1, 0); + ZYer.Text := trim(ADOQueryTmp.fieldbyname('ZYer').AsString); + if not ADOQueryTmp.IsEmpty then + begin + fromConNo.Hint := trim(ADOQueryTmp.fieldbyname('fromMainID').AsString); + fromConNo.Text := trim(ADOQueryTmp.fieldbyname('fromConNo').AsString); + end; + if PState = 0 then + begin + with ADOTemp do + begin + Close; + SQL.Clear; + sql.Add('select Top 1* from Contract_Main order by FillTime desc '); + Open; + end; + QDTime.DateTime := SGetServerDate(ADOTemp); + ZYtime.DateTime := SGetServerDate(ADOTemp); + QDTime.Checked := True; +// DeliveryDate.Checked := False; + ZYer.Text := Trim(DCode); + // ConNo.Text:='Զ'; + //CompanyName.Text:='¡֯'; + end; + PanZDY.Visible := False; +end; + +procedure TfrmClothTPHWZYInput.ZDYHelp(FButn: TcxButtonEdit; LType: string); +var + FType, ZDYName, FText: string; +begin + PanZDY.Visible := True; + PanZDY.Left := FButn.Left; + PanZDY.Top := FButn.Top + FButn.Height; + with ADOZDY do + begin + Filtered := False; + Close; + SQL.Clear; + SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type=''' + Trim(LType) + ''''); + Open; + end; + FText := Trim(FButn.Text); + if FText <> '' then + SDofilter(ADOZDY, ' ZDYName like ' + QuotedStr('%' + Trim(FText) + '%')) + else + SDofilter(ADOZDY, ''); + VHelpZDYName.Summary.GroupFormat := Trim(FButn.Name); +end; + +procedure TfrmClothTPHWZYInput.TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +var + FName: string; +begin + if ADOZDY.IsEmpty then + Exit; + FName := Trim(VHelpZDYName.Summary.GroupFormat); + TcxButtonEdit(FindComponent(FName)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(FName)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; +end; + +procedure TfrmClothTPHWZYInput.Button1Click(Sender: TObject); +begin + PanZDY.Visible := False; +end; + +procedure TfrmClothTPHWZYInput.TVZDYKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + if ADOZDY.IsEmpty then + Exit; + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; + ADOZDY.Active := False; + end; +end; + +procedure TfrmClothTPHWZYInput.FormShow(Sender: TObject); +begin + {if Trim(DParameters1)='1' then + begin + v1Price.Visible:=False; + // v1ClothQty.Visible:=False; + // v1PRTQty.Visible:=False; + end else + begin + v1Price.Visible:=True; + v1ClothQty.Visible:=True; + v1PRTQty.Visible:=True; + end;} + readCXgrid(self.Caption, tv1); + InitData(); +end; + +function TfrmClothTPHWZYInput.SaveData(): Boolean; +var + maxno: string; +begin + try + ADOCmd.Connection.BeginTrans; + /// + with ADOCmd do + begin + Close; + sql.Clear; + SQL.Add('select * from Contract_Main where MainId=''' + Trim(fMainID) + ''''); + Open; + end; + with ADOCmd do + begin + + if Trim(fMainID) = '' then + begin + Append; + if GetLSNo(ADOTemp, maxno, 'ZY', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + end + else + begin + maxno := Trim(fMainID); + Edit; + end; + + FieldByName('MainId').Value := Trim(maxno); + SSetsaveSql(ADOCmd, 'Contract_Main', ScrollBox1, 22); + + if Trim(fMainID) = '' then + begin + FieldByName('Filler').Value := Trim(DName); + FieldByName('Filltime').Value := SGetServerDateTime(ADOTemp); + end + else + begin + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp); + end; + FieldByName('ConType').Value := 'ռ'; + FieldByName('status').Value := '0'; + FieldByName('ConNo').Value := Trim(ConNo.Text); + FieldByName('fromconNo').Value := Trim(fromConNo.Text); + FieldByName('fromMainID').Value := Trim(fromConNo.Hint); + Post; + end; + fMainID := Trim(maxno); + ///ӱ + with Order_Sub do + begin + First; + while not Eof do + begin + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then + begin + if GetLSNo(ADOTemp, maxno, 'CS', 'Contract_Sub', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(Order_Sub.fieldbyname('SubId').AsString); + end; + with ADOCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(fMainID) + ''''); + sql.Add(' and SubId=''' + Trim(maxno) + ''''); +// showmessage(sql.Text); + Open; + end; + with ADOCmd do + begin + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then + Append + else + Edit; + FieldByName('MainId').Value := Trim(fMainID); + FieldByName('SubId').Value := Trim(maxno); + FieldByName('ConNo').Value := Trim(ConNo.Text); + RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'Contract_Sub', 0); + FieldByName('fromMainID').Value := Trim(Order_Sub.fieldbyname('fromMainID').AsString); + FieldByName('fromsubID').Value := Trim(Order_Sub.fieldbyname('fromsubID').AsString); + + FieldByName('C_Status').Value := '0'; + FieldByName('Price').Value := 0; + FieldByName('Qty3').Value := 0; + FieldByName('Qty2').Value := 0; + FieldByName('Qty1').Value := 0; + FieldByName('C_Qty').Value := 0; + FieldByName('T_Price').Value := 0; + FieldByName('H_PS').Value := 0; + FieldByName('H_Qty').Value := 0; + FieldByName('T_money').Value := 0; + FieldByName('T_Qty').Value := 0; + FieldByName('T_Ps').Value := 0; + FieldByName('money').Value := 0; + FieldByName('Price').Value := 0; + + Post; + end; + Order_Sub.Edit; + Order_Sub.FieldByName('SubId').Value := Trim(maxno); + + + //Order_Sub.Post; + Next; + end; + end; + ADOCmd.Connection.CommitTrans; + Result := True; + except + Result := False; + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ʧܣ', 'ʾ', 0); + end; +end; +//function TfrmClothTPHWZYInput.SaveData(): Boolean; +//var +// maxno: string; +// FZYGS, FZYPS, FZYQty: Double; +//begin +// try +// ADOCmd.Connection.BeginTrans; +// /// +// with ADOCmd do +// begin +// Close; +// sql.Clear; +// SQL.Add('select * from Contract_Main where MainId=''' + Trim(fMainID) + ''''); +// Open; +// end; +// if Trim(fMainID) <> '' then +// begin +// with ADOCmd do +// begin +// Close; +// sql.Clear; +// SQL.Add('update Contract_Main set ZYtime= getdate() ,ZYer=''' + trim(ZYer.text) + ''' where MainId=''' + Trim(fMainID) + ''''); +//// ShowMessage(SQL.text); +// ExecSQL; +// end; +// end; +// ///ӱ +// with Order_Sub do +// begin +// First; +// while not Eof do +// begin +// +// if Trim(Order_Sub.fieldbyname('SubId').AsString) <> '' then +// begin +//// FZYGS := Order_Sub.fieldbyname('ZYGS').AsFloat; +//// FZYPS := Order_Sub.fieldbyname('ZYPS').AsFloat; +//// FZYQty := Order_Sub.fieldbyname('ZYQty').AsFloat; +// with ADOCmd do +// begin +// Close; +// sql.Clear; +// SQL.Add('UPDATE Contract_Sub SET ZYGS=:ZYGS, ZYPS=:ZYPS, ZYQty=:ZYQty WHERE MainId=:MainId'); +// +// // 󶨲Զͺţ +// Parameters.ParamByName('ZYGS').Value := Order_Sub.FieldByName('ZYGS').AsFloat; +// Parameters.ParamByName('ZYPS').Value := Order_Sub.FieldByName('ZYPS').AsFloat; +// Parameters.ParamByName('ZYQty').Value := Order_Sub.FieldByName('ZYQty').AsFloat; +// Parameters.ParamByName('MainId').Value := Trim(fMainID); +//// ShowMessage(SQL.text); +// ExecSQL; +// end; +// end; +// Next; +// end; +// end; +// +// ADOCmd.Connection.CommitTrans; +// Result := True; +// except +// Result := False; +// ADOCmd.Connection.RollbackTrans; +//// if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then +//// begin +//// end; +// Application.MessageBox('ʧܣ', 'ʾ', 0); +// end; +//end; + +procedure TfrmClothTPHWZYInput.TBSaveClick(Sender: TObject); +begin + cxGrid1.SetFocus; + + if Order_Sub.IsEmpty then + begin + Application.MessageBox('ϸΪգ', 'ʾ', 0); + exit; + end; + if Order_Sub.Locate('ZYQty', null, []) then + begin + Application.MessageBox('ռΪ!', 'ʾ', 0); + Exit; + end; + if Order_Sub.Locate('ZYPS', null, []) then + begin + Application.MessageBox('ռƥΪ!', 'ʾ', 0); + Exit; + end; +// if Order_Sub.Locate('ZYGangNo', null, []) then +// begin +// Application.MessageBox('ռø׺ŲΪ!', 'ʾ', 0); +// Exit; +// end; + + if SaveData() then + begin + Application.MessageBox('ɹ', 'ʾ', 0); + ModalResult := 1; + + end; +end; + +procedure TfrmClothTPHWZYInput.v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('OrderUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PRTUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdColor'; + flagname := 'ɫ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PRTColor').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.ToolButton1Click(Sender: TObject); +begin +// with Order_Sub do +// begin +// Append; +// fieldbyname('PriceUnit').Value := ''; +// fieldbyname('C_UNit').Value := 'M'; +// Post; +// end; + try + frmClothContractList_TpXZ := TfrmClothContractList_TpXZ.Create(Application); + with frmClothContractList_TpXZ do + begin + if showmodal = 1 then + begin + Order_Main.DisableControls; + Order_Main.first; + while not Order_Main.Eof do + begin + + if Order_Main.FieldByName('ssel').AsBoolean then + begin + Self.ConNo.text := trim(Order_Main.fieldbyname('ConNo').AsString); +// fMainID := trim(Order_Main.fieldbyname('mainid').AsString); + Order_Sub.append; + Order_Sub.FieldByName('frommainid').Value := trim(Order_Main.fieldbyname('mainid').AsString); + Order_Sub.FieldByName('fromsubid').Value := trim(Order_Main.fieldbyname('subid').AsString); + Order_Sub.FieldByName('ConNo').Value := trim(Order_Main.fieldbyname('ConNo').AsString); + Order_Sub.FieldByName('ZYGangNo').Value := trim(Order_Main.fieldbyname('BCGangNo').AsString); + Order_Sub.FieldByName('C_CodeName').Value := trim(Order_Main.fieldbyname('C_CodeName').AsString); + Order_Sub.FieldByName('C_Color').Value := trim(Order_Main.fieldbyname('C_Color').AsString); + Order_Sub.FieldByName('C_ColorNo').Value := trim(Order_Main.fieldbyname('C_ColorNo').AsString); + Order_Sub.FieldByName('C_Unit').Value := trim(Order_Main.fieldbyname('C_Unit').AsString); + Order_Sub.FieldByName('C_Spec').Value := trim(Order_Main.fieldbyname('C_Spec').AsString); + Order_Sub.FieldByName('Qty2').Value := trim(Order_Main.fieldbyname('Qty2').AsString); + Order_Sub.FieldByName('Qty1').Value := trim(Order_Main.fieldbyname('Qty1').AsString); + Order_Sub.FieldByName('C_Qty').Value := trim(Order_Main.fieldbyname('C_Qty').AsString); + + Order_Sub.Post; + end; + Order_Main.next; + end; + Order_Main.EnableControls; + end; + end; + finally + frmClothContractList_TpXZ.Free; + end; + +end; + +procedure TfrmClothTPHWZYInput.ToolButton2Click(Sender: TObject); +begin + if Order_Sub.IsEmpty then + Exit; + if Trim(Order_Sub.fieldbyname('SubId').AsString) <> '' then + begin + { with ADOTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contrac_Sub_MX where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+''''); + Open; + end; + if ADOTemp.IsEmpty then + begin + Application.MessageBox('ѵɾ!','ʾ',0); + Exit; + end; } + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where subID=''' + Trim(Order_Sub.fieldbyname('subID').AsString) + ''''); + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + end; + Order_Sub.Delete; +end; + +procedure TfrmClothTPHWZYInput.FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + if Trim(fMainID) <> '' then + begin + with ADOTemp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR A where exists('); + sql.Add('select * from Contract_Sub_MX B inner join Contract_Sub C on B.SubId=C.SubId '); + sql.Add(' where C.Mainid=''' + Trim(fMainID) + ''''); + sql.Add(' and B.MXID=A.YFTypeId)'); + Open; + end; + if ADOTemp.IsEmpty = False then + begin + Application.MessageBox('ѾӦ޸ĹӦ!', 'ʾ', 0); + Exit; + end; + end; + +// try +// frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); +// with frmZdyAttachGYS do +// begin +// if ShowModal = 1 then +// begin +// FactoryNoName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); +// FactoryNoName.Hint := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); +// LXTel.Text := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); +// LXPerson.Text := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); +// end; +// end; +// finally +// frmZdyAttachGYS.Free; +// end; +end; + +procedure TfrmClothTPHWZYInput.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZdyAttachCP := TfrmZdyAttachCP.Create(Application); + with frmZdyAttachCP do + begin + FType := ''; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString); + Self.Order_Sub.FieldByName('CP_CodeName').Value := Trim(CDS_HZ.fieldbyname('CPhh').AsString); + // Self.Order_Sub.FieldByName('Color').Value:=Trim(CDS_HZ.fieldbyname('DEFstr3').AsString); + // Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString); + Self.Order_Sub.Post; + end; + end; + finally + frmZdyAttachCP.Free; + end; + DoKc(); + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothTPHWZYInput.v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'KZ'; + flagname := 'صλ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('KZUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'MF'; + flagname := 'ŷλ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('MFUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'PriceUnit'; + flagname := 'Ƽ۵λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('PriceUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrderUnit'; + flagname := 'λ'; + if ShowModal = 1 then + begin + Self.Order_Sub.Edit; + Self.Order_Sub.FieldByName('C_Unit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.FactoryNoNamePropertiesChange(Sender: TObject); +begin + {if FXS=99 then + begin + PanZDY.Visible:=False; + FXS:=0; + Exit; + end; + ZDYHelp(FactoryNoName,'FactoryNo1Name'); } +end; + +procedure TfrmClothTPHWZYInput.CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'OrdDefStr2'; + flagname := '跽'; + if ShowModal = 1 then + begin + FXS := 99; + CompanyName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTPHWZYInput.JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + + try + frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); + with frmZdyAttachGYS do + begin + if ShowModal = 1 then + begin + JHPlace.Text := Trim(CDS_HZ.fieldbyname('zdyName').AsString); + end; + end; + finally + frmZdyAttachGYS.Free; + end; + +end; + +procedure TfrmClothTPHWZYInput.v1Column1PropertiesEditValueChanged(Sender: TObject); +var + mvalue: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + + if trim(mvalue) = '' then + exit; + + if rightBstr(trim(mvalue), 1) <> '#' then + begin + mvalue := trim(mvalue) + '#'; + end; + + with Order_Sub do + begin + Edit; + FieldByName('C_CodeName').Value := Trim(mvalue); + Post; + end; + + with ADOTemp do + begin + close; + sql.Clear; + sql.Add('select * from KH_Zdy_Attachment A '); + sql.Add('where zdyName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); + open; + end; + if ADOTemp.IsEmpty then + begin + application.MessageBox('Ʒڣ', 'ʾϢ', 0); + with Order_Sub do + begin + Edit; + FieldByName('C_CodeName').Value := ''; + Post; + end; + end; + + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothTPHWZYInput.fromConNoKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + DoQuery(fromConNo.text); + end; +end; + +procedure TfrmClothTPHWZYInput.v1ClothUnitPropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; +begin + if Trim(TcxTextEdit(Sender).EditingText) <> '' then + begin + mvalue := TcxTextEdit(Sender).EditingText; + end + else + begin + mvalue := '0'; + end; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + with Order_Sub do + begin + Edit; + FieldByName(Trim(fieldname)).Value := mvalue; + Post; + end; + with Order_Sub do + begin + Edit; + FieldByName('money').Value := strtofloat(format('%.2f', [FieldByName('C_Qty').AsFloat * FieldByName('Price').AsFloat])); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothTPHWZYInput.fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmClothContractList_CG_help := TfrmClothContractList_CG_help.Create(Application); + with frmClothContractList_CG_help do + begin + if ShowModal = 1 then + begin + fromConNO.Text := Trim(Order_Main.fieldbyname('ConNO').AsString); + end; + end; + finally + frmClothContractList_CG_help.Free; + end; + DoQuery(fromConNo.text); +end; + +procedure TfrmClothTPHWZYInput.v1Column6PropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; +begin + if Trim(TcxTextEdit(Sender).EditingText) <> '' then + begin + mvalue := TcxTextEdit(Sender).EditingText; + end + else + begin + mvalue := '0'; + end; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + with Order_Sub do + begin + Edit; + FieldByName(Trim(fieldname)).Value := mvalue; + Post; + end; + with Order_Sub do + begin + Edit; + FieldByName('T_money').Value := strtofloat(format('%.2f', [FieldByName('T_Qty').AsFloat * FieldByName('T_Price').AsFloat])); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmClothTPHWZYInput.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCXgrid(self.Caption, tv1); +end; + +procedure TfrmClothTPHWZYInput.FormCreate(Sender: TObject); +begin + cxGrid1.Align := Alclient; +end; + +procedure TfrmClothTPHWZYInput.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + DoKc(); +end; + +end. + diff --git a/管理系统/U_ClothTP_HWZY.dfm b/管理系统/U_ClothTP_HWZY.dfm new file mode 100644 index 0000000..6b6a9a4 --- /dev/null +++ b/管理系统/U_ClothTP_HWZY.dfm @@ -0,0 +1,822 @@ +object frmClothTP_HWZY: TfrmClothTP_HWZY + Left = 309 + Top = 284 + Width = 1222 + Height = 738 + Caption = #36135#29289#21344#29992#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + OnClick = TBAddClick + end + object TBEdit: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + Visible = False + OnClick = TBDelClick + end + object tchk: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #30830#35748#21462#28040 + ImageIndex = 41 + Visible = False + OnClick = tchkClick + end + object Tnochk: TToolButton + Left = 402 + Top = 0 + AutoSize = True + Caption = #25764#38144#21462#28040 + Enabled = False + ImageIndex = 56 + Visible = False + OnClick = TnochkClick + end + object ToolButton1: TToolButton + Left = 489 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + Visible = False + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 552 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + Visible = False + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 615 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + Visible = False + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 678 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #20219#21153#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #35268#26684 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 26 + Height = 12 + Caption = #20379#26041 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 836 + Top = 22 + Width = 52 + Height = 12 + Caption = #21040#36135#22320#28857 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + OnKeyPress = conPress + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Spec: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 732 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + object JHPlace: TEdit + Tag = 2 + Left = 892 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 6 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 107 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + 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 + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object Tv1Column2: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1OrderNo: TcxGridDBColumn + Caption = #20219#21153#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 58 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MFQty' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty1: TcxGridDBColumn + Caption = #21344#29992#21305#25968 + DataBinding.FieldName = 'ZYPS' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle3 + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle3 + Width = 85 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #21344#29992#25968#37327 + DataBinding.FieldName = 'ZYQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle3 + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle3 + Width = 58 + end + object Tv1Column3: TcxGridDBColumn + Caption = #21344#29992#32568#25968 + DataBinding.FieldName = 'ZYGS' + Styles.Content = cxStyle3 + Styles.Header = cxStyle3 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column18: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column20: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column19: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column21: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Column1: TcxGridDBColumn + Caption = #25104#21697#21697#21517 + DataBinding.FieldName = 'CP_CodeName' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv1Column4: TcxGridDBColumn + Caption = #25237#22383#25968#37327 + DataBinding.FieldName = 'T_Qty' + Styles.Content = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object Tv1Column5: TcxGridDBColumn + Caption = #25237#22383#32568#25968 + DataBinding.FieldName = 'Qty2' + Styles.Content = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object Tv1Column6: TcxGridDBColumn + Caption = #25237#22383#21305#25968 + DataBinding.FieldName = 'Qty1' + Styles.Content = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object Tv1Column7: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column8: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_colorno' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column9: TcxGridDBColumn + Caption = #21344#29992#20154 + DataBinding.FieldName = 'ZYer' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column10: TcxGridDBColumn + Caption = #21344#29992#26102#38388 + DataBinding.FieldName = 'ZYtime' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 85 + Width = 1206 + Height = 22 + Align = alTop + TabOrder = 3 + Visible = False + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 2 + Properties.Tabs.Strings = ( + #24050#21344#29992 + #21462#28040#21344#29992 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectBottom = 22 + ClientRectRight = 1206 + ClientRectTop = 19 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 1096 + Top = 8 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 1112 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 880 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 920 + Top = 224 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 680 + Top = 32 + end + object cxStyleRepository1: TcxStyleRepository + Left = 305 + Top = 310 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + object cxStyle3: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clFuchsia + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + end +end diff --git a/管理系统/U_ClothTP_HWZY.pas b/管理系统/U_ClothTP_HWZY.pas new file mode 100644 index 0000000..8ddd6a7 --- /dev/null +++ b/管理系统/U_ClothTP_HWZY.pas @@ -0,0 +1,962 @@ +unit U_ClothTP_HWZY; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls, + cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, + cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxCurrencyEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, + dxBarBuiltInMenu, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, + dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, + dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, + dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, + dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, + dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, + dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; + +type + TfrmClothTP_HWZY = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Spec: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + ToolButton1: TToolButton; + cxTabControl1: TcxTabControl; + tchk: TToolButton; + Tnochk: TToolButton; + Label7: TLabel; + JHPlace: TEdit; + v1Column18: TcxGridDBColumn; + v1Column19: TcxGridDBColumn; + v1Column20: TcxGridDBColumn; + v1Column21: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + Tv1Column7: TcxGridDBColumn; + Tv1Column8: TcxGridDBColumn; + cxStyle3: TcxStyle; + Tv1Column9: TcxGridDBColumn; + Tv1Column10: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure conPress(Sender: TObject; var Key: Char); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure TthClick(Sender: TObject); + procedure tchkClick(Sender: TObject); + procedure TnochkClick(Sender: TObject); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure cxTabControl1Change(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothTP_HWZY: TfrmClothTP_HWZY; + +implementation + +uses + U_DataLink, U_ClothTPHWZYInput, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothTP_HWZY.FormDestroy(Sender: TObject); +begin + frmClothTP_HWZY := nil; +end; + +procedure TfrmClothTP_HWZY.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothTP_HWZY.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothTP_HWZY.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothTP_HWZY.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; +// sql.Add('exec P_Get_Contract'); +// sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); +// sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); +// sql.Add(',@conType='''' '); +// sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' '); +// ShowMessage(SQL.text); + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.conType=''ռ'' '); //and ZYGS>0 +// ShowMessage(SQL.text); +// IF cxTabControl1.TabIndex<2 then +// sql.Add('and isnull(B.C_status,''0'')='''+inttostr(cxTabControl1.TabIndex)+''' '); + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + TBFind.Click; + end; +end; + +procedure TfrmClothTP_HWZY.InitForm(); +begin +// if fDParameters1 = 'ѯ' then +// begin +// TBADD.Visible := false; +// // TBEdit.Visible:=false; +// TBDel.Visible := false; +// // Tchk.Visible:=false; +// // TNochk.Visible:=false; +//// v1Price.Visible := false; +//// v1Price.Hidden := true; +//// v1money.Visible := false; +//// v1money.Hidden := true; +//// v1T_money.Visible := false; +//// v1T_money.Hidden := true; +// ToolButton1.Visible := false; +// end; +// +// TBEdit.Enabled := false; +// TBDel.Enabled := false; +// Tchk.Enabled := false; +// TNochk.Enabled := false; +// +// if cxTabControl1.TabIndex = 0 then +// begin +//// TBEdit.Enabled := true; +// TBDel.Enabled := true; +// Tchk.Enabled := true; +// +// end; +// if cxTabControl1.TabIndex = 1 then +// begin +// TNochk.Enabled := true; +// end; + InitGrid(); +end; + +procedure TfrmClothTP_HWZY.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothTP_HWZY.TBEditClick(Sender: TObject); +var + i: integer; +begin + if Order_Main.IsEmpty then + Exit; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; +// with ADOQueryTemp do +// begin +// close; +// sql.Clear; +// sql.Add('select * from contract_sub '); +// sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); +//// sql.Add(' '); +// open; +// if not IsEmpty then +// begin +// application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); +// exit; +// end; +// end; + try + frmClothTPHWZYInput := TfrmClothTPHWZYInput.Create(Application); + with frmClothTPHWZYInput do + begin + if trim(fDParameters1) = 'ѯ' then + begin + frmClothTPHWZYInput.Caption := 'Ϣѯ'; +// v1Money.Visible := false; +// v1Price.Visible := false; +// v1Money.Hidden := true; +// v1Price.Hidden := true; +// v1T_money.Visible := false; +// v1T_money.Hidden := true; +// v1T_price.Visible := false; +// v1T_price.Hidden := true; + ScrollBox1.Enabled := false; + for i := 0 to tv1.ColumnCount - 1 do + begin + tv1.Columns[i].Options.Editing := false; + end; +// v1Mrate.Options.Editing := true; + ToolBar2.Enabled := false; + end; + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + // TBRafresh.Click; + end; + end; + finally + frmClothTPHWZYInput.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothTP_HWZY.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select YFID from YF_money_CR '); + sql.Add('where mainID=''' + trim(Order_Main.FieldByName('mainID').AsString) + ''' '); + sql.Add('and status>0 '); + open; + if not IsEmpty then + begin + application.MessageBox('ˣɾ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + with ADOQueryTemp do + begin + close; + sql.Clear; + sql.Add('select * from contract_sub '); + sql.Add('where kcsubid=''' + trim(Order_Main.FieldByName('subid').AsString) + ''' '); + open; + if not IsEmpty then + begin + application.MessageBox('ѳⲻ޸ģ', 'ʾϢ', MB_ICONERROR); + exit; + end; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothTP_HWZY.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothTP_HWZY.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); +end; + +procedure TfrmClothTP_HWZY.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\.rmf'), 'ʾ', 0); + end; + +end; + +procedure TfrmClothTP_HWZY.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothTP_HWZY.TBAddClick(Sender: TObject); +var + i: integer; +begin + try + frmClothTPHWZYInput := TfrmClothTPHWZYInput.Create(Application); + with frmClothTPHWZYInput do + begin + if trim(fDParameters1) = 'ѯ' then + begin + frmClothTPHWZYInput.Caption := 'Ϣѯ'; +// v1Money.Visible := false; +// v1Price.Visible := false; +// v1Money.Hidden := true; +// v1Price.Hidden := true; +// v1T_money.Visible := false; +// v1T_money.Hidden := true; + ScrollBox1.Enabled := false; + for i := 0 to tv1.ColumnCount - 2 do + begin + tv1.Columns[i].Options.Editing := false; + end; +// v1Mrate.Options.Editing := true; + ToolBar2.Enabled := false; + end; + PState := 0; + FMainId := ''; + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothTPHWZYInput.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothTP_HWZY.ConNoChange(Sender: TObject); +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothTP_HWZY.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + initForm(); + +end; + +procedure TfrmClothTP_HWZY.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothTP_HWZY.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothTP_HWZY.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothTP_HWZY.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothTP_HWZY.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothTP_HWZY.conPress(Sender: TObject; var Key: Char); +begin + { if Key=#13 then + begin + if Length(Trim(ConNoM.Text))<4 then Exit; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add('exec ClothContract_QryList :MainId,:WSql'); + Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNoM.Text)+'%'+''''; + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; + end; } +end; + +procedure TfrmClothTP_HWZY.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothTPHWZYInput := TfrmClothTPHWZYInput.Create(Application); + with frmClothTPHWZYInput do + begin + PState := 3; + TBSave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothTPHWZYInput.Free; + end; +end; + +procedure TfrmClothTP_HWZY.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothTP_HWZY.TthClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothTPHWZYInput := TfrmClothTPHWZYInput.Create(Application); + with frmClothTPHWZYInput do + begin + Caption := '˻'; + PState := 1; + v1T_money.Visible := true; + v1T_ps.Visible := true; + v1T_Qty.Visible := true; + v1T_Price.Visible := true; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothTPHWZYInput.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothTP_HWZY.tchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + { try + frmClothContractInPut := TfrmClothContractInPut.Create(Application); + with frmClothContractInPut do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + with self.ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(self.Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(self.Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + self.InitGrid(); + end + else + begin + end; + end; + finally + frmClothContractInPut.Free; + // TBRafresh.Click; + end; } + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothTP_HWZY.TnochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + {with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; } + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothTP_HWZY.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin +// FBounds := AViewInfo.Bounds; +// if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then +// begin +// ACanvas.FillRect(FBounds); +// ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); +// FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); +// InflateRect(FBounds, -1, -1); +// ACanvas.Font.Color := clBlack; +// ACanvas.Brush.Style := bsClear; +// ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); +// ADone := True; +// end; +end; + +procedure TfrmClothTP_HWZY.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +// if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('H_PS').Index] >= AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Qty1').Index] then +// begin +// ACanvas.Brush.Color := clSkyBlue; +// end; +end; + +procedure TfrmClothTP_HWZY.cxTabControl1Change(Sender: TObject); +begin + initForm(); +end; + +end. + diff --git a/管理系统/U_GetDllForm.pas b/管理系统/U_GetDllForm.pas index 180f175..10466ac 100644 --- a/管理系统/U_GetDllForm.pas +++ b/管理系统/U_GetDllForm.pas @@ -34,8 +34,8 @@ uses U_ClothContractList_SJDCK, U_KH_XS_YP_list, U_ProductOrderNewList_BH, U_ClothContractList_HZ1, U_ClothContractList_CP, U_ClothContractList_SJD, U_ClothContractList_XPKF, U_ClothContractList_DY, U_ClothContractList_Dp, - U_ClothContractList_CK, - U_ClothContractList_SJDMX, U_ClothContractList_PBKC; + U_ClothContractList_CK, U_ClothContractCPRKList, U_ClothContractCPCKList, + U_ClothTP_HWZY, U_ClothContractList_SJDMX, U_ClothContractList_PBKC; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -387,7 +387,7 @@ begin // mNewHandle:=frmCpCkSaoMNewSel.Handle; - end ; } + end ; } 6: //Ʒб ڳ begin if frmCKProductBCPInList = nil then @@ -627,7 +627,7 @@ begin mnewHandle := frmCpRkSaoMNew.Handle; end; - 315: // + 315: // begin if frmClothContractList_CK = nil then begin @@ -649,7 +649,7 @@ begin mnewHandle := frmClothContractList_CK.Handle; end; - 15: //ɹ Ͷƥ + 15: // begin if frmClothContractList = nil then begin @@ -671,7 +671,49 @@ begin mnewHandle := frmClothContractList.Handle; end; - 151: //ɹ Ͷƥ + 661: //Ʒ + begin + if frmClothContractCPRKList = nil then + begin + frmClothContractCPRKList := TfrmClothContractCPRKList.Create(application.MainForm); + with frmClothContractCPRKList do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + // fDParameters1:=trim('ѯ'); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothContractCPRKList.BringToFront; + // + mnewHandle := frmClothContractCPRKList.Handle; + end; + 662: //Ʒ + begin + if frmClothContractCPCKList = nil then + begin + frmClothContractCPCKList := TfrmClothContractCPCKList.Create(application.MainForm); + with frmClothContractCPCKList do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + // fDParameters1:=trim('ѯ'); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothContractCPCKList.BringToFront; + // + mnewHandle := frmClothContractCPCKList.Handle; + end; + 151: //ɹƻ begin if frmClothContractList_CG = nil then begin @@ -690,7 +732,26 @@ begin // mnewHandle := frmClothContractList_CG.Handle; end; - + 552: //ռ + begin + if frmClothTP_HWZY = nil then + begin + frmClothTP_HWZY := TfrmClothTP_HWZY.Create(application.MainForm); + with frmClothTP_HWZY do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothTP_HWZY.BringToFront; + // + mnewHandle := frmClothTP_HWZY.Handle; + end; 152: //ɹ ɫƻ begin if frmClothContractList_Tp = nil then @@ -774,9 +835,9 @@ begin mnewHandle := frmClothContractList_XPKF.Handle; end; 127: //ƻ - begin + begin if frmClothContractList_DY = nil then - begin + begin frmClothContractList_DY := TfrmClothContractList_DY.Create(application.MainForm); with frmClothContractList_DY do begin