unit u_op_seae_fangdan; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, XPMenu, Menus, dxDBTLCl, dxGrClms, dxDBCtrl, dxDBGrid, dxTL, dxCntner, DB, ADODB, Mask, wwdbedit, Wwdotdot, Wwdbcomb, wwdblook, RxLookup, wwdbdatetimepicker, StdCtrls, bsSkinCtrls, ExtCtrls; type Tfrm_op_seae_fangdan = class(TForm) Panel2: TPanel; Panel3: TPanel; bsSkinButton10: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinPanel1: TbsSkinPanel; Label6: TLabel; Label3: TLabel; Label1: TLabel; Label2: TLabel; Label10: TLabel; Label5: TLabel; Label9: TLabel; Label8: TLabel; Label11: TLabel; Label30: TLabel; Label125: TLabel; Label124: TLabel; Label7: TLabel; Edit1: TEdit; Edit4: TEdit; Edit2: TEdit; Edit3: TEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; RxDBLookupCombo2: TRxDBLookupCombo; wwDBDateTimePicker3: TwwDBDateTimePicker; wwDBDateTimePicker4: TwwDBDateTimePicker; Edit7: TEdit; wwDBLookupCombo49: TwwDBLookupCombo; wwDBLookupCombo52: TwwDBLookupCombo; wwDBComboBox1: TwwDBComboBox; t_op_seae: TADOQuery; t_op_seae1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column78: TdxDBGridColumn; 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; dxDBGrid1Column39: TdxDBGridColumn; dxDBGrid1Column40: TdxDBGridColumn; dxDBGrid11: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGridMaskColumn; dxDBGrid19: TdxDBGridMaskColumn; dxDBGrid110: TdxDBGridMaskColumn; dxDBGrid111: TdxDBGridMaskColumn; dxDBGrid112: TdxDBGridMaskColumn; dxDBGrid113: TdxDBGridMaskColumn; dxDBGrid114: TdxDBGridMaskColumn; dxDBGrid115: TdxDBGridMaskColumn; dxDBGrid116: TdxDBGridMaskColumn; dxDBGrid117: TdxDBGridMaskColumn; dxDBGrid118: TdxDBGridMaskColumn; dxDBGrid119: TdxDBGridMaskColumn; dxDBGrid120: 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; dxDBGrid1Column73: TdxDBGridColumn; dxDBGrid1Column76: TdxDBGridColumn; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; XPMenu1: TXPMenu; t_op_seaesel: TADOQuery; ds_op_seaesel1: TDataSource; pm1: TPopupMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; dxDBGrid1Column89: TdxDBGridColumn; dxDBGrid1Column90: TdxDBGridColumn; dxDBGrid1Column91: TdxDBGridColumn; dxDBGrid1Column92: TdxDBGridColumn; dxDBGrid1Column94: TdxDBGridColumn; dxDBGrid1Column96: TdxDBGridColumn; dxDBGrid1Column97: TdxDBGridColumn; Label14: TLabel; wwDBDateTimePicker7: TwwDBDateTimePicker; Label15: TLabel; wwDBDateTimePicker8: TwwDBDateTimePicker; wwDBComboBox2: TwwDBComboBox; Label21: TLabel; PopupMenu1: TPopupMenu; N9: TMenuItem; MenuItem4: TMenuItem; N17: TMenuItem; MenuItem5: TMenuItem; N18: TMenuItem; MenuItem6: TMenuItem; MenuItem7: TMenuItem; MenuItem8: TMenuItem; N19: TMenuItem; N20: TMenuItem; N21: TMenuItem; N22: TMenuItem; N23: TMenuItem; MenuItem9: TMenuItem; MenuItem10: TMenuItem; N24: TMenuItem; N25: TMenuItem; N26: TMenuItem; N27: TMenuItem; N28: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; N29: TMenuItem; N30: TMenuItem; N31: TMenuItem; N32: TMenuItem; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinPanel2: TbsSkinPanel; dxDBGrid1Column93: TdxDBGridDateColumn; dxDBGrid1Column95: TdxDBGridColumn; dxDBGrid1Column85: TdxDBGridColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton1Click(Sender: TObject); procedure N1Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure dxDBGrid1DblClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_seae_fangdan: Tfrm_op_seae_fangdan; implementation uses my_sys_function, u_main, my_sys_chat, u_data_share; {$R *.dfm} procedure Tfrm_op_seae_fangdan.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_op_seae_fangdan.Hide; frm_op_seae_fangdan.ManualFloat(frm_op_seae_fangdan.BoundsRect ); frm_main.freeTabs('frm_op_seae_fangdan'); action:=cafree; frm_op_seae_fangdan:=nil; end; procedure Tfrm_op_seae_fangdan.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_fangdan.bsSkinButton10Click(Sender: TObject); var str:widestring; begin str:='where 1=1'; if (wwDBDateTimePicker7.text<>'')or(wwDBDateTimePicker8.text<>'') then begin if wwDBDateTimePicker7.text<>'' then str:=str+' and 申请日期>='+''''+wwDBDateTimePicker7.text+''''; if wwDBDateTimePicker8.text<>'' then str:=str+' and 申请日期<='+''''+wwDBDateTimePicker8.text+''''; end; if wwDBComboBox1.text='没有审核' then str:=str+' and 财务审核状态=''没有审核'''; if wwDBComboBox1.text='审核通过' then str:=str+' and 财务审核状态=''审核通过'''; if wwDBComboBox2.text='没有审核' then str:=str+' and 经理审核状态=''没有审核'''; if wwDBComboBox2.text='审核通过' then str:=str+' and 经理审核状态=''审核通过'''; if Edit1.text<>''then str:=str+' and 业务编号 like '+''''+'%'+Edit1.text+'%'+''''; if Edit4.text<>''then str:=str+' and 委托编号 like '+''''+'%'+Edit4.text+'%'+''''; if Edit2.text<>''then str:=str+' and 主提单号 like '+''''+'%'+Edit2.text+'%'+''''; if Edit3.text<>''then str:=str+' and 分提单号 like '+''''+'%'+Edit3.text+'%'+''''; if wwDBDateTimePicker1.text<>''then str:=str+' and 开船日期>='+''''+wwDBDateTimePicker1.text+''''; if wwDBDateTimePicker2.text<>''then str:=str+' and 开船日期<='+''''+wwDBDateTimePicker2.text+''''; if wwDBDateTimePicker3.text<>''then str:=str+' and 会计期间>='+''''+wwDBDateTimePicker3.text+''''; if wwDBDateTimePicker4.text<>''then str:=str+' and 会计期间<='+''''+wwDBDateTimePicker4.text+''''; if RxDBLookupCombo2.DisplayValues[1]<>''then str:=str+' and 委托单位='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if wwDBLookupCombo49.text<>''then str:=str+' and 船名 like '+''''+'%'+wwDBLookupCombo49.text+'%'+''''; if Edit7.text<>''then str:=str+' and 航次 like '+''''+'%'+Edit7.text+'%'+''''; if wwDBLookupCombo52.text<>''then str:=str+' and 卸货港 like '+''''+'%'+wwDBLookupCombo52.text+'%'+''''; t_op_seae.close; t_op_seae.sql.clear; t_op_seae.sql.add('select * from v_op_fangdan_bscard '+str+' order by blid'); t_op_seae.open; end; procedure Tfrm_op_seae_fangdan.bsSkinButton6Click(Sender: TObject); begin Edit1.text:=''; Edit4.text:=''; Edit2.text:=''; Edit3.text:=''; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; RxDBLookupCombo2.ClearValue; wwDBDateTimePicker3.text:=''; wwDBDateTimePicker4.text:=''; wwDBLookupCombo49.text:=''; Edit7.text:=''; wwDBLookupCombo52.text:=''; wwDBComboBox1.text:=''; wwDBComboBox2.text:=''; wwDBDateTimePicker7.text:=''; wwDBDateTimePicker8.text:=''; end; procedure Tfrm_op_seae_fangdan.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_op_seae,'编号'); end; procedure Tfrm_op_seae_fangdan.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seae_fangdan.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seae_fangdan.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,110); end; procedure Tfrm_op_seae_fangdan.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seae_fangdan.FormShow(Sender: TObject); begin loadreggrid(dxdbgrid1,true,caption); if not if_open('307') then begin bsSkinButton1.Enabled:=false; bsSkinButton2.Enabled:=false; end; if not if_open('306') then begin bsSkinButton3.Enabled:=false; bsSkinButton4.Enabled:=false; end; end; procedure Tfrm_op_seae_fangdan.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin key:=#0; frm_op_seae_fangdan.bsSkinButton10Click(Sender); end; end; procedure Tfrm_op_seae_fangdan.bsSkinButton1Click(Sender: TObject); var i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if t_op_seae.FieldByName('经理审核状态').AsString<>'审核通过' then begin t_op_seae.Edit; t_op_seae['经理审核状态']:='审核通过'; t_op_seae['经理审核人']:=employee; t_op_seae['经理审核日期']:=DATE; if t_op_seae.FieldByName('财务审核状态').AsString='审核通过' then t_op_seae['放单状态']:='确认放单'; t_op_seae.post; end; end; end else begin if t_op_seae.FieldByName('经理审核状态').AsString<>'审核通过' then begin t_op_seae.Edit; t_op_seae['经理审核状态']:='审核通过'; t_op_seae['经理审核人']:=employee; if t_op_seae.FieldByName('财务审核状态').AsString='审核通过' then t_op_seae['放单状态']:='确认放单'; t_op_seae['经理审核日期']:=DATE; t_op_seae.post; end; end; end; procedure Tfrm_op_seae_fangdan.N1Click(Sender: TObject); begin // sys_print('海运出口单证管理',2,nil,nil,nil,nil,t_op_seae1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_seae_fangdan.bsSkinButton7Click(Sender: TObject); begin t_op_seae.close; t_op_seae.sql.clear; t_op_seae.sql.add('select * from v_op_fangdan_bscard where 经理审核状态<>''审核通过'' order by blid'); t_op_seae.open; end; procedure Tfrm_op_seae_fangdan.bsSkinButton8Click(Sender: TObject); begin t_op_seae.close; t_op_seae.sql.clear; t_op_seae.sql.add('select * from v_op_fangdan_bscard where 财务审核状态<>''审核通过'' order by blid'); t_op_seae.open; end; procedure Tfrm_op_seae_fangdan.bsSkinButton2Click(Sender: TObject); var i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if t_op_seae.FieldByName('经理审核状态').AsString='审核通过' then begin t_op_seae.Edit; t_op_seae['经理审核状态']:='没有审核'; t_op_seae['经理审核人']:=''; t_op_seae['经理审核日期']:=null; t_op_seae['放单状态']:=''; t_op_seae.post; end; end; end else begin if t_op_seae.FieldByName('经理审核状态').AsString='审核通过' then begin t_op_seae.Edit; t_op_seae['经理审核状态']:='没有审核'; t_op_seae['经理审核人']:=''; t_op_seae['经理审核日期']:=null; t_op_seae['放单状态']:=''; t_op_seae.post; end; end; end; procedure Tfrm_op_seae_fangdan.bsSkinButton3Click(Sender: TObject); var i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if t_op_seae.FieldByName('财务审核状态').AsString<>'审核通过' then begin t_op_seae.Edit; t_op_seae['财务审核状态']:='审核通过'; t_op_seae['财务审核人']:=employee; t_op_seae['财务审核日期']:=DATE; if t_op_seae.FieldByName('经理审核状态').AsString='审核通过' then t_op_seae['放单状态']:='确认放单'; t_op_seae.post; end; end; end else begin if t_op_seae.FieldByName('财务审核状态').AsString<>'审核通过' then begin t_op_seae.Edit; t_op_seae['财务审核状态']:='审核通过'; t_op_seae['财务审核人']:=employee; t_op_seae['财务审核日期']:=DATE; if t_op_seae.FieldByName('经理审核状态').AsString='审核通过' then t_op_seae['放单状态']:='确认放单'; t_op_seae.post; end; end; end; procedure Tfrm_op_seae_fangdan.bsSkinButton4Click(Sender: TObject); var i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount>=1 then begin for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if t_op_seae.FieldByName('财务审核状态').AsString='审核通过' then begin t_op_seae.Edit; t_op_seae['财务审核状态']:='没有审核'; t_op_seae['财务审核日期']:=null; t_op_seae['财务审核人']:=''; t_op_seae['放单状态']:=''; t_op_seae.post; end; end; end else begin if t_op_seae.FieldByName('财务审核状态').AsString='审核通过' then begin t_op_seae.Edit; t_op_seae['财务审核状态']:='没有审核'; t_op_seae['财务审核人']:=''; t_op_seae['财务审核日期']:=null; t_op_seae['放单状态']:=''; t_op_seae.post; end; end; end; procedure Tfrm_op_seae_fangdan.dxDBGrid1DblClick(Sender: TObject); begin fee_view(t_op_seae.fieldbyname('编号').asstring); end; end.