unit u_op_seai_apply; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, Menus, DB, ADODB, bsSkinCtrls, u_op_card, u_fee, u_op_sate, bsdbctrls, StdCtrls, DBCtrls, RxLookup, wwdbdatetimepicker, Mask, wwdblook, ComCtrls, bsSkinTabs, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, ExtCtrls, XPMenu; type Tfrm_op_seai_apply = class(TForm) Panel2: TPanel; bsSkinButton7: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton38: TbsSkinButton; Notebook1: TNotebook; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridDateColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridDateColumn; dxDBGrid1Column20: TdxDBGridMaskColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridCheckColumn; dxDBGrid1Column26: TdxDBGridCheckColumn; dxDBGrid1Column27: TdxDBGridCheckColumn; dxDBGrid1Column28: TdxDBGridDateColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridMaskColumn; dxDBGrid1Column34: TdxDBGridMaskColumn; dxDBGrid1Column40: TdxDBGridMaskColumn; dxDBGrid1Column41: TdxDBGridMaskColumn; dxDBGrid1Column42: TdxDBGridMaskColumn; dxDBGrid1Column43: TdxDBGridMaskColumn; dxDBGrid1Column44: TdxDBGridMaskColumn; dxDBGrid1Column45: TdxDBGridMaskColumn; dxDBGrid1Column46: TdxDBGridMaskColumn; dxDBGrid1Column47: TdxDBGridColumn; dxDBGrid1Column48: TdxDBGridDateColumn; dxDBGrid1Column49: TdxDBGridDateColumn; dxDBGrid1Column50: TdxDBGridMaskColumn; dxDBGrid1Column51: TdxDBGridDateColumn; dxDBGrid1Column52: TdxDBGridDateColumn; dxDBGrid1Column53: TdxDBGridDateColumn; dxDBGrid1Column54: TdxDBGridDateColumn; dxDBGrid1Column55: TdxDBGridMaskColumn; dxDBGrid1Column56: TdxDBGridMaskColumn; dxDBGrid1Column57: TdxDBGridMaskColumn; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; Label125: TLabel; Label126: TLabel; Label15: TLabel; Label7: TLabel; Label124: TLabel; Label73: TLabel; Label19: TLabel; Label20: TLabel; Label42: TLabel; Label16: TLabel; Label6: TLabel; Label8: TLabel; Label10: TLabel; Label11: TLabel; Label13: TLabel; Label14: TLabel; Label18: TLabel; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label25: TLabel; Label26: TLabel; Label164: TLabel; Label27: TLabel; Label165: TLabel; Label166: TLabel; Label167: TLabel; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label39: TLabel; Label40: TLabel; Label41: TLabel; Label43: TLabel; Label44: TLabel; Label46: TLabel; wwDBLookupCombo49: TwwDBLookupCombo; DBEdit63: TDBEdit; wwDBDateTimePicker2: TwwDBDateTimePicker; wwDBLookupCombo3: TwwDBLookupCombo; wwDBLookupCombo52: TwwDBLookupCombo; RxDBLookupCombo20: TRxDBLookupCombo; RxDBLookupCombo12: TRxDBLookupCombo; RxDBLookupCombo29: TRxDBLookupCombo; RxDBLookupCombo30: TRxDBLookupCombo; RxDBLookupCombo14: TRxDBLookupCombo; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit12: TDBEdit; DBEdit13: TDBEdit; DBEdit14: TDBEdit; DBEdit15: TDBEdit; DBEdit16: TDBEdit; DBEdit17: TDBEdit; DBEdit19: TDBEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker3: TwwDBDateTimePicker; DBMemo39: TDBMemo; DBMemo2: TDBMemo; DBMemo40: TDBMemo; DBMemo41: TDBMemo; DBMemo42: TDBMemo; DBMemo1: TDBMemo; DBEdit81: TDBEdit; wwDBLookupCombo61: TwwDBLookupCombo; DBEdit20: TDBEdit; DBEdit21: TDBEdit; DBEdit22: TDBEdit; wwDBDateTimePicker4: TwwDBDateTimePicker; wwDBDateTimePicker5: TwwDBDateTimePicker; wwDBDateTimePicker6: TwwDBDateTimePicker; wwDBDateTimePicker7: TwwDBDateTimePicker; wwDBDateTimePicker8: TwwDBDateTimePicker; DBEdit23: TDBEdit; DBMemo3: TDBMemo; bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox; RxDBLookupCombo7: TRxDBLookupCombo; bsSkinTabSheet2: TbsSkinTabSheet; fra_op_state1: Tfra_op_state; bsSkinTabSheet3: TbsSkinTabSheet; fra_fee1: Tfra_fee; bsSkinTabSheet4: TbsSkinTabSheet; fra_op_card1: Tfra_op_card; bsSkinPanel1: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label37: TLabel; Label5: TLabel; Label38: TLabel; Label4: TLabel; Label65: TLabel; Label17: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit8: TDBEdit; DBEdit4: TDBEdit; DBEdit9: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; DBEdit18: TDBEdit; RxDBLookupCombo13: TRxDBLookupCombo; t_op_seai: TADOQuery; t_op_seai1: TDataSource; t_ch_fee: TADOQuery; PopupMenu3: TPopupMenu; N37: TMenuItem; N38: TMenuItem; N62: TMenuItem; N25: TMenuItem; N64: TMenuItem; N63: TMenuItem; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; DBEdit11: TDBEdit; bsSkinPanel2: TbsSkinPanel; Label48: TLabel; Edit1: TEdit; Label50: TLabel; Edit2: TEdit; Label47: TLabel; Edit3: TEdit; Label45: TLabel; Edit4: TEdit; Label57: TLabel; Edit5: TEdit; Label58: TLabel; Edit6: TEdit; Label54: TLabel; RxDBLookupCombo4: TRxDBLookupCombo; Label56: TLabel; RxDBLookupCombo5: TRxDBLookupCombo; Label49: TLabel; wwDBDateTimePicker9: TwwDBDateTimePicker; Label52: TLabel; wwDBDateTimePicker12: TwwDBDateTimePicker; Label51: TLabel; wwDBDateTimePicker11: TwwDBDateTimePicker; Label53: TLabel; wwDBDateTimePicker13: TwwDBDateTimePicker; bsSkinButton8: TbsSkinButton; bsSkinButton12: TbsSkinButton; bsSkinButton13: TbsSkinButton; dxDBGrid1Column58: TdxDBGridColumn; dxDBGrid1Column59: TdxDBGridColumn; dxDBGrid1Column60: TdxDBGridColumn; dxDBGrid1Column61: TdxDBGridColumn; Label36: TLabel; DBEdit7: TDBEdit; Button1: TButton; Button2: TButton; dxDBGrid1Column62: TdxDBGridColumn; t_op_seai_danwei: TADOQuery; t_op_seai_danwei1: TDataSource; wwDBLookupCombo1: TwwDBLookupCombo; RxDBLookupCombo33: TRxDBLookupCombo; Label81: TLabel; RxDBLookupCombo32: TRxDBLookupCombo; Label80: TLabel; Label12: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label55: TLabel; DBEdit10: TDBEdit; bsSkinButton14: TbsSkinButton; PopupMenu1: TPopupMenu; N1: TMenuItem; Label9: TLabel; RxDBLookupCombo3: TRxDBLookupCombo; Label61: TLabel; RxDBLookupCombo31: TRxDBLookupCombo; bsSkinSpeedButton1: TbsSkinSpeedButton; dxDBGrid1Column63: TdxDBGridColumn; RxDBLookupCombo8: TRxDBLookupCombo; Label59: TLabel; DBEdit24: TDBEdit; dxDBGrid1Column64: TdxDBGridColumn; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; dxDBGrid1Column65: TdxDBGridCheckColumn; bsSkinDBCheckRadioBox16: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox18: TbsSkinDBCheckRadioBox; Label112: TLabel; RxDBLookupCombo43: TRxDBLookupCombo; Label111: TLabel; DBEdit40: TDBEdit; Label60: TLabel; DBEdit25: TDBEdit; Label62: TLabel; RxDBLookupCombo6: TRxDBLookupCombo; Label83: TLabel; DBEdit26: TDBEdit; procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Panel2Resize(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton38Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); procedure t_op_seaiBeforeCancel(DataSet: TDataSet); procedure t_op_seaiBeforeDelete(DataSet: TDataSet); procedure t_op_seaiBeforeEdit(DataSet: TDataSet); procedure t_op_seaiBeforePost(DataSet: TDataSet); procedure t_op_seaiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure N37Click(Sender: TObject); procedure N62Click(Sender: TObject); procedure N64Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure DBEdit1KeyPress(Sender: TObject; var Key: Char); procedure DBEdit2KeyPress(Sender: TObject; var Key: Char); procedure DBEdit3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit4KeyPress(Sender: TObject; var Key: Char); procedure DBEdit18KeyPress(Sender: TObject; var Key: Char); procedure DBEdit9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit5KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); procedure DBEdit8KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit81KeyPress(Sender: TObject; var Key: Char); procedure DBEdit6KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo49KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); procedure DBEdit11KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); procedure DBEdit12KeyPress(Sender: TObject; var Key: Char); procedure DBEdit13KeyPress(Sender: TObject; var Key: Char); procedure DBEdit14KeyPress(Sender: TObject; var Key: Char); procedure DBEdit15KeyPress(Sender: TObject; var Key: Char); procedure DBEdit16KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo61KeyPress(Sender: TObject; var Key: Char); procedure DBEdit20KeyPress(Sender: TObject; var Key: Char); procedure DBEdit21KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker8KeyPress(Sender: TObject; var Key: Char); procedure DBEdit23KeyPress(Sender: TObject; var Key: Char); procedure DBEdit63KeyPress(Sender: TObject; var Key: Char); procedure DBEdit17KeyPress(Sender: TObject; var Key: Char); procedure DBEdit19KeyPress(Sender: TObject; var Key: Char); procedure DBEdit22KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker4KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker5KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker6KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker7KeyPress(Sender: TObject; var Key: Char); procedure DBEdit7KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1Enter(Sender: TObject); procedure RxDBLookupCombo1Exit(Sender: TObject); procedure RxDBLookupCombo2Exit(Sender: TObject); procedure RxDBLookupCombo2Enter(Sender: TObject); procedure RxDBLookupCombo7Enter(Sender: TObject); procedure RxDBLookupCombo7Exit(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton14Click(Sender: TObject); procedure N1Click(Sender: TObject); procedure RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); procedure DBEdit10KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo1Change(Sender: TObject); procedure bsSkinSpeedButton1Click(Sender: TObject); procedure RxDBLookupCombo6Enter(Sender: TObject); procedure RxDBLookupCombo6Exit(Sender: TObject); procedure RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); 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 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 RxDBLookupCombo8Change(Sender: TObject); procedure RxDBLookupCombo1Change(Sender: TObject); procedure Notebook1PageChanged(Sender: TObject); procedure DBEdit26Click(Sender: TObject); private { Private declarations } procedure setconcolor; public { Public declarations } end; var frm_op_seai_apply: Tfrm_op_seai_apply; implementation uses my_sys_function, u_main, u_sys_progress, u_data_share, u_op_seai_apply_add, u_op_add_code, u_op_date_change, u_op_ctn; {$R *.dfm} procedure Tfrm_op_seai_apply.setconcolor; procedure consetcolor(fielname:String); var i:integer; scolor:string; begin scolor:=get_parameters_value(144,'clInfoBk'); with bsSkinTabSheet1 do begin for i:=0 to ControlCount-1 do begin if Controls[i] is TDBEdit then begin if TDBEdit(Controls[i]).DataField=fielname then begin TDBEdit(Controls[i]).Color:=StringToColor(scolor); exit; end; end else if Controls[i] is TwwDBDateTimePicker then begin if TwwDBDateTimePicker(Controls[i]).DataField=fielname then begin TwwDBDateTimePicker(Controls[i]).Color:=StringToColor(scolor); exit; end; end else if Controls[i] is TDBMemo then begin if TDBMemo(Controls[i]).DataField=fielname then begin TDBMemo(Controls[i]).Color:=StringToColor(scolor); exit; end; end else if Controls[i] is TwwDBLookupCombo then begin if TwwDBLookupCombo(Controls[i]).DataField=fielname then begin TwwDBLookupCombo(Controls[i]).Color:=StringToColor(scolor); exit; end; end; end; end; with bsSkinPanel1 do begin for i:=0 to ControlCount-1 do begin if Controls[i] is TDBEdit then begin if TDBEdit(Controls[i]).DataField=fielname then begin TDBEdit(Controls[i]).Color:=StringToColor(scolor); exit; end; end else if Controls[i] is TwwDBLookupCombo then begin if TwwDBLookupCombo(Controls[i]).DataField=fielname then begin TwwDBLookupCombo(Controls[i]).Color:=StringToColor(scolor); exit; end; end; end; end; end; begin //必填项设置不能颜色 frm_data_share.t_code_empty.Filtered:=false; frm_data_share.t_code_empty.Filter:='表=''t_op_seai'''; frm_data_share.t_code_empty.Filtered:=true; frm_data_share.t_code_empty.First; while not frm_data_share.t_code_empty.Eof do begin if (frm_data_share.t_code_empty.fieldbyname('字段名称').asstring='分提单号') or (frm_data_share.t_code_empty.fieldbyname('字段名称').asstring='分提单号') then begin if t_op_seai1.DataSet.FindField('装运方式')<>nil then begin if pos('主票',t_op_seai1.DataSet.FieldByName('装运方式').asstring)>0 then begin end else begin consetcolor(frm_data_share.t_code_empty.fieldbyname('字段名称').asstring); end; end else begin consetcolor(frm_data_share.t_code_empty.fieldbyname('字段名称').asstring); end; end else begin consetcolor(frm_data_share.t_code_empty.fieldbyname('字段名称').asstring); end; frm_data_share.t_code_empty.next; end; end; procedure Tfrm_op_seai_apply.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seai_apply.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_op_seai_apply.Hide; frm_op_seai_apply.ManualFloat(frm_op_seai_apply.BoundsRect ); frm_main.freeTabs('frm_op_seai_apply'); action:=cafree; frm_op_seai_apply:=nil; end; procedure Tfrm_op_seai_apply.Panel2Resize(Sender: TObject); var i:integer; begin i:=round(Panel2.Width/12); bsSkinButton7.Width:=i; bsSkinButton6.Width:=i; bsSkinButton9.Width:=i; bsSkinButton10.Width:=i; bsSkinButton1.Width:=i; bsSkinButton11.Width:=i; bsSkinButton14.Width:=i; bsSkinButton2.Width:=i; bsSkinButton4.Width:=i; bsSkinButton3.Width:=i; bsSkinButton38.Width:=i; end; procedure Tfrm_op_seai_apply.bsSkinButton7Click(Sender: TObject); begin table_Prior(t_op_seai); end; procedure Tfrm_op_seai_apply.bsSkinButton6Click(Sender: TObject); begin table_next(t_op_seai); end; procedure Tfrm_op_seai_apply.bsSkinButton2Click(Sender: TObject); begin table_post(t_op_seai); end; procedure Tfrm_op_seai_apply.bsSkinButton9Click(Sender: TObject); begin sys_print('海运进口报关报检',2,t_op_seai1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_seai_apply.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end else begin if (t_op_seai.State=dsinsert)or(t_op_seai.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_seai.post; end; if answer=mrNo then begin t_op_seai.cancel; end; if answer=mrCancel then begin exit; end; END; Notebook1.PageIndex:=0; bsSkinButton11.Caption:='编辑修改'; end; end; procedure Tfrm_op_seai_apply.bsSkinButton4Click(Sender: TObject); begin t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_seai.fieldbyname('编号').asstring; t_ch_fee.open; if not t_ch_fee.IsEmpty then begin showmessage('对不起业务存在费用信息,不能删除!!'); exit; end; table_delete(t_op_seai); end; procedure Tfrm_op_seai_apply.bsSkinButton3Click(Sender: TObject); begin table_cancel(t_op_seai); end; procedure Tfrm_op_seai_apply.bsSkinButton38Click(Sender: TObject); var book1:Tbookmark; begin book1:=t_op_seai.GetBookmark; t_op_seai.Refresh; t_op_seai.GotoBookmark(book1); end; procedure Tfrm_op_seai_apply.bsSkinButton13Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seai_apply.t_op_seaiBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_seai); if t_op_seai.State=dsinsert then if not t_op_seai.FieldByName('委托编号').IsNull then delwtno(t_op_seai['委托编号']); end; procedure Tfrm_op_seai_apply.t_op_seaiBeforeDelete(DataSet: TDataSet); begin op_befor_post(t_op_seai,'0002'); delete_add(2,t_op_seai); if not t_op_seai.FieldByName('委托编号').IsNull then delwtno(t_op_seai['委托编号']); end; procedure Tfrm_op_seai_apply.t_op_seaiBeforeEdit(DataSet: TDataSet); begin op_befor_post(t_op_seai,'0002'); end; procedure Tfrm_op_seai_apply.t_op_seaiBeforePost(DataSet: TDataSet); var aQuery:TAdoQuery; str:String; begin table_before_post(t_op_seai,'委托单位'); table_before_post(t_op_seai,'操作员'); table_before_post(t_op_seai,'揽货人'); table_before_post(t_op_seai,'客服员'); table_before_post(t_op_seai,'进口日期'); table_before_post(t_op_seai,'销售部门'); table_before_post(t_op_seai,'操作部门'); if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then if t_op_seai.FieldByName('委托编号').IsNull or (trim(t_op_seai['委托编号'])='') then if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_seai['委托编号']:=getwtno(2,subComp,department,employee,t_op_seai['会计期间']) else t_op_seai['委托编号']:=getwtno(2,subComp,department,employee,t_op_seai['进口日期']); if op_empty('t_op_seai',t_op_seai) then abort; if t_op_seai.fieldbyname('进口日期').oldvalue<>t_op_seai.fieldbyname('进口日期').asdatetime then if (t_op_seai.fieldbyname('业务类型').asstring<>'更改单') and (Logininfo.endday>=t_op_seai.fieldbyname('进口日期').asdatetime) then begin showmessage('此进口日期所在期间已月末结账,不能添加修改业务!!'); abort; end; if t_op_seai.FieldByName('委托单位').OldValue<>t_op_seai.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_seai.FieldByName('委托单位').asstring,[])then begin if frm_data_share.t_crm_client_all.fieldbyname('客户状态').asstring='封存客户'then begin showmessage('当前业务委托单位已经封存,不能再进行业务合作,如需合作请进行恢复客户操作!'); abort; end; end; end; if t_op_seai.State=dsinsert then begin if t_op_seai.fieldbyname('业务编号').asstring=''then begin t_op_seai['业务编号']:=get_no(t_op_seai.fieldbyname('会计期间').AsDateTime,getbsno(Logininfo.CustomImp,'BI')); t_op_seai['编号']:=get_id; end; t_op_seai['主编号']:=t_op_seai['编号']; t_op_seai['业务状态']:='接受委托'; // t_op_seai['费用状态']:='录入状态'; end; if strtobool(get_parameters_value(34,'false')) then begin if (t_op_seai.fieldbyname('主提单号').asstring='') or ((not strtobool(get_parameters_value(151,'false'))) and (t_op_seai.fieldbyname('装运方式').asstring='报关')) then begin t_op_seai['主提单标准']:=t_op_seai['编号']; end else begin t_op_seai['主提单标准']:=t_op_seai['主提单号']; end; end else begin t_op_seai['主提单标准']:=t_op_seai['编号']; end; if strtobool(get_parameters_value(35,'false')) then begin if (t_op_seai.fieldbyname('分提单号').asstring='') or ((not strtobool(get_parameters_value(151,'false'))) and (t_op_seai.fieldbyname('装运方式').asstring='报关')) then begin t_op_seai['分提单标准']:=t_op_seai['编号']; end else begin t_op_seai['分提单标准']:=t_op_seai['分提单号']; end; end else begin t_op_seai['分提单标准']:=t_op_seai['编号']; end; if strtobool(get_parameters_value(36,'false')) then begin if (t_op_seai.fieldbyname('委托编号').asstring='') or ((not strtobool(get_parameters_value(151,'false'))) and (t_op_seai.fieldbyname('装运方式').asstring='报关')) then begin t_op_seai['委托标准']:=t_op_seai['编号']; end else begin t_op_seai['委托标准']:=t_op_seai['委托编号']; end; end else begin t_op_seai['委托标准']:=t_op_seai['编号']; end; if strtobool(get_parameters_value(60,'false')) then begin if (trim(t_op_seai.fieldbyname('报关单号').asstring)='') or ((not strtobool(get_parameters_value(151,'false'))) and (t_op_seai.fieldbyname('装运方式').asstring='报关')) then begin t_op_seai['报关标准']:=t_op_seai['编号']; end else begin t_op_seai['报关标准']:=t_op_seai['报关单号']; end; end else begin t_op_seai['报关标准']:=t_op_seai['编号']; end; if strtobool(get_parameters_value(61,'false')) then begin if (trim(t_op_seai.fieldbyname('报检单号').asstring)='') or ((not strtobool(get_parameters_value(151,'false'))) and (t_op_seai.fieldbyname('装运方式').asstring='报关')) then begin t_op_seai['报检标准']:=t_op_seai['编号']; end else begin t_op_seai['报检标准']:=t_op_seai['报检单号']; end; end else begin t_op_seai['报检标准']:=t_op_seai['编号']; end; if t_op_seai.fieldbyname('发票号').AsString<>'' then begin if t_op_seai.fieldbyname('发票号').OldValue<>t_op_seai.fieldbyname('发票号').NewValue then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; SQL.Add('select 编号 from t_op_seai where 发票号='''+t_op_seai.fieldbyname('发票号').AsString+''' and 编号<>'''+t_op_seai['编号']+''''); Open; if not IsEmpty then begin str:='select * from t_op_seai where 发票号='+''''+t_op_seai['发票号']+''''; double_seai(str,6); end; end; finally FreeAndNil(aQuery); end; end; end; end; procedure Tfrm_op_seai_apply.t_op_seaiPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); var str:widestring; begin if pos('SOME VALUES MAY HAVE BEEN CHANGED',UpperCase(E.Message))<>0 then begin showmessage('数据已经被其它用户修改,当前修改不能保存'+#13#10+'请刷新数据后重新录入'); abort; end; if pos('主提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seai where 主提单标准='+''''+t_op_seai['主提单标准']+''''; double_seai(str,1); abort; end; if pos('分提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seai where 分提单标准='+''''+t_op_seai['分提单标准']+''''; double_seai(str,2); abort; end; if pos('委托标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seai where 委托标准='+''''+t_op_seai['委托标准']+''''; double_seai(str,3); abort; end; if pos('报关标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seai where 报关标准='+''''+t_op_seai['报关标准']+''''; double_seae(str,4); abort; end; if pos('报检标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seai where 报检标准='+''''+t_op_seai['报检标准']+''''; double_seae(str,5); abort; end; end; procedure Tfrm_op_seai_apply.N37Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_op_state where 是否完成<>1) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_op_seai_apply.N62Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' 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_op_seai_apply.N64Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' 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_op_seai_apply.N17Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+') ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_op_seai_apply.N34Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_op_seai_apply.N36Click(Sender: TObject); begin t_op_seai.Close; t_op_seai.sql.clear; t_op_seai.sql.text:='select * from t_op_seai where ' +open_data('0002','揽货人','操作员','客服员','报关操作','报检操作') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) ' +default_sort(54,'t_op_seai','','desc'); t_op_seai.open; end; procedure Tfrm_op_seai_apply.FormShow(Sender: TObject); begin Notebook1.PageIndex:=0; if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(self); frm_sys_progress.bsSkinGauge1.ProgressText:='加载数据请等候。。。'; frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=28; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; bsSkinDBCheckRadioBox4.visible:=strtobool(get_parameters_value(160,'false')); if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then begin DBEdit8.Width:=110; bsSkinSpeedButton1.Visible:=false; if frm_data_share.t_sys_noset.fieldbyname('是否允许手动编辑').AsBoolean then begin DBEdit8.ReadOnly:=false; end else begin DBEdit8.ReadOnly:=true; end; end else if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动取号' then begin DBEdit8.Width:=90; bsSkinSpeedButton1.Visible:=true; if frm_data_share.t_sys_noset.fieldbyname('是否允许手动编辑').AsBoolean then begin DBEdit8.ReadOnly:=false; end else begin DBEdit8.ReadOnly:=true; end; end else if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动编辑' then begin DBEdit8.ReadOnly:=false; DBEdit8.Width:=110; bsSkinSpeedButton1.Visible:=false; end; t_op_seai.Close; t_op_seai.SQL.clear; t_op_seai.SQL.Add('select top 100 * from t_op_seai where ' +'(录入人='+''''+employee+''''+' or 操作员='+''''+employee+'''' +' or 客服员='+''''+employee+''''+' or 报关操作='+''''+employee+'''' +' or 报检操作='+''''+employee+''''+')' +default_sort(54,'t_op_seai','','desc')); t_op_seai.open; t_op_seai_danwei.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_card1.t_op_card.DataSource:=t_op_seai1; fra_op_card1.t_op_card.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; loadreggrid(dxdbgrid1,false,caption); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; if if_open('295') or if_open('296') then begin fra_fee1.edit_type.text:='2'; fra_fee1.baoguan.text:='1'; fra_fee1.edit_data.text:='0002'; fra_fee1.edit_report.text:='海运进口'; fra_fee1.t_ch_accept.DataSource:=t_op_seai1; if strtobool(get_parameters_value(150,'false')) then fra_fee1.bsSkinPanel3.Visible:=true; fra_fee1.DBEdit48.DataSource:=t_op_seai1; if if_open('295') then begin fra_fee1.t_ch_accept.DataSource:=t_op_seai1; if (strtobool(get_parameters_value(153,'false'))=true) then begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('207')=false) then begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) and '+open_data('7000','录入人','no','no','no','no') +' order by 顺序,CH_ID'); end else begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+''''+' and 编号=:编号 and ' +open_data('7000','录入人','no','no','no','no') +' order by 顺序,CH_ID'); end; fra_fee1.t_ch_accept.open; end else begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('207')=false) then begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) order by 顺序,CH_ID'); end; fra_fee1.t_ch_accept.open; end; fra_fee1.a_shen_delete.open; fra_fee1.a_shen_modify_old.open; fra_fee1.a_shen_modify_new.open; fra_fee1.Panel3.visible:=true; end else fra_fee1.Panel3.visible:=false; if if_open('296') then begin fra_fee1.t_ch_pay.DataSource:=t_op_seai1; if (strtobool(get_parameters_value(153,'false'))=true) then begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('207')=false) then begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee where 类型=' +''''+'付'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) and '+open_data('7000','录入人','no','no','no','no') +' order by 顺序,CH_ID'); end else begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee where 类型=' +''''+'付'+''''+' and 编号=:编号 and ' +open_data('7000','录入人','no','no','no','no') +' order by 顺序,CH_ID'); end; fra_fee1.t_ch_pay.open; end else begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('207')=false) then begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee where 类型=' +''''+'付'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) order by 顺序,CH_ID'); end; fra_fee1.t_ch_pay.open; end; fra_fee1.p_shen_delete.open; fra_fee1.p_shen_modify_old.open; fra_fee1.p_shen_modify_new.open; fra_fee1.Panel1.visible:=true; end else fra_fee1.Panel1.visible:=false; if fra_fee1.Panel1.visible and fra_fee1.Panel3.visible then begin if if_open('254') then begin fra_fee1.Panel8.Visible:=true; fra_fee1.Panel8.Height:=20; end else fra_fee1.Panel8.Visible:=false; fra_fee1.t_op_gain.DataSource:=t_op_seai1; fra_fee1.t_op_gain.open; fra_fee1.Panel9.Visible:=false; end else begin fra_fee1.Panel8.Visible:=false; end; end else begin fra_fee1.Visible:=false; end; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_state1.edit_state.Text:='2'; fra_op_state1.t_op_state.DataSource:=t_op_seai1; fra_op_state1.t_op_state.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.close; frm_sys_progress:=nil; end; procedure Tfrm_op_seai_apply.bsSkinButton1Click(Sender: TObject); begin if t_op_seai=nil then exit; if (t_op_seai.State=dsinsert)or(t_op_seai.State=dsedit) then t_op_seai.post; try frm_op_seai_apply_add:=tfrm_op_seai_apply_add.Create (self); frm_op_seai_apply_add.data1.Enabled:=false; frm_op_seai_apply_add.data1.DataSet:=t_op_seai; frm_op_seai_apply_add.data1.Enabled:=true; frm_op_seai_apply_add.ShowModal; finally frm_op_seai_apply_add.Free; if not frm_op_seai_apply.bsSkinTabSheet1.Showing then frm_op_seai_apply.bsSkinTabSheet1.Show; frm_op_seai_apply_add:=nil; end; end; procedure Tfrm_op_seai_apply.bsSkinButton10Click(Sender: TObject); begin query_seai(10,'0002'); end; procedure Tfrm_op_seai_apply.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seai_apply.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seai_apply.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,102); end; procedure Tfrm_op_seai_apply.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seai_apply.bsSkinButton8Click(Sender: TObject); VAR str:widestring; begin str:='where '+open_data('0002','录入人','操作员','客服员','报关操作','报检操作'); if Edit1.text<>''then str:=str+' and 报关单号 like '+''''+'%'+Edit1.text+'%'+''''; if Edit2.text<>''then str:=str+' and 报检单号 like '+''''+'%'+Edit2.text+'%'+''''; if Edit3.text<>''then str:=str+' and 主提单号 like '+''''+'%'+Edit3.text+'%'+''''; if Edit4.text<>''then str:=str+' and 经营单位 like '+''''+'%'+Edit4.text+'%'+''''; if Edit5.text<>''then str:=str+' and 发票号 like '+''''+'%'+Edit5.text+'%'+''''; if Edit6.text<>''then str:=str+' and 手册号 like '+''''+'%'+Edit6.text+'%'+''''; if RxDBLookupCombo4.DisplayValue<>''then str:=str+' and 委托单位='+''''+RxDBLookupCombo4.DisplayValues[1]+''''; if RxDBLookupCombo5.DisplayValue<>''then str:=str+' and 收货人='+''''+RxDBLookupCombo5.DisplayValues[1]+''''; if wwDBDateTimePicker9.text<>''then str:=str+' and 报关日期>='+''''+wwDBDateTimePicker9.text+''''; if wwDBDateTimePicker12.text<>''then str:=str+' and 报关日期<='+''''+wwDBDateTimePicker12.text+''''; if wwDBDateTimePicker11.text<>''then str:=str+' and 报检日期>='+''''+wwDBDateTimePicker11.text+''''; if wwDBDateTimePicker13.text<>''then str:=str+' and 报检日期<='+''''+wwDBDateTimePicker13.text+''''; t_op_seai.close; t_op_seai.sql.clear; t_op_seai.sql.add('select * from t_op_seai '+str+' order by 业务编号'); t_op_seai.open; end; procedure Tfrm_op_seai_apply.bsSkinButton12Click(Sender: TObject); begin Edit1.text:=''; Edit2.text:=''; Edit3.text:=''; Edit4.text:=''; Edit5.text:=''; Edit6.text:=''; RxDBLookupCombo4.ClearValue; RxDBLookupCombo5.ClearValue; wwDBDateTimePicker9.text:=''; wwDBDateTimePicker12.text:=''; wwDBDateTimePicker11.text:=''; wwDBDateTimePicker13.text:=''; end; procedure Tfrm_op_seai_apply.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit2); end; procedure Tfrm_op_seai_apply.DBEdit2KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit3); end; procedure Tfrm_op_seai_apply.DBEdit3KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit4); end; procedure Tfrm_op_seai_apply.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit18); end; procedure Tfrm_op_seai_apply.DBEdit18KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_op_seai_apply.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit10); end; procedure Tfrm_op_seai_apply.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo20); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo31); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit8); end; procedure Tfrm_op_seai_apply.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit9); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo3); end; procedure Tfrm_op_seai_apply.wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); // key_wwDBLookupCombo(Key,wwDBLookupCombo52); end; procedure Tfrm_op_seai_apply.DBEdit81KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo61); end; procedure Tfrm_op_seai_apply.DBEdit6KeyPress(Sender: TObject; var Key: Char); var aQuery:TAdoQuery; begin if (key=#13) and (t_op_seai.State in [dsedit,dsinsert]) and (t_op_seai.FieldByName('经营单位').AsString='') then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; SQL.Add('select 客户全称,客户简称 from t_crm_client where 海关编码='''+DBEdit6.Text+''''); Open; if not IsEmpty then begin if fieldbyname('客户全称').AsString<>'' then t_op_seai.FieldByName('经营单位').AsString:=fieldbyname('客户全称').AsString else t_op_seai.FieldByName('经营单位').AsString:=fieldbyname('客户简称').AsString; end; end; finally FreeAndNil(aQuery); end; end; key_RxDBLookupCombo(Key,RxDBLookupCombo7); end; procedure Tfrm_op_seai_apply.wwDBLookupCombo49KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit63); end; procedure Tfrm_op_seai_apply.wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit11); end; procedure Tfrm_op_seai_apply.DBEdit11KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit5); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); begin // key_RxDBLookupCombo(Key,RxDBLookupCombo6); key_wwDBLookupCombo(Key,wwDBLookupCombo1); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit12); end; procedure Tfrm_op_seai_apply.DBEdit12KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit13); end; procedure Tfrm_op_seai_apply.DBEdit13KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit14); end; procedure Tfrm_op_seai_apply.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit15); end; procedure Tfrm_op_seai_apply.DBEdit15KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit16); end; procedure Tfrm_op_seai_apply.DBEdit16KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit17); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit19); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit81); end; procedure Tfrm_op_seai_apply.wwDBLookupCombo61KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit20); end; procedure Tfrm_op_seai_apply.DBEdit20KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit21); end; procedure Tfrm_op_seai_apply.DBEdit21KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit22); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker8KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit23); end; procedure Tfrm_op_seai_apply.DBEdit23KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit7); end; procedure Tfrm_op_seai_apply.DBEdit63KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker2); end; procedure Tfrm_op_seai_apply.DBEdit17KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker1); end; procedure Tfrm_op_seai_apply.DBEdit19KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker3); end; procedure Tfrm_op_seai_apply.DBEdit22KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker4); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker4KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker5); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker5KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker6); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker6KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker7); end; procedure Tfrm_op_seai_apply.wwDBDateTimePicker7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker8); end; procedure Tfrm_op_seai_apply.DBEdit7KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo39); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo1Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo1); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo1Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo1); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo2Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo2); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo2Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo2); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo7Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo7); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo7Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo7); end; procedure Tfrm_op_seai_apply.Button1Click(Sender: TObject); begin if t_op_seai.isempty then exit; try frm_op_add_code:=tfrm_op_add_code.Create (self); frm_op_add_code_num:=3; frm_op_add_code.caption:='实验内容选择'; frm_op_add_code.ShowModal; finally frm_op_add_code.Free; frm_op_add_code:=nil; end; end; procedure Tfrm_op_seai_apply.Button2Click(Sender: TObject); begin if t_op_seai.isempty then exit; try frm_op_add_code:=tfrm_op_add_code.Create (self); frm_op_add_code_num:=4; frm_op_add_code.caption:='单证信息选择'; frm_op_add_code.ShowModal; finally frm_op_add_code.Free; frm_op_add_code:=nil; end; end; procedure Tfrm_op_seai_apply.wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit6); end; procedure Tfrm_op_seai_apply.bsSkinButton14Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton14.ClientToScreen(Point(0,bsSkinButton14.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seai_apply.N1Click(Sender: TObject); begin if t_op_seai1.DataSet.IsEmpty then exit; if not do_data('0001',t_op_seai1.DataSet.FieldByName('录入人').asstring ,t_op_seai1.DataSet.FieldByName('操作员').asstring ,t_op_seai1.DataSet.FieldByName('揽货人').asstring ,t_op_seai1.DataSet.FieldByName('客服员').asstring ,t_op_seai1.DataSet.FieldByName('报关操作').asstring ,t_op_seai1.DataSet.FieldByName('报检操作').asstring) then begin showmessage('对不起你无权修改此数据!'); abort; end; if t_op_seai1.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_seai1.DataSet=nil then exit; if (t_op_seai1.DataSet.State=dsinsert)or(t_op_seai1.DataSet.State=dsedit) then t_op_seai1.DataSet.post; try frm_op_date_change:=tfrm_op_date_change.Create (self); frm_op_date_change.DataSource1.Enabled:=false; frm_op_date_change.DataSource1.DataSet:=t_op_seai1.DataSet; frm_op_date_change.DataSource1.Enabled:=true; frm_op_date_change.ShowModal; finally frm_op_date_change.Free; frm_op_date_change:=nil; end; end; procedure Tfrm_op_seai_apply.RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo13); end; procedure Tfrm_op_seai_apply.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo49); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit11); end; procedure Tfrm_op_seai_apply.wwDBLookupCombo1Change(Sender: TObject); var aQuery:TAdoQuery; begin if (t_op_seai.State in [dsedit,dsinsert]) then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; SQL.Add('select 海关编码 from t_crm_client where 客户全称 like ''%'+wwDBLookupCombo1.Text+'%'' or 客户简称 like ''%'+wwDBLookupCombo1.Text+'%'''); Open; if not IsEmpty then begin if t_op_seai.FieldByName('单位代码').AsString='' then t_op_seai.FieldByName('单位代码').AsString:=fieldbyname('海关编码').AsString end; end; finally FreeAndNil(aQuery); end; end; end; procedure Tfrm_op_seai_apply.bsSkinSpeedButton1Click(Sender: TObject); begin if (t_op_seai1.DataSet.FieldByName('委托编号').IsNull) or (t_op_seai1.DataSet['委托编号']='') then begin t_op_seai1.DataSet.edit; if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_seai1.DataSet['委托编号']:=getwtno(2,subComp,department,employee,t_op_seai1.DataSet['会计期间']) else t_op_seai1.DataSet['委托编号']:=getwtno(2,subComp,department,employee,t_op_seai1.DataSet['进口日期']); end; end; procedure Tfrm_op_seai_apply.RxDBLookupCombo6Enter(Sender: TObject); begin //RxLookupComboEnter(RxDBLookupCombo6); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo6Exit(Sender: TObject); begin //RxLookupComboExit(RxDBLookupCombo6); end; procedure Tfrm_op_seai_apply.RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit6); end; procedure Tfrm_op_seai_apply.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_seai_apply.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_seai_apply.RxDBLookupCombo8Change(Sender: TObject); begin if t_op_seai1.DataSet=nil then exit; if frm_data_share.t_crm_client_all.Locate('客户简称',RxDBLookupCombo8.DisplayValues[1],[])then begin if t_op_seai1.DataSet.State in [dsinsert,dsedit] then t_op_seai1.DataSet['经营单位']:=frm_data_share.t_crm_client_all.fieldbyname('客户全称').asstring else begin t_op_seai1.DataSet.edit; t_op_seai1.DataSet['经营单位']:=frm_data_share.t_crm_client_all.fieldbyname('客户全称').asstring end; end; end; procedure Tfrm_op_seai_apply.RxDBLookupCombo1Change(Sender: TObject); begin if t_op_seai1.DataSet=nil then exit; if t_op_seai1.DataSet.State in [dsinsert,dsedit] then begin if frm_data_share.t_crm_client_weituo.Locate('客户简称',RxDBLookupCombo1.DisplayValues[1],[])then begin t_op_seai1.DataSet['经营单位']:=frm_data_share.t_crm_client_weituo.fieldbyname('客户全称').asstring; end; if frm_data_share.t_crm_client_weituo.fieldbyname('揽货人').asstring<>''then begin t_op_seai1.DataSet['揽货人']:=frm_data_share.t_crm_client_weituo.fieldbyname('揽货人').asstring; if frm_data_share.t_sys_employee.Locate('姓名',t_op_seai1.DataSet['揽货人'],[])then begin t_op_seai1.DataSet['销售部门']:=frm_data_share.t_sys_employee.fieldbyname('部门名称').asstring end; end; end; end; procedure Tfrm_op_seai_apply.Notebook1PageChanged(Sender: TObject); begin setconcolor; end; procedure Tfrm_op_seai_apply.DBEdit26Click(Sender: TObject); begin try frm_op_ctn:=tfrm_op_ctn.Create (self); frm_op_ctn.t_op_ctn.DataSource:=t_op_seai1; frm_op_ctn_type:=true; op_ctn_limited:='0002'; frm_op_ctn.ShowModal; finally frm_op_ctn.Free; end; end; end.