unit u_rp_tai_seae_pin; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, DB, ADODB, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, cxGridCardView, cxGridDBCardView, Grids, DBGrids, dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, wwdbdatetimepicker, StdCtrls, wwdblook, RxLookup, Menus, XPMenu; type Tfrm_rp_tai_seae_pin = class(TForm) bsSkinPanel1: TbsSkinPanel; p_seae_pin1: TDataSource; dxDBGrid1: TdxDBGrid; p_seae_pin: TADOStoredProc; dxDBGrid1Column5: TdxDBGridColumn; dxDBGrid1Column3: TdxDBGridColumn; dxDBGrid1Column4: TdxDBGridColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridColumn; dxDBGrid1Column10: TdxDBGridColumn; dxDBGrid1Column11: TdxDBGridColumn; dxDBGrid1Column12: TdxDBGridColumn; dxDBGrid1Column19: TdxDBGridColumn; dxDBGrid1Column21: TdxDBGridColumn; dxDBGrid1Column22: TdxDBGridColumn; dxDBGrid1Column23: TdxDBGridColumn; dxDBGrid1Column24: TdxDBGridColumn; dxDBGrid1Column25: TdxDBGridColumn; dxDBGrid1Column26: TdxDBGridColumn; dxDBGrid1Column28: TdxDBGridColumn; dxDBGrid1Column30: TdxDBGridColumn; dxDBGrid1Column32: TdxDBGridColumn; dxDBGrid1Column33: TdxDBGridColumn; dxDBGrid1Column34: TdxDBGridColumn; dxDBGrid1Column35: TdxDBGridColumn; dxDBGrid1Column40: TdxDBGridColumn; dxDBGrid1Column43: TdxDBGridColumn; dxDBGrid1Column54: TdxDBGridColumn; dxDBGrid1Column55: TdxDBGridColumn; dxDBGrid1Column56: TdxDBGridColumn; dxDBGrid1Column57: TdxDBGridColumn; dxDBGrid11: TdxDBGridColumn; dxDBGrid12: TdxDBGridColumn; dxDBGrid13: TdxDBGridColumn; dxDBGrid14: TdxDBGridColumn; dxDBGrid15: TdxDBGridColumn; dxDBGrid16: TdxDBGridColumn; dxDBGrid17: TdxDBGridColumn; dxDBGrid18: TdxDBGridColumn; dxDBGrid19: TdxDBGridColumn; dxDBGrid110: TdxDBGridColumn; dxDBGrid1Column80: TdxDBGridColumn; dxDBGrid1TEU: TdxDBGridColumn; dxDBGrid1Column82: TdxDBGridColumn; dxDBGrid1Column83: TdxDBGridColumn; dxDBGrid1Column84: TdxDBGridColumn; dxDBGrid1Column85: TdxDBGridColumn; dxDBGrid1Column86: TdxDBGridColumn; dxDBGrid1Column87: TdxDBGridColumn; dxDBGrid1Column88: TdxDBGridColumn; dxDBGrid1Column89: TdxDBGridColumn; dxDBGrid1Column90: TdxDBGridColumn; dxDBGrid1Column92: TdxDBGridColumn; dxDBGrid1Column93: TdxDBGridColumn; dxDBGrid1Column101: TdxDBGridColumn; dxDBGrid1Column102: TdxDBGridColumn; dxDBGrid1Column103: TdxDBGridColumn; dxDBGrid1Column104: TdxDBGridColumn; dxDBGrid1Column105: TdxDBGridColumn; dxDBGrid1Column106: TdxDBGridColumn; dxDBGrid1Column107: TdxDBGridColumn; dxDBGrid1Column108: TdxDBGridColumn; dxDBGrid1Column111: TdxDBGridColumn; dxDBGrid1Column113: TdxDBGridColumn; dxDBGrid1Column122: TdxDBGridColumn; dxDBGrid1Column124: TdxDBGridColumn; dxDBGrid1Column125: TdxDBGridColumn; dxDBGrid1Column127: TdxDBGridColumn; dxDBGrid1Column110: TdxDBGridCheckColumn; dxDBGrid1Column112: TdxDBGridCheckColumn; dxDBGrid1Column96: TdxDBGridCheckColumn; dxDBGrid1Column97: TdxDBGridCheckColumn; dxDBGrid1Column98: TdxDBGridCheckColumn; dxDBGrid1Column99: TdxDBGridCheckColumn; dxDBGrid1Column100: TdxDBGridCheckColumn; Label6: TLabel; Edit1: TEdit; Label3: TLabel; Edit4: TEdit; Label1: TLabel; Edit2: TEdit; Edit3: TEdit; Label2: TLabel; Label10: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; Label5: TLabel; wwDBDateTimePicker2: TwwDBDateTimePicker; Label8: TLabel; wwDBDateTimePicker3: TwwDBDateTimePicker; Label11: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; Label9: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label125: TLabel; wwDBLookupCombo49: TwwDBLookupCombo; Label30: TLabel; Edit7: TEdit; Label20: TLabel; wwDBLookupCombo3: TwwDBLookupCombo; Label124: TLabel; wwDBLookupCombo52: TwwDBLookupCombo; Label14: TLabel; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo6: TRxDBLookupCombo; Label16: TLabel; bsSkinCheckGroup1: TbsSkinCheckGroup; bsSkinButton1: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton9: TbsSkinButton; dxDBGrid1Column91: TdxDBGridColumn; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; N39: TMenuItem; XPMenu1: TXPMenu; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure N10Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_rp_tai_seae_pin: Tfrm_rp_tai_seae_pin; implementation uses u_main, my_sys_function; {$R *.dfm} procedure Tfrm_rp_tai_seae_pin.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_rp_tai_seae_pin.Hide; frm_rp_tai_seae_pin.ManualFloat(frm_rp_tai_seae_pin.BoundsRect ); frm_main.freeTabs('frm_rp_tai_seae_pin'); action:=cafree; frm_rp_tai_seae_pin:=nil; end; procedure Tfrm_rp_tai_seae_pin.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_tai_seae_pin.bsSkinButton10Click(Sender: TObject); begin Edit1.text:=''; Edit4.text:=''; Edit2.text:=''; Edit3.text:=''; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; RxDBLookupCombo2.ClearValue; wwDBDateTimePicker3.text:=''; wwDBDateTimePicker4.text:=''; wwDBLookupCombo49.text:=''; Edit7.text:=''; wwDBLookupCombo3.text:=''; wwDBLookupCombo52.text:=''; RxDBLookupCombo6.ClearValue; RxDBLookupCombo3.ClearValue; end; procedure Tfrm_rp_tai_seae_pin.bsSkinButton1Click(Sender: TObject); var str:widestring; pin_str:string; begin str:='where 装运方式 like '+''''+'拼箱%'+''''; if bsSkinCheckGroup1.Checked[0] then pin_str:='装运方式 in('+''''+'拼箱主票'+''''; if bsSkinCheckGroup1.Checked[1] then begin if pin_str=''then pin_str:='装运方式 in('+''''+'拼箱分票'+'''' else pin_str:=pin_str+','+''''+'拼箱分票'+''''; end; if bsSkinCheckGroup1.Checked[2] then begin if pin_str=''then pin_str:='装运方式 in('+''''+'拼箱单票'+'''' else pin_str:=pin_str+','+''''+'拼箱单票'+''''; end; if pin_str<>''then begin pin_str:=pin_str+')'; str:=str+' and '+pin_str; end; if Edit1.text<>''then str:=str+' and 业务编号 like '+''''+'%'+Edit1.text+'%'+''''; if Edit4.text<>''then str:=str+' and 委托编号 like '+''''+'%'+Edit4.text+'%'+''''; if Edit2.text<>''then str:=str+' and 主提单号 like '+''''+'%'+Edit2.text+'%'+''''; if Edit3.text<>''then str:=str+' and 分提单号 like '+''''+'%'+Edit3.text+'%'+''''; if wwDBDateTimePicker1.text<>''then str:=str+' and 开船日期>='+''''+wwDBDateTimePicker1.text+''''; if wwDBDateTimePicker2.text<>''then str:=str+' and 开船日期<='+''''+wwDBDateTimePicker2.text+''''; if wwDBDateTimePicker3.text<>''then str:=str+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''; if wwDBDateTimePicker4.text<>''then str:=str+' and 会计期间<='+''''+wwDBDateTimePicker4.text+''''; if RxDBLookupCombo2.DisplayValues[1]<>''then str:=str+' and 委托单位='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if RxDBLookupCombo6.DisplayValues[1]<>''then str:=str+' and 操作员='+''''+RxDBLookupCombo6.DisplayValues[1]+''''; if RxDBLookupCombo3.DisplayValues[1]<>''then str:=str+' and 揽货人='+''''+RxDBLookupCombo3.DisplayValues[1]+''''; if wwDBLookupCombo49.text<>''then str:=str+' and 船名 like '+''''+'%'+wwDBLookupCombo49.text+'%'+''''; if Edit7.text<>''then str:=str+' and 航次 like '+''''+'%'+Edit7.text+'%'+''''; if wwDBLookupCombo3.text<>''then str:=str+' and 装货港 like '+''''+'%'+wwDBLookupCombo3.text+'%'+''''; if wwDBLookupCombo52.text<>''then str:=str+' and 卸货港 like '+''''+'%'+wwDBLookupCombo52.text+'%'+''''; str:='select *,(case when 重量/1000>尺码 then 重量/1000 else 尺码 end) as 计费吨 from t_op_seae '+str+default_sort(53,'t_op_seae','',''); p_seae_pin.close; p_seae_pin.Parameters.ParamByName('SQLStr').Value:=str; p_seae_pin.open; end; procedure Tfrm_rp_tai_seae_pin.FormShow(Sender: TObject); begin bsSkinCheckGroup1.Checked[0]:=true; bsSkinCheckGroup1.Checked[1]:=true; bsSkinCheckGroup1.Checked[2]:=true; loadreggrid(dxdbgrid1,true,caption); end; procedure Tfrm_rp_tai_seae_pin.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_rp_tai_seae_pin.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_rp_tai_seae_pin.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,p_seae_pin,'业务编号'); end; procedure Tfrm_rp_tai_seae_pin.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_rp_tai_seae_pin.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,1); end; procedure Tfrm_rp_tai_seae_pin.bsSkinButton9Click(Sender: TObject); begin sys_print('海运拼箱台帐',2,nil,nil,nil,nil,p_seae_pin1,nil,nil,nil,nil,nil,nil); end; end.