|
|
unit u_op_seae_web_order_edit;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, ExtCtrls, DB, ADODB, dxExEdtr, dxCntner, dxTL,
|
|
|
dxDBCtrl, dxDBGrid, ComCtrls, bsSkinTabs, RxLookup, StdCtrls, Mask,
|
|
|
DBCtrls, wwdbdatetimepicker, wwdblook, u_op_sate, u_fee, u_op_card, Menus,
|
|
|
dxDBTLCl, dxGrClms, bsdbctrls, XPMenu, wwdbedit, Wwdotdot, Wwdbcomb,
|
|
|
Grids, Wwdbigrd, Wwdbgrid, DBGrids,IdSMTP,IdMessage;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_web_order_edit = class(TForm)
|
|
|
Panel2: TPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
t_op_seae: TADOQuery;
|
|
|
t_op_seae1: TDataSource;
|
|
|
XPMenu1: TXPMenu;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
t_op_ctn1: TDataSource;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
t_op_seae_insert: TADOQuery;
|
|
|
t_op_seae_insert1: TDataSource;
|
|
|
t_op_ctn_insert: TADOQuery;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
Label2: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label21: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label23: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBEdit2: TDBEdit;
|
|
|
DBEdit4: TDBEdit;
|
|
|
DBEdit3: TDBEdit;
|
|
|
DBEdit5: TDBEdit;
|
|
|
DBEdit6: TDBEdit;
|
|
|
DBEdit7: TDBEdit;
|
|
|
DBEdit8: TDBEdit;
|
|
|
DBMemo3: TDBMemo;
|
|
|
DBEdit14: TDBEdit;
|
|
|
DBEdit15: TDBEdit;
|
|
|
wwDBComboBox15: TwwDBComboBox;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label11: TLabel;
|
|
|
Label12: TLabel;
|
|
|
Label13: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label15: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Label17: TLabel;
|
|
|
Label18: TLabel;
|
|
|
Label19: TLabel;
|
|
|
Label20: TLabel;
|
|
|
Label25: TLabel;
|
|
|
Label26: TLabel;
|
|
|
Label27: TLabel;
|
|
|
Label28: TLabel;
|
|
|
Label29: TLabel;
|
|
|
Label30: TLabel;
|
|
|
Label31: TLabel;
|
|
|
Label32: TLabel;
|
|
|
Label33: TLabel;
|
|
|
Label34: TLabel;
|
|
|
Label35: TLabel;
|
|
|
Label36: TLabel;
|
|
|
Label37: TLabel;
|
|
|
Label38: TLabel;
|
|
|
Label39: TLabel;
|
|
|
Label40: TLabel;
|
|
|
Label41: TLabel;
|
|
|
Label42: TLabel;
|
|
|
Label43: TLabel;
|
|
|
Label44: TLabel;
|
|
|
DBMemo1: TDBMemo;
|
|
|
DBMemo4: TDBMemo;
|
|
|
DBMemo5: TDBMemo;
|
|
|
DBMemo38: TDBMemo;
|
|
|
DBMemo2: TDBMemo;
|
|
|
DBEdit9: TDBEdit;
|
|
|
DBEdit10: TDBEdit;
|
|
|
DBEdit11: TDBEdit;
|
|
|
DBEdit12: TDBEdit;
|
|
|
DBEdit13: TDBEdit;
|
|
|
DBEdit16: TDBEdit;
|
|
|
DBEdit18: TDBEdit;
|
|
|
DBEdit19: TDBEdit;
|
|
|
DBEdit20: TDBEdit;
|
|
|
DBEdit21: TDBEdit;
|
|
|
DBEdit22: TDBEdit;
|
|
|
DBEdit23: TDBEdit;
|
|
|
DBEdit24: TDBEdit;
|
|
|
DBEdit25: TDBEdit;
|
|
|
DBEdit26: TDBEdit;
|
|
|
DBEdit27: TDBEdit;
|
|
|
DBEdit28: TDBEdit;
|
|
|
DBEdit29: TDBEdit;
|
|
|
DBEdit30: TDBEdit;
|
|
|
DBEdit31: TDBEdit;
|
|
|
DBEdit32: TDBEdit;
|
|
|
DBEdit33: TDBEdit;
|
|
|
DBEdit34: TDBEdit;
|
|
|
DBEdit35: TDBEdit;
|
|
|
DBEdit36: TDBEdit;
|
|
|
DBEdit17: TDBEdit;
|
|
|
Label10: TLabel;
|
|
|
DBEdit37: TDBEdit;
|
|
|
Label24: TLabel;
|
|
|
DBGrid1: TDBGrid;
|
|
|
OP_STATUS_LOG: TADOQuery;
|
|
|
Label45: TLabel;
|
|
|
DBEdit38: TDBEdit;
|
|
|
Label46: TLabel;
|
|
|
DBEdit39: TDBEdit;
|
|
|
lblctn: TLabel;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure Panel2Resize(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure Notebook1PageChanged(Sender: TObject);
|
|
|
procedure RxDBLookupCombo5Enter(Sender: TObject);
|
|
|
procedure RxDBLookupCombo5Exit(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
m_bsno:string;
|
|
|
m_qryTask:TADOQuery;
|
|
|
procedure setconcolor; //<2F><><EFBFBD>ÿؼ<C3BF><D8BC><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
function getkingpkgs(kindpkgscode:string):string;
|
|
|
function GetDeptname(Port:String): String;
|
|
|
public
|
|
|
public procedure InitialData( qryTask:TADOQuery; bsno1:string);
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_web_order_edit: Tfrm_op_seae_web_order_edit;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main,u_data_share, my_sys_function, u_sys_progress,
|
|
|
u_op_seae_apply_add, u_op_add_code, u_op_date_change, u_op_ctn,
|
|
|
u_op_seae_web_add, u_sendmail_msg;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.setconcolor;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.Panel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(Panel2.Width/12);
|
|
|
bsSkinButton1.Width:=i;
|
|
|
bsSkinButton2.Width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
|
|
|
t_op_seae.Close;
|
|
|
t_op_seae.SQL.clear;
|
|
|
t_op_seae.SQL.Add('select B.*,case B.BSSTATUS when ''Create'' then ''¼<><C2BC>'' when ''Confirm'' then ''<27><>ȷ<EFBFBD><C8B7>'' when ''Submit'' then ''<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>''');
|
|
|
t_op_seae.SQL.Add('when ''Back'' then ''<27><><EFBFBD><EFBFBD>'' else '''' end BSSTATUSREF ');
|
|
|
t_op_seae.SQL.Add(',u.EMAIL CUSTEMAIL,u.TEL,u.[NAME] CUSTATTN,u.REC_BC_MAIL,CASE WHEN U.IS_ADMIN=1 THEN INFO_CLIENT ELSE (select info_client from SYS_USER where GID=U.PARENT_ID) END ί<>е<EFBFBD>λ');
|
|
|
t_op_seae.SQL.Add(' from OP_SEAE_ORDER B LEFT JOIN SYS_USER U ON (U.GID=B.USERID) where B.BSSTATUS<>''Create'' and B.ORDNO='''+m_bsno+''' '
|
|
|
+' order by B.ETD DESC');
|
|
|
t_op_seae.open;
|
|
|
t_op_ctn.Open;
|
|
|
lblctn.Caption:='';
|
|
|
if ((t_op_seae.FieldByName('CARGOID').AsString<>'R') OR (t_op_seae.FieldByName('CARGOID').AsString='')) then begin
|
|
|
t_op_ctn.First;
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
if ((Pos('RF',t_op_ctn.FieldByName('CTNALL').AsString)>0) OR (Pos('RH',t_op_ctn.FieldByName('CTNALL').AsString)>0)) THEN
|
|
|
lblctn.Caption:='ע<><D7A2>:<3A><>Ʊҵ<C6B1><D2B5>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>';
|
|
|
t_op_ctn.Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.Notebook1PageChanged(Sender: TObject);
|
|
|
begin
|
|
|
setconcolor;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.RxDBLookupCombo5Enter(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>' ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.RxDBLookupCombo5Exit(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
i: Integer;
|
|
|
bsno,ywno,sql,mailremarks,mailto,mailtitle,cntrstr:String;
|
|
|
aQuery:TAdoQuery;
|
|
|
SMTP1:TIdSMTP;
|
|
|
IdMsg:TIdMessage;
|
|
|
begin
|
|
|
|
|
|
if not assigned(frm_sendmail_msg) then
|
|
|
frm_sendmail_msg:=tfrm_sendmail_msg.Create (self);
|
|
|
frm_sendmail_msg.Memo2.Clear;
|
|
|
frm_sendmail_msg.Memo4.Clear;
|
|
|
frm_sendmail_msg.Memo1.Clear;
|
|
|
frm_sendmail_msg.Memo2.Lines.Add(DBEdit3.Text);
|
|
|
frm_sendmail_msg.Memo4.Lines.Add('<27><><EFBFBD>ܶ<EFBFBD><DCB6><EFBFBD>:|ETD:'+t_op_seae.FieldByName('ETD').AsString+'|<7C><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString+':ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>չ<EFBFBD>˾:<3A>ൺ<EFBFBD>ݷ<EFBFBD>');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>:'+t_op_seae.FieldByName('ORDERNO').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('ETD').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('CNTRTOTAL').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add(MailSignName);
|
|
|
|
|
|
if frm_sendmail_msg.ShowModal = mrOK then
|
|
|
begin
|
|
|
mailremarks:=frm_sendmail_msg.Memo1.Text;
|
|
|
mailto:=frm_sendmail_msg.Memo2.Text;
|
|
|
mailtitle:=frm_sendmail_msg.Memo4.Text;
|
|
|
end;
|
|
|
|
|
|
frm_main.db.BeginTrans;
|
|
|
|
|
|
|
|
|
try
|
|
|
if not t_op_seae_insert.Active then t_op_seae_insert.Open; //<2F><><EFBFBD><EFBFBD>
|
|
|
if not t_op_ctn_insert.Active then t_op_ctn_insert.Open; //
|
|
|
|
|
|
t_op_seae_insert.Insert;
|
|
|
bsno:=get_id;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('װ<>˷<EFBFBD>ʽ').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').Value:=Date;
|
|
|
t_op_seae_insert.FieldByName('<27>ܴ<EFBFBD>').AsInteger:=WeekofYear(Date);
|
|
|
t_op_seae_insert.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=date;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('ί<>е<EFBFBD>λ').AsString:=t_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString;
|
|
|
if frm_data_share.t_crm_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString,[]) then begin
|
|
|
// t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=GetDeptname(t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=getzqlx(t_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString);
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>һ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><>ע').AsString;
|
|
|
end;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SALECODE').AsString;
|
|
|
if (frm_data_share.t_sys_employee.Locate('<27><><EFBFBD><EFBFBD>',t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,[])) then begin
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=frm_data_share.t_sys_employee.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString:=frm_data_share.t_sys_employee.fieldbyname('<27><>Դ<EFBFBD><D4B4>ϸ').AsString;
|
|
|
end else if frm_data_share.t_crm_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString,[]) then begin
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=GetDeptname(t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>Դ<EFBFBD><D4B4>ϸ').AsString:=frm_data_share.t_sys_employee.fieldbyname('<27><>Դ<EFBFBD><D4B4>ϸ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=getzqlx(t_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString);
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>һ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><>ע').AsString;
|
|
|
end;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>ͷ<EFBFBD>Ա').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=department;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString:=t_op_seae.FieldByName('CARGOID').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>˾').AsString:=t_op_seae.FieldByName('CARRIER').AsString;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
With aQuery do begin
|
|
|
close;sql.Clear;
|
|
|
sql.Add('select Ĭ<>ϳ<EFBFBD>վ,Ĭ<>ϳ<EFBFBD>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_op_seae.FieldByName('CARRIER').AsString+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then begin
|
|
|
t_op_seae_insert.FieldByName('<27><>վ').AsString:=aQuery.fieldbyname('Ĭ<>ϳ<EFBFBD>վ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').AsString:=aQuery.fieldbyname('Ĭ<>ϳ<EFBFBD>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').AsString;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
|
|
|
ywno:=get_no(Date,getbsno(Logininfo.SeaExpBsNo,'SE'));
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=ywno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString:=t_op_seae.FieldByName('PONO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('ί<>б<EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ر<EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27>Ʒѱ<C6B7>').AsString:='';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5>״̬').AsString:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ǰ״̬').AsString:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='¼<><C2BC>״̬';
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27><>ͨ<EFBFBD><CDA8>';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOAD').AsString;
|
|
|
t_op_seae_insert.FieldByName('װ<>۴<EFBFBD><DBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOADID').AsString; //////??????
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('NOBILL').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SERVICE').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>ͷ').AsString:=t_op_seae.FieldByName('MARKS').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DESCRIPTION').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('SHIPPER').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('CONSIGNEE').AsString;
|
|
|
t_op_seae_insert.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('NOTIFYPARTY').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('BLFRT').AsString;
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').AsString:='QINGDAO,CHINA';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('KGS').AsString+'KGS';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('CBM').AsString+'CBM';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=t_op_seae.FieldByName('PKGS').AsInteger;
|
|
|
t_op_seae_insert.FieldByName('<27><>װ').AsString:=t_op_seae.FieldByName('KINDPKGS').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ').AsString:=t_op_seae.FieldByName('PKGS').AsString+t_op_seae_insert.FieldByName('<27><>װ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_seae.FieldByName('KGS').AsFloat;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_seae.FieldByName('CBM').AsFloat;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').AsString:='SAY:'+ntoc(t_op_seae.FieldByName('PKGS').asfloat,true)
|
|
|
+t_op_seae.FieldByName('KINDPKGS').asstring+' ONLY.';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DCLASS').AsString;
|
|
|
t_op_seae_insert.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DUNNO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').AsString:=t_op_seae.FieldByName('TEMPSET').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('REEFERF').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>Σ').AsString:=t_op_seae.FieldByName('FUWEI').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SHANDIAN').AsString;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('CONTRACTNO').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VESSEL').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VOYNO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_op_seae.FieldByName('ETD').Value;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGEID').AsString;
|
|
|
if (frm_data_share.t_code_disport.Locate('EDI<44><49><EFBFBD><EFBFBD>',t_op_seae.FieldByName('PORTDISCHARGEID').AsString,[])) then
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_disport.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').AsString
|
|
|
else
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGE').AsString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATIONID').AsString;
|
|
|
if (frm_data_share.t_code_disport.Locate('EDI<44><49><EFBFBD><EFBFBD>',t_op_seae.FieldByName('DESTINATIONID').AsString,[])) then
|
|
|
t_op_seae_insert.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString:=frm_data_share.t_code_disport.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').AsString
|
|
|
else t_op_seae_insert.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATION').AsString;
|
|
|
|
|
|
cntrstr:=t_op_seae.FieldByName('CNTRTOTAL').AsString;
|
|
|
cntrstr:=StringReplace(cntrstr,'/',' ',[]);
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><>װ<EFBFBD><D7B0>').AsString:=cntrstr;
|
|
|
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>϶<EFBFBD><CFB6>ձ<EFBFBD>ע').AsString:='<27>ͻ<EFBFBD><CDBB><EFBFBD>ϵ<EFBFBD><CFB5>:'+t_op_seae.FieldByName('CUSTATTN').AsString+' TEL:'+t_op_seae.FieldByName('TEL').AsString+' EMAIL:'+t_op_seae.FieldByName('CUSTEMAIL').AsString
|
|
|
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦ<EFBFBD><C8BE>:'+t_op_seae.FieldByName('HAIYANGWURANWU').AsString
|
|
|
+#13#10+'<27><>װΣ<D7B0><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('DangerType').AsString
|
|
|
+#13#10+t_op_seae.FieldByName('REMARK').AsString
|
|
|
+#13#10+t_op_seae.FieldByName('EDIREMARK').AsString;
|
|
|
|
|
|
|
|
|
// t_op_seae_insert.FieldByName('EDI<44><49>ע').AsString:=t_op_seae.FieldByName('EDIREMARK').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>ĵ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>˰').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD>ͨ<EFBFBD><CDA8>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD>ǩ<EFBFBD><C7A9>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:='';
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6>½<EFBFBD><C2BD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6>½<EFBFBD><C2BD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('½<><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ƾ֤').Value:='';
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>˲<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('Ԥ¼<D4A4><C2BC>').Value:=1;
|
|
|
t_op_seae_insert['VGM']:=1;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>').Value:=1;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('BC״̬').Value:='N';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ƾ֤').Value:='';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('ISSUETYPE').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('BLFRT').AsString;
|
|
|
// if (t_op_seae.FieldByName('BLFRT').AsString='FREIGHT COLLECT') then
|
|
|
t_op_seae_insert.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString;
|
|
|
// else
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PAYABLEAT').AsString;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Ӧ<>պ<EFBFBD><D5BA>˷<EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.Post;
|
|
|
|
|
|
|
|
|
|
|
|
if (not t_op_ctn.IsEmpty) then
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn_insert.Close;
|
|
|
t_op_ctn_insert.Open;
|
|
|
with t_op_ctn do begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
t_op_ctn_insert.Insert;
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CTNNUM'];
|
|
|
if frm_data_share.t_code_ctn.Locate('MSC<53><43><EFBFBD><EFBFBD>',t_op_ctn['CTNALL'],[]) then
|
|
|
begin
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn_insert['<27>ߴ<EFBFBD>']:=frm_data_share.t_code_ctn['<27>ߴ<EFBFBD>'];
|
|
|
if frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
t_op_ctn_insert['TEU']:=1*t_op_ctn_insert.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
|
if (frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
(frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
t_op_ctn_insert['TEU']:=2*t_op_ctn_insert.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:='';
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn_insert['<27>ߴ<EFBFBD>']:='';
|
|
|
t_op_ctn_insert['TEU']:=0;
|
|
|
end;
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['PKGS'];
|
|
|
t_op_ctn_insert['<27><>װ']:=getkingpkgs(t_op_ctn.FieldByName('KINDPKGS').AsString);
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['KGS'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CBM'];
|
|
|
// t_op_ctn_insert['Ʒ<><C6B7>']:=t_op_ctn['GOODSNAME'];
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=bsno;
|
|
|
t_op_ctn_insert.post;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
end;
|
|
|
update_ctn(t_op_ctn_insert);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
t_op_seae.Edit;
|
|
|
t_op_seae.fieldbyname('BSSTATUS').AsString:='Confirm';
|
|
|
t_op_seae.fieldbyname('BSNO').AsString:=bsno;
|
|
|
t_op_seae.fieldbyname('BusinessNO').AsString:=ywno;
|
|
|
t_op_seae.Post;
|
|
|
OP_STATUS_LOG.Close;
|
|
|
OP_STATUS_LOG.SQL.Text:='INSERT INTO OP_STATUS_LOG (GID,RELATIVE_ID,STATUS,OP_TIME,OP_USER)VALUES (NEWID(),'''+t_op_seae.Fieldbyname('ORDNO').AsString+''',''OrderConfirm'',GETDATE(),'''+employee+''')';
|
|
|
OP_STATUS_LOG.ExecSQL;
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27>ѽ<EFBFBD><D1BD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27>ѽ<EFBFBD><D1BD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
finally
|
|
|
if frm_main.db.InTransaction then
|
|
|
begin
|
|
|
frm_main.db.RollbackTrans;
|
|
|
end;
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
if (Trim(mailto)<>'') then begin
|
|
|
SMTP1:=TIdSMTP.Create(nil);
|
|
|
IdMsg:=TIdMessage.Create(nil);
|
|
|
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
|
|
|
SMTP1.username:=MailAddress;
|
|
|
SMTP1.Password :=MailPw;
|
|
|
// SMTP1.Host :='smtpcom.263xmail.com';
|
|
|
SMTP1.Host :='mail.sdsmartlogistics.com';
|
|
|
|
|
|
SMTP1.Port :=25;
|
|
|
try
|
|
|
SMTP1.Connect;
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
|
|
|
end;
|
|
|
end;
|
|
|
if not SMTP1.Connected then
|
|
|
begin
|
|
|
SMTP1.Connect;
|
|
|
end;
|
|
|
with IdMsg do
|
|
|
begin
|
|
|
Body.Text:=mailremarks;
|
|
|
From.address :=MailAddress;
|
|
|
Recipients.EMailAddresses :=mailto;
|
|
|
Subject:=mailtitle;
|
|
|
CharSet:='GB2312';
|
|
|
end;
|
|
|
if not SMTP1.Connected then
|
|
|
begin
|
|
|
Sleep(1000);
|
|
|
SMTP1.Connect;
|
|
|
end;
|
|
|
SMTP1.Send(IdMsg);
|
|
|
Insert_mail_Log(BSNO,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>',mailto,mailtitle,mailremarks,'');
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.InitialData(qryTask: TADOQuery;
|
|
|
bsno1: string);
|
|
|
begin
|
|
|
m_qryTask:=qryTask;
|
|
|
m_bsno:=bsno1;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_order_edit.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
sql:string;
|
|
|
mailremarks,mailto,mailtitle:String;
|
|
|
SMTP1:TIdSMTP;
|
|
|
IdMsg:TIdMessage;
|
|
|
begin
|
|
|
if( Application.MessageBox(PChar('<27><>ȷʵҪֱ<D2AA>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӹر<D3B9><D8B1><EFBFBD><EFBFBD><EFBFBD>!,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
|
|
|
Exit;
|
|
|
try
|
|
|
|
|
|
if not assigned(frm_sendmail_msg) then
|
|
|
frm_sendmail_msg:=tfrm_sendmail_msg.Create (self);
|
|
|
frm_sendmail_msg.Memo2.Clear;
|
|
|
frm_sendmail_msg.Memo4.Clear;
|
|
|
frm_sendmail_msg.Memo1.Clear;
|
|
|
frm_sendmail_msg.Memo2.Lines.Add(DBEdit3.Text);
|
|
|
frm_sendmail_msg.Memo4.Lines.Add('<27><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD>:|ETD:'+t_op_seae.FieldByName('ETD').AsString+'|<7C><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString+':ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>չ<EFBFBD>˾:<3A>ൺ<EFBFBD>ݷ<EFBFBD>');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>:'+t_op_seae.FieldByName('ORDERNO').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('ETD').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('CNTRTOTAL').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add('');
|
|
|
frm_sendmail_msg.Memo1.Lines.Add(MailSignName);
|
|
|
|
|
|
if frm_sendmail_msg.ShowModal = mrOK then
|
|
|
begin
|
|
|
mailremarks:=frm_sendmail_msg.Memo1.Text;
|
|
|
mailto:=frm_sendmail_msg.Memo2.Text;
|
|
|
mailtitle:=frm_sendmail_msg.Memo4.Text;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
//** m_qryTask.Connection.BeginTrans;
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
|
|
|
t_op_seae.Edit;
|
|
|
t_op_seae.fieldbyname('BSSTATUS').AsString:='Back';
|
|
|
t_op_seae.Post;
|
|
|
//
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
//** m_qryTask.Connection.CommitTrans;
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close();
|
|
|
except
|
|
|
on e:Exception do
|
|
|
begin
|
|
|
// on except
|
|
|
//* m_qryTask.Connection.RollbackTrans;
|
|
|
m_qryTask.Cancel();
|
|
|
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
if (Trim(mailto)<>'') then begin
|
|
|
SMTP1:=TIdSMTP.Create(nil);
|
|
|
IdMsg:=TIdMessage.Create(nil);
|
|
|
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
|
|
|
SMTP1.username:=MailAddress;
|
|
|
SMTP1.Password :=MailPw;
|
|
|
// SMTP1.Host :='smtpcom.263xmail.com';
|
|
|
SMTP1.Host :='mail.sdsmartlogistics.com';
|
|
|
|
|
|
SMTP1.Port :=25;
|
|
|
try
|
|
|
SMTP1.Connect;
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
|
|
|
end;
|
|
|
end;
|
|
|
if not SMTP1.Connected then
|
|
|
begin
|
|
|
SMTP1.Connect;
|
|
|
end;
|
|
|
with IdMsg do
|
|
|
begin
|
|
|
Body.Text:=mailremarks;
|
|
|
From.address :=MailAddress;
|
|
|
Recipients.EMailAddresses :=mailto;
|
|
|
Subject:=mailtitle;
|
|
|
CharSet:='GB2312';
|
|
|
end;
|
|
|
if not SMTP1.Connected then
|
|
|
begin
|
|
|
Sleep(1000);
|
|
|
SMTP1.Connect;
|
|
|
end;
|
|
|
SMTP1.Send(IdMsg);
|
|
|
Insert_mail_Log('','<27><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD>',mailto,mailtitle,mailremarks,'');
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_web_order_edit.GetDeptname(Port: String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+Port+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_web_order_edit.getkingpkgs(
|
|
|
kindpkgscode: string): string;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
if (kindpkgscode='') then begin
|
|
|
result:='';
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> from t_code_package where EDI<44><49><EFBFBD><EFBFBD>='''+kindpkgscode+'''');
|
|
|
Open;
|
|
|
if IsEmpty then
|
|
|
Result:='a'
|
|
|
else
|
|
|
Result:=FieldByName('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|