You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
292 lines
10 KiB
Plaintext
292 lines
10 KiB
Plaintext
unit u_op_seae_weborder_add;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, wwdbdatetimepicker, DB,
|
|
RxLookup,adodb,my_sys_chat;
|
|
|
|
type
|
|
Tfrm_op_seae_weborder_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_seae_weborder_add: Tfrm_op_seae_weborder_add;
|
|
frm_op_seae_add_num:integer;
|
|
|
|
implementation
|
|
|
|
uses u_main, my_sys_function, u_data_share;
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure Tfrm_op_seae_weborder_add.bsSkinButton2Click(Sender: TObject);
|
|
begin
|
|
close;
|
|
end;
|
|
|
|
procedure Tfrm_op_seae_weborder_add.FormShow(Sender: TObject);
|
|
begin
|
|
wwDBDateTimePicker1.Date:=date;
|
|
end;
|
|
|
|
procedure Tfrm_op_seae_weborder_add.bsSkinButton3Click(Sender: TObject);
|
|
var
|
|
i: Integer;
|
|
bsno,ywno:String;
|
|
aQuery:TAdoQuery;
|
|
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;
|
|
if not data3.DataSet.Active then data3.DataSet.Open;
|
|
bsno:=get_id;
|
|
data1.DataSet.Insert;
|
|
data1.DataSet['񅧏']:=bsno;
|
|
|
|
if Data2.DataSet['ÊÇ·ñÆ´Ïä']=1 then
|
|
data1.DataSet['×°ÔË·½Ê½']:='Æ´Ï䵥Ʊ'
|
|
else
|
|
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['ÒµÎñÀàÐÍ']:='ÆÕͨ»õ';
|
|
|
|
|
|
ywno:=get_no(wwDBDateTimePicker1.date,getbsno(Logininfo.SeaExpBsNo,'SE'));
|
|
data1.DataSet['ÒµÎñ±àºÅ']:=ywno;
|
|
|
|
data1.DataSet['Ö÷±àºÅ']:=bsno;
|
|
data1.DataSet['Ö÷Ìáµ¥±ê×¼']:=bsno;
|
|
data1.DataSet['·ÖÌáµ¥±ê×¼']:=bsno;
|
|
data1.DataSet['ίÍбê×¼']:=bsno;
|
|
data1.DataSet['±¨¹Ø±ê×¼']:=bsno;
|
|
data1.DataSet['±¨¼ì±ê×¼']:=bsno;
|
|
data1.DataSet['ºËÏú±ê×¼']:=bsno;
|
|
data1.DataSet['¼Æ·Ñ±ê×¼']:='';
|
|
|
|
data1.DataSet['ÒµÎñ״̬']:='½ÓÊÜίÍÐ';
|
|
data1.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['³ßÂë']:=data2.DataSet['³ßÂë'];
|
|
|
|
|
|
data1.DataSet['¼þÊý°ü×°']:=data2.DataSet.FieldByName('¼þÊý').AsString+data2.DataSet['°ü×°'];
|
|
data1.DataSet['»õÎïÖØÁ¿']:=data2.DataSet.FieldByName('ÖØÁ¿').AsString+'KGS';
|
|
data1.DataSet['»õÎï³ßÂë']:=data2.DataSet.FieldByName('³ßÂë').AsString+'CBM';
|
|
|
|
|
|
data1.DataSet['ÉèÖÃζÈ']:=data2.DataSet['ÉèÖÃζÈ'];
|
|
data1.DataSet['Àä²Øͨ·çÁ¿']:=data2.DataSet['Àä²Øͨ·çÁ¿'];
|
|
data1.DataSet['ʪ¶È']:=data2.DataSet['ʪ¶È'];
|
|
data1.DataSet['ÏäÐÍ1']:=0;
|
|
data1.DataSet['ÏäÐÍ2']:=0;
|
|
data1.DataSet['ÏäÐÍ3']:=0;
|
|
data1.DataSet['ÏäÐÍ4']:=0;
|
|
data1.DataSet['ÏäÐÍ5']:=0;
|
|
data1.DataSet['ÏäÐÍ6']:=0;
|
|
data1.DataSet['ÏäÐÍ7']:=0;
|
|
data1.DataSet['ÏäÐÍ8']:=0;
|
|
data1.DataSet['ÏäÐÍ9']:=0;
|
|
data1.DataSet['ÏäÐÍ10']:=0;
|
|
data1.DataSet['ÆäËûÏäÐÍ']:=0;
|
|
data1.DataSet['ÏäTEU']:=0;
|
|
data1.DataSet['¼¯×°Ïä']:='';
|
|
data1.DataSet['ÏäÊý´óд']:='';
|
|
|
|
data1.DataSet['¼þÊý´óд']
|
|
:='SAY:'+ntoc(data1.DataSet.FieldByName('¼þÊý').asfloat,true)
|
|
+data1.DataSet.FieldByName('°ü×°').asstring+' ONLY.';
|
|
data1.DataSet['±¸×¢']:=data2.DataSet['±¸×¢'];
|
|
data1.DataSet['Ç©µ¥µØµã']:=get_parameters_value(49,'QINGDAO,CHINA');
|
|
data1.DataSet['Ô¤¸¶µØµã']:=get_parameters_value(50,'QINGDAO,CHINA');
|
|
data1.DataSet['ÍËË°ÈÕÆÚ']:=null;
|
|
data1.DataSet['Ç©µ¥ÈÕÆÚ']:=null;
|
|
data1.DataSet['ÅɳµÈÕÆÚ']:=null;
|
|
data1.DataSet['¼Äµ¥ÈÕÆÚ']:=null;
|
|
data1.DataSet['ÊÇ·ñ¼Äµ¥']:=0;
|
|
data1.DataSet['ÊÇ·ñÍËË°']:=0;
|
|
data1.DataSet['ÊÇ·ñͨ¹Ø']:=0;
|
|
data1.DataSet['ÊÇ·ñÇ©µ¥']:=0;
|
|
data1.DataSet['ÇëÇóÅɳµ']:=0;
|
|
data1.DataSet['ÊÇ·ñÅɳµ']:=0;
|
|
data1.DataSet['ÊÇ·ñ½âËø']:=0;
|
|
data1.DataSet['½âËøÈÕÆÚ']:=null;
|
|
data1.DataSet['½âËøÈË']:='';
|
|
data1.DataSet['Ó¦ÊÕ½ÔË']:=0;
|
|
data1.DataSet['Ó¦¸¶Â½ÔË']:=0;
|
|
data1.DataSet['½ÔËÀûÈó']:=0;
|
|
data1.DataSet['²ÆÎñ']:=0;
|
|
data1.DataSet['²ÆÎñƾ֤']:='';
|
|
data1.DataSet['ÊÇ·ñ´òÓ¡']:=0;
|
|
data1.DataSet['·ÑÓ÷âÕÊÈÕÆÚ']:=null;
|
|
|
|
data1.DataSet.Post;
|
|
if (Data2.DataSet['ÏäÐÍ1']<>'') and (Data2.DataSet['ÏäÁ¿1']<>0) then begin
|
|
aQuery:=CreateAdoQuery;
|
|
try
|
|
with aQuery do begin
|
|
sql.Add('select * from t_code_ctn where ´úÂë='''+Data2.DataSet['ÏäÐÍ1']+'''');
|
|
Open;
|
|
if recordcount<>0 then begin
|
|
Data3.DataSet.Insert;
|
|
Data3.DataSet['´úÂë']:=Data2.DataSet['ÏäÐÍ1'];
|
|
Data3.DataSet['ÊýÁ¿']:=Data2.DataSet['ÏäÁ¿1'];
|
|
Data3.DataSet['±íÏÖÐÎʽ']:=aQuery['±íÏÖÐÎʽ'];
|
|
if aQuery.FieldByName('³ß´ç').asstring='20'then
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
if (aQuery.FieldByName('³ß´ç').asstring='40')OR
|
|
(aQuery.FieldByName('³ß´ç').asstring='45')then
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
Data3.DataSet.post;
|
|
end;
|
|
end;
|
|
finally
|
|
freeAndNil(aQuery);
|
|
end;
|
|
end;
|
|
|
|
if (Data2.DataSet['ÏäÐÍ2']<>'') and (Data2.DataSet['ÏäÁ¿2']<>0) then begin
|
|
aQuery:=CreateAdoQuery;
|
|
try
|
|
with aQuery do begin
|
|
sql.Add('select * from t_code_ctn where ´úÂë='''+Data2.DataSet['ÏäÐÍ2']+'''');
|
|
Open;
|
|
if recordcount<>0 then begin
|
|
Data3.DataSet.Insert;
|
|
Data3.DataSet['´úÂë']:=Data2.DataSet['ÏäÐÍ2'];
|
|
Data3.DataSet['ÊýÁ¿']:=Data2.DataSet['ÏäÁ¿2'];
|
|
Data3.DataSet['±íÏÖÐÎʽ']:=aQuery['±íÏÖÐÎʽ'];
|
|
if aQuery.FieldByName('³ß´ç').asstring='20'then
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
if (aQuery.FieldByName('³ß´ç').asstring='40')OR
|
|
(aQuery.FieldByName('³ß´ç').asstring='45')then
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
Data3.DataSet.post;
|
|
end;
|
|
end;
|
|
finally
|
|
freeAndNil(aQuery);
|
|
end;
|
|
end;
|
|
|
|
if (Data2.DataSet['ÏäÐÍ3']<>'') and (Data2.DataSet['ÏäÁ¿3']<>0) then begin
|
|
aQuery:=CreateAdoQuery;
|
|
try
|
|
with aQuery do begin
|
|
sql.Add('select * from t_code_ctn where ´úÂë='''+Data2.DataSet['ÏäÐÍ3']+'''');
|
|
Open;
|
|
if recordcount<>0 then begin
|
|
Data3.DataSet.Insert;
|
|
Data3.DataSet['´úÂë']:=Data2.DataSet['ÏäÐÍ3'];
|
|
Data3.DataSet['ÊýÁ¿']:=Data2.DataSet['ÏäÁ¿3'];
|
|
Data3.DataSet['±íÏÖÐÎʽ']:=aQuery['±íÏÖÐÎʽ'];
|
|
if aQuery.FieldByName('³ß´ç').asstring='20'then
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
if (aQuery.FieldByName('³ß´ç').asstring='40')OR
|
|
(aQuery.FieldByName('³ß´ç').asstring='45')then
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('ÊýÁ¿').asinteger;
|
|
Data3.DataSet.post;
|
|
end;
|
|
end;
|
|
finally
|
|
freeAndNil(aQuery);
|
|
end;
|
|
end;
|
|
|
|
Data2.DataSet.Edit;
|
|
Data2.DataSet['¶©²Õ״̬']:=1;
|
|
Data2.DataSet['ÒµÎñ±àºÅ']:=Data1.DataSet['ÒµÎñ±àºÅ'];
|
|
Data2.DataSet.Post;
|
|
{
|
|
Send_op_do('½ÓÊܺ£Ô˳ö¿ÚÍøÉ϶©²Õ,ÒµÎñ±àºÅ:'+Data1.DataSet['ÒµÎñ±àºÅ'],'66',
|
|
RxDBLookupCombo14.DisplayValue,
|
|
RxDBLookupCombo13.DisplayValue,
|
|
RxDBLookupCombo29.DisplayValue);
|
|
}
|
|
close;
|
|
|
|
end;
|
|
|
|
procedure Tfrm_op_seae_weborder_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_seae_weborder_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.
|