diff --git a/坯布仓库/BPCK.dpr b/坯布仓库/BPCK.dpr index b50a53d..49b6aff 100644 --- a/坯布仓库/BPCK.dpr +++ b/坯布仓库/BPCK.dpr @@ -4,7 +4,7 @@ uses SysUtils, classes, forms, - WinTypes, + WinTypes, WinProcs, U_DataLink in 'U_DataLink.pas' {BPCK_DataLink: TDataModule}, U_GetDllForm in 'U_GetDllForm.pas', diff --git a/坯布仓库/U_BpRk.pas b/坯布仓库/U_BpRk.pas index 9de45e0..4178de0 100644 --- a/坯布仓库/U_BpRk.pas +++ b/坯布仓库/U_BpRk.pas @@ -10,7 +10,21 @@ uses cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, BtnEdit, RM_Common, RM_Class, RM_e_Xls, RM_GridReport, RM_System, RM_Dataset, - cxLookAndFeels, cxLookAndFeelPainters, cxNavigator; + 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 TfrmbpRk = class(TForm) @@ -916,6 +930,7 @@ begin begin Edit; FieldByName('P_Color').value := CDS_HZ.fieldbyname('CodeName').AsString; + FieldByName('P_ColorNo').value := CDS_HZ.fieldbyname('Colorno').AsString; Post; end; end; diff --git a/坯布仓库/U_BpRklist.dfm b/坯布仓库/U_BpRklist.dfm index fd44860..70de4ed 100644 --- a/坯布仓库/U_BpRklist.dfm +++ b/坯布仓库/U_BpRklist.dfm @@ -21,7 +21,6 @@ object frmBpRklist: TfrmBpRklist Left = 0 Top = 0 Width = 1144 - Height = 62 AutoSize = True ButtonHeight = 30 ButtonWidth = 95 @@ -93,12 +92,11 @@ object frmBpRklist: TfrmBpRklist AutoSize = True Caption = #23548#20986 ImageIndex = 75 - Wrap = True OnClick = TBExportClick end object TBPrint: TToolButton - Left = 0 - Top = 30 + Left = 441 + Top = 0 AutoSize = True Caption = #25171#21360 ImageIndex = 12 @@ -106,8 +104,8 @@ object frmBpRklist: TfrmBpRklist OnClick = TBPrintClick end object ToolButton1: TToolButton - Left = 63 - Top = 30 + Left = 504 + Top = 0 AutoSize = True Caption = #25171#21360#36864#36135#21333 ImageIndex = 12 @@ -115,32 +113,32 @@ object frmBpRklist: TfrmBpRklist OnClick = ToolButton1Click end object ToolButton2: TToolButton - Left = 162 - Top = 30 + Left = 603 + Top = 0 AutoSize = True Caption = #32454#30721#24405#20837 ImageIndex = 10 OnClick = ToolButton2Click end object ToolButton3: TToolButton - Left = 249 - Top = 30 + Left = 690 + Top = 0 AutoSize = True Caption = #25171#21360#26631#31614 ImageIndex = 12 OnClick = ToolButton3Click end object TBClose: TToolButton - Left = 336 - Top = 30 + Left = 777 + Top = 0 AutoSize = True Caption = #20851#38381 ImageIndex = 55 OnClick = TBCloseClick end object ToolButton4: TToolButton - Left = 399 - Top = 30 + Left = 840 + Top = 0 Caption = #25171#21360#20837#24211#21333 ImageIndex = 12 OnClick = ToolButton4Click @@ -148,7 +146,7 @@ object frmBpRklist: TfrmBpRklist end object Panel1: TPanel Left = 0 - Top = 62 + Top = 32 Width = 1144 Height = 65 Align = alTop @@ -427,9 +425,9 @@ object frmBpRklist: TfrmBpRklist end object cxGrid1: TcxGrid Left = 0 - Top = 147 + Top = 117 Width = 560 - Height = 314 + Height = 344 Align = alClient TabOrder = 2 object Tv1: TcxGridDBTableView @@ -681,7 +679,7 @@ object frmBpRklist: TfrmBpRklist end object cxTabControl1: TcxTabControl Left = 0 - Top = 127 + Top = 97 Width = 1144 Height = 20 Align = alTop @@ -699,9 +697,9 @@ object frmBpRklist: TfrmBpRklist end object cxGrid2: TcxGrid Left = 560 - Top = 147 + Top = 117 Width = 584 - Height = 314 + Height = 344 Align = alRight PopupMenu = PopupMenu1 TabOrder = 4 diff --git a/坯布仓库/U_BpRklist.pas b/坯布仓库/U_BpRklist.pas index 9ffb24c..aa36583 100644 --- a/坯布仓库/U_BpRklist.pas +++ b/坯布仓库/U_BpRklist.pas @@ -11,7 +11,20 @@ uses cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_Common, RM_Class, RM_e_Xls, RM_System, RM_GridReport, cxPC, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, cxCheckBox, cxTextEdit, - Menus; + Menus, 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 TfrmBpRklist = class(TForm) @@ -328,7 +341,7 @@ begin begin fkeyNo := ''; fType := 0; - fckName := self.fckName; + fckName := self.fckName; if showmodal = 1 then begin TBRafresh.Click; diff --git a/坯布仓库/U_ZdyYS_Sel.dfm b/坯布仓库/U_ZdyYS_Sel.dfm index fcb11ef..57f6b03 100644 --- a/坯布仓库/U_ZdyYS_Sel.dfm +++ b/坯布仓库/U_ZdyYS_Sel.dfm @@ -1,6 +1,6 @@ object frmZdyYS_Sel: TfrmZdyYS_Sel - Left = 1087 - Top = 274 + Left = 682 + Top = 278 Width = 813 Height = 662 Caption = #39068#33394 @@ -97,6 +97,12 @@ object frmZdyYS_Sel: TfrmZdyYS_Sel PropertiesClassName = 'TcxCheckBoxProperties' Properties.ImmediatePost = True end + object Tv2Column3: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'Colorno' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/坯布仓库/U_ZdyYS_Sel.pas b/坯布仓库/U_ZdyYS_Sel.pas index e2bfa3e..950aaa8 100644 --- a/坯布仓库/U_ZdyYS_Sel.pas +++ b/坯布仓库/U_ZdyYS_Sel.pas @@ -12,7 +12,21 @@ uses cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit, - cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator; + cxTextEdit, 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 TfrmZdyYS_Sel = class(TForm) @@ -46,6 +60,7 @@ type Code: TEdit; Tv2Column2: TcxGridDBColumn; Edit1: TEdit; + Tv2Column3: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); diff --git a/基础资料维护(BaseInfo.dll)/BaseInfo.dpr b/基础资料维护(BaseInfo.dll)/BaseInfo.dpr index 81e4a77..e4a08ca 100644 --- a/基础资料维护(BaseInfo.dll)/BaseInfo.dpr +++ b/基础资料维护(BaseInfo.dll)/BaseInfo.dpr @@ -4,8 +4,8 @@ uses SysUtils, classes, forms, - WinTypes, - WinProcs, + WinTypes, + WinProcs, U_DataLink in 'U_DataLink.pas' {DataLink_BaseInfo: TDataModule}, U_GetDllForm in 'U_GetDllForm.pas', U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas', diff --git a/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas b/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas index 8383691..dca1779 100644 --- a/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas +++ b/基础资料维护(BaseInfo.dll)/U_GetDllForm.pas @@ -154,12 +154,12 @@ begin // fkhType:=''; fkhType := trim(DataBase); FormStyle := mstyle; - windowState := mstate; + windowState := mstate; BorderStyle := mborderstyle; //show; end; end - else + else frmZdyAttachCP.BringToFront; // mnewHandle := frmZdyAttachCP.Handle; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.dfm index 017918d..6168926 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.dfm @@ -543,6 +543,12 @@ object frmZdyAttInputCP10: TfrmZdyAttInputCP10 HeaderAlignmentHorz = taCenter Width = 60 end + object Tv2Column2: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'CYYSno' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 @@ -622,6 +628,14 @@ object frmZdyAttInputCP10: TfrmZdyAttInputCP10 TabOrder = 23 Visible = False end + object CYColorno: TEdit + Tag = 2 + Left = 703 + Top = 317 + Width = 141 + Height = 20 + TabOrder = 24 + end end end object PopupMenu1: TPopupMenu diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.pas index e5b45cd..2a676c5 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP10.pas @@ -106,6 +106,8 @@ type fprice: TEdit; Label26: TLabel; CPtxm: TEdit; + Tv2Column2: TcxGridDBColumn; + CYColorno: TEdit; procedure FormDestroy(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -352,7 +354,7 @@ begin end; with adoqueryTmp do - begin + begin close; sql.Clear; sql.Add('select * from KH_Zdy_Attachment X'); @@ -546,7 +548,7 @@ begin begin cycolor.text := CDS_HZ.fieldbyname('CodeName').AsString; - + CYColorno.text := trim(CDS_HZ.fieldbyname('Colorno').AsString); end; free; end; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.dfm index fcd39ac..59346ac 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.dfm @@ -419,6 +419,15 @@ object frmZdyAttInputCP_CB: TfrmZdyAttInputCP_CB TabOrder = 18 OnBtnClick = CYColorBtnClick end + object CYColorno: TEdit + Tag = 2 + Left = 820 + Top = 229 + Width = 141 + Height = 20 + TabOrder = 19 + Visible = False + end end object Panel2: TPanel Left = 0 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas index ac21f45..0929a7e 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas @@ -159,6 +159,7 @@ type DS5: TDataSource; TV5Column1: TcxGridDBColumn; TV5Column2: TcxGridDBColumn; + CYColorno: TEdit; procedure FormDestroy(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -272,7 +273,7 @@ begin FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTmp); end; SSetsaveSqlNew(ADOQueryCmd, 'KH_Zdy_Attachment', GroupBox1, 2); -// fieldbyname('fprice').Value := strtofloatdef(trim(DefFlt1.Text), 0); + // fieldbyname('fprice').Value := strtofloatdef(trim(DefFlt1.Text), 0); // fieldbyname('Sprice').Value := strtofloatdef(trim(DefFlt2.Text), 0); // fieldbyname('Tprice').Value := strtofloatdef(trim(DefFlt1.Text), 0); // FieldByName('defflt3').Value := strtofloatdef(Trim(defflt3.text), 1); @@ -299,6 +300,8 @@ begin fieldbyname('Seprice').Value := strtofloatdef(trim(Seprice.Text), 0); fieldbyname('Tprice').Value := strtofloatdef(trim(Tprice.Text), 0); fieldbyname('DZprice').Value := strtofloatdef(trim(DZprice.Text), 0); + FieldByName('CYColorno').Value := Trim(CYColorno.text); + FieldByName('CYColor').Value := Trim(CYColor.text); post; end; end; @@ -413,7 +416,7 @@ begin next; end; end; - with cds5 do + with cds5 do begin First; while not eof do @@ -1342,6 +1345,7 @@ begin begin CYColor.text := trim(CDS_HZ.fieldbyname('CodeName').AsString); + CYColorno.text := trim(CDS_HZ.fieldbyname('Colorno').AsString); // Self.Order_Sub.FieldByName('SOrddefstr4').Value := Trim(ClientDataSet1.fieldbyname('Note').AsString); end; // if showmodal = 1 then diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.dfm index 4f59298..87e3159 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.dfm @@ -423,6 +423,12 @@ object frmZdyAttachCP10: TfrmZdyAttachCP10 HeaderAlignmentHorz = taCenter Width = 90 end + object Tv2Column7: TcxGridDBColumn + Caption = #39068#33394#32534#21495 + DataBinding.FieldName = 'CYColorno' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas index 66b1127..9da749c 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas @@ -130,6 +130,7 @@ type TV3Column30: TcxGridDBColumn; TV3Column31: TcxGridDBColumn; TV3Column32: TcxGridDBColumn; + Tv2Column7: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.dfm b/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.dfm index bf5f181..46c58fc 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.dfm +++ b/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.dfm @@ -115,6 +115,14 @@ object frmZdyYS_help: TfrmZdyYS_help HeaderAlignmentHorz = taCenter Width = 147 end + object Tv2Column3: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'Colorno' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = Tv2Column3PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.pas b/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.pas index 38f9d20..7d1e919 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyYS_help.pas @@ -13,7 +13,20 @@ uses RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit, cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, - cxTLdxBarBuiltInMenu; + 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, + dxSkinscxPCPainter; type TfrmZdyYS_help = class(TForm) @@ -64,6 +77,7 @@ type Tv2Column2: TcxGridDBColumn; Label4: TLabel; CPNameYW: TEdit; + Tv2Column3: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -83,6 +97,7 @@ type procedure PageControl1Change(Sender: TObject); procedure cxDBTreeList1Change(Sender: TObject); procedure Tv2Column2PropertiesEditValueChanged(Sender: TObject); + procedure Tv2Column3PropertiesEditValueChanged(Sender: TObject); private { Private declarations } PState: Integer; @@ -444,8 +459,34 @@ begin CPNo.Text := Trim(ADOQueryTree.fieldbyname('Code').AsString); end; -procedure TfrmZdyYS_help.Tv2Column2PropertiesEditValueChanged( - Sender: TObject); +procedure TfrmZdyYS_help.Tv2Column2PropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := ''; + end; + FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName); + with CDS_HZ do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + Post; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('UPdate CP_CMYS '); + sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + ''''); + SQL.Add(' where Mainid=''' + Trim(CDS_HZ.fieldbyname('Mainid').AsString) + ''''); + ExecSQL; + end; +end; + +procedure TfrmZdyYS_help.Tv2Column3PropertiesEditValueChanged(Sender: TObject); var mvalue, FFieldName: string; begin diff --git a/应收应付/U_SXCKNewList.pas b/应收应付/U_SXCKNewList.pas index d341a19..3427b9c 100644 --- a/应收应付/U_SXCKNewList.pas +++ b/应收应付/U_SXCKNewList.pas @@ -12,7 +12,20 @@ uses cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit, cxPC, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, - cxContainer, cxImage, cxDBEdit; + cxContainer, cxImage, cxDBEdit, 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 TfrmSXCKNewList = class(TForm) @@ -176,7 +189,7 @@ begin // + quotedstr(Trim(CDS_Main.fieldbyname('factoryName').AsString))); sql.Add(' and mainID=''' + Trim(CDS_Main.fieldbyname('crno').AsString) + ''' and yfname not in('''',''ӹ'',''첼'',''Ʒ'')'); sql.Add(' and P_color=''' + Trim(CDS_Main.fieldbyname('P_color').AsString) + ''''); - sql.Add(' and P_code=''' + Trim(CDS_Main.fieldbyname('P_code').AsString) + ''''); + sql.Add(' and P_code=''' + Trim(CDS_Main.fieldbyname('P_code').AsString) + ''''); // ShowMessage(sql.Text); Open; end; @@ -219,7 +232,7 @@ begin FieldByName('CJQty').Value := CDS_Main.fieldbyname('Qty').AsFloat; // FieldByName('Qty').Value := CDS_Main.fieldbyname('Qty').AsFloat * CDS_Main.fieldbyname('CRQtyFlag').AsFloat; // FieldByName('MDQty').Value := CDS_Main.fieldbyname('Qty').AsFloat * CDS_Main.fieldbyname('CRQtyFlag').AsFloat; -// FieldByName('machi').Value := 1; + FieldByName('PS').Value := CDS_Main.fieldbyname('piqty').AsFloat; // FieldByName('PS').Value := CDS_Main.fieldbyname('rollnum').AsFloat * CDS_Main.fieldbyname('CRQtyFlag').AsFloat; FieldByName('YFType').Value := 'Զ'; @@ -241,7 +254,7 @@ begin FieldByName('YFName').Value := Trim(CDS_Main.fieldbyname('FeeName').AsString); FieldByName('Price').Value := Trim(CDS_Main.fieldbyname('Price').AsString); FieldByName('Money').Value := Trim(CDS_Main.fieldbyname('Money').AsString); -// fieldbyname('quality').Value := Trim(CDS_Main.fieldbyname('quality').AsString); + fieldbyname('P_Code').Value := Trim(CDS_Main.fieldbyname('p_code').AsString); fieldbyname('Note').Value := Trim(CDS_Main.fieldbyname('Note').AsString); FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('crno').AsString); @@ -406,7 +419,7 @@ end; procedure TfrmSXCKNewList.FactoryNameChange(Sender: TObject); begin - TBFind.Click; + TBFind.Click; end; procedure TfrmSXCKNewList.ToolButton1Click(Sender: TObject); diff --git a/成品仓库/CPCK.dpr b/成品仓库/CPCK.dpr index 0387736..628148e 100644 --- a/成品仓库/CPCK.dpr +++ b/成品仓库/CPCK.dpr @@ -13,11 +13,11 @@ uses U_ZDYHelp in '..\..\..\ThreeFun\Form\U_ZDYHelp.pas' {frmZDYHelp}, U_BpSmRk in 'U_BpSmRk.pas' {frmBpSmRk}, U_BpJylist in 'U_BpJylist.pas' {frmBpJylist}, - U_BpRk in 'U_BpRk.pas' {frmbpRk}, + U_CPRk in 'U_CPRk.pas' {frmCPRk}, U_ProductOrderNewList in 'U_ProductOrderNewList.pas' {frmProductOrderNewList}, - U_BpCk in 'U_BpCk.pas' {frmbpCk}, + U_CpCk in 'U_CpCk.pas' {frmCpCk}, U_BpSmCk in 'U_BpSmCk.pas' {frmBpSmCk}, - U_BpRklist in 'U_BpRklist.pas' {frmBpRklist}, + U_CPRklist in 'U_CPRklist.pas' {frmCPRklist}, U_ZdyAttachment in 'U_ZdyAttachment.pas' {frmZdyAttachment}, U_ZDYHelpSel in '..\..\..\ThreeFun\Form\U_ZDYHelpSel.pas' {frmZDYHelpSel}, U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas', @@ -34,7 +34,6 @@ uses U_CPKWListSel in 'U_CPKWListSel.pas' {frmCPKWListSel}, U_ZdyYS_Sel in 'U_ZdyYS_Sel.pas' {frmZdyYS_Sel}; - // U_SelfForm in '..\..\SelfForm\U_SelfForm.pas', // U_SelExportField in '..\..\SelfForm\U_SelExportField.pas' {frmSelExportField}, // U_SelPrintField in '..\..\SelfForm\U_SelPrintField.pas' {frmSelPrintField}, diff --git a/成品仓库/U_CPRk.dfm b/成品仓库/U_CPRk.dfm new file mode 100644 index 0000000..0bb345f --- /dev/null +++ b/成品仓库/U_CPRk.dfm @@ -0,0 +1,892 @@ +object frmCPRk: TfrmCPRk + Left = 343 + Top = 489 + Width = 1381 + Height = 660 + Caption = #25104#21697#20837#24211#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + WindowState = wsMaximized + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1365 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + 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 Panel1: TPanel + Left = 0 + Top = 29 + Width = 1365 + Height = 56 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 36 + Top = 20 + Width = 48 + Height = 12 + Caption = #20837#24211#26085#26399 + end + object Label2: TLabel + Left = 540 + Top = 20 + Width = 48 + Height = 12 + Caption = #20837#24211#31867#22411 + end + object Label3: TLabel + Left = 384 + Top = 20 + Width = 24 + Height = 12 + Caption = #20179#24211 + end + object Label8: TLabel + Left = 216 + Top = 20 + Width = 48 + Height = 12 + Caption = #20837#24211#21333#21495 + end + object Label4: TLabel + Left = 724 + Top = 20 + Width = 66 + Height = 12 + Caption = #21152#24037#21378'/'#23458#25143 + end + object Label17: TLabel + Left = 1096 + Top = 22 + Width = 60 + Height = 14 + Caption = #27599#21305#25968#37327 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label14: TLabel + Left = 32 + Top = 84 + Width = 48 + Height = 12 + Caption = #25171' '#21253' '#36153 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + end + object CRTime: TDateTimePicker + Left = 88 + Top = 16 + Width = 100 + Height = 20 + Date = 41509.970132187500000000 + Format = 'yyyy-MM-dd' + Time = 41509.970132187500000000 + TabOrder = 0 + end + object CRType: TComboBox + Left = 592 + Top = 16 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 1 + Text = #29983#20135#20837#24211 + Items.Strings = ( + #29983#20135#20837#24211) + end + object ckName: TComboBox + Left = 416 + Top = 16 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 2 + Text = #26679#21697#20179#24211 + Items.Strings = ( + #26679#21697#20179#24211) + end + object InoutNo: TEdit + Left = 264 + Top = 16 + Width = 100 + Height = 20 + TabOrder = 3 + end + object custName: TBtnEditA + Left = 796 + Top = 16 + Width = 101 + Height = 20 + ReadOnly = True + TabOrder = 4 + OnBtnClick = custNameBtnClick + end + object QtyMX: TEdit + Left = 1156 + Top = 18 + Width = 65 + Height = 22 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 5 + Visible = False + OnKeyPress = QtyMXKeyPress + end + object PackFee: TcxCurrencyEdit + Left = 84 + Top = 80 + Properties.DisplayFormat = '0.##' + TabOrder = 6 + Width = 100 + end + object CheckBox1: TCheckBox + Left = 927 + Top = 19 + Width = 61 + Height = 17 + Caption = #35009#21098 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 7 + end + object CheckBox2: TCheckBox + Left = 1008 + Top = 17 + Width = 61 + Height = 21 + Caption = #32541#32427 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 8 + end + end + object ToolBar2: TToolBar + Left = 0 + Top = 85 + Width = 1365 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 2 + object ToolButton5: TToolButton + Left = 0 + Top = 0 + Caption = #36873#25321#35746#21333 + ImageIndex = 108 + OnClick = ToolButton5Click + end + object ToolButton1: TToolButton + Left = 83 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 103 + OnClick = ToolButton1Click + end + object ToolButton2: TToolButton + Left = 146 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 107 + OnClick = ToolButton2Click + end + end + object Panel2: TPanel + Left = 0 + Top = 114 + Width = 1365 + Height = 267 + Align = alClient + Caption = 'Panel2' + TabOrder = 3 + object cxGrid1: TcxGrid + Left = 1 + Top = 1 + Width = 1154 + Height = 265 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnCellClick = Tv1CellClick + OnFocusedRecordChanged = Tv1FocusedRecordChanged + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1P_CodeName + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty + end + item + Kind = skSum + Column = v1Money + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v1OrderNo: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'OrderNo' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column5PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1Column2: TcxGridDBColumn + Caption = #21152#24037#21333#21495 + DataBinding.FieldName = 'fromMainID' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.ReadOnly = True + Properties.OnButtonClick = v1Column2PropertiesButtonClick + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 90 + end + object v1MJXH: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'MJXH' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 50 + end + object v1MJId: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'MJId' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 80 + end + object v1P_Code: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'P_Code' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1P_CodePropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 79 + end + object v1P_CodeName: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'P_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1P_CodePropertiesButtonClick + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 90 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #27454#21495 + DataBinding.FieldName = 'P_SPEC' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 90 + end + object Tv1Column4: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 68 + end + object Tv1Column5: TcxGridDBColumn + Caption = #39068#33394#33521#25991 + DataBinding.FieldName = 'P_Ecolor' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column1: TcxGridDBColumn + Caption = #25209#27425 + DataBinding.FieldName = 'batchNo' + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 70 + end + object v1Column3: TcxGridDBColumn + Caption = #23610#23544'/'#23610#30721 + DataBinding.FieldName = 'defstr1' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column3PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 73 + end + object v1Column4: TcxGridDBColumn + Caption = #24037#21345#21495 + DataBinding.FieldName = 'defstr2' + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 60 + end + object v1Qty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'qty' + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 86 + end + object v1Price: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1PricePropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 43 + end + object v1Money: TcxGridDBColumn + Caption = #37329#39069 + DataBinding.FieldName = 'Money' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Styles.Content = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Footer = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Header = CPCK_DataLink.cxStyle_fontclFuchsia + Width = 52 + end + object v1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 94 + end + object Tv1Column2: TcxGridDBColumn + Caption = #20179#24211#32534#21495 + DataBinding.FieldName = 'DRCKNO' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1Column3PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 70 + end + object Tv1Column3: TcxGridDBColumn + Caption = #20179#24211#21517#31216 + DataBinding.FieldName = 'DRCKName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1Column3PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1CPType: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'CPType' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.DropDownListStyle = lsEditFixedList + Properties.Items.Strings = ( + #27491#21697 + #27425#21697) + Properties.ReadOnly = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 63 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object cxGrid2: TcxGrid + Left = 1155 + Top = 1 + Width = 209 + Height = 265 + Align = alRight + TabOrder = 1 + Visible = False + object Tv2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv2CellDblClick + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v2Column2 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v2Column2: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 102 + end + end + object cxGridLevel1: TcxGridLevel + GridView = Tv2 + end + end + end + object cxGrid3: TcxGrid + Left = 0 + Top = 410 + Width = 1365 + Height = 211 + Align = alBottom + TabOrder = 4 + Visible = False + object TV3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource2 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV2Column2 + end + item + Kind = skSum + Column = TV2Column3 + end + item + Kind = skSum + Column = TV2Column4 + end + item + Kind = skSum + Column = TV2Column5 + end + item + Kind = skSum + Column = TV2Column6 + end + item + Kind = skSum + Column = TV2Column7 + end + item + Kind = skSum + Column = TV2Column8 + end + item + Kind = skSum + Column = TV2Column9 + end + item + Kind = skSum + Column = TV2Column10 + end + item + Kind = skSum + Column = TV2Column11 + end + item + Kind = skSum + Column = TV2Column12 + end + item + Kind = skSum + Column = TV2Column13 + end + item + Kind = skSum + Column = TV3Column1 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnSorting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV2Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = TV2Column1PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column4: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV2Column2: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column3: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column4: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column5: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column6: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column7: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column2: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column8: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column9: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column10: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column11: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column12: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column13: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column3: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'Size14' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV3Column1: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 70 + end + end + object cxGridLevel2: TcxGridLevel + GridView = TV3 + end + end + object ToolBar3: TToolBar + Left = 0 + Top = 381 + Width = 1365 + Height = 29 + Align = alBottom + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 5 + Visible = False + object ToolButton3: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 103 + OnClick = ToolButton3Click + end + object ToolButton4: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 107 + OnClick = ToolButton4Click + end + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 292 + end + object ADOQueryTmp: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 344 + Top = 4 + end + object DataSource1: TDataSource + DataSet = CDS_Main + Left = 400 + Top = 1 + end + object CDS_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 464 + Top = 1 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 532 + Top = 65 + end + object ADO_Sub: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 964 + Top = 5 + end + object DataSource2: TDataSource + DataSet = CDS_Sub + Left = 872 + Top = 425 + end + object CDS_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 832 + Top = 429 + end +end diff --git a/成品仓库/U_CPRk.pas b/成品仓库/U_CPRk.pas new file mode 100644 index 0000000..ba2d36a --- /dev/null +++ b/成品仓库/U_CPRk.pas @@ -0,0 +1,1628 @@ +unit U_CPRk; + +interface + +uses + Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls, + Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, + cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView, + cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit, + DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, BtnEdit, + cxContainer, 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 + TfrmCPRk = class(TForm) + ToolBar1: TToolBar; + TBSave: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + CRTime: TDateTimePicker; + Label2: TLabel; + CRType: TComboBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1P_CodeName: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1Qty: TcxGridDBColumn; + v1Note: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ADOQueryCmd: TADOQuery; + ADOQueryTmp: TADOQuery; + DataSource1: TDataSource; + CDS_Main: TClientDataSet; + ToolBar2: TToolBar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + cxGridPopupMenu1: TcxGridPopupMenu; + Label3: TLabel; + ckName: TComboBox; + v1MJXH: TcxGridDBColumn; + v1MJId: TcxGridDBColumn; + v1CPType: TcxGridDBColumn; + v1P_Code: TcxGridDBColumn; + InoutNo: TEdit; + Label8: TLabel; + Label4: TLabel; + custName: TBtnEditA; + v1Price: TcxGridDBColumn; + v1Money: TcxGridDBColumn; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column4: TcxGridDBColumn; + Panel2: TPanel; + cxGrid2: TcxGrid; + Tv2: TcxGridDBTableView; + v2Column2: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + QtyMX: TEdit; + Label17: TLabel; + ADO_Sub: TADOQuery; + DataSource2: TDataSource; + CDS_Sub: TClientDataSet; + PackFee: TcxCurrencyEdit; + Label14: TLabel; + v1OrderNo: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + cxGrid3: TcxGrid; + TV3: TcxGridDBTableView; + TV2Column1: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + TV2Column5: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + TV2Column8: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; + TV2Column11: TcxGridDBColumn; + TV2Column12: TcxGridDBColumn; + TV2Column13: TcxGridDBColumn; + cxGridLevel2: TcxGridLevel; + ToolBar3: TToolBar; + ToolButton3: TToolButton; + ToolButton4: TToolButton; + TV3Column1: TcxGridDBColumn; + TV3Column2: TcxGridDBColumn; + CheckBox1: TCheckBox; + CheckBox2: TCheckBox; + TV3Column3: TcxGridDBColumn; + TV3Column4: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + ToolButton5: TToolButton; + procedure FormDestroy(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormShow(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton1Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1P_ColorPropertiesEditValueChanged(Sender: TObject); + procedure custNameBtnClick(Sender: TObject); + procedure v1QtyPropertiesEditValueChanged(Sender: TObject); + procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure QtyMXKeyPress(Sender: TObject; var Key: Char); + procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1QtyUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); + procedure TV2Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton3Click(Sender: TObject); + procedure ToolButton4Click(Sender: TObject); + procedure TV2Column2PropertiesEditValueChanged(Sender: TObject); + procedure v1PricePropertiesEditValueChanged(Sender: TObject); + procedure ToolButton5Click(Sender: TObject); + procedure Tv1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + private + procedure InitGrid(); + function savedate(): Boolean; + procedure Initsub(); + procedure InitMX(); + procedure SetComboBox(); + function YSData(): Boolean; + function YFData(freeName: string): Boolean; + function YSData_Other(fYFName: string; fmoney: double): Boolean; + { Private declarations } + public + fkeyNO, FCodeName, FCode, FDRCKNO, FDRCKName: string; + FType: integer; + fCKName: string; + { Public declarations } + end; + +var + frmCPRk: TfrmCPRk; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_BpJylist, U_ZdyAttachment, U_ZdyAttachGYS, + U_JGCklistSel, U_ProductOrderNewListSEl, U_ZdyAttachCP, U_ZdyCMZ_Sel, + U_CPKWListSel, U_ZdyYS_Sel; +{$R *.dfm} + +function TfrmCPRk.YSData_Other(fYFName: string; fmoney: double): Boolean; +var + CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou, cust: string; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + trim(fYFName) + ''' '); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + trim(fYFName) + ''' '); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'CS', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦտǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('Qty').Value := 1; + FieldByName('Price').Value := fmoney; + FieldByName('Money').Value := fmoney; + FieldByName('BBMoney').Value := fmoney; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := ''; + FieldByName('ComTaiTou').Value := Trim(cust); + FieldByName('YFName').Value := fYFName; + // FieldByName('ISTAX').Value:=IsTax.Checked; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('subID').Value := Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('note').Value := '˻'; + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + 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; + Result := True; +end; + +procedure TfrmCPRk.Initsub(); +begin +// if CDS_Main.IsEmpty then +// exit; +// +// with Ado_Sub do +// begin +// close; +// sql.Clear; +// sql.Add('select * from CP_InOut_MX A'); +// sql.Add('where A.MJID=' + quotedstr(trim(CDS_Main.fieldbyname('MJID').AsString))); +// open; +// end; +// SCreateCDS20(Ado_Sub, CDS_sub); +// SInitCDSData20(Ado_Sub, CDS_sub); +end; + +function TfrmCPRk.YFData(freeName: string): Boolean; +var + CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou, cust: string; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + Trim(freeName) + ''''); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + Trim(freeName) + ''''); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'CF', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('ps').Value := CDS_Main.fieldbyname('RollNum').AsFloat; + FieldByName('Qty').Value := CDS_Main.fieldbyname('Qty').AsFloat; + FieldByName('Price').Value := CDS_Main.fieldbyname('Price').AsFloat; + FieldByName('Money').Value := CDS_Main.fieldbyname('Money').AsFloat; + FieldByName('BBMoney').Value := CDS_Main.fieldbyname('Money').AsFloat; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := Trim(CDS_Main.fieldbyname('QtyUnit').AsString); + FieldByName('ComTaiTou').Value := Trim(cust); + FieldByName('YFName').Value := freeName; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('subID').Value := Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + 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; + + Result := True; +end; + +function TfrmCPRk.YSData(): Boolean; +var + CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou, cust: string; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''ͻ˻'' '); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''ͻ˻'' '); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'CS', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦտǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('ps').Value := -1 * CDS_Main.fieldbyname('RollNum').AsFloat; + FieldByName('Qty').Value := -1 * CDS_Main.fieldbyname('Qty').AsFloat; + FieldByName('Price').Value := CDS_Main.fieldbyname('Price').AsFloat; + FieldByName('Money').Value := -1 * CDS_Main.fieldbyname('Money').AsFloat; + FieldByName('BBMoney').Value := -1 * CDS_Main.fieldbyname('Money').AsFloat; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := Trim(CDS_Main.fieldbyname('QtyUnit').AsString); + FieldByName('ComTaiTou').Value := Trim(cust); + FieldByName('YFName').Value := 'ͻ˻'; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('subID').Value := Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('note').Value := '˻'; + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + 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; + + Result := True; +end; + +procedure TfrmCPRk.SetComboBox(); +begin + ckName.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCK'' '); + if trim(fCKName) <> '' then + sql.Add('and zdyName=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + ckName.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if ckName.Items.Count > 0 then + ckName.ItemIndex := 0; + + CRType.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPRKTYPE'''); + if trim(fCKName) <> '' then + sql.Add('and note=' + quotedstr(trim(fCKName))); + // sql.Add('and zdyName<>'+quotedstr(trim('ӹ'))); + open; + while not eof do + begin + CRType.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if CRType.Items.Count > 0 then + CRType.ItemIndex := 0; +end; + +function TfrmCPRk.savedate(): Boolean; +var + fkcID, XHNO, i: integer; + Filler, FSize: string; + FillTime: TdateTime; +begin + result := false; + try + ADOQueryCmd.Connection.BeginTrans; + if FType = 0 then + begin + Filler := DName; + FillTime := SGetServerDateTime(adoqueryTmp); + end + else + begin + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + open; + Filler := adoqueryTmp.fieldbyname('Filler').AsString; + FillTime := adoqueryTmp.fieldbyname('FillTime').AsDateTime; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(fkeyNO) + ''''); + execsql; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_InOut'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + execsql; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_kc'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + execsql; + end; + + CDS_Main.DisableControls; + CDS_Main.First; + XHNO := 1; + with CDS_Main do + begin + First; + + while not eof do + begin + Edit; + FieldByName('CRNO').Value := trim(fkeyNO); +// FieldByName('CRID').Value := recNo; + post; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + SQL.add('Update CP_Kcid Set kcid=kcid+1'); + sql.Add('select kcid from CP_Kcid'); + Open; + end; + + fkcID := ADOQueryCmd.fieldbyname('kcid').AsInteger; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut'); + sql.Add('where 1=2 '); + open; + end; + + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO); + ADOQueryCmd.FieldByName('CRID').Value := XHNO; + ADOQueryCmd.FieldByName('custNo').Value := trim(custName.TxtCode); + ADOQueryCmd.FieldByName('custName').Value := trim(custName.Text); + + ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date); + ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text); + ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text); + ADOQueryCmd.FieldByName('CRFlag').Value := ''; + ADOQueryCmd.FieldByName('mainID').Value := trim(CDS_Main.fieldbyname('mainID').AsString); + ADOQueryCmd.FieldByName('subID').Value := trim(CDS_Main.fieldbyname('subID').AsString); + + ADOQueryCmd.FieldByName('CPTYPE').Value := trim(CDS_Main.fieldbyname('CPTYPE').AsString); + ADOQueryCmd.FieldByName('P_Code').Value := trim(CDS_Main.fieldbyname('P_Code').AsString); + ADOQueryCmd.FieldByName('P_CodeName').Value := trim(CDS_Main.fieldbyname('P_CodeName').AsString); + ADOQueryCmd.FieldByName('P_spec').Value := trim(CDS_Main.fieldbyname('P_spec').AsString); + ADOQueryCmd.FieldByName('P_Color').Value := trim(CDS_Main.fieldbyname('P_Color').AsString); + + ADOQueryCmd.FieldByName('RollNum').Value := CDS_Main.fieldbyname('RollNum').AsFloat; + + ADOQueryCmd.FieldByName('Qty').Value := CDS_Main.fieldbyname('Qty').AsFloat; + + ADOQueryCmd.FieldByName('Price').Value := CDS_Main.fieldbyname('price').AsFloat; + ADOQueryCmd.FieldByName('rkPrice').Value := CDS_Main.fieldbyname('price').AsFloat; + ADOQueryCmd.FieldByName('money').Value := CDS_Main.fieldbyname('money').AsFloat; + ADOQueryCmd.FieldByName('note').Value := trim(CDS_Main.fieldbyname('note').AsString); + ADOQueryCmd.FieldByName('Filler').Value := trim(Filler); + ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(FillTime); + ADOQueryCmd.FieldByName('InOutNo').Value := trim(InOutNo.Text); + + ADOQueryCmd.FieldByName('DRCKNO').Value := trim(CDS_Main.fieldbyname('DRCKNO').AsString); + ADOQueryCmd.FieldByName('DRCKName').Value := trim(CRType.Text); +// trim(CDS_Main.fieldbyname('DRCKName').AsString); +// ADOQueryCmd.FieldByName('fromMainID').Value := trim(CDS_Main.fieldbyname('fromMainID').AsString); +// ADOQueryCmd.FieldByName('fromsubID').Value := trim(CDS_Main.fieldbyname('fromsubID').AsString); + ADOQueryCmd.FieldByName('defstr1').Value := trim(CDS_Main.fieldbyname('defstr1').AsString); +// ADOQueryCmd.FieldByName('defstr2').Value := trim(CDS_Main.fieldbyname('defstr2').AsString); +// ADOQueryCmd.FieldByName('defstr3').Value := trim(CDS_Main.fieldbyname('defstr3').AsString); +// ADOQueryCmd.FieldByName('defstr4').Value := trim(CDS_Main.fieldbyname('defstr4').AsString); +// ADOQueryCmd.FieldByName('defstr5').Value := trim(CDS_Main.fieldbyname('defstr5').AsString); + if CheckBox1.Checked then + begin + ADOQueryCmd.FieldByName('Caijian').Value := 'ü'; + end; + if CheckBox2.Checked then + begin + ADOQueryCmd.FieldByName('Fengren').Value := ''; + end; + + if FType = 1 then + begin + ADOQueryCmd.FieldByName('editer').Value := trim(dName); + ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp); + end; + ADOQueryCmd.FieldByName('kcID').Value := fkcID; + ADOQueryCmd.Post; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_KC'); + sql.Add('where 1=2 '); + open; + end; + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('kcID').Value := fkcID; + ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text); + ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO); + ADOQueryCmd.FieldByName('CRID').Value := XHNO; + ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date); + ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text); + ADOQueryCmd.FieldByName('CRFlag').Value := ''; + ADOQueryCmd.FieldByName('mainID').Value := trim(cds_main.fieldbyname('mainID').AsString); + ADOQueryCmd.FieldByName('subID').Value := trim(cds_main.fieldbyname('subID').AsString); +// ADOQueryCmd.FieldByName('MJXH').Value := trim(fieldbyname('MJXH').AsString); +// ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString); + ADOQueryCmd.FieldByName('CPType').Value := trim(cds_main.fieldbyname('CPType').AsString); + ADOQueryCmd.FieldByName('P_Code').Value := trim(cds_main.fieldbyname('P_Code').AsString); + ADOQueryCmd.FieldByName('P_CodeName').Value := trim(cds_main.fieldbyname('P_CodeName').AsString); + ADOQueryCmd.FieldByName('P_spec').Value := trim(cds_main.fieldbyname('P_spec').AsString); + ADOQueryCmd.FieldByName('P_Color').Value := trim(CDS_Main.fieldbyname('P_Color').AsString); + ADOQueryCmd.FieldByName('DRCKNO').Value := trim(CDS_Main.fieldbyname('DRCKNO').AsString); + ADOQueryCmd.FieldByName('DRCKName').Value := trim(CDS_Main.fieldbyname('DRCKName').AsString); + ADOQueryCmd.FieldByName('Qty').Value := CDS_Main.fieldbyname('QTY').AsFloat; + ADOQueryCmd.FieldByName('kcID').Value := fkcID; + ADOQueryCmd.Post; + + XHNO := XHNO + 1; + Next; + end; + end; + next; + CDS_Main.EnableControls; + ADOQueryCmd.Connection.CommitTrans; + result := true; + except + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + end; +end; + +procedure TfrmCPRk.InitGrid(); +begin + try + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select isnull(mainID,'''') as Mainid,isnull(subID,'''') as Subid,isnull(P_Code,'''') as P_Code,isnull(P_CodeName,'''') as P_CodeName,isnull(P_spec,'''') as P_spec '); + sql.Add(',isnull(P_MF,'''') as P_MF,isnull(P_KZ,'''') as P_KZ,RKprice,isnull(P_Color,'''') as P_Color,isnull(defstr1,'''') as defstr1,'); + sql.Add('SUM(RollNum ) as RollNum,'); + sql.Add('SUM((Qty+zsQty)) as Qty,'); + sql.Add('CAST( P_KZ as varchar(10)) as P_KZ_s,'); + sql.Add('SUM((Qty+zsQty))*RKprice as money'); + sql.Add(',ISNULL(OrderNO,'''') as OrderNO'); + sql.Add(',isnull(DRCKNO ,'''') as DRCKNO ,isnull(DRCKName,'''') as DRCKName,CRNO,InOutNo,CRTime,isnull(custName,'''') as custName,CRType,CKName,isnull(custNo,'''') as custNo,CPType '); + SQL.Add(',isnull(Note,'''') as Note,isnull(Price,0) as Price'); + sql.Add('from (select A.*,'); + sql.Add('orderNo=(select Top 1 orderNo from JYOrder_Main X where X.MainID=A.MainID )'); + sql.Add('from CP_InOut A'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); +// SQL.Add('and P_Code=' + quotedstr(trim(FCode))); +// SQL.Add('and P_CodeName=' + quotedstr(trim(FCodeName))); + SQL.Add('and DRCKNO=' + quotedstr(trim(FDRCKNO))); + SQL.Add('and DRCKName=' + quotedstr(trim(FDRCKName))); + sql.Add(')AA'); + sql.Add('group by ISNULL(mainID,''''),ISNULL(subID,''''),isnull(P_Code,''''),isnull(P_CodeName,''''),ISNULL(P_spec,'''')'); + sql.Add(',isnull(P_MF,''''),isnull(P_KZ,''''),RKprice,ISNULL(OrderNO,'''') ,isnull(P_Color,''''),isnull(defstr1,''''),CAST( P_KZ as varchar(10))'); + sql.Add(',isnull(DRCKNO ,'''') ,isnull(DRCKName,''''),CRNO,InOutNo,CRTime,isnull(custName,''''),CRType,CKName,isnull(custNo,''''),CPType'); + sql.Add(',isnull(Note,''''),isnull(Price,0)'); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); + + if not CDS_Main.IsEmpty then + begin + CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime; + CKName.ItemIndex := CKName.Items.IndexOf(trim(CDS_Main.fieldbyname('CKName').AsString)); + CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString)); + inoutNo.Text := CDS_Main.fieldbyname('inoutNo').asstring; + custName.TxtCode := trim(CDS_Main.fieldbyname('custNo').AsString); + custName.Text := trim(CDS_Main.fieldbyname('custName').AsString); + // FirstName.TxtCode:=trim(CDS_Main.fieldbyname('FirstNo').AsString); + // FirstName.Text:=trim(CDS_Main.fieldbyname('FirstName').AsString); + end + else +// ToolButton1.Click; + + + + + finally + end; + Initsub(); + InitMX(); +end; + +procedure TfrmCPRk.FormDestroy(Sender: TObject); +begin + frmCpRk := nil; +end; + +procedure TfrmCPRk.FormCreate(Sender: TObject); +begin + CRTime.Date := DServerDate; + Panel2.Align := alclient; + +end; + +procedure TfrmCPRk.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + tv1.Name + '4', Tv1, 'Ʒֿ'); + Action := cahide; +end; + +procedure TfrmCPRk.FormShow(Sender: TObject); +begin + readCxGrid(self.Caption + tv1.Name + '4', Tv1, 'Ʒֿ'); + SetComboBox(); + InitGrid(); + if fType = 0 then + begin + if GetLSNo(ADOQueryCmd, fkeyNo, 'RK', 'CP_InOut', 3, 1) = False then + begin + Application.MessageBox('ȡʧ!', 'ʾ', 0); + Exit; + end; + inoutNo.Text := 'R' + Trim(RightBStr(fkeyNo, Length(fkeyNo) - 2)); + end; +end; + +procedure TfrmCPRk.TBSaveClick(Sender: TObject); +begin + if cds_main.IsEmpty then + exit; + CRTime.SetFocus; + if trim(CRType.Text) = '' then + begin + application.MessageBox('ͲΪգ', 'ʾϢ', 0); + exit; + end; + + if trim(custName.Text) = '' then + begin + application.MessageBox('ӹΪգ', 'ʾϢ', MB_ICONERROR); + exit; + end; + +// if cds_main.Locate('QtyUnit', '', []) then +// begin +// application.MessageBox('λΪգ', 'ʾϢ', 0); +// exit; +// end; +// if cds_main.Locate('QtyUnit', NULL, []) then +// begin +// application.MessageBox('λΪգ', 'ʾϢ', 0); +// exit; +// end; + {if trim(CRType.Text)='ӹ' then + begin + if cds_main.Locate('fromMainID',NULL,[]) then + begin + application.MessageBox('ӹŲΪգ','ʾϢ',0); + exit; + end; + if cds_main.Locate('fromMainID','',[]) then + begin + application.MessageBox('ӹŲΪգ','ʾϢ',0); + exit; + end; + end;} + if savedate() then + begin + application.MessageBox('ݱɹ', 'ʾϢ'); + ModalResult := 1; + end + else + begin + application.MessageBox('ݱʧܣ', 'ʾϢ', MB_ICONERROR); + end; +end; + +procedure TfrmCPRk.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'MPRTCodeName'; + flagname := 'Ʒ'; + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.ToolButton1Click(Sender: TObject); +//var +// FMJID: string; +begin +// if GetLSNo(self.ADOQueryCmd, FMJID, 'MR', 'CP_InOut_MX', 3, 1) = False then +// begin +// // ADOQueryCmd.Connection.RollbackTrans; +// Application.MessageBox('ȡʧ!', 'ʾ', 0); +// Exit; +// end; + with CDS_Main do + begin + append; +// FieldByName('MJID').Value := trim(FMJID); + FieldbyName('CPType').Value := 'Ʒ'; + // FieldbyName('QtyUnit').Value:='KG'; + post; + end; +{ frmBpJylist:=TfrmBpJylist.create(self); + with frmBpJylist do + begin + fType:=10; + // fckName:=self.fckName; + if showmodal=1 then + begin + self.cds_main.DisableControls; + cds_main.DisableControls; + cds_main.First; + while not cds_main.Eof do + begin + if (cds_main.fieldbyname('ssel').AsBoolean) then //and (not self.cds_main.Locate('MJID',trim(cds_main.fieldbyname('MJID').AsString),[])) + begin + self.cds_main.Append; + // self.cds_main.FieldByName('kcid').Value:=trim(cds_main.fieldbyname('kcid').AsString); + self.cds_main.FieldByName('mainID').Value:=trim(cds_main.fieldbyname('mainID').AsString); + self.cds_main.FieldByName('subID').Value:=trim(cds_main.fieldbyname('subID').AsString); + self.cds_main.FieldByName('MJID').Value:=trim(cds_main.fieldbyname('MJID').AsString); + self.cds_main.FieldByName('MJXH').Value:=trim(cds_main.fieldbyname('MJXH').AsString); + self.cds_main.FieldByName('CPTYPE').Value:=trim(cds_main.fieldbyname('MJType').AsString); + self.cds_main.FieldByName('P_Code').Value:=trim(cds_main.fieldbyname('MprtCode').AsString); + self.cds_main.FieldByName('P_CodeName').Value:=trim(cds_main.fieldbyname('MprtCodeName').AsString); + self.cds_main.FieldByName('P_spec').Value:=trim(cds_main.fieldbyname('Mprtspec').AsString); + // self.cds_main.FieldByName('P_Color').Value:=trim(cds_main.fieldbyname('P_Color').AsString); + // self.cds_main.FieldByName('P_MF').Value:=cds_main.fieldbyname('P_MF').AsFloat; + // self.cds_main.FieldByName('P_KZ').Value:=cds_main.fieldbyname('P_KZ').AsFloat; + self.cds_main.FieldByName('RollNum').Value:=1; + self.cds_main.FieldByName('Qty').Value:=cds_main.fieldbyname('MJLen').AsFloat; + self.cds_main.FieldByName('QtyUnit').Value:=trim(cds_main.fieldbyname('MJTypeother').AsString); + self.cds_main.Post; + end; + cds_main.Next; + end; + cds_main.EnableControls; + self.cds_main.EnableControls; + end; + free; + end;} +end; + +procedure TfrmCPRk.ToolButton2Click(Sender: TObject); +begin + if CDS_Main.IsEmpty then + exit; + CDS_Main.Delete; +end; + +procedure TfrmCPRk.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCPRk.v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin +// try +// frmZDYHelp := TfrmZDYHelp.Create(Application); +// with frmZDYHelp do +// begin +// flag := 'OrdColor'; +// flagname := 'ɫ'; +// V1Name.Caption := ''; +// V1Note.Caption := 'Ӣ'; +// MainType := Trim(DName); +// fnote := True; +// if ShowModal = 1 then +// begin +// Self.CDS_Main.Edit; +// Self.CDS_Main.FieldByName('P_Color').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); +// Self.CDS_Main.Post; +// end; +// end; +// finally +// frmZDYHelp.Free; +// end; +// self.tv1.Controller.EditingController.ShowEdit(); + + frmZdyYS_sel := TfrmZdyYS_sel.create(self); + with frmZdyYS_sel do + begin + if showmodal = 1 then + begin + with CDS_Main do + begin + Edit; + FieldByName('P_Color').value := CDS_HZ.fieldbyname('CodeName').AsString; + Post; + end; + end; + free; + end; +end; + +procedure TfrmCPRk.v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin +// try +// frmZDYHelp:=TfrmZDYHelp.Create(Application); +// with frmZDYHelp do +// begin +// flag:='MPRTCodeName'; +// flagname:='Ʒ'; +// if ShowModal=1 then +// begin +// Self.CDS_Main.Edit; +// Self.CDS_Main.FieldByName('P_CodeName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); +// Self.CDS_Main.FieldByName('P_Code').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); +// end; +// end; +// finally +// frmZDYHelp.Free; +// end; +// self.tv1.Controller.EditingController.ShowEdit(); + try + frmZdyAttachCP := TfrmZdyAttachCP.Create(Application); + with frmZdyAttachCP do + begin + + if ShowModal = 1 then + begin + with CDS_Main do + begin + CDS_Main.Edit; + CDS_Main.fieldbyname('P_Code').Value := Trim(CDS_HZ.fieldbyname('ZDYCode').AsString); + CDS_Main.fieldbyname('P_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); +// CDS_Main.fieldbyname('defstr1').Value := Trim(CDS_HZ.fieldbyname('CYCM').AsString); + CDS_Main.Post; + end; + + with CDS_Sub do + begin + append; + FieldByName('P_Color').Value := Trim(CDS_HZ.fieldbyname('CYYS').AsString); + post; + end; + end; + + end; + finally + frmZdyAttachCP.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); + +end; + +procedure TfrmCPRk.v1P_ColorPropertiesEditValueChanged(Sender: TObject); +var + mvalue: string; +begin +{ mvalue:=TcxTextEdit(Sender).EditingText; + + IF trim(mvalue)='' then exit; + + IF rightBstr(trim(mvalue),1)<>'#'THEN + BEGIn + mvalue:=trim(mvalue)+'#'; + END; + + + + with CDS_Main do + begin + Edit; + FieldByName('P_Color').Value:=Trim(mvalue); + Post; + end; + self.tv1.Controller.EditingController.ShowEdit();} +end; + +procedure TfrmCPRk.custNameBtnClick(Sender: TObject); +begin + if CRType.Text = '˻' then + begin + try + frmZdyAttachment := TfrmZdyAttachment.Create(Application); + with frmZdyAttachment do + begin + if ShowModal = 1 then + begin + custName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + custName.TxtCode := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + end; + end; + finally + frmZdyAttachment.Free; + end; + end + else + begin + try + frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); + with frmZdyAttachGYS do + begin + if ShowModal = 1 then + begin + custName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + custName.TxtCode := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + end; + end; + finally + frmZdyAttachGYS.Free; + end; + end; +end; + +procedure TfrmCPRk.v1QtyPropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := '0'; + end; + FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName); + with CDS_Main do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + Post; + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + frmJGCklistSel := TfrmJGCklistSel.create(self); + with frmJGCklistSel do + begin + cust.text := self.custName.Text; + if showmodal = 1 then + begin + self.CDS_Main.edit; + self.CDS_Main.FieldByName('frommainid').Value := CDS_Main.FieldByName('crno').AsString; + self.CDS_Main.FieldByName('fromsubid').Value := CDS_Main.FieldByName('crid').AsString; + self.CDS_Main.post; + + end; + free; + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.QtyMXKeyPress(Sender: TObject; var Key: Char); +var + fMJXH: string; + fRollNum: integer; + fQty: double; +begin + if Key = #13 then + begin + if strtofloatdef(QtyMX.Text, 0) = 0 then + exit; + + if GetLSNo(self.ADOQueryCmd, fMJXH, 'MX', 'CP_InOut_MX', 4, 1) = False then + begin + // ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡʧ!', 'ʾ', 0); + Exit; + end; + try + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut_MX A'); + sql.Add('where 1=2'); + open; + append; + Fieldbyname('MJID').Value := trim(CDS_Main.fieldbyname('MJID').AsString); + Fieldbyname('MJXH').Value := fMJXH; + Fieldbyname('RollNUm').Value := 1; + Fieldbyname('Qty').Value := strtofloatdef(QtyMX.Text, 0); + Fieldbyname('Qtyunit').Value := trim(CDS_Main.fieldbyname('Qtyunit').AsString); + post; + end; + + with CDS_sub do + begin + append; + Fieldbyname('Qty').Value := strtofloatdef(QtyMX.Text, 0); + post; + end; + if varisnull(tv2.DataController.Summary.FooterSummaryValues[0]) then + begin + fRollNum := 0; + fQty := 0; + end + else + begin + fRollNum := CDS_Sub.RecordCount; + fQty := tv2.DataController.Summary.FooterSummaryValues[0]; + end; + with CDS_Main do + begin + EDIT; + FieldByName('RollNum').Value := fRollNum; + Fieldbyname('Qty').Value := fQty; + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + post; + end; + QtyMX.Text := ''; + except + end; + end; +end; + +procedure TfrmCPRk.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin +// Initsub(); +end; + +procedure TfrmCPRk.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +var + FROLLnUM: INTEGER; + FQTY: double; +begin + if CDS_Sub.IsEmpty then + exit; + try + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_InOut_MX '); + sql.Add('where MJXH=' + quotedstr(trim(CDS_Sub.fieldbyname('MJXH').AsString))); + execsql; + end; + Initsub(); + if varisnull(tv2.DataController.Summary.FooterSummaryValues[0]) then + begin + FROLLnUM := 0; + FQTY := 0; + end + else + begin + FROLLnUM := CDS_Sub.RecordCount; + FQTY := tv2.DataController.Summary.FooterSummaryValues[0]; + end; + with CDS_Main do + begin + EDIT; + FieldByName('RollNum').Value := FROLLnUM; + Fieldbyname('Qty').Value := FQTY; + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + post; + end; + except + application.MessageBox('ɾʧ', 'ʾϢ', 0) + end; +end; + +procedure TfrmCPRk.v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + frmProductOrderNewListSEl := TfrmProductOrderNewListSEl.create(self); + with frmProductOrderNewListSEl do + begin + FCloth := 1; + if showmodal = 1 then + begin + Order_Main.First; + while not Order_Main.Eof do + begin + if Order_Main.fieldbyname('ssel').AsBoolean then + begin + CDS_Main.edit; + CDS_Main.FieldByName('orderNo').Value := trim(order_main.fieldbyname('orderNo').asstring); + CDS_Main.FieldByName('mainID').Value := trim(order_main.fieldbyname('mainID').asstring); + CDS_Main.FieldByName('subID').Value := trim(order_main.fieldbyname('subID').asstring); + CDS_Main.FieldByName('P_Code').Value := trim(order_main.fieldbyname('prtcode').asstring); + CDS_Main.FieldByName('P_CodeName').Value := trim(order_main.fieldbyname('prtCodeName').asstring); + CDS_Main.FieldByName('P_Spec').Value := trim(order_main.fieldbyname('prtspec').asstring); + CDS_Main.FieldByName('P_Color').Value := trim(order_main.fieldbyname('prtcolor').asstring); +// CDS_Main.FieldByName('P_EColor').Value := trim(order_main.fieldbyname('SOrdDefStr4').asstring); //ɫӢ + CDS_Main.FieldByName('defstr1').Value := trim(order_main.fieldbyname('Sorddefstr5').asstring); + CDS_Main.FieldByName('qty').Value := trim(order_main.fieldbyname('PRTOrderQty').asstring); + + CDS_Main.post; + end; + Order_Main.Next; + end; + + free; + +// CDS_Main.Edit; +// CDS_Main.FieldByName('orderNo').Value := trim(order_main.fieldbyname('orderNo').asstring); +// CDS_Main.FieldByName('mainID').Value := trim(order_main.fieldbyname('mainID').asstring); +// CDS_Main.FieldByName('subID').Value := trim(order_main.fieldbyname('subID').asstring); +// CDS_Main.FieldByName('P_Code').Value := trim(order_main.fieldbyname('prtcode').asstring); +// CDS_Main.FieldByName('P_CodeName').Value := trim(order_main.fieldbyname('prtCodeName').asstring); +// CDS_Main.FieldByName('P_Spec').Value := trim(order_main.fieldbyname('prtspec').asstring); +//// CDS_Main.FieldByName('P_Color').Value := trim(order_main.fieldbyname('prtcolor').asstring); +//// CDS_Main.FieldByName('defstr1').Value := trim(order_main.fieldbyname('Sorddefstr5').asstring); +//// CDS_Main.FieldByName('P_MF').Value := trim(order_main.fieldbyname('PRTMF').asstring); +//// CDS_Main.FieldByName('P_KZ').Value := trim(order_main.fieldbyname('PRTKZ').asstring); +// CDS_Main.post; + end; +// free; + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.v1QtyUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'QtyUnitType'; + flagname := 'λ'; + V1Name.Caption := 'λ'; + fnote := false; + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('QtyUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.CDS_Main.Post; + end; + end; + finally + frmZDYHelp.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + frmZdyCMZ_sel := TfrmZdyCMZ_sel.create(self); + with frmZdyCMZ_sel do + begin + if showmodal = 1 then + begin + with CDS_Main do + begin + Edit; + FieldByName('defstr1').value := cdssub.fieldbyname('SizeSpec').AsString; + Post; + end; + end; + free; + end; +end; + +procedure TfrmCPRk.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); +begin + initsub(); +end; + +procedure TfrmCPRk.InitMX(); +begin + try + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_RK_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''',''' + Cds_main.fieldbyname('CRNO').AsString + ''',''' + Cds_main.fieldbyname('DRCKNO').AsString + ''',''' + Cds_main.fieldbyname('DRCKName').AsString + ''' '); +// ShowMessage(SQL.text); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Sub); + SInitCDSData20(adoqueryTmp, CDS_Sub); + finally + end; +end; + +procedure TfrmCPRk.TV2Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + frmZdyYS_sel := TfrmZdyYS_sel.create(self); + with frmZdyYS_sel do + begin + if showmodal = 1 then + begin + with CDS_Sub do + begin + Edit; + FieldByName('P_Color').value := CDS_HZ.fieldbyname('CodeName').AsString; + Post; + end; + end; + free; + end; +end; + +procedure TfrmCPRk.ToolButton3Click(Sender: TObject); +begin + with CDS_Sub do + begin + append; + post; + end; +end; + +procedure TfrmCPRk.ToolButton4Click(Sender: TObject); +begin + if CDS_Sub.IsEmpty then + exit; + CDS_Sub.Delete; +end; + +procedure TfrmCPRk.TV2Column2PropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; + Qty1, Qty2, Qty3, Qty4, Qty5, Qty6, Qty7, Qty8, Qty9, Qty10, Qty11, Qty12, Qty13, Qty14, Qty15, ZQty, a: Integer; + Fprice, Fmoney: Double; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := '0'; + end; + FFieldName := Trim(Tv3.Controller.FocusedColumn.DataBinding.FilterFieldName); + + with CDS_Sub do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + Post; + end; + + Qty1 := StrToIntDef(CDS_Sub.fieldbyname('Size1').asstring, 0); + Qty2 := StrToIntDef(CDS_Sub.fieldbyname('Size2').asstring, 0); + Qty3 := StrToIntDef(CDS_Sub.fieldbyname('Size3').asstring, 0); + Qty4 := StrToIntDef(CDS_Sub.fieldbyname('Size4').asstring, 0); + Qty5 := StrToIntDef(CDS_Sub.fieldbyname('Size5').asstring, 0); + Qty6 := StrToIntDef(CDS_Sub.fieldbyname('Size6').asstring, 0); + Qty7 := StrToIntDef(CDS_Sub.fieldbyname('Size7').asstring, 0); + Qty8 := StrToIntDef(CDS_Sub.fieldbyname('Size8').asstring, 0); + Qty9 := StrToIntDef(CDS_Sub.fieldbyname('Size9').asstring, 0); + Qty10 := StrToIntDef(CDS_Sub.fieldbyname('Size10').asstring, 0); + Qty11 := StrToIntDef(CDS_Sub.fieldbyname('Size11').asstring, 0); + Qty12 := StrToIntDef(CDS_Sub.fieldbyname('Size12').asstring, 0); + Qty13 := StrToIntDef(CDS_Sub.fieldbyname('Size13').asstring, 0); + Qty14 := StrToIntDef(CDS_Sub.fieldbyname('Size14').asstring, 0); + Qty15 := StrToIntDef(CDS_Sub.fieldbyname('Size15').asstring, 0); + ZQty := Qty1 + Qty2 + Qty3 + Qty4 + Qty5 + Qty6 + Qty7 + Qty8 + Qty9 + Qty10 + Qty11 + Qty12 + Qty13 + Qty14 + Qty15; + + with CDS_Sub do + begin + Edit; + FieldByName('ZQty').Value := ZQty; + Post; + end; + + tv3.Controller.EditingController.ShowEdit(); +// CDS_Main.FieldByName('Qty').Value + a := TV3.DataController.Summary.FooterSummaryValues[15]; + + CDS_Main.Edit; + CDS_Main.FieldByName('Qty').Value := a; + CDS_Main.post; + + Fprice := StrToIntDef(CDS_Main.fieldbyname('Price').asstring, 0); + + Fmoney := Fprice * a; + + with CDS_Main do + begin + Edit; + FieldByName('Money').Value := Fmoney; + Post; + end; +end; + +procedure TfrmCPRk.v1PricePropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := '0'; + end; + FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName); + with CDS_Main do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + Post; + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.ToolButton5Click(Sender: TObject); +begin + frmProductOrderNewListSEl := TfrmProductOrderNewListSEl.create(self); + with frmProductOrderNewListSEl do + begin + FCloth := 1; + if showmodal = 1 then + begin + Order_Main.First; + while not Order_Main.Eof do + begin + if Order_Main.fieldbyname('ssel').AsBoolean then + begin + CDS_Main.Append; + CDS_Main.FieldByName('orderNo').Value := trim(order_main.fieldbyname('orderNo').asstring); + CDS_Main.FieldByName('mainID').Value := trim(order_main.fieldbyname('mainID').asstring); + CDS_Main.FieldByName('subID').Value := trim(order_main.fieldbyname('subID').asstring); + CDS_Main.FieldByName('P_Code').Value := trim(order_main.fieldbyname('prtcode').asstring); + CDS_Main.FieldByName('P_CodeName').Value := trim(order_main.fieldbyname('prtCodeName').asstring); + CDS_Main.FieldByName('P_Spec').Value := trim(order_main.fieldbyname('prtspec').asstring); + CDS_Main.FieldByName('P_Color').Value := trim(order_main.fieldbyname('prtcolor').asstring); +// CDS_Main.FieldByName('P_EColor').Value := trim(order_main.fieldbyname('SOrdDefStr4').asstring); //ɫӢ + CDS_Main.FieldByName('defstr1').Value := trim(order_main.fieldbyname('Sorddefstr5').asstring); + CDS_Main.FieldByName('qty').Value := trim(order_main.fieldbyname('PRTOrderQty').asstring); + CDS_Main.FieldByName('Price').Value := trim(order_main.fieldbyname('PRTPrice').asstring); + CDS_Main.post; + end; + Order_Main.Next; + end; + free; + end; + + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCPRk.Tv1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmCPKWListSel := TfrmCPKWListSel.Create(Application); + with frmCPKWListSel do + begin + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('DRCKName').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + end; + end; + finally + frmCPKWListSel.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +end. + diff --git a/成品仓库/U_CPRklist.dfm b/成品仓库/U_CPRklist.dfm new file mode 100644 index 0000000..9e8f8a1 --- /dev/null +++ b/成品仓库/U_CPRklist.dfm @@ -0,0 +1,873 @@ +object frmCPRklist: TfrmCPRklist + Left = 394 + Top = 212 + Width = 1265 + Height = 518 + Caption = #25104#21697#20837#24211 + 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 = 1249 + 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 = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #26597#35810 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + Visible = False + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #25104#21697#20837#24211 + ImageIndex = 3 + OnClick = TBAddClick + end + object TBAddSM: TToolButton + Left = 213 + Top = 0 + AutoSize = True + Caption = #25195#25551#20837#24211 + ImageIndex = 3 + Visible = False + OnClick = TBAddSMClick + end + object TBEdit: TToolButton + Left = 300 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 363 + Top = 0 + AutoSize = True + Caption = #20316#24223 + ImageIndex = 17 + OnClick = TBDelClick + end + object TBCdel: TToolButton + Left = 426 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 107 + OnClick = TBCdelClick + end + object TBExport: TToolButton + Left = 489 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 552 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 615 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1249 + Height = 61 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 35 + Top = 15 + Width = 52 + Height = 12 + Caption = #20837#24211#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 = 76 + Top = 36 + Width = 13 + Height = 12 + Caption = #33267 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label3: TLabel + Left = 624 + Top = 16 + 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 Label5: TLabel + Left = 264 + Top = 16 + Width = 52 + Height = 12 + Caption = #20837#24211#31867#22411 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 288 + Top = 100 + Width = 24 + Height = 12 + Caption = #20179#24211 + end + object Label7: TLabel + Left = 264 + Top = 40 + Width = 52 + Height = 12 + Caption = #20837#24211#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label8: TLabel + Left = 440 + Top = 16 + Width = 72 + Height = 12 + Caption = #21152#24037#21378'/'#23458#25143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label9: TLabel + Left = 440 + Top = 40 + Width = 53 + Height = 12 + Caption = #35746' '#21333' '#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label11: TLabel + Left = 620 + Top = 40 + Width = 52 + Height = 12 + Caption = #20135#21697#32534#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 88 + Top = 11 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 88 + Top = 35 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object P_CodeName: TEdit + Tag = 2 + Left = 680 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 2 + OnChange = P_CodeNameChange + end + object CRType: TComboBox + Tag = 2 + Left = 320 + Top = 12 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 3 + OnChange = P_CodeNameChange + Items.Strings = ( + '' + #29983#20135#20837#24211) + end + object ckName: TComboBox + Left = 320 + Top = 96 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 4 + Text = #26679#21697#20179#24211 + Items.Strings = ( + #26679#21697#20179#24211) + end + object inoutNo: TEdit + Tag = 2 + Left = 320 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 5 + OnChange = P_CodeNameChange + end + object custName: TEdit + Tag = 2 + Left = 516 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 6 + OnChange = P_CodeNameChange + end + object orderNo: TEdit + Tag = 2 + Left = 516 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 7 + OnChange = P_CodeNameChange + end + object P_Code: TEdit + Tag = 2 + Left = 680 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 8 + OnChange = P_CodeNameChange + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 113 + Width = 1249 + Height = 155 + Align = alClient + TabOrder = 2 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnFocusedRecordChanged = Tv1FocusedRecordChanged + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1P_CodeName + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty + end + item + Kind = skSum + Column = v1money + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v1CRNO: TcxGridDBColumn + Caption = #20837#24211#32534#21495 + DataBinding.FieldName = 'CRNO' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1CRID: TcxGridDBColumn + Caption = #24207#27425#21495 + DataBinding.FieldName = 'CRID' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1INoutNo: TcxGridDBColumn + Caption = #20837#24211#21333#21495 + DataBinding.FieldName = 'INoutNo' + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Width = 79 + end + object v1Column4: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'orderNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 94 + end + object v1custName: TcxGridDBColumn + Caption = #21152#24037#21378'/'#23458#25143 + DataBinding.FieldName = 'custName' + HeaderAlignmentHorz = taCenter + Width = 89 + end + object v1CRTime: TcxGridDBColumn + Caption = #20837#24211#26085#26399 + DataBinding.FieldName = 'CRTime' + Width = 60 + end + object v1CRType: TcxGridDBColumn + Caption = #20837#24211#31867#22411 + DataBinding.FieldName = 'CRType' + HeaderAlignmentHorz = taCenter + end + object v1MJID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'MJID' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1MJXH: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'MJXH' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1P_Code: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'P_Code' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1Column1: TcxGridDBColumn + Caption = #25209#27425 + DataBinding.FieldName = 'batchNo' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1P_CodeName: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'P_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1P_SPEC: TcxGridDBColumn + Caption = #27454#21495 + DataBinding.FieldName = 'P_SPEC' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 90 + end + object Tv1Column4: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column5: TcxGridDBColumn + Caption = #39068#33394#33521#25991 + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Qty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + HeaderAlignmentHorz = taCenter + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 50 + end + object v1Column2: TcxGridDBColumn + Caption = #23610#23544'/'#23610#30721 + DataBinding.FieldName = 'defstr1' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 71 + end + object Tv1Column2: TcxGridDBColumn + Caption = #20179#24211#32534#21495 + DataBinding.FieldName = 'DRCKNO' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object Tv1Column3: TcxGridDBColumn + Caption = #20179#24211#21517#31216 + DataBinding.FieldName = 'DRCKName' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object v1Column3: TcxGridDBColumn + Caption = #24037#21345#21495 + DataBinding.FieldName = 'defstr2' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1CPType: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'CPType' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Price: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1money: TcxGridDBColumn + Caption = #37329#39069 + DataBinding.FieldName = 'money' + HeaderAlignmentHorz = taCenter + Styles.Content = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Footer = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Header = CPCK_DataLink.cxStyle_fontclFuchsia + Width = 60 + end + object v1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1Filler: TcxGridDBColumn + Caption = #25805#20316#21592 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1FillTime: TcxGridDBColumn + Caption = #25805#20316#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Width = 75 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 93 + Width = 1249 + Height = 20 + Align = alTop + TabOrder = 3 + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 0 + Properties.Tabs.Strings = ( + #26410#20316#24223 + #24050#20316#24223 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectRight = 0 + ClientRectTop = 0 + end + object cxGrid2: TcxGrid + Left = 0 + Top = 268 + Width = 1249 + Height = 211 + Align = alBottom + TabOrder = 4 + object TV2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource2 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV2Column14 + end + item + Kind = skSum + Column = TV2Column2 + end + item + Kind = skSum + Column = TV2Column3 + end + item + Kind = skSum + Column = TV2Column4 + end + item + Kind = skSum + Column = TV2Column5 + end + item + Kind = skSum + Column = TV2Column6 + end + item + Kind = skSum + Column = TV2Column7 + end + item + Kind = skSum + Column = TV2Column8 + end + item + Kind = skSum + Column = TV2Column9 + end + item + Kind = skSum + Column = TV2Column10 + end + item + Kind = skSum + Column = TV2Column11 + end + item + Kind = skSum + Column = TV2Column12 + end + item + Kind = skSum + Column = TV2Column13 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsData.Editing = False + OptionsSelection.CellSelect = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV2Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column14: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column17: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV2Column2: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column3: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column4: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column5: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column6: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column7: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column15: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column8: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column9: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column10: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column11: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column12: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column13: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column16: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'Size14' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 680 + Top = 8 + end + object ADOQueryTmp: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 796 + Top = 12 + end + object DataSource1: TDataSource + DataSet = CDS_Main + Left = 652 + Top = 1 + end + object CDS_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 716 + Top = 1 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 860 + Top = 65528 + end + object AdoPrint: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 908 + Top = 76 + end + object AdoPrint1: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 1012 + Top = 48 + end + object RMDB_MD: TRMDBDataSet + Visible = True + DataSet = AdoPrint1 + Left = 876 + Top = 64 + end + object RMDB_Main: TRMDBDataSet + Visible = True + DataSet = AdoPrint + Left = 952 + Top = 56 + end + object RMGridReport1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, 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 + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 896 + Top = 8 + ReportData = {} + 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 = 956 + end + object CDS_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 904 + Top = 353 + end + object DataSource2: TDataSource + DataSet = CDS_Sub + Left = 840 + Top = 353 + end + object ADOQuerySub: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 760 + Top = 380 + end +end diff --git a/成品仓库/U_CPRklist.pas b/成品仓库/U_CPRklist.pas new file mode 100644 index 0000000..388f39c --- /dev/null +++ b/成品仓库/U_CPRklist.pas @@ -0,0 +1,564 @@ +unit U_CPRklist; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, + cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView, + cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, + cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, RM_Common, + RM_Class, RM_e_Xls, RM_GridReport, RM_System, RM_Dataset, cxPC, 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 + TfrmCPRklist = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBExport: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1P_CodeName: TcxGridDBColumn; + v1P_SPEC: TcxGridDBColumn; + v1Qty: TcxGridDBColumn; + v1Note: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + v1CRType: TcxGridDBColumn; + v1CRTime: TcxGridDBColumn; + v1CRNO: TcxGridDBColumn; + v1CRID: TcxGridDBColumn; + v1Filler: TcxGridDBColumn; + v1FillTime: TcxGridDBColumn; + Label2: TLabel; + Label3: TLabel; + P_CodeName: TEdit; + CRType: TComboBox; + Label5: TLabel; + ADOQueryCmd: TADOQuery; + ADOQueryTmp: TADOQuery; + DataSource1: TDataSource; + CDS_Main: TClientDataSet; + cxGridPopupMenu1: TcxGridPopupMenu; + v1MJID: TcxGridDBColumn; + v1MJXH: TcxGridDBColumn; + v1CPType: TcxGridDBColumn; + ckName: TComboBox; + Label6: TLabel; + v1P_Code: TcxGridDBColumn; + TBAddSM: TToolButton; + v1INoutNo: TcxGridDBColumn; + Label7: TLabel; + inoutNo: TEdit; + v1custName: TcxGridDBColumn; + v1Price: TcxGridDBColumn; + v1money: TcxGridDBColumn; + custName: TEdit; + Label8: TLabel; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + AdoPrint: TADOQuery; + AdoPrint1: TADOQuery; + RMDB_MD: TRMDBDataSet; + RMDB_Main: TRMDBDataSet; + RMGridReport1: TRMGridReport; + RMXLSExport1: TRMXLSExport; + cxTabControl1: TcxTabControl; + TBCdel: TToolButton; + v1Column4: TcxGridDBColumn; + orderNo: TEdit; + Label9: TLabel; + P_Code: TEdit; + Label11: TLabel; + Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + cxGrid2: TcxGrid; + TV2: TcxGridDBTableView; + TV2Column1: TcxGridDBColumn; + TV2Column14: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + TV2Column5: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + TV2Column8: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; + TV2Column11: TcxGridDBColumn; + TV2Column12: TcxGridDBColumn; + TV2Column13: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + CDS_Sub: TClientDataSet; + DataSource2: TDataSource; + ADOQuerySub: TADOQuery; + TV2Column15: TcxGridDBColumn; + TV2Column16: TcxGridDBColumn; + TV2Column17: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure P_CodeNameChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBAddSMClick(Sender: TObject); + procedure cxTabControl1Change(Sender: TObject); + procedure TBCdelClick(Sender: TObject); + procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); + private + procedure InitGrid(); + procedure InitSub(); + procedure SetComboBox(); + procedure SetStatus(); + { Private declarations } + public + fCKName: string; + { Public declarations } + end; + +var + frmCPRklist: TfrmCPRklist; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_BpRk, U_BpSmRk, U_CPRk; +{$R *.dfm} + +procedure TfrmCPRklist.SetStatus(); +begin + TBedit.Visible := false; + Tbdel.Visible := false; + tbcdel.Visible := false; + case cxTabControl1.TabIndex of + 0: + begin + TBedit.Visible := true; + Tbdel.Visible := true; + end; + 1: + begin + tbcdel.Visible := true; + end; + end; +end; + +procedure TfrmCPRklist.SetComboBox(); +begin + ckName.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCK'' '); + if trim(fCKName) <> '' then + sql.Add('and zdyName=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + ckName.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if ckName.Items.Count > 0 then + ckName.ItemIndex := 0; + + CRType.Items.Clear; + CRType.Items.Add(''); + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPRKTYPE'''); + if trim(fCKName) <> '' then + sql.Add('and note=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + CRType.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if CRType.Items.Count > 0 then + CRType.ItemIndex := 0; +end; + +procedure TfrmCPRklist.InitGrid(); +begin + try + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add(' exec P_Get_CP_RK ''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''',''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''',''' + inttostr(cxTabControl1.TabIndex) + ''' '); + +// sql.Add('select A.*,'); +// sql.Add('orderNo=(select Top 1 orderNo from JYOrder_Main X where X.MainID=A.MainID )'); +// +// sql.Add('from CP_InOut A'); +// sql.Add('where CRTime>=''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''' '); +// sql.Add('and CRTime<''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''' '); +// sql.Add('and CRFlag='''' '); +// if trim(FckName) <> '' then +// sql.Add('and ckName=' + quotedstr(trim(fckName))); +// if cxTabControl1.TabIndex = 0 then +// sql.Add('and valid=''Y'' '); +// if cxTabControl1.TabIndex = 1 then +// sql.Add('and valid=''N'' '); +// ShowMessage(sql.Text); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); + finally + end; +end; + +procedure TfrmCPRklist.InitSub(); +begin + if CDS_Main.IsEmpty then + Exit; + try + with ADOQuerySub do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_RK_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''',''' + Cds_main.fieldbyname('CRNO').AsString + ''' '); + sql.Add(' ,''' + cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + cds_main.fieldbyname('DRCKName').AsString + ''' '); +// ShowMessage(sql.text); + open; + end; + SCreateCDS20(ADOQuerySub, CDS_Sub); + SInitCDSData20(ADOQuerySub, CDS_Sub); + finally + end; +end; + +procedure TfrmCPRklist.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + Action := cafree; +end; + +procedure TfrmCPRklist.FormDestroy(Sender: TObject); +begin + frmCpRklist := nil; +end; + +procedure TfrmCPRklist.TBAddClick(Sender: TObject); +begin + frmCpRk := TfrmCpRk.create(self); + with frmCpRk do + begin + fkeyNo := ''; + fType := 0; + fckName := self.fckName; + if showmodal = 1 then + begin + TBRafresh.Click; + self.CDS_Main.Locate('crNo', trim(fkeyNo), []); + end; + free; + end; +end; + +procedure TfrmCPRklist.P_CodeNameChange(Sender: TObject); +begin + if ADOQueryTmp.Active = False then + Exit; + SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryTmp, CDS_Main); + SInitCDSData20(ADOQueryTmp, CDS_Main); +end; + +procedure TfrmCPRklist.FormShow(Sender: TObject); +begin + readCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + SetComboBox(); + SetStatus(); + InitGrid(); +end; + +procedure TfrmCPRklist.FormCreate(Sender: TObject); +begin + BegDate.Date := DServerDate - 7; + EndDate.Date := DServerDate; + cxGrid1.Align := alclient; + +end; + +procedure TfrmCPRklist.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCPRklist.TBEditClick(Sender: TObject); +begin + if cds_main.IsEmpty then + exit; + if Trim(CDS_Main.fieldbyname('CRType').AsString) = Trim('ӹ') then + begin + Application.MessageBox('˵Ǽӹ⣬޸ģ', 'ʾ', 0); + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add(' select * from YF_Money_CR A'); + SQL.Add(' where A.mainid=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sql.Add(' and status>=''1'' '); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('Ӧûгˣ޸ģ', 'ʾ', 0); + Exit; + end; +{ + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from CP_InOut A'); + SQL.Add('where A.kcid='''+Trim(CDS_Main.fieldbyname('kcid').AsString)+''' '); + sQL.Add('and A.CRFlag='''''); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('Ѳݣ޸ģ','ʾ',0); + Exit; + end; } + + frmCPRk := TfrmCPRk.create(self); + with frmCPRk do + begin + fkeyNo := self.cds_main.fieldbyname('CRNO').AsString; + FCode := self.cds_main.fieldbyname('P_Code').AsString; + FCodeName := self.cds_main.fieldbyname('P_Codename').AsString; + FDRCKNO := self.cds_main.fieldbyname('DRCKNO').AsString; + FDRCKName := self.cds_main.fieldbyname('DRCKName').AsString; + fType := 1; + fckName := self.fckName; + if showmodal = 1 then + begin + TBRafresh.Click; + self.CDS_Main.Locate('crNo', trim(fkeyNo), []); + end; + free; + end; +end; + +procedure TfrmCPRklist.TBDelClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + { if Trim(CDS_Main.fieldbyname('Filler').AsString)<>Trim(DName) then + begin + Application.MessageBox('ܲ˵!','ʾ',0); + Exit; + end; } + if Trim(CDS_Main.fieldbyname('CRType').AsString) = Trim('ӹ') then + begin + Application.MessageBox('˵Ǽӹ⣬ϣ', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add(' select * from YF_Money_CR A'); + SQL.Add(' where A.mainid=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sql.Add(' and status>=''1'' '); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('Ӧûгˣϣ', 'ʾ', 0); + Exit; + end; + + if Application.MessageBox('ȷҪ', 'ʾ', 32 + 4) <> IDYES then + Exit; + + try + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + SQL.Add('where mainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + 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('delete from CP_kc '); + SQL.Add('where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + SQL.Add('and ISNULL(P_Code,'''')=''' + trim(CDS_Main.fieldbyname('P_Code').AsString) + ''' '); + SQL.Add('and ISNULL(P_CodeName,'''')=''' + trim(CDS_Main.fieldbyname('P_CodeName').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKNO,'''')=''' + trim(CDS_Main.fieldbyname('DRCKNO').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKName,'''')=''' + trim(CDS_Main.fieldbyname('DRCKName').AsString) + ''' '); + + sql.Add('update CP_InOut SET valid=''N'' '); + SQL.Add('where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + SQL.Add('and ISNULL(P_Code,'''')=''' + trim(CDS_Main.fieldbyname('P_Code').AsString) + ''' '); + SQL.Add('and ISNULL(P_CodeName,'''')=''' + trim(CDS_Main.fieldbyname('P_CodeName').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKNO,'''')=''' + trim(CDS_Main.fieldbyname('DRCKNO').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKName,'''')=''' + trim(CDS_Main.fieldbyname('DRCKName').AsString) + ''' '); + execsql; + end; + TBRafresh.Click; + except + Application.MessageBox('ɾʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCPRklist.TBRafreshClick(Sender: TObject); +begin + initGrid(); +end; + +procedure TfrmCPRklist.TBPrintClick(Sender: TObject); +var + filepath: string; +begin + if CDS_Main.IsEmpty then + exit; + if CDS_Main.FieldByName('CRType').AsString <> '˻' then + begin + application.MessageBox('˻⣬ܴӡ뵥', 'ʾϢ', 0); + exit; + end; + + with AdoPrint do + begin + close; + sql.Clear; + sql.Add('select A.* from CP_InOut A'); + sql.Add('where inoutNO=' + quotedstr(trim(CDS_Main.fieldbyname('inoutNO').AsString))); + open; + end; + + with AdoPrint1 do + begin + close; + sql.Clear; + sql.Add('exec P_Print_cpCkMd '); + sql.Add('@inoutNo=' + quotedstr(trim(CDS_Main.fieldbyname('inoutNO').AsString))); + sql.Add(',@flag=' + quotedstr(trim(''))); + open; + end; + + try + filepath := ExtractFilePath(Application.ExeName) + 'report\˻뵥.rmf'; + if not FileExists(Pchar(filepath)) then + begin + application.MessageBox(pchar('ļ[' + filepath + ']ڣ'), 'ʾϢ', MB_IConError); + exit; + end; + RMVariables['dtxz'] := FormatDateTime('yyyy-mm-dd', date()); + RMVariables['zdr'] := trim(DName); + RMVariables['Filler'] := trim(CDS_Main.fieldbyname('Filler').AsString); + RMGridReport1.LoadFromFile(filepath); + RMGridReport1.ShowReport; + finally + + end; +end; + +procedure TfrmCPRklist.TBExportClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxgrid1); +end; + +procedure TfrmCPRklist.TBAddSMClick(Sender: TObject); +begin + frmBpSmRk := TfrmBpSmRk.create(self); + with frmBpSmRk do + begin + fkeyNo := ''; + fType := 0; + fckName := self.fckName; + if showmodal = 1 then + begin + TBRafresh.Click; + // self.CDS_Main.Locate('crNo',trim(fkeyNo),[]) ; + end; + free; + end; +end; + +procedure TfrmCPRklist.cxTabControl1Change(Sender: TObject); +begin + SetStatus(); + InitGrid(); +end; + +procedure TfrmCPRklist.TBCdelClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + exit; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + + try + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from CP_InOut where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + SQL.Add('and ISNULL(P_Code,'''')=''' + trim(CDS_Main.fieldbyname('P_Code').AsString) + ''' '); + SQL.Add('and ISNULL(P_CodeName,'''')=''' + trim(CDS_Main.fieldbyname('P_CodeName').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKNO,'''')=''' + trim(CDS_Main.fieldbyname('DRCKNO').AsString) + ''' '); + SQL.Add('and ISNULL(DRCKName,'''')=''' + trim(CDS_Main.fieldbyname('DRCKName').AsString) + ''' '); + execsql; + end; + TBRafresh.Click; + except + Application.MessageBox('ɾʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCPRklist.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); +begin + initsub(); +end; + +end. + diff --git a/成品仓库/U_ContractSelList.dfm b/成品仓库/U_ContractSelList.dfm new file mode 100644 index 0000000..9da52a3 --- /dev/null +++ b/成品仓库/U_ContractSelList.dfm @@ -0,0 +1,443 @@ +object frmContractSelList: TfrmContractSelList + Left = 319 + Top = 121 + Width = 1348 + Height = 600 + Align = alClient + Caption = #35746#21333#21512#21516#36873#25321 + 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 + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1332 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 9 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object ToolButton2: TToolButton + Left = 126 + Top = 0 + Caption = #36873#25321 + ImageIndex = 16 + OnClick = ToolButton2Click + end + object TBClose: TToolButton + Left = 185 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 74 + Width = 1332 + Height = 487 + Align = alClient + TabOrder = 1 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + Column = v1PRTOrderQty + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + Styles.Inactive = CPCK_DataLink.SHuangSe + Styles.IncSearch = CPCK_DataLink.SHuangSe + Styles.Selection = CPCK_DataLink.SHuangSe + Styles.Header = CPCK_DataLink.Default + object v1Column4: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + Visible = False + HeaderAlignmentHorz = taCenter + Width = 49 + end + object v1Column13: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 59 + end + object v1ConNo: TcxGridDBColumn + Caption = #21512#21516#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 77 + end + object v1Column1: TcxGridDBColumn + Caption = #20844#21496#25260#22836 + DataBinding.FieldName = 'SYRName' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 97 + end + object v1OrdDate: TcxGridDBColumn + Caption = #21046#21333#26085#26399 + DataBinding.FieldName = 'OrdDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 76 + end + object v1CustomerNoName: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'CustomerNoName' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 73 + end + object v1Column7: TcxGridDBColumn + Caption = 'PO#' + DataBinding.FieldName = 'KHConNO' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 71 + end + object v1Column10: TcxGridDBColumn + Caption = #27454#21495 + DataBinding.FieldName = 'styleNo' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 92 + end + object v1Column14: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'PRTColor' + HeaderAlignmentHorz = taCenter + Width = 71 + end + object v1Column15: TcxGridDBColumn + Caption = #39068#33394#33521#25991 + DataBinding.FieldName = 'SOrdDefStr4' + HeaderAlignmentHorz = taCenter + Width = 64 + end + object v1Column17: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'PRTColor' + HeaderAlignmentHorz = taCenter + Width = 67 + end + object v1Column18: TcxGridDBColumn + Caption = #23610#23544'/'#23610#30721 + DataBinding.FieldName = 'SOrdDefStr5' + HeaderAlignmentHorz = taCenter + Width = 74 + end + object v1Column16: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'PRTPrice' + HeaderAlignmentHorz = taCenter + Width = 85 + end + object v1MPRTCodeName: TcxGridDBColumn + Caption = #21697#21517 + DataBinding.FieldName = 'PrtCodeName' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 83 + end + object v1Column9: TcxGridDBColumn + Caption = #35268#26684#25104#20998 + DataBinding.FieldName = 'PRTSpec' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 67 + end + object v1Column11: TcxGridDBColumn + Caption = #38376#24133 + DataBinding.FieldName = 'PRTMF' + HeaderAlignmentHorz = taCenter + HeaderGlyphAlignmentHorz = taCenter + Options.Focusing = False + Width = 75 + end + object v1Column12: TcxGridDBColumn + Caption = #20811#37325 + DataBinding.FieldName = 'PRTKZ' + HeaderAlignmentHorz = taCenter + HeaderGlyphAlignmentHorz = taCenter + Options.Focusing = False + Width = 84 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'PRTOrderQty' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 67 + end + object v1Column2: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'OrderUnit' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 60 + end + object v1PRTPrice: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'PRTPrice' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 71 + end + object v1PRTColor: TcxGridDBColumn + Caption = #24065#31181 + DataBinding.FieldName = 'PriceUnit' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Styles.Header = CPCK_DataLink.Default + Width = 63 + end + object v1Column3: TcxGridDBColumn + Caption = #23457#26680#20154 + DataBinding.FieldName = 'Chker' + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 58 + end + object v1Column5: TcxGridDBColumn + Caption = #23457#26680#26102#38388 + DataBinding.FieldName = 'ChkTime' + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 60 + end + object v1Column6: TcxGridDBColumn + Caption = #23457#26680#29366#24577 + DataBinding.FieldName = 'ChkStatus' + Visible = False + HeaderAlignmentHorz = taCenter + VisibleForCustomization = False + Width = 56 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1332 + Height = 42 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 2 + object Label1: TLabel + Left = 23 + Top = 15 + Width = 52 + Height = 12 + Caption = #21046#21333#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 407 + Top = 15 + Width = 26 + Height = 12 + Caption = #23458#25143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label9: TLabel + Left = 265 + Top = 15 + Width = 39 + Height = 12 + Caption = #21512#21516#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 543 + Top = 15 + Width = 26 + Height = 12 + Caption = #31867#22411 + 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 = 11 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 163 + Top = 10 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object CustomerNoName: TEdit + Tag = 2 + Left = 436 + Top = 11 + Width = 77 + Height = 20 + TabOrder = 2 + OnChange = CustomerNoNameChange + end + object MPRTType: TComboBox + Tag = 1 + Left = 572 + Top = 11 + Width = 88 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + TabOrder = 3 + OnChange = CustomerNoNameChange + Items.Strings = ( + #22806#38144 + #20869#38144 + '') + end + object FConNo: TEdit + Tag = 2 + Left = 308 + Top = 11 + Width = 77 + Height = 20 + TabOrder = 4 + OnChange = CustomerNoNameChange + OnKeyPress = FConNoKeyPress + end + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 504 + Top = 184 + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 320 + Top = 176 + end + object ADOQueryMain: TADOQuery + Connection = CPCK_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 344 + Top = 176 + end + object ADOQueryTemp: TADOQuery + Connection = CPCK_DataLink.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 288 + Top = 176 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 440 + Top = 184 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 472 + Top = 184 + end +end diff --git a/成品仓库/U_ContractSelList.pas b/成品仓库/U_ContractSelList.pas new file mode 100644 index 0000000..2206327 --- /dev/null +++ b/成品仓库/U_ContractSelList.pas @@ -0,0 +1,242 @@ +unit U_ContractSelList; + +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, cxCheckBox, cxCalendar, cxSplitter, + RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, + Menus, cxPC, 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 + TfrmContractSelList = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBClose: TToolButton; + Tv1: TcxGridDBTableView; + cxGrid1Level1: TcxGridLevel; + cxGrid1: TcxGrid; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + v1OrdDate: TcxGridDBColumn; + v1ConNo: TcxGridDBColumn; + v1PRTColor: TcxGridDBColumn; + Order_Main: TClientDataSet; + v1CustomerNoName: TcxGridDBColumn; + v1MPRTCodeName: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1PRTPrice: TcxGridDBColumn; + v1Column1: TcxGridDBColumn; + v1Column4: TcxGridDBColumn; + Panel1: TPanel; + Label1: TLabel; + Label4: TLabel; + Label9: TLabel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + CustomerNoName: TEdit; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + v1Column9: TcxGridDBColumn; + v1Column10: TcxGridDBColumn; + v1Column11: TcxGridDBColumn; + v1Column12: TcxGridDBColumn; + ToolButton2: TToolButton; + v1Column13: TcxGridDBColumn; + MPRTType: TComboBox; + Label2: TLabel; + v1Column14: TcxGridDBColumn; + v1Column15: TcxGridDBColumn; + v1Column16: TcxGridDBColumn; + v1Column17: TcxGridDBColumn; + v1Column18: TcxGridDBColumn; + FConNo: TEdit; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure CustomerNoNameChange(Sender: TObject); + procedure FConNoKeyPress(Sender: TObject; var Key: Char); + procedure cxTabControl1Change(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + private + DQdate:TDateTime; + procedure InitGrid(); + procedure InitForm(); + { Private declarations } + public + FFInt,FCloth:Integer; + FLXStr,KHCode:string; + + { Public declarations } + end; + +var + frmContractSelList: TfrmContractSelList; + +implementation +uses + U_DataLink,U_Fun10; //U_ConInPut, + +{$R *.dfm} + +procedure TfrmContractSelList.FormDestroy(Sender: TObject); +begin + frmContractSelList:=nil; +end; + +procedure TfrmContractSelList.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Action:=caFree; +end; + +procedure TfrmContractSelList.FormCreate(Sender: TObject); +begin + cxgrid1.Align:=alClient; + DQdate:=SGetServerDate(ADOQueryTemp); +end; + +procedure TfrmContractSelList.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid('ͬбѡX',Tv1,'ָʾ'); +end; + +procedure TfrmContractSelList.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add('select A.conno as FConNo,A.*,B.* '); + sql.Add(' from JYOrderCon_Main A '); + sql.Add(' inner join JYOrderCon_Sub B on A.MainId=B.MainId'); + SQL.Add(' where A.OrdDate>='''+FormatDateTime('yyyy-MM-dd',BegDate.DateTime)+''''); + SQL.Add(' and A.OrdDate<'''+FormatDateTime('yyyy-MM-dd',enddate.DateTime+1)+''''); + if Trim(KHCode)<>'' then + begin + sql.Add(' and isnull(A.CustomerNoName,'''')='''+Trim(KHCode)+''''); + end; + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally; + ADOQueryMain.EnableControls; + end; +end; + + +procedure TfrmContractSelList.InitForm(); +begin + ReadCxGrid('ͬбѡX',Tv1,'ָʾ'); + BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-30; + EndDate.DateTime:=SGetServerDate10(ADOQueryTemp); + InitGrid(); +end; + +procedure TfrmContractSelList.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 TfrmContractSelList.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmContractSelList.FormShow(Sender: TObject); +begin + InitForm(); +end; + +procedure TfrmContractSelList.CustomerNoNameChange(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 TfrmContractSelList.FConNoKeyPress(Sender: TObject; var Key: Char); +begin + if Key=#13 then + begin + if Length(FConNo.Text)<3 then Exit; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + SQL.Clear; + sql.Add('select A.*,B.* '); + sql.Add(' from JYOrderCon_Main A '); + sql.Add(' inner join JYOrderCon_Sub B on A.MainId=B.MainId'); + SQL.Add('where 1=1'); + sql.Add(' and A.ConNo like '''+'%'+Trim(FConNo.Text)+'%'+''''); + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; + end; +end; + +procedure TfrmContractSelList.cxTabControl1Change(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmContractSelList.ToolButton2Click(Sender: TObject); +begin + if Order_Main.IsEmpty then Exit; + if Order_Main.Locate('SSel',True,[])=False then + begin + Application.MessageBox('ûѡ!','ʾ',0); + Exit; + end; + ModalResult:=1; +end; + +end. diff --git a/成品仓库/U_CpCk.dfm b/成品仓库/U_CpCk.dfm new file mode 100644 index 0000000..4eccae5 --- /dev/null +++ b/成品仓库/U_CpCk.dfm @@ -0,0 +1,1185 @@ +object frmCpCk: TfrmCpCk + Left = 564 + Top = 306 + Width = 1094 + Height = 539 + BorderIcons = [biSystemMenu] + Caption = #25104#21697#20986#24211#20449#24687 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1078 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + Color = clSkyBlue + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + 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 Panel1: TPanel + Left = 0 + Top = 29 + Width = 1078 + Height = 104 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 36 + Top = 20 + Width = 52 + Height = 12 + Caption = #20986#24211#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 = 408 + Top = 20 + Width = 52 + Height = 12 + Caption = #20986#24211#31867#22411 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label3: TLabel + Left = 188 + Top = 168 + Width = 48 + Height = 12 + Caption = #21457#24448#21333#20301 + end + object Label4: TLabel + Left = 544 + Top = 196 + Width = 48 + Height = 12 + Caption = #20179' '#24211 + end + object Label5: TLabel + Left = 36 + Top = 132 + Width = 48 + Height = 12 + Caption = #35746#21333#20449#24687 + end + object Label6: TLabel + Left = 252 + Top = 132 + Width = 24 + Height = 12 + Caption = #20135#21697 + end + object Label7: TLabel + Left = 488 + Top = 128 + Width = 48 + Height = 12 + Caption = #39068' '#33394 + end + object Label8: TLabel + Left = 220 + Top = 20 + Width = 52 + Height = 12 + Caption = #20986#24211#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label9: TLabel + Left = 592 + Top = 20 + Width = 54 + Height = 12 + Caption = #23458' '#25143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label12: TLabel + Left = 396 + Top = 144 + Width = 65 + Height = 12 + Caption = #25910#29616#37329#20154#21592 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label13: TLabel + Left = 568 + Top = 140 + Width = 78 + Height = 12 + Caption = #26368#36831#25910#27454#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label14: TLabel + Left = 36 + Top = 112 + Width = 53 + Height = 12 + Caption = #25171' '#21253' '#36153 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label15: TLabel + Left = 220 + Top = 168 + Width = 53 + Height = 12 + Caption = #26679' '#26495' '#36153 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label16: TLabel + Left = 408 + Top = 168 + Width = 53 + Height = 12 + Caption = #20854' '#23427' '#36153 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label17: TLabel + Left = 828 + Top = 60 + Width = 60 + Height = 14 + Caption = #27599#21305#25968#37327 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object Label18: TLabel + Left = 220 + Top = 144 + Width = 52 + Height = 12 + Caption = #23454#25910#29616#37329 + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label19: TLabel + Left = 36 + Top = 45 + Width = 52 + Height = 12 + Caption = #21457#36135#22320#22336 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label20: TLabel + Left = 407 + Top = 45 + Width = 52 + Height = 12 + Caption = #32852#31995#26041#24335 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label21: TLabel + Left = 828 + Top = 84 + Width = 138 + Height = 12 + Caption = '*'#21452#20987#26126#32454#34920#26684#21487#21024#38500#25968#25454 + Visible = False + end + object Label22: TLabel + Left = 828 + Top = 28 + Width = 60 + Height = 14 + Caption = #36192#36865#25968#37327 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end + object CRTime: TDateTimePicker + Left = 88 + Top = 16 + Width = 100 + Height = 20 + Date = 41509.970132187500000000 + Format = 'yyyy-MM-dd' + Time = 41509.970132187500000000 + TabOrder = 0 + end + object CRType: TComboBox + Left = 464 + Top = 16 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 1 + Text = #38144#21806#20986#24211 + Items.Strings = ( + #38144#21806#20986#24211 + #21152#24037#20986#24211) + end + object ToCustName: TBtnEditA + Left = 240 + Top = 164 + Width = 321 + Height = 20 + ReadOnly = True + TabOrder = 2 + OnBtnClick = ToCustNameBtnClick + end + object ckName: TComboBox + Left = 768 + Top = 172 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 3 + Text = #26679#21697#20179#24211 + Items.Strings = ( + #26679#21697#20179#24211) + end + object orderNO: TBtnEditA + Left = 88 + Top = 132 + Width = 100 + Height = 20 + ReadOnly = True + TabOrder = 4 + OnBtnClick = orderNOBtnClick + end + object PRTCodeName: TEdit + Left = 280 + Top = 132 + Width = 100 + Height = 20 + Enabled = False + ReadOnly = True + TabOrder = 5 + end + object PRTColor: TEdit + Left = 756 + Top = 136 + Width = 100 + Height = 20 + Enabled = False + ReadOnly = True + TabOrder = 6 + end + object InoutNo: TEdit + Left = 272 + Top = 16 + Width = 100 + Height = 20 + TabOrder = 7 + end + object custName: TBtnEditA + Left = 648 + Top = 16 + Width = 101 + Height = 20 + ReadOnly = True + TabOrder = 8 + OnBtnClick = custNameBtnClick + end + object IsYjx: TCheckBox + Left = 36 + Top = 144 + Width = 97 + Height = 17 + Caption = #26159#21542#25910#29616#37329 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 9 + end + object YjxYG: TBtnEditA + Left = 464 + Top = 140 + Width = 100 + Height = 20 + ReadOnly = True + TabOrder = 10 + OnBtnClick = YjxYGBtnClick + end + object Yjxdate: TDateTimePicker + Left = 648 + Top = 136 + Width = 101 + Height = 20 + Date = 41628.038490810180000000 + Format = 'yyyy-MM-dd' + Time = 41628.038490810180000000 + TabOrder = 11 + end + object PackFee: TcxCurrencyEdit + Left = 88 + Top = 108 + Properties.DisplayFormat = '0.##' + Properties.OnChange = PackFeePropertiesChange + TabOrder = 12 + Width = 100 + end + object YbFee: TcxCurrencyEdit + Left = 272 + Top = 164 + Properties.DisplayFormat = '0.##' + Properties.OnChange = PackFeePropertiesChange + TabOrder = 13 + Width = 100 + end + object OtherFee: TcxCurrencyEdit + Left = 464 + Top = 164 + Properties.DisplayFormat = '0.##' + Properties.OnChange = PackFeePropertiesChange + TabOrder = 14 + Width = 100 + end + object QtyMX: TEdit + Left = 888 + Top = 56 + Width = 65 + Height = 22 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 15 + Visible = False + OnKeyPress = QtyMXKeyPress + end + object XjNum: TcxCurrencyEdit + Left = 272 + Top = 140 + Properties.DisplayFormat = '0.##' + TabOrder = 16 + Width = 100 + end + object FHAddress: TBtnEditC + Tag = 2 + Left = 86 + Top = 41 + Width = 287 + Height = 20 + ReadOnly = True + TabOrder = 17 + OnBtnUpClick = FHAddressBtnUpClick + OnBtnDnClick = FHAddressBtnDnClick + end + object LXFS: TBtnEditC + Tag = 2 + Left = 462 + Top = 41 + Width = 287 + Height = 20 + ReadOnly = True + TabOrder = 18 + OnBtnUpClick = LXFSBtnUpClick + OnBtnDnClick = FHAddressBtnDnClick + end + object IsTax: TCheckBox + Left = 216 + Top = 104 + Width = 97 + Height = 17 + Caption = #26159#21542#21547#31246 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 19 + Visible = False + end + object ZsQtyMX: TEdit + Left = 888 + Top = 24 + Width = 65 + Height = 22 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 20 + Visible = False + end + end + object ToolBar2: TToolBar + Left = 0 + Top = 133 + Width = 1078 + Height = 29 + ButtonHeight = 30 + ButtonWidth = 95 + Caption = 'ToolBar1' + Color = clSkyBlue + EdgeInner = esNone + EdgeOuter = esNone + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 2 + object ToolButton6: TToolButton + Left = 0 + Top = 0 + Caption = #36873#25321#35746#21333#21495 + ImageIndex = 50 + OnClick = ToolButton6Click + end + object ToolButton1: TToolButton + Left = 95 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 103 + OnClick = ToolButton1Click + end + object ToolButton2: TToolButton + Left = 158 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 107 + OnClick = ToolButton2Click + end + object ToolButton3: TToolButton + Left = 221 + Top = 0 + AutoSize = True + Caption = #25195#25551#21024#34892 + ImageIndex = 48 + Visible = False + OnClick = ToolButton3Click + end + object ToolButton7: TToolButton + Left = 308 + Top = 0 + Caption = #36873#25321#21512#21516 + ImageIndex = 51 + OnClick = ToolButton7Click + end + end + object Panel2: TPanel + Left = 172 + Top = 228 + Width = 289 + Height = 121 + Color = clSkyBlue + TabOrder = 3 + Visible = False + OnDblClick = Panel2DblClick + object Label10: TLabel + Left = 36 + Top = 24 + Width = 26 + Height = 12 + Caption = #26465#30721 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label11: TLabel + Left = 36 + Top = 72 + Width = 8 + Height = 14 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Edit1: TEdit + Left = 68 + Top = 20 + Width = 137 + Height = 20 + TabOrder = 0 + OnKeyPress = Edit1KeyPress + end + end + object Panel3: TPanel + Left = 0 + Top = 162 + Width = 1078 + Height = 254 + Align = alClient + Caption = 'Panel3' + TabOrder = 4 + object cxGrid1: TcxGrid + Left = 1 + Top = 1 + Width = 967 + Height = 252 + Align = alClient + TabOrder = 0 + 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 = v1P_CodeName + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty + end + item + Kind = skSum + Column = v1Money + end + item + Kind = skSum + Column = v1Column3 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v1Column4: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'orderNo' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Width = 98 + end + object v1MJID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'MJID' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + VisibleForCustomization = False + Width = 75 + end + object v1MJXH: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'MJXH' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + VisibleForCustomization = False + Width = 60 + end + object v1Column2: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'TocustName' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 83 + end + object v1P_Code: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'P_Code' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 80 + end + object v1P_CodeName: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'P_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1P_CodeNamePropertiesButtonClick + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 80 + end + object v1P_SPEC: TcxGridDBColumn + Caption = #35268#26684#25104#20998 + DataBinding.FieldName = 'P_SPEC' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 80 + end + object v1Column1: TcxGridDBColumn + Caption = #23610#23544'/'#23610#30721 + DataBinding.FieldName = 'defstr1' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = v1Column1PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 69 + end + object v1CPType: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'CPType' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 56 + end + object v1Qty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 80 + end + object v1Column3: TcxGridDBColumn + Caption = #36192#36865#25968#37327 + DataBinding.FieldName = 'ZsQty' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 76 + end + object v1Price: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 34 + end + object v1Money: TcxGridDBColumn + Caption = #37329#39069 + DataBinding.FieldName = 'Money' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Styles.Content = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Footer = CPCK_DataLink.cxStyle_fontclFuchsia + Styles.Header = CPCK_DataLink.cxStyle_fontclFuchsia + Width = 61 + end + object v1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 132 + end + object Tv1Column1: TcxGridDBColumn + Caption = #20179#24211#32534#21495 + DataBinding.FieldName = 'DRCKNO' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1Column1PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 70 + end + object Tv1Column2: TcxGridDBColumn + Caption = #20179#24211#21517#31216 + DataBinding.FieldName = 'DRCKName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1Column2PropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 70 + end + object Tv1Column3: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object cxGrid2: TcxGrid + Left = 968 + Top = 1 + Width = 109 + Height = 252 + Align = alRight + TabOrder = 1 + Visible = False + object Tv2: TcxGridDBTableView + OnMouseDown = Tv2MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv2CellDblClick + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v2Column2 + end + item + Kind = skSum + Column = v2Column1 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v2Column2: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 92 + end + object v2Column1: TcxGridDBColumn + Caption = #36192#36865#25968#37327 + DataBinding.FieldName = 'ZsQty' + PropertiesClassName = 'TcxCurrencyEditProperties' + Properties.DisplayFormat = '0.##' + Properties.ReadOnly = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + end + object cxGridLevel1: TcxGridLevel + GridView = Tv2 + end + end + end + object cxGrid3: TcxGrid + Left = 0 + Top = 416 + Width = 1078 + Height = 84 + Align = alBottom + TabOrder = 5 + Visible = False + object TV3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource2 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV2Column2 + end + item + Kind = skSum + Column = TV2Column3 + end + item + Kind = skSum + Column = TV2Column4 + end + item + Kind = skSum + Column = TV2Column5 + end + item + Kind = skSum + Column = TV2Column6 + end + item + Kind = skSum + Column = TV2Column7 + end + item + Kind = skSum + Column = TV2Column8 + end + item + Kind = skSum + Column = TV2Column9 + end + item + Kind = skSum + Column = TV2Column10 + end + item + Kind = skSum + Column = TV2Column11 + end + item + Kind = skSum + Column = TV2Column12 + end + item + Kind = skSum + Column = TV2Column13 + end + item + Kind = skSum + Column = TV3Column1 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnSorting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV2Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column4: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV2Column2: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column3: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column4: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column5: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column6: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column7: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column2: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column8: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column9: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column10: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column11: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column12: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column13: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV3Column3: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'Size14' + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = TV2Column2PropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV3Column1: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Options.Focusing = False + Width = 70 + end + end + object cxGridLevel2: TcxGridLevel + GridView = TV3 + end + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 292 + Top = 8 + end + object ADOQueryTmp: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 340 + Top = 8 + end + object DataSource1: TDataSource + DataSet = CDS_Main + Left = 400 + Top = 9 + end + object CDS_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 464 + Top = 17 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 716 + Top = 9 + end + object ADO_Sub: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 780 + Top = 17 + end + object DataSource2: TDataSource + DataSet = CDS_Sub + Left = 824 + Top = 337 + end + object CDS_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 872 + Top = 345 + end +end diff --git a/成品仓库/U_CpCk.pas b/成品仓库/U_CpCk.pas new file mode 100644 index 0000000..ce812cf --- /dev/null +++ b/成品仓库/U_CpCk.pas @@ -0,0 +1,2071 @@ +unit U_CpCk; + +interface + +uses + Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls, + Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, + cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView, + cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit, + DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, BtnEdit, cxContainer, + cxTextEdit, 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 + TfrmCpCk = class(TForm) + ToolBar1: TToolBar; + TBSave: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + CRTime: TDateTimePicker; + Label2: TLabel; + CRType: TComboBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1P_CodeName: TcxGridDBColumn; + v1P_SPEC: TcxGridDBColumn; + v1Qty: TcxGridDBColumn; + v1Note: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ADOQueryCmd: TADOQuery; + ADOQueryTmp: TADOQuery; + DataSource1: TDataSource; + CDS_Main: TClientDataSet; + ToolBar2: TToolBar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + cxGridPopupMenu1: TcxGridPopupMenu; + Label3: TLabel; + ToCustName: TBtnEditA; + v1MJID: TcxGridDBColumn; + v1MJXH: TcxGridDBColumn; + v1CPType: TcxGridDBColumn; + ckName: TComboBox; + Label4: TLabel; + Label5: TLabel; + orderNO: TBtnEditA; + Label6: TLabel; + PRTCodeName: TEdit; + Label7: TLabel; + PRTColor: TEdit; + v1P_Code: TcxGridDBColumn; + Label8: TLabel; + InoutNo: TEdit; + Label9: TLabel; + custName: TBtnEditA; + ToolButton3: TToolButton; + Panel2: TPanel; + Label10: TLabel; + Edit1: TEdit; + Label11: TLabel; + IsYjx: TCheckBox; + Label12: TLabel; + v1Price: TcxGridDBColumn; + v1Money: TcxGridDBColumn; + YjxYG: TBtnEditA; + Label13: TLabel; + Yjxdate: TDateTimePicker; + Label14: TLabel; + PackFee: TcxCurrencyEdit; + YbFee: TcxCurrencyEdit; + Label15: TLabel; + OtherFee: TcxCurrencyEdit; + Label16: TLabel; + Panel3: TPanel; + cxGrid2: TcxGrid; + Tv2: TcxGridDBTableView; + cxGridLevel1: TcxGridLevel; + v2Column2: TcxGridDBColumn; + ADO_Sub: TADOQuery; + DataSource2: TDataSource; + Label17: TLabel; + QtyMX: TEdit; + CDS_Sub: TClientDataSet; + Label18: TLabel; + XjNum: TcxCurrencyEdit; + FHAddress: TBtnEditC; + Label19: TLabel; + Label20: TLabel; + LXFS: TBtnEditC; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + IsTax: TCheckBox; + Label21: TLabel; + v2Column1: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + ZsQtyMX: TEdit; + Label22: TLabel; + v1Column4: TcxGridDBColumn; + cxGrid3: TcxGrid; + TV3: TcxGridDBTableView; + TV2Column1: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + TV2Column5: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + TV2Column8: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; + TV2Column11: TcxGridDBColumn; + TV2Column12: TcxGridDBColumn; + TV2Column13: TcxGridDBColumn; + TV3Column1: TcxGridDBColumn; + cxGridLevel2: TcxGridLevel; + Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + TV3Column2: TcxGridDBColumn; + TV3Column3: TcxGridDBColumn; + TV3Column4: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + ToolButton6: TToolButton; + ToolButton7: TToolButton; + procedure FormDestroy(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormShow(Sender: TObject); + procedure TBSaveClick(Sender: TObject); + procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure ToolButton1Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure ToCustNameBtnClick(Sender: TObject); + procedure orderNOBtnClick(Sender: TObject); + procedure custNameBtnClick(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure Edit1KeyPress(Sender: TObject; var Key: Char); + procedure Panel2DblClick(Sender: TObject); + procedure v1QtyPropertiesEditValueChanged(Sender: TObject); + procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure QtyMXKeyPress(Sender: TObject; var Key: Char); + procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure YjxYGBtnClick(Sender: TObject); + procedure PackFeePropertiesChange(Sender: TObject); + procedure FHAddressBtnUpClick(Sender: TObject); + procedure LXFSBtnUpClick(Sender: TObject); + procedure FHAddressBtnDnClick(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton4Click(Sender: TObject); + procedure ToolButton5Click(Sender: TObject); + procedure TV2Column2PropertiesEditValueChanged(Sender: TObject); + procedure ToolButton6Click(Sender: TObject); + procedure ToolButton7Click(Sender: TObject); + procedure Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); + private + procedure InitGrid(); + procedure Initsub(); + procedure Initsub_1(); + function savedate(): Boolean; + function savedate1(): Boolean; + procedure SetComboBox(); + function YSData(): Boolean; + function SKData(): Boolean; + function YSData_Other(fYFName: string; fmoney: double): Boolean; + procedure GetxjNum(); + { Private declarations } + public + fkeyNO, FCodeName, FCode, FDRCKNO, FDRCKName: string; + FType: integer; + fCKName: string; + { Public declarations } + end; + +var + frmCpCk: TfrmCpCk; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_Bpkclist, U_ZdyAttachment, U_ZDYHelpSel, + U_ProductOrderNewListSEl, U_ContractSelList, U_CpkcSel, U_CPKWListSel, + U_ZdyCMZ_Sel; +{$R *.dfm} + +function TfrmCpCk.SKData(): Boolean; +var + CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou, cust: string; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + // sql.Add(' and subID='''+Trim(CDS_Main.fieldbyname('CRID').AsString)+''''); + sql.Add(' and YFName=''ֽտ'' '); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + // sql.Add(' and subID='''+Trim(CDS_Main.fieldbyname('CRID').AsString)+''''); + sql.Add(' and YFName=''ֽտ'' '); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'FK', 'YF_Money_CR', 4, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'տǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := -1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('TOFactoryName').Value := ''; + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('Qty').Value := 1; + FieldByName('Price').Value := strtofloatdef(XjNum.Text, 0); + FieldByName('Money').Value := strtofloatdef(XjNum.Text, 0); + FieldByName('BBMoney').Value := strtofloatdef(XjNum.Text, 0); + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := Trim(CDS_Main.fieldbyname('QtyUnit').AsString); + FieldByName('ComTaiTou').Value := Trim(cust); + FieldByName('YFName').Value := 'ֽտ'; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + // FieldByName('subID').Value:=Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + 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; + + Result := True; +end; + +procedure TfrmCpCk.GetxjNum(); +begin + if not varisnull(tv1.DataController.Summary.FooterSummaryValues[2]) then + begin + XjNum.Value := tv1.DataController.Summary.FooterSummaryValues[2] + strtofloatdef(PackFee.Text, 0) + strtofloatdef(YbFee.Text, 0) + strtofloatdef(OtherFee.Text, 0); + end + else + begin + XjNum.Value := strtofloatdef(PackFee.Text, 0) + strtofloatdef(YbFee.Text, 0) + strtofloatdef(OtherFee.Text, 0); + end; +end; + +procedure TfrmCpCk.Initsub(); +begin +// if CDS_Main.IsEmpty then +// Exit; +// try +// with Ado_Sub do +// begin +// close; +// sql.Clear; +// sql.Add('exec P_Get_CP_CK_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''',''' + Cds_main.fieldbyname('CRNO').AsString + ''' '); +// sql.Add(' ,''' + cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + cds_main.fieldbyname('DRCKName').AsString + ''' '); +// open; +// end; +// SCreateCDS20(Ado_Sub, CDS_Sub); +// SInitCDSData20(Ado_Sub, CDS_Sub); +// finally +// end; +// if CDS_Main.IsEmpty then +// exit; +// +// with Ado_Sub do +// begin +// close; +// sql.Clear; +// sql.Add('select * from CP_InOut_MX A'); +// sql.Add('where A.MJID=' + quotedstr(trim(CDS_Main.fieldbyname('MJID').AsString))); +// open; +// end; +// SCreateCDS20(Ado_Sub, CDS_sub); +// SInitCDSData20(Ado_Sub, CDS_sub); +end; + +procedure TfrmCpCk.Initsub_1(); +begin + try + with self.adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_CK_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''',''' + Cds_main.fieldbyname('CRNO').AsString + ''' '); + sql.Add(' ,''' + cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + cds_main.fieldbyname('DRCKName').AsString + ''' '); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Sub); + SInitCDSData20(adoqueryTmp, CDS_Sub); + finally + end; +end; + +function TfrmCpCk.YSData(): Boolean; +var + CRID, YFID, priceUnit: string; + PrtPrice, huilv: double; +begin + Result := False; + + priceUnit := 'RMB'; + PrtPrice := 0; + huilv := 1; + with ADOQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from JYOrder_sub '); + sql.Add('where subID=''' + Trim(CDS_Main.fieldbyname('subID').AsString) + ''''); + open; + end; + if not ADOQueryTmp.IsEmpty then + begin + priceUnit := ADOQueryTmp.fieldbyname('priceUnit').AsString; + PrtPrice := ADOQueryTmp.fieldbyname('PrtPrice').AsFloat; + huilv := ADOQueryTmp.fieldbyname('huilv').AsFloat; + end; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''Ʒ'' '); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''Ʒ'' '); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'CS', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦտǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('HuiLv').Value := huilv; + FieldByName('ps').Value := CDS_Main.fieldbyname('RollNum').AsFloat; + FieldByName('Qty').Value := CDS_Main.fieldbyname('Qty').AsFloat; + FieldByName('Price').Value := CDS_Main.fieldbyname('Price').AsFloat; + FieldByName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + FieldByName('BBMoney').Value := format('%.2f', [FieldByName('Money').AsFloat * FieldByName('HuiLv').AsFloat]); + FieldByName('ISTAX').Value := IsTax.Checked; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := Trim(CDS_Main.fieldbyname('QtyUnit').AsString); + FieldByName('ComTaiTou').Value := Trim(custName.Text); + FieldByName('YFName').Value := 'Ʒ'; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('subID').Value := Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + end; + + Result := True; +end; + +function TfrmCpCk.YSData_Other(fYFName: string; fmoney: double): Boolean; +var + CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou, cust: string; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(custName.Text) + ''' and YFDefFlag1=0 '); + Open; + end; + + if not ADOQueryTmp.IsEmpty then + begin + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; + end + else + begin + with ADOQueryCmd 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 := ADOQueryCmd.fieldbyname('CRID').AsString; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from YF_Money_KC where 1<>1'); + Open; + end; + with ADOQueryCmd do + begin + Append; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; + Post; + end; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + trim(fYFName) + ''' '); + execsql; + end; + + with ADOQueryTmp do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR '); + sql.Add(' where MainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''''); + sql.Add(' and subID=''' + Trim(CDS_Main.fieldbyname('CRID').AsString) + ''''); + sql.Add(' and YFName=''' + trim(fYFName) + ''' '); + Open; + end; + + if ADOQueryTmp.IsEmpty then + begin + if GetLSNo(ADOQueryCmd, YFID, 'CS', 'YF_Money_CR', 3, 1) = False then + begin + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR where 1<>1'); + Open; + end; + + with ADOQueryCmd do + begin + Append; + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦտǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(custName.Text); + FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)); + FieldByName('YFType').Value := 'Զ'; + FieldByName('Qty').Value := 1; + FieldByName('Price').Value := fmoney; + FieldByName('Money').Value := fmoney; + FieldByName('BBMoney').Value := fmoney; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('QtyUnit').Value := ''; + FieldByName('ComTaiTou').Value := Trim(cust); + FieldByName('YFName').Value := fYFName; + FieldByName('ISTAX').Value := IsTax.Checked; + FieldByName('MainId').Value := Trim(CDS_Main.fieldbyname('CRNO').AsString); + FieldByName('subID').Value := Trim(CDS_Main.fieldbyname('CRID').AsString); + FieldByName('status').Value := '0'; + Post; + end; + end + else + begin + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + 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; + + Result := True; +end; + +procedure TfrmCpCk.SetComboBox(); +begin + ckName.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCK'' '); + if trim(fCKName) <> '' then + sql.Add('and zdyName=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + ckName.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if ckName.Items.Count > 0 then + ckName.ItemIndex := 0; + + CRType.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCKTYPE'''); + if trim(fCKName) <> '' then + sql.Add('and note=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + CRType.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if CRType.Items.Count > 0 then + CRType.ItemIndex := 0; +end; + +function TfrmCpCk.savedate(): Boolean; +var + fkcID, XHNO, i: integer; + Filler, FSize: string; + FillTime: TdateTime; + maxno: string; +begin + result := false; + try + ADOQueryCmd.Connection.BeginTrans; + + if FType = 0 then + begin + Filler := DName; + FillTime := SGetServerDateTime(adoqueryTmp); + end + else + begin + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + open; + Filler := adoqueryTmp.fieldbyname('Filler').AsString; + FillTime := adoqueryTmp.fieldbyname('FillTime').AsDateTime; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add('where MAINid=' + quotedstr(trim(fkeyNO))); + execsql; + end; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_INout'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + execsql; + end; + CDS_Main.DisableControls; + CDS_Main.First; + XHNO := 1; + with CDS_Main do + begin + First; + while not eof do + begin + Edit; + FieldByName('CRNO').Value := trim(fkeyNO); +// FieldByName('CRID').Value := recNo; + post; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_INout'); + sql.Add('where 1=2 '); + open; + end; + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO); + ADOQueryCmd.FieldByName('CRID').Value := XHNO; + ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text); + ADOQueryCmd.FieldByName('InoutNO').Value := trim(InoutNO.Text); + ADOQueryCmd.FieldByName('custNo').Value := trim(custName.TxtCode); + ADOQueryCmd.FieldByName('custName').Value := trim(custName.Text); + // ADOQueryCmd.FieldByName('TocustNo').Value:=trim(TocustName.TxtCode); + // ADOQueryCmd.FieldByName('TocustName').Value:=trim(TocustName.Text); + ADOQueryCmd.FieldByName('FHAddress').Value := trim(FHAddress.Text); + ADOQueryCmd.FieldByName('LXFS').Value := trim(LXFS.Text); + + if IsYjx.Checked then + begin + ADOQueryCmd.FieldByName('IsYjx').Value := ''; + ADOQueryCmd.FieldByName('xjNum').Value := strtofloatdef(xjNum.text, 0); + ADOQueryCmd.FieldByName('Yjxdate').Value := formatdateTime('yyyy-MM-dd', Yjxdate.Date); + end + else + ADOQueryCmd.FieldByName('IsYjx').Value := ''; + ADOQueryCmd.FieldByName('YjxYG').Value := trim(YjxYG.Text); + ADOQueryCmd.FieldByName('ISTAX').Value := IsTax.Checked; + // ADOQueryCmd.FieldByName('Yjxdate').Value:=formatdateTime('yyyy-MM-dd',Yjxdate.Date); + ADOQueryCmd.FieldByName('PackFee').Value := floattostr(strtofloatdef(PackFee.Text, 0)); + ADOQueryCmd.FieldByName('YbFee').Value := floattostr(strtofloatdef(YbFee.Text, 0)); + ADOQueryCmd.FieldByName('otherFee').Value := floattostr(strtofloatdef(otherFee.Text, 0)); + ADOQueryCmd.FieldByName('mainID').Value := trim(CDS_Main.fieldbyname('mainID').AsString); + ADOQueryCmd.FieldByName('subID').Value := trim(CDS_Main.fieldbyname('subID').AsString); + ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date); + ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text); + ADOQueryCmd.FieldByName('CRFlag').Value := ''; + ADOQueryCmd.FieldByName('CPTYPE').Value := 'Ʒ'; + ADOQueryCmd.FieldByName('P_Code').Value := trim(CDS_Main.fieldbyname('P_Code').AsString); + ADOQueryCmd.FieldByName('P_CodeName').Value := trim(CDS_Main.fieldbyname('P_CodeName').AsString); + ADOQueryCmd.FieldByName('P_spec').Value := trim(CDS_Main.fieldbyname('P_spec').AsString); + ADOQueryCmd.FieldByName('P_Color').Value := trim(CDS_Main.fieldbyname('P_Color').AsString); + + ADOQueryCmd.FieldByName('DRCKNO').Value := trim(CDS_Main.fieldbyname('DRCKNO').AsString); + ADOQueryCmd.FieldByName('DRCKName').Value := trim(CDS_Main.fieldbyname('DRCKName').AsString); +// ADOQueryCmd.FieldByName('P_ColorNO').Value := trim(fieldbyname('P_ColorNO').AsString); + ADOQueryCmd.FieldByName('defstr1').Value := trim(fieldbyname('defstr1').AsString); + ADOQueryCmd.FieldByName('P_MF').Value := fieldbyname('P_MF').AsFloat; + ADOQueryCmd.FieldByName('P_KZ').Value := fieldbyname('P_KZ').AsFloat; + + ADOQueryCmd.FieldByName('Qty').Value := CDS_Main.fieldbyname('Qty').AsFloat; + ADOQueryCmd.FieldByName('Price').Value := CDS_Main.fieldbyname('price').AsFloat; + ADOQueryCmd.FieldByName('money').Value := CDS_Main.fieldbyname('money').AsFloat; + ADOQueryCmd.FieldByName('rkPrice').Value := CDS_Main.fieldbyname('rkPrice').AsFloat; + ADOQueryCmd.FieldByName('note').Value := trim(CDS_Main.fieldbyname('note').AsString); + ADOQueryCmd.FieldByName('Filler').Value := trim(Filler); + ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(FillTime); + ADOQueryCmd.FieldByName('inoutNo').Value := trim(inoutNo.Text); + + if FType = 1 then + begin + ADOQueryCmd.FieldByName('editer').Value := trim(dName); + ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp); + end; + +// ADOQueryCmd.FieldByName('kcID').Value := FieldByName('kcID').AsInteger; + ADOQueryCmd.Post; + XHNO := XHNO + 1; + Next; + end; + + end; + CDS_Main.EnableControls; + ADOQueryCmd.Connection.CommitTrans; + result := true; + except + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + end; +end; + +function TfrmCpCk.savedate1(): Boolean; +var + fkcID, XHNO, i: integer; + Filler, FSize: string; + FillTime: TdateTime; + maxno: string; +begin + result := false; + try + ADOQueryCmd.Connection.BeginTrans; + + if FType = 0 then + begin + Filler := DName; + FillTime := SGetServerDateTime(adoqueryTmp); + end + else + begin + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + open; + Filler := adoqueryTmp.fieldbyname('Filler').AsString; + FillTime := adoqueryTmp.fieldbyname('FillTime').AsDateTime; + end; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from YF_Money_CR '); + sql.Add('where MAINid=' + quotedstr(trim(fkeyNO))); + execsql; + end; + end; + + +{ with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update CP_kc set RollNum=A.RollNum + B.RollNum, Qty=A.Qty + B.Qty '); + sql.Add('from CP_kc A'); + sql.Add('inner join CP_INout B on B.kcid=A.kcid'); + sql.Add('where B.CRNO='+quotedstr(trim(fkeyNO))); + execsql; + end; } + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_INout'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + execsql; + end; + CDS_Main.DisableControls; + CDS_Main.First; + XHNO := 1; + with CDS_Main do + begin + while not eof do + begin + Edit; + FieldByName('CRNO').Value := trim(fkeyNO); +// FieldByName('CRID').Value := recNo; + post; + + { IF trim(CRType.Text)='۳'then + begin + with ADOQueryTmp do + begin + close; + sql.Clear; + sql.Add('select sum(RollNum) as RollNum,sum(Qty) as Qty from CP_InOut_MX'); + sql.Add('where MJID='+quotedstr(trim(CDS_main.fieldbyname('MJID').AsString))); + open; + end; + IF ADOQueryTmp.IsEmpty then + begin + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('۳ϸ뵥ݣ','ʾϢ',0); + exit; + end + else + begin + IF ADOQueryTmp.fieldbyname('RollNum').AsFloat<> CDS_main.fieldbyname('RollNum').AsFloat then + begin + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ϸ뵥ƥ͵ݵƥһ£','ʾϢ',0); + exit; + end; + IF ADOQueryTmp.fieldbyname('Qty').AsFloat<> CDS_main.fieldbyname('Qty').AsFloat then + begin + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ϸ뵥͵ݵһ£','ʾϢ',0); + exit; + end; + end; + end; + } + + with CDS_Sub do + begin + First; + while not eof do + begin + i := 1; + while i < 16 do + begin + FSize := 'Size' + IntToStr(i); + if StrToFloatDef(CDS_Sub.fieldbyname(FSize).AsString, 0) > 0 then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_INout'); + sql.Add('where 1=2 '); + open; + end; + ADOQueryCmd.Append; + ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO); + ADOQueryCmd.FieldByName('CRID').Value := XHNO; + ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text); + ADOQueryCmd.FieldByName('InoutNO').Value := trim(InoutNO.Text); + ADOQueryCmd.FieldByName('custNo').Value := trim(custName.TxtCode); + ADOQueryCmd.FieldByName('custName').Value := trim(custName.Text); + // ADOQueryCmd.FieldByName('TocustNo').Value:=trim(TocustName.TxtCode); + // ADOQueryCmd.FieldByName('TocustName').Value:=trim(TocustName.Text); + ADOQueryCmd.FieldByName('FHAddress').Value := trim(FHAddress.Text); + ADOQueryCmd.FieldByName('LXFS').Value := trim(LXFS.Text); + + if IsYjx.Checked then + begin + ADOQueryCmd.FieldByName('IsYjx').Value := ''; + ADOQueryCmd.FieldByName('xjNum').Value := strtofloatdef(xjNum.text, 0); + ADOQueryCmd.FieldByName('Yjxdate').Value := formatdateTime('yyyy-MM-dd', Yjxdate.Date); + end + else + ADOQueryCmd.FieldByName('IsYjx').Value := ''; + ADOQueryCmd.FieldByName('YjxYG').Value := trim(YjxYG.Text); + ADOQueryCmd.FieldByName('ISTAX').Value := IsTax.Checked; + // ADOQueryCmd.FieldByName('Yjxdate').Value:=formatdateTime('yyyy-MM-dd',Yjxdate.Date); + ADOQueryCmd.FieldByName('PackFee').Value := floattostr(strtofloatdef(PackFee.Text, 0)); + ADOQueryCmd.FieldByName('YbFee').Value := floattostr(strtofloatdef(YbFee.Text, 0)); + ADOQueryCmd.FieldByName('otherFee').Value := floattostr(strtofloatdef(otherFee.Text, 0)); + ADOQueryCmd.FieldByName('mainID').Value := trim(CDS_Main.fieldbyname('mainID').AsString); + ADOQueryCmd.FieldByName('subID').Value := trim(CDS_Main.fieldbyname('subID').AsString); + ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date); +// ADOQueryCmd.FieldByName('TocustName').Value := trim(CDS_Main.fieldbyname('TocustName').AsString); +// ADOQueryCmd.FieldByName('batchNo').Value := trim(CDS_Main.fieldbyname('batchNo').AsString); + ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text); + ADOQueryCmd.FieldByName('CRFlag').Value := ''; +// ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString); +// ADOQueryCmd.FieldByName('MJXH').Value := trim(fieldbyname('MJXH').AsString); + ADOQueryCmd.FieldByName('CPTYPE').Value := 'Ʒ'; + ADOQueryCmd.FieldByName('P_Code').Value := trim(CDS_Main.fieldbyname('P_Code').AsString); + ADOQueryCmd.FieldByName('P_CodeName').Value := trim(CDS_Main.fieldbyname('P_CodeName').AsString); + ADOQueryCmd.FieldByName('P_spec').Value := trim(CDS_Main.fieldbyname('P_spec').AsString); + ADOQueryCmd.FieldByName('P_Color').Value := trim(CDS_Sub.fieldbyname('P_Color').AsString); + + ADOQueryCmd.FieldByName('DRCKNO').Value := trim(CDS_Main.fieldbyname('DRCKNO').AsString); + ADOQueryCmd.FieldByName('DRCKName').Value := trim(CDS_Main.fieldbyname('DRCKName').AsString); +// ADOQueryCmd.FieldByName('P_ColorNO').Value := trim(fieldbyname('P_ColorNO').AsString); +// ADOQueryCmd.FieldByName('defstr1').Value := trim(fieldbyname('defstr1').AsString); +// ADOQueryCmd.FieldByName('P_MF').Value := fieldbyname('P_MF').AsFloat; +// ADOQueryCmd.FieldByName('P_KZ').Value := fieldbyname('P_KZ').AsFloat; +// ADOQueryCmd.FieldByName('RollNum').Value := fieldbyname('RollNum').AsFloat; + ADOQueryCmd.FieldByName('Qty').Value := CDS_sub.fieldbyname(FSize).AsFloat; +// ADOQueryCmd.FieldByName('zsQty').Value := fieldbyname('zsQty').AsFloat; +// ADOQueryCmd.FieldByName('QtyUnit').Value := trim(fieldbyname('QtyUnit').AsString); + ADOQueryCmd.FieldByName('Price').Value := CDS_Main.fieldbyname('price').AsFloat; + ADOQueryCmd.FieldByName('money').Value := CDS_Main.fieldbyname('money').AsFloat; + ADOQueryCmd.FieldByName('rkPrice').Value := CDS_Main.fieldbyname('rkPrice').AsFloat; + ADOQueryCmd.FieldByName('note').Value := trim(CDS_Main.fieldbyname('note').AsString); + ADOQueryCmd.FieldByName('Filler').Value := trim(Filler); + ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(FillTime); + ADOQueryCmd.FieldByName('inoutNo').Value := trim(inoutNo.Text); + // ADOQueryCmd.FieldByName('FirstNo').Value:=trim(FirstName.TxtCode); + // ADOQueryCmd.FieldByName('FirstName').Value:=trim(FirstName.Text); + + if i = 1 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CXXS'; + end + else if i = 2 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CXS'; + end + else if i = 3 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CS'; + end + else if i = 4 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CM'; + end + else if i = 5 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CL'; + end + else if i = 6 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CXL'; + end + else if i = 7 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AXS'; + end + else if i = 8 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AS'; + end + else if i = 9 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AM'; + end + else if i = 10 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AL'; + end + else if i = 11 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AXL'; + end + else if i = 12 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AXXL'; + end + else if i = 13 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CXXL'; + end + else if i = 14 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'AXXXL'; + end + else if i = 15 then + begin + ADOQueryCmd.FieldByName('defstr1').Value := 'CXXXS'; + end; + + if FType = 1 then + begin + ADOQueryCmd.FieldByName('editer').Value := trim(dName); + ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp); + end; +// ADOQueryCmd.FieldByName('kcID').Value := FieldByName('kcID').AsInteger; + ADOQueryCmd.Post; + + with ADOQueryTmp do + begin + close; + sql.Clear; + sql.Add('select isnull(mainID,'''') as Mainid,isnull(subID,'''') as Subid,isnull(P_Code,'''') as P_Code,isnull(P_CodeName,'''') as P_CodeName,isnull(P_spec,'''') '); + sql.Add(',isnull(P_Color,'''') as P_Color,defstr1,isnull(P_MF,'''') as P_MF,isnull(P_KZ,'''') as P_KZ,RKprice, '); + sql.Add('SUM(CRFlagRate * RollNum ) as RollNum,'); + sql.Add('SUM(CRFlagRate * (Qty+zsQty)) as Qty,'); + sql.Add('CAST( P_KZ as varchar(10)) as P_KZ_s,'); + sql.Add(' SUM(CRFlagRate * (Qty+zsQty))*RKprice as money '); + sql.Add(',ISNULL(OrderNO,'''') as OrderNO'); + sql.Add(',isnull(DRCKNO ,'''') as DRCKNO ,isnull(DRCKName,'''') as DRCKName'); + sql.Add('from( '); + sql.Add('select RKprice=(select top 1 RKprice from CP_inout D where D.P_code=A.P_code order by D.RKprice desc), '); + SQL.Add('A.mainid,Subid,P_Code,P_CodeName,P_spec,P_MF,P_KZ,DRCKNO,DRCKName,RollNum,Qty,zsQty,P_color,DEFstr1, '); + sql.Add('case when CRFlag='''' then 1 else -1 end as CRFlagRate '); + sql.Add(',Orderno '); + sql.Add('from CP_inout A'); + sql.Add('left join JYOrder_main B on A.maiNID=B.Mainid '); + sql.Add('where a.Valid=''Y'' '); + sql.Add('and isnull(A.p_Codename,'''')=''' + CDS_Main.fieldbyname('p_Codename').AsString + ''' '); + sql.Add('and isnull(A.P_Code,'''')=''' + CDS_Main.fieldbyname('P_Code').AsString + ''' '); + sql.Add('and isnull(A.DRCKNO,'''')=''' + CDS_Main.fieldbyname('DRCKNO').AsString + ''' '); + sql.Add('and isnull(A.DRCKName,'''')=''' + CDS_Main.fieldbyname('DRCKName').AsString + ''' '); + sql.Add('and isnull(A.P_color,'''')=''' + CDS_Sub.fieldbyname('P_Color').AsString + ''' '); + sql.Add('and isnull(defstr1,'''')=(select defstr1 from CP_inout X where X.CRNO=''' + trim(fkeyNO) + ''' and X.CRID=''' + IntToStr(XHNO) + ''')'); + sql.Add(' )AA'); + sql.Add(' group by ISNULL(mainID,''''),ISNULL(subID,''''),isnull(P_Code,''''),isnull(P_CodeName,''''),ISNULL(P_spec,''''),isnull(P_MF,''''),isnull(P_KZ,''''),RKprice,ISNULL(OrderNO,'''') ,CAST( P_KZ as varchar(10)) '); + sql.Add(',isnull(DRCKNO ,'''') ,isnull(DRCKName,''''),isnull(P_Color,'''') ,defstr1 '); +// showmessage(sql.Text); + open; + end; + + if ((ADOQueryTmp.FieldByName('Qty').AsFloat) < 0) or (ADOQueryTmp.IsEmpty = True) then + begin +// application.MessageBox('ܴڿ', 'ʾϢ', 0); + Application.MessageBox(PChar(CDS_Sub.fieldbyname('P_Color').AsString + 'ܴڿ'), 'ʾ', 0); + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + exit; + end; + + XHNO := XHNO + 1; + end; + + i := i + 1; + end; + + Next; + end; + end; + + + +// if trim(CRType.Text) = '۳' then +// begin +// if not YSData() then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// exit; +// end; +// end; + next; + end; +// if trim(CRType.Text) = '۳' then +// begin +// if strtofloatdef(PackFee.Text, 0) <> 0 then +// begin +// if not YSData_other('', strtofloatdef(PackFee.Text, 0)) then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// exit; +// end; +// end; +// if strtofloatdef(YbFee.Text, 0) <> 0 then +// begin +// if not YSData_other('', strtofloatdef(YbFee.Text, 0)) then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// exit; +// end; +// end; +// if strtofloatdef(OtherFee.Text, 0) <> 0 then +// begin +// if not YSData_other('', strtofloatdef(otherFee.Text, 0)) then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// exit; +// end; +// end; +// if IsYjx.Checked then +// begin +// if not SKData() then +// begin +// ADOQueryCmd.Connection.RollbackTrans; +// exit; +// end; +// end; +// +// end; + + end; + CDS_Main.EnableControls; + ADOQueryCmd.Connection.CommitTrans; + result := true; + except + CDS_Main.EnableControls; + ADOQueryCmd.Connection.RollbackTrans; + end; +end; + +procedure TfrmCpCk.InitGrid(); +begin + try + { with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select isnull(mainID,'''') as Mainid,isnull(subID,'''') as Subid,isnull(P_Code,'''') as P_Code,isnull(P_CodeName,'''') as P_CodeName,isnull(P_spec,'''') as P_spec '); + sql.Add(',isnull(P_MF,'''') as P_MF,isnull(P_KZ,'''') as P_KZ,RKprice,isnull(P_Color,'''') as P_Color,'); + sql.Add('SUM(RollNum ) as RollNum,'); + sql.Add('SUM((Qty+zsQty)) as Qty,'); + sql.Add('CAST( P_KZ as varchar(10)) as P_KZ_s,'); + sql.Add('SUM((Qty+zsQty))*RKprice as money'); + sql.Add(',ISNULL(OrderNO,'''') as OrderNO'); + sql.Add(',isnull(DRCKNO ,'''') as DRCKNO ,isnull(DRCKName,'''') as DRCKName,CRNO,InOutNo,CRTime,isnull(custName,'''') as custName,CRType,CKName,isnull(custNo,'''') as custNo,CPType '); + SQL.Add(',isnull(Note,'''') as Note,isnull(Price,0) as Price,FHAddress,LXFS,TocustName'); + sql.Add('from (select A.*,'); + sql.Add('orderNo=(select Top 1 orderNo from JYOrder_Main X where X.MainID=A.MainID )'); + sql.Add('from CP_InOut A'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); + SQL.Add('and P_Code=' + quotedstr(trim(FCode))); + SQL.Add('and P_CodeName=' + quotedstr(trim(FCodeName))); +// SQL.Add('and DRCKNO=' + quotedstr(trim(FDRCKNO))); +// SQL.Add('and DRCKName=' + quotedstr(trim(FDRCKName))); + sql.Add(')AA'); + sql.Add('group by ISNULL(mainID,''''),ISNULL(subID,''''),isnull(P_Code,''''),isnull(P_CodeName,''''),ISNULL(P_spec,'''')'); + sql.Add(',isnull(P_MF,''''),isnull(P_KZ,''''),RKprice,ISNULL(OrderNO,'''') ,CAST( P_KZ as varchar(10)),isnull(P_Color,'''')'); + sql.Add(',isnull(DRCKNO ,'''') ,isnull(DRCKName,''''),CRNO,InOutNo,CRTime,isnull(custName,''''),CRType,CKName,isnull(custNo,''''),CPType'); + sql.Add(',isnull(Note,''''),isnull(Price,0),FHAddress,LXFS,TocustName'); +// ShowMessage(SQL.text); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); } + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('select isnull(mainID,'''') as Mainid,isnull(subID,'''') as Subid,isnull(P_Code,'''') as P_Code,isnull(P_CodeName,'''') as P_CodeName,isnull(P_spec,'''') as P_spec '); + sql.Add(',isnull(P_MF,'''') as P_MF,isnull(P_KZ,'''') as P_KZ,RKprice,isnull(P_Color,'''') as P_Color,isnull(defstr1,'''') as defstr1,'); + sql.Add('SUM(RollNum ) as RollNum,'); + sql.Add('SUM((Qty+zsQty)) as Qty,'); + sql.Add('CAST( P_KZ as varchar(10)) as P_KZ_s,'); + sql.Add('SUM((Qty+zsQty))*RKprice as money'); + sql.Add(',ISNULL(OrderNO,'''') as OrderNO,FHAddress,LXFS'); + sql.Add(',isnull(DRCKNO ,'''') as DRCKNO ,isnull(DRCKName,'''') as DRCKName,CRNO,InOutNo,CRTime,isnull(custName,'''') as custName,CRType,CKName,isnull(custNo,'''') as custNo,CPType '); + SQL.Add(',isnull(Note,'''') as Note,isnull(Price,0) as Price'); + sql.Add('from (select A.*,'); + sql.Add('orderNo=(select Top 1 orderNo from JYOrder_Main X where X.MainID=A.MainID )'); + sql.Add('from CP_InOut A'); + sql.Add('where CRNO=' + quotedstr(trim(fkeyNO))); +// SQL.Add('and P_Code=' + quotedstr(trim(FCode))); +// SQL.Add('and P_CodeName=' + quotedstr(trim(FCodeName))); +// SQL.Add('and DRCKNO=' + quotedstr(trim(FDRCKNO))); +// SQL.Add('and DRCKName=' + quotedstr(trim(FDRCKName))); + sql.Add(')AA'); + sql.Add('group by ISNULL(mainID,''''),ISNULL(subID,''''),isnull(P_Code,''''),isnull(P_CodeName,''''),ISNULL(P_spec,'''')'); + sql.Add(',isnull(P_MF,''''),isnull(P_KZ,''''),RKprice,ISNULL(OrderNO,'''') ,isnull(P_Color,''''),isnull(defstr1,''''),CAST( P_KZ as varchar(10))'); + sql.Add(',isnull(DRCKNO ,'''') ,isnull(DRCKName,''''),CRNO,InOutNo,CRTime,isnull(custName,''''),CRType,CKName,isnull(custNo,''''),CPType'); + sql.Add(',isnull(Note,''''),isnull(Price,0),FHAddress,LXFS'); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); + if not CDS_Main.IsEmpty then + begin + CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime; + CKName.ItemIndex := CKName.Items.IndexOf(trim(CDS_Main.fieldbyname('CKName').AsString)); + CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString)); + InoutNO.Text := trim(CDS_Main.fieldbyname('InoutNO').AsString); + custName.TxtCode := trim(CDS_Main.fieldbyname('custNo').AsString); + custName.Text := trim(CDS_Main.fieldbyname('custName').AsString); + FHAddress.Text := trim(CDS_Main.fieldbyname('FHAddress').AsString); + LXFS.Text := trim(CDS_Main.fieldbyname('LXFS').AsString); + // orderNo.Text:=trim(CDS_Main.fieldbyname('orderNo').AsString); + // PRTCodeName.Text:=trim(CDS_Main.fieldbyname('PRTCodeName').AsString); + // PRTColor.Text:=trim(CDS_Main.fieldbyname('PRTColor').AsString); +// TocustName.TxtCode := trim(CDS_Main.fieldbyname('TocustNo').AsString); +// TocustName.Text := trim(CDS_Main.fieldbyname('TocustName').AsString); +// IStax.Checked := CDS_Main.FieldByName('IsTax').AsBoolean; +// if CDS_Main.fieldbyname('IsYjx').AsString = '' then +// begin +// IsYjx.Checked := true; +// Yjxdate.Date := CDS_Main.FieldByName('Yjxdate').AsDateTime; +// end +// else +// IsYjx.Checked := false; +// YjxYG.Text := trim(CDS_Main.FieldByName('YjxYG').AsString); +// PackFee.Value := CDS_Main.FieldByName('PackFee').AsFloat; +// YbFee.Value := CDS_Main.FieldByName('YbFee').AsFloat; +// otherFee.Value := CDS_Main.FieldByName('otherFee').AsFloat; +// XjNum.Value := CDS_Main.FieldByName('XjNum').AsFloat; +// ToolButton1.Click; + Initsub_1(); + end + else +// ToolButton1.Click; + + + + + finally + end; + Initsub(); +end; + +procedure TfrmCpCk.FormDestroy(Sender: TObject); +begin + frmCpCk := nil; +end; + +procedure TfrmCpCk.FormCreate(Sender: TObject); +begin + CRTime.Date := DServerDate; + panel3.Align := alclient; + Yjxdate.Date := DServerDate; +end; + +procedure TfrmCpCk.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + tv1.Name + '2', Tv1, 'Ʒֿ'); + Action := cahide; +end; + +procedure TfrmCpCk.FormShow(Sender: TObject); +begin + readCxGrid(self.Caption + tv1.Name + '2', Tv1, 'Ʒֿ'); + SetComboBox(); + InitGrid(); + if fType = 0 then + begin + if GetLSNo(ADOQueryCmd, fkeyNo, 'CK', 'CP_InOut', 3, 1) = False then + begin + // ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡʧ!', 'ʾ', 0); + Exit; + end; + inoutNo.Text := 'C' + Trim(RightBStr(fkeyNo, Length(fkeyNo) - 2)); + end; +end; + +procedure TfrmCpCk.TBSaveClick(Sender: TObject); +begin + if cds_main.IsEmpty then + exit; + CRTime.SetFocus; + if trim(CRType.Text) = '' then + begin + application.MessageBox('ͲΪգ', 'ʾϢ', 0); + exit; + end; + if trim(CRType.Text) = '۳' then + begin + if trim(custName.Text) = '' then + begin + application.MessageBox('ͻΪգ', 'ʾϢ', 0); + exit; + end; + end; + + if IsYjx.Checked then + begin + if trim(YjxYG.Text) = '' then + begin + application.MessageBox('տ˲Ϊգ', 'ʾϢ', 0); + exit; + end; + end; + if (trim(CRType.Text) = 'Ʒ') and (trim(orderNO.Text) = '') then + begin + application.MessageBox('ϢΪգ', 'ʾϢ', 0); + exit; + end; + +// if cds_main.Locate('QtyUnit','',[]) then +// begin +// application.MessageBox('λΪգ','ʾϢ',0); +// exit; +// end; +// if cds_main.Locate('QtyUnit',NULL,[]) then +// begin +// application.MessageBox('λΪգ','ʾϢ',0); +// exit; +// end; + + if savedate() then + begin + application.MessageBox('ݱɹ', 'ʾϢ'); + ModalResult := 1; + end + else + begin + application.MessageBox('ݱʧܣ', 'ʾϢ', MB_ICONERROR); + end; +end; + +procedure TfrmCpCk.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'Cloth'; + flagname := ''; + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmCpCk.ToolButton1Click(Sender: TObject); +var + FMJID: string; +begin + frmCpkcSel := TfrmCpkcSel.create(self); + with frmCpkcSel do + begin + fType := 10; + fckName := self.fckName; + if showmodal = 1 then + begin + cds_main.DisableControls; + cds_main.First; + while not cds_main.Eof do + begin + if (cds_main.fieldbyname('ssel').AsBoolean) then + begin +// if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut_MX', 3, 1) = False then +// begin +// // ADOQueryCmd.Connection.RollbackTrans; +// Application.MessageBox('ȡʧ!', 'ʾ', 0); +// Exit; +// end; + self.cds_main.Append; + self.cds_main.FieldByName('orderNo').Value := trim(cds_main.fieldbyname('orderNo').AsString); + self.cds_main.FieldByName('mainID').Value := trim(cds_main.fieldbyname('mainID').AsString); + self.cds_main.FieldByName('subID').Value := trim(cds_main.fieldbyname('subID').AsString); + self.cds_main.FieldByName('P_Code').Value := trim(cds_main.fieldbyname('P_Code').AsString); + self.cds_main.FieldByName('P_CodeName').Value := trim(cds_main.fieldbyname('P_CodeName').AsString); + self.cds_main.FieldByName('Qty').Value := cds_main.fieldbyname('Qty').AsFloat; + self.cds_main.FieldByName('P_Color').Value := trim(cds_main.fieldbyname('P_Color').AsString); + self.cds_main.FieldByName('defstr1').Value := cds_main.fieldbyname('defstr1').AsString; + self.cds_main.FieldByName('price').Value := cds_main.fieldbyname('rkprice').AsFloat; + self.cds_main.FieldByName('rkprice').Value := cds_main.fieldbyname('rkprice').AsFloat; + self.cds_main.FieldByName('money').Value := cds_main.fieldbyname('money').AsFloat; + self.cds_main.FieldByName('DRCKNO').Value := trim(cds_main.fieldbyname('DRCKNO').AsString); + self.cds_main.FieldByName('DRCKName').Value := trim(cds_main.fieldbyname('DRCKName').AsString); + self.cds_main.Post; + + end; + cds_main.Next; + end; + cds_main.EnableControls; + end; + free; + end; +end; + +procedure TfrmCpCk.ToolButton2Click(Sender: TObject); +begin + if CDS_Main.IsEmpty then + exit; + CDS_Main.Delete; + getxjNum(); +end; + +procedure TfrmCpCk.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCpCk.ToCustNameBtnClick(Sender: TObject); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'CustomerNoName'; + flagname := 'ͻ'; + if ShowModal = 1 then + begin + ToCustName.Text := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + ToCustName.TxtCode := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmCpCk.orderNOBtnClick(Sender: TObject); +begin + { frmProductOrderNewList:=TfrmProductOrderNewList.Create(Application); + with frmProductOrderNewList do + begin + DParameters1:='Ȩ'; + if showmodal=1 then + begin + self.fmainID:=trim(Order_Main.fieldbyname('MainID').AsString); + self.fsubID:=trim(Order_Main.fieldbyname('subID').AsString); + self.orderNo.Text:=trim(Order_Main.fieldbyname('orderNo').AsString); + self.PRTCodeName.Text:=trim(Order_Main.fieldbyname('PRTCodeName').AsString); + self.PRTColor.Text:=trim(Order_Main.fieldbyname('PRTColor').AsString); + end; + free; + end; } +end; + +procedure TfrmCpCk.custNameBtnClick(Sender: TObject); +begin + try + frmZdyAttachment := TfrmZdyAttachment.Create(Application); + with frmZdyAttachment do + begin + if ShowModal = 1 then + begin + custName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + custName.TxtCode := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + FHAddress.Text := Trim(CDS_HZ.fieldbyname('DEFNote2').AsString); + LXFS.Text := Trim(CDS_HZ.fieldbyname('DEFstr1').AsString) + ' ' + Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); + end; + end; + finally + frmZdyAttachment.Free; + end; +end; + +procedure TfrmCpCk.ToolButton3Click(Sender: TObject); +begin + Panel2.Visible := true; +end; + +procedure TfrmCpCk.Edit1KeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + if CDS_Main.IsEmpty then + exit; + if trim(edit1.Text) = '' then + exit; + if CDS_Main.Locate('MJID', trim(edit1.Text), []) then + begin + CDS_Main.Delete; + Label11.Caption := ':' + trim(edit1.Text) + 'ɾɹ'; + end + else + begin + Label11.Caption := ':' + trim(edit1.Text) + 'ɾʧܣ'; + end; + + edit1.Text := ''; + end; +end; + +procedure TfrmCpCk.Panel2DblClick(Sender: TObject); +begin + Panel2.Visible := false; +end; + +procedure TfrmCpCk.v1QtyPropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := '0'; + end; + FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName); + with CDS_Main do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + Post; + end; + tv1.Controller.EditingController.ShowEdit(); + GetxjNum(); +end; + +procedure TfrmCpCk.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + Initsub(); +end; + +procedure TfrmCpCk.QtyMXKeyPress(Sender: TObject; var Key: Char); +var + fMJXH: string; + fRollNum: integer; + fQty, fzsQty: double; +begin + if Key = #13 then + begin + if strtofloatdef(QtyMX.Text, 0) = 0 then + exit; + + if GetLSNo(self.ADOQueryCmd, fMJXH, 'MX', 'CP_InOut_MX', 4, 1) = False then + begin + // ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡʧ!', 'ʾ', 0); + Exit; + end; + try + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from CP_InOut_MX A'); + sql.Add('where 1=2'); + open; + append; + Fieldbyname('MJID').Value := trim(CDS_Main.fieldbyname('MJID').AsString); + Fieldbyname('MJXH').Value := fMJXH; + Fieldbyname('RollNUm').Value := 1; + Fieldbyname('Qty').Value := strtofloatdef(QtyMX.Text, 0) - strtofloatdef(zsQtyMX.Text, 0); + Fieldbyname('zsQty').Value := strtofloatdef(zsQtyMX.Text, 0); + Fieldbyname('Qtyunit').Value := trim(CDS_Main.fieldbyname('Qtyunit').AsString); + post; + end; + + with CDS_sub do + begin + append; + Fieldbyname('Qty').Value := strtofloatdef(QtyMX.Text, 0) - strtofloatdef(zsQtyMX.Text, 0); + Fieldbyname('zsQty').Value := strtofloatdef(zsQtyMX.Text, 0); + post; + end; + if varisnull(tv2.DataController.Summary.FooterSummaryValues[0]) then + begin + fRollNum := 0; + fQty := 0; + fzsQty := 0; + end + else + begin + fRollNum := CDS_Sub.RecordCount; + fQty := tv2.DataController.Summary.FooterSummaryValues[0]; + fzsQty := tv2.DataController.Summary.FooterSummaryValues[1]; + end; + with CDS_Main do + begin + EDIT; + FieldByName('RollNum').Value := fRollNum; + Fieldbyname('Qty').Value := fQty; + Fieldbyname('zsQty').Value := fzsQty; + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + post; + end; + QtyMX.Text := ''; + // zsQtyMX.Text:=''; + QtyMX.SetFocus; + except + end; + end; +end; + +procedure TfrmCpCk.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +var + FROLLnUM: INTEGER; + FQTY: double; + fzsQty: double; +begin + if CDS_Sub.IsEmpty then + exit; + if Application.MessageBox('ȷҪɾƥ', 'ʾ', 32 + 4) <> IDYES then + Exit; + try + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_InOut_MX '); + sql.Add('where MJXH=' + quotedstr(trim(CDS_Sub.fieldbyname('MJXH').AsString))); + + sql.Add('update CP_InOut SET RollNum=(select count(MJXH) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add(',Qty=(select sum(Qty) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add(',ZsQty=(select sum(ZsQty) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add('where MJID=' + quotedstr(trim(CDS_Sub.fieldbyname('MJID').AsString))); + sql.Add('and CRFLag='''' '); + execsql; + end; + Initsub(); + if varisnull(tv2.DataController.Summary.FooterSummaryValues[0]) then + begin + FROLLnUM := 0; + FQTY := 0; + fzsQty := 0; + end + else + begin + FROLLnUM := CDS_Sub.RecordCount; + FQTY := tv2.DataController.Summary.FooterSummaryValues[0]; + fzsQty := tv2.DataController.Summary.FooterSummaryValues[1]; + end; + with CDS_Main do + begin + EDIT; + FieldByName('RollNum').Value := FROLLnUM; + Fieldbyname('Qty').Value := FQTY; + Fieldbyname('ZsQty').Value := fzsQty; + FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + post; + end; + except + application.MessageBox('ɾʧ', 'ʾϢ', 0) + end; +end; + +procedure TfrmCpCk.YjxYGBtnClick(Sender: TObject); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'YjxYGFlag'; + flagname := 'տ'; + if ShowModal = 1 then + begin + YjxYG.Text := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmCpCk.PackFeePropertiesChange(Sender: TObject); +begin + GetxjNum(); +end; + +procedure TfrmCpCk.FHAddressBtnUpClick(Sender: TObject); +begin + if Trim(custName.Text) = '' then + begin + Application.MessageBox('ͻΪ!', 'ʾ', 0); + Exit; + end; + try + frmZDYHelpSel := TfrmZDYHelpSel.Create(Application); + with frmZDYHelpSel do + begin + flag := 'FHAddress'; + flagname := 'ַ'; + MainType := Trim(custName.Text); + if ShowModal = 1 then + begin + FHAddress.Text := Trim(ReturnStr); + end; + end; + finally + frmZDYHelpSel.Free; + end; +end; + +procedure TfrmCpCk.LXFSBtnUpClick(Sender: TObject); +begin + if Trim(custName.Text) = '' then + begin + Application.MessageBox('ͻΪ!', 'ʾ', 0); + Exit; + end; + try + frmZDYHelpSel := TfrmZDYHelpSel.Create(Application); + with frmZDYHelpSel do + begin + flag := 'LXFS'; + flagname := 'ϵʽ'; + MainType := Trim(custName.Text); + if ShowModal = 1 then + begin + LXFS.Text := Trim(ReturnStr); + end; + end; + finally + frmZDYHelpSel.Free; + end; +end; + +procedure TfrmCpCk.FHAddressBtnDnClick(Sender: TObject); +begin + TBtnEditC(Sender).Text := ''; + TBtnEditC(Sender).TxtCode := ''; +end; + +procedure TfrmCpCk.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + FROLLnUM: INTEGER; + FQTY: double; + fzsQty: double; +begin + if Button = mbRight then + begin + if CDS_Sub.IsEmpty then + exit; + if Application.MessageBox('ȷҪɾƥ', 'ʾ', 32 + 4) <> IDYES then + Exit; + try + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('delete from CP_InOut_MX '); + sql.Add('where MJXH=' + quotedstr(trim(CDS_Sub.fieldbyname('MJXH').AsString))); + + sql.Add('update CP_InOut SET RollNum=(select count(MJXH) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add(',Qty=(select sum(Qty) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add(',zsQty=(select sum(zsQty) from CP_InOut_MX X where X.MJID=CP_InOut.MJID) '); + sql.Add('where MJID=' + quotedstr(trim(CDS_Sub.fieldbyname('MJID').AsString))); + sql.Add('and CRFlag='''''); + + execsql; + end; + Initsub(); + if varisnull(tv2.DataController.Summary.FooterSummaryValues[0]) then + begin + FROLLnUM := 0; + FQTY := 0; + fzsQty := 0; + end + else + begin + FROLLnUM := CDS_Sub.RecordCount; + FQTY := tv2.DataController.Summary.FooterSummaryValues[0]; + fzsQty := tv2.DataController.Summary.FooterSummaryValues[1]; + end; + with CDS_Main do + begin + EDIT; + FieldByName('RollNum').Value := FROLLnUM; + Fieldbyname('Qty').Value := FQTY; + Fieldbyname('zsQty').Value := fzsQty; + FieldbyName('Money').Value := format('%.3f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]); + post; + end; + except + application.MessageBox('ɾʧ', 'ʾϢ', 0) + end; + end; +end; + +procedure TfrmCpCk.ToolButton4Click(Sender: TObject); +begin + with CDS_Sub do + begin + append; + post; + end; +end; + +procedure TfrmCpCk.ToolButton5Click(Sender: TObject); +begin + if CDS_Sub.IsEmpty then + exit; + CDS_Sub.Delete; +end; + +procedure TfrmCpCk.TV2Column2PropertiesEditValueChanged(Sender: TObject); +var + mvalue, FFieldName: string; + Qty1, Qty2, Qty3, Qty4, Qty5, Qty6, Qty7, Qty8, Qty9, Qty10, Qty11, Qty12, Qty13, Qty14, Qty15, ZQty, a: Integer; + Fprice, Fmoney: Double; +begin + mvalue := TcxTextEdit(Sender).EditingText; + if Trim(mvalue) = '' then + begin + mvalue := '0'; + end; + FFieldName := Trim(Tv3.Controller.FocusedColumn.DataBinding.FilterFieldName); + + with CDS_Sub do + begin + Edit; + FieldByName(FFieldName).Value := Trim(mvalue); + Post; + end; + + Qty1 := StrToIntDef(CDS_Sub.fieldbyname('Size1').asstring, 0); + Qty2 := StrToIntDef(CDS_Sub.fieldbyname('Size2').asstring, 0); + Qty3 := StrToIntDef(CDS_Sub.fieldbyname('Size3').asstring, 0); + Qty4 := StrToIntDef(CDS_Sub.fieldbyname('Size4').asstring, 0); + Qty5 := StrToIntDef(CDS_Sub.fieldbyname('Size5').asstring, 0); + Qty6 := StrToIntDef(CDS_Sub.fieldbyname('Size6').asstring, 0); + Qty7 := StrToIntDef(CDS_Sub.fieldbyname('Size7').asstring, 0); + Qty8 := StrToIntDef(CDS_Sub.fieldbyname('Size8').asstring, 0); + Qty9 := StrToIntDef(CDS_Sub.fieldbyname('Size9').asstring, 0); + Qty10 := StrToIntDef(CDS_Sub.fieldbyname('Size10').asstring, 0); + Qty11 := StrToIntDef(CDS_Sub.fieldbyname('Size11').asstring, 0); + Qty12 := StrToIntDef(CDS_Sub.fieldbyname('Size12').asstring, 0); + Qty13 := StrToIntDef(CDS_Sub.fieldbyname('Size13').asstring, 0); + Qty14 := StrToIntDef(CDS_Sub.fieldbyname('Size14').asstring, 0); + Qty15 := StrToIntDef(CDS_Sub.fieldbyname('Size15').asstring, 0); + ZQty := Qty1 + Qty2 + Qty3 + Qty4 + Qty5 + Qty6 + Qty7 + Qty8 + Qty9 + Qty10 + Qty11 + Qty12 + Qty13 + Qty14 + Qty15; + + with CDS_Sub do + begin + Edit; + FieldByName('ZQty').Value := ZQty; + Post; + end; + + tv3.Controller.EditingController.ShowEdit(); +// CDS_Main.FieldByName('Qty').Value + a := TV3.DataController.Summary.FooterSummaryValues[15]; + + CDS_Main.Edit; + CDS_Main.FieldByName('Qty').Value := a; + CDS_Main.post; + + Fprice := StrToIntDef(CDS_Main.fieldbyname('Price').asstring, 0); + + Fmoney := Fprice * a; + + with CDS_Main do + begin + Edit; + FieldByName('Money').Value := Fmoney; + Post; + end; +end; + +procedure TfrmCpCk.ToolButton6Click(Sender: TObject); +begin + frmProductOrderNewListSEl := TfrmProductOrderNewListSEl.create(self); + with frmProductOrderNewListSEl do + begin + FCloth := 1; + if showmodal = 1 then + begin + Order_Main.First; + while not Order_Main.Eof do + begin + if Order_Main.fieldbyname('ssel').AsBoolean then + begin + CDS_Main.Append; + CDS_Main.FieldByName('orderNo').Value := trim(order_main.fieldbyname('orderNo').asstring); + CDS_Main.FieldByName('mainID').Value := trim(order_main.fieldbyname('mainID').asstring); + CDS_Main.FieldByName('subID').Value := trim(order_main.fieldbyname('subID').asstring); + CDS_Main.FieldByName('P_Code').Value := trim(order_main.fieldbyname('prtcode').asstring); + CDS_Main.FieldByName('P_CodeName').Value := trim(order_main.fieldbyname('prtCodeName').asstring); + CDS_Main.FieldByName('P_Spec').Value := trim(order_main.fieldbyname('prtspec').asstring); + CDS_Main.FieldByName('P_Color').Value := trim(order_main.fieldbyname('prtcolor').asstring); +// CDS_Main.FieldByName('P_EColor').Value := trim(order_main.fieldbyname('SOrdDefStr4').asstring); //ɫӢ + CDS_Main.FieldByName('defstr1').Value := trim(order_main.fieldbyname('Sorddefstr5').asstring); + CDS_Main.FieldByName('qty').Value := trim(order_main.fieldbyname('PRTOrderQty').asstring); + + CDS_Main.post; + end; + Order_Main.Next; + end; + free; + end; + + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCpCk.ToolButton7Click(Sender: TObject); +begin + frmContractSelList := TfrmContractSelList.create(self); + with frmContractSelList do + begin + FCloth := 1; + if showmodal = 1 then + begin + Order_Main.First; + while not Order_Main.Eof do + begin + if Order_Main.fieldbyname('ssel').AsBoolean then + begin + CDS_Main.Append; + CDS_Main.FieldByName('orderNo').Value := trim(order_main.fieldbyname('ConNo').asstring); + CDS_Main.FieldByName('mainID').Value := trim(order_main.fieldbyname('mainID').asstring); + CDS_Main.FieldByName('subID').Value := trim(order_main.fieldbyname('subID').asstring); + CDS_Main.FieldByName('P_Code').Value := trim(order_main.fieldbyname('prtcode').asstring); + CDS_Main.FieldByName('P_CodeName').Value := trim(order_main.fieldbyname('prtCodeName').asstring); + CDS_Main.FieldByName('P_Spec').Value := trim(order_main.fieldbyname('prtspec').asstring); + CDS_Main.FieldByName('P_Color').Value := trim(order_main.fieldbyname('prtcolor').asstring); +// CDS_Main.FieldByName('P_EColor').Value := trim(order_main.fieldbyname('SOrdDefStr4').asstring); //ɫӢ + CDS_Main.FieldByName('defstr1').Value := trim(order_main.fieldbyname('Sorddefstr5').asstring); + CDS_Main.FieldByName('qty').Value := trim(order_main.fieldbyname('PRTOrderQty').asstring); + CDS_Main.FieldByName('Price').Value := trim(order_main.fieldbyname('PRTPrice').asstring); + CDS_Main.FieldByName('Money').Value := (order_main.fieldbyname('PRTOrderQty').asfloat) * (order_main.fieldbyname('PRTPrice').asfloat); + + CDS_Main.post; + end; + Order_Main.Next; + end; + free; + end; + + end; + tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCpCk.Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmCPKWListSel := TfrmCPKWListSel.Create(Application); + with frmCPKWListSel do + begin + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('DRCKNo').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + end; + end; + finally + frmCPKWListSel.Free; + end; + self.tv1.Controller.EditingController.ShowEdit(); +end; + +procedure TfrmCpCk.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'CPRKTYPE'; + flagname := 'ֿ'; + if ShowModal = 1 then + begin + Self.CDS_Main.Edit; + Self.CDS_Main.FieldByName('DRCKName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); +// Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmCpCk.v1Column1PropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); +begin + frmZdyCMZ_sel := TfrmZdyCMZ_sel.create(self); + with frmZdyCMZ_sel do + begin + if showmodal = 1 then + begin + with CDS_Main do + begin + Edit; + FieldByName('defstr1').value := cdssub.fieldbyname('SizeSpec').AsString; + Post; + end; + end; + free; + end; +end; + +end. + diff --git a/成品仓库/U_CpCklist.dfm b/成品仓库/U_CpCklist.dfm new file mode 100644 index 0000000..077d5d9 --- /dev/null +++ b/成品仓库/U_CpCklist.dfm @@ -0,0 +1,1172 @@ +object frmCpCklist: TfrmCpCklist + Left = 251 + Top = 294 + Width = 1287 + Height = 579 + Caption = #25104#21697#20986#24211#21015#34920 + 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 = 1271 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 95 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #26597#35810 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + Visible = False + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #25104#21697#20986#24211 + ImageIndex = 3 + OnClick = TBAddClick + end + object TBsmADD: TToolButton + Left = 213 + Top = 0 + AutoSize = True + Caption = #25195#25551#20986#24211 + ImageIndex = 3 + Visible = False + OnClick = TBsmADDClick + end + object TBEdit: TToolButton + Left = 300 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 363 + Top = 0 + AutoSize = True + Caption = #20316#24223 + ImageIndex = 17 + OnClick = TBDelClick + end + object TBcdel: TToolButton + Left = 426 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 107 + OnClick = TBcdelClick + end + object TBExport: TToolButton + Left = 489 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 552 + Top = 0 + AutoSize = True + Caption = #25171#21360#32454#30721#21333 + ImageIndex = 12 + Visible = False + OnClick = TBPrintClick + end + object TbPrint1: TToolButton + Left = 651 + Top = 0 + Caption = #25171#21360#21457#36135#21333 + ImageIndex = 12 + Visible = False + OnClick = TbPrint1Click + end + object TBClose: TToolButton + Left = 746 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1271 + Height = 69 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 35 + Top = 15 + Width = 52 + Height = 12 + Caption = #20986#24211#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 = 74 + Top = 40 + Width = 13 + Height = 12 + Caption = #33267 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label3: TLabel + Left = 676 + Top = 16 + 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 = 676 + Top = 40 + Width = 54 + Height = 12 + Caption = #39068' '#33394 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 228 + Top = 16 + Width = 52 + Height = 12 + Caption = #20986#24211#31867#22411 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 312 + Top = 72 + Width = 24 + Height = 12 + Caption = #20179#24211 + end + object Label7: TLabel + Left = 228 + Top = 40 + Width = 52 + Height = 12 + Caption = #20986#24211#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label8: TLabel + Left = 448 + Top = 16 + Width = 54 + Height = 12 + Caption = #23458' '#25143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label9: TLabel + Left = 448 + Top = 40 + Width = 53 + Height = 12 + Caption = #35746' '#21333' '#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label10: TLabel + Left = 880 + Top = 40 + Width = 59 + Height = 12 + Caption = #23610#23544'/'#23610#30721 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label11: TLabel + Left = 880 + Top = 16 + Width = 52 + Height = 12 + Caption = #20135#21697#32534#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 88 + Top = 11 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 88 + Top = 35 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object P_CodeName: TEdit + Tag = 2 + Left = 732 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 2 + OnChange = P_CodeNameChange + end + object P_Color: TEdit + Tag = 2 + Left = 732 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 3 + OnChange = P_CodeNameChange + end + object CRType: TComboBox + Tag = 2 + Left = 284 + Top = 12 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 4 + OnChange = P_CodeNameChange + Items.Strings = ( + '' + #38144#21806#20986#24211 + #21152#24037#20986#24211) + end + object ckName: TComboBox + Left = 352 + Top = 76 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 5 + Text = #26679#21697#20179#24211 + Items.Strings = ( + #26679#21697#20179#24211) + end + object inoutNo: TEdit + Tag = 2 + Left = 284 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 6 + OnChange = P_CodeNameChange + end + object custName: TEdit + Tag = 2 + Left = 508 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 7 + OnChange = P_CodeNameChange + end + object orderNo: TEdit + Tag = 2 + Left = 508 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 8 + OnChange = P_CodeNameChange + end + object P_Code: TEdit + Tag = 2 + Left = 944 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 9 + OnChange = P_CodeNameChange + end + object defstr1: TEdit + Tag = 2 + Left = 944 + Top = 36 + Width = 100 + Height = 20 + TabOrder = 10 + OnChange = P_CodeNameChange + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 121 + Width = 1271 + Height = 208 + Align = alClient + TabOrder = 2 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnCustomDrawCell = Tv1CustomDrawCell + OnFocusedRecordChanged = Tv1FocusedRecordChanged + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1P_CodeName + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1RollNum + end + item + Kind = skSum + Column = v1Qty + end + item + Kind = skSum + Column = v1Column2 + end + item + Kind = skSum + Column = v1Column14 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsData.Editing = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v1CRNO: TcxGridDBColumn + Caption = #20986#24211#32534#21495 + DataBinding.FieldName = 'CRNO' + PropertiesClassName = 'TcxTextEditProperties' + Properties.Alignment.Horz = taCenter + Visible = False + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1CRID: TcxGridDBColumn + Caption = #24207#27425#21495 + DataBinding.FieldName = 'CRID' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1inoutNO: TcxGridDBColumn + Caption = #20986#24211#21333#21495 + DataBinding.FieldName = 'inoutNO' + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Width = 88 + end + object v1Column15: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'orderNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1custName: TcxGridDBColumn + Caption = #23458#25143 + DataBinding.FieldName = 'custName' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1TocustName: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'TocustName' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object v1CRTime: TcxGridDBColumn + Caption = #20986#24211#26085#26399 + DataBinding.FieldName = 'CRTime' + Width = 60 + end + object v1CRType: TcxGridDBColumn + Caption = #20986#24211#31867#22411 + DataBinding.FieldName = 'CRType' + HeaderAlignmentHorz = taCenter + end + object v1MJID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'MJID' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1MJXH: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'MJXH' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1P_Code1: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'P_Code' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 70 + end + object v1P_CodeName: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'P_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1P_SPEC: TcxGridDBColumn + Caption = #35268#26684#25104#20998 + DataBinding.FieldName = 'P_SPEC' + HeaderAlignmentHorz = taCenter + Options.Sorting = False + Width = 90 + end + object v1P_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column12: TcxGridDBColumn + Caption = #23610#23544'/'#23610#30721 + DataBinding.FieldName = 'defstr1' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1P_MF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'P_MF' + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1P_KZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'P_KZ' + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1CPTYPE: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'CPTYPE' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1RollNum: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'RollNum' + HeaderAlignmentHorz = taCenter + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 50 + end + object v1Qty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + HeaderAlignmentHorz = taCenter + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 50 + end + object v1Column14: TcxGridDBColumn + Caption = #36192#36865#25968#37327 + DataBinding.FieldName = 'ZSQty' + HeaderAlignmentHorz = taCenter + Width = 80 + end + object v1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + HeaderAlignmentHorz = taCenter + Width = 90 + end + object v1Filler: TcxGridDBColumn + Caption = #25805#20316#21592 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1FillTime: TcxGridDBColumn + Caption = #25805#20316#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Width = 75 + end + object v1Column1: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'price' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column2: TcxGridDBColumn + Caption = #37329#39069 + DataBinding.FieldName = 'money' + HeaderAlignmentHorz = taCenter + Styles.Content = cxStyle_fontclPurple + Styles.Footer = cxStyle_fontclPurple + Styles.Header = cxStyle_fontclPurple + Width = 60 + end + object v1Column3: TcxGridDBColumn + Caption = #26159#21542#25910#29616#37329 + DataBinding.FieldName = 'ISyjx' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column4: TcxGridDBColumn + Caption = #23454#25910#29616#37329 + DataBinding.FieldName = 'xjNum' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column5: TcxGridDBColumn + Caption = #26368#36831#25910#29616#37329#26085#26399 + DataBinding.FieldName = 'Yjxdate' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 75 + end + object v1Column6: TcxGridDBColumn + Caption = #25171#21253#36153 + DataBinding.FieldName = 'packFee' + PropertiesClassName = 'TcxTextEditProperties' + Properties.Alignment.Horz = taCenter + Visible = False + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Width = 60 + OnCompareRowValuesForCellMerging = v1Column6CompareRowValuesForCellMerging + end + object v1Column7: TcxGridDBColumn + Caption = #26679#26495#36153 + DataBinding.FieldName = 'YBFEE' + PropertiesClassName = 'TcxTextEditProperties' + Properties.Alignment.Horz = taCenter + Visible = False + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Width = 60 + OnCompareRowValuesForCellMerging = v1Column6CompareRowValuesForCellMerging + end + object v1Column8: TcxGridDBColumn + Caption = #20854#23427#36153 + DataBinding.FieldName = 'OtherFee' + PropertiesClassName = 'TcxTextEditProperties' + Properties.Alignment.Horz = taCenter + Visible = False + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Width = 60 + OnCompareRowValuesForCellMerging = v1Column6CompareRowValuesForCellMerging + end + object v1Column9: TcxGridDBColumn + Caption = #21457#36135#22320#22336 + DataBinding.FieldName = 'FHAddress' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column10: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXFS' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column11: TcxGridDBColumn + Caption = #24635#37329#39069 + DataBinding.FieldName = 'sMoney' + PropertiesClassName = 'TcxTextEditProperties' + Properties.Alignment.Horz = taCenter + Visible = False + HeaderAlignmentHorz = taCenter + Options.CellMerging = True + Styles.Content = cxStyle_fontclFuchsia + Styles.Footer = cxStyle_fontclFuchsia + Styles.Header = cxStyle_fontclFuchsia + Width = 70 + OnCompareRowValuesForCellMerging = v1Column6CompareRowValuesForCellMerging + end + object v1validName: TcxGridDBColumn + Caption = #26159#21542#20316#24223 + DataBinding.FieldName = 'validName' + Visible = False + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Column13: TcxGridDBColumn + Caption = #26159#21542#21547#31246 + DataBinding.FieldName = 'Istax' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.NullStyle = nssUnchecked + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object Tv1Column1: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'P_ColorNo' + HeaderAlignmentHorz = taCenter + Width = 70 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 101 + Width = 1271 + Height = 20 + Align = alTop + TabOrder = 3 + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 0 + Properties.Tabs.Strings = ( + #26410#20316#24223 + #24050#20316#24223 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectRight = 0 + ClientRectTop = 0 + end + object cxGrid2: TcxGrid + Left = 0 + Top = 329 + Width = 1271 + Height = 211 + Align = alBottom + TabOrder = 4 + object TV2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource2 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV2Column14 + end + item + Kind = skSum + Column = TV2Column2 + end + item + Kind = skSum + Column = TV2Column3 + end + item + Kind = skSum + Column = TV2Column4 + end + item + Kind = skSum + Column = TV2Column5 + end + item + Kind = skSum + Column = TV2Column6 + end + item + Kind = skSum + Column = TV2Column7 + end + item + Kind = skSum + Column = TV2Column8 + end + item + Kind = skSum + Column = TV2Column9 + end + item + Kind = skSum + Column = TV2Column10 + end + item + Kind = skSum + Column = TV2Column11 + end + item + Kind = skSum + Column = TV2Column12 + end + item + Kind = skSum + Column = TV2Column13 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsData.Editing = False + OptionsSelection.CellSelect = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV2Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column14: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column17: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV2Column2: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column3: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column4: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column5: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column6: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column7: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column15: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column8: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column9: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column10: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column11: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column12: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column13: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column16: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'SIZE14' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 1140 + Top = 65532 + end + object ADOQueryTmp: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 608 + Top = 152 + end + object DataSource1: TDataSource + DataSet = CDS_Main + Left = 812 + Top = 65517 + end + object CDS_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 964 + Top = 113 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1032 + Top = 56 + end + object ADOPrint: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 848 + Top = 104 + end + object RMDB_MD: TRMDBDataSet + Visible = True + DataSet = ADOPrint1 + Left = 908 + Top = 152 + end + object RMGridReport1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, 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 + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 896 + Top = 8 + ReportData = {} + 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 = 956 + end + object ADOPrint1: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 860 + Top = 4 + end + object RMDB_Main: TRMDBDataSet + Visible = True + DataSet = ADOPrint + Left = 904 + Top = 152 + end + object cxStyleRepository1: TcxStyleRepository + Left = 265 + Top = 174 + 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 = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_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 = GB2312_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 = GB2312_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 = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clOlive + end + end + object DataSource2: TDataSource + DataSet = CDS_Sub + Left = 840 + Top = 353 + end + object CDS_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 904 + Top = 353 + end + object ADOQuerySub: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 760 + Top = 380 + end +end diff --git a/成品仓库/U_CpCklist.pas b/成品仓库/U_CpCklist.pas new file mode 100644 index 0000000..31eae62 --- /dev/null +++ b/成品仓库/U_CpCklist.pas @@ -0,0 +1,676 @@ +unit U_CpCklist; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, + cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView, + cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, + cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, RM_Common, + RM_Class, RM_e_Xls, RM_GridReport, RM_System, RM_Dataset, cxTextEdit, + cxCheckBox, cxPC, 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 + TfrmCpCklist = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBExport: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1P_CodeName: TcxGridDBColumn; + v1P_SPEC: TcxGridDBColumn; + v1P_MF: TcxGridDBColumn; + v1P_KZ: TcxGridDBColumn; + v1RollNum: TcxGridDBColumn; + v1Qty: TcxGridDBColumn; + v1Note: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + v1CRType: TcxGridDBColumn; + v1CRTime: TcxGridDBColumn; + v1CRNO: TcxGridDBColumn; + v1CRID: TcxGridDBColumn; + v1Filler: TcxGridDBColumn; + v1FillTime: TcxGridDBColumn; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + P_CodeName: TEdit; + P_Color: TEdit; + CRType: TComboBox; + Label5: TLabel; + ADOQueryCmd: TADOQuery; + ADOQueryTmp: TADOQuery; + DataSource1: TDataSource; + CDS_Main: TClientDataSet; + cxGridPopupMenu1: TcxGridPopupMenu; + v1MJID: TcxGridDBColumn; + v1MJXH: TcxGridDBColumn; + v1CPTYPE: TcxGridDBColumn; + ckName: TComboBox; + Label6: TLabel; + v1P_Color: TcxGridDBColumn; + ADOPrint: TADOQuery; + RMDB_MD: TRMDBDataSet; + RMGridReport1: TRMGridReport; + RMXLSExport1: TRMXLSExport; + v1P_Code1: TcxGridDBColumn; + v1inoutNO: TcxGridDBColumn; + TBsmADD: TToolButton; + inoutNo: TEdit; + Label7: TLabel; + v1custName: TcxGridDBColumn; + v1TocustName: TcxGridDBColumn; + TbPrint1: TToolButton; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + v1Column8: TcxGridDBColumn; + v1Column9: TcxGridDBColumn; + v1Column10: TcxGridDBColumn; + ADOPrint1: TADOQuery; + RMDB_Main: TRMDBDataSet; + v1Column11: 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; + Label8: TLabel; + custName: TEdit; + v1validName: TcxGridDBColumn; + v1Column12: TcxGridDBColumn; + v1Column13: TcxGridDBColumn; + cxTabControl1: TcxTabControl; + TBcdel: TToolButton; + v1Column14: TcxGridDBColumn; + v1Column15: TcxGridDBColumn; + orderNo: TEdit; + Label9: TLabel; + P_Code: TEdit; + defstr1: TEdit; + Label10: TLabel; + Label11: TLabel; + Tv1Column1: TcxGridDBColumn; + DataSource2: TDataSource; + CDS_Sub: TClientDataSet; + cxGrid2: TcxGrid; + TV2: TcxGridDBTableView; + TV2Column1: TcxGridDBColumn; + TV2Column14: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + TV2Column5: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + TV2Column8: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; + TV2Column11: TcxGridDBColumn; + TV2Column12: TcxGridDBColumn; + TV2Column13: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + ADOQuerySub: TADOQuery; + TV2Column15: TcxGridDBColumn; + TV2Column16: TcxGridDBColumn; + TV2Column17: TcxGridDBColumn; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure P_CodeNameChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBsmADDClick(Sender: TObject); + procedure TbPrint1Click(Sender: TObject); + procedure v1Column6CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure cxTabControl1Change(Sender: TObject); + procedure TBcdelClick(Sender: TObject); + procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); + private + procedure InitGrid(); + procedure InitSub(); + procedure SetComboBox(); + procedure SetStatus(); + { Private declarations } + public + fCKName: string; + { Public declarations } + end; + +var + frmCpCklist: TfrmCpCklist; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_CpCk, U_BpSmCk; +{$R *.dfm} + +procedure TfrmCpCklist.SetStatus(); +begin + TBedit.Visible := false; + Tbdel.Visible := false; + tbcdel.Visible := false; + case cxTabControl1.TabIndex of + 0: + begin + TBedit.Visible := true; + Tbdel.Visible := true; + end; + 1: + begin + tbcdel.Visible := true; + end; + end; +end; + +procedure TfrmCpCklist.SetComboBox(); +begin + ckName.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCK'' '); + if trim(fCKName) <> '' then + sql.Add('and zdyName=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + ckName.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if ckName.Items.Count > 0 then + ckName.ItemIndex := 0; + + CRType.Items.Clear; + CRType.Items.Add(''); + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCKTYPE'''); + if trim(fCKName) <> '' then + sql.Add('and note=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + CRType.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if CRType.Items.Count > 0 then + CRType.ItemIndex := 0; +end; + +procedure TfrmCpCklist.InitGrid(); +begin + try + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add(' exec P_Get_CP_CK ''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''',''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''',''' + inttostr(cxTabControl1.TabIndex) + ''' '); +// sql.Add('select A.*, '); +// sql.Add('SMoney=PackFee+YbFee+OtherFee+(select SUM(money) from CP_InOut X where X.CRNO=A.CRNO), '); +// sql.Add('orderNo=(select Top 1 orderNo from JYOrder_Main X where X.MainID=A.MainID ),'); +// sql.Add('validName=case when valid=''N'' then '''' else ''δ'' end '); +// sql.Add('from CP_InOut A'); +// sql.Add('where CRTime>=''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''' '); +// sql.Add('and CRTime<''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''' '); +// sql.Add('and CRFlag='''' '); +// if trim(FckName) <> '' then +// sql.Add('and ckName=' + quotedstr(trim(FckName))); +// if cxTabControl1.TabIndex = 0 then +// sql.Add('and valid=''Y'' '); +// if cxTabControl1.TabIndex = 1 then +// sql.Add('and valid=''N'' '); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); + finally + end; +end; + +procedure TfrmCpCklist.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + Action := cafree; +end; + +procedure TfrmCpCklist.FormDestroy(Sender: TObject); +begin + frmCpCklist := nil; +end; + +procedure TfrmCpCklist.TBAddClick(Sender: TObject); +begin + frmCpck := TfrmCpck.create(self); + with frmCpck do + begin + fkeyNo := ''; + fType := 0; + fckName := self.fckName; + if showmodal = 1 then + begin + TBRafresh.Click; + self.CDS_Main.Locate('crNo', trim(fkeyNo), []); + end; + free; + end; +end; + +procedure TfrmCpCklist.P_CodeNameChange(Sender: TObject); +begin + if ADOQueryTmp.Active = False then + Exit; + SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryTmp, CDS_Main); + SInitCDSData20(ADOQueryTmp, CDS_Main); +end; + +procedure TfrmCpCklist.FormShow(Sender: TObject); +begin + readCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + SetComboBox(); + SetStatus(); + InitGrid(); +end; + +procedure TfrmCpCklist.FormCreate(Sender: TObject); +begin + BegDate.Date := DServerDate - 7; + EndDate.Date := DServerDate; + cxGrid1.Align := alclient; + +end; + +procedure TfrmCpCklist.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCpCklist.TBEditClick(Sender: TObject); +begin + if cds_main.IsEmpty then + exit; + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR A'); + SQL.Add('where A.mainid=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sQL.Add('and A.hxNum<>0 '); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('˵Ѿݣ޸ģ', 'ʾ', 0); + Exit; + end; + + + { with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from BP_InOut A'); + SQL.Add('where A.kcid='''+Trim(CDS_Main.fieldbyname('kcid').AsString)+''' '); + sQL.Add('and A.CRFlag='''''); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('Ѳݣ޸ģ','ʾ',0); + Exit; + end; } + + frmCpck := TfrmCpck.create(self); + with frmCpck do + begin + fkeyNo := self.cds_main.fieldbyname('CRNO').AsString; + FCode := self.cds_main.fieldbyname('P_Code').AsString; + FCodeName := self.cds_main.fieldbyname('P_Codename').AsString; + FDRCKNO := self.cds_main.fieldbyname('DRCKNO').AsString; + FDRCKName := self.cds_main.fieldbyname('DRCKName').AsString; + fType := 1; + fckName := self.fckName; + if showmodal = 1 then + begin + + end; + free; + end; + TBRafresh.Click; + +end; + +procedure TfrmCpCklist.TBDelClick(Sender: TObject); +var + YFID, CRID: string; +begin + if CDS_Main.IsEmpty then + Exit; + { if Trim(CDS_Main.fieldbyname('Filler').AsString)<>Trim(DName) then + begin + Application.MessageBox('ܲ˵!','ʾ',0); + Exit; + end; } + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR A'); + SQL.Add('where A.mainid=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sQL.Add('and A.hxNum<>0 '); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('˵Ѿݣɾ', 'ʾ', 0); + Exit; + end; + + if Application.MessageBox('ȷҪ', 'ʾ', 32 + 4) <> IDYES then + Exit; + + try + + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('update CP_InOut SET valid=''N'' '); + SQL.Add('where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sql.Add('delete from YF_Money_CR '); + SQL.Add('where mainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + 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)'); + execsql; + end; + TBRafresh.Click; + except + Application.MessageBox('ɾʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCpCklist.TBRafreshClick(Sender: TObject); +begin + initGrid(); +end; + +procedure TfrmCpCklist.TBPrintClick(Sender: TObject); +var + filepath: string; +begin + if CDS_Main.IsEmpty then + exit; + + with AdoPrint do + begin + close; + sql.Clear; + sql.Add('select A.* from CP_InOut A'); + sql.Add('where inoutNO=' + quotedstr(trim(CDS_Main.fieldbyname('inoutNO').AsString))); + open; + end; + + with AdoPrint1 do + begin + close; + sql.Clear; + sql.Add('exec P_Print_cpCkMd '); + sql.Add('@inoutNo=' + quotedstr(trim(CDS_Main.fieldbyname('inoutNO').AsString))); + sql.Add(',@flag=' + quotedstr(trim(''))); + open; + end; + + try + filepath := ExtractFilePath(Application.ExeName) + 'report\뵥.rmf'; + if not FileExists(Pchar(filepath)) then + begin + application.MessageBox(pchar('ļ[' + filepath + ']ڣ'), 'ʾϢ', MB_IConError); + exit; + end; + RMVariables['dtxz'] := FormatDateTime('yyyy-mm-dd', date()); + RMVariables['zdr'] := trim(DName); + RMVariables['Filler'] := trim(CDS_Main.fieldbyname('Filler').AsString); + RMGridReport1.LoadFromFile(filepath); + RMGridReport1.ShowReport; + finally + + end; + +end; + +procedure TfrmCpCklist.TBExportClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxgrid1); +end; + +procedure TfrmCpCklist.TBsmADDClick(Sender: TObject); +begin + frmbpsmck := Tfrmbpsmck.create(self); + with frmbpsmck do + begin + fkeyNo := ''; + fType := 0; + fckName := self.fckName; + if showmodal = 1 then + begin + TBRafresh.Click; + // self.CDS_Main.Locate('crNo',trim(fkeyNo),[]) ; + end; + TBRafresh.Click; + free; + end; +end; + +procedure TfrmCpCklist.TbPrint1Click(Sender: TObject); +var + filepath: string; +begin + if CDS_Main.IsEmpty then + exit; + + with AdoPrint do + begin + close; + sql.Clear; + sql.Add('select * from CP_INout A '); + sql.Add('where A.inoutNo=' + quotedstr(trim(CDS_Main.fieldbyname('inoutNO').AsString))); + open; + end; + + try + filepath := ExtractFilePath(Application.ExeName) + 'report\.rmf'; + if not FileExists(Pchar(filepath)) then + begin + application.MessageBox(pchar('ļ[' + filepath + ']ڣ'), 'ʾϢ', MB_IConError); + exit; + end; + RMVariables['dtxz'] := FormatDateTime('yyyy-mm-dd', date()); + RMVariables['zdr'] := trim(DName); + RMVariables['Filler'] := trim(CDS_Main.fieldbyname('Filler').AsString); + RMGridReport1.LoadFromFile(filepath); + RMGridReport1.ShowReport; + finally + + end; + +end; + +procedure TfrmCpCklist.v1Column6CompareRowValuesForCellMerging(Sender: TcxGridColumn; ARow1: TcxGridDataRow; AProperties1: TcxCustomEditProperties; const AValue1: Variant; ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties; const AValue2: Variant; var AAreEqual: Boolean); +var + colIdx0, colIdx1: integer; +begin + colIdx0 := tv1.GetColumnByFieldName('CRNO').Index; +// colIdx1:= tv1.GetColumnByFieldName('colorname').Index; + if (ARow1.Values[colIdx0] = ARow2.Values[colIdx0]) then + AAreEqual := True + else + AAreEqual := False; + +end; + +procedure TfrmCpCklist.ToolButton1Click(Sender: TObject); +var + YFID, CRID: string; +begin + if CDS_Main.IsEmpty then + Exit; + { if Trim(CDS_Main.fieldbyname('Filler').AsString)<>Trim(DName) then + begin + Application.MessageBox('ܲ˵!','ʾ',0); + Exit; + end; } + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from YF_Money_CR A'); + SQL.Add('where A.mainid=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sQL.Add('and A.hxNum<>0 '); + Open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('˵Ѿݣɾ', 'ʾ', 0); + Exit; + end; + + if Application.MessageBox('ȷҪ', 'ʾ', 32 + 4) <> IDYES then + Exit; + + try + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('update CP_InOut SET valid=''N'' '); + SQL.Add('where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + sql.Add('delete from YF_Money_CR '); + SQL.Add('where mainID=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + 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)'); + execsql; + end; + TBRafresh.Click; + except + Application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCpCklist.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +// IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('validName').Index]='' then +// ACanvas.Font.Color:=clred; +end; + +procedure TfrmCpCklist.cxTabControl1Change(Sender: TObject); +begin + SetStatus(); + InitGrid(); +end; + +procedure TfrmCpCklist.TBcdelClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + exit; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + try + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete from CP_InOut where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' '); + execsql; + end; + TBRafresh.Click; + except + Application.MessageBox('ɾʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCpCklist.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); +begin + initsub(); +end; + +procedure TfrmCpCklist.InitSub(); +begin + if CDS_Main.IsEmpty then + Exit; + try + with ADOQuerySub do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_CK_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''',''' + Cds_main.fieldbyname('CRNO').AsString + ''' '); + sql.Add(' ,''' + cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + cds_main.fieldbyname('DRCKName').AsString + ''' '); +// ShowMessage(SQL.text); + open; + end; + SCreateCDS20(ADOQuerySub, CDS_Sub); + SInitCDSData20(ADOQuerySub, CDS_Sub); + finally + end; +end; + +end. + diff --git a/成品仓库/U_CpkcSel.dfm b/成品仓库/U_CpkcSel.dfm new file mode 100644 index 0000000..c247841 --- /dev/null +++ b/成品仓库/U_CpkcSel.dfm @@ -0,0 +1,1383 @@ +object frmCpkcSel: TfrmCpkcSel + Left = 636 + Top = 153 + Width = 1097 + Height = 891 + Caption = #25104#21697#24211#23384 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + WindowState = wsMaximized + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object Label7: TLabel + Left = 268 + Top = 16 + Width = 52 + Height = 12 + Caption = #35268#26684#22411#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1081 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 107 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = CPCK_DataLink.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #26597#35810 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TOk: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #30830#23450 + ImageIndex = 41 + Visible = False + OnClick = TOkClick + end + object ToolButton1: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #22270#26679#26597#30475 + ImageIndex = 57 + Visible = False + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 213 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object ToolButton2: TToolButton + Left = 276 + Top = 0 + Caption = #20462#25913#20179#24211#32534#21495 + ImageIndex = 54 + Visible = False + OnClick = ToolButton2Click + end + object ToolButton3: TToolButton + Left = 383 + Top = 0 + Caption = #20462#25913#20179#24211#21517#31216 + ImageIndex = 54 + Visible = False + OnClick = ToolButton3Click + end + object TBPrint: TToolButton + Left = 490 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + Visible = False + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 553 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1081 + Height = 45 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 27 + Top = 135 + Width = 52 + Height = 12 + Caption = #20837#24211#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 = 60 + Top = 124 + Width = 13 + Height = 12 + Caption = #33267 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label3: TLabel + Left = 16 + Top = 64 + Width = 39 + Height = 12 + Caption = #21152#24037#21378 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 308 + Top = 152 + Width = 52 + Height = 12 + Caption = #20837#24211#31867#22411 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 288 + Top = 72 + Width = 24 + Height = 12 + Caption = #20179#24211 + end + object Label8: TLabel + Left = 192 + Top = 64 + Width = 26 + Height = 12 + Caption = #25209#27425 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label9: TLabel + Left = 188 + Top = 16 + Width = 52 + Height = 12 + Caption = #20135#21697#32534#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label10: TLabel + Left = 540 + Top = 64 + Width = 52 + Height = 12 + Caption = #35268#26684#22411#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label11: TLabel + Left = 516 + Top = 16 + Width = 26 + Height = 12 + Caption = #39068#33394 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label12: TLabel + Left = 424 + Top = 76 + Width = 26 + Height = 12 + Caption = #20811#37325 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 32 + Top = 16 + Width = 39 + Height = 12 + Caption = #35746#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label13: TLabel + Left = 656 + Top = 16 + Width = 59 + Height = 12 + Caption = #23610#23544'/'#23610#30721 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label14: TLabel + Left = 348 + Top = 16 + 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 Label15: TLabel + Left = 828 + Top = 16 + Width = 52 + Height = 12 + Caption = #20179#24211#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 216 + Top = 131 + Width = 100 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + ShowCheckbox = True + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 88 + Top = 127 + Width = 100 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + ShowCheckbox = True + TabOrder = 1 + end + object custName: TEdit + Tag = 2 + Left = 60 + Top = 60 + Width = 100 + Height = 20 + TabOrder = 2 + OnChange = custNameChange + end + object CRType: TComboBox + Tag = 2 + Left = 384 + Top = 152 + Width = 120 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 3 + OnChange = custNameChange + Items.Strings = ( + '' + #29983#20135#20837#24211) + end + object CheckBox1: TCheckBox + Left = 544 + Top = 152 + Width = 97 + Height = 17 + Caption = #21547#24211#23384#20026#38646 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + end + object ckName: TComboBox + Left = 320 + Top = 68 + Width = 100 + Height = 20 + Style = csDropDownList + ItemHeight = 12 + ItemIndex = 0 + TabOrder = 5 + Text = #26679#21697#20179#24211 + Items.Strings = ( + #26679#21697#20179#24211) + end + object batchNo: TEdit + Tag = 2 + Left = 220 + Top = 60 + Width = 100 + Height = 20 + TabOrder = 6 + OnChange = custNameChange + end + object P_CodeName: TEdit + Tag = 2 + Left = 408 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 7 + OnChange = custNameChange + end + object P_Spec: TEdit + Tag = 2 + Left = 592 + Top = 60 + Width = 100 + Height = 20 + TabOrder = 8 + OnChange = custNameChange + end + object P_Color: TEdit + Tag = 2 + Left = 548 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 9 + OnChange = custNameChange + end + object P_KZ_S: TEdit + Tag = 2 + Left = 456 + Top = 72 + Width = 100 + Height = 20 + TabOrder = 10 + OnChange = custNameChange + end + object orderNo: TEdit + Tag = 2 + Left = 76 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 11 + OnChange = custNameChange + end + object defstr1: TEdit + Tag = 2 + Left = 720 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 12 + OnChange = custNameChange + end + object P_Code: TEdit + Tag = 2 + Left = 244 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 13 + OnChange = custNameChange + end + object DRCKName: TEdit + Tag = 2 + Left = 884 + Top = 12 + Width = 100 + Height = 20 + TabOrder = 14 + OnChange = custNameChange + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 77 + Width = 1081 + Height = 359 + Align = alClient + PopupMenu = PopupMenu1 + TabOrder = 2 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + OnFocusedRecordChanged = Tv1FocusedRecordChanged + DataController.DataSource = DataSource1 + DataController.Filter.AutoDataSetFilter = True + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + Column = v1P_CodeName + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + Column = v1Qty + end + item + Kind = skSum + Column = v1Column7 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnSorting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object v1Ssel: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'Ssel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + end + object v1Column4: TcxGridDBColumn + Caption = #35746#21333#21495 + DataBinding.FieldName = 'OrderNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 128 + end + object v1CRTime: TcxGridDBColumn + Caption = #20837#24211#26085#26399 + DataBinding.FieldName = 'CRTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + Width = 60 + end + object v1CRType: TcxGridDBColumn + Caption = #20837#24211#31867#22411 + DataBinding.FieldName = 'CRType' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + end + object v1MJID: TcxGridDBColumn + Caption = #21367#26465#30721 + DataBinding.FieldName = 'MJID' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + Width = 60 + end + object v1MJXH: TcxGridDBColumn + Caption = #21367#21495 + DataBinding.FieldName = 'MJXH' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + Width = 60 + end + object v1Column2: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'custName' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + Width = 100 + end + object v1Column3: TcxGridDBColumn + Caption = #25209#27425 + DataBinding.FieldName = 'batchNo' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + VisibleForCustomization = False + Width = 100 + end + object Tv1Column3: TcxGridDBColumn + Caption = #20837#24211#31867#22411 + DataBinding.FieldName = 'CRType' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object v1P_Code: TcxGridDBColumn + Caption = #20135#21697#32534#21495 + DataBinding.FieldName = 'P_Code' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 100 + end + object v1P_CodeName: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'P_CodeName' + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 100 + end + object v1P_SPEC: TcxGridDBColumn + Caption = #35268#26684#25104#20998 + DataBinding.FieldName = 'P_SPEC' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 128 + end + object v1CPType: TcxGridDBColumn + Caption = #31561#32423 + DataBinding.FieldName = 'CPType' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + VisibleForCustomization = False + Width = 76 + end + object Tv1Column5: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column6: TcxGridDBColumn + Caption = #23610#30721'/'#23610#23544 + DataBinding.FieldName = 'defstr1' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object v1Qty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Styles.Content = CPCK_DataLink.FontBlue + Styles.Footer = CPCK_DataLink.FontBlue + Styles.Header = CPCK_DataLink.FontBlue + Width = 59 + end + object v1Note: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'Note' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Options.Sorting = False + Width = 90 + end + object v1Column6: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'RKPrice' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 70 + end + object v1Column7: TcxGridDBColumn + Caption = #37329#39069 + DataBinding.FieldName = 'money' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 70 + end + object Tv1Column1: TcxGridDBColumn + Caption = #20179#24211#32534#21495 + DataBinding.FieldName = 'DRCKNO' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object Tv1Column2: TcxGridDBColumn + Caption = #20179#24211#21517#31216 + DataBinding.FieldName = 'DRCKName' + HeaderAlignmentHorz = taCenter + Width = 70 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object MovePanel2: TMovePanel + Left = 280 + Top = 128 + Width = 289 + Height = 49 + BevelInner = bvLowered + Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290 + Color = clSkyBlue + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + Visible = False + end + object GroupBox2: TGroupBox + Left = 0 + Top = 436 + Width = 1081 + Height = 208 + Align = alBottom + Caption = #24211#23384#20449#24687 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + Visible = False + object cxGrid2: TcxGrid + Left = 2 + Top = 16 + Width = 1077 + Height = 190 + Align = alTop + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + TabOrder = 0 + Visible = False + object TV2: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource2 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV2Column14 + end + item + Kind = skSum + Column = TV2Column2 + end + item + Kind = skSum + Column = TV2Column3 + end + item + Kind = skSum + Column = TV2Column4 + end + item + Kind = skSum + Column = TV2Column5 + end + item + Kind = skSum + Column = TV2Column6 + end + item + Kind = skSum + Column = TV2Column7 + end + item + Kind = skSum + Column = TV2Column8 + end + item + Kind = skSum + Column = TV2Column9 + end + item + Kind = skSum + Column = TV2Column10 + end + item + Kind = skSum + Column = TV2Column11 + end + item + Kind = skSum + Column = TV2Column12 + end + item + Kind = skSum + Column = TV2Column13 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsData.Editing = False + OptionsSelection.CellSelect = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV2Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column14: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column17: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV2Column2: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column3: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column4: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column5: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column6: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column7: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column15: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column8: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column9: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column10: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column11: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column12: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column13: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + HeaderAlignmentHorz = taCenter + Width = 70 + end + object TV2Column16: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'Size14' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGridLevel1: TcxGridLevel + GridView = TV2 + end + end + end + object GroupBox1: TGroupBox + Left = 0 + Top = 644 + Width = 1081 + Height = 208 + Align = alBottom + Caption = #39044#20986#24211#20449#24687 + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 5 + Visible = False + object cxGrid3: TcxGrid + Left = 2 + Top = 16 + Width = 1077 + Height = 190 + Align = alTop + Font.Charset = GB2312_CHARSET + Font.Color = clRed + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + TabOrder = 0 + Visible = False + object TV3: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource3 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Format = 'C_Code' + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = TV3Column2 + end + item + Kind = skSum + Column = TV3Column3 + end + item + Kind = skSum + Column = TV3Column4 + end + item + Kind = skSum + Column = TV3Column5 + end + item + Kind = skSum + Column = TV3Column6 + end + item + Kind = skSum + Column = TV3Column7 + end + item + Kind = skSum + Column = TV3Column8 + end + item + Kind = skSum + Column = TV3Column9 + end + item + Kind = skSum + Column = TV3Column10 + end + item + Kind = skSum + Column = TV3Column11 + end + item + Kind = skSum + Column = TV3Column12 + end + item + Kind = skSum + Column = TV3Column13 + end + item + Kind = skSum + Column = TV3Column14 + end + item + Kind = skSum + Column = TV3Column15 + end> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.FocusCellOnTab = True + OptionsBehavior.GoToNextCellOnEnter = True + OptionsBehavior.FocusCellOnCycle = True + OptionsCustomize.ColumnFiltering = False + OptionsCustomize.ColumnSorting = False + OptionsData.Editing = False + OptionsSelection.CellSelect = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + Styles.Header = CPCK_DataLink.Default + object TV3Column1: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'P_Color' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column2: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'ZQty' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column17: TcxGridDBColumn + Caption = 'CXXXS' + DataBinding.FieldName = 'Size15' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object TV3Column3: TcxGridDBColumn + Caption = 'CXXS' + DataBinding.FieldName = 'Size1' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column4: TcxGridDBColumn + Caption = 'CXS' + DataBinding.FieldName = 'Size2' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column5: TcxGridDBColumn + Caption = 'CS' + DataBinding.FieldName = 'Size3' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column6: TcxGridDBColumn + Caption = 'CM' + DataBinding.FieldName = 'Size4' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column7: TcxGridDBColumn + Caption = 'CL' + DataBinding.FieldName = 'Size5' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column8: TcxGridDBColumn + Caption = 'CXL' + DataBinding.FieldName = 'Size6' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column9: TcxGridDBColumn + Caption = 'CXXL' + DataBinding.FieldName = 'Size13' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column10: TcxGridDBColumn + Caption = 'AXS' + DataBinding.FieldName = 'Size7' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column11: TcxGridDBColumn + Caption = 'AS' + DataBinding.FieldName = 'Size8' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column12: TcxGridDBColumn + Caption = 'AM' + DataBinding.FieldName = 'Size9' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column13: TcxGridDBColumn + Caption = 'AL' + DataBinding.FieldName = 'Size10' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column14: TcxGridDBColumn + Caption = 'AXL' + DataBinding.FieldName = 'Size11' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column15: TcxGridDBColumn + Caption = 'AXXL' + DataBinding.FieldName = 'Size12' + HeaderAlignmentHorz = taCenter + Width = 66 + end + object TV3Column16: TcxGridDBColumn + Caption = 'AXXXL' + DataBinding.FieldName = 'Size14' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGridLevel2: TcxGridLevel + GridView = TV3 + end + end + end + object Panel9: TPanel + Left = 168 + Top = 220 + Width = 261 + Height = 141 + Color = clSkyBlue + TabOrder = 6 + Visible = False + object Label32: TLabel + Left = 15 + Top = 44 + Width = 48 + Height = 12 + Caption = #20179#24211#32534#21495 + end + object Button11: TButton + Left = 40 + Top = 93 + Width = 60 + Height = 25 + Caption = #30830#23450 + TabOrder = 0 + OnClick = Button11Click + end + object Button12: TButton + Left = 156 + Top = 93 + Width = 60 + Height = 25 + Caption = #20851#38381 + TabOrder = 1 + OnClick = Button12Click + end + object Edit1: TEdit + Tag = 2 + Left = 69 + Top = 40 + Width = 116 + Height = 20 + TabOrder = 2 + end + end + object Panel2: TPanel + Left = 436 + Top = 216 + Width = 261 + Height = 141 + Color = clSkyBlue + TabOrder = 7 + Visible = False + object Label16: TLabel + Left = 15 + Top = 44 + Width = 48 + Height = 12 + Caption = #20179#24211#21517#31216 + end + object Button1: TButton + Left = 40 + Top = 93 + Width = 60 + Height = 25 + Caption = #30830#23450 + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 156 + Top = 93 + Width = 60 + Height = 25 + Caption = #20851#38381 + TabOrder = 1 + OnClick = Button2Click + end + object Edit2: TEdit + Tag = 2 + Left = 69 + Top = 40 + Width = 116 + Height = 20 + TabOrder = 2 + end + end + object ADOQueryCmd: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 680 + Top = 8 + end + object ADOQueryTmp: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 756 + Top = 4 + end + object DataSource1: TDataSource + DataSet = CDS_Main + Left = 576 + Top = 1 + end + object CDS_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 612 + Top = 5 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 640 + Top = 116 + end + object CDS_Sub: TClientDataSet + Aggregates = <> + Params = <> + Left = 772 + Top = 317 + end + object DataSource2: TDataSource + DataSet = CDS_Sub + Left = 736 + Top = 313 + end + object ADOQuerySub: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 688 + Top = 312 + end + object RMDB_Main: TRMDBDataSet + Visible = True + DataSet = AdoPrint + Left = 524 + Top = 160 + end + object AdoPrint: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 496 + Top = 156 + 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 = 464 + Top = 160 + end + object RMGridReport1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, 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 + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 440 + Top = 164 + ReportData = {} + end + object PopupMenu1: TPopupMenu + Left = 256 + Top = 152 + object N1: TMenuItem + Caption = #20840#36873 + OnClick = N1Click + end + object N2: TMenuItem + Caption = #20840#24323 + OnClick = N2Click + end + end + object ADOQueryYck: TADOQuery + Connection = CPCK_DataLink.ADOLink + Parameters = <> + Left = 192 + Top = 712 + end + object DataSource3: TDataSource + DataSet = CDS_Yck + Left = 240 + Top = 713 + end + object CDS_Yck: TClientDataSet + Aggregates = <> + Params = <> + Left = 276 + Top = 717 + end +end diff --git a/成品仓库/U_CpkcSel.pas b/成品仓库/U_CpkcSel.pas new file mode 100644 index 0000000..17b05e7 --- /dev/null +++ b/成品仓库/U_CpkcSel.pas @@ -0,0 +1,669 @@ +unit U_CpkcSel; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, + cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView, + cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, + cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox, + IdFTP, ShellAPI, strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, + RM_Common, RM_Class, RM_GridReport, RM_e_Xls, RM_System, RM_Dataset, Menus, + MovePanel, cxContainer, cxTextEdit, cxCurrencyEdit, 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 + TfrmCpkcSel = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBExport: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + Label1: TLabel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1P_CodeName: TcxGridDBColumn; + v1P_SPEC: TcxGridDBColumn; + v1Qty: TcxGridDBColumn; + v1Note: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + v1CRType: TcxGridDBColumn; + v1CRTime: TcxGridDBColumn; + Label2: TLabel; + Label3: TLabel; + custName: TEdit; + CRType: TComboBox; + Label5: TLabel; + ADOQueryCmd: TADOQuery; + ADOQueryTmp: TADOQuery; + DataSource1: TDataSource; + CDS_Main: TClientDataSet; + cxGridPopupMenu1: TcxGridPopupMenu; + TOk: TToolButton; + v1Ssel: TcxGridDBColumn; + CheckBox1: TCheckBox; + v1MJID: TcxGridDBColumn; + v1MJXH: TcxGridDBColumn; + v1CPType: TcxGridDBColumn; + ckName: TComboBox; + Label6: TLabel; + v1P_Code: TcxGridDBColumn; + Label7: TLabel; + batchNo: TEdit; + Label8: TLabel; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + P_CodeName: TEdit; + Label9: TLabel; + P_Spec: TEdit; + Label10: TLabel; + Label11: TLabel; + P_Color: TEdit; + Label12: TLabel; + P_KZ_S: TEdit; + orderNo: TEdit; + Label4: TLabel; + v1Column4: TcxGridDBColumn; + ToolButton1: TToolButton; + defstr1: TEdit; + Label13: TLabel; + P_Code: TEdit; + Label14: TLabel; + v1Column6: TcxGridDBColumn; + v1Column7: TcxGridDBColumn; + Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + CDS_Sub: TClientDataSet; + DataSource2: TDataSource; + ADOQuerySub: TADOQuery; + Tv1Column3: TcxGridDBColumn; + RMDB_Main: TRMDBDataSet; + AdoPrint: TADOQuery; + RMXLSExport1: TRMXLSExport; + RMGridReport1: TRMGridReport; + PopupMenu1: TPopupMenu; + N1: TMenuItem; + N2: TMenuItem; + MovePanel2: TMovePanel; + Label15: TLabel; + DRCKName: TEdit; + GroupBox2: TGroupBox; + cxGrid2: TcxGrid; + TV2: TcxGridDBTableView; + TV2Column1: TcxGridDBColumn; + TV2Column14: TcxGridDBColumn; + TV2Column2: TcxGridDBColumn; + TV2Column3: TcxGridDBColumn; + TV2Column4: TcxGridDBColumn; + TV2Column5: TcxGridDBColumn; + TV2Column6: TcxGridDBColumn; + TV2Column7: TcxGridDBColumn; + TV2Column15: TcxGridDBColumn; + TV2Column8: TcxGridDBColumn; + TV2Column9: TcxGridDBColumn; + TV2Column10: TcxGridDBColumn; + TV2Column11: TcxGridDBColumn; + TV2Column12: TcxGridDBColumn; + TV2Column13: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + GroupBox1: TGroupBox; + cxGrid3: TcxGrid; + TV3: TcxGridDBTableView; + cxGridLevel2: TcxGridLevel; + ADOQueryYck: TADOQuery; + DataSource3: TDataSource; + CDS_Yck: TClientDataSet; + TV3Column1: TcxGridDBColumn; + TV3Column2: TcxGridDBColumn; + TV3Column3: TcxGridDBColumn; + TV3Column4: TcxGridDBColumn; + TV3Column5: TcxGridDBColumn; + TV3Column6: TcxGridDBColumn; + TV3Column7: TcxGridDBColumn; + TV3Column8: TcxGridDBColumn; + TV3Column9: TcxGridDBColumn; + TV3Column10: TcxGridDBColumn; + TV3Column11: TcxGridDBColumn; + TV3Column12: TcxGridDBColumn; + TV3Column13: TcxGridDBColumn; + TV3Column14: TcxGridDBColumn; + TV3Column15: TcxGridDBColumn; + ToolButton2: TToolButton; + Panel9: TPanel; + Label32: TLabel; + Button11: TButton; + Button12: TButton; + Edit1: TEdit; + ToolButton3: TToolButton; + Panel2: TPanel; + Label16: TLabel; + Button1: TButton; + Button2: TButton; + Edit2: TEdit; + TV2Column16: TcxGridDBColumn; + TV3Column16: TcxGridDBColumn; + TV2Column17: TcxGridDBColumn; + TV3Column17: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure custNameChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TOkClick(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); + procedure N1Click(Sender: TObject); + procedure N2Click(Sender: TObject); + procedure ToolButton2Click(Sender: TObject); + procedure Button11Click(Sender: TObject); + procedure Button12Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + + + private + procedure InitGrid(); + procedure InitSub(); + procedure SetComboBox(); + { Private declarations } + public + fType: integer; + fCKName: string; + + { Public declarations } + end; + +var + frmCpkcSel: TfrmCpkcSel; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_BpRk; +{$R *.dfm} + +procedure TfrmCpkcSel.SetComboBox(); +begin + ckName.Items.Clear; + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPCK'' '); + if trim(fCKName) <> '' then + sql.Add('and zdyName=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + ckName.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if ckName.Items.Count > 0 then + ckName.ItemIndex := 0; + + CRType.Items.Clear; + CRType.Items.Add(''); + with adoQueryTmp do + begin + close; + sql.Clear; + sql.Add('select * from KH_ZDY where Type=''CPRKTYPE'''); + if trim(fCKName) <> '' then + sql.Add('and note=' + quotedstr(trim(fCKName))); + open; + while not eof do + begin + CRType.Items.Add(trim(fieldbyname('zdyName').AsString)); + next; + end; + end; + if CRType.Items.Count > 0 then + CRType.ItemIndex := 0; +end; + +procedure TfrmCpkcSel.InitGrid(); +begin + MovePanel2.Visible := True; + try + with adoqueryTmp do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_KCsel'); + open; + end; + SCreateCDS20(adoqueryTmp, CDS_Main); + SInitCDSData20(adoqueryTmp, CDS_Main); + finally + end; + MovePanel2.Visible := False; +end; + +procedure TfrmCpkcSel.InitSub(); +begin + if CDS_Main.IsEmpty then + Exit; + try + with adoquerysub do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_KC_MX ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''' '); + sql.Add(',''' + Cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + Cds_main.fieldbyname('DRCKName').AsString + ''''); +// ShowMessage(SQL.text); + open; + end; + SCreateCDS20(adoquerysub, CDS_Sub); + SInitCDSData20(adoquerysub, CDS_Sub); + + with ADOQueryYck do + begin + close; + sql.Clear; + sql.Add('exec P_Get_CP_KC_MX_Yck ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''' '); + sql.Add(',''' + Cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + Cds_main.fieldbyname('DRCKName').AsString + ''''); +// ShowMessage(SQL.text); + open; + end; + SCreateCDS20(ADOQueryYck, CDS_Yck); + SInitCDSData20(ADOQueryYck, CDS_Yck); + finally + end; +end; + +procedure TfrmCpkcSel.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + tv1.Name + '3', Tv1, 'Ʒֿ'); + if fType = 10 then + Action := cahide + else + Action := cafree; +end; + +procedure TfrmCpkcSel.FormDestroy(Sender: TObject); +begin + frmCpkcSel := nil; +end; + +procedure TfrmCpkcSel.custNameChange(Sender: TObject); +begin + if ADOQueryTmp.Active = False then + Exit; + SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2)); + SCreateCDS20(ADOQueryTmp, CDS_Main); + SInitCDSData20(ADOQueryTmp, CDS_Main); +end; + +procedure TfrmCpkcSel.FormShow(Sender: TObject); +begin + if fType = 10 then + begin + TOk.Visible := true; + end; + v1Ssel.Visible := true; + readCxGrid(self.Caption + tv1.Name + 'KC', Tv1, 'Ʒֿ'); + SetComboBox(); + InitGrid(); +end; + +procedure TfrmCpkcSel.FormCreate(Sender: TObject); +begin + BegDate.Date := DServerDate - 7; + EndDate.Date := DServerDate; + cxGrid1.Align := alclient; + +end; + +procedure TfrmCpkcSel.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCpkcSel.TBRafreshClick(Sender: TObject); +begin + + initGrid(); +end; + +procedure TfrmCpkcSel.TBPrintClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxgrid1); +end; + +procedure TfrmCpkcSel.TBExportClick(Sender: TObject); +var + filepath: string; + sqlstr: string; + i: Integer; +begin + if CDS_Main.IsEmpty then + exit; + + if CDS_Main.Locate('SSel', True, []) = False then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + + with ADOQueryTmp do + begin + close; + SQL.Clear; + sql.Add('delete CPKC_Print '); + ExecSQL; + end; + Tv1.OnFocusedRecordChanged := nil; + sqlstr := ''; + i := 0; + MovePanel2.Visible := True; + with CDS_Main do + begin + First; + while CDS_Main.Locate('SSel', true, []) do + begin + sqlstr := sqlstr + Cds_main.fieldbyname('P_CodeName').AsString + Cds_main.fieldbyname('P_Code').AsString + Cds_main.fieldbyname('DRCKNO').AsString + Cds_main.fieldbyname('DRCKName').AsString + ','; + +// sqlstr := sqlstr + 'exec P_Get_CP_KC_copy1 ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''''; +// sqlstr := sqlstr + ',''' + Cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + Cds_main.fieldbyname('DRCKName').AsString + ''' '; +// i := i + 1; +// with ADOQueryTmp do +// begin +// close; +// sql.Clear; +// sql.Add('exec P_Get_CP_KC_copy1 ''' + Cds_main.fieldbyname('P_CodeName').AsString + ''' ,''' + Cds_main.fieldbyname('P_Code').AsString + ''' '); +// sql.Add(',''' + Cds_main.fieldbyname('DRCKNO').AsString + ''' ,''' + Cds_main.fieldbyname('DRCKName').AsString + ''''); +//// ShowMessage(SQL.text); +// ExecSQL; +// end; + Delete; +// if i = 50 then +// begin +// i := 0; +// sqlstr := ''; +// end; + + end; + end; + + sqlstr := Copy(sqlstr, 1, Length(sqlstr) - 1); + + with ADOQueryTmp do + begin + close; + SQL.Clear; + sql.Add('exec P_Get_CP_KC_copy3 ' + QuotedStr(sqlstr)); +// ShowMessage(SQL.Text); + ExecSQL; + end; +// ShowMessage(sqlstr); +// with ADOQueryTmp do +// begin +// close; +// SQL.Clear; +// sql.Add(sqlstr); +//// ShowMessage(SQL.text); +// ExecSQL; +// end; + + with AdoPrint do + begin + close; + sql.Clear; + sql.Add('select A.* from CPKC_Print A'); + sql.Add('order by P_Code,P_Color,'); + sql.Add('case when defstr1=''CXXS'' then 1 when defstr1=''CXS'' then 2 when defstr1=''CS'' then 3 '); + sql.Add(' when defstr1=''CM'' then 4 when defstr1=''CL'' then 5 when defstr1=''CXL'' then 6'); + sql.Add(' when defstr1=''AXS'' then 7 when defstr1=''AS'' then 8 when defstr1=''AM'' then 9'); + sql.Add(' when defstr1=''AL'' then 10 when defstr1=''AXL'' then 11 when defstr1=''AXXL'' then 12'); + sql.Add('else 99 end '); +// ShowMessage(sql.Text); + open; + end; + + try + filepath := ExtractFilePath(Application.ExeName) + 'report\ϸ.rmf'; + if not FileExists(Pchar(filepath)) then + begin + application.MessageBox(pchar('ļ[' + filepath + ']ڣ'), 'ʾϢ', MB_IConError); + exit; + end; + RMGridReport1.LoadFromFile(filepath); + RMGridReport1.ShowReport; + finally + Tv1.OnFocusedRecordChanged := Tv1FocusedRecordChanged; + InitGrid(); + end; + MovePanel2.Visible := False; + +end; +//begin +// if CDS_Main.IsEmpty then +// Exit; +// TcxGridToExcel(self.Caption, cxgrid1); + +//end; + +procedure TfrmCpkcSel.TOkClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + ModalResult := 1; +end; + +procedure TfrmCpkcSel.ToolButton1Click(Sender: TObject); +var + IdFTP1: TIdFTP; + FileName, FPath, FFName: string; + FInt: integer; +begin + if CDS_Main.IsEmpty then + Exit; + with adoqueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from TP_File '); + sql.Add('where WBID=' + quotedstr(trim(CDS_Main.fieldbyname('orderNo').AsString))); + //sql.Add('and TFType=''Ʒ'''); + open; + end; + if adoqueryCmd.IsEmpty then + begin + application.MessageBox('ָʾûͼϢ', 'ʾϢ', MB_ICONERROR); + exit; + end; + FileName := adoqueryCmd.fieldbyname('FileName').AsString; + + try + IdFTP1 := TIdFTP.Create(self); + IdFTP1.Host := server; + IdFTP1.Username := 'three'; + IdFTP1.Password := '641010'; + IdFTP1.Connect(); + except + IdFTP1.Quit; + IdFTP1.Free; + Application.MessageBox('޷ӵļ飡', 'ʾ', MB_ICONWARNING); + Exit; + end; + FPath := Leftstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ鿴\'; + if not DirectoryExists(ExtractFileDir(FPath)) then + CreateDir(ExtractFileDir(FPath)); + FFName := Trim(FileName); + FFName := FPath + FFName; + deleteFile(FFName); + IdFTP1.Get('TP\' + FileName, FFName); + if IdFTP1.Connected then + begin + IdFTP1.Quit; + IdFTP1.Free; + end; + try + ShellExecute(Handle, 'open', PChar(FFName), '', '', SW_SHOWNORMAL); + except + end; + +end; + +procedure TfrmCpkcSel.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); +begin + initsub(); +end; + +procedure TfrmCpkcSel.N1Click(Sender: TObject); +begin + SelOKNo(CDS_Main, True); +end; + +procedure TfrmCpkcSel.N2Click(Sender: TObject); +begin + SelOKNo(CDS_Main, False); +end; + +procedure TfrmCpkcSel.ToolButton2Click(Sender: TObject); +begin + Panel9.Left := (self.Width - Panel9.Width) div 2; + Panel9.Visible := true; +end; + +procedure TfrmCpkcSel.Button11Click(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + if CDS_Main.Locate('SSel', True, []) = False then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + CDS_Main.DisableControls; + ADOQueryCmd.Connection.BeginTrans; + with CDS_Main do + begin + First; + while not Eof do + begin + if CDS_Main.FieldByName('SSel').AsBoolean = True then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update CP_inout Set DRCKNO=''' + trim(Edit1.Text) + ''' '); + sql.Add('where P_CodeName=''' + Trim(CDS_Main.fieldbyname('P_CodeName').AsString) + ''''); + sql.Add('and P_Code=''' + Trim(CDS_Main.fieldbyname('P_Code').AsString) + ''''); + sql.Add('and DRCKNO=''' + Trim(CDS_Main.fieldbyname('DRCKNO').AsString) + ''''); + sql.Add('and DRCKName=''' + Trim(CDS_Main.fieldbyname('DRCKName').AsString) + ''''); +// sql.add('where AA.P_CodeName='FAIRY' and AA.P_Code='1505-C' and isnull(DRCKNO,'')='101' and isnull(DRCKName,'')='²''); + ExecSQL; + end; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + CDS_Main.EnableControls; + application.MessageBox('ݱɹ', 'ʾϢ'); + Panel9.Visible := false; + TBRafresh.Click; + except + ADOQueryCmd.Connection.RollbackTrans; + CDS_Main.EnableControls; + application.MessageBox('ݱʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCpkcSel.Button12Click(Sender: TObject); +begin + Panel9.Visible := false; +end; + +procedure TfrmCpkcSel.Button1Click(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + if CDS_Main.Locate('SSel', True, []) = False then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + CDS_Main.DisableControls; + ADOQueryCmd.Connection.BeginTrans; + with CDS_Main do + begin + First; + while not Eof do + begin + if CDS_Main.FieldByName('SSel').AsBoolean = True then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update CP_inout Set DRCKName=''' + trim(Edit2.Text) + ''' '); + sql.Add('where P_CodeName=''' + Trim(CDS_Main.fieldbyname('P_CodeName').AsString) + ''''); + sql.Add('and P_Code=''' + Trim(CDS_Main.fieldbyname('P_Code').AsString) + ''''); + sql.Add('and DRCKNO=''' + Trim(CDS_Main.fieldbyname('DRCKNO').AsString) + ''''); + sql.Add('and DRCKName=''' + Trim(CDS_Main.fieldbyname('DRCKName').AsString) + ''''); +// sql.add('where AA.P_CodeName='FAIRY' and AA.P_Code='1505-C' and isnull(DRCKNO,'')='101' and isnull(DRCKName,'')='²''); + ExecSQL; + end; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + CDS_Main.EnableControls; + application.MessageBox('ݱɹ', 'ʾϢ'); + Panel2.Visible := false; + TBRafresh.Click; + except + ADOQueryCmd.Connection.RollbackTrans; + CDS_Main.EnableControls; + application.MessageBox('ݱʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmCpkcSel.Button2Click(Sender: TObject); +begin + Panel2.Visible := false; +end; + +procedure TfrmCpkcSel.ToolButton3Click(Sender: TObject); +begin + Panel2.Left := (self.Width - Panel2.Width) div 2; + Panel2.Visible := true; +end; + + +end. + diff --git a/成品仓库/U_GetDllForm.pas b/成品仓库/U_GetDllForm.pas index 33640ac..995d017 100644 --- a/成品仓库/U_GetDllForm.pas +++ b/成品仓库/U_GetDllForm.pas @@ -1,7 +1,7 @@ unit U_GetDllForm; interface - + uses Windows, Messages, forms, OleCtnrs, DateUtils, SysUtils, ADODB, IniFiles, dxCore, ActiveX; @@ -15,8 +15,8 @@ function GetsysParam(muserId: pchar; fparam1: pchar): Boolean; implementation uses - U_DataLink, U_getDogServer, U_BpRklist, U_Bpcklist, U_Bpkclist, U_ZDYHelp,U_CPKWListSel, - U_BpckXjList, U_Bpkclist_HZ; + U_DataLink, U_getDogServer, U_BpRklist, U_CPRklist, U_Bpcklist, U_Bpkclist, + U_ZDYHelp, U_CPKWListSel, U_BpckXjList, U_Bpkclist_HZ, U_CpCklist; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -142,7 +142,7 @@ begin free; end; end; - 10: //Ʒ + 102: //Ʒ(ԭ) begin if frmBpRklist = nil then begin @@ -162,7 +162,47 @@ begin // mnewHandle := frmBpRklist.Handle; end; + 10: //Ʒ + begin + if frmCPRklist = nil then + begin + frmCPRklist := TfrmCPRklist.Create(application.MainForm); + with frmCPRklist do + begin + caption := Trim(Title); + fCkName := trim(Parameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmCPRklist.BringToFront; + // + mnewHandle := frmCPRklist.Handle; + end; 20: //Ʒ + begin + if frmCpCklist = nil then + begin + frmCpCklist := TfrmCpCklist.Create(application.MainForm); + with frmCpCklist do + begin + caption := Trim(Title); + fCkName := trim(Parameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmCpCklist.BringToFront; + // + mnewHandle := frmCpCklist.Handle; + end; + 201: //Ʒ⣨ԭ begin if frmBpCklist = nil then begin diff --git a/成品仓库/U_ProductOrderNewListSEl.dfm b/成品仓库/U_ProductOrderNewListSEl.dfm index 219f487..df1e696 100644 --- a/成品仓库/U_ProductOrderNewListSEl.dfm +++ b/成品仓库/U_ProductOrderNewListSEl.dfm @@ -249,6 +249,19 @@ object frmProductOrderNewListSEl: TfrmProductOrderNewListSEl Font.Style = [fsBold] ParentFont = False end + object Label14: TLabel + Left = 669 + Top = 39 + Width = 52 + Height = 12 + Caption = #20135#21697#32534#21495 + 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 = 11 @@ -378,6 +391,15 @@ object frmProductOrderNewListSEl: TfrmProductOrderNewListSEl TabOrder = 13 OnChange = OrderNoChange end + object prtcode: TEdit + Tag = 2 + Left = 723 + Top = 35 + Width = 100 + Height = 20 + TabOrder = 14 + OnChange = OrderNoChange + end end object cxGrid1: TcxGrid Left = 0 @@ -387,6 +409,7 @@ object frmProductOrderNewListSEl: TfrmProductOrderNewListSEl Align = alTop TabOrder = 2 object Tv1: TcxGridDBTableView + PopupMenu = PopupMenu1 Navigator.Buttons.CustomButtons = <> OnCellDblClick = Tv1CellDblClick DataController.DataSource = DataSource1 @@ -612,9 +635,13 @@ object frmProductOrderNewListSEl: TfrmProductOrderNewListSEl object PopupMenu1: TPopupMenu Left = 256 Top = 176 - object N2: TMenuItem - Caption = #26377#20379#24212#21830 - OnClick = N2Click + object N3: TMenuItem + Caption = #20840#36873 + OnClick = N3Click + end + object N4: TMenuItem + Caption = #20840#24323 + OnClick = N4Click end end object ADOQueryPrint: TADOQuery diff --git a/成品仓库/U_ProductOrderNewListSEl.pas b/成品仓库/U_ProductOrderNewListSEl.pas index a3e4fdf..f9e2329 100644 --- a/成品仓库/U_ProductOrderNewListSEl.pas +++ b/成品仓库/U_ProductOrderNewListSEl.pas @@ -49,7 +49,6 @@ type Label4: TLabel; CustomerNoName: TEdit; PopupMenu1: TPopupMenu; - N2: TMenuItem; Label2: TLabel; JGFactoryName: TEdit; Label5: TLabel; @@ -91,6 +90,10 @@ type v1Column6: TcxGridDBColumn; v1Column2: TcxGridDBColumn; v1Column7: TcxGridDBColumn; + N3: TMenuItem; + N4: TMenuItem; + Label14: TLabel; + prtcode: TEdit; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -115,6 +118,8 @@ type procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure N3Click(Sender: TObject); + procedure N4Click(Sender: TObject); private DQdate:TDateTime; procedure InitGrid(); @@ -133,8 +138,8 @@ var implementation uses - U_DataLink,U_Fun10; - + U_DataLink,U_Fun10,U_Fun; + {$R *.dfm} @@ -463,4 +468,14 @@ begin ToolButton3.Click; end; +procedure TfrmProductOrderNewListSEl.N3Click(Sender: TObject); +begin +SelOKNoFiler(Tv1, True); +end; + +procedure TfrmProductOrderNewListSEl.N4Click(Sender: TObject); +begin +SelOKNoFiler(Tv1, False); +end; + end. diff --git a/成品仓库/U_ZdyCMZ_Sel.dfm b/成品仓库/U_ZdyCMZ_Sel.dfm index a5e7483..15f9923 100644 --- a/成品仓库/U_ZdyCMZ_Sel.dfm +++ b/成品仓库/U_ZdyCMZ_Sel.dfm @@ -54,10 +54,10 @@ object frmZdyCMZ_Sel: TfrmZdyCMZ_Sel OptionsCustomize.ColumnSorting = False OptionsView.GroupByBox = False OptionsView.Indicator = True - Styles.Inactive = DataLink_BaseInfo.SHuangSe - Styles.IncSearch = DataLink_BaseInfo.SHuangSe - Styles.Selection = DataLink_BaseInfo.SHuangSe - Styles.Header = DataLink_BaseInfo.handBlack + Styles.Inactive = CPCK_DataLink.SHuangSe + Styles.IncSearch = CPCK_DataLink.SHuangSe + Styles.Selection = CPCK_DataLink.SHuangSe + Styles.Header = CPCK_DataLink.handBlack object TV1Column1: TcxGridDBColumn OnGetDisplayText = TV1Column1GetDisplayText HeaderAlignmentHorz = taCenter @@ -144,10 +144,10 @@ object frmZdyCMZ_Sel: TfrmZdyCMZ_Sel OptionsCustomize.ColumnSorting = False OptionsView.GroupByBox = False OptionsView.Indicator = True - Styles.Inactive = DataLink_BaseInfo.SHuangSe - Styles.IncSearch = DataLink_BaseInfo.SHuangSe - Styles.Selection = DataLink_BaseInfo.SHuangSe - Styles.Header = DataLink_BaseInfo.handBlack + Styles.Inactive = CPCK_DataLink.SHuangSe + Styles.IncSearch = CPCK_DataLink.SHuangSe + Styles.Selection = CPCK_DataLink.SHuangSe + Styles.Header = CPCK_DataLink.handBlack object v2Column2: TcxGridDBColumn Caption = #32534#21495 DataBinding.FieldName = 'Code' @@ -188,9 +188,9 @@ object frmZdyCMZ_Sel: TfrmZdyCMZ_Sel ButtonWidth = 59 Caption = 'ToolBar1' Color = clSkyBlue - DisabledImages = DataLink_BaseInfo.ThreeImgList + DisabledImages = CPCK_DataLink.ThreeImgList Flat = True - Images = DataLink_BaseInfo.ThreeImgList + Images = CPCK_DataLink.ThreeImgList List = True ParentColor = False ShowCaptions = True @@ -222,20 +222,20 @@ object frmZdyCMZ_Sel: TfrmZdyCMZ_Sel end end object ADOQueryTemp: TADOQuery - Connection = DataLink_BaseInfo.ADOLink + Connection = CPCK_DataLink.ADOLink LockType = ltReadOnly Parameters = <> Left = 357 Top = 73 end object ADOQueryCmd: TADOQuery - Connection = DataLink_BaseInfo.ADOLink + Connection = CPCK_DataLink.ADOLink Parameters = <> Left = 401 Top = 145 end object ADOQueryMain: TADOQuery - Connection = DataLink_BaseInfo.ADOLink + Connection = CPCK_DataLink.ADOLink LockType = ltReadOnly Parameters = <> Left = 125 @@ -294,7 +294,7 @@ object frmZdyCMZ_Sel: TfrmZdyCMZ_Sel Top = 268 end object ADOQuerysub: TADOQuery - Connection = DataLink_BaseInfo.ADOLink + Connection = CPCK_DataLink.ADOLink Parameters = <> Left = 484 Top = 276 diff --git a/成品仓库/U_ZdyCMZ_Sel.pas b/成品仓库/U_ZdyCMZ_Sel.pas index d3642bd..a869c1e 100644 --- a/成品仓库/U_ZdyCMZ_Sel.pas +++ b/成品仓库/U_ZdyCMZ_Sel.pas @@ -12,7 +12,21 @@ uses cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit, - cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator; + cxTextEdit, 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 TfrmZdyCMZ_Sel = class(TForm) diff --git a/成品仓库/U_ZdyYS_Sel.dfm b/成品仓库/U_ZdyYS_Sel.dfm index 8f74e23..de0d06d 100644 --- a/成品仓库/U_ZdyYS_Sel.dfm +++ b/成品仓库/U_ZdyYS_Sel.dfm @@ -103,6 +103,12 @@ object frmZdyYS_Sel: TfrmZdyYS_Sel HeaderAlignmentHorz = taCenter Width = 147 end + object Tv2Column4: TcxGridDBColumn + Caption = #33394#21495 + DataBinding.FieldName = 'Colorno' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 diff --git a/成品仓库/U_ZdyYS_Sel.pas b/成品仓库/U_ZdyYS_Sel.pas index cc3a4ed..be17de0 100644 --- a/成品仓库/U_ZdyYS_Sel.pas +++ b/成品仓库/U_ZdyYS_Sel.pas @@ -63,6 +63,7 @@ type Tv2Column3: TcxGridDBColumn; Label2: TLabel; CodeNameYW: TEdit; + Tv2Column4: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject);