diff --git a/基础资料维护(BaseInfo.dll)/BaseInfo.dpr b/基础资料维护(BaseInfo.dll)/BaseInfo.dpr index 8f40e63..3ece2bf 100644 --- a/基础资料维护(BaseInfo.dll)/BaseInfo.dpr +++ b/基础资料维护(BaseInfo.dll)/BaseInfo.dpr @@ -3,7 +3,7 @@ library BaseInfo; uses SysUtils, classes, - forms, + forms, WinTypes, WinProcs, U_DataLink in 'U_DataLink.pas' {DataLink_BaseInfo: TDataModule}, diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXList.dfm b/基础资料维护(BaseInfo.dll)/U_MLXXList.dfm index 880098b..8214f9f 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXList.dfm +++ b/基础资料维护(BaseInfo.dll)/U_MLXXList.dfm @@ -1,7 +1,7 @@ object frmMLXXList: TfrmMLXXList Left = 588 Top = 307 - Width = 1075 + Width = 1165 Height = 629 Caption = #36741#26009#20449#24687#31649#29702 Color = clBtnFace @@ -19,7 +19,7 @@ object frmMLXXList: TfrmMLXXList object ToolBar1: TToolBar Left = 0 Top = 0 - Width = 1059 + Width = 1149 Height = 31 ButtonHeight = 30 ButtonWidth = 113 @@ -77,7 +77,6 @@ object frmMLXXList: TfrmMLXXList Top = 0 Caption = #25552#21462'Excel'#25968#25454 ImageIndex = 106 - Visible = False OnClick = ToolButton5Click end object ToolButton1: TToolButton @@ -100,7 +99,7 @@ object frmMLXXList: TfrmMLXXList object Panel1: TPanel Left = 0 Top = 31 - Width = 1059 + Width = 1149 Height = 39 Align = alTop BevelInner = bvRaised @@ -167,7 +166,7 @@ object frmMLXXList: TfrmMLXXList object cxGrid2: TcxGrid Left = 0 Top = 70 - Width = 1059 + Width = 1149 Height = 520 Align = alClient TabOrder = 2 @@ -318,6 +317,48 @@ object frmMLXXList: TfrmMLXXList Options.Sorting = False Width = 188 end + object Tv2Column1: TcxGridDBColumn + Caption = #20379#24212#21830 + DataBinding.FieldName = 'GYS' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column2: TcxGridDBColumn + Caption = #36741#26009#32534#21495 + DataBinding.FieldName = 'MLBH' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column3: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'MJgg' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column4: TcxGridDBColumn + Caption = #25104#20154#29992#37327 + DataBinding.FieldName = 'Adultamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column5: TcxGridDBColumn + Caption = #20799#31461#29992#37327 + DataBinding.FieldName = 'childamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column6: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column7: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'Total' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 @@ -340,8 +381,8 @@ object frmMLXXList: TfrmMLXXList Connection = DataLink_BaseInfo.ADOLink LockType = ltReadOnly Parameters = <> - Left = 949 - Top = 225 + Left = 717 + Top = 209 end object RM1: TRMGridReport ThreadPrepareReport = True diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXList.pas b/基础资料维护(BaseInfo.dll)/U_MLXXList.pas index 1d24da3..bc7a086 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXList.pas +++ b/基础资料维护(BaseInfo.dll)/U_MLXXList.pas @@ -77,6 +77,13 @@ type v2Mrate: TcxGridDBColumn; v2Column14: TcxGridDBColumn; v2Column15: TcxGridDBColumn; + Tv2Column1: TcxGridDBColumn; + Tv2Column2: TcxGridDBColumn; + Tv2Column3: TcxGridDBColumn; + Tv2Column4: TcxGridDBColumn; + Tv2Column5: TcxGridDBColumn; + Tv2Column6: TcxGridDBColumn; + Tv2Column7: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -94,7 +101,7 @@ type procedure InitGrid(); public fkhType: string; - dFdDy: array[0..20] of FdDy; //ͻ + dFdDy: array[0..200] of FdDy; //ͻ end; var @@ -153,7 +160,7 @@ begin if Trim(CDS_HZ.fieldbyname('MLID').AsString) <> '' then begin with ADOQueryCmd do - begin + begin Close; SQL.Clear; sql.Add('delete KH_Zdy_MLXX where MLID=''' + Trim(CDS_HZ.fieldbyname('MLID').AsString) + ''''); @@ -261,57 +268,74 @@ begin begin if trim(excelApp.Cells[1, i].value) = '' then break; - if trim(excelApp.Cells[1, i].value) = 'Ʒ' then + if trim(excelApp.Cells[1, i].value) = '' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'ZdyCode'; - dFdDy[k].FdDysName := 'Ʒ'; - end; - - if trim(excelApp.Cells[1, i].value) = 'Ʒ' then - begin - dFdDy[k].inc := i; - dFdDy[k].FDdys := 'ZdyName'; - dFdDy[k].FdDysName := 'Ʒ'; - end; - - if trim(excelApp.Cells[1, i].value) = '' then - begin - dFdDy[k].inc := i; - dFdDy[k].FDdys := 'defNote3'; - dFdDy[k].FdDysName := ''; + dFdDy[k].FDdys := 'MLName'; + dFdDy[k].FdDysName := ''; end; if trim(excelApp.Cells[1, i].value) = 'ɫ' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'DEFstr3'; + dFdDy[k].FDdys := 'Color'; dFdDy[k].FdDysName := 'ɫ'; end; - if trim(excelApp.Cells[1, i].value) = 'ɫ' then + + if trim(excelApp.Cells[1, i].value) = 'ע' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'DEFstr6'; - dFdDy[k].FdDysName := 'ɫ'; + dFdDy[k].FDdys := 'Note'; + dFdDy[k].FdDysName := 'ע'; end; if trim(excelApp.Cells[1, i].value) = '' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'DEFstr5'; + dFdDy[k].FDdys := 'Type'; dFdDy[k].FdDysName := ''; end; + if trim(excelApp.Cells[1, i].value) = 'Ӧ' then + begin + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'GYS'; + dFdDy[k].FdDysName := 'Ӧ'; + end; + if trim(excelApp.Cells[1, i].value) = 'ϱǩ' then + begin + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'MLBH'; + dFdDy[k].FdDysName := 'ϱǩ'; + end; if trim(excelApp.Cells[1, i].value) = '' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'DEFstr1'; + dFdDy[k].FDdys := 'MLgg'; dFdDy[k].FdDysName := ''; end; - if trim(excelApp.Cells[1, i].value) = 'ɷ' then + if trim(excelApp.Cells[1, i].value) = '' then begin dFdDy[k].inc := i; - dFdDy[k].FDdys := 'DEFstr2'; - dFdDy[k].FdDysName := 'ɷ'; + dFdDy[k].FDdys := 'Adultamount'; + dFdDy[k].FdDysName := ''; + end; + if trim(excelApp.Cells[1, i].value) = 'ͯ' then + begin + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'childamount'; + dFdDy[k].FdDysName := 'ͯ'; + end; + if trim(excelApp.Cells[1, i].value) = '' then + begin + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'Price'; + dFdDy[k].FdDysName := ''; + end; + if trim(excelApp.Cells[1, i].value) = 'ϼ' then + begin + dFdDy[k].inc := i; + dFdDy[k].FDdys := 'Total'; + dFdDy[k].FdDysName := 'ϼ'; end; k := k + 1; end; @@ -322,7 +346,7 @@ begin try for i := 2 to ExcelRowCount do begin - if GetLSNo(ADOQueryCmd, maxId, 'AT', 'KH_Zdy_Attachment', 4, 1) = False then + if GetLSNo(ADOQueryCmd, maxId, 'ML', 'KH_Zdy_MLXX', 4, 1) = False then begin ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('ȡʧܣ', 'ʾ', 0); @@ -333,19 +357,20 @@ begin begin close; sql.Clear; - sql.Add('select * from KH_Zdy_Attachment where 1=2'); + sql.Add('select * from KH_Zdy_MLXX where 1=2'); open; end; ADOQueryCmd.Append; - for j := 0 to k - 1 do - begin + for j := 0 to k - 1 do + begin ADOQueryCmd.fieldbyname(dFdDy[j].FDdys).Value := excelApp.Cells[i, dFdDy[j].inc].Value; end; - ADOQueryCmd.FieldByName('ATID').Value := Trim(maxId); - ADOQueryCmd.FieldByName('zdyCode').Value := Trim(maxId); - ADOQueryCmd.FieldByName('khType').Value := Trim(fkhType); - ADOQueryCmd.FieldByName('Type').Value := 'CP'; + ADOQueryCmd.FieldByName('MLID').Value := Trim(maxId); +// ADOQueryCmd.FieldByName('zdyCode').Value := Trim(maxId); +// ADOQueryCmd.FieldByName('khType').Value := Trim(fkhType); + ADOQueryCmd.FieldByName('Type').Value := ''; ADOQueryCmd.FieldByName('Filler').Value := Trim(DName); + ADOQueryCmd.FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp); ADOQueryCmd.Post; end; diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXListSel.dfm b/基础资料维护(BaseInfo.dll)/U_MLXXListSel.dfm index 046af41..1392afc 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXListSel.dfm +++ b/基础资料维护(BaseInfo.dll)/U_MLXXListSel.dfm @@ -221,15 +221,6 @@ object frmMLXXListSel: TfrmMLXXListSel Options.Sorting = False Width = 94 end - object Tv2Column1: TcxGridDBColumn - Caption = #36873#25321 - DataBinding.FieldName = 'Ssel' - PropertiesClassName = 'TcxCheckBoxProperties' - Properties.ImmediatePost = True - Properties.NullStyle = nssUnchecked - HeaderAlignmentHorz = taCenter - Width = 60 - end object v2Column6: TcxGridDBColumn Caption = #36741#26009#21517#31216 DataBinding.FieldName = 'MLName' @@ -280,6 +271,43 @@ object frmMLXXListSel: TfrmMLXXListSel VisibleForCustomization = False Width = 74 end + object v2Mrate: TcxGridDBColumn + Caption = #35745#21010#32553#29575'(%)' + DataBinding.FieldName = 'Mrate' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + VisibleForCustomization = False + Width = 80 + end + object v2Column13: TcxGridDBColumn + Caption = #24037#33402 + DataBinding.FieldName = 'defNote2' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + VisibleForCustomization = False + Width = 100 + end + object v2Column9: TcxGridDBColumn + Caption = #38376#24133 + DataBinding.FieldName = 'DEFstr7' + PropertiesClassName = 'TcxTextEditProperties' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + VisibleForCustomization = False + Width = 73 + end + object v2Column7: TcxGridDBColumn + Caption = #20811#37325 + DataBinding.FieldName = 'DEFstr8' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Sorting = False + VisibleForCustomization = False + Width = 61 + end object v2Column1: TcxGridDBColumn Caption = #22791#27880 DataBinding.FieldName = 'Note' @@ -302,6 +330,56 @@ object frmMLXXListSel: TfrmMLXXListSel Options.Sorting = False Width = 188 end + object Tv2Column1: TcxGridDBColumn + Caption = #20379#24212#21830 + DataBinding.FieldName = 'GYS' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column2: TcxGridDBColumn + Caption = #36741#26009#32534#21495 + DataBinding.FieldName = 'MLBH' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column3: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'MJgg' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column4: TcxGridDBColumn + Caption = #25104#20154#29992#37327 + DataBinding.FieldName = 'Adultamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column5: TcxGridDBColumn + Caption = #20799#31461#29992#37327 + DataBinding.FieldName = 'childamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column6: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column7: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'Total' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv2Column8: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'ssel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + Width = 60 + end end object cxGridLevel1: TcxGridLevel GridView = Tv2 @@ -354,7 +432,6 @@ object frmMLXXListSel: TfrmMLXXListSel Top = 180 end object cxGridPopupMenu2: TcxGridPopupMenu - Grid = cxGrid2 PopupMenus = <> Left = 888 Top = 224 diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXListSel.pas b/基础资料维护(BaseInfo.dll)/U_MLXXListSel.pas index 0e7a443..21fc0f9 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXListSel.pas +++ b/基础资料维护(BaseInfo.dll)/U_MLXXListSel.pas @@ -50,31 +50,42 @@ type RMDB_Main: TRMDBDataSet; Label3: TLabel; ZdyName: TEdit; - cxGrid2: TcxGrid; - Tv2: TcxGridDBTableView; - cxGridLevel1: TcxGridLevel; cxGridPopupMenu2: TcxGridPopupMenu; DS_HZ: TDataSource; CDS_HZ: TClientDataSet; ToolButton3: TToolButton; - v2Column6: TcxGridDBColumn; - v2Column1: TcxGridDBColumn; - v2Column2: TcxGridDBColumn; - v2Column3: TcxGridDBColumn; - v2Column4: TcxGridDBColumn; - v2Column5: TcxGridDBColumn; Label1: TLabel; ZdyCode: TEdit; ToolButton4: TToolButton; Label2: TLabel; DEFstr5: TComboBox; - v2Column11: TcxGridDBColumn; OpenDialog1: TOpenDialog; ToolButton5: TToolButton; + ToolButton6: TToolButton; + cxGrid2: TcxGrid; + Tv2: TcxGridDBTableView; + v2Column2: TcxGridDBColumn; + v2Column6: TcxGridDBColumn; + v2Column5: TcxGridDBColumn; + v2Column11: TcxGridDBColumn; + v2Column3: TcxGridDBColumn; + v2Column4: TcxGridDBColumn; + v2Mrate: TcxGridDBColumn; + v2Column13: TcxGridDBColumn; + v2Column9: TcxGridDBColumn; + v2Column7: TcxGridDBColumn; + v2Column1: TcxGridDBColumn; v2Column14: TcxGridDBColumn; v2Column15: TcxGridDBColumn; Tv2Column1: TcxGridDBColumn; - ToolButton6: TToolButton; + Tv2Column2: TcxGridDBColumn; + Tv2Column3: TcxGridDBColumn; + Tv2Column4: TcxGridDBColumn; + Tv2Column5: TcxGridDBColumn; + Tv2Column6: TcxGridDBColumn; + Tv2Column7: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + Tv2Column8: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXinput.dfm b/基础资料维护(BaseInfo.dll)/U_MLXXinput.dfm index 73b2e63..bae192a 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXinput.dfm +++ b/基础资料维护(BaseInfo.dll)/U_MLXXinput.dfm @@ -1,6 +1,6 @@ object frmMLXXinput: TfrmMLXXinput - Left = 617 - Top = 377 + Left = 495 + Top = 376 Width = 1171 Height = 370 Caption = #36741#26009#20449#24687#24405#20837 @@ -22,7 +22,7 @@ object frmMLXXinput: TfrmMLXXinput Width = 1155 Height = 31 ButtonHeight = 30 - ButtonWidth = 59 + ButtonWidth = 83 Caption = 'ToolBar1' Color = clSkyBlue DisabledImages = DataLink_BaseInfo.ThreeImgList @@ -43,21 +43,28 @@ object frmMLXXinput: TfrmMLXXinput object ToolButton1: TToolButton Left = 63 Top = 0 + AutoSize = True Caption = #22686#34892 ImageIndex = 103 - Visible = False OnClick = ToolButton1Click end object ToolButton2: TToolButton - Left = 122 + Left = 126 Top = 0 + AutoSize = True Caption = #21024#34892 ImageIndex = 107 - Visible = False OnClick = ToolButton2Click end + object ToolButton4: TToolButton + Left = 189 + Top = 0 + Caption = #25171#24320#25991#20214 + ImageIndex = 5 + OnClick = ToolButton4Click + end object TBClose: TToolButton - Left = 181 + Left = 272 Top = 0 AutoSize = True Caption = #20851#38381 @@ -122,6 +129,52 @@ object frmMLXXinput: TfrmMLXXinput object v2Column11: TcxGridDBColumn Caption = #31867#22411 DataBinding.FieldName = 'Type' + PropertiesClassName = 'TcxComboBoxProperties' + Properties.Items.Strings = ( + #36741#26009 + #38754#26009) + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column2: TcxGridDBColumn + Caption = #20379#24212#21830 + DataBinding.FieldName = 'GYS' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column3: TcxGridDBColumn + Caption = #36741#26009#32534#21495 + DataBinding.FieldName = 'MLBH' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column4: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'MLgg' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column5: TcxGridDBColumn + Caption = #25104#20154#29992#37327 + DataBinding.FieldName = 'Adultamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column6: TcxGridDBColumn + Caption = #20799#31461#29992#37327 + DataBinding.FieldName = 'childamount' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column7: TcxGridDBColumn + Caption = #21333#20215 + DataBinding.FieldName = 'Price' + HeaderAlignmentHorz = taCenter + Width = 60 + end + object Tv1Column8: TcxGridDBColumn + Caption = #21512#35745 + DataBinding.FieldName = 'Total' HeaderAlignmentHorz = taCenter Width = 60 end @@ -192,4 +245,14 @@ object frmMLXXinput: TfrmMLXXinput Left = 696 Top = 128 end + object OpenDialog1: TOpenDialog + Left = 386 + Top = 170 + end + object CDS_LM: TClientDataSet + Aggregates = <> + Params = <> + Left = 232 + Top = 240 + end end diff --git a/基础资料维护(BaseInfo.dll)/U_MLXXinput.pas b/基础资料维护(BaseInfo.dll)/U_MLXXinput.pas index b8e7637..2bdf716 100644 --- a/基础资料维护(BaseInfo.dll)/U_MLXXinput.pas +++ b/基础资料维护(BaseInfo.dll)/U_MLXXinput.pas @@ -26,7 +26,7 @@ uses dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, - dxSkinscxPCPainter; + dxSkinscxPCPainter, ComObj; type TfrmMLXXinput = class(TForm) @@ -50,6 +50,16 @@ type ToolButton1: TToolButton; ToolButton2: TToolButton; Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; + Tv1Column3: TcxGridDBColumn; + Tv1Column4: TcxGridDBColumn; + Tv1Column5: TcxGridDBColumn; + Tv1Column6: TcxGridDBColumn; + Tv1Column7: TcxGridDBColumn; + Tv1Column8: TcxGridDBColumn; + ToolButton4: TToolButton; + OpenDialog1: TOpenDialog; + CDS_LM: TClientDataSet; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -62,6 +72,7 @@ type procedure Tv2Column1PropertiesEditValueChanged(Sender: TObject); procedure ToolButton1Click(Sender: TObject); procedure ToolButton2Click(Sender: TObject); + procedure ToolButton4Click(Sender: TObject); private { Private declarations } procedure InitGrid(); @@ -122,16 +133,16 @@ procedure TfrmMLXXinput.FormShow(Sender: TObject); begin ReadCxGrid('Ʒ¼1', Tv1, 'ͻԶ'); InitGrid(); - if Trim(FMLID) = '' then - begin - with CDS_HZ do - begin - Edit; - FieldByName('type').Value := ''; - Post; - end; - - end; +// if Trim(FMLID) = '' then +// begin +// with CDS_HZ do +// begin +// Edit; +// FieldByName('type').Value := ''; +// Post; +// end; +// +// end; end; procedure TfrmMLXXinput.TBRafreshClick(Sender: TObject); @@ -143,79 +154,95 @@ function TfrmMLXXinput.SaveData(): Boolean; var maxId, CRID: string; begin + if CDS_HZ.IsEmpty then + exit; + ADOQueryCmd.Connection.BeginTrans; try - ADOQueryCmd.Connection.BeginTrans; - if Trim(FMLID) = '' then - begin - if GetLSNo(ADOQueryCmd, maxId, 'ML', 'KH_Zdy_MLXX', 4, 1) = False then - begin - Result := False; - ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ȡʧܣ', 'ʾ', 0); - Exit; - end; - end - else - begin - maxId := Trim(FMLID); - end; - - with ADOQueryCmd do - begin - Close; - SQL.Clear; - sql.Add('select * from KH_Zdy_MLXX where MLID=''' + Trim(FMLID) + ''''); - Open; - end; - with ADOQueryCmd do - begin - if Trim(FMLID) = '' then - begin - Append; - FieldByName('Filler').Value := Trim(DName); - end - else - begin - Edit; - FieldByName('Editer').Value := Trim(DName); - FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp); - end; - FieldByName('MLID').Value := Trim(maxId); - - RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_HZ, 'KH_Zdy_MLXX', 0); -// FieldByName('ZdyName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString); - FieldByName('Filler').Value := Trim(DName); - FieldByName('Filltime').Value := SGetServerDateTime(ADOQueryTemp); - Post; - end; - - with ADOQueryCmd do - begin - Close; - sql.Clear; - sql.Add('select * from KH_Zdy_MLXX where MLName=''' + Trim(CDS_HZ.fieldbyname('MLName').AsString) + ''' and color=''' + Trim(CDS_HZ.fieldbyname('color').AsString) + ''''); -// sql.Add(' and Type=''CP'' '); - Open; - end; - if ADOQueryCmd.RecordCount > 1 then - begin - ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('ƷŲظ!', 'ʾ', 0); - Exit; - end; with CDS_HZ do begin - Edit; - FieldByName('MLID').Value := Trim(maxId); - Post; + first; + while not eof do + begin + if (CDS_HZ.FieldByName('MLName').asstring = '') then + begin + Next; + end + else + begin + if Trim(CDS_HZ.fieldbyname('MLid').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxId, 'ML', 'KH_Zdy_MLXX', 4, 1) = False then + begin + Result := False; + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxId := Trim(FMLID); + end; + + with ADOQueryCmd do + begin + Close; + SQL.Clear; + sql.Add('select * from KH_Zdy_MLXX where MLID=''' + Trim(CDS_HZ.fieldbyname('MLid').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(CDS_HZ.fieldbyname('MLid').AsString) = '' then + begin + Append; + FieldByName('Filler').Value := Trim(DName); + end + else + begin + Edit; + FieldByName('Editer').Value := Trim(DName); + FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp); + end; + FieldByName('MLID').Value := Trim(maxId); + FieldByName('Filler').Value := Trim(DName); + FieldByName('Filltime').Value := SGetServerDateTime(ADOQueryTemp); + RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_HZ, 'KH_Zdy_MLXX', 0); + Post; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from KH_Zdy_MLXX where MLName=''' + Trim(CDS_HZ.fieldbyname('MLName').AsString) + ''' and color=''' + Trim(CDS_HZ.fieldbyname('color').AsString) + ''''); + Open; + end; + if ADOQueryCmd.RecordCount > 1 then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ƷŲظ!', 'ʾ', 0); + Exit; + end; + with CDS_HZ do + begin + Edit; + FieldByName('MLID').Value := Trim(maxId); + Post; + end; + end; + next; + end; + end; end; + ADOQueryCmd.Connection.CommitTrans; - Result := True; + + application.MessageBox('ɹ', 'ʾ'); + Modalresult := 1; except - Result := True; ADOQueryCmd.Connection.RollbackTrans; - Application.MessageBox('쳣!', 'ʾ', 0); + application.MessageBox(PChar(Exception(ExceptObject).Message), 'ʾϢ', 0); end; + end; procedure TfrmMLXXinput.ToolButton3Click(Sender: TObject); @@ -230,10 +257,10 @@ begin Application.MessageBox('ɹ!', 'ʾ', 0); // ModalResult := 1; end; - try + { try ADOQueryMain.DisableControls; with ADOQueryMain do - begin + begin Filtered := False; Close; SQL.Clear; @@ -253,7 +280,7 @@ begin FieldByName('Type').Value := ''; Post; end; - end; + end; } end; procedure TfrmMLXXinput.v2Column6PropertiesEditValueChanged(Sender: TObject); @@ -358,6 +385,7 @@ begin with CDS_HZ do begin Edit; + FieldByName('MLID').Value := ''; FieldByName('note').Value := ''; Post; end; @@ -383,5 +411,100 @@ begin CDS_HZ.Delete; end; +procedure TfrmMLXXinput.ToolButton4Click(Sender: TObject); +var + excelApp, WorkBook: Variant; + i, j, k, LX, ExcelRowCount: integer; + maxId, FCPID, FCPName, t1, t2, t3, FFID: string; +begin + with CDS_LM do + begin + FieldDefs.Clear; + FieldDefs.Add('LXH', ftInteger, 0); + FieldDefs.Add('lCode', ftString, 40); + FieldDefs.Add('LName', ftString, 40); + close; + CreateDataSet; + end; + try + excelApp := CreateOleObject('Excel.Application'); + openDialog1.Filter := '*.CSV;*.xls'; + if opendialog1.Execute then + begin + WorkBook := excelApp.WorkBooks.Open(OpenDialog1.FileName); + end + else + exit; + excelApp.Visible := false; + ExcelRowCount := WorkBook.WorkSheets[1].UsedRange.Rows.Count; + except + application.MessageBox('EXCEL', 'Ϣ', MB_ICONERROR); + exit; + end; + + CDS_LM.EmptyDataSet; + + for j := 0 to Tv1.ColumnCount - 1 do + begin + with CDS_LM do + begin + Append; + FieldByName('LCode').Value := trim(Tv1.Columns[j].DataBinding.FieldName); + FieldByName('LName').Value := trim(Tv1.Columns[j].Caption); + Post; + end; + end; + + try + for i := 1 to 50 do + begin + if trim(WorkBook.WorkSheets[1].Cells[1, i].value) = '' then + continue; + if CDS_LM.Locate('LName', trim(WorkBook.WorkSheets[1].Cells[1, i].value), []) then + begin + with CDS_LM do + begin + Edit; + FieldByName('LXH').Value := i; + Post; + end; + end; + end; + except + application.MessageBox('', 'Ϣ', MB_ICONERROR); + exit; + end; + + try + for i := 2 to ExcelRowCount do + begin + with CDS_HZ do + begin + Append; + CDS_LM.First; + while not CDS_LM.Eof do + begin + if (CDS_LM.FieldByName('LXH').AsInteger > 0) then + CDS_HZ.fieldbyname(CDS_LM.FieldByName('LCode').AsString).Value := WorkBook.WorkSheets[1].Cells[i, CDS_LM.FieldByName('LXH').AsInteger].Value; + CDS_LM.Next; + end; + + Post; + end; + end; + WorkBook.Close; + excelApp.Quit; + excelApp := Unassigned; + WorkBook := Unassigned; + except + WorkBook.Close; + excelApp.Quit; + excelApp := Unassigned; + WorkBook := Unassigned; + exit; + end; + +end; + end. diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas index c82b7d3..585defd 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttInputCP_CB.pas @@ -816,6 +816,10 @@ begin cds1.Append; cds1.FieldByName('DEFstr1').Value := trim(CDS_HZ.fieldbyname('MLName').AsString); cds1.FieldByName('CBColor').Value := trim(CDS_HZ.fieldbyname('Color').AsString); + cds1.FieldByName('defstr4').Value := trim(CDS_HZ.fieldbyname('GYS').AsString); + cds1.FieldByName('defstr2').Value := trim(CDS_HZ.fieldbyname('Adultamount').AsString); + cds1.FieldByName('defstr3').Value := trim(CDS_HZ.fieldbyname('childamount').AsString); + cds1.FieldByName('CBdj').Value := trim(CDS_HZ.fieldbyname('Price').AsString); cds1.post; end; diff --git a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas index 9da749c..c59670f 100644 --- a/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas +++ b/基础资料维护(BaseInfo.dll)/U_ZdyAttachCP10.pas @@ -531,7 +531,7 @@ end; procedure TfrmZdyAttachCP10.TBCBClick(Sender: TObject); begin if cds_hz.IsEmpty then - exit; + exit; try frmZdyAttInputCP_CB := TfrmZdyAttInputCP_CB.Create(Application); with frmZdyAttInputCP_CB do diff --git a/应收应付/U_YSYGGJList.dfm b/应收应付/U_YSYGGJList.dfm index 90309a7..fa0b59d 100644 --- a/应收应付/U_YSYGGJList.dfm +++ b/应收应付/U_YSYGGJList.dfm @@ -1,6 +1,6 @@ object frmYSYGGJList: TfrmYSYGGJList - Left = 639 - Top = 399 + Left = 416 + Top = 337 Width = 1333 Height = 598 Caption = #21592#24037#24037#20215#20449#24687 @@ -61,17 +61,16 @@ object frmYSYGGJList: TfrmYSYGGJList ImageIndex = 59 OnClick = TBFindClick end - object tbdel: TToolButton + object ToolButton1: TToolButton Left = 126 Top = 0 AutoSize = True - Caption = #21024#38500 - ImageIndex = 17 - Visible = False - OnClick = tbdelClick + Caption = ' '#20462#25913' ' + ImageIndex = 54 + OnClick = ToolButton1Click end object Tch: TToolButton - Left = 189 + Left = 201 Top = 0 AutoSize = True Caption = #23457#26680 @@ -80,7 +79,7 @@ object frmYSYGGJList: TfrmYSYGGJList OnClick = TchClick end object Tnoch: TToolButton - Left = 252 + Left = 264 Top = 0 AutoSize = True Caption = #25764#38144#23457#26680 @@ -88,8 +87,16 @@ object frmYSYGGJList: TfrmYSYGGJList Visible = False OnClick = TnochClick end + object tbdel: TToolButton + Left = 351 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + OnClick = tbdelClick + end object TBExport: TToolButton - Left = 339 + Left = 414 Top = 0 AutoSize = True Caption = #23548#20986 @@ -97,7 +104,7 @@ object frmYSYGGJList: TfrmYSYGGJList OnClick = TBExportClick end object TBPrint: TToolButton - Left = 402 + Left = 477 Top = 0 AutoSize = True Caption = #25171#21360 @@ -105,7 +112,7 @@ object frmYSYGGJList: TfrmYSYGGJList Visible = False end object TBClose: TToolButton - Left = 465 + Left = 540 Top = 0 AutoSize = True Caption = #20851#38381 @@ -366,7 +373,9 @@ object frmYSYGGJList: TfrmYSYGGJList end> DataController.Summary.SummaryGroups = <> OptionsCustomize.ColumnFiltering = False - OptionsData.Editing = False + OptionsData.Deleting = False + OptionsData.DeletingConfirmation = False + OptionsData.Inserting = False OptionsView.Footer = True OptionsView.GroupByBox = False Styles.Inactive = DataLink_YSYF.SHuangSe @@ -376,6 +385,9 @@ object frmYSYGGJList: TfrmYSYGGJList object Tv1Column5: TcxGridDBColumn Caption = #36873#25321 DataBinding.FieldName = 'SSel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked HeaderAlignmentHorz = taCenter Width = 60 end @@ -595,6 +607,87 @@ object frmYSYGGJList: TfrmYSYGGJList ClientRectRight = 1317 ClientRectTop = 19 end + object Panel2: TPanel + Left = 406 + Top = 200 + Width = 307 + Height = 217 + Color = clSkyBlue + TabOrder = 6 + Visible = False + object Label19: TLabel + Left = 37 + Top = 41 + Width = 42 + Height = 14 + Caption = #21333' '#20215 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + end + object Label20: TLabel + Left = 37 + Top = 83 + Width = 49 + Height = 14 + Caption = #25968' '#37327 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -14 + Font.Name = #23435#20307 + Font.Style = [] + ParentFont = False + end + object Button4: TButton + Left = 170 + Top = 150 + Width = 60 + Height = 25 + Caption = #20851#38381 + TabOrder = 0 + OnClick = Button4Click + end + object Edit_GXPrice: TEdit + Left = 100 + Top = 39 + Width = 121 + Height = 20 + TabOrder = 1 + end + object Edit_QTY: TEdit + Left = 100 + Top = 81 + Width = 121 + Height = 20 + TabOrder = 2 + end + object CheckBox4: TCheckBox + Left = 12 + Top = 41 + Width = 20 + Height = 17 + TabOrder = 3 + end + object CheckBox5: TCheckBox + Left = 12 + Top = 83 + Width = 20 + Height = 17 + TabOrder = 4 + end + object Button9: TButton + Left = 33 + Top = 150 + Width = 60 + Height = 25 + Caption = #20462#25913 + TabOrder = 5 + OnClick = Button9Click + end + end object ADOQueryCmd: TADOQuery Connection = DataLink_YSYF.ADOLink Parameters = <> diff --git a/应收应付/U_YSYGGJList.pas b/应收应付/U_YSYGGJList.pas index 85d90b8..5a193a3 100644 --- a/应收应付/U_YSYGGJList.pas +++ b/应收应付/U_YSYGGJList.pas @@ -1,7 +1,7 @@ unit U_YSYGGJList; interface - + uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, @@ -23,7 +23,7 @@ uses dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, - dxSkinscxPCPainter; + dxSkinscxPCPainter, cxCheckBox; type TfrmYSYGGJList = class(TForm) @@ -92,6 +92,16 @@ type Tnoch: TToolButton; cxTabControl1: TcxTabControl; Tv1Column5: TcxGridDBColumn; + ToolButton1: TToolButton; + Panel2: TPanel; + Label19: TLabel; + Label20: TLabel; + Button4: TButton; + Edit_GXPrice: TEdit; + Edit_QTY: TEdit; + CheckBox4: TCheckBox; + CheckBox5: TCheckBox; + Button9: TButton; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -111,6 +121,9 @@ type procedure TchClick(Sender: TObject); procedure TnochClick(Sender: TObject); procedure tbdelClick(Sender: TObject); + procedure ToolButton1Click(Sender: TObject); + procedure Button4Click(Sender: TObject); + procedure Button9Click(Sender: TObject); private FLeft, FTop: Integer; procedure InitGrid(); @@ -447,5 +460,87 @@ begin end; +procedure TfrmYSYGGJList.ToolButton1Click(Sender: TObject); +begin + Panel2.Left := (self.Width - Panel2.Width) div 2; + Panel2.Visible := True; +end; + +procedure TfrmYSYGGJList.Button4Click(Sender: TObject); +begin + Panel2.Visible := False; +end; + +procedure TfrmYSYGGJList.Button9Click(Sender: TObject); +begin + if (trim(Edit_GXPrice.Text) = '') and checkbox4.Checked then + begin + application.MessageBox('۲Ϊգ', 'ʾϢ', 0); + exit; + end; + if (trim(Edit_QTY.Text) = '') and checkbox5.Checked then + begin + application.MessageBox('Ϊգ', 'ʾϢ', 0); + exit; + end; + + try + ADOQueryCmd.Connection.BeginTrans; + with CDS_Main do + begin + while CDS_Main.Locate('SSel', True, []) do + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( '); + sql.Add(' ' + quotedstr(trim(DName))); + sql.Add(',getdate() '); + sql.Add(',' + quotedstr(trim(self.Caption))); + sql.Add(',' + quotedstr(trim('Ա'))); + sql.Add(',' + quotedstr(trim('޸ǰ:' + trim(CDS_Main.fieldbyname('CLID').AsString) + ', ' + trim(CDS_Main.fieldbyname('GXPrice').AsString) + ', '+ trim(CDS_Main.fieldbyname('QTY').AsString) + '޸ĺ' + ', ' + trim(Edit_GXPrice.Text) + ', ' + trim(Edit_QTY.text)))); + sql.Add(',' + quotedstr(trim('ɹ'))); + sql.Add(')'); + if CheckBox4.Checked then + begin + sql.Add('update JyOrder_Yield SET GXPrice=''' + trim(Edit_GXPrice.Text) + ''' where CLID=''' + trim(CDS_Main.fieldbyname('CLID').AsString) + ''' '); + end; + if CheckBox5.Checked then + begin + sql.Add('update JyOrder_Yield SET QTY=''' + trim(Edit_QTY.Text) + ''' where CLID=''' + trim(CDS_Main.fieldbyname('CLID').AsString) + ''' '); + end; + + ExecSQL; + end; + Edit; + FieldByName('SSel').Value := False; + + if CheckBox4.Checked then + begin + FieldByName('GXPrice').Value := Trim(Edit_GXPrice.Text); + end; + if CheckBox5.Checked then + begin + FieldByName('QTY').Value := Trim(Edit_QTY.Text); + end; + + Post; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ!', 'ʾ', 0); + Panel2.Visible := false; + Edit_GXPrice.Text := ''; + Edit_QTY.Text := ''; + CheckBox4.Checked:=false; + CheckBox5.Checked:=false; + Exit; + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣!', 'ʾ', 0); + end; +end; + end. diff --git a/成品仓库/CPCK.dof b/成品仓库/CPCK.dof index 8eac372..1d3604a 100644 --- a/成品仓库/CPCK.dof +++ b/成品仓库/CPCK.dof @@ -101,7 +101,7 @@ DebugSourceDirs= UsePackages=0 [Parameters] RunParams= -HostApplication=D:\Ŀ\Ŀ\\Ʒֿ\testDll.exe +HostApplication=D:\Dp7Repo\Ŀ\D7FZaideng\Ʒֿ\testDll.exe Launcher= UseLauncher=0 DebugCWD= diff --git a/成品仓库/CPCK.dpr b/成品仓库/CPCK.dpr index 628148e..076a461 100644 --- a/成品仓库/CPCK.dpr +++ b/成品仓库/CPCK.dpr @@ -4,7 +4,7 @@ uses SysUtils, classes, forms, - WinTypes, + WinTypes, WinProcs, U_DataLink in 'U_DataLink.pas' {CPCK_DataLink: TDataModule}, U_GetDllForm in 'U_GetDllForm.pas', @@ -15,7 +15,7 @@ uses U_BpJylist in 'U_BpJylist.pas' {frmBpJylist}, U_CPRk in 'U_CPRk.pas' {frmCPRk}, U_ProductOrderNewList in 'U_ProductOrderNewList.pas' {frmProductOrderNewList}, - U_CpCk in 'U_CpCk.pas' {frmCpCk}, + U_CpCkWF in 'U_CpCkWF.pas' {frmCpCkWF}, U_BpSmCk in 'U_BpSmCk.pas' {frmBpSmCk}, U_CPRklist in 'U_CPRklist.pas' {frmCPRklist}, U_ZdyAttachment in 'U_ZdyAttachment.pas' {frmZdyAttachment}, diff --git a/成品仓库/U_CpCk.pas b/成品仓库/U_CpCk.pas index ce812cf..08b4460 100644 --- a/成品仓库/U_CpCk.pas +++ b/成品仓库/U_CpCk.pas @@ -167,8 +167,7 @@ type procedure ToolButton7Click(Sender: TObject); procedure Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); - procedure v1Column1PropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); private procedure InitGrid(); procedure Initsub(); @@ -184,7 +183,7 @@ type public fkeyNO, FCodeName, FCode, FDRCKNO, FDRCKName: string; FType: integer; - fCKName: string; + fCKName, Fname: string; { Public declarations } end; @@ -670,6 +669,7 @@ begin 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 @@ -2030,7 +2030,7 @@ end; procedure TfrmCpCk.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin - try + try frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin @@ -2048,10 +2048,9 @@ begin end; end; -procedure TfrmCpCk.v1Column1PropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); +procedure TfrmCpCk.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin - frmZdyCMZ_sel := TfrmZdyCMZ_sel.create(self); + frmZdyCMZ_sel := TfrmZdyCMZ_sel.create(self); with frmZdyCMZ_sel do begin if showmodal = 1 then diff --git a/成品仓库/U_CpCkWF.dfm b/成品仓库/U_CpCkWF.dfm new file mode 100644 index 0000000..5f0846f --- /dev/null +++ b/成品仓库/U_CpCkWF.dfm @@ -0,0 +1,1185 @@ +object frmCpCkWF: TfrmCpCkWF + Left = 564 + Top = 306 + Width = 1094 + Height = 539 + BorderIcons = [biSystemMenu] + Caption = #25104#21697#22806#21457#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 = #35009#29255#20986#24211 + Items.Strings = ( + #35009#29255#20986#24211 + #21322#25104#21697#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_CpCkWF.pas b/成品仓库/U_CpCkWF.pas new file mode 100644 index 0000000..1e300b3 --- /dev/null +++ b/成品仓库/U_CpCkWF.pas @@ -0,0 +1,2070 @@ +unit U_CpCkWF; + +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 + TfrmCpCkWF = 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, Fname: string; + { Public declarations } + end; + +var + frmCpCkWF: TfrmCpCkWF; + +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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.FormDestroy(Sender: TObject); +begin + frmCpCkWF := nil; +end; + +procedure TfrmCpCkWF.FormCreate(Sender: TObject); +begin + CRTime.Date := DServerDate; + panel3.Align := alclient; + Yjxdate.Date := DServerDate; +end; + +procedure TfrmCpCkWF.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + tv1.Name + '2', Tv1, 'Ʒֿ'); + Action := cahide; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.ToolButton2Click(Sender: TObject); +begin + if CDS_Main.IsEmpty then + exit; + CDS_Main.Delete; + getxjNum(); +end; + +procedure TfrmCpCkWF.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.ToolButton3Click(Sender: TObject); +begin + Panel2.Visible := true; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.Panel2DblClick(Sender: TObject); +begin + Panel2.Visible := false; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + Initsub(); +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.PackFeePropertiesChange(Sender: TObject); +begin + GetxjNum(); +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.FHAddressBtnDnClick(Sender: TObject); +begin + TBtnEditC(Sender).Text := ''; + TBtnEditC(Sender).TxtCode := ''; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.ToolButton4Click(Sender: TObject); +begin + with CDS_Sub do + begin + append; + post; + end; +end; + +procedure TfrmCpCkWF.ToolButton5Click(Sender: TObject); +begin + if CDS_Sub.IsEmpty then + exit; + CDS_Sub.Delete; +end; + +procedure TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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 TfrmCpCkWF.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_CpCklistWF.dfm b/成品仓库/U_CpCklistWF.dfm new file mode 100644 index 0000000..b374485 --- /dev/null +++ b/成品仓库/U_CpCklistWF.dfm @@ -0,0 +1,1172 @@ +object frmCpCklistWF: TfrmCpCklistWF + Left = 251 + Top = 294 + Width = 1287 + Height = 579 + Caption = #25104#21697#22806#21457#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_CpCklistWF.pas b/成品仓库/U_CpCklistWF.pas new file mode 100644 index 0000000..8a6c614 --- /dev/null +++ b/成品仓库/U_CpCklistWF.pas @@ -0,0 +1,676 @@ +unit U_CpCklistWF; + +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 + TfrmCpCklistWF = 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, fName: string; + { Public declarations } + end; + +var + frmCpCklistWF: TfrmCpCklistWF; + +implementation + +uses + U_DataLink, U_Fun10, U_ZDYHelp, U_CpCkWF, U_BpSmCk; +{$R *.dfm} + +procedure TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.FormClose(Sender: TObject; var Action: TCloseAction); +begin + writeCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + Action := cafree; +end; + +procedure TfrmCpCklistWF.FormDestroy(Sender: TObject); +begin + frmCpCklistWF := nil; +end; + +procedure TfrmCpCklistWF.TBAddClick(Sender: TObject); +begin + frmCpCkWF := TfrmCpCkWF.create(self); + with frmCpCkWF 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 TfrmCpCklistWF.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 TfrmCpCklistWF.FormShow(Sender: TObject); +begin + readCxGrid(self.Caption + '1', Tv1, 'Ʒֿ'); + SetComboBox(); + SetStatus(); + InitGrid(); +end; + +procedure TfrmCpCklistWF.FormCreate(Sender: TObject); +begin + BegDate.Date := DServerDate - 7; + EndDate.Date := DServerDate; + cxGrid1.Align := alclient; + +end; + +procedure TfrmCpCklistWF.TBCloseClick(Sender: TObject); +begin + close; +end; + +procedure TfrmCpCklistWF.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; } + + frmCpCkWF := TfrmCpCkWF.create(self); + with frmCpCkWF 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 TfrmCpCklistWF.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 TfrmCpCklistWF.TBRafreshClick(Sender: TObject); +begin + initGrid(); +end; + +procedure TfrmCpCklistWF.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 TfrmCpCklistWF.TBExportClick(Sender: TObject); +begin + if CDS_Main.IsEmpty then + Exit; + TcxGridToExcel(self.Caption, cxgrid1); +end; + +procedure TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.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 TfrmCpCklistWF.cxTabControl1Change(Sender: TObject); +begin + SetStatus(); + InitGrid(); +end; + +procedure TfrmCpCklistWF.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 TfrmCpCklistWF.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean); +begin + initsub(); +end; + +procedure TfrmCpCklistWF.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_GetDllForm.pas b/成品仓库/U_GetDllForm.pas index 995d017..b51baf6 100644 --- a/成品仓库/U_GetDllForm.pas +++ b/成品仓库/U_GetDllForm.pas @@ -16,7 +16,8 @@ implementation uses U_DataLink, U_getDogServer, U_BpRklist, U_CPRklist, U_Bpcklist, U_Bpkclist, - U_ZDYHelp, U_CPKWListSel, U_BpckXjList, U_Bpkclist_HZ, U_CpCklist; + U_ZDYHelp, U_CPKWListSel, U_BpckXjList, U_Bpkclist_HZ, U_CpCklist, + U_CpCklistWF; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -202,6 +203,26 @@ begin // mnewHandle := frmCpCklist.Handle; end; + 2011: //Ʒ ⷢ + begin + if frmCpCklistWF = nil then + begin + frmCpCklistWF := TfrmCpCklistWF.Create(application.MainForm); + with frmCpCklistWF do + begin + caption := Trim(Title); + fCkName := trim(Parameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmCpCklistWF.BringToFront; + // + mnewHandle := frmCpCklistWF.Handle; + end; 201: //Ʒ⣨ԭ begin if frmBpCklist = nil then