unit u_op_seae_list; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, Grids, Wwdbigrd, Wwdbgrid, StdCtrls, DB, ADODB, dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, DBCtrls, wwdblook, wwdbdatetimepicker, RxLookup, Menus, XPMenu, Mask, wwdbedit, Wwdotdot, Wwdbcomb,inifiles; type Tfrm_op_seae_list = class(TForm) Panel2: TPanel; dxDBGrid1: TdxDBGrid; t_op_seae: TADOQuery; t_op_seae1: TDataSource; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu1: TXPMenu; bsSkinPanel1: TbsSkinPanel; bsSkinPanel2: TbsSkinPanel; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; Label10: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; Label5: TLabel; wwDBDateTimePicker2: TwwDBDateTimePicker; Label9: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label125: TLabel; wwDBLookupCombo49: TwwDBLookupCombo; Label30: TLabel; Edit7: TEdit; Label6: TLabel; Edit1: TEdit; Label3: TLabel; Edit4: TEdit; Label1: TLabel; Edit2: TEdit; Label4: TLabel; Label7: TLabel; ComboBox1: TComboBox; Label2: TLabel; Edit3: TEdit; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridDateColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridMaskColumn; dxDBGrid1Column20: TdxDBGridMaskColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridDateColumn; dxDBGrid1Column26: TdxDBGridDateColumn; dxDBGrid1Column27: TdxDBGridDateColumn; dxDBGrid1Column28: TdxDBGridMaskColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridDateColumn; dxDBGrid1Column34: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGrid1Column36: TdxDBGridMaskColumn; dxDBGrid1Column37: TdxDBGridMaskColumn; dxDBGrid1Column38: TdxDBGridMaskColumn; dxDBGrid1Column39: TdxDBGridMaskColumn; dxDBGrid1Column40: TdxDBGridMaskColumn; dxDBGrid1Column41: TdxDBGridMaskColumn; dxDBGrid1Column42: TdxDBGridMaskColumn; dxDBGrid1Column43: TdxDBGridDateColumn; dxDBGrid1Column44: TdxDBGridMaskColumn; dxDBGrid1Column45: TdxDBGridMaskColumn; dxDBGrid1Column46: TdxDBGridMaskColumn; dxDBGrid1Column47: TdxDBGridMaskColumn; dxDBGrid1Column48: TdxDBGridMaskColumn; dxDBGrid1Column49: TdxDBGridMaskColumn; dxDBGrid1Column50: TdxDBGridMaskColumn; dxDBGrid1Column51: TdxDBGridMaskColumn; dxDBGrid1Column52: TdxDBGridMaskColumn; dxDBGrid1Column53: TdxDBGridMaskColumn; dxDBGrid1Column54: TdxDBGridMaskColumn; dxDBGrid1Column55: TdxDBGridMaskColumn; dxDBGrid1Column56: TdxDBGridMaskColumn; dxDBGrid1Column57: TdxDBGridColumn; dxDBGrid1Column58: TdxDBGridColumn; dxDBGrid1Column59: TdxDBGridMaskColumn; dxDBGrid1Column60: TdxDBGridMaskColumn; dxDBGrid11: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGridMaskColumn; dxDBGrid19: TdxDBGridMaskColumn; dxDBGrid110: TdxDBGridMaskColumn; dxDBGrid1Column71: TdxDBGridMaskColumn; dxDBGrid1TEU: TdxDBGridMaskColumn; dxDBGrid1Column73: TdxDBGridMaskColumn; dxDBGrid1Column74: TdxDBGridMaskColumn; dxDBGrid1Column75: TdxDBGridDateColumn; dxDBGrid1Column76: TdxDBGridMaskColumn; dxDBGrid1Column77: TdxDBGridMaskColumn; dxDBGrid1Column78: TdxDBGridMaskColumn; dxDBGrid1Column79: TdxDBGridMaskColumn; dxDBGrid1Column80: TdxDBGridMaskColumn; dxDBGrid1Column81: TdxDBGridMaskColumn; dxDBGrid1Column82: TdxDBGridMaskColumn; dxDBGrid1Column83: TdxDBGridMaskColumn; dxDBGrid1Column84: TdxDBGridMaskColumn; dxDBGrid1Column85: TdxDBGridMaskColumn; dxDBGrid1Column86: TdxDBGridMaskColumn; dxDBGrid1Column87: TdxDBGridCheckColumn; dxDBGrid1Column88: TdxDBGridCheckColumn; dxDBGrid1Column89: TdxDBGridCheckColumn; dxDBGrid1Column90: TdxDBGridCheckColumn; dxDBGrid1Column91: TdxDBGridCheckColumn; dxDBGrid1Column92: TdxDBGridDateColumn; dxDBGrid1Column93: TdxDBGridMaskColumn; dxDBGrid1Column94: TdxDBGridMaskColumn; dxDBGrid1Column95: TdxDBGridMaskColumn; dxDBGrid1Column96: TdxDBGridMaskColumn; dxDBGrid1Column97: TdxDBGridMaskColumn; dxDBGrid1Column98: TdxDBGridMaskColumn; dxDBGrid1Column99: TdxDBGridMaskColumn; dxDBGrid1Column100: TdxDBGridMaskColumn; dxDBGrid1Column101: TdxDBGridCheckColumn; dxDBGrid1Column102: TdxDBGridDateColumn; dxDBGrid1Column103: TdxDBGridCheckColumn; dxDBGrid1Column104: TdxDBGridDateColumn; dxDBGrid1Column105: TdxDBGridMaskColumn; dxDBGrid1Column106: TdxDBGridMaskColumn; dxDBGrid1Column107: TdxDBGridMaskColumn; dxDBGrid1Column108: TdxDBGridMaskColumn; dxDBGrid1Column109: TdxDBGridMaskColumn; dxDBGrid1Column110: TdxDBGridMaskColumn; dxDBGrid1Column111: TdxDBGridMaskColumn; dxDBGrid1Column112: TdxDBGridMaskColumn; dxDBGrid1Column113: TdxDBGridMaskColumn; dxDBGrid1Column114: TdxDBGridMaskColumn; dxDBGrid1Column115: TdxDBGridMaskColumn; dxDBGrid1Column116: TdxDBGridMaskColumn; dxDBGrid1Column117: TdxDBGridMaskColumn; dxDBGrid1Column118: TdxDBGridMaskColumn; dxDBGrid1Column119: TdxDBGridCheckColumn; dxDBGrid1Column120: TdxDBGridCheckColumn; dxDBGrid1Column121: TdxDBGridCheckColumn; dxDBGrid1Column122: TdxDBGridCheckColumn; dxDBGrid1Column123: TdxDBGridMaskColumn; dxDBGrid1Column124: TdxDBGridCheckColumn; dxDBGrid1Column125: TdxDBGridDateColumn; dxDBGrid1Column126: TdxDBGridCheckColumn; dxDBGrid1Column127: TdxDBGridCheckColumn; dxDBGrid1Column128: TdxDBGridDateColumn; dxDBGrid1Column129: TdxDBGridDateColumn; dxDBGrid1Column130: TdxDBGridMaskColumn; dxDBGrid1Column131: TdxDBGridMaskColumn; dxDBGrid1Column132: TdxDBGridMaskColumn; dxDBGrid1Column133: TdxDBGridMaskColumn; dxDBGrid1Column134: TdxDBGridMaskColumn; dxDBGrid1Column135: TdxDBGridMaskColumn; dxDBGrid1Column136: TdxDBGridMaskColumn; dxDBGrid1Column137: TdxDBGridCheckColumn; dxDBGrid1Column138: TdxDBGridMaskColumn; dxDBGrid1Column139: TdxDBGridDateColumn; dxDBGrid1Column140: TdxDBGridColumn; dxDBGrid1Column141: TdxDBGridColumn; dxDBGrid1Column142: TdxDBGridColumn; dxDBGrid1Column143: TdxDBGridDateColumn; dxDBGrid1Column144: TdxDBGridDateColumn; dxDBGrid1Column145: TdxDBGridDateColumn; dxDBGrid1Column146: TdxDBGridDateColumn; dxDBGrid1Column147: TdxDBGridMaskColumn; dxDBGrid1Column148: TdxDBGridMaskColumn; dxDBGrid1Column149: TdxDBGridMaskColumn; dxDBGrid1Column150: TdxDBGridCheckColumn; dxDBGrid1Column151: TdxDBGridMaskColumn; dxDBGrid1Column152: TdxDBGridMaskColumn; dxDBGrid1Column153: TdxDBGridMaskColumn; dxDBGrid1Column154: TdxDBGridMaskColumn; dxDBGrid1Column155: TdxDBGridMaskColumn; dxDBGrid1Column156: TdxDBGridMaskColumn; dxDBGrid1Column157: TdxDBGridMaskColumn; dxDBGrid1Column158: TdxDBGridColumn; dxDBGrid1Column159: TdxDBGridMaskColumn; dxDBGrid1Column160: TdxDBGridMaskColumn; dxDBGrid1Column161: TdxDBGridMaskColumn; dxDBGrid1Column162: TdxDBGridMaskColumn; dxDBGrid1Column163: TdxDBGridDateColumn; dxDBGrid1Column164: TdxDBGridDateColumn; dxDBGrid1Column165: TdxDBGridMaskColumn; dxDBGrid1Column166: TdxDBGridDateColumn; dxDBGrid1Column167: TdxDBGridDateColumn; dxDBGrid1Column168: TdxDBGridDateColumn; dxDBGrid1Column169: TdxDBGridDateColumn; dxDBGrid1Column170: TdxDBGridMaskColumn; dxDBGrid1Column171: TdxDBGridMaskColumn; dxDBGrid1Column172: TdxDBGridMaskColumn; dxDBGrid1Column173: TdxDBGridMaskColumn; dxDBGrid1Column174: TdxDBGridMaskColumn; dxDBGrid1Column175: TdxDBGridMaskColumn; dxDBGrid1Column176: TdxDBGridMaskColumn; dxDBGrid1Column177: TdxDBGridMaskColumn; dxDBGrid1Column178: TdxDBGridCheckColumn; dxDBGrid1Column179: TdxDBGridDateColumn; dxDBGrid1Column180: TdxDBGridMaskColumn; dxDBGrid1Column181: TdxDBGridMaskColumn; dxDBGrid1Column182: TdxDBGridMaskColumn; dxDBGrid1Column183: TdxDBGridMaskColumn; dxDBGrid1Column184: TdxDBGridCheckColumn; dxDBGrid1Column185: TdxDBGridMaskColumn; dxDBGrid1Column186: TdxDBGridMaskColumn; dxDBGrid1Column187: TdxDBGridMaskColumn; dxDBGrid1Column189: TdxDBGridMaskColumn; dxDBGrid1Column190: TdxDBGridMaskColumn; dxDBGrid1Column191: TdxDBGridColumn; dxDBGrid1Column192: TdxDBGridMaskColumn; dxDBGrid1Column193: TdxDBGridDateColumn; dxDBGrid1Column206: TdxDBGridMaskColumn; bsSkinPanel3: TbsSkinPanel; lblcount: TLabel; qryseae_delbunk: TADOQuery; Label8: TLabel; RxDBLookupCombo6: TRxDBLookupCombo; bsSkinButton2: TbsSkinButton; bsSkinButton6: TbsSkinButton; Label11: TLabel; wwDBDateTimePicker3: TwwDBDateTimePicker; Label12: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; bsSkinCheckRadioBox1: TbsSkinCheckRadioBox; Label13: TLabel; ComboBox2: TComboBox; Label14: TLabel; ComboBox3: TComboBox; dxDBGrid1Column194: TdxDBGridCheckColumn; dxDBGrid1Column195: TdxDBGridCheckColumn; dxDBGrid1Column196: TdxDBGridCheckColumn; dxDBGrid1Column197: TdxDBGridColumn; dxDBGrid1Column198: TdxDBGridColumn; Label15: TLabel; wwDBDateTimePicker5: TwwDBDateTimePicker; Label16: TLabel; wwDBDateTimePicker6: TwwDBDateTimePicker; Label17: TLabel; dxDBGrid1Column199: TdxDBGridColumn; dxDBGrid1Column200: TdxDBGridColumn; RxDBLookupCombo12: TRxDBLookupCombo; RxDBLookupCombo1: TRxDBLookupCombo; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton9Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure dxDBGrid2Column3CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure dxDBGrid1Column4CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid1CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure dxDBGrid1Column200CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); procedure RxDBLookupCombo1Exit(Sender: TObject); procedure RxDBLookupCombo1Enter(Sender: TObject); procedure RxDBLookupCombo12Enter(Sender: TObject); procedure RxDBLookupCombo12Exit(Sender: TObject); private { Private declarations } seaestr,seaedelstr:string ; function findstr:string ; procedure setFootermsg; procedure loadFindIni ; procedure writeFindIni ; public { Public declarations } end; var frm_op_seae_list: Tfrm_op_seae_list; implementation {$R *.dfm} uses u_main,my_sys_function,u_data_share ; procedure Tfrm_op_seae_list.bsSkinButton5Click(Sender: TObject); begin close ; end; procedure Tfrm_op_seae_list.FormClose(Sender: TObject; var Action: TCloseAction); begin writeFindIni; savereggrid(dxdbgrid1,caption+'1'); frm_op_seae_list.Hide; frm_op_seae_list.ManualFloat(frm_op_seae_list.BoundsRect ); frm_main.freeTabs('frm_op_seae_list'); action:=cafree; frm_op_seae_list:=nil; end; procedure Tfrm_op_seae_list.bsSkinButton9Click(Sender: TObject); begin sys_print('舱位表',2,nil,nil,nil,nil,t_op_seae1,Nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_seae_list.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seae_list.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seae_list.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,210); end; procedure Tfrm_op_seae_list.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seae_list.FormShow(Sender: TObject); var i:integer ; begin loadFindIni; loadreggrid(dxdbgrid1,true,caption+'1'); seaestr:='select ' ; seaedelstr:='select ' ; qryseae_delbunk.open ; for i:=0 to qryseae_delbunk.fieldcount-1 do begin if i=0 then begin if (qryseae_delbunk.fields[i].FieldName='是否推航次') or (qryseae_delbunk.fields[i].FieldName='是否改港') then seaestr:=seaestr+' cast(0 as bit) as '+qryseae_delbunk.Fields[i].FieldName else if (qryseae_delbunk.fields[i].FieldName='处理日期') then seaestr:=seaestr+' 录入日期 as 处理日期 ' else if (qryseae_delbunk.fields[i].FieldName='处理人') then seaestr:=seaestr+' 录入人 as 处理人 ' else seaestr:=seaestr+' '+qryseae_delbunk.Fields[i].FieldName ; seaedelstr:=seaedelstr+' '+qryseae_delbunk.Fields[i].FieldName ; end else begin if (qryseae_delbunk.fields[i].FieldName='是否推航次') or (qryseae_delbunk.fields[i].FieldName='是否改港') then seaestr:=seaestr+', cast(0 as bit) as '+qryseae_delbunk.Fields[i].FieldName else if (qryseae_delbunk.fields[i].FieldName='处理日期') then seaestr:=seaestr+',录入日期 as 处理日期 ' else if (qryseae_delbunk.fields[i].FieldName='处理人') then seaestr:=seaestr+',录入人 as 处理人 ' else seaestr:=seaestr+','+qryseae_delbunk.Fields[i].FieldName ; seaedelstr:=seaedelstr+','+qryseae_delbunk.Fields[i].FieldName ; end; end ; seaestr:=seaestr+' from t_op_seae ' ; seaedelstr:=seaedelstr+' from t_op_seae_delbunk ' ; lblcount.Caption:='' ; end; procedure Tfrm_op_seae_list.dxDBGrid2Column3CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); begin if frm_data_share.t_code_state.Locate('业务状态',backstate,[])then AColor:=stringtocolor(frm_data_share.t_code_state.fieldbyname('颜色').asstring) else AColor:=clwhite ; end; procedure Tfrm_op_seae_list.bsSkinButton6Click(Sender: TObject); begin edit1.Text:='' ; edit2.text:='' ; edit4.text:='' ; edit7.Text:='' ; wwDBDateTimePicker1.Clear ; wwDBDateTimePicker2.Clear ; RxDBLookupCombo12.ClearValue; RxDBLookupCombo1.ClearValue; RxDBLookupCombo6.ClearValue ; RxDBLookupCombo2.ClearValue ; ComboBox1.ItemIndex:=-1 ; ComboBox2.ItemIndex:=-1 ; ComboBox3.ItemIndex:=-1 ; wwDBLookupCombo49.clear ; wwDBDateTimePicker3.Clear ; wwDBDateTimePicker4.Clear ; wwDBDateTimePicker5.Clear ; wwDBDateTimePicker6.Clear ; end; function Tfrm_op_seae_list.findstr: string; begin end; procedure Tfrm_op_seae_list.bsSkinButton1Click(Sender: TObject); var str,delstr:string ; begin str:='where 业务类型=''普通货'' and '+open_data('0001','录入人','操作员','客服员','报关操作','报检操作') ; 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 edit7.text<>'' then str:=str+' and 航次 like '+''''+'%'+Edit7.text+'%'+''''; if edit3.text<>'' then str:=str+' and 业务编号 like '+''''+'%'+Edit3.text+'%'+''''; if wwDBLookupCombo49.text<>''then str:=str+' and 船名 like '+''''+'%'+wwDBLookupCombo49.text+'%'+''''; if RxDBLookupCombo12.DisplayValue<>'' then str:=str+' and 揽货人='+''''+RxDBLookupCombo12.DisplayValue+''''; if RxDBLookupCombo1.DisplayValue<>'' then str:=str+' and 操作员='+''''+RxDBLookupCombo1.DisplayValue+''''; 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 ComboBox1.ItemIndex=0 then str:=str+' and 是否退舱=1 '; if ComboBox1.ItemIndex=1 then str:=str+' and (是否退舱=0 or 是否退舱 is null)'; if RxDBLookupCombo2.DisplayValues[1]<>'' then str:=str+' and 委托单位='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if RxDBLookupCombo6.DisplayValues[1]<>'' then str:=str+' and 船公司='+''''+RxDBLookupCombo6.DisplayValues[1]+''''; delstr:=str; if ComboBox2.ItemIndex=0 then begin str:=str+' and 2=1 '; delstr:=delstr+' and 是否改港=1 '; end; if ComboBox2.ItemIndex=1 then begin str:=str+' and 1=1 '; delstr:=delstr+' and (是否改港=0 or 是否改港 is null) '; end; if ComboBox3.ItemIndex=0 then begin str:=str+' and 2=1 '; delstr:=delstr+' and 是否推航次=1 '; end; if ComboBox3.ItemIndex=1 then begin str:=str+' and 1=1 '; delstr:=delstr+' and (是否推航次=0 or 是否推航次 is null) '; end; if wwDBDateTimePicker5.text<>''then begin str:=str+' and 录入日期>='+''''+wwDBDateTimePicker5.text+''''; delstr:=delstr+' and 处理日期>='+''''+wwDBDateTimePicker5.text+''''; end; if wwDBDateTimePicker6.text<>''then begin str:=str+' and 录入日期<='+''''+wwDBDateTimePicker6.text+''''; delstr:=delstr+' and 处理日期<='+''''+wwDBDateTimePicker6.text+''''; end; delstr:=delstr+' and (是否退舱=1 or 是否推航次=1 or 是否改港=1)'; screen.Cursor:=crSQLwait ; try str:=findstr ; with t_op_seae,SQL do begin close ; Clear ; add(seaedelstr); add(delstr); add(' union '); add(seaestr); add(str); open ; end ; setfootermsg ; finally screen.Cursor:=crDefault ; end ; end; procedure Tfrm_op_seae_list.setFootermsg; var backteu,ggteu,thcteu:integer ; i,teu1,teu2,teu3,teu4,teu5,teu6,teu7,teu8,teu9,teu10,teuot,teuall:integer; steu:string; teu:Array [1..10] of integer; begin lblcount.Caption:='票数 共: '+inttostr(t_op_seae.recordcount) ; ggteu:=0 ; backteu:=0 ;thcteu:=0 ; teu[1]:=0; teu[2]:=0; teu[3]:=0; teu[4]:=0; teu[5]:=0; teu[6]:=0; teu[7]:=0; teu[8]:=0; teu[9]:=0; teu[10]:=0; teuot:=0; teuall:=0; with t_op_seae do begin disablecontrols ; first ; while not eof do begin if fieldbyname('是否退舱').asboolean then backteu:=backteu+1; if fieldbyname('是否改港').asboolean then ggteu:=ggteu+1; if fieldbyname('是否推航次').asboolean then thcteu:=thcteu+1; if not fieldbyname('是否退舱').asboolean then begin teu[1]:=teu[1]+fieldbyname('箱型1').AsInteger; teu[2]:=teu[2]+fieldbyname('箱型2').AsInteger; teu[3]:=teu[3]+fieldbyname('箱型3').AsInteger; teu[4]:=teu[4]+fieldbyname('箱型4').AsInteger; teu[5]:=teu[5]+fieldbyname('箱型5').AsInteger; teu[6]:=teu[6]+fieldbyname('箱型6').AsInteger; teu[7]:=teu[7]+fieldbyname('箱型7').AsInteger; teu[8]:=teu[8]+fieldbyname('箱型8').AsInteger; teu[9]:=teu[9]+fieldbyname('箱型9').AsInteger; teu[10]:=teu[10]+fieldbyname('箱型10').AsInteger; teuot:=teuot+fieldbyname('其他箱型').AsInteger; teuall:=teuall+fieldbyname('箱TEU').AsInteger; end; next ; end ; enablecontrols ; steu:='集装箱(不包含退舱):'; for i:=1 to 10 do begin try if trim(frm_data_share.t_code_ctn_de.fieldbyname('箱型'+inttostr(i)).asstring)<>'' then begin if frm_data_share.t_code_ctn.locate('代码',trim(frm_data_share.t_code_ctn_de.fieldbyname('箱型'+inttostr(i)).asstring),[]) then begin steu:=steu+' '+trim(frm_data_share.t_code_ctn.fieldbyname('表现形式').asstring)+': '+inttostr(teu[i]); end; end else begin end; except ; end; end; steu:=steu+' '+'其他箱型: '+inttostr(teuot); steu:=steu+' '+'合计TEU: '+inttostr(teuall); lblcount.Caption:='票数共: '+inttostr(t_op_seae.recordcount) ; lblcount.Caption:=lblcount.Caption+' 退舱: '+inttostr(backteu); lblcount.Caption:=lblcount.Caption+' 改港: '+inttostr(ggteu); lblcount.Caption:=lblcount.Caption+' 推航次: '+inttostr(thcteu); lblcount.Caption:=lblcount.Caption+' '+steu; end ; end; procedure Tfrm_op_seae_list.dxDBGrid1Column4CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); begin AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid1Column4.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae_list.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_op_seae,'编号'); end; procedure Tfrm_op_seae_list.loadFindIni; var findini:tinifile ; mysec,tmpname:string; canload:boolean ; //是否记忆 i:integer ; begin mysec:='1'; findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'bunkquery.ini'); try canload:=findini.ReadBool(mysec,mysec,false); bsSkinCheckRadioBox1.Checked:=canload ; if canload then begin with bsSkinPanel1 do for i:=0 to ControlCount-1 do begin tmpname:=Controls[i].Name ; if Controls[i] is TComboBox then (Controls[i] as TComboBox).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TwwDBLookupCombo then (Controls[i] as TwwDBLookupCombo).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TEdit then (Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TwwDBDateTimePicker then (Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else if Controls[i] is TRxDBLookupCombo then (Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ; end ; end else begin end ; finally findini.free; end ; end; procedure Tfrm_op_seae_list.writeFindIni; var findini:tinifile ; mysec,tmpname:string; canload:boolean ; //是否记忆 i:integer ; begin canload:=bsSkinCheckRadioBox1.Checked ; mysec:='1'; findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'bunkquery.ini'); try findini.WriteBool(mysec,mysec,canload); if canload then begin with bsSkinPanel1 do for i:=0 to ControlCount-1 do begin tmpname:=Controls[i].Name ; if Controls[i] is TComboBox then findini.WriteString(mysec,TmpName,(Controls[i] as TComboBox).Text) else if Controls[i] is TwwDBLookupCombo then findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBLookupCombo).Text) else if Controls[i] is TEdit then findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else if Controls[i] is TwwDBDateTimePicker then findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else if Controls[i] is TRxDBLookupCombo then findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ; end ; end ; finally findini.free; end ; end; procedure Tfrm_op_seae_list.dxDBGrid1CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if uppercase(ANode.Strings[dxDBGrid1Column196.Index])='TRUE' then begin AFont.Style:=AFont.Style+[fsStrikeOut]; AFont.Color:=clred; AColor:=clBtnFace; exit; end; if uppercase(ANode.Strings[dxDBGrid1Column194.Index])='TRUE' then begin AFont.Style:=AFont.Style+[fsStrikeOut]; AColor:=clYellow; exit; end; if uppercase(ANode.Strings[dxDBGrid1Column195.Index])='TRUE' then begin AFont.Style:=AFont.Style+[fsStrikeOut]; AColor:=clFuchsia; exit; end; end; procedure Tfrm_op_seae_list.dxDBGrid1Column200CustomDrawCell( Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); begin AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid1Column200.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae_list.RxDBLookupCombo1Exit(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='姓名'; end; procedure Tfrm_op_seae_list.RxDBLookupCombo1Enter(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='代码;姓名'; end; procedure Tfrm_op_seae_list.RxDBLookupCombo12Enter(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='代码;姓名'; end; procedure Tfrm_op_seae_list.RxDBLookupCombo12Exit(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='姓名'; end; end.