diff --git a/基础数据/U_CPTypeBM.dfm b/基础数据/U_CPTypeBM.dfm new file mode 100644 index 0000000..610c2d2 --- /dev/null +++ b/基础数据/U_CPTypeBM.dfm @@ -0,0 +1,185 @@ +object frmCPTypeBM: TfrmCPTypeBM + Left = 281 + Top = 184 + Width = 870 + Height = 505 + Caption = #37096#38376#31867#21035 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 854 + Height = 33 + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + DisabledImages = BaseData10_DataLink.ThreeImgList + Flat = True + Images = BaseData10_DataLink.ThreeImgList + List = True + ParentColor = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 9 + OnClick = TBRafreshClick + end + object TBAdd: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #26032#22686#23376#31867 + ImageIndex = 3 + OnClick = TBAddClick + end + object ToolButton1: TToolButton + Left = 150 + Top = 0 + AutoSize = True + Caption = #20445#23384 + ImageIndex = 14 + OnClick = ToolButton1Click + end + object TBDel: TToolButton + Left = 213 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + OnClick = TBDelClick + end + object TBClose: TToolButton + Left = 276 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object cxDBTreeList1: TcxDBTreeList + Left = 0 + Top = 33 + Width = 249 + Height = 433 + Align = alLeft + Bands = < + item + end> + DataController.DataSource = DataSource1 + DataController.ParentField = 'CPParent' + DataController.KeyField = 'CPID' + Navigator.Buttons.CustomButtons = <> + OptionsBehavior.ExpandOnDblClick = False + OptionsSelection.CellSelect = False + OptionsView.CellAutoHeight = True + OptionsView.Headers = False + RootValue = -1 + TabOrder = 1 + OnClick = cxDBTreeList1Click + object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn + DataBinding.FieldName = 'CPName' + Width = 210 + Position.ColIndex = 0 + Position.RowIndex = 0 + Position.BandIndex = 0 + Summary.FooterSummaryItems = <> + Summary.GroupFooterSummaryItems = <> + end + end + object Panel1: TPanel + Left = 270 + Top = 54 + Width = 315 + Height = 150 + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 2 + object Label1: TLabel + Left = 66 + Top = 24 + Width = 48 + Height = 12 + Caption = #29238' '#31867 + end + object Label2: TLabel + Left = 66 + Top = 65 + Width = 48 + Height = 12 + Caption = #31867#21035#21517#31216 + end + object Label3: TLabel + Left = 66 + Top = 105 + Width = 48 + Height = 12 + Caption = #31867#21035#32534#30721 + end + object CPTopName: TEdit + Left = 129 + Top = 21 + Width = 121 + Height = 20 + ReadOnly = True + TabOrder = 0 + end + object CPName: TEdit + Left = 129 + Top = 61 + Width = 121 + Height = 20 + TabOrder = 1 + OnKeyPress = CPNameKeyPress + end + object CPNo: TEdit + Left = 129 + Top = 101 + Width = 121 + Height = 20 + TabOrder = 2 + end + end + object DataSource1: TDataSource + DataSet = ADOQueryTree + Left = 91 + Top = 147 + end + object ADOQueryTree: TADOQuery + Connection = BaseData10_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 117 + Top = 145 + end + object ADOQueryTemp: TADOQuery + Connection = BaseData10_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 709 + Top = 209 + end + object ADOQueryCmd: TADOQuery + Connection = BaseData10_DataLink.ADOLink + Parameters = <> + Left = 677 + Top = 137 + end +end diff --git a/基础数据/U_CPTypeBM.pas b/基础数据/U_CPTypeBM.pas new file mode 100644 index 0000000..eeb2eb6 --- /dev/null +++ b/基础数据/U_CPTypeBM.pas @@ -0,0 +1,270 @@ +unit U_CPTypeBM; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB, + cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls, + ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters, cxTLdxBarBuiltInMenu, + 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; + +type + TfrmCPTypeBM = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBAdd: TToolButton; + TBDel: TToolButton; + TBClose: TToolButton; + cxDBTreeList1: TcxDBTreeList; + cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn; + DataSource1: TDataSource; + ADOQueryTree: TADOQuery; + ToolButton1: TToolButton; + ADOQueryTemp: TADOQuery; + ADOQueryCmd: TADOQuery; + Panel1: TPanel; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + CPTopName: TEdit; + CPName: TEdit; + CPNo: TEdit; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure TBRafreshClick(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure cxDBTreeList1Click(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure CPNameKeyPress(Sender: TObject; var Key: Char); + procedure FormShow(Sender: TObject); + private + { Private declarations } + PState: Integer; + FCPID, FTopID: string; + procedure InitTree(); + public + FState: string; + { Public declarations } + end; + +var + frmCPTypeBM: TfrmCPTypeBM; + +implementation + +uses + U_DataLink, U_Fun; + +{$R *.dfm} + +procedure TfrmCPTypeBM.InitTree(); +var + i: Integer; +begin + with ADOQueryTree do + begin + Close; + SQL.Clear; + SQL.Add('select * from BD_Staff_bumen order by CPlevel,CPOrder,CPName'); + Open; + end; + cxDBTreeList1.Items[0].Expand(false); + //cxDBTreeList1.Items[1].Expand(False); +end; + +procedure TfrmCPTypeBM.FormDestroy(Sender: TObject); +begin + frmCPTypeBM := nil; +end; + +procedure TfrmCPTypeBM.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmCPTypeBM.TBRafreshClick(Sender: TObject); +begin + InitTree(); +end; + +procedure TfrmCPTypeBM.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmCPTypeBM.TBAddClick(Sender: TObject); +begin + PState := 11; + CPTopName.Text := Trim(ADOQueryTree.fieldbyname('CPName').AsString); + //FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString); + FCPID := ''; + CPName.Text := ''; + CPNo.Text := ''; + CPName.SetFocus; +end; + +procedure TfrmCPTypeBM.cxDBTreeList1Click(Sender: TObject); +begin + PState := 22; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from BD_Staff_bumen where CPID=''' + Trim(ADOQueryTree.fieldbyname('CPParent').AsString) + ''''); + Open; + end; + FCPID := Trim(ADOQueryTree.fieldbyname('CPID').AsString); + CPTopName.Text := Trim(ADOQueryTemp.fieldbyname('CPName').AsString); + CPName.Text := Trim(ADOQueryTree.fieldbyname('CPName').AsString); + CPNo.Text := Trim(ADOQueryTree.fieldbyname('CPNo').AsString); + if FState = 'ѡ' then + begin + ModalResult := 1; +// FCPID := Trim(ADOQueryTree.fieldbyname('CPName').AsString); + + end; +end; + +procedure TfrmCPTypeBM.ToolButton1Click(Sender: TObject); +var + maxId: string; +begin + if Trim(CPName.Text) = '' then + begin + Application.MessageBox('ƲΪգ', 'ʾ', 0); + Exit; + end; + if Trim(CPNo.Text) = '' then + begin + Application.MessageBox('벻Ϊգ', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + if PState = 11 then + begin + if GetLSNo(ADOQueryCmd, maxId, 'CP', 'BD_Staff_bumen', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxId := Trim(FCPID); + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from BD_Staff_bumen where CPID=''' + Trim(FCPID) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if PState = 11 then + begin + Append; + FieldByName('CPID').Value := Trim(maxId); + FieldByName('CPName').Value := Trim(CPName.Text); + FieldByName('CPNo').Value := Trim(CPNo.Text); + FieldByName('CPParent').Value := Trim(ADOQueryTree.fieldbyname('CPID').AsString); + FieldByName('CPLevel').Value := ADOQueryTree.fieldbyname('CPLevel').AsInteger + 1; + Post; + end + else if PState = 22 then + begin + Edit; + FieldByName('CPID').Value := Trim(maxId); + FieldByName('CPName').Value := Trim(CPName.Text); + FieldByName('CPNo').Value := Trim(CPNo.Text); + //FieldByName('CPParent').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString); + //FieldByName('CPOrder').Value:=ADOQueryTree.fieldbyname('CPOrder').AsInteger+1; + Post; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ!', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ʧ!', 'ʾ', 0); + end; +end; + +procedure TfrmCPTypeBM.TBDelClick(Sender: TObject); +begin + if ADOQueryTree.FieldByName('CPLevel').AsInteger = 0 then + Exit; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from BD_Staff_bumen where CPParent=''' + Trim(ADOQueryTree.fieldbyname('CPID').AsString) + ''''); + Open; + if not IsEmpty then + begin + Application.MessageBox('Ѿ಻ɾ', 'ʾ', 0); + Exit; + end; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from CP_YDang where CYType=''' + Trim(ADOQueryTree.fieldbyname('CPID').AsString) + ''''); + Open; + if not IsEmpty then + begin + Application.MessageBox('ѾвƷڴ಻ɾ', 'ʾ', 0); + Exit; + end; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('delete BD_Staff_bumen where CPID=''' + Trim(ADOQueryTree.fieldbyname('CPID').AsString) + ''''); + sql.Add('delete BD_Staff_bumen where CPParent=''' + Trim(ADOQueryTree.fieldbyname('CPID').AsString) + ''''); + ExecSQL; + end; + InitTree(); +end; + +procedure TfrmCPTypeBM.CPNameKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + CPNo.SetFocus; +end; + +procedure TfrmCPTypeBM.FormShow(Sender: TObject); +begin + if FState = 'ѡ' then + begin + TBAdd.Visible := False; + TBAdd.Visible := False; + TBDel.Visible := False; + + end; + InitTree(); +end; + +end. + diff --git a/基础数据/U_GetDllForm.pas b/基础数据/U_GetDllForm.pas index c28630a..2118f03 100644 --- a/基础数据/U_GetDllForm.pas +++ b/基础数据/U_GetDllForm.pas @@ -15,7 +15,7 @@ function GetsysParam(muserId: pchar; fparam1: pchar): Boolean; implementation uses - U_DataLink, U_getDogServer, U_UserList, U_User_bz_List; + U_DataLink, U_getDogServer, U_UserList, U_User_bz_List,U_CPTypeBM; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -119,6 +119,26 @@ begin mnewHandle := frmUserList.Handle; end; + 3: // Ź + begin + if frmCPTypeBM = nil then + begin + frmCPTypeBM := TfrmCPTypeBM.Create(application.MainForm); + with frmCPTypeBM do + begin + caption := Trim(Title); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmCPTypeBM.BringToFront; + // + mnewHandle := frmCPTypeBM.Handle; + + end; 2: // Ʒ begin if frmUser_bz_List = nil then diff --git a/基础数据/U_User10.dfm b/基础数据/U_User10.dfm index cfc4769..f69d222 100644 --- a/基础数据/U_User10.dfm +++ b/基础数据/U_User10.dfm @@ -238,22 +238,13 @@ object frmUser10: TfrmUser10 TabOrder = 5 OnKeyPress = userIDKeyPress end - object Udept: TEdit - Tag = 2 - Left = 112 - Top = 168 - Width = 120 - Height = 20 - TabOrder = 6 - OnKeyPress = userIDKeyPress - end object UType: TEdit Tag = 2 Left = 112 Top = 196 Width = 120 Height = 20 - TabOrder = 7 + TabOrder = 6 OnKeyPress = userIDKeyPress end object cxOK: TcxButton @@ -262,7 +253,7 @@ object frmUser10: TfrmUser10 Width = 75 Height = 25 Caption = #25552#20132 - TabOrder = 8 + TabOrder = 7 OnClick = cxOKClick LookAndFeel.Kind = lfOffice11 LookAndFeel.NativeStyle = False @@ -273,7 +264,7 @@ object frmUser10: TfrmUser10 Width = 75 Height = 25 Caption = #20851#38381 - TabOrder = 9 + TabOrder = 8 OnClick = cxCloseClick LookAndFeel.Kind = lfOffice11 LookAndFeel.NativeStyle = False @@ -285,7 +276,7 @@ object frmUser10: TfrmUser10 Height = 20 CharCase = ecUpperCase PasswordChar = '*' - TabOrder = 10 + TabOrder = 9 Visible = False OnKeyPress = userIDKeyPress end @@ -296,7 +287,7 @@ object frmUser10: TfrmUser10 Height = 20 CharCase = ecUpperCase PasswordChar = '*' - TabOrder = 11 + TabOrder = 10 Visible = False OnKeyPress = userIDKeyPress end @@ -306,7 +297,7 @@ object frmUser10: TfrmUser10 Top = 116 Width = 357 Height = 20 - TabOrder = 12 + TabOrder = 11 end object phone: TEdit Tag = 2 @@ -314,7 +305,7 @@ object frmUser10: TfrmUser10 Top = 144 Width = 120 Height = 20 - TabOrder = 13 + TabOrder = 12 end object position: TBtnEditC Tag = 2 @@ -324,7 +315,7 @@ object frmUser10: TfrmUser10 Height = 20 Hint = 'position/'#24037#31181 ReadOnly = True - TabOrder = 14 + TabOrder = 13 OnBtnUpClick = positionBtnUpClick OnBtnDnClick = positionBtnDnClick end @@ -334,7 +325,7 @@ object frmUser10: TfrmUser10 Top = 168 Width = 121 Height = 20 - TabOrder = 15 + TabOrder = 14 end object note: TMemo Tag = 2 @@ -343,7 +334,7 @@ object frmUser10: TfrmUser10 Width = 357 Height = 61 ScrollBars = ssVertical - TabOrder = 16 + TabOrder = 15 end object valid: TComboBox Left = 348 @@ -353,7 +344,7 @@ object frmUser10: TfrmUser10 Style = csDropDownList ItemHeight = 12 ItemIndex = 0 - TabOrder = 17 + TabOrder = 16 Text = #26159 Items.Strings = ( #26159 @@ -369,7 +360,7 @@ object frmUser10: TfrmUser10 Properties.ReadOnly = True Properties.ShowFocusRect = False Style.BorderStyle = ebsSingle - TabOrder = 18 + TabOrder = 17 Visible = False OnDblClick = Picture4DblClick Height = 220 @@ -382,7 +373,7 @@ object frmUser10: TfrmUser10 Height = 25 Hint = 'Filesother' Caption = #36523#20221#35777#27491#38754 - TabOrder = 19 + TabOrder = 18 Visible = False OnClick = FileNameClick LookAndFeel.Kind = lfOffice11 @@ -397,7 +388,7 @@ object frmUser10: TfrmUser10 Properties.ReadOnly = True Properties.ShowFocusRect = False Style.BorderStyle = ebsSingle - TabOrder = 20 + TabOrder = 19 Visible = False OnDblClick = Picture4DblClick Height = 220 @@ -410,11 +401,32 @@ object frmUser10: TfrmUser10 Height = 25 Hint = 'Filesother1' Caption = #36523#20221#35777#32972#38754 - TabOrder = 21 + TabOrder = 20 Visible = False OnClick = FileNameClick LookAndFeel.Kind = lfOffice11 end + object Udept: TBtnEditC + Tag = 2 + Left = 112 + Top = 170 + Width = 121 + Height = 20 + Hint = 'Udept/'#37096#38376 + ReadOnly = True + TabOrder = 21 + OnBtnUpClick = UdeptBtnUpClick + OnBtnDnClick = UdeptBtnDnClick + end + object UdeptID: TEdit + Tag = 2 + Left = 160 + Top = 288 + Width = 120 + Height = 20 + TabOrder = 22 + Visible = False + end end object ADOQueryTmp: TADOQuery Connection = BaseData10_DataLink.ADOLink diff --git a/基础数据/U_User10.pas b/基础数据/U_User10.pas index 8ff3ef8..0755785 100644 --- a/基础数据/U_User10.pas +++ b/基础数据/U_User10.pas @@ -3,24 +3,23 @@ unit U_User10; interface uses - Windows, Messages, SysUtils, strUtils,Variants, Classes, Graphics, Controls, Forms, - Dialogs, Menus, cxLookAndFeelPainters, StdCtrls, cxButtons, DB, ADODB, + Windows, Messages, SysUtils, strUtils, Variants, Classes, Graphics, Controls, + Forms, Dialogs, Menus, cxLookAndFeelPainters, StdCtrls, cxButtons, DB, ADODB, BtnEdit, ComCtrls, ExtCtrls, cxControls, cxContainer, cxEdit, cxImage, - cxDBEdit, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,ShellAPI, + cxDBEdit, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, ShellAPI, IdFTP, cxGraphics, cxLookAndFeels, 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; + 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; type TfrmUser10 = class(TForm) @@ -39,7 +38,6 @@ type Label8: TLabel; Label2: TLabel; userName: TEdit; - Udept: TEdit; Label5: TLabel; Label6: TLabel; UType: TEdit; @@ -68,6 +66,8 @@ type DataSource1: TDataSource; ADOQueryImage: TADOQuery; IdFTP1: TIdFTP; + Udept: TBtnEditC; + UdeptID: TEdit; procedure cxCloseClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure cxOKClick(Sender: TObject); @@ -77,16 +77,18 @@ type procedure positionBtnDnClick(Sender: TObject); procedure FileNameClick(Sender: TObject); procedure Picture4DblClick(Sender: TObject); + procedure UdeptBtnDnClick(Sender: TObject); + procedure UdeptBtnUpClick(Sender: TObject); private - fPassWord:string; - fIsYGCodezdsc:Boolean; + fPassWord: string; + fIsYGCodezdsc: Boolean; procedure DoQuery(); - function SaveData():Boolean; + function SaveData(): Boolean; // procedure InitImage(); { Private declarations } public - formId:integer; - fuserID:string; + formId: integer; + fuserID: string; { Public declarations } end; @@ -94,7 +96,9 @@ var frmUser10: TfrmUser10; implementation -uses U_DataLink,U_Fun10,U_ZDYHelp,U_PublicFunction, getpic; + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_PublicFunction, getpic, U_CPTypeBM; {$R *.dfm} {procedure TfrmUser10.InitImage(); begin @@ -107,36 +111,39 @@ begin open; end; end;} -function TfrmUser10.SaveData():Boolean; + +function TfrmUser10.SaveData(): Boolean; begin - result:=false; + result := false; ADO_Cmd.Connection.BeginTrans; try { if trim(newPassword.Text)<>'' then fPassWord:=trim(EncryptString(trim(newPassword.text),keys)) else } - fPassWord:=''; + fPassWord := ''; with ADO_Cmd do begin close; sql.Clear; sql.Add(' select * from BD_Staff '); - sql.Add(' where userID='+quotedstr(trim(fuserID))); + sql.Add(' where userID=' + quotedstr(trim(fuserID))); open; - if ADO_Cmd.IsEmpty then ADO_Cmd.Append - else ADO_Cmd.Edit; - SSetsaveSqlNew(ADO_Cmd,'BD_Staff',Panel1,2); - ADO_Cmd.FieldByName('userID').Value:=trim(fuserID); + if ADO_Cmd.IsEmpty then + ADO_Cmd.Append + else + ADO_Cmd.Edit; + SSetsaveSqlNew(ADO_Cmd, 'BD_Staff', Panel1, 2); + ADO_Cmd.FieldByName('userID').Value := trim(fuserID); // ADO_Cmd.FieldByName('username').Value:=trim(username.Text); - ADO_Cmd.FieldByName('passWord').Value:=trim(fPassWord); + ADO_Cmd.FieldByName('passWord').Value := trim(fPassWord); // ADO_Cmd.FieldByName('Udept').Value:=trim(Udept.Text); // ADO_Cmd.FieldByName('UType').Value:=trim(UType.Text); - if trim(valid.Text)='' then - ADO_Cmd.FieldByName('valid').Value:='N' + if trim(valid.Text) = '' then + ADO_Cmd.FieldByName('valid').Value := 'N' else - ADO_Cmd.FieldByName('valid').Value:='Y'; - ADO_Cmd.FieldByName('isywy').Value:=false; + ADO_Cmd.FieldByName('valid').Value := 'Y'; + ADO_Cmd.FieldByName('isywy').Value := false; ADO_Cmd.Post; end; with ADO_Cmd do @@ -144,20 +151,21 @@ begin close; sql.Clear; sql.Add(' update SY_user SET '); - if trim(valid.Text)='' then - sql.Add(' valid=''N'' ') + if trim(valid.Text) = '' then + sql.Add(' valid=''N'' ') else - sql.Add(' valid=''Y'' '); - sql.Add(' where userID='+quotedstr(trim(fuserID))); + sql.Add(' valid=''Y'' '); + sql.Add(' where userID=' + quotedstr(trim(fuserID))); execsql; end; ADO_Cmd.Connection.CommitTrans; - result:=true; + result := true; except ADO_Cmd.Connection.RollbackTrans; end; end; + procedure TfrmUser10.DoQuery(); begin with adoqueryTmp do @@ -165,11 +173,11 @@ begin close; sql.Clear; sql.Add(' select * from BD_Staff A '); - sql.Add(' where userID='+quotedstr(trim(fuserID))); + sql.Add(' where userID=' + quotedstr(trim(fuserID))); open; if not IsEmpty then begin - SCSHDataNew(adoqueryTmp,Panel1,2); + SCSHDataNew(adoqueryTmp, Panel1, 2); // userID.Text:=trim(fieldbyname('userID').AsString); // userName.Text:=trim(fieldbyname('userName').AsString); // Udept.Text:=trim(fieldbyname('Udept').AsString); @@ -177,7 +185,7 @@ begin { if trim(fieldbyname('passWord').AsString)<>'' then fPassWord:=trim(DecryptString(trim(fieldbyname('passWord').AsString),keys)) else } - fPassWord:=''; + fPassWord := ''; // newPassword.Text:=trim(fPassWord); // DnewPassword.Text:=trim(fPassWord); end; @@ -191,7 +199,7 @@ end; procedure TfrmUser10.FormCreate(Sender: TObject); begin - Panel1.Align:=alclient; + Panel1.Align := alclient; { with ADO_Cmd do begin close; @@ -203,89 +211,90 @@ begin fIsYGCodezdsc:=fieldbyname('IsYGCodezdsc').AsBoolean; end; end; } - fIsYGCodezdsc:=true; - InTime.Date:=strtodate(formatdateTime('yyyy-MM-dd',DServerDate)); - + fIsYGCodezdsc := true; + InTime.Date := strtodate(formatdateTime('yyyy-MM-dd', DServerDate)); + end; procedure TfrmUser10.cxOKClick(Sender: TObject); begin - if trim(userID.Text)='' then + if trim(userID.Text) = '' then begin - application.MessageBox('ŲΪգ','Ϣ',MB_ICONERROR); + application.MessageBox('ŲΪգ', 'Ϣ', MB_ICONERROR); userName.Text; exit; end; - if trim(userName.Text)='' then + if trim(userName.Text) = '' then begin - application.MessageBox('ƲΪգ','Ϣ',MB_ICONERROR); + application.MessageBox('ƲΪգ', 'Ϣ', MB_ICONERROR); userName.Text; exit; end; - if trim(newPassword.Text)<> trim(dnewPassword.Text) then + if trim(newPassword.Text) <> trim(dnewPassword.Text) then begin - application.MessageBox('벻һ£','Ϣ',MB_ICONERROR); - newPassword.Text:=''; - dnewPassword.Text:=''; + application.MessageBox('벻һ£', 'Ϣ', MB_ICONERROR); + newPassword.Text := ''; + dnewPassword.Text := ''; exit; end; - if formId=0 then + if formId = 0 then + begin + if fIsYGCodezdsc then begin - if fIsYGCodezdsc then - begin - if not GetMaxBh(ADO_Cmd,fuserID,'BD_Staff','YG','0',3) then exit; - end - else - begin - fuserID:=trim(userID.Text); - end; + if not GetMaxBh(ADO_Cmd, fuserID, 'BD_Staff', 'YG', '0', 3) then + exit; + end + else + begin + fuserID := trim(userID.Text); + end; - with ADO_Cmd do + with ADO_Cmd do + begin + close; + sql.Clear; + sql.Add(' select * from BD_Staff'); + sql.Add(' where userID=' + quotedstr(trim(fuserID))); + open; + if not isempty then begin - close; - sql.Clear; - sql.Add(' select * from BD_Staff'); - sql.Add(' where userID='+quotedstr(trim(fuserID))) ; - open; - if not isempty then - begin - application.MessageBox('ظ','Ϣ',MB_ICONERROR); - exit; - end; + application.MessageBox('ظ', 'Ϣ', MB_ICONERROR); + exit; end; end; + end; if SaveData() then begin - application.MessageBox('ݱɹ','ʾϢ'); - ModalResult:=1; + application.MessageBox('ݱɹ', 'ʾϢ'); + ModalResult := 1; end else - application.MessageBox('ݱʧܣ','ʾϢ',MB_ICONERROR); + application.MessageBox('ݱʧܣ', 'ʾϢ', MB_ICONERROR); end; procedure TfrmUser10.userIDKeyPress(Sender: TObject; var Key: Char); begin - Key:=UpCase(Key); - if key=#13 then + Key := UpCase(Key); + if Key = #13 then begin - perform(WM_NEXTDLGCTL,0,0); + perform(WM_NEXTDLGCTL, 0, 0); Key := #0; end; end; procedure TfrmUser10.FormShow(Sender: TObject); begin - if formId=0 then + if formId = 0 then begin if fIsYGCodezdsc then begin - userID.Enabled:=false; - userID.Text:='Զ'; + userID.Enabled := false; + userID.Text := 'Զ'; end; end else begin - userID.Enabled:=false; + userID.Enabled := false; end; DoQuery(); // InitImage(); @@ -293,26 +302,26 @@ end; procedure TfrmUser10.positionBtnUpClick(Sender: TObject); var - fsj:string; - FWZ:Integer; + fsj: string; + FWZ: Integer; begin - fsj:=Trim(TEdit(Sender).Hint); - FWZ:=Pos('/',fsj); + fsj := Trim(TEdit(Sender).Hint); + FWZ := Pos('/', fsj); try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:=Copy(fsj,1,FWZ-1); - flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz); - if Trim(flag)='OrdDefStr2' then + flag := Copy(fsj, 1, FWZ - 1); + flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ); + if Trim(flag) = 'OrdDefStr2' then begin - V1Name.Caption:=''; - V1Note.Caption:='עϢ'; - fnote:=true; + V1Name.Caption := ''; + V1Note.Caption := 'עϢ'; + fnote := true; end; - if ShowModal=1 then + if ShowModal = 1 then begin - TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -323,62 +332,64 @@ end; procedure TfrmUser10.positionBtnDnClick(Sender: TObject); begin - TBtnEditC(Sender).Text:=''; - TBtnEditC(Sender).TxtCode:=''; + TBtnEditC(Sender).Text := ''; + TBtnEditC(Sender).TxtCode := ''; end; procedure TfrmUser10.FileNameClick(Sender: TObject); begin - IF trim(userID.Text)='' then + if trim(userID.Text) = '' then begin - application.MessageBox('ƷŲΪգ','ʾϢ',MB_ICONERROR); + application.MessageBox('ƷŲΪգ', 'ʾϢ', MB_ICONERROR); exit; end; try - FormGetPic := TFormGetPic.Create(Application); + FormGetPic := TFormGetPic.Create(Application); with FormGetPic do begin - fkeyNO:=trim(userID.Text); - pat1:=TCXbutton(Sender).Name; - pic1:=TCXbutton(Sender).Hint; - FTFType:='ԱϢ'; + fkeyNO := trim(userID.Text); + pat1 := TCXbutton(Sender).Name; + pic1 := TCXbutton(Sender).Hint; + FTFType := 'ԱϢ'; // pat1:='PatFile1'; // pic1:='Picture1'; - IF ShowModal = 1 then + if ShowModal = 1 then begin // self.Timage(Tbutton(Sender).Hint).Picture.Assign(FormGetPic.Image2.Picture.Bitmap); - userID.Enabled:=false; + userID.Enabled := false; end; Release; end; // Initimage(); except - if FormGetPic<>nil then FormGetPic.Release; + if FormGetPic <> nil then + FormGetPic.Release; end; end; procedure TfrmUser10.Picture4DblClick(Sender: TObject); var - sFieldName:string; - fileName:string; + sFieldName: string; + fileName: string; begin - IF TcxDBImage(Sender).Picture.Height=0 then exit; + if TcxDBImage(Sender).Picture.Height = 0 then + exit; - sFieldName:=LeftBstr(ExtractFilePath(Application.ExeName),1)+':\ͼƬ鿴'; + sFieldName := LeftBstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ鿴'; if not DirectoryExists(pchar(sFieldName)) then - CreateDirectory(pchar(sFieldName),nil); + CreateDirectory(pchar(sFieldName), nil); - fileName:=adoqueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring; + fileName := adoqueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring; - sFieldName:=sFieldName+'\'+trim(fileName); + sFieldName := sFieldName + '\' + trim(fileName); try IdFTP1.Host := PicSvr; IdFTP1.Username := 'three'; - IdFTP1.Password := '641010'; + IdFTP1.Password := '641010'; IdFTP1.Connect(); except ; @@ -387,7 +398,7 @@ begin if IdFTP1.Connected then begin try - IdFTP1.Get('TP\'+ Trim(fileName), sFieldName,false, true); + IdFTP1.Get('TP\' + Trim(fileName), sFieldName, false, true); except Application.MessageBox('ͻͼļ', 'ʾ', MB_ICONWARNING); IdFTP1.Quit; @@ -400,9 +411,42 @@ begin IdFTP1.Quit; Exit; end; - if IdFTP1.Connected then IdFTP1.Quit; - ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL); + if IdFTP1.Connected then + IdFTP1.Quit; + ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL); end; +procedure TfrmUser10.UdeptBtnDnClick(Sender: TObject); +begin + TBtnEditC(Sender).Text := ''; + TBtnEditC(Sender).TxtCode := ''; +end; + +procedure TfrmUser10.UdeptBtnUpClick(Sender: TObject); +begin + try + frmCPTypeBM := TfrmCPTypeBM.Create(Application); + with frmCPTypeBM do + begin +// flag:=Copy(fsj,1,FWZ-1); +// flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz); +// if Trim(flag)='OrdDefStr2' then +// begin +// V1Name.Caption:=''; +// V1Note.Caption:='עϢ'; +// fnote:=true; +// end; + FState := 'ѡ'; + if ShowModal = 1 then + begin + TEdit(Sender).Text := Trim(ADOQueryTree.fieldbyname('CPName').AsString); + UdeptID.Text := Trim(ADOQueryTree.fieldbyname('CPID').AsString); + end; + end; + finally + frmCPTypeBM.Free; + end; +end; end. + diff --git a/基础数据/U_UserList.pas b/基础数据/U_UserList.pas index 07cbcd7..c004bf7 100644 --- a/基础数据/U_UserList.pas +++ b/基础数据/U_UserList.pas @@ -93,7 +93,7 @@ type Procedure InitUser(); { Private declarations } public - { Public declarations } + { Public declarations } end; var diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm index f7070b8..177bce3 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.dfm @@ -192,6 +192,30 @@ 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' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column4: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'DEFstr2' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column5: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'DEFstr4' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas index f2d54fe..a22ebcd 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputPB.pas @@ -14,19 +14,19 @@ uses IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit, cxTextEdit, cxDropDownEdit, strutils, cxCurrencyEdit, 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; + 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 TfrmZdyAttInputPB = class(TForm) @@ -57,6 +57,10 @@ type v2Mrate: TcxGridDBColumn; v2Column15: TcxGridDBColumn; Tv2Column1: TcxGridDBColumn; + Tv2Column2: TcxGridDBColumn; + Tv2Column3: TcxGridDBColumn; + Tv2Column4: TcxGridDBColumn; + Tv2Column5: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -327,12 +331,12 @@ begin if trim(mvalue) = '' then exit; - - if rightBstr(trim(mvalue), 1) <> '#' then - begin - mvalue := trim(mvalue) + '#'; - end; - + +// if rightBstr(trim(mvalue), 1) <> '#' then +// begin +// mvalue := trim(mvalue) + '#'; +// end; + mvalue := trim(mvalue); with CDS_HZ do begin Edit; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm index 8e71151..08af7ba 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.dfm @@ -338,6 +338,30 @@ 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' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column4: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'DEFstr2' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column5: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'DEFstr4' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas index 16b92b1..1a95e9c 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachPB.pas @@ -85,6 +85,10 @@ type cxButton1: TcxButton; cxButton2: TcxButton; Tv2Column1: TcxGridDBColumn; + Tv2Column2: TcxGridDBColumn; + Tv2Column3: TcxGridDBColumn; + Tv2Column4: TcxGridDBColumn; + Tv2Column5: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -241,8 +245,8 @@ begin if ShowModal=1 then begin TBRafresh.Click; - end; - end; + end; + end; finally frmZdyAttInputPB.Free; end; diff --git a/样品/U_CPManage.pas b/样品/U_CPManage.pas index 34012ea..f17d798 100644 --- a/样品/U_CPManage.pas +++ b/样品/U_CPManage.pas @@ -344,7 +344,7 @@ begin frmCPAdd := TfrmCPAdd.Create(Application); with frmCPAdd do begin - CopyInt := 0; + CopyInt := 0; FCYID := ''; FCPID := Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString); FCPNo := Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString); diff --git a/管理系统/TradeManage.dpr b/管理系统/TradeManage.dpr index 29bc697..8265453 100644 --- a/管理系统/TradeManage.dpr +++ b/管理系统/TradeManage.dpr @@ -2,9 +2,9 @@ library TradeManage; uses SysUtils, - classes, + classes, forms, - WinTypes, + WinTypes, WinProcs, U_DataLink in 'U_DataLink.pas' {DataLink_TradeManage: TDataModule}, U_GetDllForm in 'U_GetDllForm.pas', diff --git a/管理系统/U_CKProductBCPKCHZList.dfm b/管理系统/U_CKProductBCPKCHZList.dfm index 96dba11..99509b5 100644 --- a/管理系统/U_CKProductBCPKCHZList.dfm +++ b/管理系统/U_CKProductBCPKCHZList.dfm @@ -1,6 +1,6 @@ object frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList - Left = -8 - Top = -8 + Left = 389 + Top = 351 Width = 1382 Height = 754 Caption = #25104#21697#24211#23384#27719#24635#21015#34920 @@ -279,11 +279,11 @@ object frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList Left = 0 Top = 77 Width = 1366 - Height = 639 + Height = 638 Align = alClient TabOrder = 2 object Tv1: TcxGridDBTableView - NavigatorButtons.ConfirmDelete = False + Navigator.Buttons.CustomButtons = <> DataController.DataSource = DataSource1 DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = < @@ -319,8 +319,8 @@ object frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList Width = 144 end object v1Column1: TcxGridDBColumn - Caption = #20013#25991#21517#31216 - DataBinding.FieldName = 'C_CodeName_ZW' + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'C_Code' HeaderAlignmentHorz = taCenter Width = 120 end @@ -333,13 +333,13 @@ object frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList end object v1KCRollNum: TcxGridDBColumn Caption = #24211#23384#21305#25968 - DataBinding.FieldName = 'KCRollNum' + DataBinding.FieldName = 'N_Ps' HeaderAlignmentHorz = taCenter Width = 103 end object v2Column6: TcxGridDBColumn Caption = #24211#23384#25968#37327 - DataBinding.FieldName = 'KCQty' + DataBinding.FieldName = 'N_Qty' HeaderAlignmentHorz = taCenter Options.Focusing = False Width = 123 @@ -352,6 +352,12 @@ object frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList Options.Focusing = False Width = 83 end + object Tv1Column1: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'C_COlorNo' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid2Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_CKProductBCPKCHZList.pas b/管理系统/U_CKProductBCPKCHZList.pas index 608e1ab..da85874 100644 --- a/管理系统/U_CKProductBCPKCHZList.pas +++ b/管理系统/U_CKProductBCPKCHZList.pas @@ -4,12 +4,25 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, - cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, - cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView, - cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView, - cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu, - cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, MovePanel; + Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, + cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView, + cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses, + cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls, + ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient, + cxDropDownEdit, MovePanel, 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 TfrmCKProductBCPKCHZList = class(TForm) @@ -58,6 +71,7 @@ type v1Column1: TcxGridDBColumn; C_CodeName_ZW: TEdit; Label11: TLabel; + Tv1Column1: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -79,27 +93,27 @@ var frmCKProductBCPKCHZList: TfrmCKProductBCPKCHZList; implementation + uses - U_DataLink,U_Fun; + U_DataLink, U_Fun; {$R *.dfm} procedure TfrmCKProductBCPKCHZList.FormDestroy(Sender: TObject); begin - frmCKProductBCPKCHZList:=nil; + frmCKProductBCPKCHZList := nil; end; -procedure TfrmCKProductBCPKCHZList.FormClose(Sender: TObject; - var Action: TCloseAction); +procedure TfrmCKProductBCPKCHZList.FormClose(Sender: TObject; var Action: TCloseAction); begin - Action:=caFree; + Action := caFree; end; procedure TfrmCKProductBCPKCHZList.FormCreate(Sender: TObject); begin //cxGrid1.Align:=alClient; - BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp); - EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp) + BegDate.DateTime := SGetServerDateTime(ADOQueryTemp); + EndDate.DateTime := SGetServerDateTime(ADOQueryTemp) end; procedure TfrmCKProductBCPKCHZList.InitGrid(); @@ -108,17 +122,22 @@ begin ADOQueryMain.DisableControls; with ADOQueryMain do begin - Filtered:=False; + Filtered := False; Close; sql.Clear; - sql.Add(' select sum(KCQty) KCQty,Sum(KCKgQty) KCKgQty,Sum(KCRollNum) KCRollNum,C_CodeName,C_Color,KCQtyUnit=''M'', '); - sql.Add(' C_CodeName_ZW=(select Top 1 defnote3 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and X.Type=''CP'') '); - sql.Add(' from CK_BanCP_KC A '); - sql.Add(' where A.KCQty<>0 group by C_CodeName,C_Color'); +// sql.Add(' select sum(KCQty) KCQty,Sum(KCKgQty) KCKgQty,Sum(KCRollNum) KCRollNum,C_CodeName,C_Color,KCQtyUnit=''M'', '); +// sql.Add(' C_CodeName_ZW=(select Top 1 defnote3 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and X.Type=''CP'') '); +// sql.Add(' from CK_BanCP_KC A '); +// sql.Add(' where A.KCQty<>0 group by C_CodeName,C_Color'); + sql.Add('exec P_Get_FabricStock'); + sql.Add('@begdate=''2000-01-01'' '); + sql.Add(',@enddate=''2050-01-01'' '); + sql.Add(',@conType=''Ʒ'''); +// ShowMessage(SQL.text); Open; end; - SCreateCDS20(ADOQueryMain,CDS_Main); - SInitCDSData20(ADOQueryMain,CDS_Main); + SCreateCDS20(ADOQueryMain, CDS_Main); + SInitCDSData20(ADOQueryMain, CDS_Main); finally ADOQueryMain.EnableControls; TBFind.Click; @@ -128,47 +147,48 @@ end; procedure TfrmCKProductBCPKCHZList.TBRafreshClick(Sender: TObject); begin //BegDate.SetFocus; - MovePanel2.Visible:=True; + MovePanel2.Visible := True; MovePanel2.Refresh; InitGrid(); - MovePanel2.Visible:=False; + MovePanel2.Visible := False; end; procedure TfrmCKProductBCPKCHZList.ConNoMChange(Sender: TObject); begin if ADOQueryMain.Active then begin - SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); end; end; procedure TfrmCKProductBCPKCHZList.TBCloseClick(Sender: TObject); begin - WriteCxGrid('ֿб1',Tv1,'Ʒֿ'); + WriteCxGrid('ֿб1', Tv1, 'Ʒֿ'); Close; end; procedure TfrmCKProductBCPKCHZList.FormShow(Sender: TObject); begin - ReadCxGrid('ֿб1',Tv1,'Ʒֿ'); + ReadCxGrid('ֿб1', Tv1, 'Ʒֿ'); //InitGrid(); end; procedure TfrmCKProductBCPKCHZList.TBExportClick(Sender: TObject); begin - if ADOQueryMain.IsEmpty then exit; - TcxGridToExcel('б',cxGrid2); + if ADOQueryMain.IsEmpty then + exit; + TcxGridToExcel('б', cxGrid2); end; procedure TfrmCKProductBCPKCHZList.TBFindClick(Sender: TObject); begin if ADOQueryMain.Active then begin - SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); - SCreateCDS20(ADOQueryMain,CDS_Main); - SInitCDSData20(ADOQueryMain,CDS_Main); + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, CDS_Main); + SInitCDSData20(ADOQueryMain, CDS_Main); end; end; @@ -178,3 +198,4 @@ begin end; end. + diff --git a/管理系统/U_ClothContractInPut_CG.dfm b/管理系统/U_ClothContractInPut_CG.dfm index c7b65ed..fbcf39b 100644 --- a/管理系统/U_ClothContractInPut_CG.dfm +++ b/管理系统/U_ClothContractInPut_CG.dfm @@ -137,7 +137,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG Top = 62 Width = 65 Height = 12 - Caption = #36865#36135#22320#22336#65306 + Caption = #23384#25918#22320#22336#65306 Font.Charset = GB2312_CHARSET Font.Color = clWindowText Font.Height = -12 @@ -191,7 +191,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG Width = 115 Height = 18 Enabled = False - TabOrder = 0 + TabOrder = 1 end object DeliveryDate: TDateTimePicker Left = 85 @@ -203,12 +203,12 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG Format = 'yyyy-MM-dd' Time = 40916.000000000000000000 ShowCheckbox = True - TabOrder = 1 + TabOrder = 2 end object FactoryNoName: TcxButtonEdit Left = 615 Top = 10 - Hint = 'FactoryNo' + Hint = 'FactoryNoName' BeepOnEnter = False Properties.Buttons = < item @@ -218,7 +218,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG Properties.OnButtonClick = FactoryNoNamePropertiesButtonClick Properties.OnChange = FactoryNoNamePropertiesChange Style.BorderStyle = ebsSingle - TabOrder = 2 + TabOrder = 0 OnKeyDown = PRTCodeNameKeyDown Width = 132 end diff --git a/管理系统/U_ClothContractInPut_CG.pas b/管理系统/U_ClothContractInPut_CG.pas index 5c6e3c8..6ae8629 100644 --- a/管理系统/U_ClothContractInPut_CG.pas +++ b/管理系统/U_ClothContractInPut_CG.pas @@ -290,7 +290,7 @@ begin Open; end; QDTime.DateTime := SGetServerDate(ADOTemp); - DeliveryDate.DateTime := SGetServerDate(ADOTemp); + DeliveryDate.DateTime := QDTime.DateTime; QDTime.Checked := True; DeliveryDate.Checked := False; ConNo.Text := 'Զ'; @@ -724,6 +724,9 @@ 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_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.FieldByName('Color').Value:=Trim(CDS_HZ.fieldbyname('DEFstr3').AsString); // Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString); Self.Order_Sub.Post; @@ -903,12 +906,12 @@ begin if trim(mvalue) = '' then exit; - - if rightBstr(trim(mvalue), 1) <> '#' then - begin - mvalue := trim(mvalue) + '#'; - end; - +// +// if rightBstr(trim(mvalue), 1) <> '#' then +// begin +// mvalue := trim(mvalue) + '#'; +// end; + mvalue := trim(mvalue); with Order_Sub do begin Edit; diff --git a/管理系统/U_ClothContractInPut_Tp.dfm b/管理系统/U_ClothContractInPut_Tp.dfm index c5a79e1..3cca6fb 100644 --- a/管理系统/U_ClothContractInPut_Tp.dfm +++ b/管理系统/U_ClothContractInPut_Tp.dfm @@ -418,32 +418,30 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp end object GxNote1: TEdit Left = 86 - Top = 59 + Top = 67 Width = 627 Height = 18 TabOrder = 11 end object OrdPerson1: TBtnEditA - Tag = 2 Left = 572 Top = 34 Width = 137 Height = 20 + Hint = 'OrdPerson1' TabOrder = 12 OnBtnClick = OrdPerson1BtnClick end object CustomerNoName: TBtnEditC - Tag = 2 Left = 786 Top = 9 Width = 140 Height = 20 - Hint = 'CustomerNo' + Hint = 'CustomerNoname' TabOrder = 13 OnBtnUpClick = CustomerNoNameBtnUpClick end object DYer: TBtnEditC - Tag = 2 Left = 786 Top = 34 Width = 140 diff --git a/管理系统/U_ClothContractInPut_Tp.pas b/管理系统/U_ClothContractInPut_Tp.pas index 31c2de8..009e2a2 100644 --- a/管理系统/U_ClothContractInPut_Tp.pas +++ b/管理系统/U_ClothContractInPut_Tp.pas @@ -540,6 +540,57 @@ begin 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 @@ -570,6 +621,11 @@ begin SSetsaveSql(ADOCmd, 'Contract_Main', ScrollBox1, 0); FieldByName('LXPerson').Value := Trim(LXPerson.Text); FieldByName('LXTel').Value := Trim(LXTel.Text); +// FieldByName('FactoryNoName').Value := Trim(FactoryNoName.Text); + FieldByName('CustomerNoName').Value := Trim(CustomerNoName.Text); + FieldByName('DYer').Value := Trim(DYer.Text); + FieldByName('OrdPerson1').Value := Trim(OrdPerson1.Text); + if Trim(fMainID) = '' then begin FieldByName('Filler').Value := Trim(DName); @@ -670,7 +726,7 @@ begin end; if Trim(FactoryNoName.Text) = '' then begin - Application.MessageBox('Ϊգ', 'ʾ', 0); + Application.MessageBox('ӹΪգ', 'ʾ', 0); Exit; end; if Order_Sub.IsEmpty then @@ -890,6 +946,9 @@ begin 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; @@ -1059,11 +1118,11 @@ begin if trim(mvalue) = '' then exit; - if rightBstr(trim(mvalue), 1) <> '#' then - begin - mvalue := trim(mvalue) + '#'; - end; - +// if rightBstr(trim(mvalue), 1) <> '#' then +// begin +// mvalue := trim(mvalue) + '#'; +// end; + mvalue := trim(mvalue); with Order_Sub do begin Edit; @@ -1287,7 +1346,7 @@ begin if ShowModal = 1 then begin CustomerNoName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); - CustomerNoName.TxtCode := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); +// CustomerNoName.TxtCode := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); end; end; finally diff --git a/管理系统/U_ClothContractList.dfm b/管理系统/U_ClothContractList.dfm index c838eec..607360e 100644 --- a/管理系统/U_ClothContractList.dfm +++ b/管理系统/U_ClothContractList.dfm @@ -1,6 +1,6 @@ object frmClothContractList: TfrmClothContractList - Left = 173 - Top = 94 + Left = 309 + Top = 284 Width = 1222 Height = 738 Caption = #22383#24067#21040#36135#20449#24687 @@ -340,11 +340,9 @@ object frmClothContractList: TfrmClothContractList end item Kind = skSum - Column = v1Column12 end item Kind = skSum - Column = v1Column13 end item Kind = skSum @@ -356,23 +354,18 @@ object frmClothContractList: TfrmClothContractList end item Kind = skSum - Column = v1Column11 end item Kind = skSum - Column = v1Column9 end item Kind = skSum - Column = v1T_money end item Kind = skSum - Column = v1Column22 end item Kind = skSum - Column = v1Column23 end> DataController.Summary.SummaryGroups = <> OptionsCustomize.ColumnFiltering = False @@ -527,26 +520,6 @@ object frmClothContractList: TfrmClothContractList Styles.Header = DataLink_TradeManage.Default Width = 63 end - object v1Column11: TcxGridDBColumn - Caption = #36864#36135#21305#25968 - DataBinding.FieldName = 'T_Ps' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Width = 60 - end - object v1Column9: TcxGridDBColumn - Caption = #36864#36135#25968#37327 - DataBinding.FieldName = 'T_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Width = 60 - end - object v1T_money: TcxGridDBColumn - Caption = #36864#36135#37329#39069 - DataBinding.FieldName = 'T_money' - Options.Editing = False - Width = 60 - end object v1Column7: TcxGridDBColumn Caption = #21040#36135#22320#28857 DataBinding.FieldName = 'JHPlace' @@ -555,26 +528,6 @@ object frmClothContractList: TfrmClothContractList Styles.Header = DataLink_TradeManage.Default Width = 101 end - object v1Column12: TcxGridDBColumn - Caption = #22238#20179#21305#25968 - DataBinding.FieldName = 'H_PS' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclPurple - Styles.Footer = cxStyle_fontclPurple - Styles.Header = cxStyle_fontclPurple - Width = 60 - end - object v1Column13: TcxGridDBColumn - Caption = #22238#20179#25968#37327 - DataBinding.FieldName = 'H_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclPurple - Styles.Footer = cxStyle_fontclPurple - Styles.Header = cxStyle_fontclPurple - Width = 60 - end object v1Column16: TcxGridDBColumn Caption = #24211#23384#21305#25968 DataBinding.FieldName = 'N_Ps' @@ -595,45 +548,6 @@ object frmClothContractList: TfrmClothContractList Styles.Header = cxStyle_fontclFuchsia Width = 60 end - object v1Column15: TcxGridDBColumn - Caption = #35745#21010#32553#29575'(%)' - DataBinding.FieldName = 'Mrate' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Width = 80 - end - object v1Column14: TcxGridDBColumn - Caption = #23454#38469#32553#29575'(%)' - DataBinding.FieldName = 'Srate' - PropertiesClassName = 'TcxCurrencyEditProperties' - Properties.DisplayFormat = ',0.##%;-,0.##' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclGreen - Styles.Footer = cxStyle_fontclGreen - Styles.Header = cxStyle_fontclGreen - Width = 80 - end - object v1Column22: TcxGridDBColumn - Caption = #26816#39564#21305#25968 - DataBinding.FieldName = 'J_PS' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclTeal - Styles.Footer = cxStyle_fontclTeal - Styles.Header = cxStyle_fontclTeal - Width = 60 - end - object v1Column23: TcxGridDBColumn - Caption = #26816#39564#25968#37327 - DataBinding.FieldName = 'J_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclTeal - Styles.Footer = cxStyle_fontclTeal - Styles.Header = cxStyle_fontclTeal - Width = 60 - end object v1Column18: TcxGridDBColumn Caption = #21046#21333#20154 DataBinding.FieldName = 'Filler' diff --git a/管理系统/U_ClothContractList.pas b/管理系统/U_ClothContractList.pas index 69f09f6..0d7a135 100644 --- a/管理系统/U_ClothContractList.pas +++ b/管理系统/U_ClothContractList.pas @@ -86,9 +86,6 @@ type Label6: TLabel; FactoryNoName: TEdit; v1Column8: TcxGridDBColumn; - v1Column9: TcxGridDBColumn; - v1T_money: TcxGridDBColumn; - v1Column11: TcxGridDBColumn; cxStyleRepository1: TcxStyleRepository; cxStyle1: TcxStyle; cxStyle2: TcxStyle; @@ -110,20 +107,14 @@ type cxTabControl1: TcxTabControl; tchk: TToolButton; Tnochk: TToolButton; - v1Column12: TcxGridDBColumn; - v1Column13: TcxGridDBColumn; v1Column16: TcxGridDBColumn; v1Column17: TcxGridDBColumn; - v1Column14: TcxGridDBColumn; - v1Column15: TcxGridDBColumn; Label7: TLabel; JHPlace: TEdit; v1Column18: TcxGridDBColumn; v1Column19: TcxGridDBColumn; v1Column20: TcxGridDBColumn; v1Column21: TcxGridDBColumn; - v1Column22: TcxGridDBColumn; - v1Column23: TcxGridDBColumn; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); @@ -242,8 +233,8 @@ begin v1Price.Hidden := true; v1money.Visible := false; v1money.Hidden := true; - v1T_money.Visible := false; - v1T_money.Hidden := true; +// v1T_money.Visible := false; +// v1T_money.Hidden := true; ToolButton1.Visible := false; end; @@ -942,26 +933,26 @@ 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; +// 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.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; +// 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.cxTabControl1Change(Sender: TObject); diff --git a/管理系统/U_ClothContractList_CG.dfm b/管理系统/U_ClothContractList_CG.dfm index aedb86f..0866878 100644 --- a/管理系统/U_ClothContractList_CG.dfm +++ b/管理系统/U_ClothContractList_CG.dfm @@ -1,6 +1,6 @@ object frmClothContractList_CG: TfrmClothContractList_CG - Left = 94 - Top = 29 + Left = 269 + Top = 396 Width = 1217 Height = 738 Caption = #22383#24067#37319#36141#35745#21010#20449#24687 @@ -463,7 +463,7 @@ object frmClothContractList_CG: TfrmClothContractList_CG Width = 63 end object v1Column7: TcxGridDBColumn - Caption = #36865#36135#22320#22336 + Caption = #23384#25918#22320#28857 DataBinding.FieldName = 'QDPalce' HeaderAlignmentHorz = taCenter Options.Editing = False diff --git a/管理系统/U_ClothContractList_CK.dfm b/管理系统/U_ClothContractList_CK.dfm new file mode 100644 index 0000000..5f69a3d --- /dev/null +++ b/管理系统/U_ClothContractList_CK.dfm @@ -0,0 +1,846 @@ +object frmClothContractList_CK: TfrmClothContractList_CK + 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 + 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 + OnClick = TBDelClick + end + object tchk: TToolButton + Left = 315 + Top = 0 + AutoSize = True + Caption = #30830#35748#23436#25104 + ImageIndex = 41 + OnClick = tchkClick + end + object Tnochk: TToolButton + Left = 402 + Top = 0 + AutoSize = True + Caption = #25764#38144#23436#25104 + Enabled = False + ImageIndex = 56 + OnClick = TnochkClick + end + object Tth: TToolButton + Left = 489 + Top = 0 + AutoSize = True + Caption = #36864#36135 + ImageIndex = 129 + 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 + 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 + Column = v1Price + end + item + Kind = skSum + Column = v1Money + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Column16 + end + item + Kind = skSum + Column = v1Column17 + 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 = 'MFQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + 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 = 'C_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 v1Price: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 57 + end + object v1Money: TcxGridDBColumn + Caption = #24635#20215 + DataBinding.FieldName = 'Money' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 58 + 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 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' + 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 + 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.pas b/管理系统/U_ClothContractList_CK.pas new file mode 100644 index 0000000..7052ef7 --- /dev/null +++ b/管理系统/U_ClothContractList_CK.pas @@ -0,0 +1,964 @@ +unit U_ClothContractList_CK; + +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 = 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; + v1Price: TcxGridDBColumn; + v1Money: 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; + v1Column16: TcxGridDBColumn; + v1Column17: TcxGridDBColumn; + 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: TfrmClothContractList_CK; + +implementation + +uses + U_DataLink, U_ClothContractOutPut, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractList_CK.FormDestroy(Sender: TObject); +begin + frmClothContractList_CK := nil; +end; + +procedure TfrmClothContractList_CK.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractList_CK.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractList_CK.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractList_CK.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.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.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.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.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.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.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); +end; + +procedure TfrmClothContractList_CK.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.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractList_CK.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.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.FormShow(Sender: TObject); +begin + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + initForm(); + +end; + +procedure TfrmClothContractList_CK.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractList_CK.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractList_CK.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.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.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.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.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.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractList_CK.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.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.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.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.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.cxTabControl1Change(Sender: TObject); +begin + initForm(); +end; + +end. + diff --git a/管理系统/U_ClothContractList_DY.dfm b/管理系统/U_ClothContractList_DY.dfm index 75d84ca..2fb4d6b 100644 --- a/管理系统/U_ClothContractList_DY.dfm +++ b/管理系统/U_ClothContractList_DY.dfm @@ -565,6 +565,18 @@ object frmClothContractList_DY: TfrmClothContractList_DY HeaderAlignmentHorz = taCenter Width = 60 end + object Tv1Column2: TcxGridDBColumn + Caption = #25171#26679#20154 + DataBinding.FieldName = 'DYer' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column3: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustomerNoname' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractList_DY.pas b/管理系统/U_ClothContractList_DY.pas index 9bcc8ab..0c05043 100644 --- a/管理系统/U_ClothContractList_DY.pas +++ b/管理系统/U_ClothContractList_DY.pas @@ -115,6 +115,8 @@ type TJj: TToolButton; TnoJj: TToolButton; Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -202,12 +204,12 @@ begin Filtered := False; Close; sql.Clear; - sql.Add('exec P_Get_Contract_TG'); + 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= '''+TconType+''' '); - sql.Add(',@status=''' + strwhere + ''' '); -// ShowMessage(sql.text); + sql.Add(',@conType=''ƻ'' '); + sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' '); + // ShowMessage(sql.text); Open; end; SCreateCDS20(ADOQueryMain, Order_Main); diff --git a/管理系统/U_ClothContractList_JG.dfm b/管理系统/U_ClothContractList_JG.dfm index 64fd781..006b620 100644 --- a/管理系统/U_ClothContractList_JG.dfm +++ b/管理系统/U_ClothContractList_JG.dfm @@ -1,6 +1,6 @@ object frmClothContractList_JG: TfrmClothContractList_JG - Left = 129 - Top = 62 + Left = 353 + Top = 299 Width = 1221 Height = 738 Caption = #25104#21697#21518#21152#24037 diff --git a/管理系统/U_ClothContractList_JG.pas b/管理系统/U_ClothContractList_JG.pas index 63dbef3..e4e0da8 100644 --- a/管理系统/U_ClothContractList_JG.pas +++ b/管理系统/U_ClothContractList_JG.pas @@ -169,7 +169,7 @@ begin with ADOQueryMain do begin Filtered := False; - Close; + Close; sql.Clear; sql.Add('select *,Gf=(select factoryNoName from Contract_Main X where X.mainID=B.frommainID), '); sql.Add('fdhNO=(select conNo from Contract_Main X where X.mainID=B.frommainID) '); @@ -217,6 +217,8 @@ begin begin PState := 1; FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + FConType := Trim(Self.Order_Main.fieldbyname('ConType').AsString); + caption := 'ӹ'; if ShowModal = 1 then begin TBRafresh.Click; @@ -349,6 +351,7 @@ begin PState := 0; FMainId := ''; FConType := 'Ʒӹ'; + caption := 'ӹ'; if ShowModal = 1 then begin TBRafresh.Click; @@ -564,11 +567,11 @@ begin begin // TBEdit.Visible:=true; TBDel.Visible := true; - Tchk.Visible:=true; + Tchk.Visible := true; end; if cxTabControl1.TabIndex = 1 then begin - TNochk.Visible:=true; + TNochk.Visible := true; end; InitGrid(); end; diff --git a/管理系统/U_ClothContractList_TP.dfm b/管理系统/U_ClothContractList_TP.dfm index c6f5591..981c6b0 100644 --- a/管理系统/U_ClothContractList_TP.dfm +++ b/管理系统/U_ClothContractList_TP.dfm @@ -565,6 +565,12 @@ object frmClothContractList_Tp: TfrmClothContractList_Tp 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 diff --git a/管理系统/U_ClothContractList_TP.pas b/管理系统/U_ClothContractList_TP.pas index cfc71a6..912f32c 100644 --- a/管理系统/U_ClothContractList_TP.pas +++ b/管理系统/U_ClothContractList_TP.pas @@ -115,6 +115,7 @@ type TJj: TToolButton; TnoJj: TToolButton; Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -198,7 +199,7 @@ begin try ADOQueryMain.DisableControls; with ADOQueryMain do - begin + begin Filtered := False; Close; sql.Clear; diff --git a/管理系统/U_ClothContractList_XPKF.pas b/管理系统/U_ClothContractList_XPKF.pas index da4941c..458318a 100644 --- a/管理系统/U_ClothContractList_XPKF.pas +++ b/管理系统/U_ClothContractList_XPKF.pas @@ -201,12 +201,13 @@ begin begin Filtered := False; Close; - sql.Clear; - 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 + ''' '); + 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); Open; end; diff --git a/管理系统/U_ClothContractList_help.dfm b/管理系统/U_ClothContractList_help.dfm index 9f9a0ac..586ebfa 100644 --- a/管理系统/U_ClothContractList_help.dfm +++ b/管理系统/U_ClothContractList_help.dfm @@ -1,6 +1,6 @@ object frmClothContractList_Help: TfrmClothContractList_Help - Left = 35 - Top = 105 + Left = 408 + Top = 340 Width = 1221 Height = 738 Caption = #36873#25321#22383#24067#21040#36135#20449#24687 @@ -100,7 +100,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help Color = clSkyBlue TabOrder = 1 object Label1: TLabel - Left = 23 + Left = 37 Top = 22 Width = 52 Height = 12 @@ -113,14 +113,14 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object Label2: TLabel - Left = 161 + Left = 175 Top = 22 Width = 6 Height = 12 Caption = '-' end object Label3: TLabel - Left = 271 + Left = 285 Top = 22 Width = 52 Height = 12 @@ -133,7 +133,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object Label5: TLabel - Left = 420 + Left = 434 Top = 22 Width = 52 Height = 12 @@ -146,7 +146,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object Label4: TLabel - Left = 572 + Left = 586 Top = 22 Width = 26 Height = 12 @@ -159,7 +159,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object Label6: TLabel - Left = 704 + Left = 718 Top = 22 Width = 26 Height = 12 @@ -172,7 +172,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object Label7: TLabel - Left = 832 + Left = 846 Top = 22 Width = 39 Height = 12 @@ -185,7 +185,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help ParentFont = False end object BegDate: TDateTimePicker - Left = 76 + Left = 90 Top = 18 Width = 85 Height = 20 @@ -195,7 +195,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help TabOrder = 0 end object EndDate: TDateTimePicker - Left = 167 + Left = 181 Top = 18 Width = 86 Height = 20 @@ -206,7 +206,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help end object ConNo: TEdit Tag = 2 - Left = 329 + Left = 343 Top = 18 Width = 81 Height = 20 @@ -215,7 +215,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help end object C_CodeName: TEdit Tag = 2 - Left = 473 + Left = 487 Top = 18 Width = 83 Height = 20 @@ -224,7 +224,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help end object C_Spec: TEdit Tag = 2 - Left = 600 + Left = 614 Top = 18 Width = 83 Height = 20 @@ -233,7 +233,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help end object FactoryNoName: TEdit Tag = 2 - Left = 732 + Left = 746 Top = 18 Width = 80 Height = 20 @@ -242,13 +242,26 @@ object frmClothContractList_Help: TfrmClothContractList_Help end object JHPlace: TEdit Tag = 2 - Left = 868 + Left = 882 Top = 18 Width = 80 Height = 20 TabOrder = 6 OnChange = ConNoChange end + object CheckBox2: TCheckBox + Left = 17 + Top = 18 + Width = 20 + Height = 17 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 7 + end end object ScrollBox1: TScrollBox Left = 0 @@ -283,14 +296,12 @@ object frmClothContractList_Help: TfrmClothContractList_Help end item Kind = skSum - Column = v1Column20 end item Kind = skCount end item Kind = skSum - Column = v1Column9 end item Kind = skSum @@ -329,11 +340,9 @@ object frmClothContractList_Help: TfrmClothContractList_Help end item Kind = skSum - Column = v1Column17 end item Kind = skSum - Column = v1Column16 end> DataController.Summary.SummaryGroups = <> OptionsCustomize.ColumnFiltering = False @@ -429,21 +438,8 @@ object frmClothContractList_Help: TfrmClothContractList_Help Styles.Header = DataLink_TradeManage.Default Width = 47 end - object v1Column20: TcxGridDBColumn - Caption = #36864#36135#21305#25968 - DataBinding.FieldName = 'T_Ps' - HeaderAlignmentHorz = taCenter - Width = 60 - end - object v1Column9: TcxGridDBColumn - Caption = #36864#36135#25968#37327 - DataBinding.FieldName = 'T_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Width = 60 - end object v1Column13: TcxGridDBColumn - Caption = #22238#20179#21305#25968 + Caption = #20986#24211#21305#25968 DataBinding.FieldName = 'H_PS' HeaderAlignmentHorz = taCenter Options.Editing = False @@ -454,7 +450,7 @@ object frmClothContractList_Help: TfrmClothContractList_Help Width = 60 end object v1Column12: TcxGridDBColumn - Caption = #22238#20179#25968#37327 + Caption = #20986#24211#25968#37327 DataBinding.FieldName = 'H_Qty' HeaderAlignmentHorz = taCenter Options.Editing = False @@ -482,45 +478,6 @@ object frmClothContractList_Help: TfrmClothContractList_Help Styles.Header = cxStyle_fontclFuchsia Width = 60 end - object v1Column11: TcxGridDBColumn - Caption = #23454#38469#32553#29575'(%)' - DataBinding.FieldName = 'Srate' - PropertiesClassName = 'TcxCurrencyEditProperties' - Properties.DisplayFormat = '0.##%;-,0.##%' - HeaderAlignmentHorz = taCenter - Styles.Content = cxStyle_fontclGreen - Styles.Footer = cxStyle_fontclGreen - Styles.Header = cxStyle_fontclGreen - Width = 80 - end - object v1Column14: TcxGridDBColumn - Caption = #35745#21010#32553#29575'(%)' - DataBinding.FieldName = 'Mrate' - PropertiesClassName = 'TcxCurrencyEditProperties' - Properties.DisplayFormat = '0.##%;-,0.##%' - HeaderAlignmentHorz = taCenter - Width = 80 - end - object v1Column17: TcxGridDBColumn - Caption = #26816#39564#21305#25968 - DataBinding.FieldName = 'J_PS' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclTeal - Styles.Footer = cxStyle_fontclTeal - Styles.Header = cxStyle_fontclTeal - Width = 60 - end - object v1Column16: TcxGridDBColumn - Caption = #26816#39564#25968#37327 - DataBinding.FieldName = 'J_Qty' - HeaderAlignmentHorz = taCenter - Options.Editing = False - Styles.Content = cxStyle_fontclTeal - Styles.Footer = cxStyle_fontclTeal - Styles.Header = cxStyle_fontclTeal - Width = 60 - end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractList_help.pas b/管理系统/U_ClothContractList_help.pas index cff6ae1..b1e6e42 100644 --- a/管理系统/U_ClothContractList_help.pas +++ b/管理系统/U_ClothContractList_help.pas @@ -6,12 +6,24 @@ 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, cxCheckBox, cxCurrencyEdit, cxLookAndFeels, - cxLookAndFeelPainters, cxNavigator; + 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, cxCheckBox, + cxCurrencyEdit, 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 TfrmClothContractList_Help = class(TForm) @@ -59,7 +71,6 @@ type Label6: TLabel; FactoryNoName: TEdit; v1Column8: TcxGridDBColumn; - v1Column9: TcxGridDBColumn; v1Ssel: TcxGridDBColumn; v1Column12: TcxGridDBColumn; v1Column13: TcxGridDBColumn; @@ -81,16 +92,12 @@ type cxStyle_fontclOlive: TcxStyle; v1Column18: TcxGridDBColumn; v1Column19: TcxGridDBColumn; - v1Column20: TcxGridDBColumn; - v1Column11: TcxGridDBColumn; - v1Column14: TcxGridDBColumn; v1Column15: TcxGridDBColumn; Label7: TLabel; JHPlace: TEdit; - v1Column16: TcxGridDBColumn; - v1Column17: TcxGridDBColumn; Order_Main: TClientDataSet; ToolButton1: TToolButton; + CheckBox2: TCheckBox; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -102,18 +109,15 @@ type procedure TBRafreshClick(Sender: TObject); procedure ConNoChange(Sender: TObject); procedure FormShow(Sender: TObject); - procedure v2Column3PropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure conPress(Sender: TObject; var Key: Char); procedure ToolButton1Click(Sender: TObject); - procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; - ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; - var ADone: Boolean); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); private - FInt,PFInt:Integer; + FInt, PFInt: Integer; procedure InitGrid(); procedure InitForm(); - function DelData():Boolean; + function DelData(): Boolean; { Private declarations } public { Public declarations } @@ -123,31 +127,31 @@ var frmClothContractList_Help: TfrmClothContractList_Help; implementation + uses - U_DataLink,U_ClothContractInPut,U_Fun,U_ProductOrderList,U_ZDYHelp; + U_DataLink, U_ClothContractInPut, U_Fun, U_ProductOrderList, U_ZDYHelp; {$R *.dfm} procedure TfrmClothContractList_Help.FormDestroy(Sender: TObject); begin - frmClothContractList_Help:=nil; + frmClothContractList_Help := nil; end; -procedure TfrmClothContractList_Help.FormClose(Sender: TObject; - var Action: TCloseAction); +procedure TfrmClothContractList_Help.FormClose(Sender: TObject; var Action: TCloseAction); begin - Action:=caFree; + Action := caFree; end; procedure TfrmClothContractList_Help.FormCreate(Sender: TObject); begin - ScrollBox1.Align:=alClient; + ScrollBox1.Align := alClient; end; procedure TfrmClothContractList_Help.TBCloseClick(Sender: TObject); begin Close; - WriteCxGrid(self.Caption,Tv1,'ָʾ'); + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); end; procedure TfrmClothContractList_Help.InitGrid(); @@ -158,16 +162,26 @@ begin begin Close; sql.Clear; - Filtered:=False; + Filtered := False; 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))+''' '); + if CheckBox2.Checked = True then + begin + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); + end + else + begin + sql.Add('@begdate=''2000-01-01'' '); + sql.Add(',@enddate=''2050-01-01'' '); + 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(',@status=''' + inttostr(0) + ''' '); Open; end; - SCreateCDS20(ADOQueryMain,Order_Main); - SInitCDSData20(ADOQueryMain,Order_Main); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); finally ADOQueryMain.EnableControls; end; @@ -175,30 +189,32 @@ end; procedure TfrmClothContractList_Help.InitForm(); begin - ReadCxGrid(self.Caption,Tv1,'ָʾ'); - BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7; - EndDate.DateTime:=SGetServerDate10(ADOQueryTemp); + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7; + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); InitGrid(); end; procedure TfrmClothContractList_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); + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); end; procedure TfrmClothContractList_Help.TBEditClick(Sender: TObject); begin - if Order_Main.IsEmpty then Exit; + if Order_Main.IsEmpty then + Exit; try - frmClothContractInPut:=TfrmClothContractInPut.Create(Application); + frmClothContractInPut := TfrmClothContractInPut.Create(Application); with frmClothContractInPut do begin - PState:=1; - FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString); - if ShowModal=1 then + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then begin end; @@ -208,39 +224,39 @@ begin end; end; -function TfrmClothContractList_Help.DelData():Boolean; +function TfrmClothContractList_Help.DelData(): Boolean; begin end; procedure TfrmClothContractList_Help.TBExportClick(Sender: TObject); begin - if ADOQueryMain.IsEmpty then Exit; - TcxGridToExcel('ͬб',cxGrid1); + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ͬб', cxGrid1); end; procedure TfrmClothContractList_Help.TBPrintClick(Sender: TObject); var - fPrintFile,FConNoM:string; - + fPrintFile, FConNoM: string; begin - if Order_Main.IsEmpty then Exit; - fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\ͬ.rmf' ; + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͬ.rmf'; with ADOQueryTemp do begin - Filtered:=False; + Filtered := False; Close; sql.Clear; sql.Add('exec ClothContract_QryList :MainId,:WSql'); - Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''' - +' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+''''; - Parameters.ParamByName('MainId').Value:=Trim(Order_Main.fieldbyname('MainId').AsString); - Parameters.ParamByName('WSql').Value:=''; + Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + ''''; + Parameters.ParamByName('MainId').Value := Trim(Order_Main.fieldbyname('MainId').AsString); + Parameters.ParamByName('WSql').Value := ''; Open; end; - SCreateCDS20(ADOQueryTemp,CDS_PRT); - SInitCDSData20(ADOQueryTemp,CDS_PRT); - FConNoM:=Trim(CDS_PRT.fieldbyname('ConNoM').AsString); + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + FConNoM := Trim(CDS_PRT.fieldbyname('ConNoM').AsString); //SDofilter(ADOQueryMain,' ConNoM='''+Trim(Order_Main.fieldbyname('ConNoM').AsString)+''''); //SCreateCDS20(ADOQueryMain,Order_Main); //SInitCDSData20(ADOQueryMain,Order_Main); @@ -252,24 +268,26 @@ begin //RMVariables['printer']:=Trim(gUserName); RM1.LoadFromFile(fPrintFile); RM1.ShowReport; - end else + end + else begin - Application.MessageBox(PChar('û'+ExtractFilePath(Application.ExeName)+'Report\ͬ.rmf'),'ʾ',0); + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\ͬ.rmf'), 'ʾ', 0); end; end; procedure TfrmClothContractList_Help.TBRafreshClick(Sender: TObject); begin - InitGrid(); + InitGrid(); end; procedure TfrmClothContractList_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); + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); end; procedure TfrmClothContractList_Help.FormShow(Sender: TObject); @@ -277,21 +295,20 @@ begin InitForm(); end; -procedure TfrmClothContractList_Help.v2Column3PropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractList_Help.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='RKPlace'; - flagname:='ص'; - if ShowModal=1 then + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then begin with ClientDataSet2 do begin Edit; - FieldByName('RKPlace').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; end; @@ -300,25 +317,25 @@ begin end; end; -procedure TfrmClothContractList_Help.conPress(Sender: TObject; - var Key: Char); +procedure TfrmClothContractList_Help.conPress(Sender: TObject; var Key: Char); begin - if Key=#13 then + if Key = #13 then begin - if Length(Trim(ConNo.Text))<4 then Exit; + if Length(Trim(ConNo.Text)) < 4 then + Exit; try ADOQueryMain.DisableControls; with ADOQueryMain do begin - Filtered:=False; + Filtered := False; Close; sql.Clear; sql.Add('exec ClothContract_QryList :MainId,:WSql'); - Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNo.Text)+'%'+''''; + Parameters.ParamByName('WSql').Value := ' and OM.conNo like ''' + '%' + Trim(ConNo.Text) + '%' + ''''; Open; end; - SCreateCDS20(ADOQueryMain,Order_Main); - SInitCDSData20(ADOQueryMain,Order_Main); + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); finally ADOQueryMain.EnableControls; end; @@ -327,29 +344,29 @@ end; procedure TfrmClothContractList_Help.ToolButton1Click(Sender: TObject); begin - IF Order_Main.IsEmpty then exit; - ModalResult:=1; + if Order_Main.IsEmpty then + exit; + ModalResult := 1; end; -procedure TfrmClothContractList_Help.Tv1CustomDrawIndicatorCell( - Sender: TcxGridTableView; ACanvas: TcxCanvas; - AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +procedure TfrmClothContractList_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; + 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; end. + diff --git a/管理系统/U_ClothContractOutPut.dfm b/管理系统/U_ClothContractOutPut.dfm new file mode 100644 index 0000000..6ed0fe7 --- /dev/null +++ b/管理系统/U_ClothContractOutPut.dfm @@ -0,0 +1,618 @@ +object frmClothContractOutPut: TfrmClothContractOutPut + Left = 404 + Top = 253 + Width = 1046 + Height = 541 + Caption = #22383#24067#20986#24211 + 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 = 96 + 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 = #21040#36135#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 = 38 + 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 + 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 = 38 + 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 + 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 = 548 + Top = 38 + Width = 66 + Height = 12 + Caption = #32852' '#31995' '#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 = 62 + 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 + end + object Label9: TLabel + Left = 20 + Top = 62 + 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 + end + object Label10: TLabel + Left = 546 + 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 + end + object ConNo: TEdit + Left = 86 + Top = 11 + Width = 137 + Height = 18 + 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 = 353 + Top = 34 + 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 + 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 = 34 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = CompanyNamePropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 5 + Width = 136 + end + object QDPalce: TEdit + Left = 311 + Top = 271 + Width = 131 + Height = 18 + TabOrder = 6 + Visible = False + end + object LXPerson: TEdit + Left = 611 + Top = 35 + Width = 134 + Height = 18 + TabOrder = 7 + end + object LXTel: TEdit + Left = 85 + Top = 59 + Width = 136 + Height = 18 + TabOrder = 8 + end + object JHPlace: TcxButtonEdit + Left = 353 + Top = 58 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = JHPlacePropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 9 + Width = 392 + end + object fromConNo: TcxButtonEdit + Left = 633 + Top = 10 + BeepOnEnter = False + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = fromConNoPropertiesButtonClick + Style.BorderStyle = ebsSingle + TabOrder = 10 + OnKeyPress = fromConNoKeyPress + Width = 116 + end + end + object ToolBar2: TToolBar + Left = 0 + Top = 125 + 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 = 154 + 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 v1Column5: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 54 + 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 + 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' + HeaderAlignmentHorz = taCenter + Styles.Header = DataLink_TradeManage.Default + Width = 177 + end + object Tv1Column1: TcxGridDBColumn + Caption = #25104#21697#21697#21517 + DataBinding.FieldName = 'CP_CodeName' + HeaderAlignmentHorz = taCenter + Width = 118 + 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 +end diff --git a/管理系统/U_ClothContractOutPut.pas b/管理系统/U_ClothContractOutPut.pas new file mode 100644 index 0000000..cd21ff1 --- /dev/null +++ b/管理系统/U_ClothContractOutPut.pas @@ -0,0 +1,1135 @@ +unit U_ClothContractOutPut; + +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 + TfrmClothContractOutPut = 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; + Label7: TLabel; + Label8: TLabel; + Label9: TLabel; + LXPerson: 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; + Tv1Column1: 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; + function YFData(fMainID, FsubID: string): Boolean; + procedure DoQuery(fkeyNo: string); + procedure DoKc(); + { Private declarations } + public + PState: Integer; + FMainId: string; + + { Public declarations } + end; + +var + frmClothContractOutPut: TfrmClothContractOutPut; + +implementation + +uses + U_DataLink, U_ZDYHelp, U_Fun, U_ZdyAttachGYS, U_ClothContractList_CG_help, + U_ZdyAttachCP; + +{$R *.dfm} +procedure TfrmClothContractOutPut.DoKc(); +begin +// Label11.Caption := 'ۣ0'; + 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; + if not ADOTemp.IsEmpty then + begin +// Label11.Caption := 'ۣ' + trim(ADOTemp.fieldbyname('price').AsString); + end; +end; + +procedure TfrmClothContractOutPut.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; + +function TfrmClothContractOutPut.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').AsFloat; + FieldByName('PS').Value := Order_Sub.fieldbyname('Qty1').AsFloat; + FieldByName('T_Ps').Value := Order_Sub.fieldbyname('T_Ps').AsFloat; + FieldByName('T_Qty').Value := Order_Sub.fieldbyname('T_Qty').AsFloat; + FieldByName('YFType').Value := 'Զ'; + FieldByName('Price').Value := Order_Sub.fieldbyname('Price').asfloat; + FieldByName('T_Price').Value := Order_Sub.fieldbyname('T_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); + FieldByName('P_CodeName').Value := Trim(Order_Sub.fieldbyname('C_CodeName').AsString); + FieldByName('P_Color').Value := Trim(Order_Sub.fieldbyname('C_color').AsString); + Post; + end; + + with ADOCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty,T_money=T_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 TfrmClothContractOutPut.TBCloseClick(Sender: TObject); +begin + Close; +end; + +procedure TfrmClothContractOutPut.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); + 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); + DeliveryDate.DateTime := SGetServerDate(ADOTemp); + QDTime.Checked := True; + DeliveryDate.Checked := False; + // ConNo.Text:='Զ'; + //CompanyName.Text:='¡֯'; + end; + PanZDY.Visible := False; +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.Button1Click(Sender: TObject); +begin + PanZDY.Visible := False; +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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, '', '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, 0); +// FieldByName('conno').Value := Trim(LXPerson.Text); + FieldByName('LXPerson').Value := Trim(LXPerson.Text); + FieldByName('LXTel').Value := Trim(LXTel.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('status').Value := '0'; + FieldByName('fromconNo').Value := null; + FieldByName('fromMainID').Value := Trim(fromConNo.Hint); + FieldByName('fromConNO').Value := Trim(fromConNo.text); + 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('mrate').Value := Trim(Order_Sub.fieldbyname('mrate').AsString); + FieldByName('C_status').Value := '0'; + FieldByName('MFQty').Value := Order_Sub.fieldbyname('MFQty').AsFloat; + FieldByName('KZQty').Value := Order_Sub.fieldbyname('KZQty').AsFloat; + FieldByName('C_Qty').Value := Order_Sub.fieldbyname('C_Qty').AsFloat; + FieldByName('Qty1').Value := Order_Sub.fieldbyname('Qty1').AsFloat; + FieldByName('Qty2').Value := Order_Sub.fieldbyname('Qty2').AsFloat; + FieldByName('Qty3').Value := Order_Sub.fieldbyname('Qty3').AsFloat; + FieldByName('Price').Value := Order_Sub.fieldbyname('Price').AsFloat; + FieldByName('money').Value := Order_Sub.fieldbyname('money').AsFloat; + FieldByName('T_ps').Value := Order_Sub.fieldbyname('T_ps').AsFloat; + FieldByName('T_Qty').Value := Order_Sub.fieldbyname('T_Qty').AsFloat; + FieldByName('T_Price').Value := Order_Sub.fieldbyname('T_Price').AsFloat; + FieldByName('T_money').Value := Order_Sub.fieldbyname('T_money').AsFloat; + FieldByName('H_ps').Value := Order_Sub.fieldbyname('H_ps').AsFloat; + FieldByName('H_Qty').Value := Order_Sub.fieldbyname('H_Qty').AsFloat; + if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then + begin + if Order_Sub.fieldbyname('MFQty').AsFloat * Order_Sub.fieldbyname('KZQty').AsFloat > 0 then + FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value * 1.00 * 1000 / (Order_Sub.fieldbyname('MFQty').Value * 1.00 / 100 * Order_Sub.fieldbyname('KZQty').Value); + end + else + begin + FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value; + end; + FieldByName('C_Valid').Value := 'Y'; + Post; + end; + Order_Sub.Edit; + Order_Sub.FieldByName('SubId').Value := Trim(maxno); + +// if not YFData(fMainID, maxno) then +// begin +// ADOCmd.Connection.RollbackTrans; +// exit; +// end; + //Order_Sub.Post; + 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 TfrmClothContractOutPut.TBSaveClick(Sender: TObject); +begin + cxGrid1.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_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 MainID from Contract_Main A'); + sql.Add('where mainID<>' + quotedstr(trim(fMainID))); + sql.Add('and conNo=' + quotedstr(trim(conNo.Text))); + sql.Add('and conType='''''); + open; + end; + if not ADOTemp.IsEmpty then + begin + application.MessageBox('񵥺ظ', 'ʾϢ', 0); + exit; + end; + if SaveData() then + begin + Application.MessageBox('ɹ', 'ʾ', 0); + ModalResult := 1; + // ConNo.Text:='Զ'; + { FactoryNoName.Text:=''; + CompanyName.Text:='֯'; + LXPerson.Text:=''; + LXTel.Text:=''; + JHPlace.Text:=''; + Order_Sub.EmptyDataSet; + PState:=0; + FMainId:=''; } + end; +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.ToolButton1Click(Sender: TObject); +begin + with Order_Sub do + begin + Append; + fieldbyname('PriceUnit').Value := ''; + fieldbyname('C_UNit').Value := 'M'; + Post; + end; +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.FactoryNoNamePropertiesChange(Sender: TObject); +begin + {if FXS=99 then + begin + PanZDY.Visible:=False; + FXS:=0; + Exit; + end; + ZDYHelp(FactoryNoName,'FactoryNo1Name'); } +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.fromConNoKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + DoQuery(fromConNo.text); + end; +end; + +procedure TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.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 TfrmClothContractOutPut.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCXgrid(self.Caption, tv1); +end; + +procedure TfrmClothContractOutPut.FormCreate(Sender: TObject); +begin + cxGrid1.Align := Alclient; +end; + +procedure TfrmClothContractOutPut.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + DoKc(); +end; + +end. + diff --git a/管理系统/U_GetDllForm.pas b/管理系统/U_GetDllForm.pas index d0133c2..180f175 100644 --- a/管理系统/U_GetDllForm.pas +++ b/管理系统/U_GetDllForm.pas @@ -34,6 +34,7 @@ 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; ///////////////////////////////////////////////////////////////// @@ -380,13 +381,13 @@ begin BorderStyle := mborderstyle; //show; end; - end + end else frmCpCkSaoMNewSel.BringToFront; // mNewHandle:=frmCpCkSaoMNewSel.Handle; - end ; } + end ; } 6: //Ʒб ڳ begin if frmCKProductBCPInList = nil then @@ -625,6 +626,28 @@ begin // mnewHandle := frmCpRkSaoMNew.Handle; + end; + 315: // + begin + if frmClothContractList_CK = nil then + begin + frmClothContractList_CK := TfrmClothContractList_CK.Create(application.MainForm); + with frmClothContractList_CK do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + // fDParameters1:=trim('ѯ'); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothContractList_CK.BringToFront; + // + mnewHandle := frmClothContractList_CK.Handle; + end; 15: //ɹ Ͷƥ begin