|
|
unit u_op_seae_web_dg_import;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, OleCtrls, iWebPDFEditorLib_TLB, ExtCtrls,
|
|
|
Buttons, DB, ADODB, bsSkinCtrls, DBCtrls, bsdbctrls, StdCtrls, RxLookup,
|
|
|
wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker, Mask, wwdblook,
|
|
|
ComCtrls, bsSkinTabs, Wwdbigrd, Wwdbgrid, Grids, DBGridEh, cxControls,
|
|
|
cxSplitter, Menus, ToolWin, ImgList, kbmMemTable,
|
|
|
IdAttachmentFile,IdText, IdBaseComponent, IdComponent,
|
|
|
IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
|
|
|
IdMessageClient, IdSMTPBase, IdSMTP,IdMessage,IdAttachment, RXSplit,
|
|
|
dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, DBGrids, bsSkinBoxCtrls;
|
|
|
type
|
|
|
Tfrm_op_seae_web_dg_import = class(TForm)
|
|
|
pnl1: TPanel;
|
|
|
qry_op_seae: TADOQuery;
|
|
|
ds_op_seae2: TDataSource;
|
|
|
lbl38: TLabel;
|
|
|
lbl39: TLabel;
|
|
|
lbl40: TLabel;
|
|
|
lbl41: TLabel;
|
|
|
lbl42: TLabel;
|
|
|
lbl43: TLabel;
|
|
|
lbl44: TLabel;
|
|
|
lbl45: TLabel;
|
|
|
lbl47: TLabel;
|
|
|
lbl48: TLabel;
|
|
|
dbtxt1: TDBText;
|
|
|
lbl50: TLabel;
|
|
|
bsknpnl1: TbsSkinPanel;
|
|
|
lbldc: TLabel;
|
|
|
dbedt3: TDBEdit;
|
|
|
dbedt4: TDBEdit;
|
|
|
dbedt5: TDBEdit;
|
|
|
dbedt6: TDBEdit;
|
|
|
dbedt7: TDBEdit;
|
|
|
dbedt8: TDBEdit;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
dbedt9: TDBEdit;
|
|
|
dbedt11: TDBEdit;
|
|
|
dbedt12: TDBEdit;
|
|
|
dbedt13: TDBEdit;
|
|
|
dbedt14: TDBEdit;
|
|
|
mailSend: TkbmMemTable;
|
|
|
strngfldSendStringField: TStringField;
|
|
|
strngfldSendField: TStringField;
|
|
|
strngfldSendField2: TStringField;
|
|
|
strngfldSendField3: TStringField;
|
|
|
strngfldSendField4: TStringField;
|
|
|
strngfldSendField5: TStringField;
|
|
|
strngfldSendField6: TStringField;
|
|
|
strngfldSendField7: TStringField;
|
|
|
bsknpnl2_right: TbsSkinPanel;
|
|
|
pnl2_ch_fee_edi: TPanel;
|
|
|
lbl75: TLabel;
|
|
|
lbl83: TLabel;
|
|
|
dbedt37: TDBEdit;
|
|
|
Panel2: TPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
t_op_ctndetail1: TDataSource;
|
|
|
Memo4: TMemo;
|
|
|
Memo3: TMemo;
|
|
|
Memo2: TMemo;
|
|
|
Memo1: TMemo;
|
|
|
dxDBGrid5: TdxDBGrid;
|
|
|
dxDBGrid5Column3: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGridColumn1: TdxDBGridColumn;
|
|
|
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
|
|
|
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridColumn;
|
|
|
dxDBGrid1Column6: TdxDBGridColumn;
|
|
|
Label245: TLabel;
|
|
|
Label246: TLabel;
|
|
|
Label248: TLabel;
|
|
|
Label250: TLabel;
|
|
|
Label252: TLabel;
|
|
|
Label254: TLabel;
|
|
|
Label255: TLabel;
|
|
|
Label257: TLabel;
|
|
|
Label261: TLabel;
|
|
|
Label266: TLabel;
|
|
|
Label268: TLabel;
|
|
|
Label272: TLabel;
|
|
|
Label273: TLabel;
|
|
|
Label277: TLabel;
|
|
|
DBEdit94: TDBEdit;
|
|
|
DBEdit96: TDBEdit;
|
|
|
DBEdit98: TDBEdit;
|
|
|
DBEdit102: TDBEdit;
|
|
|
DBEdit103: TDBEdit;
|
|
|
DBEdit104: TDBEdit;
|
|
|
DBEdit108: TDBEdit;
|
|
|
DBEdit117: TDBEdit;
|
|
|
DBEdit119: TDBEdit;
|
|
|
DBEdit123: TDBEdit;
|
|
|
wwDBComboBox21: TwwDBComboBox;
|
|
|
DBEdit125: TDBEdit;
|
|
|
wwDBLookupCombo31: TwwDBLookupCombo;
|
|
|
wwDBLookupCombo28: TwwDBLookupCombo;
|
|
|
Label251: TLabel;
|
|
|
DBEdit99: TDBEdit;
|
|
|
DBEdit124: TDBEdit;
|
|
|
Label276: TLabel;
|
|
|
DBEdit101: TDBEdit;
|
|
|
Label253: TLabel;
|
|
|
wwDBLookupCombo29: TwwDBLookupCombo;
|
|
|
Label247: TLabel;
|
|
|
wwDBComboBox24: TwwDBComboBox;
|
|
|
Label256: TLabel;
|
|
|
Label278: TLabel;
|
|
|
DBEdit97: TDBEdit;
|
|
|
Label249: TLabel;
|
|
|
Label270: TLabel;
|
|
|
DBEdit122: TDBEdit;
|
|
|
Label271: TLabel;
|
|
|
Label263: TLabel;
|
|
|
wwDBComboBox28: TwwDBComboBox;
|
|
|
DBEdit118: TDBEdit;
|
|
|
wwDBComboBox23: TwwDBComboBox;
|
|
|
Label269: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
Label1: TLabel;
|
|
|
t_op_dgform: TADOQuery;
|
|
|
t_op_ctn_detail: TADOQuery;
|
|
|
t_op_ctn1: TDataSource;
|
|
|
del_dgfrom: TADOQuery;
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure btnCoseClick(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure t_op_dgformAfterInsert(DataSet: TDataSet);
|
|
|
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
m_bsno:string;
|
|
|
m_qryTask:TADOQuery;
|
|
|
procedure InitialBusiData();
|
|
|
procedure setcolor();
|
|
|
function defctn():Boolean;
|
|
|
procedure savectndetail();
|
|
|
function getkingpkgs(kindpkgscode:string):string;
|
|
|
|
|
|
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
|
|
|
public procedure InitialData( qryTask:TADOQuery; bsno1:string);
|
|
|
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_web_dg_import: Tfrm_op_seae_web_dg_import;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
{$R *.dfm}
|
|
|
uses my_sys_function,u_main, u_tree_main, u_data_share, u_sys_progress,
|
|
|
u_sendmail_msg;
|
|
|
|
|
|
/// <summary>
|
|
|
/// <20><>ʱĿ¼
|
|
|
/// </summary>
|
|
|
function GetWinTempPath: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_web_dg_import.InitialData( qryTask:TADOQuery; bsno1:string);
|
|
|
|
|
|
begin
|
|
|
m_qryTask:=qryTask;
|
|
|
m_bsno:=bsno1;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.InitialBusiData();
|
|
|
var
|
|
|
strtmp,strtmp1:string;
|
|
|
begin
|
|
|
//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
|
|
|
|
|
|
|
qry_op_seae.Close;
|
|
|
qry_op_seae.SQL.clear;
|
|
|
qry_op_seae.SQL.Add('select * from t_op_seae where <20><><EFBFBD><EFBFBD>='''+m_qryTask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').asstring+ '''');
|
|
|
qry_op_seae.open;
|
|
|
|
|
|
t_op_ctn.Close;
|
|
|
t_op_ctn.SQL.clear;
|
|
|
t_op_ctn.SQL.Add('select * from t_op_seae_dg_task_ctn where TASKID='''+m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+ '''');
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctn_detail.open;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
InitialBusiData();
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.btnCoseClick(Sender: TObject);
|
|
|
begin
|
|
|
|
|
|
close();
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.setcolor;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_web_dg_import.defctn: Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
sql,mailremarks,mailto,mailtitle:String;
|
|
|
icount:Integer;
|
|
|
begin
|
|
|
|
|
|
|
|
|
frm_main.db.BeginTrans;
|
|
|
try
|
|
|
del_dgfrom.Close;
|
|
|
del_dgfrom.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=qry_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
del_dgfrom.ExecSQL;
|
|
|
t_op_dgform.Open;
|
|
|
t_op_ctn.First;
|
|
|
icount:=1;
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
t_op_ctn_detail.First;
|
|
|
while not t_op_ctn_detail.Eof do begin
|
|
|
t_op_dgform.Insert;
|
|
|
t_op_dgform['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['ContainerNumber'];
|
|
|
t_op_dgform['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=icount;
|
|
|
t_op_dgform['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['ContainerSize'];
|
|
|
t_op_dgform['PKGS']:=t_op_ctn_detail['PackageQuantity'];
|
|
|
t_op_dgform['PACKAGE']:=t_op_ctn_detail['PackageType'];
|
|
|
t_op_dgform['WEIGHT']:=t_op_ctn_detail['GrossWeight'];
|
|
|
t_op_dgform['NET_WEIGHT']:=t_op_ctn_detail['NetWeight'];
|
|
|
t_op_dgform['PACKINGCODE']:=t_op_ctn_detail['PackingCode'];
|
|
|
t_op_dgform['UNNO']:=t_op_ctn_detail['UNNO'];
|
|
|
t_op_dgform['IMO_CLASS']:=t_op_ctn_detail['ImoClass'];
|
|
|
t_op_dgform['PROPER_SHIPPING_NAME']:=t_op_ctn_detail['ProperShippingName'];
|
|
|
t_op_dgform['NA_NO']:=t_op_ctn_detail['NaNumber'];
|
|
|
t_op_dgform['SUB_HAZARD1']:=t_op_ctn_detail['Subrisk1'];
|
|
|
t_op_dgform['IMDG']:=t_op_ctn_detail['IMDGCodeSegregationGroup'];
|
|
|
t_op_dgform['FLASH_POINT']:=t_op_ctn_detail['FlashPoint'];
|
|
|
t_op_dgform['PACKING_GROUP']:=t_op_ctn_detail['PackingGroup'];
|
|
|
t_op_dgform['EMS']:=t_op_ctn_detail['EMS'];
|
|
|
t_op_dgform['TECHNICAL_NAME']:=t_op_ctn_detail['TechnicalName'];
|
|
|
t_op_dgform['MARINE_POLLUTANT']:=t_op_ctn_detail['MarinePollutant'];
|
|
|
t_op_dgform['TRANSPORT_IN_LIMITED_QUANTIFY']:=t_op_ctn_detail['LimitedQuantity'];
|
|
|
t_op_dgform['CONTROL_TEMPERATURE']:=t_op_ctn_detail['ControlTemperature'];
|
|
|
t_op_dgform['EMERGENCY_TEMPERATURE']:=t_op_ctn_detail['EmergencyTemperature'];
|
|
|
t_op_dgform['SUFFIX']:=t_op_ctn_detail['UNNOSufficSequence'];
|
|
|
// t_op_dgform['FUMIGANT']:=t_op_ctndetail['PackageType'];
|
|
|
t_op_dgform['CONTACT']:=t_op_ctn_detail['contactPerson'];
|
|
|
t_op_dgform['CONTACTTEL']:=t_op_ctn_detail['contactTelephone'];
|
|
|
if (t_op_ctn_detail.FieldByName('InnerPackage').AsString<>'') then
|
|
|
t_op_dgform['INNERPKGS']:=t_op_ctn_detail['InnerPackage'];
|
|
|
t_op_dgform['INNERPACKAGE']:=t_op_ctn_detail['InnerPackageType'];
|
|
|
|
|
|
t_op_dgform['SUB_HAZARD2']:=t_op_ctn_detail['Subrisk2'];
|
|
|
t_op_dgform.Post;
|
|
|
t_op_ctn_detail.Next;
|
|
|
end;
|
|
|
icount:=icount+1;
|
|
|
t_op_ctn.Next;
|
|
|
end;
|
|
|
t_op_dgform.Post;
|
|
|
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27>ѽ<EFBFBD><D1BD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27>ѽ<EFBFBD><D1BD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
finally
|
|
|
if frm_main.db.InTransaction then
|
|
|
begin
|
|
|
frm_main.db.RollbackTrans;
|
|
|
end;
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.savectndetail;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_web_dg_import.getkingpkgs(
|
|
|
kindpkgscode: string): string;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
sql:string;
|
|
|
mailremarks,mailto,mailtitle:String;
|
|
|
SMTP1:TIdSMTP;
|
|
|
IdMsg:TIdMessage;
|
|
|
begin
|
|
|
if( Application.MessageBox(PChar('<27><>ȷʵҪֱ<D2AA>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӹر<D3B9><D8B1><EFBFBD><EFBFBD><EFBFBD>!,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
|
|
|
Exit;
|
|
|
try
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
//
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
//** m_qryTask.Connection.CommitTrans;
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close();
|
|
|
except
|
|
|
on e:Exception do
|
|
|
begin
|
|
|
m_qryTask.Cancel();
|
|
|
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_web_dg_import.t_op_dgformAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_op_dgform['<27><><EFBFBD><EFBFBD>']:=t_op_dgform.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|
|
|
|