|
|
unit u_op_seae_edi;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
|
|
|
dxDBGrid, Grids, Wwdbigrd, Wwdbgrid, StdCtrls, DB,
|
|
|
ADODB, dxDBTLCl, dxGrClms, ComCtrls, bsSkinTabs, DBCtrls, wwdblook,
|
|
|
wwdbdatetimepicker, RxLookup, Menus, XPMenu, Mask, wwdbedit, Wwdotdot,
|
|
|
Wwdbcomb,inifiles, kbmMemTable;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_edi = class(TForm)
|
|
|
Panel2: TPanel;
|
|
|
t_op_seae: TADOQuery;
|
|
|
t_op_seae1: TDataSource;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
XPMenu1: TXPMenu;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label10: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label125: TLabel;
|
|
|
Label30: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Label8: TLabel;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBLookupCombo49: TwwDBLookupCombo;
|
|
|
Edit7: TEdit;
|
|
|
Edit2: TEdit;
|
|
|
RxDBLookupCombo6: TRxDBLookupCombo;
|
|
|
bsSkinPanel5: TbsSkinPanel;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
|
|
|
Label38: TLabel;
|
|
|
DBEdit9: TDBEdit;
|
|
|
Label36: TLabel;
|
|
|
DBEdit7: TDBEdit;
|
|
|
t_code_sendedi: TADOQuery;
|
|
|
t_code_sendedi1: TDataSource;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column114: TdxDBGridColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column7: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column81: TdxDBGridColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column10: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column11: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column12: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column17: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column18: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column22: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column23: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column28: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column29: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column30: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column31: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column32: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column33: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column34: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column35: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column36: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column37: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column38: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column39: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column40: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column41: TdxDBGridColumn;
|
|
|
dxDBGrid1Column42: TdxDBGridColumn;
|
|
|
dxDBGrid11: TdxDBGridMaskColumn;
|
|
|
dxDBGrid12: TdxDBGridMaskColumn;
|
|
|
dxDBGrid13: TdxDBGridMaskColumn;
|
|
|
dxDBGrid14: TdxDBGridMaskColumn;
|
|
|
dxDBGrid15: TdxDBGridMaskColumn;
|
|
|
dxDBGrid16: TdxDBGridMaskColumn;
|
|
|
dxDBGrid17: TdxDBGridMaskColumn;
|
|
|
dxDBGrid18: TdxDBGridMaskColumn;
|
|
|
dxDBGrid19: TdxDBGridMaskColumn;
|
|
|
dxDBGrid110: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column63: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1TEU: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column65: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column66: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column67: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column68: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column69: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column70: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column71: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column72: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column97: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column119: TdxDBGridColumn;
|
|
|
dxDBGrid1Column120: TdxDBGridColumn;
|
|
|
dxDBGrid1Column122: TdxDBGridCheckColumn;
|
|
|
dxDBGrid1Column124: TdxDBGridColumn;
|
|
|
dxDBGrid1Column125: TdxDBGridColumn;
|
|
|
dxDBGrid1Column126: TdxDBGridColumn;
|
|
|
SaveDialog1: TSaveDialog;
|
|
|
t_op_ctn1: TDataSource;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
Label20: TLabel;
|
|
|
Label124: TLabel;
|
|
|
RxDBLookupCombo28: TRxDBLookupCombo;
|
|
|
Label35: TLabel;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
RxDBLookupCombo22: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo8: TRxDBLookupCombo;
|
|
|
memtotal: TkbmMemTable;
|
|
|
memtotal1: TDataSource;
|
|
|
memtotalField20: TIntegerField;
|
|
|
memtotalField40: TIntegerField;
|
|
|
memtotalField40HC: TIntegerField;
|
|
|
memtotalField45: TIntegerField;
|
|
|
memtotalField202: TIntegerField;
|
|
|
memtotalField402: TIntegerField;
|
|
|
memtotalField40HC2: TIntegerField;
|
|
|
memtotalField452: TIntegerField;
|
|
|
memtotalField203: TIntegerField;
|
|
|
memtotalField403: TIntegerField;
|
|
|
memtotalField40HC3: TIntegerField;
|
|
|
memtotalField453: TIntegerField;
|
|
|
memtotalField204: TIntegerField;
|
|
|
memtotalField404: TIntegerField;
|
|
|
memtotalField40HC4: TIntegerField;
|
|
|
memtotalField454: TIntegerField;
|
|
|
memtotalField: TIntegerField;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N16Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure dxDBGrid1Column4CustomDrawCell(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxTreeListColumn; ASelected, AFocused,
|
|
|
ANewItemRow: Boolean; var AText: String; var AColor: TColor;
|
|
|
AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure bsSkinCheckRadioBox2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinCheckRadioBox1Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
seaestr,seaedelstr:string ;
|
|
|
function findstr:string ;
|
|
|
procedure setFootermsg;
|
|
|
function CreateIFCSUMEdiFile:TStrings;
|
|
|
function CreateVOSTOCHNYEdiFile:TStrings;
|
|
|
function CreateEdiFile:TStrings;
|
|
|
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_edi: Tfrm_op_seae_edi;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
{$R *.dfm}
|
|
|
uses u_main,my_sys_function,u_data_share ;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
savereggrid(dxdbgrid1,caption+'1');
|
|
|
frm_op_seae_edi.Hide;
|
|
|
frm_op_seae_edi.ManualFloat(frm_op_seae_edi.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_seae_edi');
|
|
|
action:=cafree;
|
|
|
frm_op_seae_edi:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_no(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid_view_all(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
update_grid(dxdbgrid1,210);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.N16Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxdbgrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.FormShow(Sender: TObject);
|
|
|
var i:integer ;
|
|
|
begin
|
|
|
loadreggrid(dxdbgrid1,true,caption+'1');
|
|
|
bsSkinCheckRadioBox2.checked:=True;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
edit2.text:='' ;
|
|
|
edit7.Text:='' ;
|
|
|
wwDBDateTimePicker1.Clear ;
|
|
|
wwDBDateTimePicker2.Clear ;
|
|
|
RxDBLookupCombo6.ClearValue ;
|
|
|
wwDBLookupCombo49.clear ;
|
|
|
RxDBLookupCombo22.ClearValue ;
|
|
|
RxDBLookupCombo8.ClearValue ;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi.findstr: string;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.setFootermsg;
|
|
|
var backteu,ggteu,thcteu:integer ;
|
|
|
i,teu1,teu2,teu3,teu4,teu5,teu6,teu7,teu8,teu9,teu10,teuot,teuall:integer;
|
|
|
steu:string;
|
|
|
teu:Array [1..10] of integer;
|
|
|
begin
|
|
|
{
|
|
|
lblcount.Caption:='Ʊ<><C6B1> <20><>: '+inttostr(t_op_seae.recordcount) ;
|
|
|
ggteu:=0 ; backteu:=0 ;thcteu:=0 ;
|
|
|
teu[1]:=0;
|
|
|
teu[2]:=0;
|
|
|
teu[3]:=0;
|
|
|
teu[4]:=0;
|
|
|
teu[5]:=0;
|
|
|
teu[6]:=0;
|
|
|
teu[7]:=0;
|
|
|
teu[8]:=0;
|
|
|
teu[9]:=0;
|
|
|
teu[10]:=0;
|
|
|
teuot:=0;
|
|
|
teuall:=0;
|
|
|
|
|
|
with t_op_seae do
|
|
|
begin
|
|
|
disablecontrols ;
|
|
|
first ;
|
|
|
while not eof do
|
|
|
begin
|
|
|
teu[1]:=teu[1]+fieldbyname('<27><><EFBFBD><EFBFBD>1').AsInteger;
|
|
|
teu[2]:=teu[2]+fieldbyname('<27><><EFBFBD><EFBFBD>2').AsInteger;
|
|
|
teu[3]:=teu[3]+fieldbyname('<27><><EFBFBD><EFBFBD>3').AsInteger;
|
|
|
teu[4]:=teu[4]+fieldbyname('<27><><EFBFBD><EFBFBD>4').AsInteger;
|
|
|
teu[5]:=teu[5]+fieldbyname('<27><><EFBFBD><EFBFBD>5').AsInteger;
|
|
|
teu[6]:=teu[6]+fieldbyname('<27><><EFBFBD><EFBFBD>6').AsInteger;
|
|
|
teu[7]:=teu[7]+fieldbyname('<27><><EFBFBD><EFBFBD>7').AsInteger;
|
|
|
teu[8]:=teu[8]+fieldbyname('<27><><EFBFBD><EFBFBD>8').AsInteger;
|
|
|
teu[9]:=teu[9]+fieldbyname('<27><><EFBFBD><EFBFBD>9').AsInteger;
|
|
|
teu[10]:=teu[10]+fieldbyname('<27><><EFBFBD><EFBFBD>10').AsInteger;
|
|
|
teuot:=teuot+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger;
|
|
|
teuall:=teuall+fieldbyname('<27><>TEU').AsInteger;
|
|
|
next ;
|
|
|
end ;
|
|
|
enablecontrols ;
|
|
|
steu:='<27><>װ<EFBFBD><D7B0>:';
|
|
|
for i:=1 to 10 do
|
|
|
begin
|
|
|
try
|
|
|
if trim(frm_data_share.t_code_ctn_de.fieldbyname('<27><><EFBFBD><EFBFBD>'+inttostr(i)).asstring)<>'' then
|
|
|
begin
|
|
|
if frm_data_share.t_code_ctn.locate('<27><><EFBFBD><EFBFBD>',trim(frm_data_share.t_code_ctn_de.fieldbyname('<27><><EFBFBD><EFBFBD>'+inttostr(i)).asstring),[]) then
|
|
|
begin
|
|
|
steu:=steu+' '+trim(frm_data_share.t_code_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring)+': '+inttostr(teu[i]);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
end;
|
|
|
except
|
|
|
;
|
|
|
end;
|
|
|
end;
|
|
|
steu:=steu+' '+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+inttostr(teuot);
|
|
|
steu:=steu+' '+'<27>ϼ<EFBFBD>TEU: '+inttostr(teuall);
|
|
|
|
|
|
lblcount.Caption:='Ʊ<><C6B1><EFBFBD><EFBFBD>: '+inttostr(t_op_seae.recordcount) ;
|
|
|
lblcount.Caption:=lblcount.Caption+' '+steu;
|
|
|
end ;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.dxDBGrid1Column4CustomDrawCell(Sender: TObject;
|
|
|
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
|
|
|
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
|
|
|
var AText: String; var AColor: TColor; AFont: TFont;
|
|
|
var AAlignment: TAlignment; var ADone: Boolean);
|
|
|
begin
|
|
|
AColor:=dxgrid_color('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>',ANode.Strings[dxDBGrid1Column4.Index]);
|
|
|
AFont.Color:=clblack;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_op_seae,'<27><><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinButton2Click(Sender: TObject);
|
|
|
var str,delstr:string ;
|
|
|
begin
|
|
|
str:='where װ<>˷<EFBFBD>ʽ<>''ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'' and װ<>˷<EFBFBD>ʽ<>''<27><>Ʊ<EFBFBD><C6B1>Ʊ'' and װ<>˷<EFBFBD>ʽ<>''<27><>Ʊ<EFBFBD><C6B1>Ʊ'' ' ;
|
|
|
if edit2.text<>'' then str:=str+' and <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
|
|
|
if edit7.text<>'' then str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
|
|
|
|
|
|
if wwDBLookupCombo49.text<>''then
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
|
|
|
if wwDBDateTimePicker1.text<>''then
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
|
|
|
if wwDBDateTimePicker2.text<>''then
|
|
|
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
|
|
|
if RxDBLookupCombo22.DisplayValue<>''then
|
|
|
str:=str+' and װ<>۴<EFBFBD><DBB4><EFBFBD>='+''''+RxDBLookupCombo22.DisplayValues[2]+'''';
|
|
|
if RxDBLookupCombo8.DisplayValue<>''then
|
|
|
str:=str+' and ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo8.DisplayValues[2]+'''';
|
|
|
|
|
|
if RxDBLookupCombo6.DisplayValues[1]<>'' then str:=str+' and <20><><EFBFBD><EFBFBD>˾='+''''+RxDBLookupCombo6.DisplayValues[1]+'''';
|
|
|
|
|
|
|
|
|
screen.Cursor:=crSQLwait ;
|
|
|
try
|
|
|
with t_op_seae,SQL do
|
|
|
begin
|
|
|
close ; Clear ;
|
|
|
add('select * from t_op_seae ');
|
|
|
add(str);
|
|
|
open ;
|
|
|
end ;
|
|
|
setfootermsg ;
|
|
|
finally
|
|
|
screen.Cursor:=crDefault ;
|
|
|
end ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
if t_code_sendedi.State in [dsedit,dsinsert] then
|
|
|
t_code_sendedi.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinCheckRadioBox2Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_code_sendedi.State in [dsedit,dsinsert] then
|
|
|
t_code_sendedi.post;
|
|
|
if bsSkinCheckRadioBox2.Checked then begin
|
|
|
t_code_sendedi.close;
|
|
|
t_code_sendedi.SQL.Text:='select * from t_code_sendedi where EDI<44><49><EFBFBD><EFBFBD>='''+bsSkinCheckRadioBox2.Caption+'''';
|
|
|
t_code_sendedi.Open;
|
|
|
if t_code_sendedi.IsEmpty then begin
|
|
|
t_code_sendedi.Insert;
|
|
|
t_code_sendedi.FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString:=bsSkinCheckRadioBox2.Caption;
|
|
|
t_code_sendedi.post;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi.CreateEdiFile: TStrings;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi.CreateIFCSUMEdiFile: TStrings;
|
|
|
var
|
|
|
Str,sl1,sl:TStringList;
|
|
|
i,l,M:integer;
|
|
|
SenderCode,ReciverCode,strtemp:String;
|
|
|
aQuery:TADOQuery;
|
|
|
function GetShipperString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='16:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function GetConsigneString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='17:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function GetNOTIFYString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='18:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
function GetMARKSString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><>ͷ').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='44:';
|
|
|
Result:=Result+FormatListString(TempStr,10,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
begin
|
|
|
str:=Tstringlist.Create;
|
|
|
sl1:=Tstringlist.Create;
|
|
|
sl:=Tstringlist.Create;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
SenderCode:=trim(DBEdit9.Text) ;
|
|
|
ReciverCode:=trim(DBEdit7.Text) ;
|
|
|
|
|
|
str.Add('00:IFCSUM:MANIFEST:9:'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
|
|
|
str.Add('10::' + trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':::'
|
|
|
+ GetDatetime(datetimetostr(t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime),0)+':'
|
|
|
+ GetDatetime(datetimetostr(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime),0)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
|
|
|
if SenderCode<>'' then
|
|
|
str.Add('11:'+ SenderCode+#39);
|
|
|
t_op_seae.First;
|
|
|
while not t_op_seae.eof do begin
|
|
|
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring,[]) then
|
|
|
begin
|
|
|
strtemp:=copy(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,1,1);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
strtemp:='P';
|
|
|
end;
|
|
|
|
|
|
str.Add('12:'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring) +'::::'
|
|
|
+':'
|
|
|
+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+ strtemp+':'
|
|
|
+ GetDatetime(trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+'::'
|
|
|
+ GetDatetime(trim(t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+':'
|
|
|
+'::'
|
|
|
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
|
|
|
|
|
|
str.Add ('13:'+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +'::::'
|
|
|
+#39);
|
|
|
|
|
|
Str.Add(GetShipperString);
|
|
|
Str.Add(GetConsigneString);
|
|
|
Str.Add(GetNOTIFYString);
|
|
|
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Text:='select * from t_op_yp_ctn where <20><><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''';
|
|
|
aQuery.Open;
|
|
|
|
|
|
if not aQuery.IsEmpty then begin
|
|
|
while not aQuery.Eof do begin
|
|
|
str.Add ('21:'+Trim(GetCntrEdi(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+':'+trim(aQuery.fieldbyname('<27><>״̬').asstring)+':'
|
|
|
+':::::'+''''
|
|
|
);
|
|
|
aQuery.Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
str.Add ('41:1::'+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)+':' // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(GetpkgsEdi(t_op_seae.fieldbyname('<27><>װ').asstring))+':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><>װ').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +#39);
|
|
|
IF trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
|
|
|
BEGIN
|
|
|
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>䶳
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+trim(t_op_seae.fieldbyname('<27>¶ȵ<C2B6>λ').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +#39);
|
|
|
END;
|
|
|
IF trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
|
|
|
BEGIN
|
|
|
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>䶳
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒҳ<C6B7><D2B3>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+'::'
|
|
|
+':'
|
|
|
+':'
|
|
|
+#39);
|
|
|
END;
|
|
|
Str.Add(GetMARKSString);
|
|
|
sl1.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
GetLengthTString(sl1,35);
|
|
|
sl.text:='';
|
|
|
for L:=0 to sl1.Count-1 do begin
|
|
|
if Trim(sl1.Strings[L])<>'' then
|
|
|
sl.Add(sl1.Strings[L]);
|
|
|
end;
|
|
|
strtemp:='';
|
|
|
M:=1;
|
|
|
for L:=0 to sl.Count-1 do begin
|
|
|
if M<=5 then begin
|
|
|
if M=1 then begin
|
|
|
strtemp:='47:'+sl.Strings[L]+':';
|
|
|
end else begin
|
|
|
if M=5 then
|
|
|
strtemp:=strtemp+sl.Strings[L]
|
|
|
else
|
|
|
strtemp:=strtemp+sl.Strings[L]+':';
|
|
|
end;
|
|
|
end else begin
|
|
|
strtemp:=strtemp+'''';
|
|
|
Str.Add(strtemp);
|
|
|
M:=1;
|
|
|
strtemp:='47:'+sl.Strings[L]+':';
|
|
|
end;
|
|
|
M:=M+1;
|
|
|
end;
|
|
|
strtemp:=strtemp+'''';
|
|
|
Str.Add(strtemp);
|
|
|
|
|
|
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Text:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''';
|
|
|
aQuery.Open;
|
|
|
|
|
|
if not aQuery.IsEmpty then begin
|
|
|
while not aQuery.Eof do begin
|
|
|
str.Add ('51:1:'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+Trim(GetCntrEdi(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+trim(aQuery.fieldbyname('<27><>״̬').asstring)
|
|
|
+':'+trim(IntToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger))+':'+trim(FloatToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+':'
|
|
|
+trim(FloatToStr(aQuery.fieldbyname('<27><>Ƥ<EFBFBD><C6A4>').AsFloat))+':'+trim(FloatToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+'::::::'
|
|
|
+trim(aQuery.fieldbyname('<27><>λ').asstring)+''''
|
|
|
);
|
|
|
aQuery.Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
t_op_seae.Next;
|
|
|
end;
|
|
|
I:=str.Count;
|
|
|
str.Add('99:'+intToStr(i+1)+'''');
|
|
|
{
|
|
|
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>Ȳ<EFBFBD><C8B2>淶<EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
SaveDialog1.FileName:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
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;
|
|
|
finally
|
|
|
FreeAndNil(Str);
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_edi.CreateVOSTOCHNYEdiFile: TStrings;
|
|
|
var
|
|
|
Str,sl1,sl:TStringList;
|
|
|
i,l,M:integer;
|
|
|
SenderCode,ReciverCode,strtemp:String;
|
|
|
aQuery:TADOQuery;
|
|
|
function GetShipperString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='16:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function GetConsigneString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='17:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
function GetNOTIFYString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='18:';
|
|
|
Result:=Result+':';
|
|
|
Result:=Result+FormatListString(TempStr,6,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
function GetMARKSString:String;
|
|
|
var
|
|
|
TempStr:TStringList;
|
|
|
begin
|
|
|
TempStr:=TStringList.Create;
|
|
|
try
|
|
|
TempStr.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><>ͷ').AsString);
|
|
|
GetLengthTString(TempStr,35);
|
|
|
Result:='44:';
|
|
|
Result:=Result+FormatListString(TempStr,10,35)+'''';
|
|
|
finally
|
|
|
FreeAndNil(TempStr);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
begin
|
|
|
str:=Tstringlist.Create;
|
|
|
sl1:=Tstringlist.Create;
|
|
|
sl:=Tstringlist.Create;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
SenderCode:=trim(DBEdit9.Text) ;
|
|
|
ReciverCode:=trim(DBEdit7.Text) ;
|
|
|
|
|
|
str.Add('00:IFCSUM:MANIFEST:9:'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
|
|
|
str.Add('10::' + trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':::'
|
|
|
+ GetDatetime(datetimetostr(t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime),0)+':'
|
|
|
+ GetDatetime(datetimetostr(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime),0)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+trim(GetPortREdi(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)) +':'
|
|
|
+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+#39);
|
|
|
if SenderCode<>'' then
|
|
|
str.Add('11:'+ SenderCode+#39);
|
|
|
t_op_seae.First;
|
|
|
while not t_op_seae.eof do begin
|
|
|
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring,[]) then
|
|
|
begin
|
|
|
strtemp:=copy(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,1,1);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
strtemp:='P';
|
|
|
end;
|
|
|
|
|
|
str.Add('12:'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring) +'::::'
|
|
|
+':'
|
|
|
+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
|
|
|
+trim(t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+ trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+ strtemp+':'
|
|
|
+ GetDatetime(trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+'::'
|
|
|
+ GetDatetime(trim(t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+':'
|
|
|
+'::'
|
|
|
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
|
|
|
|
|
|
str.Add ('13:'+trim(GetPortREdi(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)) +':'
|
|
|
+trim(t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+trim(GetPortREdi(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +'::::'
|
|
|
+#39);
|
|
|
|
|
|
Str.Add(GetShipperString);
|
|
|
Str.Add(GetConsigneString);
|
|
|
Str.Add(GetNOTIFYString);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str.Add ('41:1:'+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)+':' // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(GetpkgsEdi(t_op_seae.fieldbyname('<27><>װ').asstring))+':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><>װ').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +#39);
|
|
|
IF trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
|
|
|
BEGIN
|
|
|
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>䶳
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+trim(t_op_seae.fieldbyname('<27>¶ȵ<C2B6>λ').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring) +#39);
|
|
|
END;
|
|
|
IF trim(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
|
|
|
BEGIN
|
|
|
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>䶳
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒҳ<C6B7><D2B3>').asstring) +':'
|
|
|
+trim(t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+':'
|
|
|
+'::'
|
|
|
+':'
|
|
|
+':'
|
|
|
+#39);
|
|
|
END;
|
|
|
Str.Add(GetMARKSString);
|
|
|
sl1.Text:=FormatEdiString(t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
|
GetLengthTString(sl1,35);
|
|
|
sl.text:='';
|
|
|
for L:=0 to sl1.Count-1 do begin
|
|
|
if Trim(sl1.Strings[L])<>'' then
|
|
|
sl.Add(sl1.Strings[L]);
|
|
|
end;
|
|
|
if sl.Text<>'' then begin
|
|
|
strtemp:='';
|
|
|
M:=1;
|
|
|
for L:=0 to sl.Count-1 do begin
|
|
|
if M<=10 then begin
|
|
|
if M=1 then begin
|
|
|
strtemp:='47:'+sl.Strings[L]+':';
|
|
|
end else begin
|
|
|
if M=10 then
|
|
|
strtemp:=strtemp+sl.Strings[L]
|
|
|
else
|
|
|
strtemp:=strtemp+sl.Strings[L]+':';
|
|
|
end;
|
|
|
end else begin
|
|
|
strtemp:=strtemp+'''';
|
|
|
Str.Add(strtemp);
|
|
|
M:=1;
|
|
|
strtemp:='47:'+sl.Strings[L]+':';
|
|
|
end;
|
|
|
M:=M+1;
|
|
|
end;
|
|
|
strtemp:=strtemp+'''';
|
|
|
Str.Add(strtemp);
|
|
|
end;
|
|
|
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Text:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'''';
|
|
|
aQuery.Open;
|
|
|
if not aQuery.IsEmpty then begin
|
|
|
i:=1;
|
|
|
while not aQuery.Eof do begin
|
|
|
str.Add ('51:'+inttostr(i)+':'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
|
|
|
+Trim(GetCntrEdi2(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+trim(aQuery.fieldbyname('<27><>״̬').asstring)
|
|
|
+':'+trim(IntToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger))+':'+trim(FloatToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+':'
|
|
|
+trim(FloatToStr(aQuery.fieldbyname('<27><>Ƥ<EFBFBD><C6A4>').AsFloat))+':'+trim(FloatToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+'::::::'
|
|
|
+trim(aQuery.fieldbyname('<27><>λ').asstring)+''''
|
|
|
);
|
|
|
aQuery.Next;
|
|
|
Inc(i);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
t_op_seae.Next;
|
|
|
end;
|
|
|
I:=str.Count;
|
|
|
str.Add('99:'+intToStr(i+1)+'''');
|
|
|
{
|
|
|
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>Ȳ<EFBFBD><C8B2>淶<EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
}
|
|
|
SaveDialog1.FileName:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
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;
|
|
|
finally
|
|
|
FreeAndNil(Str);
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
CreateIFCSUMEdiFile
|
|
|
else if bsSkinCheckRadioBox1.Checked then
|
|
|
CreateVOSTOCHNYEdiFile;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
if not t_op_ctn.Active then t_op_ctn.Open;
|
|
|
if not memtotal.Active then memtotal.Open;
|
|
|
memtotal.EmptyTable;
|
|
|
t_op_seae.First;
|
|
|
while not t_op_seae.Eof do begin
|
|
|
memtotal.edit;
|
|
|
memtotal.FieldByName('<27><>¼<EFBFBD><C2BC>').AsInteger:=memtotal.FieldByName('<27><>¼<EFBFBD><C2BC>').AsInteger+1;
|
|
|
memtotal.post;
|
|
|
if t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת' then begin
|
|
|
t_op_ctn.First;
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
memtotal.edit;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='20' then begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת20').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger+1;
|
|
|
end;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='45' then begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת45').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger+1;
|
|
|
end;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='40' then begin
|
|
|
if t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='HC' THEN begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40HC').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger+1;
|
|
|
end else begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger+1;
|
|
|
end;
|
|
|
end;
|
|
|
memtotal.post;
|
|
|
t_op_ctn.Next;
|
|
|
end;
|
|
|
end else if t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת' then begin
|
|
|
t_op_ctn.First;
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
memtotal.edit;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='20' then BEGIN
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת20').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger+1;
|
|
|
END;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='45' then BEGIN
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת45').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger+1;
|
|
|
|
|
|
END;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='40' then begin
|
|
|
if t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='HC' THEN BEGIN
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40HC').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger+1;
|
|
|
|
|
|
end else begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת40').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger+1;
|
|
|
END;
|
|
|
end;
|
|
|
memtotal.post;
|
|
|
t_op_ctn.Next;
|
|
|
end;
|
|
|
end else if pos('<27><><EFBFBD><EFBFBD>',t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString)>0 then begin
|
|
|
t_op_ctn.First;
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
memtotal.edit;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='20' then BEGIN
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>20').AsInteger+1;
|
|
|
END;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='45' then begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>45').AsInteger+1;
|
|
|
END;
|
|
|
if t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString='40' then begin
|
|
|
if t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString='HC' THEN begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40HC').AsInteger+1;
|
|
|
END else begin
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger+1;
|
|
|
if t_op_ctn.FieldByName('<27><>״̬').AsString='E' then
|
|
|
memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger:=memtotal.FieldByName('<27><><EFBFBD><EFBFBD>40').AsInteger+1;
|
|
|
END;
|
|
|
end;
|
|
|
memtotal.post;
|
|
|
t_op_ctn.Next;
|
|
|
end;
|
|
|
end;
|
|
|
t_op_seae.Next;
|
|
|
end;
|
|
|
try
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3>ڲյ<DAB2>',2,t_op_seae1,memtotal1,nil,nil,t_op_seae1,t_op_ctn1,nil,nil,nil,nil,nil);
|
|
|
finally
|
|
|
t_op_ctn.Close;
|
|
|
end;
|
|
|
memtotal.close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_edi.bsSkinCheckRadioBox1Click(Sender: TObject);
|
|
|
begin
|
|
|
if t_code_sendedi.State in [dsedit,dsinsert] then
|
|
|
t_code_sendedi.post;
|
|
|
if bsSkinCheckRadioBox1.Checked then begin
|
|
|
t_code_sendedi.close;
|
|
|
t_code_sendedi.SQL.Text:='select * from t_code_sendedi where EDI<44><49><EFBFBD><EFBFBD>='''+bsSkinCheckRadioBox1.Caption+'''';
|
|
|
t_code_sendedi.Open;
|
|
|
if t_code_sendedi.IsEmpty then begin
|
|
|
t_code_sendedi.Insert;
|
|
|
t_code_sendedi.FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString:=bsSkinCheckRadioBox1.Caption;
|
|
|
t_code_sendedi.post;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|