unit u_op_seae_close; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, DB, ADODB, dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, ComCtrls, bsSkinTabs, RxLookup, StdCtrls, Mask, DBCtrls, Grids, Wwdbigrd, Wwdbgrid, XPMenu, Menus, bsSkinBoxCtrls, bsdbctrls, ExtCtrls, wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker; type Tfrm_op_seae_close = class(TForm) bsSkinPanel2: TbsSkinPanel; bsSkinButton5: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton10: TbsSkinButton; t_op_seae1: TDataSource; bsSkinButton1: TbsSkinButton; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; dxDBGrid1: TdxDBGrid; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridDateColumn; dxDBGrid1Column66: TdxDBGridMaskColumn; dxDBGrid1Column67: TdxDBGridMaskColumn; dxDBGrid1Column68: TdxDBGridMaskColumn; dxDBGrid1Column69: TdxDBGridMaskColumn; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinPanel5: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label36: TLabel; Label37: TLabel; Label38: TLabel; Label19: TLabel; Label17: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; DBEdit4: TDBEdit; DBEdit7: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit; RxDBLookupCombo12: TRxDBLookupCombo; RxDBLookupCombo13: TRxDBLookupCombo; t_ch_accept: TADOQuery; t_ch_accept1: TDataSource; t_ch_pay: TADOQuery; t_ch_pay1: TDataSource; wwDBGrid1: TwwDBGrid; wwDBGrid2: TwwDBGrid; bsSkinButton3: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton6: TbsSkinButton; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu1: TXPMenu; t_op_gain: TADOQuery; t_op_gain1: TDataSource; Panel2: TPanel; bsSkinStdLabel4: TbsSkinStdLabel; bsSkinStdLabel2: TbsSkinStdLabel; bsSkinStdLabel3: TbsSkinStdLabel; bsSkinStdLabel1: TbsSkinStdLabel; bsSkinStdLabel5: TbsSkinStdLabel; bsSkinStdLabel6: TbsSkinStdLabel; bsSkinStdLabel7: TbsSkinStdLabel; bsSkinStdLabel8: TbsSkinStdLabel; bsSkinStdLabel9: TbsSkinStdLabel; bsSkinStdLabel10: TbsSkinStdLabel; bsSkinDBEdit6: TbsSkinDBEdit; bsSkinDBEdit4: TbsSkinDBEdit; bsSkinDBEdit1: TbsSkinDBEdit; bsSkinDBEdit3: TbsSkinDBEdit; bsSkinDBEdit5: TbsSkinDBEdit; bsSkinDBEdit2: TbsSkinDBEdit; bsSkinDBEdit8: TbsSkinDBEdit; bsSkinDBEdit7: TbsSkinDBEdit; bsSkinDBEdit9: TbsSkinDBEdit; bsSkinDBEdit10: TbsSkinDBEdit; PopupMenu3: TPopupMenu; N37: TMenuItem; N38: TMenuItem; N1: TMenuItem; N2: TMenuItem; N4: TMenuItem; N3: TMenuItem; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; bsSkinButton2: TbsSkinButton; N5: TMenuItem; N6: TMenuItem; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinPanel1: TbsSkinPanel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label79: TLabel; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit10: TDBEdit; DBEdit12: TDBEdit; DBEdit13: TDBEdit; DBEdit14: TDBEdit; DBEdit11: TDBEdit; DBEdit40: TDBEdit; DBEdit45: TDBEdit; DBEdit46: TDBEdit; DBEdit47: TDBEdit; Label122: TLabel; DBEdit48: TDBEdit; DBMemo33: TDBMemo; Label121: TLabel; DBEdit49: TDBEdit; DBMemo34: TDBMemo; Label123: TLabel; DBEdit50: TDBEdit; DBMemo35: TDBMemo; DBEdit51: TDBEdit; Label16: TLabel; DBMemo1: TDBMemo; Label163: TLabel; DBMemo38: TDBMemo; Label164: TLabel; DBEdit52: TDBEdit; DBMemo39: TDBMemo; Label158: TLabel; DBMemo37: TDBMemo; Label168: TLabel; DBEdit80: TDBEdit; Label165: TLabel; DBMemo40: TDBMemo; DBEdit81: TDBEdit; DBEdit75: TDBEdit; Label166: TLabel; DBMemo41: TDBMemo; Label167: TLabel; DBMemo42: TDBMemo; DBEdit82: TDBEdit; Label169: TLabel; DBEdit83: TDBEdit; Label170: TLabel; Label125: TLabel; DBEdit55: TDBEdit; Label18: TLabel; DBEdit56: TDBEdit; Label20: TLabel; DBEdit53: TDBEdit; Label124: TLabel; DBEdit54: TDBEdit; Label146: TLabel; DBEdit18: TDBEdit; Label145: TLabel; DBEdit17: TDBEdit; Label32: TLabel; DBEdit57: TDBEdit; Label21: TLabel; DBEdit58: TDBEdit; Label27: TLabel; DBEdit25: TDBEdit; Label30: TLabel; DBEdit59: TDBEdit; Label31: TLabel; DBEdit27: TDBEdit; Label22: TLabel; DBEdit60: TDBEdit; Label23: TLabel; DBEdit61: TDBEdit; Label24: TLabel; DBEdit16: TDBEdit; Label40: TLabel; DBEdit15: TDBEdit; Label126: TLabel; DBEdit63: TDBEdit; Label25: TLabel; DBEdit62: TDBEdit; Label34: TLabel; DBEdit65: TDBEdit; Label39: TLabel; DBEdit64: TDBEdit; Label26: TLabel; DBEdit69: TDBEdit; Label73: TLabel; DBEdit68: TDBEdit; Label28: TLabel; DBEdit67: TDBEdit; Label35: TLabel; DBEdit66: TDBEdit; Label29: TLabel; DBEdit74: TDBEdit; Label33: TLabel; DBEdit26: TDBEdit; Label41: TLabel; DBEdit73: TDBEdit; Label42: TLabel; DBEdit72: TDBEdit; Label43: TLabel; DBEdit71: TDBEdit; Label44: TLabel; DBEdit70: TDBEdit; N7: TMenuItem; N8: TMenuItem; N9: TMenuItem; N19: TMenuItem; bsSkinPanel9: TbsSkinPanel; Label130: TLabel; Label131: TLabel; Edit4: TEdit; Edit2: TEdit; bsSkinButton44: TbsSkinButton; dxDBGrid1Column71: TdxDBGridColumn; t_op_seae: TADOQuery; wwDBComboBox2: TwwDBComboBox; Label45: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; Label46: TLabel; dxDBGrid1Column18: TdxDBGridColumn; CheckBox1: TCheckBox; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column19: TdxDBGridColumn; dxDBGrid1Column20: TdxDBGridColumn; dxDBGrid1Column21: TdxDBGridColumn; dxDBGrid1Column22: TdxDBGridColumn; Label213: TLabel; RxDBLookupCombo57: TRxDBLookupCombo; CheckBox2: TCheckBox; dxDBGrid1Column23: TdxDBGridColumn; dxDBGrid1Column24: TdxDBGridColumn; dxDBGrid1Column25: TdxDBGridColumn; dxDBGrid1Column26: TdxDBGridColumn; CheckBox3: TCheckBox; wwDBComboBox7: TwwDBComboBox; CheckBox4: TCheckBox; dxDBGrid1Column27: TdxDBGridColumn; dxDBGrid1Column28: TdxDBGridColumn; RxDBLookupCombo2: TRxDBLookupCombo; Label47: TLabel; dxDBGrid1Column29: TdxDBGridColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton5Click(Sender: TObject); procedure FormResize(Sender: TObject); procedure FormShow(Sender: TObject); procedure dxDBGrid1Column3CustomDraw(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 bsSkinButton10Click(Sender: TObject); procedure dxDBGrid1DblClick(Sender: TObject); procedure wwDBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); procedure wwDBGrid2DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure dxDBGrid1Column2CustomDraw(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 bsSkinButton7Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure Panel2Resize(Sender: TObject); procedure N37Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N1Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N19Click(Sender: TObject); procedure bsSkinButton44Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure dxDBGrid1Column18CustomDraw(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 dxDBGrid1Column22CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); private { Private declarations } public { Public declarations } end; var frm_op_seae_close: Tfrm_op_seae_close; implementation uses u_main, my_sys_function, u_op_close_select, u_op_close_all, u_op_open_select, u_op_open_all, u_data_share; {$R *.dfm} procedure Tfrm_op_seae_close.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_op_seae_close.Hide; frm_op_seae_close.ManualFloat(frm_op_seae_close.BoundsRect ); frm_main.freeTabs('frm_op_seae_close'); action:=cafree; frm_op_seae_close:=nil; end; procedure Tfrm_op_seae_close.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_close.FormResize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel2.Width/9); bsSkinButton7.Width:=i; bsSkinButton6.Width:=i; bsSkinButton10.Width:=i; bsSkinButton3.Width:=i; bsSkinButton1.Width:=i; bsSkinButton4.Width:=i; bsSkinButton8.Width:=i; bsSkinButton2.Width:=i; wwDBGrid1.Height:=round((bsSkinTabSheet2.Height-bsSkinPanel5.Height-Panel2.Height)/2); end; procedure Tfrm_op_seae_close.FormShow(Sender: TObject); begin { t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 业务状态<>'+''''+'业务封帐'+'''' +' or 费用状态<>'+''''+'费用封帐'+'''' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; } loadreggrid(dxdbgrid1,true,caption); if if_open('027') or if_open('146') then begin bsSkinButton3.Enabled:=true; bsSkinButton1.Enabled:=true; end; if if_open('332') or if_open('337') then begin bsSkinButton4.Enabled:=true; bsSkinButton8.Enabled:=true; end; end; procedure Tfrm_op_seae_close.dxDBGrid1Column3CustomDraw(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 AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid1Column3.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae_close.bsSkinButton10Click(Sender: TObject); begin query_seae(4,'0011'); end; procedure Tfrm_op_seae_close.dxDBGrid1DblClick(Sender: TObject); begin bsSkinTabSheet2.show; end; procedure Tfrm_op_seae_close.wwDBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin fee_color(t_ch_accept,wwDBGrid1,Rect,Field); end; procedure Tfrm_op_seae_close.wwDBGrid2DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin fee_color(t_ch_pay,wwDBGrid2,Rect,Field); end; procedure Tfrm_op_seae_close.bsSkinButton3Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if (t_op_seae.fieldbyname('业务状态').asstring='业务封帐') and(t_op_seae.fieldbyname('费用状态').asstring='费用封帐')then begin showmessage('对不起业务信息的业务、费用都已经封帐,不能操作!!'); exit; end; try frm_op_close_select:=tfrm_op_close_select.Create(self); close_select_num:=1; if if_open('027') and if_open('146') then begin frm_op_close_select.bsSkinCheckRadioBox3.Checked:=true; end else if if_open('027') then begin frm_op_close_select.bsSkinCheckRadioBox1.Checked:=true; frm_op_close_select.bsSkinCheckRadioBox2.Enabled:=false; frm_op_close_select.bsSkinCheckRadioBox3.Enabled:=false; end else if if_open('146') then begin frm_op_close_select.bsSkinCheckRadioBox2.Checked:=true; frm_op_close_select.bsSkinCheckRadioBox1.Enabled:=false; frm_op_close_select.bsSkinCheckRadioBox3.Enabled:=false; end; frm_op_close_select.yewu.DataSet:=t_op_seae; frm_op_close_select.accept.DataSet:=t_ch_accept; frm_op_close_select.pay.DataSet:=t_ch_pay; frm_op_close_select.ShowModal; finally frm_op_close_select.Free; end; end; procedure Tfrm_op_seae_close.bsSkinButton1Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if (t_op_seae.fieldbyname('业务状态').asstring='业务封帐') and(t_op_seae.fieldbyname('费用状态').asstring='费用封帐')then begin showmessage('对不起业务信息的业务、费用都已经封帐,不能操作!!'); exit; end; try frm_op_close_all:=tfrm_op_close_all.Create(self); if if_open('027') and if_open('146') then begin frm_op_close_all.bsSkinCheckRadioBox3.Checked:=true; end else if if_open('027') then begin frm_op_close_all.bsSkinCheckRadioBox1.Checked:=true; frm_op_close_all.bsSkinCheckRadioBox2.Enabled:=false; frm_op_close_all.bsSkinCheckRadioBox3.Enabled:=false; end else if if_open('146') then begin frm_op_close_all.bsSkinCheckRadioBox2.Checked:=true; frm_op_close_all.bsSkinCheckRadioBox1.Enabled:=false; frm_op_close_all.bsSkinCheckRadioBox3.Enabled:=false; end; frm_op_close_all.yewu.DataSet:=t_op_seae; frm_op_close_all.accept.DataSet:=t_ch_accept; frm_op_close_all.pay.DataSet:=t_ch_pay; frm_op_close_all.ShowModal; finally frm_op_close_all.Free; end; end; procedure Tfrm_op_seae_close.bsSkinButton4Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if (t_op_seae.fieldbyname('业务状态').asstring<>'业务封帐') and(t_op_seae.fieldbyname('费用状态').asstring<>'费用封帐')then begin showmessage('对不起业务信息的业务、费用都没有封帐,不能操作!!'); exit; end; try frm_op_open_select:=tfrm_op_open_select.Create(self); open_select_num:=1; if if_open('332') and if_open('337') then begin frm_op_open_select.bsSkinCheckRadioBox3.Checked:=true; end else if if_open('332') then begin frm_op_open_select.bsSkinCheckRadioBox1.Checked:=true; frm_op_open_select.bsSkinCheckRadioBox2.Enabled:=false; frm_op_open_select.bsSkinCheckRadioBox3.Enabled:=false; end else if if_open('337') then begin frm_op_open_select.bsSkinCheckRadioBox2.Checked:=true; frm_op_open_select.bsSkinCheckRadioBox1.Enabled:=false; frm_op_open_select.bsSkinCheckRadioBox3.Enabled:=false; end; frm_op_open_select.yewu.DataSet:=t_op_seae; frm_op_open_select.accept.DataSet:=t_ch_accept; frm_op_open_select.pay.DataSet:=t_ch_pay; frm_op_open_select.ShowModal; finally frm_op_open_select.Free; end; end; procedure Tfrm_op_seae_close.bsSkinButton8Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if (t_op_seae.fieldbyname('业务状态').asstring<>'业务封帐') and(t_op_seae.fieldbyname('费用状态').asstring<>'费用封帐')then begin showmessage('对不起业务信息的业务、费用都没有封帐,不能操作!!'); exit; end; try frm_op_open_all:=tfrm_op_open_all.Create(self); if if_open('332') and if_open('337') then begin frm_op_open_all.bsSkinCheckRadioBox3.Checked:=true; end else if if_open('332') then begin frm_op_open_all.bsSkinCheckRadioBox1.Checked:=true; frm_op_open_all.bsSkinCheckRadioBox2.Enabled:=false; frm_op_open_all.bsSkinCheckRadioBox3.Enabled:=false; end else if if_open('337') then begin frm_op_open_all.bsSkinCheckRadioBox2.Checked:=true; frm_op_open_all.bsSkinCheckRadioBox1.Enabled:=false; frm_op_open_all.bsSkinCheckRadioBox3.Enabled:=false; end; frm_op_open_all.yewu.DataSet:=t_op_seae; frm_op_open_all.accept.DataSet:=t_ch_accept; frm_op_open_all.pay.DataSet:=t_ch_pay; frm_op_open_all.ShowModal; finally frm_op_open_all.Free; end; end; procedure Tfrm_op_seae_close.dxDBGrid1Column2CustomDraw(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 AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid1Column2.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae_close.bsSkinButton7Click(Sender: TObject); begin if not t_op_seae.Bof then t_op_seae.Prior; end; procedure Tfrm_op_seae_close.bsSkinButton6Click(Sender: TObject); begin if not t_op_seae.eof then t_op_seae.next; end; procedure Tfrm_op_seae_close.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seae_close.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seae_close.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,15); end; procedure Tfrm_op_seae_close.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seae_close.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin // Column_sort_pro(Column,t_op_seae,'业务编号'); end; procedure Tfrm_op_seae_close.Panel2Resize(Sender: TObject); var i:integer; begin i:=round((Panel2.Width-196)/10); bsSkinDBEdit1.Width:=i; bsSkinDBEdit2.Width:=i; bsSkinDBEdit3.Width:=i; bsSkinDBEdit4.Width:=i; bsSkinDBEdit5.Width:=i; bsSkinDBEdit6.Width:=i; bsSkinDBEdit7.Width:=i; bsSkinDBEdit8.Width:=i; bsSkinDBEdit9.Width:=i; end; procedure Tfrm_op_seae_close.N37Click(Sender: TObject); begin t_op_seae.Close; { t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where ' +'编号 in (select distinct 编号 from t_op_state where 是否完成<>1) and' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); } t_op_seae.sql.text:='select * from t_op_seae where ' +'编号 in (select distinct 编号 from t_op_state where 是否完成<>1) and' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N17Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae where ' +'编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+') and' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N34Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae where ' +' 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+')) and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N36Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where ' +' 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N1Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae where' +' 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+') and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N4Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.Text:='select * from t_op_seae ' +' where 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+') and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.bsSkinButton2Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton2.ClientToScreen(Point(0,bsSkinButton2.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seae_close.N6Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae ' +' where 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'审核通过'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+'''' +','+''''+'部分结算'+''''+','+''''+'结算完毕'+''''+')) ' +' and 编号 not in (select distinct 编号 from t_ch_fee where 费用状态 not in (' +''''+'审核通过'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+'''' +','+''''+'部分结算'+''''+','+''''+'结算完毕'+''''+')) and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N7Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae where' +' 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee ) and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.N19Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.sql.text:='select * from t_op_seae where' +' 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+') and ' +open_data('0011','录入人','操作员','客服员','报关操作','报检操作') +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; end; procedure Tfrm_op_seae_close.bsSkinButton44Click(Sender: TObject); var str:widestring; begin t_ch_accept.close; t_ch_pay.close; t_op_gain.close; str:='where 1=1 '; str:=query_tiaojian(1,str,'t_op_seae.委托编号','模糊',Edit4.text); str:=query_tiaojian(1,str,'t_op_seae.主提单号','模糊',Edit2.text); str:=query_tiaojian(1,str,'t_op_seae.费用状态',wwDBComboBox7.text,wwDBComboBox2.text); if RxDBLookupCombo57.Text<>'<无>' then str:=query_tiaojian(1,str,'t_op_seae.委托单位','等于',RxDBLookupCombo57.DisplayValues[1]); if RxDBLookupCombo2.Text<>'<无>' then str:=query_tiaojian(1,str,'t_op_seae.船公司','等于',RxDBLookupCombo2.DisplayValues[1]); str:=query_tiaojian(1,str,'t_op_seae.开船日期','大于',wwDBDateTimePicker1.text); str:=query_tiaojian(1,str,'t_op_seae.开船日期','小于',wwDBDateTimePicker2.text); if CheckBox1.Checked then begin str:=str+' and EXISTS (select 1 from t_ch_fee where t_ch_fee.编号=t_op_seae.编号 and t_ch_fee.CH_ID is not null AND t_ch_fee.结算金额<>0)' end; if CheckBox1.Checked then begin str:=str+' and (t_op_seae.财务=0 or t_op_seae.财务 is null)' end; if CheckBox2.Checked then begin str:=str+' and (t_op_seae.财务=0 or t_op_seae.财务 is null) and t_op_seae.编号 in (select distinct 编号 from t_ch_fee where 开票金额<>0 and 类型=''收'')' end; if CheckBox4.Checked then begin str:=str+' and t_op_seae.财务=0 and EXISTS (select 1 from t_ch_fee where t_ch_fee.编号=t_op_seae.编号 and t_ch_fee.CH_ID is not null) ' ; end; if CheckBox3.Checked then begin str:=str+' and (t_op_seae.财务=0 or t_op_seae.财务 is null) and t_op_seae.编号 in (select v_fee_do_bscard.编号 from t_ch_invoice INNER join v_fee_do_bscard on t_ch_invoice.申请编号=v_fee_do_bscard.工作编号 and v_fee_do_bscard.处理类型=1 '; str:=str+' and (v_fee_do_bscard.编号<>'''' or not v_fee_do_bscard.编号 is null) and t_ch_invoice.开票日期 between ''2013-08-01'' and ''2013-08-31'')'; end; // select v_fee_do_bscard.编号 from t_ch_invoice //INNER join v_fee_do_bscard on t_ch_invoice.申请编号=v_fee_do_bscard.工作编号 and v_fee_do_bscard.处理类型=1 //and (v_fee_do_bscard.编号<>'' or not v_fee_do_bscard.编号 is null) { if trim(str)='' then begin str:='where '+open_data('0011','t_op_seae.录入人', 't_op_seae.操作员','t_op_seae.客服员','t_op_seae.报关操作','t_op_seae.报检操作'); end else begin str:=str+' and '+open_data('0011','t_op_seae.录入人', 't_op_seae.操作员','t_op_seae.客服员','t_op_seae.报关操作','t_op_seae.报检操作'); end; } str:='select t_op_seae.*,t_op_gain.毛利润,t_op_gain.应收USD,t_op_gain.应收RMB,t_op_gain.应付USD,t_op_gain.应付RMB,t_op_gain.合计应收,t_op_gain.合计应付 ' +' from t_op_seae left Join t_op_gain on t_op_gain.编号=t_op_seae.编号 '+str+default_sort(53,'t_op_seae','','desc'); //ShowMessage(str); t_op_seae.close; // t_op_seae.Parameters.ParamByName('SQLStr').value:=str; t_op_seae.sql.text:=str; t_op_seae.Open; t_ch_accept.open; t_ch_pay.open; t_op_gain.OPEN; if t_op_seae.IsEmpty then begin showmessage('没有检索出所需数据!!'); exit; end; end; procedure Tfrm_op_seae_close.Edit1KeyPress(Sender: TObject; var Key: Char); begin if Key=#13 then bsSkinButton44.OnClick(Sender); end; procedure Tfrm_op_seae_close.dxDBGrid1Column18CustomDraw(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 strtofloatdef(AText,0)<0 then AColor:=clRed; end; procedure Tfrm_op_seae_close.dxDBGrid1Column22CustomDraw(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 Trim(ANode.Strings[dxDBGrid1Column22.Index])='更改单' then AColor:=clred; AFont.Color:=clblack; end; end.