{$INCLUDE t_main.inc} unit u_ch_fee_check_seai; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, ComCtrls, bsSkinTabs, DB, ADODB, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, u_fee_check, RxLookup, StdCtrls, Mask, DBCtrls, wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker, wwdblook, XPMenu, Menus, bsdbctrls, ExtCtrls, Grids, Wwdbigrd, Wwdbgrid, bsSkinBoxCtrls,inifiles; type Tfrm_ch_fee_check_seai = class(TForm) bsSkinPanel1: TbsSkinPanel; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; t_op_seai1: TDataSource; t_op_state: TADOQuery; t_op_state1: TDataSource; fra_fee_check1: Tfra_fee_check; bsSkinPanel3: TbsSkinPanel; Label1: TLabel; Label19: TLabel; Label2: TLabel; Label17: TLabel; Label3: TLabel; Label37: TLabel; Label5: TLabel; Label38: TLabel; Label4: TLabel; Label6: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit; dxDBGrid2: TdxDBGrid; dxDBGrid2Column1: TdxDBGridMaskColumn; dxDBGrid2Column2: TdxDBGridCheckColumn; dxDBGrid2Column3: TdxDBGridDateColumn; dxDBGrid2Column4: TdxDBGridMaskColumn; dxDBGrid2Column5: TdxDBGridMaskColumn; dxDBGrid2Column6: TdxDBGridColumn; dxDBGrid2Column7: TdxDBGridColumn; DBEdit18: TDBEdit; Label65: TLabel; DBEdit4: TDBEdit; Label122: TLabel; DBMemo33: TDBMemo; Label121: TLabel; DBMemo34: TDBMemo; Label123: TLabel; DBMemo35: TDBMemo; Label125: TLabel; Label124: TLabel; Label11: TLabel; DBEdit10: TDBEdit; Label9: TLabel; DBEdit7: TDBEdit; Label31: TLabel; DBEdit15: TDBEdit; Label32: TLabel; Label25: TLabel; Label24: TLabel; Label33: TLabel; Label30: TLabel; DBEdit14: TDBEdit; DBEdit11: TDBEdit; Label12: TLabel; Label7: TLabel; Label8: TLabel; Label126: TLabel; DBEdit63: TDBEdit; Label10: TLabel; Label26: TLabel; Label13: TLabel; DBEdit12: TDBEdit; Label22: TLabel; Label73: TLabel; Label27: TLabel; Label23: TLabel; Label21: TLabel; Label164: TLabel; Label18: TLabel; DBEdit83: TDBEdit; Label14: TLabel; DBEdit13: TDBEdit; Label20: TLabel; DBEdit82: TDBEdit; Label15: TLabel; DBEdit81: TDBEdit; Label16: TLabel; DBEdit5: TDBEdit; Label28: TLabel; Label29: TLabel; DBMemo1: TDBMemo; Label35: TLabel; DBMemo3: TDBMemo; Label36: TLabel; DBMemo4: TDBMemo; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu1: TXPMenu; t_op_card: TADOQuery; t_op_card1: TDataSource; bsSkinTabSheet4: TbsSkinTabSheet; bsSkinGroupBox5: TbsSkinGroupBox; bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox; bsSkinGroupBox3: TbsSkinGroupBox; dxDBGrid3: TdxDBGrid; dxDBGridButtonColumn1: TdxDBGridButtonColumn; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridCheckColumn1: TdxDBGridCheckColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridCheckColumn2: TdxDBGridCheckColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; PopupMenu3: TPopupMenu; N37: TMenuItem; N38: TMenuItem; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; t_op_seai: TADOStoredProc; DBEdit6: TDBEdit; DBEdit16: TDBEdit; DBEdit17: TDBEdit; DBEdit19: TDBEdit; DBEdit20: TDBEdit; DBEdit21: TDBEdit; DBEdit22: TDBEdit; DBEdit23: TDBEdit; DBEdit24: TDBEdit; DBEdit25: TDBEdit; DBEdit26: TDBEdit; DBEdit27: TDBEdit; DBEdit28: TDBEdit; DBEdit29: TDBEdit; DBEdit30: TDBEdit; DBEdit31: TDBEdit; DBEdit32: TDBEdit; DBEdit33: TDBEdit; DBEdit34: TDBEdit; DBEdit35: TDBEdit; DBEdit36: TDBEdit; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; t_ch_fee_truck: TADOQuery; t_ch_fee_truck1: TDataSource; bsSkinTabSheet5: TbsSkinTabSheet; Panel1: TPanel; bsSkinButton2: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton12: TbsSkinButton; bsSkinButton13: TbsSkinButton; wwDBGrid1: TwwDBGrid; N9: TMenuItem; N19: TMenuItem; N20: TMenuItem; N21: TMenuItem; N22: TMenuItem; N23: TMenuItem; N24: TMenuItem; N25: TMenuItem; N26: TMenuItem; N27: TMenuItem; bsSkinTabSheet6: TbsSkinTabSheet; bsSkinNotebook1: TbsSkinNotebook; bsSkinPanel2: TbsSkinPanel; bsSkinButton5: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton1: TbsSkinButton; DBEdit37: TDBEdit; bsSkinPanel4: TbsSkinPanel; bsSkinPanel5: TbsSkinPanel; bsSkinButton3: TbsSkinButton; bsSkinButton6: TbsSkinButton; t_op_seai2: TDataSource; t_op_seai_fen: TADOQuery; bsSkinPanel6: TbsSkinPanel; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridColumn; dxDBGrid1Column2: TdxDBGridColumn; dxDBGrid1Column3: TdxDBGridColumn; dxDBGrid1Column4: TdxDBGridColumn; dxDBGrid1Column5: TdxDBGridColumn; dxDBGrid1Column59: TdxDBGridColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column58: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridDateColumn; dxDBGrid1Column10: TdxDBGridColumn; dxDBGrid1Column11: TdxDBGridColumn; dxDBGrid1Column12: TdxDBGridColumn; dxDBGrid1Column13: TdxDBGridColumn; dxDBGrid1Column14: TdxDBGridColumn; dxDBGrid1Column15: TdxDBGridColumn; dxDBGrid1Column16: TdxDBGridColumn; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column18: TdxDBGridColumn; dxDBGrid11: TdxDBGridColumn; dxDBGrid12: TdxDBGridColumn; dxDBGrid13: TdxDBGridColumn; dxDBGrid14: TdxDBGridColumn; dxDBGrid15: TdxDBGridColumn; dxDBGrid16: TdxDBGridColumn; dxDBGrid17: TdxDBGridColumn; dxDBGrid18: TdxDBGridColumn; dxDBGrid19: TdxDBGridColumn; dxDBGrid110: TdxDBGridColumn; dxDBGrid1Column39: TdxDBGridColumn; dxDBGrid1TEU: TdxDBGridColumn; dxDBGrid1Column41: TdxDBGridColumn; dxDBGrid1Column42: TdxDBGridColumn; dxDBGrid1Column43: TdxDBGridColumn; dxDBGrid1Column44: TdxDBGridColumn; dxDBGrid1Column45: TdxDBGridColumn; dxDBGrid1Column46: TdxDBGridColumn; dxDBGrid1Column47: TdxDBGridColumn; dxDBGrid1Column48: TdxDBGridColumn; dxDBGrid1Column49: TdxDBGridColumn; dxDBGrid1Column50: TdxDBGridColumn; dxDBGrid1Column51: TdxDBGridColumn; dxDBGrid1Column52: TdxDBGridColumn; dxDBGrid1Column53: TdxDBGridColumn; dxDBGrid1Column54: TdxDBGridColumn; dxDBGrid1Column55: TdxDBGridColumn; dxDBGrid1Column56: TdxDBGridColumn; dxDBGrid1Column57: TdxDBGridColumn; dxDBGrid1Column60: TdxDBGridColumn; dxDBGrid1Column61: TdxDBGridColumn; dxDBGrid1Column62: TdxDBGridColumn; dxDBGrid1Column63: TdxDBGridColumn; bsSkinPanel7: TbsSkinPanel; dxDBGrid4: TdxDBGrid; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridColumn25: TdxDBGridColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridColumn33: TdxDBGridColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridColumn35: TdxDBGridColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGridColumn39: TdxDBGridColumn; dxDBGridColumn40: TdxDBGridColumn; dxDBGridColumn41: TdxDBGridColumn; dxDBGridColumn42: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; dxDBGridColumn44: TdxDBGridColumn; dxDBGridColumn45: TdxDBGridColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; dxDBGridColumn48: TdxDBGridColumn; dxDBGridColumn49: TdxDBGridColumn; dxDBGridColumn50: TdxDBGridColumn; dxDBGridColumn51: TdxDBGridColumn; dxDBGridColumn52: TdxDBGridColumn; dxDBGrid1Column64: TdxDBGridColumn; dxDBGrid1Column65: TdxDBGridColumn; dxDBGrid4Column54: TdxDBGridColumn; dxDBGrid4Column55: TdxDBGridColumn; dxDBGrid4Column56: TdxDBGridColumn; dxDBGrid4Column57: TdxDBGridColumn; dxDBGrid1Column66: TdxDBGridColumn; dxDBGrid1Column67: TdxDBGridColumn; dxDBGrid1Column68: TdxDBGridColumn; Panel3: TPanel; Label41: TLabel; bsSkinComboBox1: TbsSkinComboBox; bsSkinEdit1: TbsSkinEdit; bsSkinButton14: TbsSkinButton; bsSkinButton8: TbsSkinButton; dxDBGrid1Column69: TdxDBGridColumn; dxDBGrid1Column70: TdxDBGridColumn; dxDBGrid1Column71: TdxDBGridColumn; bsSkinButton18: TbsSkinButton; bsSkinButton17: TbsSkinButton; dxDBGrid1Column72: TdxDBGridColumn; procedure FormShow(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton10Click(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 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 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 bsSkinButton1Click(Sender: TObject); procedure N37Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton13Click(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 N24Click(Sender: TObject); procedure N25Click(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure fra_fee_check1bsSkinButton10Click(Sender: TObject); procedure fra_fee_check1bsSkinButton1Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure bsSkinEdit1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_fee_check_seai: Tfrm_ch_fee_check_seai; frm_op_seai_check_create:boolean; implementation uses u_main, my_sys_function, {$IFDEF DLFENZHANG}u_op_seae_fenzhang,{$ENDIF} u_ch_fee_zhupiao, u_seai_sf_shenhe; {$R *.dfm} procedure Tfrm_ch_fee_check_seai.FormShow(Sender: TObject); var inifile1:Tinifile; begin bsSkinButton8.Visible:=if_open('362'); t_op_state.close; t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where 主编号=编号 and ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seai where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'复核驳回'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+','+''''+'申请添加'+''''+','+''''+'提交审核'+''''+'))) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; t_op_seai_fen.open; t_op_state.open; t_op_card.open; t_ch_fee_truck.open; loadreggrid(dxdbgrid1,true,caption); loadwwgrid(fra_fee_check1.wwDBGrid1,'海运进口经理审核应收'); loadwwgrid(fra_fee_check1.wwDBGrid2,'海运进口经理审核应付'); bsSkinPageControl1.Align:=alClient; fra_fee_check1.limited_str.text:='0012'; fra_fee_check1.chk_accept.Text:=get_parameters_value(102,'FALSE') ; fra_fee_check1.chk_pay.text:=get_parameters_value(106,'FALSE') ; fra_fee_check1.ywlb.Text:='海运进口' ; if if_open('058') then begin fra_fee_check1.t_ch_accept.DataSource:=t_op_seai2; fra_fee_check1.t_ch_accept.open; fra_fee_check1.a_shen_delete.open; fra_fee_check1.a_shen_modify_old.open; fra_fee_check1.a_shen_modify_new.open; fra_fee_check1.bsSkinPanel3.visible:=true; end else begin fra_fee_check1.bsSkinPanel3.visible:=false; end; if if_open('059') then begin fra_fee_check1.t_ch_pay.DataSource:=t_op_seai2; fra_fee_check1.t_ch_pay.open; fra_fee_check1.p_shen_delete.open; fra_fee_check1.p_shen_modify_old.open; fra_fee_check1.p_shen_modify_new.open; fra_fee_check1.bsSkinPanel5.visible:=true; end else begin fra_fee_check1.bsSkinPanel5.visible:=false; end; if fra_fee_check1.bsSkinPanel3.visible and fra_fee_check1.bsSkinPanel5.visible then begin fra_fee_check1.Panel3.Visible:=true; fra_fee_check1.t_op_gain.DataSource:=t_op_seai2; fra_fee_check1.t_op_gain.open; // fra_fee_check1.bsSkinPanel9.Visible:=false; // fra_fee_check1.Panel3.Height:=20; fra_fee_check1.DBEdit43.DataSource:=t_op_seai2; fra_fee_check1.t_op_gain_main.DataSource:=t_op_seai2; fra_fee_check1.t_op_gain_main.open; end else begin fra_fee_check1.Panel3.Visible:=false; end; if strtobool(get_parameters_value(30,'false')) then begin bsSkinTabSheet5.TabVisible:=true; N9.Visible:=true; N19.Visible:=true; end else begin bsSkinTabSheet5.TabVisible:=false; N9.Visible:=false; N19.Visible:=false; end; if strtobool(get_parameters_value(150,'false')) then fra_fee_check1.bsSkinPanel10.Visible:=true else fra_fee_check1.bsSkinPanel10.Visible:=False; inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini'); if strtoint(get_parameters_value(197,'0'))<>0 then fra_fee_check1.bsSkinComboBox1.ItemIndex:=strtoint(get_parameters_value(197,'0'))-1 else fra_fee_check1.bsSkinComboBox1.ItemIndex:=inifile1.ReadInteger('FEE','FEEVAT',0); inifile1.Free; frm_op_seai_check_create:=true; {$IFDEF DLFENZHANG} {$ELSE} bsSkinTabSheet6.TabVisible:=false; {$ENDIF} end; procedure Tfrm_ch_fee_check_seai.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_fee_check_seai.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_op_seai_check_create:=false; {$IFDEF DLFENZHANG} if assigned(frm_op_seae_fenzhang) then begin FreeAndNil(frm_op_seae_fenzhang); end; {$ENDIF} savereggrid(dxdbgrid1,caption); savewwgrid(fra_fee_check1.wwDBGrid1,'海运进口经理审核应收'); savewwgrid(fra_fee_check1.wwDBGrid2,'海运进口经理审核应付'); frm_ch_fee_check_seai.Hide; frm_ch_fee_check_seai.ManualFloat(frm_ch_fee_check_seai.BoundsRect ); frm_main.freeTabs('frm_ch_fee_check_seai'); action:=cafree; frm_ch_fee_check_seai:=nil; end; procedure Tfrm_ch_fee_check_seai.bsSkinButton10Click(Sender: TObject); begin query_seai(3,'0012'); end; procedure Tfrm_ch_fee_check_seai.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_ch_fee_check_seai.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_ch_fee_check_seai.bsSkinButton7Click(Sender: TObject); var book1:Tbookmark; begin try book1:=t_op_seai.GetBookmark; t_op_seai.Requery; t_op_seai.GotoBookmark(book1); except ; end; end; procedure Tfrm_ch_fee_check_seai.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_ch_fee_check_seai.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_ch_fee_check_seai.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,37); end; procedure Tfrm_ch_fee_check_seai.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_ch_fee_check_seai.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort_pro(Column,t_op_seai,'业务编号'); end; procedure Tfrm_ch_fee_check_seai.bsSkinButton1Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton1.ClientToScreen(Point(0,bsSkinButton1.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_fee_check_seai.N37Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_op_state where 是否完成<>1) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N17Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+') ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open end; procedure Tfrm_ch_fee_check_seai.N34Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N36Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N2Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+')' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N4Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+')' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N6Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N8Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.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_ch_fee_check_seai.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_ch_fee_check_seai.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; showmessage('费用批准修改成功!'); end; procedure Tfrm_ch_fee_check_seai.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_ch_fee_check_seai.N19Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee_truck where 费用状态<>' +''''+'审核通过'+''''+') ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.wwDBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin fee_color(t_ch_fee_truck,wwDBGrid1,Rect,Field); end; procedure Tfrm_ch_fee_check_seai.N20Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee )' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N23Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+')' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N24Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态='+''''+'提交复核'+''''+') ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.N25Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:='select * from t_op_seai where ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态='+''''+'复核驳回'+''''+') ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_ch_fee_check_seai.bsSkinPageControl1Change(Sender: TObject); begin if frm_op_seai_check_create=false then exit; {$IFDEF DLFENZHANG} if bsSkinPageControl1.ActivePage=bsSkinTabSheet6 then begin if not assigned(frm_op_seae_fenzhang) then begin frm_op_seae_fenzhang:=tfrm_op_seae_fenzhang.Create (self); frm_op_seae_fenzhang.t_ch_fee_fenzhang.Close; frm_op_seae_fenzhang.t_ch_fee_fenzhang.DataSource:=t_op_seai1; frm_op_seae_fenzhang.t_ch_fee_fenzhang.open; frm_op_seae_fenzhang.t_ch_fee.open; frm_op_seae_fenzhang.t_ch_fee_fenzhango.Close; frm_op_seae_fenzhang.t_ch_fee_fenzhango.DataSource:=t_op_seai1; frm_op_seae_fenzhang.t_ch_fee_fenzhango.open; frm_op_seae_fenzhang.t_op_fenzhang.Close; frm_op_seae_fenzhang.t_op_fenzhang.DataSource:=t_op_seai1; frm_op_seae_fenzhang.t_op_fenzhang.Open; frm_op_seae_fenzhang.t_ch_fee_pl.Close; frm_op_seae_fenzhang.t_ch_fee_pl.DataSource:=t_op_seai1; frm_op_seae_fenzhang.t_ch_fee_pl.open; frm_op_seae_fenzhang.t_ch_fee_pl_detail.open; frm_op_seae_fenzhang.t_ch_fee_pl_detailf.open; frm_op_seae_fenzhang.ManualDock(bsSkinTabSheet6,nil,alClient); frm_op_seae_fenzhang.show; end; exit; end; {$ENDIF} end; procedure Tfrm_ch_fee_check_seai.bsSkinButton11Click(Sender: TObject); begin if t_op_seai_fen.IsEmpty then begin showmessage('没有分票信息!!'); exit; end; bsSkinNotebook1.PageIndex:=1; t_op_seai2.Enabled:=false; t_op_seai2.DataSet:=t_op_seai_fen; t_op_seai2.Enabled:=true; end; procedure Tfrm_ch_fee_check_seai.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_seai_fen; with frm_ch_fee_zhupiao do begin if if_open('058') then begin fra_fee_zhu1.t_ch_accept.close; fra_fee_zhu1.t_ch_accept.Parameters[1].value:=t_op_seai.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_accept.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seai; fra_fee_zhu1.dxDBGrid1.FullExpand; fra_fee_zhu1.bsSkinPanel3.visible:=true; end else fra_fee_zhu1.bsSkinPanel3.visible:=false; if if_open('059') then begin fra_fee_zhu1.t_ch_pay.close; fra_fee_zhu1.t_ch_pay.Parameters[1].value:=t_op_seai.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_pay.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seai; 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_seai.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_seai.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_ch_fee_check_seai.bsSkinButton3Click(Sender: TObject); begin bsSkinNotebook1.PageIndex:=0; t_op_seai2.Enabled:=false; t_op_seai2.DataSet:=t_op_seai; t_op_seai2.Enabled:=true; end; procedure Tfrm_ch_fee_check_seai.fra_fee_check1bsSkinButton10Click( Sender: TObject); begin fra_fee_check1.bsSkinButton10Click(Sender); end; procedure Tfrm_ch_fee_check_seai.fra_fee_check1bsSkinButton1Click( Sender: TObject); begin fra_fee_check1.bsSkinButton1Click(Sender); end; procedure Tfrm_ch_fee_check_seai.bsSkinButton8Click(Sender: TObject); begin if not assigned(frm_seai_sf_shen) then frm_seai_sf_shen:=tfrm_seai_sf_shen.Create (self); frm_seai_sf_shen.show; end; procedure Tfrm_ch_fee_check_seai.bsSkinButton14Click(Sender: TObject); begin fra_fee_check1.bsSkinButton10Click(Sender); fra_fee_check1.bsSkinButton12Click(Sender); UpdateInviceRemarks(t_op_seai.fieldbyname('编号').asstring,'t_op_seai'); end; procedure Tfrm_ch_fee_check_seai.bsSkinEdit1KeyPress(Sender: TObject; var Key: Char); var s:string; begin if Trim(bsSkinEdit1.Text)='' then exit; if Key=#13 then begin s:='select * from t_op_seai where 主编号=编号 and ' +open_data('0012','揽货人','操作员','客服员','报关操作','报检操作'); if (bsSkinComboBox1.ItemIndex>=0) and (Trim(bsSkinEdit1.Text)<>'') then begin s:=s+' and '+bsSkinComboBox1.Text +' like ''%'+bsSkinEdit1.Text+'%'''; end; s:=s+' '+default_sort(54,'t_op_seai','','desc'); t_op_seai.Close; t_op_seai.Parameters.ParamByName('SQLStr').value:=s; t_op_seai.open; end; end; procedure Tfrm_ch_fee_check_seai.bsSkinButton17Click(Sender: TObject); begin if strtobool(get_parameters_value(307,'false')) then begin if (trim(t_op_seai.FieldByName('业务类型').AsString)='更改单') then begin t_op_seai.Edit; t_op_seai.FieldByName('更改单状态').AsString:='审核通过'; t_op_seai.Post; showmessage('审核通过'); end; end; end; procedure Tfrm_ch_fee_check_seai.bsSkinButton18Click(Sender: TObject); begin if strtobool(get_parameters_value(307,'false')) then begin if (trim(t_op_seai.FieldByName('业务类型').AsString)='更改单') then begin t_op_seai.Edit; t_op_seai.FieldByName('更改单状态').AsString:='驳回提交'; t_op_seai.Post; showmessage('驳回提交'); end; end; end; end.