unit u_op_check_seae; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, DB, ADODB, wwdbdatetimepicker, wwdbedit, Wwdotdot, Wwdbcomb, wwdblook, StdCtrls, DBCtrls, RxLookup, Mask, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner, ComCtrls, bsSkinTabs, bsSkinCtrls, u_fee_check, u_fee_zhu, ExtCtrls, bsdbctrls, Menus, XPMenu, Grids, Wwdbigrd, Wwdbgrid; type Tfrm_op_check_seae = class(TForm) t_op_seae1: TDataSource; t_op_state: TADOQuery; t_op_state1: TDataSource; bsSkinNotebook1: TbsSkinNotebook; bsSkinPanel1: TbsSkinPanel; bsSkinButton5: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton10: TbsSkinButton; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: 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: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridDateColumn; dxDBGrid1Column17: TdxDBGridDateColumn; dxDBGrid1Column18: TdxDBGridDateColumn; dxDBGrid1Column19: TdxDBGridMaskColumn; dxDBGrid1Column20: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridDateColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridMaskColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column27: TdxDBGridMaskColumn; dxDBGrid1Column28: TdxDBGridMaskColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridDateColumn; dxDBGrid1Column32: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridMaskColumn; dxDBGrid1Column34: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGrid1Column36: TdxDBGridMaskColumn; dxDBGrid1Column37: TdxDBGridMaskColumn; dxDBGrid1Column38: TdxDBGridMaskColumn; dxDBGrid11: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGridMaskColumn; dxDBGrid19: TdxDBGridMaskColumn; dxDBGrid110: TdxDBGridMaskColumn; dxDBGrid1Column61: TdxDBGridMaskColumn; dxDBGrid1TEU: TdxDBGridMaskColumn; dxDBGrid1Column63: TdxDBGridMaskColumn; dxDBGrid1Column64: TdxDBGridMaskColumn; dxDBGrid1Column65: TdxDBGridDateColumn; dxDBGrid1Column66: TdxDBGridMaskColumn; dxDBGrid1Column67: TdxDBGridMaskColumn; dxDBGrid1Column72: TdxDBGridMaskColumn; dxDBGrid1Column68: TdxDBGridMaskColumn; dxDBGrid1Column69: TdxDBGridMaskColumn; dxDBGrid1Column70: TdxDBGridMaskColumn; dxDBGrid1Column74: TdxDBGridMaskColumn; dxDBGrid1Column75: TdxDBGridMaskColumn; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet2: TbsSkinTabSheet; t_op_seae2: TDataSource; t_op_seae_fen1: TDataSource; t_op_seae_fen: TADOQuery; bsSkinPanel2: TbsSkinPanel; bsSkinPanel3: TbsSkinPanel; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGridMaskColumn58: TdxDBGridMaskColumn; dxDBGridMaskColumn59: TdxDBGridMaskColumn; dxDBGridMaskColumn60: TdxDBGridMaskColumn; dxDBGridMaskColumn61: TdxDBGridMaskColumn; dxDBGridMaskColumn62: TdxDBGridMaskColumn; dxDBGridMaskColumn63: TdxDBGridMaskColumn; dxDBGridMaskColumn64: TdxDBGridMaskColumn; bsSkinButton3: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinPanel4: TbsSkinPanel; 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; DBEdit7: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit; Label125: TLabel; Label15: TLabel; Label7: TLabel; Label124: TLabel; Label146: TLabel; Label145: TLabel; Label32: TLabel; Label21: TLabel; Label27: TLabel; Label30: TLabel; Label31: TLabel; Label12: TLabel; Label11: TLabel; Label13: TLabel; DBEdit5: TDBEdit; Label126: TLabel; Label25: TLabel; Label34: TLabel; Label39: TLabel; Label18: TLabel; Label73: TLabel; Label22: TLabel; Label35: TLabel; Label26: TLabel; Label28: TLabel; Label9: TLabel; Label10: TLabel; Label8: TLabel; Label16: TLabel; Label23: TLabel; DBMemo3: TDBMemo; Label24: TLabel; DBMemo4: TDBMemo; Label29: TLabel; DBMemo5: TDBMemo; Label33: TLabel; DBMemo6: TDBMemo; Label164: TLabel; DBEdit81: TDBEdit; DBEdit82: TDBEdit; DBEdit83: TDBEdit; Label168: TLabel; DBEdit80: TDBEdit; Label6: TLabel; Label14: TLabel; Label20: TLabel; Label40: TLabel; bsSkinButton4: TbsSkinButton; DBEdit6: TDBEdit; dxDBGrid1Column39: TdxDBGridColumn; dxDBGrid1Column40: TdxDBGridColumn; dxDBGridCurrencyColumn1: TdxDBGridColumn; dxDBGridCurrencyColumn2: TdxDBGridColumn; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid3: TdxDBGrid; dxDBGrid2Column1: TdxDBGridMaskColumn; dxDBGrid2Column2: TdxDBGridCheckColumn; dxDBGrid2Column3: TdxDBGridDateColumn; dxDBGrid2Column4: TdxDBGridMaskColumn; dxDBGrid2Column5: TdxDBGridMaskColumn; dxDBGrid3Column6: TdxDBGridColumn; dxDBGrid3Column7: TdxDBGridColumn; dxDBGrid1Column73: TdxDBGridColumn; dxDBGrid2Column73: TdxDBGridColumn; DBEdit18: TDBEdit; Label65: TLabel; DBEdit4: TDBEdit; bsSkinButton7: TbsSkinButton; bsSkinGroupBox1: TbsSkinGroupBox; Label43: TLabel; Label45: TLabel; Label46: TLabel; Label47: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; DBEdit12: TDBEdit; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinGroupBox5: TbsSkinGroupBox; bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox; bsSkinGroupBox2: TbsSkinGroupBox; Label49: TLabel; Label50: TLabel; Label51: TLabel; Label52: TLabel; Label53: TLabel; Label54: TLabel; Label55: TLabel; Label56: TLabel; Label57: TLabel; Label80: TLabel; Label81: TLabel; Label82: TLabel; Label83: TLabel; wwDBDateTimePicker5: TwwDBDateTimePicker; DBEdit20: TDBEdit; RxDBLookupCombo23: TRxDBLookupCombo; DBEdit21: TDBEdit; DBEdit22: TDBEdit; wwDBDateTimePicker9: TwwDBDateTimePicker; bsSkinDBCheckRadioBox7: TbsSkinDBCheckRadioBox; wwDBDateTimePicker10: TwwDBDateTimePicker; DBEdit41: TDBEdit; bsSkinDBCheckRadioBox8: TbsSkinDBCheckRadioBox; DBEdit42: TDBEdit; DBEdit43: TDBEdit; DBEdit44: TDBEdit; DBMemo11: TDBMemo; DBMemo12: TDBMemo; bsSkinGroupBox3: TbsSkinGroupBox; dxDBGrid4: TdxDBGrid; dxDBGridButtonColumn1: TdxDBGridButtonColumn; dxDBGridMaskColumn65: TdxDBGridMaskColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridCheckColumn1: TdxDBGridCheckColumn; dxDBGridDateColumn9: TdxDBGridDateColumn; dxDBGridCheckColumn2: TdxDBGridCheckColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridMaskColumn66: TdxDBGridMaskColumn; t_op_card: TADOQuery; t_op_card1: TDataSource; DBEdit55: TDBEdit; DBEdit56: TDBEdit; DBEdit53: TDBEdit; DBEdit54: TDBEdit; DBEdit10: TDBEdit; DBEdit17: TDBEdit; DBEdit57: TDBEdit; DBEdit58: TDBEdit; DBEdit25: TDBEdit; DBEdit59: TDBEdit; DBEdit27: TDBEdit; DBEdit60: TDBEdit; DBEdit61: TDBEdit; DBEdit70: TDBEdit; DBEdit71: TDBEdit; DBEdit72: TDBEdit; DBEdit73: TDBEdit; DBEdit26: TDBEdit; DBEdit74: TDBEdit; DBEdit66: TDBEdit; DBEdit67: TDBEdit; DBEdit68: TDBEdit; DBEdit69: TDBEdit; DBEdit64: TDBEdit; DBEdit65: TDBEdit; DBEdit62: TDBEdit; DBEdit63: TDBEdit; DBEdit45: TDBEdit; DBEdit46: TDBEdit; DBEdit47: TDBEdit; bsSkinButton1: TbsSkinButton; t_op_seae: TADOStoredProc; DBEdit11: TDBEdit; DBEdit13: TDBEdit; DBEdit14: TDBEdit; DBEdit15: TDBEdit; bsSkinDBCheckRadioBox6: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox9: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox10: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox11: TbsSkinDBCheckRadioBox; bsSkinTabSheet5: TbsSkinTabSheet; t_ch_fee_truck: TADOQuery; t_ch_fee_truck1: TDataSource; Panel1: TPanel; bsSkinButton2: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton12: TbsSkinButton; bsSkinButton13: TbsSkinButton; wwDBGrid1: TwwDBGrid; dxDBGrid1Column71: TdxDBGridColumn; dxDBGrid1Column76: TdxDBGridColumn; dxDBGrid1Column77: TdxDBGridColumn; dxDBGrid1Column78: TdxDBGridColumn; dbedt1: TDBEdit; t_op_delnote: TADOQuery; ds_op_delnote1: TDataSource; bsSkinPanel6: TbsSkinPanel; bsSkinGroupBox4: TbsSkinGroupBox; lbl1: TLabel; lbl2: TLabel; lbl3: TLabel; bsSkinButton8: TbsSkinButton; dbmmo1: TDBMemo; dbedt2: TDBEdit; dbedt3: TDBEdit; dxDBGrid1Column79: TdxDBGridColumn; DBEdit16: TDBEdit; Label41: TLabel; procedure FormShow(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton10Click(Sender: TObject); procedure DBEdit6Change(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton4Click(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 dxDBGridMaskColumn3CustomDraw(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 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 dxDBGridMaskColumn2CustomDraw(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 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 N37Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N1Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure Panel1Resize(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure N19Click(Sender: TObject); procedure wwDBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); procedure N20Click(Sender: TObject); procedure N23Click(Sender: TObject); procedure dbedt1Change(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure t_op_seaeBeforeDelete(DataSet: TDataSet); private { Private declarations } public { Public declarations } end; var frm_op_check_seae: Tfrm_op_check_seae; implementation uses u_main, my_sys_function, u_ch_fee_zhupiao; {$R *.dfm} procedure Tfrm_op_check_seae.FormShow(Sender: TObject); begin t_op_state.close; t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 1=1 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 业务状态=''申请删除''' +default_sort(53,'t_op_seae','','desc'); { t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 1=1 and ' +open_data('0011','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc'); } t_op_seae.open; t_op_seae_fen.open; t_op_delnote.Open; t_op_state.open; t_op_card.open; t_ch_fee_truck.open; loadreggrid(dxdbgrid1,true,caption+'1'); loadreggrid(dxdbgrid2,true,caption+'2'); bsSkinPageControl1.Align:=alClient; if strtobool(get_parameters_value(30,'false')) then begin bsSkinTabSheet5.TabVisible:=true; end else begin bsSkinTabSheet5.TabVisible:=false; end; end; procedure Tfrm_op_check_seae.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_check_seae.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption+'1'); savereggrid(dxdbgrid2,caption+'2'); frm_op_check_seae.Hide; frm_op_check_seae.ManualFloat(frm_op_check_seae.BoundsRect ); frm_main.freeTabs('frm_op_check_seae'); action:=cafree; frm_op_check_seae:=nil; end; procedure Tfrm_op_check_seae.bsSkinButton10Click(Sender: TObject); begin query_seae(3,'0011'); end; procedure Tfrm_op_check_seae.DBEdit6Change(Sender: TObject); begin if (DBEdit6.text='拼箱主票') or (DBEdit6.text='合票主票') then begin bsSkinButton11.Enabled:=true; bsSkinButton4.Enabled:=true; end else begin bsSkinButton11.Enabled:=false; bsSkinButton4.Enabled:=false; end; end; procedure Tfrm_op_check_seae.bsSkinButton11Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then begin showmessage('没有分票信息!!'); exit; end; bsSkinNotebook1.PageIndex:=1; t_op_seae2.Enabled:=false; t_op_seae2.DataSet:=t_op_seae_fen; t_op_seae2.Enabled:=true; end; procedure Tfrm_op_check_seae.bsSkinButton3Click(Sender: TObject); begin bsSkinNotebook1.PageIndex:=0; t_op_seae2.Enabled:=false; t_op_seae2.DataSet:=t_op_seae; t_op_seae2.Enabled:=true; end; procedure Tfrm_op_check_seae.bsSkinButton4Click(Sender: TObject); begin try frm_ch_fee_zhupiao:=tfrm_ch_fee_zhupiao.Create (self); frm_ch_fee_zhupiao.fra_fee_zhu1.fenpiao1.DataSet:=t_op_seae_fen; with frm_ch_fee_zhupiao do begin if if_open('025') then begin fra_fee_zhu1.t_ch_accept.close; fra_fee_zhu1.t_ch_accept.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_accept.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seae; fra_fee_zhu1.dxDBGrid1.FullExpand; fra_fee_zhu1.bsSkinPanel3.visible:=true; end else fra_fee_zhu1.bsSkinPanel3.visible:=false; if if_open('026') then begin fra_fee_zhu1.t_ch_pay.close; fra_fee_zhu1.t_ch_pay.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_pay.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seae; fra_fee_zhu1.dxDBGrid2.FullExpand; fra_fee_zhu1.bsSkinPanel4.visible:=true; end else fra_fee_zhu1.bsSkinPanel4.visible:=false; if fra_fee_zhu1.bsSkinPanel3.visible and fra_fee_zhu1.bsSkinPanel4.visible then begin fra_fee_zhu1.t_op_gain.close; fra_fee_zhu1.t_op_gain.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_gain.open; fra_fee_zhu1.t_op_gain_fen.close; fra_fee_zhu1.t_op_gain_fen.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_gain_fen.open; end else begin fra_fee_zhu1.t_op_gain.close; fra_fee_zhu1.t_op_gain_fen.close; fra_fee_zhu1.bsSkinTabSheet2.TabVisible:=false; end; fra_fee_zhu1.dxDBGrid3.FullExpand; end; frm_ch_fee_zhupiao.ShowModal; finally ; end; end; procedure Tfrm_op_check_seae.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_check_seae.dxDBGridMaskColumn3CustomDraw( 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[dxDBGridMaskColumn3.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_check_seae.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 if ANode.Strings[dxDBGrid1Column2.Index]='申请删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else if ANode.Strings[dxDBGrid1Column2.Index]='批准删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else begin AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid1Column2.Index]); AFont.Color:=clblack; end; end; procedure Tfrm_op_check_seae.dxDBGridMaskColumn2CustomDraw( 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[dxDBGridMaskColumn2.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_check_seae.bsSkinButton7Click(Sender: TObject); begin try t_op_seae.Refresh; except ; end; end; procedure Tfrm_op_check_seae.N10Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then update_grid_view_no(dxdbgrid1) else update_grid_view_no(dxdbgrid2); end; procedure Tfrm_op_check_seae.N14Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then update_grid_view_all(dxdbgrid1) else update_grid_view_all(dxdbgrid2); end; procedure Tfrm_op_check_seae.N12Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then update_grid(dxdbgrid1,12) else update_grid(dxdbgrid2,13); end; procedure Tfrm_op_check_seae.N16Click(Sender: TObject); begin if bsSkinNotebook1.PageIndex=0 then grid_save_xls(dxdbgrid1) else grid_save_xls(dxdbgrid2); end; procedure Tfrm_op_check_seae.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,t_op_seae,'业务编号'); end; procedure Tfrm_op_check_seae.N37Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_op_state where 是否完成<>1)) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N17Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+')) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N34Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N36Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N1Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+')' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N4Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+')' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.Panel1Resize(Sender: TObject); var i:integer; begin i:=round(Panel1.width/4); end; procedure Tfrm_op_check_seae.bsSkinButton2Click(Sender: TObject); var i:integer; begin if t_ch_fee_truck.isempty then exit; if (t_ch_fee_truck.State=dsinsert) or (t_ch_fee_truck.State=dsedit) then begin t_ch_fee_truck.post; end; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'提交审核') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'驳回提交') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'批准修改') then begin showmessage('当前费用状态不能提交审核!!'); exit; end; end; end else begin if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'提交审核') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'驳回提交') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'批准修改') then begin showmessage('当前费用状态不能提交审核!!'); exit; end; end; try frm_main.db.BeginTrans; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='审核通过'; t_ch_fee_truck.post; end; end else begin t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='审核通过'; t_ch_fee_truck.post; end; frm_main.db.CommitTrans; except frm_main.db.RollbackTrans; showmessage('费用审核通过失败!'); exit; end; end; procedure Tfrm_op_check_seae.bsSkinButton9Click(Sender: TObject); var i:integer; begin if t_ch_fee_truck.isempty then exit; if (t_ch_fee_truck.State=dsinsert) or (t_ch_fee_truck.State=dsedit) then begin t_ch_fee_truck.post; end; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以驳回提交!!'); exit; end; if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'审核通过') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'提交审核') then begin showmessage('当前费用状态不能驳回提交!!'); exit; end; end; end else begin if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以驳回提交!!'); exit; end; if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'审核通过') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'提交审核') then begin showmessage('当前费用状态不能驳回提交!!'); exit; end; end; try frm_main.db.BeginTrans; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='驳回提交'; t_ch_fee_truck.post; end; end else begin t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='驳回提交'; t_ch_fee_truck.post; end; frm_main.db.CommitTrans; except frm_main.db.RollbackTrans; showmessage('费用驳回提交失败!'); exit; end; end; procedure Tfrm_op_check_seae.bsSkinButton12Click(Sender: TObject); var i:integer; begin if t_ch_fee_truck.isempty then exit; if (t_ch_fee_truck.State=dsinsert) or (t_ch_fee_truck.State=dsedit) then begin t_ch_fee_truck.post; end; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以批准修改!!'); exit; end; if(t_ch_fee_truck.FieldByName('费用状态').asstring<>'申请修改') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'禁止修改') then begin showmessage('当前费用状态不能批准修改!!'); exit; end; end; end else begin if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以驳回提交!!'); exit; end; if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'申请修改') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'禁止修改') then begin showmessage('当前费用状态不能批准修改!!'); exit; end; end; try frm_main.db.BeginTrans; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='批准修改'; t_ch_fee_truck.post; end; end else begin t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='批准修改'; t_ch_fee_truck.post; end; frm_main.db.CommitTrans; except frm_main.db.RollbackTrans; showmessage('费用批准修改失败!'); exit; end; end; procedure Tfrm_op_check_seae.bsSkinButton13Click(Sender: TObject); var i:integer; begin if t_ch_fee_truck.isempty then exit; if (t_ch_fee_truck.State=dsinsert) or (t_ch_fee_truck.State=dsedit) then begin t_ch_fee_truck.post; end; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以禁止修改!!'); exit; end; if(t_ch_fee_truck.FieldByName('费用状态').asstring<>'申请修改') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'批准修改') then begin showmessage('当前费用状态不能禁止修改!!'); exit; end; end; end else begin if (t_ch_fee_truck.FieldByName('收费结算').asfloat<>0) and (t_ch_fee_truck.FieldByName('付费结算').asfloat<>0) then begin showmessage('当前费用已经结算不可以禁止修改!!'); exit; end; if (t_ch_fee_truck.FieldByName('费用状态').asstring<>'申请修改') and (t_ch_fee_truck.FieldByName('费用状态').asstring<>'批准修改') then begin showmessage('当前费用状态不能禁止修改!!'); exit; end; end; try frm_main.db.BeginTrans; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_ch_fee_truck.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='禁止修改'; t_ch_fee_truck.post; end; end else begin t_ch_fee_truck.edit; t_ch_fee_truck['费用状态']:='禁止修改'; t_ch_fee_truck.post; end; frm_main.db.CommitTrans; except frm_main.db.RollbackTrans; showmessage('费用禁止修改失败!'); exit; end; end; procedure Tfrm_op_check_seae.N6Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+'))) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N8Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'申请修改'+''''+','+''''+'申请删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N19Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 编号 from t_ch_fee_truck where 费用状态<>' +''''+'审核通过'+''''+') ' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.wwDBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin fee_color(t_ch_fee_truck,wwDBGrid1,Rect,Field); end; procedure Tfrm_op_check_seae.N20Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0011','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee )' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.N23Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.Parameters.ParamByName('SQLStr').value:='select * from t_op_seae where 主编号=编号 and ' +open_data('0011','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+')' +default_sort(53,'t_op_seae','','desc'); t_op_seae.open; end; procedure Tfrm_op_check_seae.dbedt1Change(Sender: TObject); begin if (trim(dbedt1.text)='申请删除') then begin bsSkinPanel6.Visible:=true; bsSkinButton4.Enabled:=true; end else begin bsSkinPanel6.Visible:=false; bsSkinButton4.Enabled:=false; end; end; procedure Tfrm_op_check_seae.bsSkinButton8Click(Sender: TObject); begin if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae.Delete; end; end; procedure Tfrm_op_check_seae.t_op_seaeBeforeDelete(DataSet: TDataSet); begin delete_add(1,t_op_seae); end; end.