unit u_op_add_aire; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, StdCtrls, Mask, DBCtrls, bsSkinCtrls, DB, ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, wwdbdatetimepicker,Grids, DBGrids, XPMenu, Menus, ExtCtrls, wwdblook; type Tfrm_op_add_aire = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; t_main: TADOQuery; t_main1: TDataSource; bsSkinPanel1: TbsSkinPanel; bsSkinGroupBox1: TbsSkinGroupBox; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label7: TLabel; DBEdit1: TDBEdit; DBEdit8: TDBEdit; DBEdit7: TDBEdit; DBEdit2: TDBEdit; DBEdit4: TDBEdit; bsSkinGroupBox2: TbsSkinGroupBox; bsSkinPanel2: TbsSkinPanel; Label1: TLabel; Edit1: TEdit; Label37: TLabel; Edit2: TEdit; Label38: TLabel; Edit3: TEdit; t_fen: TADOQuery; t_fen1: TDataSource; t_fen_no: TADOQuery; t_fen_no1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridDateColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridColumn; XPMenu1: TXPMenu; PopupMenu1: TPopupMenu; N1: TMenuItem; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGrid2Column10: TdxDBGridColumn; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; PopupMenu2: TPopupMenu; N2: TMenuItem; dxDBGrid1Column10: TdxDBGridColumn; dxDBGrid2Column12: TdxDBGridColumn; dxDBGrid3Column7: TdxDBGridColumn; dxDBGrid1Column12: TdxDBGridColumn; Panel1: TPanel; bsSkinButton10: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton5: TbsSkinButton; dxDBGrid3Column8: TdxDBGridColumn; bsSkinPanel3: TbsSkinPanel; Label11: TLabel; Edit4: TEdit; Label12: TLabel; Edit5: TEdit; Label13: TLabel; Edit6: TEdit; Edit7: TEdit; Label14: TLabel; Label124: TLabel; wwDBLookupCombo52: TwwDBLookupCombo; bsSkinButton3: TbsSkinButton; bsSkinButton4: TbsSkinButton; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_add_aire: Tfrm_op_add_aire; implementation uses u_main, my_sys_function, u_op_aire; {$R *.dfm} procedure Tfrm_op_add_aire.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_add_aire.bsSkinButton10Click(Sender: TObject); begin t_fen.close; t_main.close; t_main.sql.clear; t_main.sql.add('select * from t_op_aire where 装运方式='+''''+'空运主票'+''''); if Edit1.text<>''then t_main.sql.add(' and 业务编号 like '+''''+'%'+Edit1.text+'%'+''''); if Edit2.text<>''then t_main.sql.add(' and 委托编号 like '+''''+'%'+Edit2.text+'%'+''''); if Edit3.text<>''then t_main.sql.add(' and 主运单号 like '+''''+'%'+Edit3.text+'%'+''''); t_main.sql.add(default_sort(55,'t_op_aire','','desc')); t_main.open; t_fen.open; end; procedure Tfrm_op_add_aire.bsSkinButton2Click(Sender: TObject); var i:integer; begin if t_main.IsEmpty then exit; if t_main.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前主票业务已经完成,不能加入!!'); exit; end; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_fen_no.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); t_fen_no.Edit; t_fen_no['主编号']:=t_main.fieldbyname('编号').asstring; t_fen_no.post; end; end else begin t_fen_no.Edit; t_fen_no['主编号']:=t_main.fieldbyname('编号').asstring; t_fen_no.post; end; t_fen.Requery(); t_fen_no.requery; frm_op_aire.t_op_aire.Requery(); //close; end; procedure Tfrm_op_add_aire.FormShow(Sender: TObject); begin t_fen_no.close; t_fen_no.sql.clear; t_fen_no.sql.add('select * from t_op_aire where 装运方式<>' +''''+'空运主票'+''''+' and 编号=主编号' +' and ' +open_data('0003','录入人','操作员','客服员','no','no') +default_sort(55,'t_op_aire','','desc')); t_fen_no.open; t_main.open; t_fen.open; end; procedure Tfrm_op_add_aire.bsSkinButton1Click(Sender: TObject); var i:integer; begin if t_main.IsEmpty then exit; if t_main.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前拼箱主票业务已经完成,不能取消加入!!'); exit; end; if t_fen.IsEmpty then exit; if dxDBGrid3.SelectedCount>=1 then begin for i:=0 to dxDBGrid3.SelectedCount-1 do begin t_fen.GotoBookmark(pointer(dxDBGrid3.selectedrows[i])); t_fen.edit; t_fen['主编号']:=t_fen['编号']; t_fen.post; end; end else begin t_fen.edit; t_fen['主编号']:=t_fen['编号']; t_fen.post; end; t_fen.Requery(); t_fen_no.Requery(); end; procedure Tfrm_op_add_aire.bsSkinButton4Click(Sender: TObject); begin Edit4.text:=''; Edit5.text:=''; Edit6.text:=''; Edit7.text:=''; wwDBLookupCombo52.text:=''; end; procedure Tfrm_op_add_aire.bsSkinButton3Click(Sender: TObject); VAR STR:WIDESTRING; begin STR:='select * from t_op_aire where 装运方式<>' +''''+'空运主票'+''''+' and 编号=主编号' +' and ' +open_data('0003','录入人','操作员','客服员','no','no'); IF Edit4.TEXT<>''THEN STR:=STR+' AND 业务编号 like '+''''+'%'+Edit4.TEXT+'%'+''''; IF Edit5.TEXT<>''THEN STR:=STR+' AND 委托编号 like '+''''+'%'+Edit5.TEXT+'%'+''''; IF Edit6.TEXT<>''THEN STR:=STR+' AND 主运单号 like '+''''+'%'+Edit6.TEXT+'%'+''''; IF Edit7.TEXT<>''THEN STR:=STR+' AND 一程航班 like '+''''+'%'+Edit7.TEXT+'%'+''''; IF wwDBLookupCombo52.TEXT<>''THEN STR:=STR+' AND 目的港 like '+''''+'%'+trim(wwDBLookupCombo52.TEXT)+'%'+''''; STR:=STR+default_sort(55,'t_op_aire','','desc'); t_fen_no.close; t_fen_no.sql.clear; t_fen_no.sql.add(str); t_fen_no.open; end; end.