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.

243 lines
8.1 KiB
Plaintext

unit u_op_seai_oder_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_seai_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_seai_order_add: Tfrm_op_seai_order_add;
frm_op_seae_add_num:integer;
implementation
uses u_main, my_sys_function, u_data_share;
{$R *.dfm}
procedure Tfrm_op_seai_order_add.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_seai_order_add.FormShow(Sender: TObject);
begin
wwDBDateTimePicker1.Date:=date;
end;
procedure Tfrm_op_seai_order_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;
¡¢¡¢ 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['À¿»õÈË']:=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(data1.DataSet.fieldbyname('»á¼ÆÆÚ¼ä').AsDateTime,getbsno(Logininfo.SeaImpBsNo,'SI'));
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['·ÑÓÃ״̬']:='¼Èë״̬';
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['¼þÊý´óд']
:='SAY:'+ntoc(data1.DataSet.FieldByName('¼þÊý').asfloat,true)
+data1.DataSet.FieldByName('°ü×°').asstring+' ONLY.';
data1.DataSet['±¸×¢']:=data2.DataSet['±¸×¢'];
data1.DataSet['²ÆÎñ']:=0;
data1.DataSet['²ÆÎñƾ֤']:='';
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['ÒµÎñ±àºÅ']:=ywno;
Data2.DataSet.Post;
close;
end;
procedure Tfrm_op_seai_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_seai_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.