unit u_rp_truck_no; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, dxExEdtr, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, RxLookup, wwdbdatetimepicker, bsSkinCtrls, Menus, XPMenu; type Tfrm_rp_truck_no = class(TForm) qrymast: TADOQuery; dsrmast: TDataSource; bsSkinPanel2: TbsSkinPanel; Label10: TLabel; Label5: TLabel; Label9: TLabel; Label14: TLabel; bsSkinButton10: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton5: TbsSkinButton; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; RxDBLookupCombo2: TRxDBLookupCombo; RxDBLookupCombo3: TRxDBLookupCombo; dxDBGrid1: TdxDBGrid; bsSkinButton1: TbsSkinButton; dxDBGrid1LE_ID: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridCurrencyColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridDateColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; t_crm_client_cd: TADOQuery; dsr_crm_client_cd1: TDataSource; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; N73: TMenuItem; N48: TMenuItem; XPMenu1: TXPMenu; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_rp_truck_no: Tfrm_rp_truck_no; implementation {$R *.dfm} uses u_main,my_sys_function ; procedure Tfrm_rp_truck_no.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption+'1'); frm_rp_truck_no.Hide; frm_rp_truck_no.ManualFloat(frm_rp_truck_no.BoundsRect ); frm_main.freeTabs('frm_rp_truck_no'); action:=cafree; frm_rp_truck_no:=nil; end; procedure Tfrm_rp_truck_no.bsSkinButton1Click(Sender: TObject); begin wwDBDateTimePicker1.Clear ; wwDBDateTimePicker2.Clear ; RxDBLookupCombo2.ClearValue ; RxDBLookupCombo3.ClearValue ; end; procedure Tfrm_rp_truck_no.bsSkinButton10Click(Sender: TObject); begin with qrymast,sql do begin close ; clear ; add('SELECT t_op_letter_pc.LE_ID, t_op_letter_pc.承运车队, t_op_letter_pc.箱型箱量, '); add('t_op_letter_pc.场站联系人, t_op_letter_pc.背箱场站, t_op_letter_pc.场站电话, '); add(' t_op_letter_pc.要求到厂时间, t_op_letter_pc.厂家地址, t_op_letter_pc.厂家联系人, '); add(' t_op_letter_pc.返箱地址, t_op_letter_pc.返箱联系人, t_op_letter_pc.厂家联系电话, '); add('t_op_letter_pc.返箱联系电话, t_op_letter_pc.备注, t_op_letter_pc.陆运费, '); add('t_op_letter_pc.结算方式, t_op_letter.签发日期, t_op_letter.编号,t_op_letter.签发人 '); add('FROM t_op_letter_pc INNER JOIN '); add(' t_op_letter ON t_op_letter_pc.LE_ID = t_op_letter.LE_ID '); add('where (1=1) '); if wwDBDateTimePicker1.TEXT<>''then begin add(' and t_op_letter.签发日期>='+''''+wwDBDateTimePicker1.TEXT+''''); end; if wwDBDateTimePicker2.TEXT<>''then begin add(' and t_op_letter.签发日期<='+''''+wwDBDateTimePicker2.TEXT+''''); end; if RxDBLookupCombo2.DisplayValues[1]<>''then begin add(' and t_op_letter_pc.承运车队='+''''+RxDBLookupCombo2.DisplayValues[1]+''''); end; if RxDBLookupCombo3.DisplayValues[0]<>''then begin add(' and t_op_letter.签发人='+''''+RxDBLookupCombo3.DisplayValues[0]+''''); end; open ; end ; end; procedure Tfrm_rp_truck_no.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid1,true,caption+'1'); t_crm_client_cd.Open ; end; procedure Tfrm_rp_truck_no.bsSkinButton5Click(Sender: TObject); begin close ; end; procedure Tfrm_rp_truck_no.bsSkinButton9Click(Sender: TObject); begin sys_print('派车单统计',2,nil,nil,nil,nil,nil,dsrmast,nil,nil,nil,nil,nil); end; procedure Tfrm_rp_truck_no.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_rp_truck_no.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_rp_truck_no.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,117); end; procedure Tfrm_rp_truck_no.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; end.