unit u_op_aire_oder_add; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, wwdbdatetimepicker, DB, RxLookup,my_sys_chat; type Tfrm_op_aire_order_add = class(TForm) bsBusinessSkinForm1: TbsBusinessSkinForm; bsSkinGroupBox1: TbsSkinGroupBox; Label1: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; data1: TDataSource; Label16: TLabel; RxDBLookupCombo14: TRxDBLookupCombo; Label42: TLabel; RxDBLookupCombo30: TRxDBLookupCombo; Label17: TLabel; RxDBLookupCombo13: TRxDBLookupCombo; data2: TDataSource; Label19: TLabel; RxDBLookupCombo12: TRxDBLookupCombo; Label20: TLabel; RxDBLookupCombo29: TRxDBLookupCombo; data3: TDataSource; procedure FormShow(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure RxDBLookupCombo14Change(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure RxDBLookupCombo29Change(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_aire_order_add: Tfrm_op_aire_order_add; frm_op_seae_add_num:integer; implementation uses u_main, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_op_aire_order_add.bsSkinButton2Click(Sender: TObject); begin close; end; procedure Tfrm_op_aire_order_add.FormShow(Sender: TObject); begin wwDBDateTimePicker1.Date:=date; end; procedure Tfrm_op_aire_order_add.bsSkinButton3Click(Sender: TObject); var i: Integer; bsno,ywno:String; begin if (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') then begin MessageDlg('所有项目都不为空!', mtConfirmation, [mbYes],0); exit; end; if not data1.DataSet.Active then data1.DataSet.Open; data1.DataSet.Insert; bsno:=get_id; // data1.DataSet['编号']:=bsno; // data1.DataSet['业务编号']:=''; data1.DataSet['计费标准']:=''; data1.DataSet['业务状态']:='接受委托'; data1.DataSet['费用状态']:='录入状态'; data1.DataSet['会计期间']:=wwDBDateTimePicker1.date; data1.DataSet['周次']:=WeekofYear(wwDBDateTimePicker1.date); data1.DataSet['录入人']:=employee; data1.DataSet['录入日期']:=date; data1.DataSet['操作员']:=RxDBLookupCombo14.DisplayValue; // data1.DataSet['报关操作']:=employee; data1.DataSet['揽货人']:=RxDBLookupCombo29.DisplayValue; data1.DataSet['客服员']:=RxDBLookupCombo13.DisplayValue; data1.DataSet['销售部门']:=RxDBLookupCombo12.DisplayValue; data1.DataSet['操作部门']:=RxDBLookupCombo30.DisplayValue; data1.DataSet['业务来源']:='自揽货'; data1.DataSet['委托单位']:=data2.DataSet['委托单位']; data1.DataSet['装运方式']:='空运单票'; data1.DataSet['业务类型']:='普通货'; ywno:=get_no(wwDBDateTimePicker1.date,getbsno(Logininfo.AirExpBsNo,'AE')); // data1.DataSet['业务编号']:=ywno; data1.DataSet['主编号']:=bsno; data1.DataSet['主提单标准']:=bsno; data1.DataSet['分提单标准']:=bsno; data1.DataSet['委托标准']:=bsno; data1.DataSet['发货人代码']:=data2.DataSet['发货人代码']; data1.DataSet['收货人代码']:=data2.DataSet['收货人代码']; data1.DataSet['通知人代码']:=data2.DataSet['通知人代码']; // data1.DataSet['船名']:=data2.DataSet['船名']; data1.DataSet['一程航班']:=data2.DataSet['航次']; data1.DataSet['一程开航日期']:=data2.DataSet['开船日期']; data1.DataSet['始发港']:=data2.DataSet['装货港']; data1.DataSet['目的港']:=data2.DataSet['卸货港']; // data1.DataSet['运输条款']:=data2.DataSet['运输条款']; data1.DataSet['唛头']:=data2.DataSet['唛头']; data1.DataSet['货物描述']:=data2.DataSet['货物描述']; data1.DataSet['件数']:=data2.DataSet['件数']; // data1.DataSet['包装']:=data2.DataSet['包装']; data1.DataSet['重量']:=data2.DataSet['重量']; // data1.DataSet['尺码']:=data2.DataSet['尺码']; data1.DataSet['备注']:=data2.DataSet['备注']; data1.DataSet['签单地点']:=get_parameters_value(49,'QINGDAO,CHINA'); // data1.DataSet['预付地点']:=get_parameters_value(50,'QINGDAO,CHINA'); data1.DataSet['财务']:=0; data1.DataSet['财务凭证']:=''; data1.DataSet.Post; Data2.DataSet.Edit; Data2.DataSet['订舱状态']:=1; // Data2.DataSet['业务编号']:=ywno; Data2.DataSet.Post; close; end; procedure Tfrm_op_aire_order_add.RxDBLookupCombo14Change(Sender: TObject); begin if RxDBLookupCombo14.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo14.DisplayValue,[]) then RxDBLookupCombo30.DisplayValue:=frm_data_share.t_sys_employee['部门名称']; end; procedure Tfrm_op_aire_order_add.RxDBLookupCombo29Change(Sender: TObject); begin if RxDBLookupCombo29.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo29.DisplayValue,[]) then RxDBLookupCombo12.DisplayValue:=frm_data_share.t_sys_employee['部门名称']; end; end.