unit u_op_airtruck; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, ExtCtrls, XPMenu, Menus, DB, ADODB, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, RxLookup, StdCtrls, Mask, DBCtrls, ComCtrls, bsSkinTabs, u_op_sate, u_fee, wwdbdatetimepicker, wwdbedit, Wwdotdot, Wwdbcomb, u_op_letter_free, wwdblook, bsdbctrls, Grids, DBGridEh, Wwdbigrd, Wwdbgrid, u_op_card,IniFiles; type Tfrm_op_airtruck = class(TForm) Panel2: TPanel; bsSkinButton7: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; Notebook1: TNotebook; t_op_airtruck: TADOQuery; t_op_airtruck1: TDataSource; PopupMenu1: TPopupMenu; N31: TMenuItem; t_ch_fee: TADOQuery; XPMenu1: TXPMenu; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridDateColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column21: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridDateColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridColumn; bsSkinPanel1: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label17: TLabel; Label3: TLabel; Label37: TLabel; Label5: TLabel; Label38: TLabel; Label4: TLabel; Label36: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; RxDBLookupCombo13: TRxDBLookupCombo; DBEdit3: TDBEdit; DBEdit8: TDBEdit; DBEdit4: TDBEdit; DBEdit9: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; DBEdit7: TDBEdit; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; fra_fee1: Tfra_fee; fra_op_state1: Tfra_op_state; Label85: TLabel; Label86: TLabel; Label10: TLabel; RxDBLookupCombo7: TRxDBLookupCombo; Label96: TLabel; DBEdit30: TDBEdit; DBEdit31: TDBEdit; Label97: TLabel; wwDBDateTimePicker2: TwwDBDateTimePicker; Label25: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; Label6: TLabel; Label164: TLabel; RxDBLookupCombo11: TRxDBLookupCombo; Label23: TLabel; RxDBLookupCombo8: TRxDBLookupCombo; Label110: TLabel; DBMemo18: TDBMemo; Label111: TLabel; DBMemo19: TDBMemo; dxDBGrid1Column27: TdxDBGridColumn; Label13: TLabel; wwDBComboBox3: TwwDBComboBox; Label65: TLabel; DBEdit18: TDBEdit; dxDBGrid1Column28: TdxDBGridColumn; bsSkinButton13: TbsSkinButton; Label19: TLabel; RxDBLookupCombo12: TRxDBLookupCombo; Label41: TLabel; Label27: TLabel; RxDBLookupCombo29: TRxDBLookupCombo; RxDBLookupCombo30: TRxDBLookupCombo; Label42: TLabel; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; PopupMenu3: TPopupMenu; N37: TMenuItem; N38: TMenuItem; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; RxDBLookupCombo31: TRxDBLookupCombo; bsSkinTabSheet4: TbsSkinTabSheet; fra_op_letter_free1: Tfra_op_letter_free; wwDBLookupCombo52: TwwDBLookupCombo; wwDBLookupCombo1: TwwDBLookupCombo; N8: TMenuItem; N9: TMenuItem; N19: TMenuItem; N20: TMenuItem; N21: TMenuItem; N22: TMenuItem; N23: TMenuItem; N24: TMenuItem; dxDBGrid1Column29: TdxDBGridColumn; bsSkinPanel2: TbsSkinPanel; bsSkinDBText1: TbsSkinDBText; N25: TMenuItem; N26: TMenuItem; bsSkinTabSheet5: TbsSkinTabSheet; Label34: TLabel; RxDBLookupCombo16: TRxDBLookupCombo; DBMemo3: TDBMemo; Label35: TLabel; RxDBLookupCombo17: TRxDBLookupCombo; DBMemo4: TDBMemo; Label39: TLabel; RxDBLookupCombo18: TRxDBLookupCombo; DBMemo5: TDBMemo; bsSkinPanel3: TbsSkinPanel; bsSkinPanel5: TbsSkinPanel; Label7: TLabel; Label9: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; RxDBLookupCombo3: TRxDBLookupCombo; Label11: TLabel; Label12: TLabel; DBEdit5: TDBEdit; DBEdit6: TDBEdit; Label14: TLabel; DBEdit10: TDBEdit; Label15: TLabel; t_op_airtruckdetail1: TDataSource; t_op_airtruckdetail: TADOQuery; wwDBGrid1: TwwDBGrid; wwDBLookupCombo2: TwwDBLookupCombo; bsSkinPanel7: TbsSkinPanel; t_op_airtruckdetailprn: TADOQuery; IntegerField1: TIntegerField; StringField1: TStringField; StringField2: TStringField; StringField3: TStringField; StringField4: TStringField; StringField5: TStringField; StringField6: TStringField; IntegerField2: TIntegerField; StringField7: TStringField; BCDField1: TBCDField; BCDField2: TBCDField; BCDField3: TBCDField; IntegerField3: TIntegerField; StringField8: TStringField; BooleanField1: TBooleanField; DateTimeField1: TDateTimeField; StringField9: TStringField; IntegerField4: TIntegerField; StringField10: TStringField; StringField11: TStringField; t_op_airtruckdetailprn1: TDataSource; bsSkinButton12: TbsSkinButton; bsSkinButton14: TbsSkinButton; bsSkinButton15: TbsSkinButton; bsSkinButton16: TbsSkinButton; bsSkinButton17: TbsSkinButton; Label16: TLabel; DBEdit14: TDBEdit; bsSkinTabSheet6: TbsSkinTabSheet; bsSkinPanel9: TbsSkinPanel; bsSkinPanel10: TbsSkinPanel; wwDBGrid3: TwwDBGrid; wwDBLookupCombo3: TwwDBLookupCombo; bsSkinPanel11: TbsSkinPanel; bsSkinButton23: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; bsSkinButton26: TbsSkinButton; bsSkinButton27: TbsSkinButton; t_op_airtruckdetailhy1: TDataSource; t_op_airtruckdetailhy: TADOQuery; IntegerField5: TIntegerField; StringField12: TStringField; StringField13: TStringField; StringField14: TStringField; StringField15: TStringField; StringField16: TStringField; StringField17: TStringField; IntegerField6: TIntegerField; StringField18: TStringField; BCDField4: TBCDField; BCDField5: TBCDField; BCDField6: TBCDField; IntegerField7: TIntegerField; StringField19: TStringField; BooleanField2: TBooleanField; DateTimeField2: TDateTimeField; StringField20: TStringField; IntegerField8: TIntegerField; StringField21: TStringField; StringField22: TStringField; bsSkinGroupBox1: TbsSkinGroupBox; Label33: TLabel; wwDBDateTimePicker3: TwwDBDateTimePicker; Label40: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; Label43: TLabel; wwDBLookupCombo4: TwwDBLookupCombo; Label44: TLabel; wwDBLookupCombo5: TwwDBLookupCombo; Label45: TLabel; RxDBLookupCombo10: TRxDBLookupCombo; DBMemo1: TDBMemo; Label46: TLabel; RxDBLookupCombo14: TRxDBLookupCombo; DBMemo2: TDBMemo; bsSkinSpeedButton1: TbsSkinSpeedButton; bsSkinTabSheet7: TbsSkinTabSheet; fra_op_card1: Tfra_op_card; Label8: TLabel; Label18: TLabel; RxDBLookupCombo4: TRxDBLookupCombo; Label20: TLabel; RxDBLookupCombo5: TRxDBLookupCombo; Label21: TLabel; DBEdit11: TDBEdit; Label22: TLabel; DBEdit12: TDBEdit; Label24: TLabel; DBEdit13: TDBEdit; Label26: TLabel; Label28: TLabel; RxDBLookupCombo6: TRxDBLookupCombo; Label29: TLabel; RxDBLookupCombo9: TRxDBLookupCombo; Label30: TLabel; DBEdit15: TDBEdit; Label31: TLabel; DBEdit16: TDBEdit; Label32: TLabel; DBEdit17: TDBEdit; wwDBComboBox1: TwwDBComboBox; PopupMenu4: TPopupMenu; SA1: TMenuItem; N27: TMenuItem; CA1: TMenuItem; N28: TMenuItem; N29: TMenuItem; N30: TMenuItem; N32: TMenuItem; wwDBComboBox2: TwwDBComboBox; wwDBComboBox4: TwwDBComboBox; Label47: TLabel; RxDBLookupCombo15: TRxDBLookupCombo; Label49: TLabel; DBEdit19: TDBEdit; Label50: TLabel; DBEdit20: TDBEdit; Label51: TLabel; DBEdit21: TDBEdit; Label48: TLabel; DBEdit22: TDBEdit; Label52: TLabel; wwDBDateTimePicker5: TwwDBDateTimePicker; wwDBComboBox5: TwwDBComboBox; wwDBComboBox6: TwwDBComboBox; wwDBLookupCombo6: TwwDBLookupCombo; wwDBLookupCombo7: TwwDBLookupCombo; t_op_airtruckdetailhyDSDesigner: TBooleanField; Label53: TLabel; wwDBComboBox7: TwwDBComboBox; bsSkinPanel4: TbsSkinPanel; Label116: TLabel; Label130: TLabel; Label131: TLabel; Label132: TLabel; Edit1: TEdit; Edit4: TEdit; Edit2: TEdit; Edit3: TEdit; bsSkinButton44: TbsSkinButton; bsSkinButton45: TbsSkinButton; procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure Panel2Resize(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure t_op_airtruckBeforeEdit(DataSet: TDataSet); procedure t_op_airtruckBeforePost(DataSet: TDataSet); 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 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 RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); procedure DBEdit8KeyPress(Sender: TObject; var Key: Char); procedure DBEdit9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit7KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); procedure DBEdit5KeyPress(Sender: TObject; var Key: Char); procedure DBEdit10KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); procedure DBEdit30KeyPress(Sender: TObject; var Key: Char); procedure DBEdit31KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); procedure DBEdit18KeyPress(Sender: TObject; var Key: Char); procedure DBEdit2Change(Sender: TObject); procedure DBEdit3Change(Sender: TObject); procedure RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo30KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox3KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo12Change(Sender: TObject); procedure RxDBLookupCombo8Change(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 bsSkinButton13Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N37Click(Sender: TObject); procedure RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); procedure N9Click(Sender: TObject); procedure N20Click(Sender: TObject); procedure t_op_airtruckBeforeDelete(DataSet: TDataSet); procedure t_op_airtruckBeforeCancel(DataSet: TDataSet); procedure N21Click(Sender: TObject); procedure N24Click(Sender: TObject); procedure dxDBGrid1Column29CustomDraw(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 N26Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure t_op_airtruckdetailBeforeDelete(DataSet: TDataSet); procedure bsSkinButton15Click(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo17Change(Sender: TObject); procedure RxDBLookupCombo18Change(Sender: TObject); procedure t_op_airtruckdetailAfterInsert(DataSet: TDataSet); procedure RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo18KeyPress(Sender: TObject; var Key: Char); procedure DBEdit14KeyPress(Sender: TObject; var Key: Char); procedure t_op_airtruckdetailhyAfterInsert(DataSet: TDataSet); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton24Click(Sender: TObject); procedure bsSkinButton25Click(Sender: TObject); procedure bsSkinButton26Click(Sender: TObject); procedure bsSkinButton27Click(Sender: TObject); procedure RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); procedure t_op_airtruckdetailAfterPost(DataSet: TDataSet); procedure t_op_airtruckdetailhyAfterPost(DataSet: TDataSet); procedure t_op_airtruckdetailBeforeInsert(DataSet: TDataSet); procedure t_op_airtruckdetailhyBeforeInsert(DataSet: TDataSet); procedure RxDBLookupCombo10Change(Sender: TObject); procedure RxDBLookupCombo14Change(Sender: TObject); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure bsSkinSpeedButton1Click(Sender: TObject); procedure N32Click(Sender: TObject); procedure N29Click(Sender: TObject); procedure CA1Click(Sender: TObject); procedure SA1Click(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure RxDBLookupCombo11Change(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton44Click(Sender: TObject); private t_op_airtruckdetailno,t_op_airtruckdetailhyno,t_op_airtruckdetailsano:integer; { Private declarations } public { Public declarations } end; var frm_op_airtruck: Tfrm_op_airtruck; airtruckopen:boolean; implementation uses u_main, my_sys_function, u_op_airtruck_add, u_data_share, u_sys_progress, u_ch_piliang_airi, u_op_date_change; {$R *.dfm} procedure Tfrm_op_airtruck.bsSkinButton7Click(Sender: TObject); begin table_Prior(t_op_airtruck); end; procedure Tfrm_op_airtruck.bsSkinButton6Click(Sender: TObject); begin table_next(t_op_airtruck); end; procedure Tfrm_op_airtruck.bsSkinButton2Click(Sender: TObject); begin table_post(t_op_airtruck); end; procedure Tfrm_op_airtruck.bsSkinButton4Click(Sender: TObject); begin t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_airtruck.fieldbyname('编号').asstring; t_ch_fee.open; if not t_ch_fee.IsEmpty then begin showmessage('对不起业务存在费用信息,不能删除!!'); exit; end; table_delete(t_op_airtruck); end; procedure Tfrm_op_airtruck.bsSkinButton3Click(Sender: TObject); begin table_cancel(t_op_airtruck); end; procedure Tfrm_op_airtruck.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_airtruck.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); savewwgrid(fra_fee1.wwDBGrid1,'监管车应收'); savewwgrid(fra_fee1.wwDBGrid2,'监管车应付'); airtruckopen:=false; frm_op_airtruck.Hide; frm_op_airtruck.ManualFloat(frm_op_airtruck.BoundsRect ); frm_main.freeTabs('frm_op_airtruck'); action:=cafree; frm_op_airtruck:=nil; end; procedure Tfrm_op_airtruck.FormShow(Sender: TObject); var inifile1:Tinifile; begin Notebook1.PageIndex:=0; inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini'); bsSkinPanel4.Visible:=inifile1.Readbool('other','aedisp',false); inifile1.free; Notebook1.Align:=alClient; 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:=20; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; 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_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select top 50 * from t_op_airtruck where ' +'(录入人='+''''+employee+'''' +' or 操作员='+''''+employee+'''' +' or 客服员='+''''+employee+''''+')' +' order by 业务编号 DESC'); t_op_airtruck.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_op_airtruckdetail.Open; // t_op_airtruckdetailsa.Open; t_op_airtruckdetailhy.Open; fra_op_letter_free1.op_type.Text:='空运进口'; fra_op_letter_free1.t_op_letter.DataSource:=t_op_airtruck1; fra_op_letter_free1.t_op_letter.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_letter_free1.t_op_letter_free_detail.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('353') or if_open('354') then begin fra_fee1.edit_type.text:='5'; fra_fee1.edit_data.text:='0005'; fra_fee1.edit_report.text:='监管车管理'; fra_fee1.t_ch_accept.DataSource:=t_op_airtruck1; if strtobool(get_parameters_value(150,'false')) then fra_fee1.bsSkinPanel3.Visible:=true; fra_fee1.DBEdit48.DataSource:=t_op_airtruck1; if if_open('353') then begin fra_fee1.t_ch_accept.DataSource:=t_op_airtruck1; if (strtobool(get_parameters_value(153,'false'))=true) then begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('351')=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('351')=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('354') then begin fra_fee1.t_ch_pay.DataSource:=t_op_airtruck1; if (strtobool(get_parameters_value(153,'false'))=true) then begin if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('351')=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('351')=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('352') 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_airtruck1; 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; loadwwgrid(fra_fee1.wwDBGrid1,'监管车应收'); loadwwgrid(fra_fee1.wwDBGrid2,'监管车应付'); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_state1.edit_state.text:='4'; fra_op_state1.t_op_state.DataSource:=t_op_airtruck1; fra_op_state1.t_op_state.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_card1.t_op_card.DataSource:=t_op_airtruck1; fra_op_card1.t_op_card.open; frm_data_share.t_crm_client.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_hangkong.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_baoguan.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_weituo.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_daili.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_shiper.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_shouhuo.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_tongzhi.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_source.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_sys_employee.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_code.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_fee.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_currency.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_port_air.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; bsSkinTabSheet2.TabVisible:=if_open('353') or if_open('354'); airtruckopen:=true; frm_sys_progress.close; frm_sys_progress:=nil; end; procedure Tfrm_op_airtruck.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end else begin if (t_op_airtruck.State=dsinsert)or(t_op_airtruck.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_airtruck.post; end; if answer=mrNo then begin t_op_airtruck.cancel; end; if answer=mrCancel then begin exit; end; END; Notebook1.PageIndex:=0; bsSkinButton11.Caption:='编辑修改'; end; end; procedure Tfrm_op_airtruck.bsSkinButton8Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton8.ClientToScreen(Point(0,bsSkinButton8.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_airtruck.Panel2Resize(Sender: TObject); var i:integer; begin i:=round(Panel2.Width/11); bsSkinButton7.Width:=i; bsSkinButton6.Width:=i; bsSkinButton9.Width:=i; bsSkinButton10.Width:=i; bsSkinButton1.Width:=i; bsSkinButton11.Width:=i; bsSkinButton8.Width:=i; bsSkinButton2.Width:=i; bsSkinButton4.Width:=i; bsSkinButton3.Width:=i; bsSkinButton13.Left:=Panel2.Width-bsSkinButton13.Width-20; end; procedure Tfrm_op_airtruck.bsSkinButton1Click(Sender: TObject); begin if (t_op_airtruck.State=dsinsert)or(t_op_airtruck.State=dsedit) then t_op_airtruck.post; try frm_op_airtruck_add:=tfrm_op_airtruck_add.Create(self); frm_op_airtruck_add.data1.Enabled:=false; frm_op_airtruck_add.data1.DataSet:=t_op_airtruck; frm_op_airtruck_add.data1.Enabled:=true; frm_op_airtruck_add.ShowModal; finally frm_op_airtruck_add.Free; end; end; procedure Tfrm_op_airtruck.t_op_airtruckBeforeEdit(DataSet: TDataSet); begin // op_befor_post(t_op_airi,'0004'); end; procedure Tfrm_op_airtruck.t_op_airtruckBeforePost(DataSet: TDataSet); begin table_before_post(t_op_airtruck,'委托单位'); table_before_post(t_op_airtruck,'操作员'); table_before_post(t_op_airtruck,'揽货人'); table_before_post(t_op_airtruck,'客服员'); // table_before_post(t_op_airtruck,'主提单号'); // table_before_post(t_op_airtruck,'分提单号'); table_before_post(t_op_airtruck,'发车日期'); table_before_post(t_op_airtruck,'业务来源'); table_before_post(t_op_airtruck,'销售部门'); table_before_post(t_op_airtruck,'操作部门'); if op_empty('t_op_airtruck',t_op_airtruck) then abort; if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then if t_op_airtruck.FieldByName('委托编号').IsNull or (trim(t_op_airtruck['委托编号'])='') then if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_airtruck['委托编号']:=getwtno(5,subComp,department,employee,t_op_airtruck['会计期间']) else t_op_airtruck['委托编号']:=getwtno(5,subComp,department,employee,t_op_airtruck['发车日期']); if t_op_airtruck.fieldbyname('发车日期').oldvalue<>t_op_airtruck.fieldbyname('发车日期').asdatetime then if (t_op_airtruck.fieldbyname('业务类型').asstring<>'更改单') and (Logininfo.endday>=t_op_airtruck.fieldbyname('发车日期').asdatetime) then begin showmessage('此发车日期所在期间已月末结账,不能添加修改业务!!'); abort; end; if t_op_airtruck.FieldByName('委托单位').OldValue<>t_op_airtruck.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_airtruck.FieldByName('委托单位').asstring,[])then begin if frm_data_share.t_crm_client_all.fieldbyname('客户状态').asstring='封存客户'then begin showmessage('当前业务委托单位已经封存,不能再进行业务合作,如需合作请进行恢复客户操作!'); abort; end; end; end; if t_op_airtruck.State=dsinsert then begin if t_op_airtruck.fieldbyname('业务编号').asstring=''then begin t_op_airtruck['业务编号']:=get_no(t_op_airtruck.fieldbyname('会计期间').AsDateTime,getbsno(Logininfo.AirTruckBsNo,'IT')); t_op_airtruck['编号']:=get_id; end; t_op_airtruck['业务状态']:='接受委托'; t_op_airtruck['费用状态']:='录入状态'; end; if strtobool(get_parameters_value(43,'false')) then begin if (trim(t_op_airtruck.fieldbyname('主提单号').asstring)='') or (t_op_airtruck.fieldbyname('业务类型').asstring='更改单') then begin t_op_airtruck['主提单标准']:=t_op_airtruck['编号']; end else begin t_op_airtruck['主提单标准']:=t_op_airtruck['主提单号']; end; end else begin t_op_airtruck['主提单标准']:=t_op_airtruck['编号']; end; if strtobool(get_parameters_value(44,'false')) then begin if (trim(t_op_airtruck.fieldbyname('分提单号').asstring)='') or (t_op_airtruck.fieldbyname('业务类型').asstring='更改单') then begin t_op_airtruck['分提单标准']:=t_op_airtruck['编号']; end else begin t_op_airtruck['分提单标准']:=t_op_airtruck['分提单号']; end; end else begin t_op_airtruck['分提单标准']:=t_op_airtruck['编号']; end; if strtobool(get_parameters_value(45,'false')) then begin if (trim(t_op_airtruck.fieldbyname('委托编号').asstring)='') or (t_op_airtruck.fieldbyname('业务类型').asstring='更改单') then begin t_op_airtruck['委托标准']:=t_op_airtruck['编号']; end else begin t_op_airtruck['委托标准']:=t_op_airtruck['委托编号']; end; end else begin t_op_airtruck['委托标准']:=t_op_airtruck['编号']; end; t_op_airtruck['upload']:=1; end; procedure Tfrm_op_airtruck.bsSkinButton10Click(Sender: TObject); begin query_airtruck(1,'0005'); end; procedure Tfrm_op_airtruck.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_airtruck.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_airtruck.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit2); end; procedure Tfrm_op_airtruck.DBEdit2KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit3); end; procedure Tfrm_op_airtruck.DBEdit3KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_op_airtruck.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_op_airtruck.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo31); end; procedure Tfrm_op_airtruck.RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit8); end; procedure Tfrm_op_airtruck.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit9); end; procedure Tfrm_op_airtruck.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit7); end; procedure Tfrm_op_airtruck.DBEdit7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker2); end; procedure Tfrm_op_airtruck.wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker1); end; procedure Tfrm_op_airtruck.wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo7); end; procedure Tfrm_op_airtruck.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit10); end; procedure Tfrm_op_airtruck.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_op_airtruck.RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit30); end; procedure Tfrm_op_airtruck.DBEdit30KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit31); end; procedure Tfrm_op_airtruck.DBEdit31KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit14); end; procedure Tfrm_op_airtruck.RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo18); end; procedure Tfrm_op_airtruck.RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo52); end; procedure Tfrm_op_airtruck.DBEdit18KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_op_airtruck.DBEdit2Change(Sender: TObject); begin DBEdit2.Color:=dxgrid_color('空运出口',DBEdit2.text); end; procedure Tfrm_op_airtruck.DBEdit3Change(Sender: TObject); begin DBEdit3.Color:=dxgrid_color_fee(DBEdit3.text); end; procedure Tfrm_op_airtruck.RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo8); end; procedure Tfrm_op_airtruck.RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo30); end; procedure Tfrm_op_airtruck.RxDBLookupCombo30KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo18); // key_wwDBComboBox(Key,wwDBComboBox3); end; procedure Tfrm_op_airtruck.wwDBComboBox3KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit30); end; procedure Tfrm_op_airtruck.RxDBLookupCombo12Change(Sender: TObject); begin if (t_op_airtruck.state=dsinsert)or(t_op_airtruck.state=dsedit)then begin if RxDBLookupCombo12.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo12.DisplayValue,[]) then t_op_airtruck['销售部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo8Change(Sender: TObject); begin if (t_op_airtruck.state=dsinsert)or(t_op_airtruck.state=dsedit)then begin if RxDBLookupCombo8.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo8.DisplayValue,[]) then t_op_airtruck['操作部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_airtruck.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_airtruck.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_airtruck.N12Click(Sender: TObject); begin // update_grid(dxdbgrid1,59); end; procedure Tfrm_op_airtruck.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_airtruck.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_op_airtruck,'业务编号'); end; procedure Tfrm_op_airtruck.bsSkinButton13Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_airtruck.N17Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+') ' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.N34Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+')) ' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.N36Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) ' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.N37Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('000','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_op_state where 是否完成<>1) ' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo13); end; procedure Tfrm_op_airtruck.wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo16); end; procedure Tfrm_op_airtruck.wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo1); end; procedure Tfrm_op_airtruck.N9Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+')' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.N20Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+')' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.t_op_airtruckBeforeDelete(DataSet: TDataSet); begin op_befor_post(t_op_airtruck,'0005'); if not t_op_airtruck.FieldByName('委托编号').IsNull then delwtno(t_op_airtruck['委托编号']); // delete_add(4,t_op_airi); end; procedure Tfrm_op_airtruck.t_op_airtruckBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_airtruck); if t_op_airtruck.State=dsinsert then if not t_op_airtruck.FieldByName('委托编号').IsNull then delwtno(t_op_airtruck['委托编号']); end; procedure Tfrm_op_airtruck.N21Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee )' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.N24Click(Sender: TObject); begin t_op_airtruck.Close; t_op_airtruck.SQL.clear; t_op_airtruck.SQL.Add('select * from t_op_airtruck where ' +open_data('0005','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+')' +' order by 业务编号 '); t_op_airtruck.open; end; procedure Tfrm_op_airtruck.dxDBGrid1Column29CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if Trim(ANode.Strings[dxDBGrid1Column29.Index])='更改单' then AColor:=clred; AFont.Color:=clblack; end; procedure Tfrm_op_airtruck.N26Click(Sender: TObject); begin if t_op_airtruck.IsEmpty then exit; if not do_data('0005',t_op_airtruck.FieldByName('录入人').asstring ,t_op_airtruck.FieldByName('操作员').asstring ,t_op_airtruck.FieldByName('揽货人').asstring ,t_op_airtruck.FieldByName('客服员').asstring ,'','') then begin showmessage('对不起你无权修改此数据!'); abort; end; if t_op_airtruck.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_airtruck1=nil then exit; if (t_op_airtruck.State=dsinsert)or(t_op_airtruck.State=dsedit) then t_op_airtruck.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_airtruck1.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_airtruck.bsSkinButton12Click(Sender: TObject); begin if not t_op_airtruck.Active then exit; if t_op_airtruck.IsEmpty then exit; t_op_airtruckdetail.Insert; end; procedure Tfrm_op_airtruck.bsSkinButton14Click(Sender: TObject); begin if not t_op_airtruck.Active then exit; if t_op_airtruck.IsEmpty then exit; if t_op_airtruckdetail.State in [dsedit,dsinsert] then t_op_airtruckdetail.Post; end; procedure Tfrm_op_airtruck.t_op_airtruckdetailBeforeDelete( DataSet: TDataSet); begin if t_op_airtruck.FieldByName('业务状态').AsString='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; end; procedure Tfrm_op_airtruck.bsSkinButton15Click(Sender: TObject); begin t_op_airtruckdetail.Delete; end; procedure Tfrm_op_airtruck.bsSkinButton16Click(Sender: TObject); begin t_op_airtruckdetail.Cancel; end; procedure Tfrm_op_airtruck.bsSkinButton17Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton17.ClientToScreen(Point(0,bsSkinButton17.Height)); PopupMenu4.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_airtruck.RxDBLookupCombo16Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.State=dsinsert)or(t_op_airtruck1.DataSet.State=dsedit)then begin if RxDBLookupCombo16.DisplayValue<>'' then t_op_airtruck1.DataSet['发货人代码']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo17Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.State=dsinsert)or(t_op_airtruck1.DataSet.State=dsedit)then begin if RxDBLookupCombo17.DisplayValue<>'' then t_op_airtruck1.DataSet['收货人代码']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo18Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.State=dsinsert)or(t_op_airtruck1.DataSet.State=dsedit)then begin if RxDBLookupCombo18.DisplayValue<>'' then t_op_airtruck1.DataSet['通知人代码']:=frm_data_share.t_crm_client_tongzhi.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_airtruck.t_op_airtruckdetailAfterInsert( DataSet: TDataSet); begin t_op_airtruckdetail['编号']:=t_op_airtruck['编号']; t_op_airtruckdetail['序号']:=t_op_airtruckdetail.RecordCount; t_op_airtruckdetail['类型']:='BGS'; t_op_airtruckdetail['是否拼出']:=0; end; procedure Tfrm_op_airtruck.RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo3); end; procedure Tfrm_op_airtruck.RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo4); end; procedure Tfrm_op_airtruck.RxDBLookupCombo18KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo5); end; procedure Tfrm_op_airtruck.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo19); end; procedure Tfrm_op_airtruck.t_op_airtruckdetailhyAfterInsert( DataSet: TDataSet); begin t_op_airtruckdetailhy['编号']:=t_op_airtruck['编号']; t_op_airtruckdetailhy['序号']:=t_op_airtruckdetailhy.RecordCount; t_op_airtruckdetailhy['是否拼出']:=1; end; procedure Tfrm_op_airtruck.bsSkinButton23Click(Sender: TObject); begin if not t_op_airtruck.Active then exit; if t_op_airtruck.IsEmpty then exit; t_op_airtruckdetailhy.Insert; end; procedure Tfrm_op_airtruck.bsSkinButton24Click(Sender: TObject); begin if not t_op_airtruck.Active then exit; if t_op_airtruck.IsEmpty then exit; if t_op_airtruckdetailhy.State in [dsedit,dsinsert] then t_op_airtruckdetailhy.Post; end; procedure Tfrm_op_airtruck.bsSkinButton25Click(Sender: TObject); begin t_op_airtruckdetailhy.Delete; end; procedure Tfrm_op_airtruck.bsSkinButton26Click(Sender: TObject); begin t_op_airtruckdetailhy.Cancel; end; procedure Tfrm_op_airtruck.bsSkinButton27Click(Sender: TObject); begin sys_print('监管车拼出交接单',2,t_op_airtruck1,nil,nil,nil,t_op_airtruckdetailhy1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo29); end; procedure Tfrm_op_airtruck.t_op_airtruckdetailAfterPost(DataSet: TDataSet); var aQuery:TAdoQuery; pkgs,kgs,cbm:double; begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; sql.Add('select sum(件数) as 件数,sum(重量) as 重量,sum(尺码) as 尺码 from t_op_airtruckdetail where 编号='''+Dataset.fieldbyname('编号').AsString+''''); open; pkgs:=fieldbyname('件数').AsFloat; kgs:=fieldbyname('重量').AsFloat; cbm:=fieldbyname('尺码').AsFloat; if not IsEmpty then begin // t_op_airtruck.Edit; // t_op_airtruck.fieldbyname('件数').AsFloat:=pkgs;// // t_op_airtruck.fieldbyname('重量').AsFloat:=kgs; // t_op_airtruck.fieldbyname('尺码').AsFloat:=cbm; // t_op_airtruck.post; close;sql.clear; sql.Add('update t_op_airtruck set 件数='+floattostr(pkgs)+',重量='+floattostr(kgs)+',尺码='+floattostr(cbm)+' where 编号='''+Dataset.fieldbyname('编号').AsString+''''); ExecSQL; end; end; finally FreeAndNil(aQuery); end; end; procedure Tfrm_op_airtruck.t_op_airtruckdetailhyAfterPost( DataSet: TDataSet); var aQuery:TAdoQuery; pkgs,kgs,cbm:double; begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; sql.Add('select sum(件数) as 件数,sum(重量) as 重量,sum(尺码) as 尺码 from t_op_airtruckdetail where 编号='''+Dataset.fieldbyname('编号').AsString+''''); open; pkgs:=fieldbyname('件数').AsFloat; kgs:=fieldbyname('重量').AsFloat; cbm:=fieldbyname('尺码').AsFloat; if not IsEmpty then begin // t_op_airtruck.Edit; // t_op_airtruck.fieldbyname('件数').AsFloat:=pkgs; // t_op_airtruck.fieldbyname('重量').AsFloat:=kgs; // t_op_airtruck.fieldbyname('尺码').AsFloat:=cbm; // t_op_airtruck.post; close;sql.clear; sql.Add('update t_op_airtruck set 件数='+floattostr(pkgs)+',重量='+floattostr(kgs)+',尺码='+floattostr(cbm)+' where 编号='''+Dataset.fieldbyname('编号').AsString+''''); ExecSQL; // t_op_airtruck.Refresh; end; end; finally FreeAndNil(aQuery); end;// t_op_airtruckdetail.Requery; end; procedure Tfrm_op_airtruck.t_op_airtruckdetailBeforeInsert( DataSet: TDataSet); begin if t_op_airtruck.FieldByName('业务状态').AsString='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_airtruckdetail.Recordset.RecordCount=0 then t_op_airtruckdetailno:=1 else t_op_airtruckdetailno:=t_op_airtruckdetail['序号']-1; end; procedure Tfrm_op_airtruck.t_op_airtruckdetailhyBeforeInsert( DataSet: TDataSet); begin if t_op_airtruck.FieldByName('业务状态').AsString='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_airtruckdetailhy.Recordset.RecordCount=0 then t_op_airtruckdetailhyno:=1 else t_op_airtruckdetailhyno:=t_op_airtruckdetailhy['序号']-1; end; procedure Tfrm_op_airtruck.RxDBLookupCombo10Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.State=dsinsert)or(t_op_airtruck1.DataSet.State=dsedit)then begin if RxDBLookupCombo10.DisplayValue<>'' then t_op_airtruck1.DataSet['回程发货人代码']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo14Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.State=dsinsert)or(t_op_airtruck1.DataSet.State=dsedit)then begin if RxDBLookupCombo14.DisplayValue<>'' then t_op_airtruck1.DataSet['回程收货人代码']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo16Enter(Sender: TObject); begin RxLookupComboEnter(TRxDBLookupCombo(Sender)); end; procedure Tfrm_op_airtruck.RxDBLookupCombo16Exit(Sender: TObject); begin RxLookupComboExit(TRxDBLookupCombo(Sender)); end; procedure Tfrm_op_airtruck.bsSkinSpeedButton1Click(Sender: TObject); begin if t_op_airtruck1.DataSet.FieldByName('委托编号').IsNull or (t_op_airtruck1.DataSet['委托编号']='') then begin t_op_airtruck1.DataSet.edit; if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_airtruck1.DataSet['委托编号']:=getwtno(5,subComp,department,employee,t_op_airtruck1.DataSet['会计期间']) else t_op_airtruck1.DataSet['委托编号']:=getwtno(5,subComp,department,employee,t_op_airtruck1.DataSet['发车日期']); end; end; procedure Tfrm_op_airtruck.N32Click(Sender: TObject); begin sys_print('BGS监管车全部',2,t_op_airtruck1,nil,nil,nil,t_op_airtruckdetail1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.N29Click(Sender: TObject); var i:integer; str:widestring; begin if t_op_airtruckdetail.IsEmpty then exit; if wwDBGrid1.SelectedList.Count>=1 then begin for i:=0 to wwDBGrid1.SelectedList.Count-1 do begin t_op_airtruckdetail.GotoBookmark(pointer(wwDBGrid1.SelectedList[i])); if i=0 then str:='('+t_op_airtruckdetail.fieldbyname('TD_ID').asstring else str:=str+','+t_op_airtruckdetail.fieldbyname('TD_ID').asstring; end; end else begin str:='('+t_op_airtruckdetail.fieldbyname('TD_ID').asstring; end; str:=str+')'; t_op_airtruckdetailprn.close; t_op_airtruckdetailprn.sql.clear; t_op_airtruckdetailprn.sql.add('select * from t_op_airtruckdetail ' +'where 是否拼出<>1 and TD_ID in '+str +' order by 类型,序号'); t_op_airtruckdetailprn.open; sys_print('BGS监管车选择',2,t_op_airtruck1,nil,nil,t_op_airtruckdetail1,t_op_airtruckdetailprn1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.CA1Click(Sender: TObject); begin if t_op_airtruckdetail.IsEmpty then exit; t_op_airtruckdetailprn.close; t_op_airtruckdetailprn.sql.clear; t_op_airtruckdetailprn.sql.add('select * from t_op_airtruckdetail ' +'where 是否拼出<>1 and 发货人=:发货人 and 编号=:编号 ' +' order by 类型,序号'); t_op_airtruckdetailprn.Parameters.ParamByName('发货人').Value:=t_op_airtruckdetail.fieldbyname('发货人').AsString; t_op_airtruckdetailprn.Parameters.ParamByName('编号').Value:=t_op_airtruckdetail.fieldbyname('编号').AsString; t_op_airtruckdetailprn.open; sys_print('BGS监管车选择',2,t_op_airtruck1,nil,nil,t_op_airtruckdetail1,t_op_airtruckdetailprn1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.SA1Click(Sender: TObject); begin if t_op_airtruckdetail.IsEmpty then exit; t_op_airtruckdetailprn.close; t_op_airtruckdetailprn.sql.clear; t_op_airtruckdetailprn.sql.add('select * from t_op_airtruckdetail ' +'where 是否拼出<>1 and 类型=:类型 and 编号=:编号 ' +' order by 类型,序号'); t_op_airtruckdetailprn.Parameters.ParamByName('类型').Value:=t_op_airtruckdetail.fieldbyname('类型').AsString; t_op_airtruckdetailprn.Parameters.ParamByName('编号').Value:=t_op_airtruckdetail.fieldbyname('编号').AsString; t_op_airtruckdetailprn.open; sys_print('BGS监管车选择',2,t_op_airtruck1,nil,nil,t_op_airtruckdetail1,t_op_airtruckdetailprn1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.bsSkinPageControl1Change(Sender: TObject); begin if not airtruckopen then exit; if bsSkinPageControl1.ActivePage<>bsSkinTabSheet1 then begin if t_op_airtruck.State in [dsedit,dsinsert] then t_op_airtruck.Post; end else begin t_op_airtruck.Refresh; end; end; procedure Tfrm_op_airtruck.RxDBLookupCombo11Change(Sender: TObject); begin if t_op_airtruck1.DataSet=nil then exit; if (t_op_airtruck1.DataSet.state=dsinsert)or(t_op_airtruck1.DataSet.state=dsedit)then begin if RxDBLookupCombo11.DisplayValue='' then exit; t_op_airtruck1.DataSet.fieldbyname('货物描述').asstring:=t_op_airtruck1.DataSet.fieldbyname('货物描述').asstring+#13#10+frm_data_share.t_code_goods['货物描述']; if frm_data_share.t_code_goods.FieldByName('商品编码').AsString<>'' then t_op_airtruck1.DataSet.fieldbyname('商品编码').asstring:=t_op_airtruck1.DataSet.fieldbyname('商品编码').asstring+#13#10+frm_data_share.t_code_goods['商品编码']; // if trim(t_op_seae2.DataSet.fieldbyname('货物描述').asstring)=''then // DBMemo39.Lines.Append(frm_data_share.t_code_goods['货物描述']); // TMemoField(t_op_seae2.Fieldbyname('货物描述')). // :=frm_data_share.t_code_goods['货物描述']; end; end; procedure Tfrm_op_airtruck.bsSkinButton9Click(Sender: TObject); begin sys_print('监管车业务',2,t_op_airtruck1,nil,nil,nil,t_op_airtruckdetail1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_airtruck.bsSkinButton44Click(Sender: TObject); var str,airepsqlstr:widestring; begin //快捷查询 str:=''; str:=query_tiaojian(1,str,'t_op_airtruck.业务编号','模糊',Edit1.text); str:=query_tiaojian(1,str,'t_op_airtruck.委托编号','模糊',Edit4.text); str:=query_tiaojian(1,str,'t_op_airtruck.主提单号','模糊',Edit2.text); str:=query_tiaojian(1,str,'t_op_airtruck.分提单号','模糊',Edit3.text); if trim(str)='' then begin str:='where '+open_data('0006','t_op_airtruck.录入人', 't_op_airtruck.操作员','t_op_airtruck.客服员','no','no'); end else begin str:=str+' and '+open_data('0006','t_op_airtruck.录入人', 't_op_airtruck.操作员','t_op_airtruck.客服员','no','no'); end; str:='select * from t_op_airtruck where 编号=编号 and 编号 in (select 编号 from t_op_airtruck ' +str+')';//;+default_sort(55,'t_op_airtruck','','desc'); if (not t_op_airtruck.IsEmpty) and (t_op_airtruck.sql.Text<>'') then t_op_airtruck.close; t_op_airtruck.sql.clear; t_op_airtruck.sql.add(str); t_op_airtruck.Open; if t_op_airtruck.IsEmpty then begin showmessage('没有检索出所需数据!!'); exit; end; end; end.