unit u_info_price_other; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, DB, ADODB, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, wwdbdatetimepicker, StdCtrls, RxLookup, wwdblook; type Tfrm_info_price_other = class(TForm) bsSkinPanel1: TbsSkinPanel; t_price_ship: TADOQuery; t_price_ship1: TDataSource; Label124: TLabel; Label20: TLabel; Label9: TLabel; Label21: TLabel; wwDBLookupCombo3: TwwDBLookupCombo; wwDBLookupCombo52: TwwDBLookupCombo; bsSkinButton1: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; RxDBLookupCombo2: TRxDBLookupCombo; RxDBLookupCombo20: TRxDBLookupCombo; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridMaskColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridMaskColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column27: TdxDBGridMaskColumn; dxDBGrid1Column28: TdxDBGridMaskColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridMaskColumn; dxDBGrid1Column34: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGrid1Column40: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGrid1Column45: TdxDBGridColumn; dxDBGrid1Column46: TdxDBGridColumn; dxDBGrid1Column47: TdxDBGridColumn; dxDBGrid1Column48: TdxDBGridColumn; dxDBGrid1Column49: TdxDBGridColumn; dxDBGrid1Column50: TdxDBGridColumn; dxDBGrid1Column51: TdxDBGridColumn; dxDBGrid1Column52: TdxDBGridColumn; dxDBGrid1Column53: TdxDBGridColumn; dxDBGrid1Column54: TdxDBGridColumn; bsSkinButton2: TbsSkinButton; Label11: TLabel; Edit1: TEdit; bsSkinButton3: TbsSkinButton; qryprice1: TADOQuery; qryprice2: TADOQuery; qryprice3: TADOQuery; qryprice01: TADOQuery; qryprice02: TADOQuery; t_price_shipDSDesigner: TAutoIncField; t_price_shipDSDesigner2: TStringField; t_price_shipDSDesigner3: TStringField; t_price_shipDSDesigner4: TStringField; t_price_shipDSDesigner5: TStringField; t_price_shipDSDesigner1: TStringField; t_price_shipDSDesigner22: TStringField; t_price_shipDSDesigner32: TStringField; t_price_shipDSDesigner42: TStringField; t_price_shipDSDesigner52: TStringField; t_price_shipDSDesigner6: TStringField; t_price_shipDSDesigner7: TStringField; t_price_shipDSDesigner8: TStringField; t_price_shipDSDesigner12: TStringField; t_price_shipDSDesigner23: TStringField; t_price_shipDSDesigner33: TStringField; t_price_shipDSDesigner43: TStringField; t_price_shipDSDesigner53: TStringField; t_price_shipDSDesigner62: TStringField; t_price_shipDSDesigner72: TStringField; t_price_shipDSDesigner82: TStringField; t_price_shipDSDesigner13: TStringField; t_price_shipDSDesigner24: TStringField; t_price_shipDSDesigner34: TStringField; t_price_shipDSDesigner44: TStringField; t_price_shipDSDesigner54: TStringField; t_price_shipDSDesigner63: TStringField; t_price_shipDSDesigner73: TStringField; t_price_shipDSDesigner83: TStringField; t_price_shipDSDesigner14: TStringField; t_price_shipDSDesigner25: TStringField; t_price_shipDSDesigner35: TStringField; t_price_shipDSDesigner45: TStringField; t_price_shipDSDesigner55: TStringField; t_price_shipDSDesigner64: TStringField; t_price_shipDSDesigner74: TStringField; t_price_shipDSDesigner84: TStringField; t_price_shipDSDesigner15: TStringField; t_price_shipDSDesigner26: TStringField; t_price_shipDSDesigner36: TStringField; t_price_shipDSDesigner46: TStringField; t_price_shipDSDesigner56: TStringField; t_price_shipDSDesigner65: TStringField; t_price_shipDSDesigner75: TStringField; t_price_shipDSDesigner85: TStringField; t_price_shipDSDesigner9: TStringField; t_price_shipDSDesigner10: TStringField; t_price_shipDSDesigner11: TStringField; t_price_shipDSDesigner16: TStringField; t_price_shipDSDesigner17: TStringField; t_price_shipDSDesigner18: TDateTimeField; t_price_shipDSDesigner19: TDateTimeField; t_price_shipDSDesigner20: TStringField; t_price_shipDSDesigner21: TDateTimeField; t_price_shipDSDesigner27: TStringField; t_price_shipDSDesigner28: TStringField; t_price_shipDSDesigner29: TBooleanField; t_price_shipDSDesigner30: TStringField; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); procedure dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure bsSkinButton3Click(Sender: TObject); procedure dxDBGrid2CustomDrawCell(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 t_price_shipDSDesigner1GetText(Sender: TField; var Text: String; DisplayText: Boolean); procedure t_price_shipDSDesigner12GetText(Sender: TField; var Text: String; DisplayText: Boolean); procedure t_price_shipDSDesigner13GetText(Sender: TField; var Text: String; DisplayText: Boolean); procedure t_price_shipDSDesigner14GetText(Sender: TField; var Text: String; DisplayText: Boolean); procedure t_price_shipDSDesigner15GetText(Sender: TField; var Text: String; DisplayText: Boolean); private procedure setbandview; { Private declarations } public { Public declarations } end; var frm_info_price_other: Tfrm_info_price_other; implementation uses u_main, u_data_share, my_sys_function; {$R *.dfm} procedure Tfrm_info_price_other.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_info_price_other.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_info_price_other.Hide; frm_info_price_other.ManualFloat(frm_info_price_other.BoundsRect ); frm_main.freeTabs('frm_info_price_other'); action:=cafree; frm_info_price_other:=nil; end; procedure Tfrm_info_price_other.bsSkinButton10Click(Sender: TObject); begin wwDBLookupCombo3.Clear; wwDBLookupCombo52.Clear; RxDBLookupCombo2.ClearValue; RxDBLookupCombo20.ClearValue; end; procedure Tfrm_info_price_other.bsSkinButton2Click(Sender: TObject); begin sys_print('航线运价打印',2,t_price_ship1,frm_data_share.t_code_price_ctn1,nil,nil,t_price_ship1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_info_price_other.bsSkinButton1Click(Sender: TObject); var str:widestring; begin str:='SELECT * FROM t_price_ship where 1=1 '; str:=Str+' and '+open_data('3001','录入人','no','no','no','no'); if wwDBLookupCombo3.text<>''then str:=str+' and 启运港 like '+''''+'%'+wwDBLookupCombo3.text+'%'+''''; if wwDBLookupCombo52.text<>''then str:=str+' and 目的港 like '+''''+'%'+wwDBLookupCombo52.text+'%'+''''; if RxDBLookupCombo2.DisplayValue<>''then str:=str+' and 船公司='+''''+RxDBLookupCombo2.KeyValue+''''; if RxDBLookupCombo20.DisplayValue<>''then str:=str+' and 航线='+''''+RxDBLookupCombo20.KeyValue+''''; t_price_ship.close; t_price_ship.sql.Clear; t_price_ship.sql.add(str); t_price_ship.sql.add(' order by 运价编号'); t_price_ship.open; end; procedure Tfrm_info_price_other.FormShow(Sender: TObject); begin qryprice1.Close ; qryprice1.Parameters.ParamByName('myname').Value:=employee ; qryprice1.Open ; qryprice2.Close ; qryprice2.Parameters.ParamByName('myname').Value:=employee ; qryprice2.Open ; qryprice3.Close ; qryprice3.Parameters.ParamByName('myname').Value:=employee ; qryprice3.Open ; qryprice01.Close ; qryprice01.Parameters.ParamByName('myname').Value:=employee ; qryprice01.Open ; qryprice02.Close ; qryprice02.Parameters.ParamByName('myname').Value:=employee ; qryprice02.Open ; setbandview; end; procedure Tfrm_info_price_other.wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo52); end; procedure Tfrm_info_price_other.wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_info_price_other.RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo20); end; procedure Tfrm_info_price_other.RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin key:=#0; frm_info_price_other.bsSkinButton1Click(Sender); end; end; procedure Tfrm_info_price_other.dxDBGrid2ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_price_ship,'运价编号'); end; procedure Tfrm_info_price_other.bsSkinButton3Click(Sender: TObject); var str,str_tiaojian:String; begin IF TRIM(Edit1.TEXT)=''THEN EXIT; str_tiaojian:=' like '+''''+'%'+TRIM(Edit1.TEXT)+'%'+''''; str:='where 目的港'+str_tiaojian; str:=str+' or 目的港中文'+str_tiaojian; str:=str+' or 启运港'+str_tiaojian; str:=str+' or 航线'+str_tiaojian; str:=str+' or 船公司'+str_tiaojian; str:=str+' or 卖价说明'+str_tiaojian; str:=str+' or 结关时间'+str_tiaojian; str:=str+' or 开航时间'+str_tiaojian; // str:=str+' or 省份'+str_tiaojian; t_price_ship.close; t_price_ship.sql.Clear; t_price_ship.sql.add('select * from t_price_ship '); t_price_ship.sql.add(str); t_price_ship.sql.add(' order by 运价编号'); t_price_ship.open; end; procedure Tfrm_info_price_other.dxDBGrid2CustomDrawCell(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 strtodatetime(ANode.Strings[dxDBGridDateColumn2.Index])'' then begin dxDBGrid2.Bands[1].Visible:=true; dxDBGrid2.Bands[1].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型1').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin dxDBGrid2.Bands[2].Visible:=true; dxDBGrid2.Bands[2].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型2').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin dxDBGrid2.Bands[3].Visible:=true; dxDBGrid2.Bands[3].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型3').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin dxDBGrid2.Bands[4].Visible:=true; dxDBGrid2.Bands[4].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型4').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin dxDBGrid2.Bands[5].Visible:=true; dxDBGrid2.Bands[5].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型5').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin dxDBGrid2.Bands[6].Visible:=true; dxDBGrid2.Bands[6].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型6').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型7').asstring)<>'' then begin dxDBGrid2.Bands[7].Visible:=true; dxDBGrid2.Bands[7].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型7').asstring); end; if trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型8').asstring)<>'' then begin dxDBGrid2.Bands[8].Visible:=true; dxDBGrid2.Bands[8].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('运价箱型8').asstring); end; end; procedure Tfrm_info_price_other.t_price_shipDSDesigner1GetText( Sender: TField; var Text: String; DisplayText: Boolean); var Canview :boolean ; begin if qryprice01.Locate('职员',t_price_ship.fieldbyname('录入人').asstring,[]) then begin Canview:=qryprice01.FieldByName('是否可视').AsBoolean ; if CanView then text:=sender.AsString else text:='--' ; end ; end; procedure Tfrm_info_price_other.t_price_shipDSDesigner12GetText( Sender: TField; var Text: String; DisplayText: Boolean); var Canview :boolean ; begin if qryprice02.Locate('职员',t_price_ship.fieldbyname('录入人').asstring,[]) then begin Canview:=qryprice02.FieldByName('是否可视').AsBoolean ; if CanView then text:=sender.AsString else text:='--' ; end ; end; procedure Tfrm_info_price_other.t_price_shipDSDesigner13GetText( Sender: TField; var Text: String; DisplayText: Boolean); var Canview :boolean ; begin if qryprice1.Locate('职员',t_price_ship.fieldbyname('录入人').asstring,[]) then begin Canview:=qryprice1.FieldByName('是否可视').AsBoolean ; if CanView then text:=sender.AsString else text:='--' ; end ; end; procedure Tfrm_info_price_other.t_price_shipDSDesigner14GetText( Sender: TField; var Text: String; DisplayText: Boolean); var Canview :boolean ; begin if qryprice2.Locate('职员',t_price_ship.fieldbyname('录入人').asstring,[]) then begin Canview:=qryprice2.FieldByName('是否可视').AsBoolean ; if CanView then text:=sender.AsString else text:='--' ; end ; end; procedure Tfrm_info_price_other.t_price_shipDSDesigner15GetText( Sender: TField; var Text: String; DisplayText: Boolean); var Canview :boolean ; begin if qryprice3.Locate('职员',t_price_ship.fieldbyname('录入人').asstring,[]) then begin Canview:=qryprice3.FieldByName('是否可视').AsBoolean ; if CanView then text:=sender.AsString else text:='--' ; end ; end; end.