|
|
unit u_op_seae_edi_msk_new;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls,inifiles, DB, ADODB,IdFTP,IdFTPCommon,
|
|
|
ExtCtrls, bsSkinBoxCtrls, FtpCli,IdMultipartFormData,IdHTTP,IdGlobalProtocols,superobject;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_edi_msk_new = class(TForm)
|
|
|
Label2: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Edit2: TEdit;
|
|
|
Edit1: TEdit;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
SaveDialog1: TSaveDialog;
|
|
|
Label3: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Edit3: TEdit;
|
|
|
Edit4: TEdit;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
Label5: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Edit5: TEdit;
|
|
|
Edit6: TEdit;
|
|
|
Edit7: TEdit;
|
|
|
RadioGroup1: TRadioGroup;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
GroupBox1: TGroupBox;
|
|
|
Label8: TLabel;
|
|
|
Edit8: TEdit;
|
|
|
Edit9: TEdit;
|
|
|
Edit10: TEdit;
|
|
|
Label9: TLabel;
|
|
|
Label10: TLabel;
|
|
|
Edit11: TEdit;
|
|
|
Label11: TLabel;
|
|
|
RadioGroup2: TRadioGroup;
|
|
|
t_op_edi: TADOQuery;
|
|
|
Label12: TLabel;
|
|
|
Edit12: TEdit;
|
|
|
RadioGroup3: TRadioGroup;
|
|
|
Label13: TLabel;
|
|
|
Edit13: TEdit;
|
|
|
bsck: TbsSkinCheckRadioBox;
|
|
|
t_op_edictn: TADOQuery;
|
|
|
bsSkinComboBox1: TbsSkinComboBox;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
FtpClient1: TFtpClient;
|
|
|
CheckBox1: TCheckBox;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
t_op_dgform: TADOQuery;
|
|
|
t_op_dgform_ctn: TADOQuery;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
|
|
|
function get_txtBooking(str:Tstringlist):integer;
|
|
|
function get_txtBookingYT(str:Tstringlist):integer;
|
|
|
function get_txtBookingBaK(str:Tstringlist):integer;
|
|
|
function get_txtSI(str:Tstringlist):integer;
|
|
|
function get_txtvgm(str:Tstringlist):integer;
|
|
|
function get_goods(str:widestring):widestring;
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
|
function isEditrue:boolean;
|
|
|
|
|
|
function GetCtnCode(ctnkind,ctnsize:String):String;
|
|
|
function GetCtnTypeCode(ctnsize:String):String;
|
|
|
function GetPkgCode(Pkg:String):String;
|
|
|
function GetPkgDgCode(Pkg:String):String;
|
|
|
function GetPort(PortID:String): String;
|
|
|
function GetPortEdiID(Port:String): String;
|
|
|
function GetShipEdiNO(Ship:String): String;
|
|
|
function Changestr(str:widestring):string;
|
|
|
function GetCtnNumPkg(CtnNum:String):String;
|
|
|
|
|
|
function GetLengthword(var s: String; l: Integer;str:String): String;
|
|
|
procedure GetLengthTString(var sl:TStringList;l:integer);
|
|
|
function GetStrNum(str:String):integer;
|
|
|
function GetCharNum(str:String):integer;
|
|
|
function IsZhongwen(Str:String):Boolean;
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure RadioGroup2Click(Sender: TObject);
|
|
|
procedure bsSkinComboBox1Change(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
function GetCtnGoods(bsno:String):String;
|
|
|
function ControlLines(LinesCount,CorpTypeid,BsTypeid:Integer;SName:string):String;
|
|
|
function CreateSIEdiFile_MBL:string;
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_edi_msk_new: Tfrm_op_seae_edi_msk_new;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_op_seae, my_sys_function, u_main, u_data_share, u_op_seae_assistant;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.ControlLines(LinesCount,CorpTypeid,BsTypeid:Integer;SName:string):String;
|
|
|
begin
|
|
|
Result:='';
|
|
|
if LinesCount>5 then
|
|
|
begin
|
|
|
if RadioGroup2.ItemIndex=5 then
|
|
|
begin
|
|
|
case CorpTypeid of
|
|
|
0:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:-<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:-<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
1:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:--<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:--<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
2:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:---<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:---<2D>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
case CorpTypeid of
|
|
|
0:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:*<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:*<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
1:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:**<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:**<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
2:begin
|
|
|
case BsTypeid of
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:***<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:***<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetCtnGoods(bsno:String):String;
|
|
|
var at_op_ctn,at_op_ctndetail :TADOQuery;
|
|
|
ctnlist:TStringList;
|
|
|
b_ctncount:Boolean;
|
|
|
begin
|
|
|
result:='';
|
|
|
|
|
|
at_op_ctn:=CreateAdoQuery;
|
|
|
at_op_ctndetail:=CreateAdoQuery;
|
|
|
ctnlist:=TStringList.Create;
|
|
|
ctnlist.Clear;
|
|
|
with at_op_ctn do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select ctn_id from t_op_ctn');
|
|
|
SQL.Add('where <20><><EFBFBD><EFBFBD>=:bsno');
|
|
|
Parameters.ParamByName('bsno').Value:=bsno;
|
|
|
open;First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
ctnlist.Add(FieldByName('ctn_id').AsString);
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if Trim(ctnlist.CommaText)<>'' then
|
|
|
with at_op_ctndetail do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select count(ctn_id) ctn_id from t_op_ctn_detail');
|
|
|
SQL.Add('where ctn_id in ('+ctnlist.CommaText+')');
|
|
|
Open;
|
|
|
if FieldByName('ctn_id').AsInteger>0 then
|
|
|
b_ctncount:=True;
|
|
|
end;
|
|
|
|
|
|
if b_ctncount then
|
|
|
begin
|
|
|
with at_op_ctndetail do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select ctn_id,sum(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> from t_op_ctn_detail');
|
|
|
SQL.Add('where ctn_id=:ctn_id');
|
|
|
SQL.Add('Group by ctn_id');
|
|
|
end;
|
|
|
|
|
|
with at_op_ctn do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select ctn_id,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> from t_op_ctn');
|
|
|
SQL.Add('where <20><><EFBFBD><EFBFBD>=:bsno');
|
|
|
Parameters.ParamByName('bsno').Value:=bsno;
|
|
|
open;First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
at_op_ctndetail.Close;
|
|
|
at_op_ctndetail.Parameters.ParamByName('ctn_id').Value:=FieldByName('ctn_id').AsInteger;
|
|
|
at_op_ctndetail.Open;
|
|
|
if at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger<>FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger then
|
|
|
begin
|
|
|
if Trim(result)='' then
|
|
|
result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString
|
|
|
else result:=result+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
if at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat<>FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat then
|
|
|
begin
|
|
|
if Trim(result)='' then
|
|
|
result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString
|
|
|
else result:=result+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
|
|
|
if at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat<>FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat then
|
|
|
begin
|
|
|
if Trim(result)='' then
|
|
|
result:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString
|
|
|
else result:=result+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD>:'+at_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>:'+FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
try
|
|
|
finally
|
|
|
at_op_ctn.Free;
|
|
|
at_op_ctndetail.Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.isEditrue: boolean;
|
|
|
var
|
|
|
cntrs,s,Edis,cntrGoods,Goods,Lines,ishaveinp:String;
|
|
|
sl:TStringList;
|
|
|
i:integer;
|
|
|
|
|
|
begin
|
|
|
result:=true;
|
|
|
sl:=TStringList.Create;
|
|
|
t_op_edi.Close;
|
|
|
t_op_edi.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_edi.Open;
|
|
|
t_op_dgform.Close;
|
|
|
t_op_dgform.Parameters.ParamByName('BSNO').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_dgform.Open;
|
|
|
|
|
|
if Edit1.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
else Edis:=Edis+','+'<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
if Edit2.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
else Edis:=Edis+','+'<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
if Edit3.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
else Edis:=Edis+','+'<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
if Edit4.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
else Edis:=Edis+','+'<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
if Edit5.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27>̶<EFBFBD><CCB6>绰'
|
|
|
else Edis:=Edis+','+'<27>̶<EFBFBD><CCB6>绰';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if Edit7.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27><>ϵ<EFBFBD><CFB5>'
|
|
|
else Edis:=Edis+','+'<27><>ϵ<EFBFBD><CFB5>';
|
|
|
end;
|
|
|
|
|
|
if Edit6.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27>ʼ<EFBFBD><CABC><EFBFBD>ַ'
|
|
|
else Edis:=Edis+','+'<27>ʼ<EFBFBD><CABC><EFBFBD>ַ';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if Edit12.Text='' then
|
|
|
begin
|
|
|
if trim(Edis)='' then
|
|
|
Edis:='<27>ʼ<EFBFBD><CABC><EFBFBD>ַ'
|
|
|
else Edis:=Edis+','+'<27>ʼ<EFBFBD><CABC><EFBFBD>ַ';
|
|
|
end;
|
|
|
|
|
|
if trim(Edis)<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg(trim(Edis)+'<27><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ᵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD><D6B5>ᵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if Trim(GetIsDggoods(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring))<>'' then
|
|
|
begin
|
|
|
// result:=false;
|
|
|
if MessageDlg('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin
|
|
|
result:=false;
|
|
|
|
|
|
end else begin
|
|
|
end;
|
|
|
// exit;
|
|
|
end;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring)='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if GetShipEdiNO(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring)='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD>˾EDI<44><49><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)='' then begin
|
|
|
if MessageDlg('ע<><D7A2>EDI<44><49>עΪ<D7A2><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?',mtWarning,[mbyes,mbno],0)=mrNO then
|
|
|
begin
|
|
|
result:=false;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if pos(':',frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)>0 then begin
|
|
|
//result:=false;
|
|
|
//MessageDlg('EDI<44><49>ע<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD> : <20>ַ<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString)='' then begin
|
|
|
if MessageDlg('ע<><D7A2>EDI<44><49>עΪ<D7A2><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?',mtWarning,[mbyes,mbno],0)=mrNO then
|
|
|
begin
|
|
|
result:=false;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if pos(':',frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString)>0 then begin
|
|
|
//result:=false;
|
|
|
// MessageDlg('EDI<44><49>ע<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD> : <20>ַ<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װƤ<D7B0>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
}
|
|
|
//<2F>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>
|
|
|
|
|
|
sl.Clear;
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring);
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
begin
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>еڶ<D0B5>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
end;
|
|
|
if sl.Count>5 then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ڶ<EFBFBD>֪ͨ<CDA8>˲<EFBFBD><CBB2>ܴ<EFBFBD><DCB4><EFBFBD>5<EFBFBD><35>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then begin
|
|
|
sl.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
result:=false;
|
|
|
// Exit;
|
|
|
end;
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
Lines:=ControlLines(sl.Count,0,0,'AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,0,0,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if bsck.Checked then
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,0,1,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then begin
|
|
|
sl.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,1,0,'AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
end else begin
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,1,0,'<27>ջ<EFBFBD><D5BB><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
IF frm_op_seae.t_op_seae.fieldbyname('DOOR<4F><52>ַ').asstring='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ:CY-DOOR,SHIPPING TO<54><4F>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA> ',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('DOOR<4F><52>ַ').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>SHIPPING TO<54><4F>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('SHIPPING TO<54><4F>ַ<EFBFBD><D6B7>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if bsck.Checked then
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
begin
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD><D6B5>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,1,1,'<27>ջ<EFBFBD><D5BB><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then
|
|
|
begin
|
|
|
sl.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
begin
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
begin
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,2,0,'AMS֪ͨ<CDA8><D6AA>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,2,0,'֪ͨ<CDA8><D6AA>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if bsck.Checked then
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
Lines:=ControlLines(sl.Count,2,1,'֪ͨ<CDA8><D6AA>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
if Lines<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
// Exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>ͷ<EFBFBD><CDB7>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
sl.Clear;
|
|
|
sl.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if bsck.Checked then
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD><D6B5><EFBFBD>ͷ<EFBFBD><CDB7>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if bsck.Checked then
|
|
|
begin
|
|
|
sl.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ֵ<EFBFBD>EDI<44><49>Ϣ<EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
FreeAndNil(sl);
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('װ<>۴<EFBFBD><DBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if trim(GetLoadPortEdiID(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('װ<>۴<EFBFBD><DBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC> EDI<44><49><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>˸۲<CBB8><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDateTime<(now-300) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD>յ<EFBFBD>300<30><30><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Ŀ<>ĵش<C4B5><D8B4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if trim(GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring))='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD>ں<EFBFBD><DABA>˸ۿ<CBB8><DBBF><EFBFBD>ά<EFBFBD><CEAC>EDI<44><49><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
}
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
//xit;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
}
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if trim(GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring))='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('ж<><D0B6><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if GetPkgCode(trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring))='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat=0 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
{
|
|
|
if (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then begin
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if GetStrNum(Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring))<>4 then begin
|
|
|
result:=false;
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD>4λ<34><CEBB><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
end;
|
|
|
}
|
|
|
if (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then begin
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if GetStrNum(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring))<>3 then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶ȱ<C2B6><C8B1><EFBFBD><EFBFBD><EFBFBD>3λ<33><CEBB><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
if (trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)='')
|
|
|
or (GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)='') then
|
|
|
begin //<2F><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>(<28><>edi<64><69><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if Pos('COLLECT',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
if (trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)='')
|
|
|
or (frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring='') then
|
|
|
begin //<2F><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>(<28><>edi<64><69><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if RadioGroup1.ItemIndex=1 then begin
|
|
|
if (trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='')
|
|
|
or (GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='')
|
|
|
then begin //ǩ<><C7A9><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('ǩ<><C7A9><EFBFBD>ص<EFBFBD>(<28><>edi<64><69><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn.<2E>ߴ<EFBFBD>,t_op_ctn.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.Ʒ<><C6B7>,t_op_ctn.<2E><>,t_op_ctn.<2E><>,t_op_ctn.<2E><> ');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E>ߴ<EFBFBD>,t_op_ctn_fendan.<2E><>װ,t_op_ctn_fendan.<2E><>,t_op_ctn_fendan.<2E><>,t_op_ctn_fendan.<2E><>');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.Ʒ<><C6B7>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn_fendan INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn_fendan.as_id=:as_id');
|
|
|
t_op_ctn.Parameters.ParamByName('as_id').Value:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asinteger;
|
|
|
end;
|
|
|
|
|
|
|
|
|
t_op_ctn.open;
|
|
|
if t_op_ctn.IsEmpty then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD>䲻<EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
cntrs:=GetCtnCode(t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').asString,t_op_ctn.fieldByName('<27>ߴ<EFBFBD>').asString);
|
|
|
if cntrs='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<44><49><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='O') then
|
|
|
begin
|
|
|
if (t_op_ctn.FieldByName('<27><>').AsFloat=0) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>伯װ<E4BCAF>䳤<EFBFBD><E4B3A4><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if (t_op_ctn.FieldByName('<27><>').AsFloat=0) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>伯װ<E4BCAF><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if (t_op_ctn.FieldByName('<27><>').AsFloat=0) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>伯װ<E4BCAF><D7B0><EFBFBD>߲<EFBFBD><DFB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if t_op_ctn.fieldByName('Ʒ<><C6B7>').asString='' then
|
|
|
begin
|
|
|
if Goods='' then
|
|
|
Goods:=t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').asString+t_op_ctn.fieldByName('<27>ߴ<EFBFBD>').asString
|
|
|
else Goods:=Goods+#13#10+t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').asString+t_op_ctn.fieldByName('<27>ߴ<EFBFBD>').asString;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
{
|
|
|
if trim(Goods)<>'' then
|
|
|
MessageDlg('ע<><D7A2>'+#13#10+Goods+#13#10+'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
|
|
|
}
|
|
|
|
|
|
t_op_dgform.First;
|
|
|
while not t_op_dgform.Eof do begin
|
|
|
if trim(t_op_dgform.fieldbyname('PKGS').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Package Quantity(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('PACKINGCODE').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Package Code(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('CONTACT').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Contact Name(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('CONTACTTEL').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Contact Phone(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('WEIGHT').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Gross Weight(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('NET_WEIGHT').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Net Weight(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('UNNO').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Unno(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
{
|
|
|
if trim(t_op_dgform.fieldbyname('TECHNICAL_NAME').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Technical Name <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
}
|
|
|
if trim(t_op_dgform.fieldbyname('PROPER_SHIPPING_NAME').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Proper Shipping Name(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('IMO_CLASS').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('IMO Class(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
{
|
|
|
if trim(t_op_dgform.fieldbyname('PACKING_GROUP').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Packing Group(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
}
|
|
|
if trim(t_op_dgform.fieldbyname('EMS').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('EMS(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if trim(t_op_dgform.fieldbyname('MARINE_POLLUTANT').asstring)='' then begin //<2F><><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('Marine Pollutant(DG Form) <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
if (ishaveinp<>'') then begin
|
|
|
if (t_op_dgform.fieldbyname('INNERPKGS').AsInteger<>0) then begin
|
|
|
if (ishaveinp='N') then begin
|
|
|
result:=false;
|
|
|
MessageDlg('ΣƷ<CEA3>ڰ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>һ<EFBFBD>£<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
|
|
|
end else begin
|
|
|
if (ishaveinp='Y') then begin
|
|
|
result:=false;
|
|
|
MessageDlg('ΣƷ<CEA3>ڰ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>һ<EFBFBD>£<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('INNERPKGS').AsInteger<>0) then begin
|
|
|
ishaveinp:='Y';
|
|
|
end else begin
|
|
|
ishaveinp:='N';
|
|
|
end;
|
|
|
|
|
|
|
|
|
t_op_dgform.Next;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
begin
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='USA' then begin
|
|
|
if t_op_edi.FieldByName('<27>յ<EFBFBD><D5B5>걨<EFBFBD><EAB1A8>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>յ<EFBFBD><D5B5>걨<EFBFBD>߲<EFBFBD><DFB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>յ<EFBFBD><D5B5>걨<EFBFBD><EAB1A8>').asstring='<27>Լ<EFBFBD>' then begin
|
|
|
if t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('SCAC<41><43><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<CAB1><E0B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<CAB1><E0B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring)='' then begin //<2F><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='CANADA' then begin
|
|
|
if t_op_edi.FieldByName('<27>յ<EFBFBD><D5B5>걨<EFBFBD><EAB1A8>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>յ<EFBFBD><D5B5>걨<EFBFBD>߲<EFBFBD><DFB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>յ<EFBFBD><D5B5>걨<EFBFBD><EAB1A8>').asstring='<27>Լ<EFBFBD>' then begin
|
|
|
if t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('SCAC<41><43><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<CAB1><E0B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='BRAZIL' then begin
|
|
|
if t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'BR' then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('֪ͨ<CDA8><D6AA>˰<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD><EFBFBD>').asstring='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
cntrGoods:=GetCtnGoods(frm_op_seae.t_op_seae.fieldByName('<27><><EFBFBD><EFBFBD>').asString);
|
|
|
if trim(cntrGoods)<>'' then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg(cntrGoods,mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn.<2E>ߴ<EFBFBD>,t_op_ctn.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E>ߴ<EFBFBD>,t_op_ctn_fendan.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn_fendan INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn_fendan.as_id=:as_id');
|
|
|
t_op_ctn.Parameters.ParamByName('as_id').Value:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asinteger;
|
|
|
end;
|
|
|
t_op_ctn.open;
|
|
|
if t_op_ctn.IsEmpty then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><><EFBFBD>ŷ<EFBFBD><C5B7>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
cntrs:=t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').asString;
|
|
|
if GetCtnCode(t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldByName('<27>ߴ<EFBFBD>').asstring)='' then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<44><49><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
if ((GetStrNum(cntrs))<>7) or ((GetcharNum(cntrs))<>4) then begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>ȷ!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldByName('<27>ܼ<EFBFBD>').asfloat=0 then
|
|
|
begin
|
|
|
result:=false;
|
|
|
MessageDlg('<27><>Ƥ<EFBFBD>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>!',mtWarning,[mbOk],0);
|
|
|
// exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.get_goods(str:widestring):widestring;
|
|
|
var
|
|
|
str_all:Tstringlist;
|
|
|
r_str:widestring;
|
|
|
i:integer;
|
|
|
begin
|
|
|
str:=Changestr(trim(str));
|
|
|
str_all:=Tstringlist.Create;
|
|
|
str_all.Text:=str;
|
|
|
for i:=0 to str_all.Count-1 do
|
|
|
begin
|
|
|
r_str:=r_str+' '+str_all[i];
|
|
|
end;
|
|
|
result:=trim(r_str);
|
|
|
end;
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetCtnCode(ctnkind,ctnsize:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
ctnsize:=StringReplace(ctnsize,'''','''''',[rfReplaceAll]);
|
|
|
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+ctnkind+''' and <20>ߴ<EFBFBD>='''+ctnsize+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetCtnTypeCode(ctnsize:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
ctnsize:=StringReplace(ctnsize,'''','''''',[rfReplaceAll]);
|
|
|
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ='''+ctnsize+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetPkgCode(Pkg:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_package where <20><><EFBFBD><EFBFBD>='''+pkg+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
function Tfrm_op_seae_edi_msk_new.GetPkgDgCode(Pkg:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> from t_code_package_dg where DG<44><47><EFBFBD><EFBFBD>='''+pkg+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetPort(PortID:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD> Ӣ<><D3A2><EFBFBD><EFBFBD> from t_code_edi_port where EDI<44><49><EFBFBD><EFBFBD>='''+PortID+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('Ӣ<><D3A2><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetPortEdiID(Port:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_disport where Ӣ<><D3A2><EFBFBD><EFBFBD>='''+Port+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetShipEdiNO(Ship:String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD>,EDI<44><49><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client');
|
|
|
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20><><EFBFBD><EFBFBD>˾=1 and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
|
|
|
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.Changestr(str:widestring):string;
|
|
|
var
|
|
|
i:integer;
|
|
|
strC:widestring;
|
|
|
begin
|
|
|
strC:='';
|
|
|
for i:=1 to length(str) do
|
|
|
begin
|
|
|
if ((str[i]=#39) or (str[i]=':') or (str[i]='''') or (str[i]='+') or (str[i]='?')) then
|
|
|
begin
|
|
|
strC:=strC+'?'+str[i];
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
strC:=strC+str[i];
|
|
|
end;
|
|
|
end;
|
|
|
result:=Trim(strC);
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetLengthword(var s: String; l: Integer;str:String): String;
|
|
|
var
|
|
|
i:Integer;
|
|
|
b:Boolean;
|
|
|
begin
|
|
|
s:='';
|
|
|
if Length(str)<=l then begin
|
|
|
result:=str;
|
|
|
end else begin
|
|
|
b:=true;
|
|
|
s:=Copy(str,l+1,Length(str)-l);
|
|
|
str:=Copy(str,1,l);
|
|
|
result:='';
|
|
|
for i:=Length(str) downto 1 do begin
|
|
|
if (str[i]<>' ') and b then
|
|
|
s:=str[i]+s
|
|
|
else begin
|
|
|
b:=false;
|
|
|
result:=str[i]+Result;
|
|
|
end;
|
|
|
end;
|
|
|
s:=s+' ';
|
|
|
end;
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_edi_msk_new.GetLengthTString(var sl: TStringList; l: integer);
|
|
|
var
|
|
|
i:integer;
|
|
|
str_head,S:String;
|
|
|
Stemp:TStrings;
|
|
|
begin
|
|
|
Stemp:=TStringList.Create;
|
|
|
try
|
|
|
str_head:='';
|
|
|
S:='';
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if sl[i]<>'' then
|
|
|
stemp.add(GetLengthword(str_head,l,s+sl[i]));
|
|
|
S:=Str_head;
|
|
|
end;
|
|
|
while S<>'' do begin
|
|
|
stemp.add(GetLengthword(str_head,l,s));
|
|
|
S:=Str_head;
|
|
|
end;
|
|
|
SL.Assign(Stemp);
|
|
|
finally
|
|
|
FreeAndNil(Stemp);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetStrNum(str:String):integer;
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
result:=0;
|
|
|
if str='' then exit;
|
|
|
for i:=1 to length(Str) do begin
|
|
|
if str[i] in ['0','1','2','3','4','5','6','7','8','9'] then
|
|
|
result:=result+1;
|
|
|
end;
|
|
|
end;
|
|
|
function Tfrm_op_seae_edi_msk_new.GetCharNum(str:String):integer;
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
result:=0;
|
|
|
if str='' then exit;
|
|
|
for i:=1 to length(Str) do begin
|
|
|
if str[i] in ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] then
|
|
|
result:=result+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.IsZhongwen(Str: String): Boolean;
|
|
|
var
|
|
|
i:Integer;
|
|
|
begin
|
|
|
Result:=false;
|
|
|
if Str='' then Exit;
|
|
|
for i:=1 to Length(Str) do begin
|
|
|
if (Str[i]>Chr(127)) or (Str[i]=Chr(9)) then begin
|
|
|
// if (Str[i]>Chr(127)) or (Str[i]=Chr(9)) or (Str[i]='<') or (Str[i]='>') then begin
|
|
|
Result:=True;
|
|
|
Exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.get_txtBooking(str:Tstringlist):integer;
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
j,Count,i,ctncount,fj,ctni:integer;
|
|
|
str_guodu,str_shr,str_con,str_not:widestring;
|
|
|
str_pay,Str_head,strtmp,strtmp2,tmpunno,sendcode,tmp,tmppkgroup:string;
|
|
|
function CutVoyNo(VoyNo:String):String;
|
|
|
begin
|
|
|
if length(VoyNO)<3 then exit;
|
|
|
if Pos('.',VoyNO)>0 then begin
|
|
|
Result:=Copy(VoyNO,3,length(VoyNO)-2);
|
|
|
end else
|
|
|
Result:=VoyNO;
|
|
|
end;
|
|
|
begin
|
|
|
IF (bsSkinCheckRadioBox1.Checked) THEN begin
|
|
|
Result:=get_txtBookingYT(str);
|
|
|
EXIT;
|
|
|
end;
|
|
|
|
|
|
str_all:=Tstringlist.Create;
|
|
|
str.Add('UNA:+.? '+#39);
|
|
|
count:=0;
|
|
|
sendcode:='MAEU';
|
|
|
if (RadioGroup2.ItemIndex=2) then sendcode:='MCPU';
|
|
|
str.Add('UNB+UNOC:1+'+Edit1.TEXT+':ZZZ+'+sendcode
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
|
|
|
// count:=count+1;
|
|
|
str.Add('UNH+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+IFTMBF:D:99B:UN'+#39);
|
|
|
count:=count+1;
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39) //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
else str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39); //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('DTM+137:'+GetDatetime(datetimetostr(now),1)+':203'+#39);
|
|
|
count:=count+1;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1>');
|
|
|
result:=-1;
|
|
|
exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+27+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+28+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+29+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='OTHER' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)<>'' then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)
|
|
|
else sl.text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if (sl.Strings[i]<>'') then begin
|
|
|
str.Add('FTX+AAI+++'+sl.Strings[i]+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+BM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+CT:'+frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('TDT+20+'+CutVoyNo(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
+'+1+++++:::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if Trim(t_op_edi.fieldbyname('PRICEOWNER').AsString)<>'' then begin
|
|
|
if Length(t_op_edi.fieldbyname('PRICEOWNER').AsString)<=35 then
|
|
|
str.Add('NAD+PO+++'+t_op_edi.fieldbyname('PRICEOWNER').AsString+#39)
|
|
|
else str.Add('NAD+PO+++'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,1,35)+'+'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('LOC+9+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('LOC+88+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('DTM+133:'+GetDatetime(datetimetostr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime),0)+':102'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+11+'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('LOC+7+'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //?
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_all.Clear;
|
|
|
str_head:='';
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CZ+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,34)+'*';
|
|
|
Str_shr:='.*'+Copy(str_all[4],34,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_shr:=Str_shr+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CN+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,33)+'**';
|
|
|
Str_con:='.**'+Copy(str_all[4],33,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_con:=Str_con+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+'+CA'+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+NI+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,32)+'***';
|
|
|
Str_not:='.***'+Copy(str_all[4],32,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_not:=Str_not+' '+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'' then
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39
|
|
|
else
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring<>'' then begin
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if (not t_op_dgform.IsEmpty) then begin
|
|
|
ctncount:=1;
|
|
|
t_op_dgform.First;
|
|
|
while not t_op_dgform.Eof do begin
|
|
|
strtmp:='';
|
|
|
if (t_op_dgform.fieldbyname('INNERPACKINGCODE').asstring<>'') then begin
|
|
|
strtmp:='+'+t_op_dgform.fieldbyname('INNERPKGS').asstring+':'+t_op_dgform.fieldbyname('INNERPACKINGCODE').asstring+':67:6:';
|
|
|
end;
|
|
|
|
|
|
str.Add('GID+'+inttostr(ctncount)+'+'+t_op_dgform.fieldbyname('PKGS').asstring+':'+
|
|
|
Trim(StringReplace(t_op_dgform.fieldbyname('PACKINGCODE').asstring,'<27><>','',[]))+':67:6:'+strtmp+#39); //<2F><>
|
|
|
|
|
|
count:=count+1;
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
if (sl.Count>5)then begin
|
|
|
for i:=0 to 4 do begin
|
|
|
if (Changestr(sl.Strings[i])<>'') then begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end else begin
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if (Changestr(sl.Strings[i])<>'') then begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
{
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring)<>'' then
|
|
|
begin
|
|
|
str.Add('PCD+52:'+frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+G+KGM:'+t_op_dgform.fieldbyname('WEIGHT').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAL+KGM:'+t_op_dgform.fieldbyname('NET_WEIGHT').asstring+#39);
|
|
|
count:=count+1;
|
|
|
if (t_op_dgform.fieldbyname('NET_EXPLOSIVE_WEIGHT').asstring<>'') then begin
|
|
|
str.Add('MEA+AAE+T19+KGM:'+t_op_dgform.fieldbyname('NET_EXPLOSIVE_WEIGHT').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
{
|
|
|
if (t_op_dgform.fieldbyname('CAT').asstring<>'') then begin
|
|
|
str.Add('MEA+AAE+CAT+CEL:'+Changestr(t_op_dgform.fieldbyname('CAT').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
}
|
|
|
if (t_op_dgform.fieldbyname('SADT').asstring<>'') then begin
|
|
|
str.Add('MEA+AAE+SAD+CEL:'+Changestr(t_op_dgform.fieldbyname('SADT').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if t_op_dgform_ctn.Active then t_op_dgform_ctn.Close;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('BSNO').Value:= t_op_dgform.fieldbyname('<27><><EFBFBD><EFBFBD>').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('PACKINGCODE').Value:= t_op_dgform.fieldbyname('PACKINGCODE').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('UNNO').Value:= t_op_dgform.fieldbyname('UNNO').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('IMO_CLASS').Value:= t_op_dgform.fieldbyname('IMO_CLASS').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('PROPER_SHIPPING_NAME').Value:= t_op_dgform.fieldbyname('PROPER_SHIPPING_NAME').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('NET_EXPLOSIVE_WEIGHT').Value:= t_op_dgform.fieldbyname('NET_EXPLOSIVE_WEIGHT').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('SADT').Value:= t_op_dgform.fieldbyname('SADT').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('NA_NO').Value:= t_op_dgform.fieldbyname('NA_NO').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('SUB_HAZARD1').Value:= t_op_dgform.fieldbyname('SUB_HAZARD1').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('IMDG').Value:= t_op_dgform.fieldbyname('IMDG').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('FLASH_POINT').Value:= t_op_dgform.fieldbyname('FLASH_POINT').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('PACKING_GROUP').Value:= t_op_dgform.fieldbyname('PACKING_GROUP').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('EMS').Value:= t_op_dgform.fieldbyname('EMS').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('TECHNICAL_NAME').Value:= t_op_dgform.fieldbyname('TECHNICAL_NAME').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('MARINE_POLLUTANT').Value:= t_op_dgform.fieldbyname('MARINE_POLLUTANT').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('REPORTABLE_QUANTIFY').Value:= t_op_dgform.fieldbyname('REPORTABLE_QUANTIFY').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('EXCEPTED_QUANTIFY').Value:= t_op_dgform.fieldbyname('EXCEPTED_QUANTIFY').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('TRANSPORT_IN_LIMITED_QUANTIFY').Value:= t_op_dgform.fieldbyname('TRANSPORT_IN_LIMITED_QUANTIFY').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('CONTROL_TEMPERATURE').Value:= t_op_dgform.fieldbyname('CONTROL_TEMPERATURE').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('EMERGENCY_TEMPERATURE').Value:= t_op_dgform.fieldbyname('EMERGENCY_TEMPERATURE').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('SUFFIX').Value:= t_op_dgform.fieldbyname('SUFFIX').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('IMDG_COPE_SEGREGATION_GROUP').Value:= t_op_dgform.fieldbyname('IMDG_COPE_SEGREGATION_GROUP').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('INNERPACKINGCODE').Value:= t_op_dgform.fieldbyname('INNERPACKINGCODE').Value;
|
|
|
t_op_dgform_ctn.Parameters.ParamByName('SUB_HAZARD2').Value:= t_op_dgform.fieldbyname('SUB_HAZARD2').Value;
|
|
|
t_op_dgform_ctn.Open;
|
|
|
t_op_dgform_ctn.First;
|
|
|
while not t_op_dgform_ctn.Eof do begin
|
|
|
if (t_op_dgform_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring<>'') then begin
|
|
|
str.Add('SGP+'+t_op_dgform_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+6'+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str.Add('SGP+'+t_op_dgform_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+'+t_op_dgform_ctn.fieldbyname('PKGS').AsString+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
str.Add('MEA+AAE+G+KGM:'+t_op_dgform_ctn.fieldbyname('WEIGHT').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAL+KGM:'+t_op_dgform_ctn.fieldbyname('NET_WEIGHT').asstring+#39);
|
|
|
count:=count+1;
|
|
|
t_op_dgform_ctn.Next;
|
|
|
end;
|
|
|
|
|
|
strtmp:=Changestr(t_op_dgform.FieldByName('FLASH_POINT').asstring);
|
|
|
if (strtmp<>'') then begin
|
|
|
if (copy(strtmp,1,1)='-') then begin
|
|
|
strtmp:=copy(strtmp,2,Length(strtmp)-1);
|
|
|
while Length(strtmp)<3 do begin
|
|
|
strtmp:='0'+strtmp;
|
|
|
end;
|
|
|
strtmp:='-'+strtmp;
|
|
|
end else begin
|
|
|
while Length(strtmp)<3 do begin
|
|
|
strtmp:='0'+strtmp;
|
|
|
end;
|
|
|
end;
|
|
|
strtmp:=strtmp+':CEL';
|
|
|
end;
|
|
|
|
|
|
|
|
|
tmpunno:=t_op_dgform.FieldByName('UNNO').asstring;
|
|
|
if pos('-',tmpunno)>0 then begin
|
|
|
tmpunno:=Copy(tmpunno,1,pos('-',tmpunno)-1);
|
|
|
end;
|
|
|
|
|
|
strtmp2:= Changestr(t_op_dgform.FieldByName('SUB_HAZARD1').asstring);
|
|
|
if (t_op_dgform.FieldByName('SUB_HAZARD2').asstring<>'') then
|
|
|
strtmp2:=strtmp2+'/'+ Changestr(t_op_dgform.FieldByName('SUB_HAZARD2').asstring);
|
|
|
|
|
|
tmppkgroup:='';
|
|
|
tmp:=t_op_dgform.FieldByName('PACKING_GROUP').asstring;
|
|
|
if (tmp='I') THEN
|
|
|
tmppkgroup:='1';
|
|
|
if (tmp='II') THEN
|
|
|
tmppkgroup:='2';
|
|
|
if (tmp='III') THEN
|
|
|
tmppkgroup:='3';
|
|
|
if (tmppkgroup='') and (tmp<>'<27><>') then tmppkgroup:=tmp;
|
|
|
|
|
|
str.Add('DGS+IMD+'+t_op_dgform.FieldByName('IMO_CLASS').asstring+':'+strtmp2+':'+t_op_dgform.FieldByName('IMDG').asstring+'+'
|
|
|
+tmpunno+'+'+strtmp+'+'+tmppkgroup
|
|
|
+'+'+StringReplace(t_op_dgform.FieldByName('EMS').asstring,',','',[])+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if (t_op_dgform.fieldbyname('NA_NO').asstring<>'') then begin
|
|
|
str.Add('DGS+CFR+'+t_op_dgform.FieldByName('IMO_CLASS').asstring+':'+strtmp2+':'+t_op_dgform.FieldByName('IMDG').asstring+'+'
|
|
|
+t_op_dgform.FieldByName('NA_NO').asstring+'+'+strtmp+'+'+tmppkgroup
|
|
|
+'+'+StringReplace(t_op_dgform.FieldByName('EMS').asstring,',','',[])+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
str.Add('FTX+AAD++PSN:122:ZZZ+'+Changestr(t_op_dgform.fieldbyname('PROPER_SHIPPING_NAME').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
if (t_op_dgform.fieldbyname('TECHNICAL_NAME').asstring<>'') then begin
|
|
|
str.Add('FTX+AAD++TN:122:ZZZ+'+Changestr(t_op_dgform.fieldbyname('TECHNICAL_NAME').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('MARINE_POLLUTANT').asstring<>'') then begin
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=t_op_dgform.fieldbyname('MARINE_POLLUTANT').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAC++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('REPORTABLE_QUANTIFY').asstring='Reportable') then begin
|
|
|
str.Add('FTX+AAC++1'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('EXCEPTED_QUANTIFY').asstring='Excepted') then begin
|
|
|
str.Add('FTX+AAC++EQ'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('TRANSPORT_IN_LIMITED_QUANTIFY').asstring='Limited') then begin
|
|
|
str.Add('FTX+AAC++TLQ'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('CONTROL_TEMPERATURE').asstring<>'') then begin
|
|
|
str.Add('FTX+AAC++CTMP+'+Changestr(t_op_dgform.fieldbyname('CONTROL_TEMPERATURE').asstring)+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('SUFFIX').asstring<>'') then begin
|
|
|
str.Add('FTX+AAC++UNNOSUFFIX+'+t_op_dgform.fieldbyname('SUFFIX').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if (t_op_dgform.fieldbyname('IMDG_COPE_SEGREGATION_GROUP').asstring<>'') then begin
|
|
|
str.Add('FTX+AAC++SEG+IMDG CODE SEGREGATION GROUP-:'+t_op_dgform.fieldbyname('IMDG_COPE_SEGREGATION_GROUP').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
{
|
|
|
if (t_op_dgform.fieldbyname('FUMIGANT').asstring<>'') then begin
|
|
|
str.Add('FTX+AAC++FUMIGANT:'+Changestr(t_op_dgform.fieldbyname('FUMIGANT').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
}
|
|
|
str.Add('CTA+HE+:'+Changestr(t_op_dgform.fieldbyname('CONTACT').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Changestr(t_op_dgform.fieldbyname('CONTACTTEL').asstring)+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
ctncount:=ctncount+1;
|
|
|
t_op_dgform.Next;
|
|
|
end;
|
|
|
end else begin
|
|
|
|
|
|
//<2F><><EFBFBD>ղ<EFBFBD><D5B2><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
|
|
|
|
|
str.Add('GID+1+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
|
|
|
count:=count+1;
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
if (sl.Count>5)then begin
|
|
|
for i:=0 to 4 do begin
|
|
|
if (Changestr(sl.Strings[i])<>'') then begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end else begin
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if (Changestr(sl.Strings[i])<>'') then begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
{
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') or (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring)<>'' then
|
|
|
begin
|
|
|
str.Add('PCD+52:'+frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
{
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
get_goods(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+G+KGM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
{
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
}
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='D') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('DGS+IMD+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring
|
|
|
+'+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('CTA+HG+:'+edit7.text+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
ctncount:=1;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
for ctni:=1 to t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger do begin
|
|
|
if (t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString='') then begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN+'+inttostr(ctncount)+'+'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+1'+#39)
|
|
|
else
|
|
|
str.Add('EQD+CN+'+inttostr(ctncount)+'+'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+2'+#39); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'+'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+1'+#39)
|
|
|
else
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'+'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+2'+#39); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
// str.Add('EQN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
// count:=count+1;
|
|
|
ctncount:=ctncount+1;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='O') then
|
|
|
begin
|
|
|
str.Add('DIM+2+CMT:'+t_op_ctn.fieldbyname('<27><>').asstring+':'+t_op_ctn.fieldbyname('<27><>').asstring+':'+t_op_ctn.fieldbyname('<27><>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAS+CBM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
if ((frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T')) AND (Trim(frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring)<>'') then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAO+HMD:'+frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
strtmp:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring;
|
|
|
if (copy(strtmp,1,1)='-') then begin
|
|
|
strtmp:=copy(strtmp,2,Length(strtmp)-1);
|
|
|
while Length(strtmp)<3 do begin
|
|
|
strtmp:='0'+strtmp;
|
|
|
end;
|
|
|
strtmp:='-'+strtmp;
|
|
|
end else begin
|
|
|
while Length(strtmp)<3 do begin
|
|
|
strtmp:='0'+strtmp;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
str.Add('TMP+2+'+strtmp+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
// count:=count+1;
|
|
|
|
|
|
result:=count;
|
|
|
end;
|
|
|
function Tfrm_op_seae_edi_msk_new.get_txtBookingYT(str:Tstringlist):integer;
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
j,Count,i:integer;
|
|
|
str_guodu,str_shr,str_con,str_not:widestring;
|
|
|
str_pay,Str_head:string;
|
|
|
function CutVoyNo(VoyNo:String):String;
|
|
|
begin
|
|
|
if length(VoyNO)<3 then exit;
|
|
|
if Pos('.',VoyNO)>0 then begin
|
|
|
Result:=Copy(VoyNO,3,length(VoyNO)-2);
|
|
|
end else
|
|
|
Result:=VoyNO;
|
|
|
end;
|
|
|
begin
|
|
|
str_all:=Tstringlist.Create;
|
|
|
count:=0;
|
|
|
str.Add('UNB+UNOA:1+'+Edit1.TEXT+':ZZZ+'+Edit3.TEXT
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
str.Add('UNH+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+IFTMBF:D:99B:UN'+#39);
|
|
|
count:=count+1;
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39) //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
else str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39); //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
// str.Add('COM+'+EDIT5.Text+':TE'+#39);
|
|
|
// count:=count+1;
|
|
|
|
|
|
str.Add('DTM+137:'+GetDatetime(datetimetostr(now),1)+':203'+#39);
|
|
|
count:=count+1;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1>');
|
|
|
result:=-1;
|
|
|
exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+27+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+28+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+29+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='OTHER' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
{
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString;
|
|
|
}
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)<>'' then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)
|
|
|
else sl.text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAI+++'+sl.Strings[i]+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
{ str.Add('CNT+7:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':KGM''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+11:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+15:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':MTQ''');
|
|
|
count:=count+1;
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT PREPAID' then
|
|
|
begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT COLLECT' then begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
}
|
|
|
{
|
|
|
str.Add('LOC+73+'+trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+'::6:'+GetPort(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
{
|
|
|
if not (frm_op_seae.t_op_seae.fieldbyname('<27>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').asDatetime<(now-120)) then begin
|
|
|
ljp str.Add('DTM+95:'+GetDatetime(datetimetostr(frm_op_seae.t_op_seae.fieldbyname('<27>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').asDatetime),0)+':102'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+BM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
{
|
|
|
str.Add('RFF+ON:###NAD-CZ-ZZZ-['+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>').asstring+']'+#39);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
str.Add('RFF+CT:'+frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str.Add('CPI+4++P''')
|
|
|
else
|
|
|
str.Add('CPI+4++C''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('TDT+20+'+CutVoyNo(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
+'+1+++++:::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if Trim(t_op_edi.fieldbyname('PRICEOWNER').AsString)<>'' then begin
|
|
|
if Length(t_op_edi.fieldbyname('PRICEOWNER').AsString)<=35 then
|
|
|
str.Add('NAD+PO+++'+t_op_edi.fieldbyname('PRICEOWNER').AsString+#39)
|
|
|
else str.Add('NAD+PO+++'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,1,35)+'+'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('LOC+9+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('DTM+133:'+GetDatetime(datetimetostr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime),0)+':102'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+88+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+11+'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('LOC+7+'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //?
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_all.Clear;
|
|
|
str_head:='';
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CZ+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,34)+'*';
|
|
|
Str_shr:='.*'+Copy(str_all[4],34,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_shr:=Str_shr+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CN+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,33)+'**';
|
|
|
Str_con:='.**'+Copy(str_all[4],33,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_con:=Str_con+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+'+CA'+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+NI+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,32)+'***';
|
|
|
Str_not:='.***'+Copy(str_all[4],32,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_not:=Str_not+' '+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'' then
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39
|
|
|
else
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring<>'' then begin
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
|
|
|
{
|
|
|
str_all.Text:=Changestr(edit12.text);
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+SF+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 4 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring); //t_op_edi
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
if (pos('TO ORDER',UpperCase(str_all.Text))>0) or (pos('SAME AS',UpperCase(str_all.Text))>0) then
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+ST+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 4 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
{
|
|
|
str_all.Text:=Changestr(edit12.text);
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+SF+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 4 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
{
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.fieldbyname('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').AsString<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+ST+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 4 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ղ<EFBFBD><D5B2><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
|
|
|
|
|
str.Add('GID+1+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
|
|
|
count:=count+1;
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') or (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring)<>'' then
|
|
|
begin
|
|
|
str.Add('PCD+52:'+frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
get_goods(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+WT+KGM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='D') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('DGS+IMD+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring
|
|
|
+'+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('CTA+HG+:'+edit7.text+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
end;
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN++'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+1'+#39)
|
|
|
else
|
|
|
str.Add('EQD+CN++'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+2'+#39); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
str.Add('EQN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAS+CBM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('TMP+2+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
result:=count;
|
|
|
end;
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.get_txtBookingBAK(str:Tstringlist):integer;
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
j,Count,i:integer;
|
|
|
str_guodu,str_shr,str_con,str_not:widestring;
|
|
|
str_pay,Str_head:string;
|
|
|
function CutVoyNo(VoyNo:String):String;
|
|
|
begin
|
|
|
if length(VoyNO)<3 then exit;
|
|
|
if Pos('.',VoyNO)>0 then begin
|
|
|
Result:=Copy(VoyNO,3,length(VoyNO)-2);
|
|
|
end else
|
|
|
Result:=VoyNO;
|
|
|
end;
|
|
|
begin
|
|
|
str_all:=Tstringlist.Create;
|
|
|
str.Add('UNA:+.?'+#39);
|
|
|
count:=0;
|
|
|
str.Add('UNB+UNOC:1+'+Edit1.TEXT+':ZZZ+'+Edit3.TEXT
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
str.Add('UNH+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+IFTMBF:D:99B:UN'+#39);
|
|
|
count:=count+1;
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39) //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
else str.Add('BGM+335+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39); //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('DTM+137:'+GetDatetime(datetimetostr(now),1)+':203'+#39);
|
|
|
count:=count+1;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1>');
|
|
|
result:=-1;
|
|
|
exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+27+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+28+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+29+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='OTHER' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
{
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString;
|
|
|
}
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)<>'' then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)
|
|
|
else sl.text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAI+++'+sl.Strings[i]+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+BM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+CT:'+frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str.Add('CPI+4++P''')
|
|
|
else
|
|
|
str.Add('CPI+4++C''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('TDT+20+'+CutVoyNo(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
+'+1+++++:::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if Trim(t_op_edi.fieldbyname('PRICEOWNER').AsString)<>'' then begin
|
|
|
if Length(t_op_edi.fieldbyname('PRICEOWNER').AsString)<=35 then
|
|
|
str.Add('NAD+PO+++'+t_op_edi.fieldbyname('PRICEOWNER').AsString+#39)
|
|
|
else str.Add('NAD+PO+++'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,1,35)+'+'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('LOC+9+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('DTM+133:'+GetDatetime(datetimetostr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime),0)+':102'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+88+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+11+'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('LOC+7+'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //?
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_all.Clear;
|
|
|
str_head:='';
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CZ+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,34)+'*';
|
|
|
Str_shr:='.*'+Copy(str_all[4],34,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_shr:=Str_shr+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CN+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,33)+'**';
|
|
|
Str_con:='.**'+Copy(str_all[4],33,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_con:=Str_con+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+'+CA'+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+NI+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,32)+'***';
|
|
|
Str_not:='.***'+Copy(str_all[4],32,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_not:=Str_not+' '+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'' then
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39
|
|
|
else
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring<>'' then begin
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+FW+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ղ<EFBFBD><D5B2><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
|
|
|
|
|
str.Add('GID+1+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
|
|
|
count:=count+1;
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring)<>'' then
|
|
|
begin
|
|
|
str.Add('PCD+52:'+frm_op_seae.t_op_seae.fieldbyname('ʪ<><CAAA>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+WT+KGM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='D') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
str.Add('DGS+IMD+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring
|
|
|
+'+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('CTA+HG+:'+edit7.text+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
end;
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN++'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+1'+#39)
|
|
|
else
|
|
|
str.Add('EQD+CN++'+t_op_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+'+2'+#39); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
str.Add('EQN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAS+CBM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='T') then
|
|
|
begin
|
|
|
str.Add('TMP+2+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
result:=count;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.get_txtvgm(str:Tstringlist):integer;
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
i,count:integer;
|
|
|
SM,Carrer:string;
|
|
|
|
|
|
begin
|
|
|
i:=0;
|
|
|
case RadioGroup2.ItemIndex of
|
|
|
0:Carrer:='MAEU';
|
|
|
1:Carrer:='SAFM';
|
|
|
2:Carrer:='MCPU';
|
|
|
end;
|
|
|
|
|
|
str_all:=Tstringlist.Create;
|
|
|
count:=0;
|
|
|
|
|
|
str.Add('UNA:+.? '+#39);
|
|
|
|
|
|
str.Add('UNB+UNOC:3+'+Edit1.TEXT+':ZZZ+'+Carrer
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
if (t_op_ctn.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring<>'') or (t_op_ctn.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring<>'<27><>') then
|
|
|
begin
|
|
|
i:=i+1;
|
|
|
str.Add('UNH+'+IntToStr(i)+'+VERMAS:D:16A:UN'+#39);
|
|
|
count:=count+1;
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+XXX+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39) //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
else str.Add('BGM+XXX+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39); //9ԭʼ 5 <20><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('DTM+137:'+GetDatetime(datetimetostr(now),1)+':203'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+GetCtnCode(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring)+'+2'+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
|
|
|
str.Add('MEA+AAE+VGM+KGM:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39); ////<2F>ۼ<EFBFBD> <20><>
|
|
|
count:=count+1;
|
|
|
|
|
|
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring)='<27>ۼ<EFBFBD>' then
|
|
|
SM:='SM2'
|
|
|
else if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
|
|
|
SM:='SM1';
|
|
|
|
|
|
str.Add('DOC+'+SM+':VGM:306'+#39); ////<2F>ۼ<EFBFBD> <20><>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('NAD+SPC+++'+Changestr(Edit2.Text)+#39); ////<2F>ۼ<EFBFBD> <20><>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('UNT+9+'+IntToStr(i)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
result:=i;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.get_txtSI(str: Tstringlist): integer; //<2F>ᵥȷ<E1B5A5><C8B7>
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
ctnlist:TStringList;
|
|
|
j,Count,i,k,Lineno:integer;
|
|
|
str_guodu,str_shr,str_con,str_not,CopyBillCount:widestring;
|
|
|
str_pay,Str_head,str1,str2,SignWay:string;
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
function CutVoyNo(VoyNo:String):String;
|
|
|
begin
|
|
|
if length(VoyNO)<3 then exit;
|
|
|
if Pos('.',VoyNO)>0 then begin
|
|
|
Result:=Copy(VoyNO,3,length(VoyNO)-2);
|
|
|
end else
|
|
|
Result:=VoyNO;
|
|
|
end;
|
|
|
begin
|
|
|
str_all:=Tstringlist.Create;
|
|
|
count:=0;
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('UNB+UNOA:2+'+Edit1.TEXT+':ZZZ+'+Edit3.TEXT
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('UNB+UNOA:2+'+Edit1.TEXT+':ZZZ+'+Edit3.TEXT
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('UNH+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+IFTMIN:D:99B:UN'+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('UNH+'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+IFTMIN:D:99B:UN'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+340+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39)
|
|
|
else str.Add('BGM+340+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39);
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+340+'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39)
|
|
|
else str.Add('BGM+340+'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1>');
|
|
|
result:=-1;
|
|
|
exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+27+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+28+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+29+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='OTHER' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
if Pos('COLLECT',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString)
|
|
|
else sl.text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asString);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
if (sl.Strings[i]<>'') then begin
|
|
|
str.Add('FTX+AAI+++'+sl.Strings[i]+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
if (t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring<>'') then
|
|
|
str.Add('FTX+CCI++MFS+1:CA:'+t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring+#39)
|
|
|
else
|
|
|
str.Add('FTX+CCI++MFS+5:CA'+#39);
|
|
|
end;
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if (t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring<>'') then
|
|
|
str.Add('FTX+CCI++MFS+1:US:'+t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring+#39)
|
|
|
else
|
|
|
str.Add('FTX+CCI++MFS+5:US'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('CNT+7:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':KGM''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+11:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+15:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':MTQ''');
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('CNT+7:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':KGM''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+11:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+15:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':MTQ''');
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT PREPAID' then
|
|
|
begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT COLLECT' then begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+73+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><EFBFBD><F0B5A5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asString);
|
|
|
if sl.Count>0 then
|
|
|
begin
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
begin
|
|
|
str.Add('RFF+BN:'+sl.Strings[i]+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if t_op_edi.IsEmpty or (t_op_edi.FieldByName('<27><><EFBFBD>պ<EFBFBD>').AsString='') then
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39)
|
|
|
else
|
|
|
str.Add('RFF+BN:'+t_op_edi.FieldByName('<27><><EFBFBD>պ<EFBFBD>').AsString+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('RFF+BM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring<>'' then
|
|
|
begin
|
|
|
str.Add('RFF+BM:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
str.Add('RFF+CT:'+frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str.Add('REF+TN:'+t_op_edi.FieldByName('ITN<54><4E><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str.Add('CPI+4++P''')
|
|
|
else
|
|
|
str.Add('CPI+4++C''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('TDT+20+'+CutVoyNo(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
+'+1+++++:::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
{
|
|
|
if Trim(t_op_edi.fieldbyname('PRICEOWNER').AsString)<>'' then begin
|
|
|
if Length(t_op_edi.fieldbyname('PRICEOWNER').AsString)<=35 then
|
|
|
str.Add('NAD+PO+++'+t_op_edi.fieldbyname('PRICEOWNER').AsString+#39)
|
|
|
else str.Add('NAD+PO+++'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,1,35)+'+'+Copy(t_op_edi.fieldbyname('PRICEOWNER').AsString,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
}
|
|
|
str.Add('LOC+9+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+88+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+11+'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('LOC+7+'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //?
|
|
|
+':139:6:'+Changestr(trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring))+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_all.Clear;
|
|
|
str_head:='';
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then
|
|
|
begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CZ+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,34)+'*';
|
|
|
Str_shr:='*'+Copy(str_all[4],34,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_shr:=Str_shr+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then
|
|
|
begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CN+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,33)+'**';
|
|
|
Str_con:='**'+Copy(str_all[4],33,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_con:=Str_con+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+'+CA'+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then
|
|
|
begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str_all.Text:=Changestr(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+NI+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,32)+'***';
|
|
|
Str_not:='***'+Copy(str_all[4],32,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_not:=Str_not+' '+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'' then
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39
|
|
|
else
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring<>'' then begin
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring)<>'' then
|
|
|
begin
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring);
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+N1+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
str.Add('NAD+CA+'+GetShipEdiNO(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring)+':160:86++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
if Length(Edit2.text)<=35 then
|
|
|
str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Edit2.text+#39)
|
|
|
else str.Add('NAD+BA+'+Edit13.TEXT+':160:86++'+Copy(Edit2.text,1,35)+'+'+Copy(Edit2.text,35,35)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='ONE' then
|
|
|
Str1:='1'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TWO' then
|
|
|
Str1:='2'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='THREE' then
|
|
|
Str1:='3'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FOUR' then
|
|
|
Str1:='4'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FIVE' then
|
|
|
Str1:='5'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SIX' then
|
|
|
Str1:='6'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SERVEN' then
|
|
|
Str1:='7'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='EIGHT' then
|
|
|
Str1:='8'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='NIGHT' then
|
|
|
Str1:='9'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TEN' then
|
|
|
Str1:='10';
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='ONE' then
|
|
|
CopyBillCount:='1'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TWO' then
|
|
|
CopyBillCount:='2'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='THREE' then
|
|
|
CopyBillCount:='3'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FOUR' then
|
|
|
CopyBillCount:='4'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FIVE' then
|
|
|
CopyBillCount:='5'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SIX' then
|
|
|
CopyBillCount:='6'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SERVEN' then
|
|
|
CopyBillCount:='7'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='EIGHT' then
|
|
|
CopyBillCount:='8'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='NIGHT' then
|
|
|
CopyBillCount:='9'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TEN' then
|
|
|
CopyBillCount:='10';
|
|
|
|
|
|
|
|
|
if not bsck.checked then
|
|
|
SignWay:=trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)
|
|
|
else SignWay:=trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring);
|
|
|
|
|
|
|
|
|
IF (SignWay='<27><><EFBFBD><EFBFBD>') OR (SignWay='<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ') then begin //<2F>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>
|
|
|
Str2:='706';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+Str1+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(CopyBillCount)<>'' then
|
|
|
begin
|
|
|
|
|
|
Str2:='707';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+CopyBillCount+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+CopyBillCount+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
end else if (SignWay='<27><><EFBFBD>˵<EFBFBD>')
|
|
|
or (SignWay='Seaway') then begin
|
|
|
Str2:='710';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+Str1+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
end else if (SignWay='BILL COPY') or (SignWay='<27><><EFBFBD><EFBFBD>')
|
|
|
then begin
|
|
|
|
|
|
Str2:='706';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+Str1+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Trim(CopyBillCount)<>'' then
|
|
|
begin
|
|
|
Str2:='707';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+CopyBillCount+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+CopyBillCount+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else if SignWay='HOUSE BILL' then begin
|
|
|
|
|
|
Str2:='714';
|
|
|
str.Add('DOC+'+Str2+':::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
end else if SignWay='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
|
|
|
Str2:='706';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+Str1+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
if Trim(CopyBillCount)<>'' then
|
|
|
begin
|
|
|
Str2:='707';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+CopyBillCount+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+CopyBillCount+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
Str2:='706';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>').AsBoolean then
|
|
|
str.Add('DOC+'+Str2+'+:27++'+Str1+#39)
|
|
|
else str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
// str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
ctnlist:=TStringList.Create;
|
|
|
ctnlist.Clear;
|
|
|
with t_op_edictn do
|
|
|
begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('select ctn_id from t_op_ctn');
|
|
|
SQL.Add('where <20><><EFBFBD><EFBFBD>=:bsno');
|
|
|
Parameters.ParamByName('bsno').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
open;First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
ctnlist.Add(FieldByName('ctn_id').AsString);
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
t_op_edictn.Close;t_op_edictn.SQL.Clear;
|
|
|
t_op_edictn.SQL.Add('select * from t_op_ctn_detail');
|
|
|
t_op_edictn.SQL.Add('where ctn_id in ('+ctnlist.CommaText+')');
|
|
|
t_op_edictn.Open;
|
|
|
if t_op_edictn.RecordCount<=0 then
|
|
|
begin
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('GID+1+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('GID+1+'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring)<>'' then begin // <20><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
|
|
|
str.Add('PIA+5+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring+':HS'+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
else sl.text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end else begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
else sl.text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+WT+KGM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str.Add('MEA+AAE+WT+KGM:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(t_op_edi.fieldbyname('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD><EFBFBD>').asstring)<>'' then begin
|
|
|
str.Add('RFF+ABT:'+t_op_edi.fieldbyname('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD><EFBFBD>').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.checked then
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString
|
|
|
else sl.text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn.<2E>ߴ<EFBFBD>,t_op_ctn.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E>ߴ<EFBFBD>,t_op_ctn_fendan.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn_fendan INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn_fendan.as_id=:as_id');
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('as_id').Value:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asinteger;
|
|
|
end;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
str.Add('SGP+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+WT+KGM:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_edictn.Close;t_op_edictn.SQL.Clear;
|
|
|
t_op_edictn.SQL.Add('select hts,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>װ,sum(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>');
|
|
|
t_op_edictn.SQL.Add('from t_op_ctn_detail');
|
|
|
t_op_edictn.SQL.Add('where ctn_id in ('+ctnlist.CommaText+')');
|
|
|
t_op_edictn.SQL.Add('Group by hts,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>װ');
|
|
|
t_op_edictn.SQL.Add('Order by min(id)');
|
|
|
t_op_edictn.Open;
|
|
|
Lineno:=1;
|
|
|
while not t_op_edictn.eof do
|
|
|
begin
|
|
|
str.Add('GID+'+Inttostr(Lineno)+'+'+t_op_edictn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(t_op_edictn.fieldbyname('<27><>װ').asstring))+'::6:'+t_op_edictn.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('PIA+5+'+t_op_edictn.fieldbyname('hts').asstring+':HS'+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=t_op_edictn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+WT+KGM:'+t_op_edictn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+t_op_edictn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
if not bsck.Checked then
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString
|
|
|
else sl.text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
aAdoQuery.Close;aAdoQuery.SQL.Clear;
|
|
|
aAdoQuery.SQL.Add('select t_op_ctn.<2E><><EFBFBD><EFBFBD>,sum(t_op_ctn_detail.<2E><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>,sum(t_op_ctn_detail.<2E><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,sum(t_op_ctn_detail.<2E><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>');
|
|
|
aAdoQuery.SQL.Add('from t_op_ctn_detail');
|
|
|
aAdoQuery.SQL.Add('left Join t_op_ctn on t_op_ctn.ctn_id=t_op_ctn_detail.ctn_id');
|
|
|
aAdoQuery.SQL.Add('where t_op_ctn.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and t_op_ctn_detail.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:goods and t_op_ctn_detail.<2E><>װ=:pkg and t_op_ctn_detail.hts=:hts');
|
|
|
aAdoQuery.SQL.Add('Group by t_op_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
aAdoQuery.Parameters.ParamByName('goods').Value:=t_op_edictn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('pkg').Value:=t_op_edictn.fieldbyname('<27><>װ').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('hts').Value:=t_op_edictn.fieldbyname('hts').asstring;
|
|
|
aAdoQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
aAdoQuery.Open;
|
|
|
while not aAdoQuery.eof do
|
|
|
begin
|
|
|
str.Add('SGP+'+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+WT+KGM:'+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
finally
|
|
|
aAdoQuery.Free;
|
|
|
end;
|
|
|
Lineno:=Lineno+1;
|
|
|
t_op_edictn.Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
////
|
|
|
|
|
|
|
|
|
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='D') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('DGS+IMD+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring
|
|
|
+'+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('CTA+HG+:'+edit7.text+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
if not bsck.Checked then
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn.<2E>ߴ<EFBFBD>,t_op_ctn.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>,t_op_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn.<2E><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.Close;t_op_ctn.SQL.Clear;
|
|
|
t_op_ctn.SQL.Add('SELECT t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E>ߴ<EFBFBD>,t_op_ctn_fendan.<2E><>װ');
|
|
|
t_op_ctn.SQL.Add(',t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>,t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('FROM t_op_ctn_fendan INNER JOIN');
|
|
|
t_op_ctn.SQL.Add('t_code_ctn ON t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>');
|
|
|
t_op_ctn.SQL.Add('WHERE t_op_ctn_fendan.as_id=:as_id');
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('as_id').Value:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asinteger;
|
|
|
end;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+GetCtnCode(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring)+'+1'+#39) //<2F><><EFBFBD><EFBFBD>
|
|
|
else
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+GetCtnCode(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring)+'+2'+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+WT+KGM:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAS+CBM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring='TK') then
|
|
|
str.Add('SEL+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+CA'+#39)
|
|
|
else
|
|
|
str.Add('SEL+'+'CN'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+CA'+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') OR (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='T') then
|
|
|
begin
|
|
|
str.Add('TMP+2+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
result:=count;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
function Tfrm_op_seae_edi_msk.get_txtSI(str: Tstringlist): integer; //<2F>ᵥȷ<E1B5A5><C8B7>
|
|
|
var
|
|
|
str_all,sl:Tstringlist;
|
|
|
j,Count,i:integer;
|
|
|
str_guodu,str_shr,str_con,str_not:widestring;
|
|
|
str_pay,Str_head,str1,str2:string;
|
|
|
function CutVoyNo(VoyNo:String):String;
|
|
|
begin
|
|
|
if length(VoyNO)<3 then exit;
|
|
|
if Pos('.',VoyNO)>0 then begin
|
|
|
Result:=Copy(VoyNO,3,length(VoyNO)-2);
|
|
|
end else
|
|
|
Result:=VoyNO;
|
|
|
end;
|
|
|
begin
|
|
|
str_all:=Tstringlist.Create;
|
|
|
count:=0;
|
|
|
str.Add('UNB+UNOA:2+'+Edit1.TEXT+':ZZZ+'+Edit3.TEXT
|
|
|
+':ZZZ+'+GetDatetime(datetimetostr(now),2)+'+'
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('UNH+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'+IFTMIN:D:99B:UN'+#39);
|
|
|
count:=count+1;
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
str.Add('BGM+340+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+9'+#39)
|
|
|
else str.Add('BGM+340+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'+5'+#39);
|
|
|
count:=count+1;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+'<27><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1>');
|
|
|
result:=-1;
|
|
|
exit;
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+27+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+28+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-DOOR' then
|
|
|
begin
|
|
|
str.Add('TSR+29+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='OTHER' then
|
|
|
begin
|
|
|
str.Add('TSR+30+2'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)<>'' then
|
|
|
str_pay:=trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring);
|
|
|
str.Add('FTX+AAI+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring
|
|
|
+' Payable at '+str_pay+' '+
|
|
|
frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+
|
|
|
' '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+
|
|
|
trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)+' '+frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString+' '+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asString;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAI+++'+sl.Strings[i]+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
if (t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring<>'') then
|
|
|
str.Add('FTX+CCI++MFS+1:CA:'+t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring+#39)
|
|
|
else
|
|
|
str.Add('FTX+CCI++MFS+5:CA'+#39);
|
|
|
end;
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if (t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring<>'') then
|
|
|
str.Add('FTX+CCI++MFS+1:US:'+t_op_edi.FieldByName('SCAC<41><43><EFBFBD><EFBFBD>').asstring+#39)
|
|
|
else
|
|
|
str.Add('FTX+CCI++MFS+5:US'+#39);
|
|
|
end;
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('CNT+7:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':KGM''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+11:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('CNT+15:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':MTQ''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT PREPAID' then
|
|
|
begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring='FREIGHT COLLECT' then begin
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
end
|
|
|
else
|
|
|
str.Add('LOC+57+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+73+'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))
|
|
|
+'::6:'+trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if t_op_edi.IsEmpty or (t_op_edi.FieldByName('<27><><EFBFBD>պ<EFBFBD>').AsString='') then
|
|
|
str.Add('RFF+BN:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39)
|
|
|
else
|
|
|
str.Add('RFF+BN:'+t_op_edi.FieldByName('<27><><EFBFBD>պ<EFBFBD>').AsString+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('RFF+BM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('RFF+CT:'+frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str.Add('REF+TN:'+t_op_edi.FieldByName('ITN<54><4E><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Pos('PREPAID',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)>0 then
|
|
|
str.Add('CPI+4++P''')
|
|
|
else
|
|
|
str.Add('CPI+4++C''');
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('TDT+20+'+CutVoyNo(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
+'+1+++++:::'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+9+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+88+'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)
|
|
|
+':139:6:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('LOC+11+'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
+':139:6:'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('LOC+7+'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //?
|
|
|
+':139:6:'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str_all.Clear;
|
|
|
str_head:='';
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CZ+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,34)+'*';
|
|
|
Str_shr:='.*'+Copy(str_all[4],34,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_shr:=Str_shr+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+CN+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,33)+'**';
|
|
|
Str_con:='.**'+Copy(str_all[4],33,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_con:=Str_con+' '+str_all[j]
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').asstring+'+CA'+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str_head:='';
|
|
|
str_all.Clear;
|
|
|
if t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring<>'' then begin
|
|
|
str_all.Text:=Changestr(t_op_edi.fieldbyname('AMS֪ͨ<CDA8><D6AA>').asstring);
|
|
|
end else begin
|
|
|
str_all.Text:=Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
end;
|
|
|
GetLengthTString(str_all,35);
|
|
|
str_guodu:='NAD+NI+++'+str_all[0]+'+';
|
|
|
if str_all.Count>=2 then
|
|
|
str_guodu:=str_guodu+str_all[1];
|
|
|
if (str_all.Count>=3) and (str_all.Count<=5) then
|
|
|
begin
|
|
|
for j:=2 to str_all.Count-1 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
if str_all.Count>5 then
|
|
|
begin
|
|
|
for j:=2 to 3 do
|
|
|
begin
|
|
|
str_guodu:=str_guodu+':'+str_all[j]
|
|
|
end;
|
|
|
str_guodu:=str_guodu+':'+Copy(str_all[4],1,32)+'***';
|
|
|
Str_not:='.***'+Copy(str_all[4],32,1);
|
|
|
for j:=5 to str_all.Count-1 do begin
|
|
|
Str_not:=Str_not+' '+str_all[j]
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+'+++'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').asstring+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD>ô<EFBFBD>') then begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end else if (t_op_edi.FieldByName('<27><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>') then begin
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring<>'' then
|
|
|
str_guodu:=str_guodu+'++++'+t_op_edi.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring+#39
|
|
|
else
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
if t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring<>'' then begin
|
|
|
str.Add('RFF+GN:'+t_op_edi.FieldByName('֪ͨ<CDA8><D6AA>˰<EFBFBD><CBB0>').asstring+#39); //
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
end else begin
|
|
|
str_guodu:=str_guodu+#39;
|
|
|
str.Add(str_guodu);
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('NAD+CA+'+GetShipEdiNO(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring)+':160:86++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring+#39);
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
str.Add('NAD+HI+'+Edit13.Text+':160:86++'+Edit2.text+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
str.Add('CTA+IC+:'+edit7.text+'''');
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit6.text+':EM'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='ONE' then
|
|
|
Str1:='1'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TWO' then
|
|
|
Str1:='2'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='THREE' then
|
|
|
Str1:='3'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FOUR' then
|
|
|
Str1:='4'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FIVE' then
|
|
|
Str1:='5'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SIX' then
|
|
|
Str1:='6'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SERVEN' then
|
|
|
Str1:='7'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='EIGHT' then
|
|
|
Str1:='8'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='NIGHT' then
|
|
|
Str1:='9'
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TEN' then
|
|
|
Str1:='10';
|
|
|
|
|
|
IF trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then begin //<2F>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>
|
|
|
Str2:='706';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end else if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD>˵<EFBFBD>' then begin
|
|
|
Str2:='710';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end else if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='BILL COPY' then begin
|
|
|
Str2:='707';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end else if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='HOUSE BILL' then begin
|
|
|
Str2:='714';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end else if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then begin
|
|
|
Str2:='706';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
Str2:='707';
|
|
|
str.Add('DOC+'+Str2+'+++'+'1'+#39);
|
|
|
// str.Add('DOC+'+Str2+'+++'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
end else begin
|
|
|
Str2:='706';
|
|
|
str.Add('DOC+'+Str2+'+++'+Str1+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
str.Add('GID+1+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'+
|
|
|
GetPkgCode(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+'::6:'+frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring)<>'' then begin // <20><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
|
|
|
str.Add('PIA+5+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring+':HS'+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if RadioGroup1.ItemIndex=0 then begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
end else begin
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('FTX+AAA+++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
if Trim(str_shr)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_shr+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_con)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_con+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
if Trim(str_not)<>'' then begin
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
' '+#39);
|
|
|
str.Add('FTX+AAA+++'+
|
|
|
Str_not+#39);
|
|
|
count:=count+2;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
str.Add('MEA+AAE+WT+KGM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(t_op_edi.fieldbyname('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD><EFBFBD>').asstring)<>'' then begin
|
|
|
str.Add('RFF+ABT:'+t_op_edi.fieldbyname('<27><><EFBFBD><EFBFBD>NCM<43><4D><EFBFBD><EFBFBD>').asstring+#39); //<2F><>
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
try
|
|
|
sl.text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asString;
|
|
|
GetLengthTString(sl,35);
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
str.Add('PCI++'+Changestr(sl.Strings[i])+''+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(sl);
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
str.Add('SGP+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+WT+KGM:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='D' then
|
|
|
begin
|
|
|
str.Add('DGS+IMD+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring
|
|
|
+'+'+frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('CTA+HG+:'+edit7.text+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('COM+'+Edit5.text+':TE'+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.close;
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn.first;
|
|
|
while not t_op_ctn.eof do
|
|
|
begin
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+GetCtnCode(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring)+'+1'+#39) //<2F><><EFBFBD><EFBFBD>
|
|
|
else
|
|
|
str.Add('EQD+CN+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+'+GetCtnCode(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,t_op_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring)+'+2'+#39); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+WT+KGM:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
str.Add('MEA+AAE+AAW+MTQ:'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
|
|
|
if frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R' then
|
|
|
begin
|
|
|
str.Add('MEA+AAE+AAS+CBM:'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
str.Add('SEL+'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'+CA'+#39);
|
|
|
count:=count+1;
|
|
|
if frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R' then
|
|
|
begin
|
|
|
str.Add('TMP+2+'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+':CEL'+#39);
|
|
|
count:=count+1;
|
|
|
end;
|
|
|
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
|
|
|
count:=count+1;
|
|
|
|
|
|
result:=count;
|
|
|
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
str:Tstringlist;
|
|
|
i,Count,get_Count,bill_count:integer;
|
|
|
inifile1:Tinifile;
|
|
|
begin
|
|
|
str:=Tstringlist.Create;
|
|
|
str.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(str)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(str);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
end;
|
|
|
str.Add('UNT+'+INTTOSTR(str.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
str.Add('UNZ+'+inttostr(bill_count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(str)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(str);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
|
|
|
str.Add('UNT+'+INTTOSTR(str.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
str.Add('UNZ+1+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end;
|
|
|
|
|
|
for i:=0 to Str.Count-1 do begin
|
|
|
if IsZhongwen(Str[i]) then begin
|
|
|
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42><EFBFBD><EFBFBD>< ><3E>ַ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>'+#13#10+Str[i],mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
SaveDialog1.FileName:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+GetDatetime(datetimetostr(now),1);
|
|
|
if SaveDialog1.Execute then
|
|
|
begin
|
|
|
str.SaveToFile(SaveDialog1.FileName+'.txt');
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.FormShow(Sender: TObject);
|
|
|
var
|
|
|
inifile1:Tinifile;
|
|
|
tmpstr:string;
|
|
|
begin
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
edit1.text:=inifile1.ReadString('EDI','SEND_CODE_MSK','');
|
|
|
edit2.text:=inifile1.ReadString('EDI','SEND_NAME_MSK','');
|
|
|
edit3.text:=inifile1.ReadString('EDI','RECEIVE_CODE_MSK','');
|
|
|
edit4.text:=inifile1.ReadString('EDI','RECEIVE_NAME_MSK','');
|
|
|
edit5.text:=inifile1.ReadString('EDI','SEND_TEL_MSK','');
|
|
|
edit6.text:=inifile1.ReadString('EDI','SEND_MAIL_MSK','');
|
|
|
edit7.text:=inifile1.ReadString('EDI','SEND_ATTN_MSK','');
|
|
|
edit8.text:=inifile1.ReadString('EDI','FTPADD_MSK','');
|
|
|
edit9.text:=inifile1.ReadString('EDI','FTPNAME_MSK','');
|
|
|
edit10.text:=inifile1.ReadString('EDI','FTPPASS_MSK','');
|
|
|
edit11.text:=inifile1.ReadString('EDI','FTPPATH_MSK','/');
|
|
|
edit12.text:=inifile1.ReadString('EDI','ADDR_MSK','');
|
|
|
edit13.text:=inifile1.ReadString('EDI','SEND_MSKID','');
|
|
|
tmpstr:=inifile1.ReadString('EDI','SEND_FTPPASSIVE_MSK','1');
|
|
|
if (tmpstr='1') then CheckBox1.checked else CheckBox1.checked:=False;
|
|
|
|
|
|
RadioGroup1.ItemIndex:=inifile1.ReadInteger('EDI','MSKSEND_TYPE',0);
|
|
|
|
|
|
RadioGroup2.ItemIndex:=inifile1.ReadInteger('EDI','MSKSEND_CA',0);
|
|
|
|
|
|
bsSkinComboBox1.ItemIndex:=inifile1.ReadInteger('EDI','MSKSEND_COM',0);
|
|
|
|
|
|
tmpstr:=inifile1.ReadString('EDI','SEND_FTPMSKYT','0');
|
|
|
if (tmpstr='1') then bsSkinCheckRadioBox1.checked:=TRUE else bsSkinCheckRadioBox1.checked:=False;
|
|
|
|
|
|
|
|
|
inifile1.free;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
VAR
|
|
|
inifile1:TIniFile;
|
|
|
begin
|
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
inifile1.WriteString('EDI','SEND_CODE_MSK',edit1.text);
|
|
|
inifile1.WriteString('EDI','SEND_NAME_MSK',edit2.text);
|
|
|
inifile1.WriteString('EDI','RECEIVE_CODE_MSK',edit3.text);
|
|
|
inifile1.WriteString('EDI','RECEIVE_NAME_MSK',edit4.text);
|
|
|
inifile1.WriteString('EDI','SEND_TEL_MSK',edit5.text);
|
|
|
inifile1.WriteString('EDI','SEND_MAIL_MSK',edit6.text);
|
|
|
inifile1.WriteString('EDI','SEND_ATTN_MSK',edit7.text);
|
|
|
inifile1.WriteString('EDI','SEND_MSKID',edit13.text);
|
|
|
inifile1.WriteString('EDI','FTPADD_MSK',edit8.text);
|
|
|
inifile1.WriteString('EDI','FTPNAME_MSK',edit9.text);
|
|
|
inifile1.WriteString('EDI','FTPPASS_MSK',Edit10.text);
|
|
|
inifile1.WriteString('EDI','FTPPATH_MSK',Edit11.text);
|
|
|
|
|
|
inifile1.WriteString('EDI','ADDR_MSK',edit12.text);
|
|
|
|
|
|
|
|
|
inifile1.WriteInteger('EDI','MSKSEND_TYPE',RadioGroup1.ItemIndex);
|
|
|
|
|
|
inifile1.WriteInteger('EDI','MSKSEND_CA',RadioGroup2.ItemIndex);
|
|
|
|
|
|
|
|
|
inifile1.WriteInteger('EDI','MSKSEND_COM',bsSkinComboBox1.ItemIndex);
|
|
|
if CheckBox1.checked then
|
|
|
inifile1.WriteString('EDI','SEND_FTPPASSIVE_MSK','1')
|
|
|
else inifile1.WriteString('EDI','SEND_FTPPASSIVE_MSK','0');
|
|
|
|
|
|
if bsSkinCheckRadioBox1.checked then
|
|
|
inifile1.WriteString('EDI','SEND_FTPMSKYT','1')
|
|
|
else inifile1.WriteString('EDI','SEND_FTPMSKYT','0');
|
|
|
|
|
|
|
|
|
inifile1.free;
|
|
|
action:=cafree;
|
|
|
frm_op_seae_edi_msk_new:=nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
if frm_op_seae_edi_msk_new.Width=650 then
|
|
|
frm_op_seae_edi_msk_new.Width:=305
|
|
|
else
|
|
|
frm_op_seae_edi_msk_new.Width:=650;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton4Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
str:widestring;
|
|
|
str_file:widestring;
|
|
|
ftpar,ftpname,ftppass,ftppath,ScriptPath,ResponseStr,strmsg:String;
|
|
|
StrL:Tstringlist;
|
|
|
i,Count,get_Count,bill_count,i_soi:integer;
|
|
|
|
|
|
SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE:string;
|
|
|
edi,dsstr,PostUrl:WideString;
|
|
|
aQuery:TADOQuery;
|
|
|
MultiPartFormDataStream :TIdMultiPartFormDataStream;
|
|
|
IdHTTP1:TIdHTTP;
|
|
|
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
jo:ISuperobject;
|
|
|
begin
|
|
|
|
|
|
IF bsck.Checked then
|
|
|
begin
|
|
|
MBL:='<27>ֵ<EFBFBD>';
|
|
|
MBLNO:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
MBL:='<27><><EFBFBD><EFBFBD>';
|
|
|
MBLNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end;
|
|
|
if (RadioGroup1.ItemIndex=0) and (RadioGroup3.ItemIndex=0) then begin
|
|
|
// if (RadioGroup2.ItemIndex=0) and (RadioGroup1.ItemIndex=0) then begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
close;SQL.Text:='select count(*) ct from t_op_Edi_Log where <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>='''+MBLNO+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''SO'' ';
|
|
|
open;
|
|
|
if FieldByName('ct').AsInteger>0 then begin
|
|
|
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7>Ͷ<EFBFBD><CDB6><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ͣ<EFBFBD>',mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if (RadioGroup1.ItemIndex=0) then begin
|
|
|
if (frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>Ѷ<EFBFBD><D1B6><EFBFBD>') then
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7>Ͷ<EFBFBD><CDB6><EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end else begin
|
|
|
if (frm_op_seae.t_op_seae.fieldbyname('ȷ<><C8B7>״̬').asstring='<27><>ȷ<EFBFBD><C8B7>') then
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD>ȷ<EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
i_soi:=0;
|
|
|
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
|
|
|
if not DirectoryExists(ScriptPath) then
|
|
|
CreateDir(ScriptPath);
|
|
|
|
|
|
ftpar:=Trim(Edit8.Text);
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftpname:=Trim(Edit9.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppass:=Trim(Edit10.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppath:=Trim(Edit11.Text);;
|
|
|
|
|
|
str:=ScriptPath
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
|
|
|
StrL:=Tstringlist.Create;
|
|
|
StrL.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
end;
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+'+inttostr(bill_count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+1+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
{
|
|
|
str.Add('UNT+'+INTTOSTR(count)+'+1'+#39);
|
|
|
str.Add('UNZ+1+100'+#39);
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
for i:=0 to StrL.Count-1 do begin
|
|
|
if IsZhongwen(StrL[i]) then begin
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>'+#13#10+Str[i],mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
StrL.SaveToFile(str);
|
|
|
edi:=StrL.Text;
|
|
|
|
|
|
|
|
|
ResponseStream := TStringStream.Create('');
|
|
|
|
|
|
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
|
|
|
IdHTTP1:=TIdHTTP.Create(Application);
|
|
|
try
|
|
|
IdHttp1.Request.Accept := '*/*';
|
|
|
IdHttp1.Request.AcceptLanguage:='zh-CN';
|
|
|
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
|
|
|
MultiPartFormDataStream.AddFile('filename',str,GetMIMETypeFromFile(str));
|
|
|
MultiPartFormDataStream.Position := 0;
|
|
|
|
|
|
try
|
|
|
|
|
|
IdHTTP1.Post(get_parameters_value(2125,''), MultiPartFormDataStream,ResponseStream);
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
end;
|
|
|
end;
|
|
|
ResponseStr := ResponseStream.DataString; //<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
|
|
ResponseStr := UTF8Decode(ResponseStr); //<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
|
|
|
jo:=so(ResponseStr);
|
|
|
strmsg:=jo.O['Message'].AsString;
|
|
|
if (jo.O['Success'].AsString='true') then begin
|
|
|
Application.MessageBox(pchar('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>,'+strmsg),'<27><>ʾ:',mrOk);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ijɹ<C4B3>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,'');
|
|
|
if RadioGroup1.ItemIndex=0 then
|
|
|
SIO:='SO'
|
|
|
else SIO:='SI';
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
ORG:='ORG'
|
|
|
else ORG:='AMEND';
|
|
|
|
|
|
|
|
|
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
|
|
|
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
|
|
|
EMP:=employee;
|
|
|
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
|
|
|
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
|
|
|
|
|
|
end else begin
|
|
|
deletefile(str);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>'+strmsg);
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
MultiPartFormDataStream.Free;
|
|
|
FreeAndNil(IdHTTP1);
|
|
|
FreeAndNil(ResponseStream);
|
|
|
end;
|
|
|
|
|
|
|
|
|
if i_soi=0 then begin
|
|
|
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
if (RadioGroup1.ItemIndex=0) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
|
|
|
dsstr:=dsstr+'{';
|
|
|
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"status":"N"';
|
|
|
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
|
|
|
dsstr:=dsstr+'}';
|
|
|
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
|
|
|
|
|
|
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
dsstr:=CreateSIEdiFile_MBL();
|
|
|
PostUrl:=get_parameters_value(2121,'http://123.234.225.158:8901')+'/booking/ReceiveBookingData';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
|
|
|
|
|
|
TDsDjyThread.create(PostUrl,dsstr,'');
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.RadioGroup2Click(Sender: TObject);
|
|
|
begin
|
|
|
case RadioGroup2.ItemIndex of
|
|
|
0:begin
|
|
|
Edit3.Text:='MAERSK';
|
|
|
Edit4.Text:='MAERSK';
|
|
|
end;
|
|
|
1:begin
|
|
|
Edit3.Text:='SAFMARINE';
|
|
|
Edit4.Text:='SAFMARINE';
|
|
|
end;
|
|
|
2:begin
|
|
|
Edit3.Text:='MCCQ';
|
|
|
Edit4.Text:='MCCQ';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinComboBox1Change(Sender: TObject);
|
|
|
begin
|
|
|
//
|
|
|
case bsSkinComboBox1.ItemIndex of
|
|
|
0:
|
|
|
begin
|
|
|
Edit13.Text:='40600057097';
|
|
|
end;
|
|
|
1:
|
|
|
begin
|
|
|
Edit13.Text:='40600104858';
|
|
|
end;
|
|
|
2:
|
|
|
begin
|
|
|
Edit13.Text:='40600740009';
|
|
|
end;
|
|
|
3:
|
|
|
begin
|
|
|
Edit13.Text:='40600654130';
|
|
|
end;
|
|
|
5:
|
|
|
begin
|
|
|
Edit13.Text:='40604968560';
|
|
|
end;
|
|
|
else
|
|
|
Edit13.Text:='40600057097';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton6Click(Sender: TObject);
|
|
|
var
|
|
|
str:Tstringlist;
|
|
|
i,Count,get_Count,bill_count:integer;
|
|
|
inifile1:Tinifile;
|
|
|
begin
|
|
|
str:=Tstringlist.Create;
|
|
|
str.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtvgm(str);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
end;
|
|
|
str.Add('UNZ+'+inttostr(count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtvgm(str);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
str.Add('UNZ+'+inttostr(count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end;
|
|
|
|
|
|
for i:=0 to Str.Count-1 do begin
|
|
|
if IsZhongwen(Str[i]) then begin
|
|
|
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42><EFBFBD><EFBFBD>< ><3E>ַ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>'+#13#10+Str[i],mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
SaveDialog1.FileName:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+GetDatetime(datetimetostr(now),1);
|
|
|
if SaveDialog1.Execute then
|
|
|
begin
|
|
|
str.SaveToFile(SaveDialog1.FileName+'.txt');
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
|
|
|
UpdateVGMStatus(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,'VGMTXT');
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton5Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
str:widestring;
|
|
|
str_file:widestring;
|
|
|
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
|
|
|
StrL:Tstringlist;
|
|
|
i,Count,get_Count,bill_count,i_soi:integer;
|
|
|
|
|
|
SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,strmsg,ResponseStr:string;
|
|
|
edi:WideString;
|
|
|
MultiPartFormDataStream :TIdMultiPartFormDataStream;
|
|
|
IdHTTP1:TIdHTTP;
|
|
|
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
jo:ISuperobject;
|
|
|
|
|
|
begin
|
|
|
i_soi:=0;
|
|
|
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
|
|
|
if not DirectoryExists(ScriptPath) then
|
|
|
CreateDir(ScriptPath);
|
|
|
|
|
|
ftpar:=Trim(Edit8.Text);
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftpname:=Trim(Edit9.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppass:=Trim(Edit10.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppath:=Trim(Edit11.Text);;
|
|
|
|
|
|
str:=ScriptPath
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
|
|
|
StrL:=Tstringlist.Create;
|
|
|
StrL.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
bill_count:=0;
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtvgm(StrL);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
end;
|
|
|
StrL.Add('UNZ+'+inttostr(count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtvgm(StrL);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
StrL.Add('UNZ+'+inttostr(count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StrL.SaveToFile(str);
|
|
|
edi:=StrL.Text;
|
|
|
try
|
|
|
ResponseStream := TStringStream.Create('');
|
|
|
|
|
|
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
|
|
|
IdHTTP1:=TIdHTTP.Create(Application);
|
|
|
try
|
|
|
IdHttp1.Request.Accept := '*/*';
|
|
|
IdHttp1.Request.AcceptLanguage:='zh-CN';
|
|
|
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
|
|
|
MultiPartFormDataStream.AddFile('filename',str,GetMIMETypeFromFile(str));
|
|
|
MultiPartFormDataStream.Position := 0;
|
|
|
|
|
|
try
|
|
|
|
|
|
IdHTTP1.Post(get_parameters_value(2125,''), MultiPartFormDataStream,ResponseStream);
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
end;
|
|
|
end;
|
|
|
ResponseStr := ResponseStream.DataString; //<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
|
|
ResponseStr := UTF8Decode(ResponseStr); //<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
|
|
|
jo:=so(ResponseStr);
|
|
|
strmsg:=jo.O['Message'].AsString;
|
|
|
if (jo.O['Success'].AsString='true') then begin
|
|
|
Application.MessageBox(pchar('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>,'+strmsg),'<27><>ʾ:',mrOk);
|
|
|
end else begin
|
|
|
deletefile(str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>'+strmsg);
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
MultiPartFormDataStream.Free;
|
|
|
FreeAndNil(IdHTTP1);
|
|
|
FreeAndNil(ResponseStream);
|
|
|
end;
|
|
|
|
|
|
|
|
|
{
|
|
|
try
|
|
|
|
|
|
IdFTP1:=TIdFTP.Create(application);
|
|
|
with idftp1 do
|
|
|
begin
|
|
|
Username:=ftpname;
|
|
|
Password:=ftppass;
|
|
|
Host:=ftpar;
|
|
|
Passive:=CheckBox1.Checked;
|
|
|
Connect;
|
|
|
end;
|
|
|
idftp1.ChangeDir(ftppath);
|
|
|
idftp1.TransferType:=ftBinary;
|
|
|
idftp1.Put(str,str_file);
|
|
|
idftp1.Disconnect;
|
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>');
|
|
|
|
|
|
}
|
|
|
|
|
|
{
|
|
|
if RadioGroup1.ItemIndex=0 then
|
|
|
SIO:='SO'
|
|
|
else SIO:='SI';
|
|
|
}
|
|
|
SIO:='VGM';
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
ORG:='ORG'
|
|
|
else ORG:='AMEND';
|
|
|
|
|
|
IF bsck.Checked then
|
|
|
begin
|
|
|
MBL:='<27>ֵ<EFBFBD>';
|
|
|
MBLNO:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
MBL:='<27><><EFBFBD><EFBFBD>';
|
|
|
MBLNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end;
|
|
|
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
|
|
|
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
|
|
|
EMP:=employee;
|
|
|
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
|
|
|
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
|
|
|
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
|
|
|
|
|
|
UpdateVGMStatus(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,'VGMEDI');
|
|
|
|
|
|
|
|
|
|
|
|
except
|
|
|
deletefile(str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
// idftp1.Free;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.Button1Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
str:widestring;
|
|
|
str_file:widestring;
|
|
|
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
|
|
|
StrL:Tstringlist;
|
|
|
i,Count,get_Count,bill_count,i_soi:integer;
|
|
|
|
|
|
SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE:string;
|
|
|
edi:WideString;
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
|
begin
|
|
|
|
|
|
IF bsck.Checked then
|
|
|
begin
|
|
|
MBL:='<27>ֵ<EFBFBD>';
|
|
|
MBLNO:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
MBL:='<27><><EFBFBD><EFBFBD>';
|
|
|
MBLNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end;
|
|
|
if (RadioGroup1.ItemIndex=0) then begin
|
|
|
// if (RadioGroup2.ItemIndex=0) and (RadioGroup1.ItemIndex=0) then begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
close;SQL.Text:='select count(*) ct from t_op_Edi_Log where <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>='''+MBLNO+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''SO'' ';
|
|
|
open;
|
|
|
if FieldByName('ct').AsInteger>0 then begin
|
|
|
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7>Ͷ<EFBFBD><CDB6><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ͣ<EFBFBD>',mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
{
|
|
|
if (RadioGroup1.ItemIndex=0) then begin
|
|
|
if (frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='<27>Ѷ<EFBFBD><D1B6><EFBFBD>') then
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7>Ͷ<EFBFBD><CDB6><EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end else begin
|
|
|
if (frm_op_seae.t_op_seae.fieldbyname('ȷ<><C8B7>״̬').asstring='<27><>ȷ<EFBFBD><C8B7>') then
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD>ȷ<EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
}
|
|
|
|
|
|
i_soi:=0;
|
|
|
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
|
|
|
if not DirectoryExists(ScriptPath) then
|
|
|
CreateDir(ScriptPath);
|
|
|
|
|
|
ftpar:=Trim(Edit8.Text);
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftpname:=Trim(Edit9.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppass:=Trim(Edit10.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppath:=Trim(Edit11.Text);;
|
|
|
|
|
|
str:=ScriptPath
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
|
|
|
StrL:=Tstringlist.Create;
|
|
|
StrL.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
end;
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+'+inttostr(bill_count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+1+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
{
|
|
|
str.Add('UNT+'+INTTOSTR(count)+'+1'+#39);
|
|
|
str.Add('UNZ+1+100'+#39);
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
for i:=0 to StrL.Count-1 do begin
|
|
|
if IsZhongwen(StrL[i]) then begin
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>'+#13#10+Str[i],mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
StrL.SaveToFile(str);
|
|
|
edi:=StrL.Text;
|
|
|
|
|
|
try
|
|
|
|
|
|
FtpClient1.UserName:=ftpname;
|
|
|
FtpClient1.PassWord:=ftppass;
|
|
|
FtpClient1.HostName:=ftpar;
|
|
|
// FtpClient1.Passive:=CheckBox1.Checked;
|
|
|
FtpClient1.MultiThreaded:=True;
|
|
|
FtpClient1.Port:='21';
|
|
|
FtpClient1.DisplayFileFlag:=True;
|
|
|
FtpClient1.Timeout:=5;
|
|
|
|
|
|
try
|
|
|
if (FtpClient1.Open) and (FtpClient1.User) and (FtpClient1.Pass) then
|
|
|
begin
|
|
|
//<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
|
|
|
frm_op_seae_edi_msk_new.Caption:='<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD>';
|
|
|
FtpClient1.HostDirName:=ftppath;
|
|
|
if FtpClient1.Cwd then
|
|
|
end else begin
|
|
|
showmessage('<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!');
|
|
|
end;
|
|
|
except
|
|
|
on e:exception do
|
|
|
begin
|
|
|
FtpClient1.Abort;
|
|
|
frm_op_seae_edi_msk_new.Caption:='<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if FtpClient1.Connected then
|
|
|
begin
|
|
|
try
|
|
|
FtpClient1.TransferMode := ftpTransModeStream;
|
|
|
FtpClient1.LocalFileName:=str;
|
|
|
FtpClient1.HostFileName:= str_file;
|
|
|
try
|
|
|
if FtpClient1.Put then
|
|
|
begin
|
|
|
ShowMessage('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>');
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,'');
|
|
|
// frm_op_seae_edi_jfyard.Caption:='<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>';
|
|
|
end;
|
|
|
except
|
|
|
FtpClient1.Abort;
|
|
|
ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
|
|
|
// frm_op_seae_edi_jfyard.Caption:='<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
finally
|
|
|
FtpClient1.Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
if RadioGroup1.ItemIndex=0 then
|
|
|
SIO:='SO'
|
|
|
else SIO:='SI';
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
ORG:='ORG'
|
|
|
else ORG:='AMEND';
|
|
|
|
|
|
|
|
|
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
|
|
|
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
|
|
|
EMP:=employee;
|
|
|
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
|
|
|
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
|
|
|
|
|
|
|
|
|
|
|
|
except
|
|
|
deletefile(str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
idftp1.Free;
|
|
|
|
|
|
if i_soi=0 then begin
|
|
|
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_msk_new.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
IdFTP1:TIdFTP;
|
|
|
str:widestring;
|
|
|
str_file:widestring;
|
|
|
ftpar,ftpname,ftppass,ftppath,ScriptPath,ResponseStr,strmsg:String;
|
|
|
StrL:Tstringlist;
|
|
|
i,j,Count,get_Count,bill_count,i_soi:integer;
|
|
|
|
|
|
SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE:string;
|
|
|
edi,dsstr,PostUrl:WideString;
|
|
|
aQuery:TADOQuery;
|
|
|
MultiPartFormDataStream :TIdMultiPartFormDataStream;
|
|
|
IdHTTP1:TIdHTTP;
|
|
|
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
jo:ISuperobject;
|
|
|
begin
|
|
|
|
|
|
IF bsck.Checked then
|
|
|
begin
|
|
|
MBL:='<27>ֵ<EFBFBD>';
|
|
|
MBLNO:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
MBL:='<27><><EFBFBD><EFBFBD>';
|
|
|
MBLNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
end;
|
|
|
if (RadioGroup1.ItemIndex=0) and (RadioGroup3.ItemIndex=0) then begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
close;SQL.Text:='select count(*) ct from t_op_Edi_Log where <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>='''+MBLNO+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''SO'' ';
|
|
|
open;
|
|
|
if FieldByName('ct').AsInteger>0 then begin
|
|
|
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD>ѷ<EFBFBD><D1B7>Ͷ<EFBFBD><CDB6><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ͣ<EFBFBD>',mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i_soi:=0;
|
|
|
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
|
|
|
if not DirectoryExists(ScriptPath) then
|
|
|
CreateDir(ScriptPath);
|
|
|
|
|
|
ftpar:=Trim(Edit8.Text);
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftpname:=Trim(Edit9.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppass:=Trim(Edit10.Text);;
|
|
|
if ftpar='' then begin
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
|
|
|
exit;
|
|
|
end;
|
|
|
ftppath:=Trim(Edit11.Text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StrL:=Tstringlist.Create;
|
|
|
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
|
|
|
begin
|
|
|
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
|
|
|
StrL.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
|
|
|
str:=ScriptPath
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+'+inttostr(bill_count)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
for j:=0 to StrL.Count-1 do begin
|
|
|
if IsZhongwen(StrL[j]) then begin
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>'+#13#10+Str[j],mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
StrL.SaveToFile(str);
|
|
|
edi:=StrL.Text;
|
|
|
|
|
|
ResponseStream := TStringStream.Create('');
|
|
|
|
|
|
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
|
|
|
IdHTTP1:=TIdHTTP.Create(Application);
|
|
|
try
|
|
|
IdHttp1.Request.Accept := '*/*';
|
|
|
IdHttp1.Request.AcceptLanguage:='zh-CN';
|
|
|
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
|
|
|
MultiPartFormDataStream.AddFile('filename',str,GetMIMETypeFromFile(str));
|
|
|
MultiPartFormDataStream.Position := 0;
|
|
|
|
|
|
try
|
|
|
|
|
|
IdHTTP1.Post(get_parameters_value(2125,''), MultiPartFormDataStream,ResponseStream);
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
end;
|
|
|
end;
|
|
|
ResponseStr := ResponseStream.DataString; //<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
|
|
ResponseStr := UTF8Decode(ResponseStr); //<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
|
|
|
jo:=so(ResponseStr);
|
|
|
strmsg:=jo.O['Message'].AsString;
|
|
|
if (jo.O['Success'].AsString='true') then begin
|
|
|
Application.MessageBox(pchar('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>,'+strmsg),'<27><>ʾ:',mrOk);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ijɹ<C4B3>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,'');
|
|
|
if RadioGroup1.ItemIndex=0 then
|
|
|
SIO:='SO'
|
|
|
else SIO:='SI';
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
ORG:='ORG'
|
|
|
else ORG:='AMEND';
|
|
|
|
|
|
|
|
|
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
|
|
|
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
|
|
|
EMP:=employee;
|
|
|
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
|
|
|
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
|
|
|
|
|
|
end else begin
|
|
|
deletefile(str);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>'+strmsg);
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
MultiPartFormDataStream.Free;
|
|
|
FreeAndNil(IdHTTP1);
|
|
|
FreeAndNil(ResponseStream);
|
|
|
end;
|
|
|
|
|
|
if i_soi=0 then begin
|
|
|
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
if (RadioGroup1.ItemIndex=0) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
|
|
|
dsstr:='{';
|
|
|
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"status":"N"';
|
|
|
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
|
|
|
dsstr:=dsstr+'}';
|
|
|
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
|
|
|
|
|
|
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
dsstr:=CreateSIEdiFile_MBL();
|
|
|
PostUrl:=get_parameters_value(2121,'http://123.234.225.158:8901')+'/booking/ReceiveBookingData';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
|
|
|
|
|
|
TDsDjyThread.create(PostUrl,dsstr,'');
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
StrL.Clear;
|
|
|
count:=0;
|
|
|
bill_count:=0;
|
|
|
|
|
|
str:=ScriptPath
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
+FormatDateTime('mm',now)
|
|
|
+FormatDateTime('dd',now)
|
|
|
+FormatDateTime('hh',now)
|
|
|
+FormatDateTime('nn',now)
|
|
|
+FormatDateTime('ss',now)+'.txt';
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
bill_count:=bill_count+1;
|
|
|
|
|
|
|
|
|
if not isEditrue then
|
|
|
exit;
|
|
|
if RadioGroup1.ItemIndex=1 then
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtSI(StrL)
|
|
|
else
|
|
|
get_Count:=frm_op_seae_edi_msk_new.get_txtBooking(StrL);
|
|
|
if get_Count=-1 then
|
|
|
exit
|
|
|
else
|
|
|
count:=count+get_Count;
|
|
|
|
|
|
StrL.Add('UNT+'+INTTOSTR(StrL.count-1)+'+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
StrL.Add('UNZ+1+'+frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+#39);
|
|
|
for i:=0 to StrL.Count-1 do begin
|
|
|
if IsZhongwen(StrL[i]) then begin
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>'+#13#10+Str[i],mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
StrL.SaveToFile(str);
|
|
|
edi:=StrL.Text;
|
|
|
|
|
|
ResponseStream := TStringStream.Create('');
|
|
|
|
|
|
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
|
|
|
IdHTTP1:=TIdHTTP.Create(Application);
|
|
|
try
|
|
|
IdHttp1.Request.Accept := '*/*';
|
|
|
IdHttp1.Request.AcceptLanguage:='zh-CN';
|
|
|
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
|
|
|
MultiPartFormDataStream.AddFile('filename',str,GetMIMETypeFromFile(str));
|
|
|
MultiPartFormDataStream.Position := 0;
|
|
|
|
|
|
try
|
|
|
|
|
|
IdHTTP1.Post(get_parameters_value(2125,''), MultiPartFormDataStream,ResponseStream);
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
end;
|
|
|
end;
|
|
|
ResponseStr := ResponseStream.DataString; //<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
|
|
ResponseStr := UTF8Decode(ResponseStr); //<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
|
|
|
jo:=so(ResponseStr);
|
|
|
strmsg:=jo.O['Message'].AsString;
|
|
|
if (jo.O['Success'].AsString='true') then begin
|
|
|
Application.MessageBox(pchar('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>,'+strmsg),'<27><>ʾ:',mrOk);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ijɹ<C4B3>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,'');
|
|
|
if RadioGroup1.ItemIndex=0 then
|
|
|
SIO:='SO'
|
|
|
else SIO:='SI';
|
|
|
if RadioGroup3.ItemIndex=0 then
|
|
|
ORG:='ORG'
|
|
|
else ORG:='AMEND';
|
|
|
|
|
|
|
|
|
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
|
|
|
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
|
|
|
EMP:=employee;
|
|
|
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
|
|
|
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
|
|
|
|
|
|
end else begin
|
|
|
deletefile(str);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD>MSK<53><4B><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'---'+str);
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>'+strmsg);
|
|
|
i_soi:=1;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
MultiPartFormDataStream.Free;
|
|
|
FreeAndNil(IdHTTP1);
|
|
|
FreeAndNil(ResponseStream);
|
|
|
end;
|
|
|
|
|
|
if i_soi=0 then begin
|
|
|
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
|
|
|
UpdateSOIStatus(RadioGroup1.ItemIndex,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
|
|
|
if (RadioGroup1.ItemIndex=0) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
|
|
|
dsstr:='{';
|
|
|
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"status":"N"';
|
|
|
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
|
|
|
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
|
|
|
dsstr:=dsstr+'}';
|
|
|
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
|
|
|
|
|
|
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
dsstr:=CreateSIEdiFile_MBL();
|
|
|
PostUrl:=get_parameters_value(2121,'http://123.234.225.158:8901')+'/booking/ReceiveBookingData';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
|
|
|
|
|
|
TDsDjyThread.create(PostUrl,dsstr,'');
|
|
|
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>');
|
|
|
|
|
|
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.CreateSIEdiFile_MBL: string;
|
|
|
var
|
|
|
str,str2,codetype,codestr,strsql,typestr:string;
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
isfirst:Boolean;
|
|
|
TempStr:TStringlist;
|
|
|
function getcustedi(cust:string):string;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
result:='';
|
|
|
try
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Text:='select <20><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD> EDI<44><49><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+'''';
|
|
|
aQuery.Open;
|
|
|
if not aQuery.IsEmpty then
|
|
|
result:=aQuery.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').AsString;
|
|
|
if Result='' then result:=cust;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
end;
|
|
|
function getempemail(emp:string):string;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
result:='';
|
|
|
try
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Text:='select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+emp+'''';
|
|
|
aQuery.Open;
|
|
|
if not aQuery.IsEmpty then
|
|
|
result:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
end;
|
|
|
begin
|
|
|
str:=str+'{';
|
|
|
str:=str+'"COMPANY_NAME":"'+frm_data_share.t_sys_company.fieldbyname('ȫ<><C8AB>').AsString+'"';
|
|
|
str:=str+',"BOOKINGS":[';
|
|
|
str:=str+'{';
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
|
|
|
|
|
|
if not bsck.checked then
|
|
|
begin
|
|
|
str:=str+'"BSNO":"'+ frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CUST_NO":"'+ frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"MBLNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"HBLNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"CONTRACTNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SHIPPER":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"CONSIGNEE":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"NOTIFYPARTY":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"NOTIFYPARTY2":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"YARD":"'+getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
|
|
|
str:=str+',"VESSEL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"VOYNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"VoynoInner":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ETD":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CLOSINGDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CLOSEDOCDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ETA":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACERECEIPTID":""';
|
|
|
str:=str+',"PLACERECEIPT":""';
|
|
|
str:=str+',"PORTLOADID":"CNTAO"';
|
|
|
str:=str+',"PORTLOAD":"QINGDAO,CHINA"';
|
|
|
str:=str+',"PORTDISCHARGEID":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PORTDISCHARGE":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACEDELIVERYID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACEDELIVERY":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DESTINATIONID":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DESTINATION":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"NOBILL":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"COPYNOBILLL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ISSUETYPE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring+'"';
|
|
|
str:=str+',"ISSUEDATE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
if (frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring<>'') then begin
|
|
|
str:=str+',"ISSUEPLACEID":"'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))+'"';
|
|
|
str:=str+',"ISSUEPLACE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
end else begin
|
|
|
str:=str+',"ISSUEPLACEID":"CNTAO"';
|
|
|
str:=str+',"ISSUEPLACE":"QINGDAO,CHINA"';
|
|
|
end;
|
|
|
str:=str+',"BLFRT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring+'"';
|
|
|
str:=str+',"PREPARDAT":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PAYABLEAT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SERVICE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"MARKS":"'+StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><>ͷ').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"HSCODE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>䷽ʽ').asstring+'"';
|
|
|
str:=str+',"DESCRIPTION":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"PKGS":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"KINDPKGS":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>װ').asstring+'"';
|
|
|
str:=str+',"KGS":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CBM":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CARRIER":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring+'"';
|
|
|
str:=str+',"CARGOID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring+'"';
|
|
|
str:=str+',"DCLASS":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DUNNO":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DPAGE":""';
|
|
|
str:=str+',"DLABEL":""';
|
|
|
str:=str+',"LINKMAN":""';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') then
|
|
|
str:=str+',"TEMPID":"C"'
|
|
|
else str:=str+',"TEMPID":""';
|
|
|
str:=str+',"TEMPSET":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"REEFERF":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"HUMIDITY":"'+ frm_op_seae.t_op_seae.FieldByName('ʪ<><CAAA>').asstring+'"';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str:=str+',"ISCONTAINERSOC":true'
|
|
|
else
|
|
|
str:=str+',"ISCONTAINERSOC":false';
|
|
|
strsql:='select * from t_op_ams where <20><><EFBFBD><EFBFBD>='
|
|
|
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.SQL.Text:=strsql;
|
|
|
aAdoQuery.Open;
|
|
|
|
|
|
str:=str+',"REMARK":"'+aAdoQuery.FieldByName('SI<53><49>ע').asstring+'"';
|
|
|
str:=str+',"EDIREMARK":"'+ frm_op_seae.t_op_seae.FieldByName('EDI<44><49>ע').asstring+'"';
|
|
|
str:=str+',"YardRemark":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>ע').asstring+'"';
|
|
|
str:=str+',"PONO":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TOTALNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring+'"';
|
|
|
str:=str+',"TEMPMIN":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TEMPMAX":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"OP":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ͷ<EFBFBD>Ա').asstring+'"';
|
|
|
str:=str+',"DOC":""';
|
|
|
str:=str+',"SALE":""';
|
|
|
str:=str+',"CUSTSERVICE":""';
|
|
|
str:=str+',"VGM_TIME":""';
|
|
|
str:=str+',"CUSTOMERNAME":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring+'"';
|
|
|
str:=str+',"EMAIL":"'+getempemail(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').asstring)+'"';
|
|
|
str:=str+',"FORWARDER":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾').asstring+'"';
|
|
|
str:=str+',"SHIPAGENCY":""';
|
|
|
str:=str+',"CUSTOMSER":""';
|
|
|
str:=str+',"TRUCKER":""';
|
|
|
str:=str+',"AGENTID":""';
|
|
|
str:=str+',"CARRIERID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring)+'"';
|
|
|
str:=str+',"YARDID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
|
|
|
str:=str+',"YardContract":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').asstring+'"';
|
|
|
str:=str+',"CUSTOMERID":""';
|
|
|
str:=str+',"FORWARDERID":""';
|
|
|
str:=str+',"SHIPAGENCYID":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CUSTOMSERID":""';
|
|
|
str:=str+',"TRUCKERID":""';
|
|
|
str:=str+',"AGENTNAME":""';
|
|
|
str:=str+',"WEITUO":""';
|
|
|
str:=str+',"EDIATTN":""';
|
|
|
str:=str+',"EDIATTNTEL":""';
|
|
|
str:=str+',"EDIATTNEMAIL":""';
|
|
|
str:=str+',"CONSIGNEEDOORADDR":""';
|
|
|
str:=str+',"SHIPPERDOORADDR":""';
|
|
|
str:=str+',"SCACCODE":""';
|
|
|
str:=str+',"ITNCODE":""';
|
|
|
str:=str+',"PREPARDAT_ID":"'+GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+'"';
|
|
|
str:=str+',"PAYABLEAT_ID":"'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring)+'"';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>۽ݷ᳡վ(FF)') or (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>ݷ᳡վ') then begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><>α').AsBoolean) then
|
|
|
str:=str+',"FEE_SELF":true'
|
|
|
else
|
|
|
str:=str+',"FEE_SELF":false';
|
|
|
end else begin
|
|
|
str:=str+',"FEE_SELF":true';
|
|
|
end;
|
|
|
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
|
|
|
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.SQL.Text:=strsql;
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
str:=str+',"CtrnList":[';
|
|
|
isfirst:=true;
|
|
|
while not aAdoQuery.Eof do begin
|
|
|
if (isfirst) then str:=str+'{' else str:=str+',{';
|
|
|
str:=str+'"CTNALL":"'+StringReplace(aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring,'''','',[])+'"';
|
|
|
str:=str+',"CTNNUM":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CNTRNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SEALNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PKGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"KINDPKGS":"'+aAdoQuery.FieldByName('<27><>װ').asstring+'"';
|
|
|
str:=str+',"KGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CBM":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TAREWEIGHT":'+aAdoQuery.FieldByName('<27><>Ƥ<EFBFBD><C6A4>').asstring;
|
|
|
str:=str+',"WEIGHTYPE":"<22>ۼ<EFBFBD>"';
|
|
|
str:=str+',"WEIGHKGS":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"REMARK":""';
|
|
|
str:=str+'}';
|
|
|
isfirst:=false;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
str:=str+']';
|
|
|
end else begin
|
|
|
|
|
|
str:=str+'"BSNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"CUST_NO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"MBLNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"HBLNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring+'"';
|
|
|
str:=str+',"CONTRACTNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SHIPPER":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"CONSIGNEE":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"NOTIFYPARTY":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"NOTIFYPARTY2":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"YARD":"'+getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
|
|
|
str:=str+',"VESSEL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"VOYNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"VoynoInner":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ETD":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CLOSINGDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CLOSEDOCDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ETA":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACERECEIPTID":""';
|
|
|
str:=str+',"PLACERECEIPT":""';
|
|
|
str:=str+',"PORTLOADID":"CNTAO"';
|
|
|
str:=str+',"PORTLOAD":"QINGDAO,CHINA"';
|
|
|
str:=str+',"PORTDISCHARGEID":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PORTDISCHARGE":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACEDELIVERYID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PLACEDELIVERY":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DESTINATIONID":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DESTINATION":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"NOBILL":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"COPYNOBILLL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ISSUETYPE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring+'"';
|
|
|
str:=str+',"ISSUEDATE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"ISSUEPLACEID":"'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))+'"';
|
|
|
str:=str+',"ISSUEPLACE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"BLFRT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring+'"';
|
|
|
str:=str+',"PREPARDAT":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PAYABLEAT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SERVICE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"MARKS":"'+StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><>ͷ').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"HSCODE":"'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('HS<48><53><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DESCRIPTION":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
|
|
|
str:=str+',"PKGS":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"KINDPKGS":"'+frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><>װ').asstring+'"';
|
|
|
str:=str+',"KGS":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CBM":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CARRIER":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring+'"';
|
|
|
str:=str+',"CARGOID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring+'"';
|
|
|
str:=str+',"DCLASS":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DUNNO":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"DPAGE":""';
|
|
|
str:=str+',"DLABEL":""';
|
|
|
str:=str+',"LINKMAN":""';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') then
|
|
|
str:=str+',"TEMPID":"C"'
|
|
|
else str:=str+',"TEMPID":""';
|
|
|
str:=str+',"TEMPSET":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"REEFERF":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"HUMIDITY":"'+ frm_op_seae.t_op_seae.FieldByName('ʪ<><CAAA>').asstring+'"';
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
str:=str+',"ISCONTAINERSOC":true'
|
|
|
else
|
|
|
str:=str+',"ISCONTAINERSOC":false';
|
|
|
str:=str+',"REMARK":""';
|
|
|
str:=str+',"EDIREMARK":"'+frm_op_seae_assistant.t_op_seae_assistant.FieldByName('EDI<44><49>ע').asstring+'"';
|
|
|
str:=str+',"PONO":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TOTALNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring+'"';
|
|
|
str:=str+',"TEMPMIN":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TEMPMAX":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring+'"';
|
|
|
str:=str+',"OP":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ͷ<EFBFBD>Ա').asstring+'"';
|
|
|
str:=str+',"DOC":""';
|
|
|
str:=str+',"SALE":""';
|
|
|
str:=str+',"CUSTSERVICE":""';
|
|
|
str:=str+',"VGM_TIME":""';
|
|
|
str:=str+',"CUSTOMERNAME":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring+'"';
|
|
|
str:=str+',"EMAIL":"'+getempemail(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').asstring)+'"';
|
|
|
str:=str+',"FORWARDER":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾').asstring+'"';
|
|
|
str:=str+',"SHIPAGENCY":""';
|
|
|
str:=str+',"CUSTOMSER":""';
|
|
|
str:=str+',"TRUCKER":""';
|
|
|
str:=str+',"AGENTID":""';
|
|
|
str:=str+',"CARRIERID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring)+'"';
|
|
|
str:=str+',"YARDID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
|
|
|
str:=str+',"CUSTOMERID":""';
|
|
|
str:=str+',"FORWARDERID":""';
|
|
|
str:=str+',"SHIPAGENCYID":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CUSTOMSERID":""';
|
|
|
str:=str+',"TRUCKERID":""';
|
|
|
str:=str+',"AGENTNAME":""';
|
|
|
str:=str+',"WEITUO":""';
|
|
|
str:=str+',"EDIATTN":""';
|
|
|
str:=str+',"EDIATTNTEL":""';
|
|
|
str:=str+',"EDIATTNEMAIL":""';
|
|
|
str:=str+',"CONSIGNEEDOORADDR":""';
|
|
|
str:=str+',"SHIPPERDOORADDR":""';
|
|
|
str:=str+',"SCACCODE":""';
|
|
|
str:=str+',"ITNCODE":""';
|
|
|
str:=str+',"PREPARDAT_ID":"'+GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+'"';
|
|
|
str:=str+',"PAYABLEAT_ID":"'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring)+'"';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>۽ݷ᳡վ(FF)') or (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>ݷ᳡վ') then begin
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27><>α').AsBoolean) then
|
|
|
str:=str+',"FEE_SELF":true'
|
|
|
else
|
|
|
str:=str+',"FEE_SELF":false';
|
|
|
end else begin
|
|
|
str:=str+',"FEE_SELF":true';
|
|
|
end;
|
|
|
strsql:='select * from t_op_ctn_fendan where <20><><EFBFBD><EFBFBD>='
|
|
|
+#39+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asstring+#39;
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.SQL.Text:=strsql;
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
str:=str+',"CtrnList":[';
|
|
|
isfirst:=true;
|
|
|
while not aAdoQuery.Eof do begin
|
|
|
if (isfirst) then str:=str+'{' else str:=str+',{';
|
|
|
str:=str+'"CTNALL":"'+StringReplace(aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring,'''','',[])+'"';
|
|
|
str:=str+',"CTNNUM":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
str:=str+',"CNTRNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"SEALNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"PKGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"KINDPKGS":"'+aAdoQuery.FieldByName('<27><>װ').asstring+'"';
|
|
|
str:=str+',"KGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"CBM":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
|
|
|
str:=str+',"TAREWEIGHT":0';
|
|
|
str:=str+',"WEIGHTYPE":"<22>ۼ<EFBFBD>"';
|
|
|
str:=str+',"WEIGHKGS":0';
|
|
|
str:=str+',"REMARK":""';
|
|
|
str:=str+'}';
|
|
|
isfirst:=false;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
str:=str+']';
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
if (frm_data_share.t_crm_client_all.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring,[])) then begin
|
|
|
str:=str+',"CUSTOMER_INFO":{';
|
|
|
str:=str+'"CODENAME":"'+frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'"';
|
|
|
str:=str+',"SHORTNAME":"'+frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
|
|
|
str:=str+',"DESCRIPTION":"'+frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString+'"';
|
|
|
str:=str+',"CONTRACT_LIST":[';
|
|
|
if (frm_op_seae.t_op_seae.FieldByName('<27>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString<>'') then begin
|
|
|
aAdoQuery.Close;
|
|
|
aAdoQuery.SQL.Clear;
|
|
|
aAdoQuery.SQL.Add('select * from t_code_cust_mailproject_detail where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.FieldByName('<27>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString+''' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD>֪ͨ'' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27>ᵥ<EFBFBD><E1B5A5><EFBFBD>»<EFBFBD>ֽ'' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>'' )');
|
|
|
aAdoQuery.Open;
|
|
|
aAdoQuery.First;
|
|
|
isfirst:=true;
|
|
|
typestr:='BC';
|
|
|
while not aAdoQuery.Eof do begin
|
|
|
if (isfirst) then str:=str+'{' else str:=str+',{';
|
|
|
str:=str+'"EMAIL":"'+aAdoQuery.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').asstring+'"';
|
|
|
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>֪ͨ') then typestr:='BC';
|
|
|
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27>ᵥ<EFBFBD><E1B5A5><EFBFBD>»<EFBFBD>ֽ') then typestr:='TD';
|
|
|
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>') then typestr:='ZD';
|
|
|
str:=str+',"TYPE":"'+typestr+'"';
|
|
|
str:=str+'}';
|
|
|
isfirst:=false;
|
|
|
aAdoQuery.Next;
|
|
|
end;
|
|
|
end;
|
|
|
str:=str+']';
|
|
|
str:=str+'}';
|
|
|
end;
|
|
|
|
|
|
str:=str+'}';
|
|
|
str:=str+']';
|
|
|
str:=str+'}';
|
|
|
finally
|
|
|
FreeAndNil(aAdoQuery);
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
|
|
|
Result:=str;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi_msk_new.GetCtnNumPkg(CtnNum: String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select sum(PKGS) PKGS from t_op_dgform where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+CtnNum+' and <20><><EFBFBD><EFBFBD>='''+t_op_dgform.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('PKGS').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|