unit u_op_airi_add; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, BusinessSkinForm, StdCtrls, wwdbdatetimepicker, bsSkinCtrls; type Tfrm_op_airi_add = class(TForm) Label1: TLabel; bsSkinButton1: TbsSkinButton; bsSkinButton2: TbsSkinButton; wwDBDateTimePicker1: TwwDBDateTimePicker; bsSkinButton3: TbsSkinButton; bsBusinessSkinForm1: TbsBusinessSkinForm; data1: TDataSource; bsSkinCheckRadioBox7: TbsSkinCheckRadioBox; bsSkinCheckRadioBox4: TbsSkinCheckRadioBox; bsSkinCheckRadioBox2: TbsSkinCheckRadioBox; bsSkinCheckRadioBox3: TbsSkinCheckRadioBox; procedure bsSkinButton2Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_airi_add: Tfrm_op_airi_add; frm_op_airi_add_num:integer; implementation uses u_op_airi, u_main, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_op_airi_add.bsSkinButton2Click(Sender: TObject); begin close; end; procedure Tfrm_op_airi_add.FormShow(Sender: TObject); begin wwDBDateTimePicker1.MinDate:=Logininfo.endday+1; wwDBDateTimePicker1.Date:=date; end; procedure Tfrm_op_airi_add.bsSkinButton1Click(Sender: TObject); var i:integer; begin if (frm_op_airi_add_num=3) then begin frm_op_airi.t_op_airi1.Enabled:=false; frm_op_airi.t_op_airi1.DataSet:=frm_op_airi.t_op_airi_fen; frm_op_airi.t_op_airi1.Enabled:=true; data1.DataSet.append; for i := 0 to (data1.DataSet.DataSource.DataSet.fieldcount-1) do begin data1.DataSet[data1.DataSet.DataSource.DataSet.fields[i].FieldName]:= data1.DataSet.DataSource.DataSet[data1.DataSet.DataSource.DataSet.fields[i].FieldName]; end; data1.DataSet['业务编号']:=''; data1.DataSet['主编号']:=''; data1.DataSet['编号']:=''; data1.DataSet['分运单号']:=''; if not (Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动编辑') then data1.DataSet['委托编号']:=''; if bsSkinCheckRadioBox7.Checked then data1.DataSet['业务类型']:='更改单' else data1.DataSet['业务类型']:='普通货'; if bsSkinCheckRadioBox4.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox4.Caption; if bsSkinCheckRadioBox2.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox2.Caption; if bsSkinCheckRadioBox3.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox3.Caption; data1.DataSet['件数']:=0; data1.DataSet['计价重量']:=0; data1.DataSet['尺码']:=0; data1.DataSet['毛重']:=0; data1.DataSet['发货人']:=''; data1.DataSet['收货人']:=''; data1.DataSet['通知人']:=''; data1.DataSet['发货人代码']:=''; data1.DataSet['收货人代码']:=''; data1.DataSet['通知人代码']:=''; data1.DataSet['会计期间']:=wwDBDateTimePicker1.date; data1.DataSet['周次']:=WeekofYear(wwDBDateTimePicker1.date); data1.DataSet['财务']:=0; data1.DataSet['财务凭证']:=''; data1.DataSet['录入人']:=employee; data1.DataSet['分部名称']:=subComp; data1.DataSet['录入日期']:=date; data1.DataSet['操作员']:=employee; data1.DataSet['揽货人']:=employee; data1.DataSet['客服员']:=employee; data1.DataSet['销售部门']:=department; data1.DataSet['操作部门']:=department; data1.DataSet['目的港']:=get_parameters_value(19,'TSINGTAO'); data1.DataSet['货物描述']:=get_parameters_value(119,''); // data1.DataSet['业务来源']:='自揽货'; data1.DataSet['是否打印']:=0; end else begin data1.DataSet.Insert; if bsSkinCheckRadioBox7.Checked then data1.DataSet['业务类型']:='更改单' else data1.DataSet['业务类型']:='普通货'; if bsSkinCheckRadioBox4.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox4.Caption; if bsSkinCheckRadioBox2.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox2.Caption; if bsSkinCheckRadioBox3.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox3.Caption; data1.DataSet['会计期间']:=wwDBDateTimePicker1.date; data1.DataSet['周次']:=WeekofYear(wwDBDateTimePicker1.date); data1.DataSet['财务']:=0; data1.DataSet['财务凭证']:=''; data1.DataSet['录入人']:=employee; data1.DataSet['分部名称']:=subComp; data1.DataSet['录入日期']:=date; data1.DataSet['操作员']:=employee; data1.DataSet['揽货人']:=employee; data1.DataSet['客服员']:=employee; data1.DataSet['销售部门']:=department; data1.DataSet['操作部门']:=department; data1.DataSet['目的港']:=get_parameters_value(19,'TSINGTAO'); data1.DataSet['货物描述']:=get_parameters_value(119,''); // data1.DataSet['业务来源']:='自揽货'; data1.DataSet['是否打印']:=0; end; data1.DataSet['fee']:=0; data1.DataSet['fee2']:=0; if frm_op_airi_add_num=1 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回列表'; end; if frm_op_airi_add_num=2 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回主票'; end; if frm_op_airi_add_num=3 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回主票'; // frm_op_aire.t_op_aire_fen.Post; end; close; end; procedure Tfrm_op_airi_add.bsSkinButton3Click(Sender: TObject); var afield : variant; i: Integer; begin if data1.DataSet.IsEmpty then begin showmessage('没有复制母体,不能复制新建!'); exit; end; afield := vararraycreate([0,data1.DataSet.fieldcount-1],varvariant); for i := 0 to (data1.DataSet.fieldcount-1) do begin afield[i] :=data1.DataSet.fields[i].value ; end; if frm_op_airi_add_num=3 then begin frm_op_airi.t_op_airi1.Enabled:=false; frm_op_airi.t_op_airi1.DataSet:=frm_op_airi.t_op_airi_fen; frm_op_airi.t_op_airi1.Enabled:=true; end; data1.DataSet.append; for i := 0 to (data1.DataSet.fieldcount-1) do begin data1.DataSet.fields[i].value := afield[i] ; end; if bsSkinCheckRadioBox7.Checked then data1.DataSet['业务类型']:='更改单' else data1.DataSet['业务类型']:='普通货'; if bsSkinCheckRadioBox4.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox4.Caption; if bsSkinCheckRadioBox2.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox2.Caption; if bsSkinCheckRadioBox3.Checked then data1.DataSet['装运方式']:=bsSkinCheckRadioBox3.Caption; data1.DataSet['业务编号']:=''; data1.DataSet['编号']:=''; data1.DataSet['主编号']:=''; if not (Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动编辑') then data1.DataSet['委托编号']:=''; data1.DataSet['计费标准']:=''; data1.DataSet['业务状态']:='接受委托'; data1.DataSet['费用状态']:='录入状态'; data1.DataSet['录入人']:=employee; data1.DataSet['录入日期']:=date; data1.DataSet['分部名称']:=subComp; data1.DataSet['操作员']:=employee; data1.DataSet['操作部门']:=department; data1.DataSet['会计期间']:=wwDBDateTimePicker1.date; data1.DataSet['周次']:=WeekofYear(wwDBDateTimePicker1.date); if (strtoint(get_parameters_value(158,'0'))=1) and bsSkinCheckRadioBox7.Checked then AmendAccDate('T_OP_AIRI',data1); data1.DataSet['财务']:=0; data1.DataSet['财务凭证']:=''; data1.DataSet['目的港']:=get_parameters_value(19,'TSINGTAO'); data1.DataSet['是否打印']:=0; data1.DataSet['fee']:=0; data1.DataSet['fee2']:=0; if frm_op_airi_add_num=1 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回列表'; end; if frm_op_airi_add_num=2 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回主票'; end; if frm_op_airi_add_num=3 then begin frm_op_airi.Notebook1.PageIndex:=1; frm_op_airi.bsSkinButton11.Caption:='返回主票'; end; close; end; end.