unit u_rp_yunjia_seae; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, ComCtrls, bsSkinTabs, bsSkinCtrls, DB, ADODB, TeEngine, Series, TeeProcs, Chart, DbChart, XPMenu, Menus,teeprevi, dxExEdtr, dxTL, dxDBCtrl, dxDBGrid, dxCntner, dxDBTLCl, dxGrClms, ExtDlgs, wwdblook, RxLookup, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker; type Tfrm_rp_yunjia_seae = class(TForm) Panel1: TPanel; p_lirun: TADOStoredProc; XPMenu1: TXPMenu; bsSkinPanel2: TbsSkinPanel; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; Panel2: TPanel; DBChart2: TDBChart; LineSeries1: TLineSeries; dxDBGrid1: TdxDBGrid; p_lirun1: TDataSource; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridColumn; bsSkinButton1: TbsSkinButton; SaveDialog1: TSaveDialog; bsSkinPanel1: TbsSkinPanel; Label12: TLabel; RxDBLookupCombo1: TRxDBLookupCombo; Label25: TLabel; wwDBComboBox31: TwwDBComboBox; Label38: TLabel; RxDBLookupCombo16: TRxDBLookupCombo; Label37: TLabel; RxDBLookupCombo15: TRxDBLookupCombo; Label124: TLabel; wwDBLookupCombo52: TwwDBLookupCombo; bsSkinButton2: TbsSkinButton; Label1: TLabel; wwDBComboBox1: TwwDBComboBox; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; Label2: TLabel; Label3: TLabel; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinPanel2Resize(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo1Enter(Sender: TObject); procedure RxDBLookupCombo1Exit(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_rp_yunjia_seae: Tfrm_rp_yunjia_seae; implementation uses u_main, my_sys_function; {$R *.dfm} procedure Tfrm_rp_yunjia_seae.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_rp_yunjia_seae.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_rp_yunjia_seae.Hide; frm_rp_yunjia_seae.ManualFloat(frm_rp_yunjia_seae.BoundsRect ); frm_main.freeTabs('frm_rp_yunjia_seae'); action:=cafree; frm_rp_yunjia_seae:=nil; end; procedure Tfrm_rp_yunjia_seae.bsSkinButton10Click(Sender: TObject); begin query_seae(7,'0037'); end; procedure Tfrm_rp_yunjia_seae.bsSkinButton9Click(Sender: TObject); begin chartpreview(frm_rp_yunjia_seae,dbchart2); end; procedure Tfrm_rp_yunjia_seae.bsSkinButton1Click(Sender: TObject); begin if SaveDialog1.Execute then frm_rp_yunjia_seae.GetFormImage.SaveToFile(SaveDialog1.FileName+'.bmp'); end; procedure Tfrm_rp_yunjia_seae.bsSkinPanel2Resize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel2.width/6); bsSkinButton9.width:=i; bsSkinButton1.width:=i; end; procedure Tfrm_rp_yunjia_seae.bsSkinButton2Click(Sender: TObject); var Str_bill,CNTRSTR:String; begin if wwDBDateTimePicker1.text<>'' then begin if str_bill='' then str_bill:=' where 开船日期>='+''''+wwDBDateTimePicker1.text+'''' else str_bill:=str_bill+' and 开船日期>='+''''+wwDBDateTimePicker1.text+''''; end; if wwDBDateTimePicker2.text<>'' then begin if str_bill='' then str_bill:=' where 开船日期<='+''''+wwDBDateTimePicker2.text+'''' else str_bill:=str_bill+' and 开船日期<='+''''+wwDBDateTimePicker2.text+''''; end; if RxDBLookupCombo1.DisplayValue<>'' then begin if str_bill='' then str_bill:=' where 客户名称='+''''+RxDBLookupCombo1.DisplayValues[1]+'''' else str_bill:=str_bill+' and 客户名称='+''''+RxDBLookupCombo1.DisplayValues[1]+''''; end; if RxDBLookupCombo16.DisplayValue<>'' then begin if str_bill='' then str_bill:=' where 费用名称='+''''+RxDBLookupCombo16.DisplayValues[1]+'''' else str_bill:=str_bill+' and 费用名称='+''''+RxDBLookupCombo16.DisplayValues[1]+''''; end; if wwDBComboBox31.Text<>'' then begin if str_bill='' then str_bill:=' where 收付='+''''+wwDBComboBox31.Text+'''' else str_bill:=str_bill+' and 收付='+''''+wwDBComboBox31.Text+''''; end; if RxDBLookupCombo15.DisplayValue<>'' then begin if str_bill='' then str_bill:=' where 原始币别='+''''+RxDBLookupCombo15.DisplayValue+'''' else str_bill:=str_bill+' and 原始币别='+''''+RxDBLookupCombo15.DisplayValue+''''; end; if wwDBLookupCombo52.Text<>'' then begin if str_bill='' then str_bill:=' where 卸货港='+''''+wwDBLookupCombo52.Text+'''' else str_bill:=str_bill+' and 卸货港='+''''+wwDBLookupCombo52.Text+''''; end; if wwDBComboBox1.Text<>'' then begin CntrStr:=StringReplace(wwDBComboBox1.Text,'''','''''',[rfReplaceAll]); if str_bill='' then str_bill:=' where 标准='+''''+CntrStr+'''' else str_bill:=str_bill+' and 标准='+''''+CntrStr+''''; end; p_lirun.close; p_lirun.Parameters.ParamByName('SQLStr').value:= 'SELECT * from v_fee_fenxi_items ' +str_bill+' order by 开船日期'; p_lirun.open; end; procedure Tfrm_rp_yunjia_seae.RxDBLookupCombo16Exit(Sender: TObject); begin // RxDBLookupCombo16.LookupDisplay:='中文名'; end; procedure Tfrm_rp_yunjia_seae.RxDBLookupCombo16Enter(Sender: TObject); begin // RxDBLookupCombo16.LookupDisplay:='代码;中文名'; end; procedure Tfrm_rp_yunjia_seae.RxDBLookupCombo1Enter(Sender: TObject); begin // RxDBLookupCombo1.LookupDisplay:='代码;客户简称'; end; procedure Tfrm_rp_yunjia_seae.RxDBLookupCombo1Exit(Sender: TObject); begin // RxDBLookupCombo1.LookupDisplay:='客户简称'; end; end.