You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1020 lines
36 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_op_seae_web_si_edit;
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_si_edit = 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;
scrlbx2: TScrollBox;
bsknpnl4: TbsSkinPanel;
lbl5: TLabel;
lbl6: TLabel;
lbl7: TLabel;
lbl8: TLabel;
lbl9: TLabel;
lbl10: TLabel;
lbl11: TLabel;
lbl12: TLabel;
lbl13: TLabel;
lbl15: TLabel;
lbl16: TLabel;
lbl17: TLabel;
lbl18: TLabel;
lbl19: TLabel;
lbl20: TLabel;
lbl22: TLabel;
lbl24: TLabel;
lbl25: TLabel;
lbl30: TLabel;
lbl31: TLabel;
lbl14: TLabel;
lbl21: TLabel;
lbl23: TLabel;
lbl26: TLabel;
lbl27: TLabel;
lbl28: TLabel;
lbl29: TLabel;
lbl4: TLabel;
lbl32: TLabel;
lbl33: TLabel;
lbl34: TLabel;
lbl35: TLabel;
lbl36: TLabel;
lbl37: TLabel;
dbedt1: TDBEdit;
wdbdtmpckr1: TwwDBDateTimePicker;
wdbdtmpckr2: TwwDBDateTimePicker;
wdbdtmpckr3: TwwDBDateTimePicker;
wdbdtmpckr4: TwwDBDateTimePicker;
wdbdtmpckr5: TwwDBDateTimePicker;
bskndbchckrdbx1: TbsSkinDBCheckRadioBox;
dbmmo4: TDBMemo;
dbmmo5: TDBMemo;
dbmmo6: TDBMemo;
dbmmo7: TDBMemo;
dbmmo8: TDBMemo;
dbedt2: TDBEdit;
dbmmo9: TDBMemo;
pnl4_jjx: TPanel;
bsknpnl2: TbsSkinPanel;
wdblkpcmb1: TwwDBLookupCombo;
bsknpnl3: TbsSkinPanel;
lbl52: TLabel;
dbtxtTEU: TDBText;
lbl53: TLabel;
dbtxt2: TDBText;
dbtxt3: TDBText;
lbl54: TLabel;
dbtxt4: TDBText;
lbl55: TLabel;
lbl56: TLabel;
dbtxt5: TDBText;
dbedt14: TDBEdit;
dbedt15: TDBEdit;
dbedt16: TDBEdit;
dbedt17: TDBEdit;
dbedt18: TDBEdit;
dbedt19: TDBEdit;
dbedt20: TDBEdit;
dbedt21: TDBEdit;
dbedt22: TDBEdit;
dbedt23: TDBEdit;
dbedt24: TDBEdit;
dbedt25: TDBEdit;
dbedt26: TDBEdit;
dbedt29: TDBEdit;
dbedt30: TDBEdit;
dbedt32: TDBEdit;
dbedt33: TDBEdit;
dbedt35: TDBEdit;
dbmmo3: TDBMemo;
lbl3: TLabel;
lbl2: TLabel;
dbmmo2: TDBMemo;
lbl1: TLabel;
dbmmo1: TDBMemo;
dbedt34: TDBEdit;
dbedt36: TDBEdit;
dbedt27: TDBEdit;
dbedt28: TDBEdit;
dbedt31: TDBEdit;
wwDBGrid1: TwwDBGrid;
lbl57: TLabel;
ds_op_ctn1: TDataSource;
qry_op_ctn: TADOQuery;
qry_op_ctndetail: TADOQuery;
ds_op_ctndetail1: TDataSource;
mailSend: TkbmMemTable;
strngfldSendStringField: TStringField;
strngfldSendField: TStringField;
strngfldSendField2: TStringField;
strngfldSendField3: TStringField;
strngfldSendField4: TStringField;
strngfldSendField5: TStringField;
strngfldSendField6: TStringField;
strngfldSendField7: TStringField;
bsknpnl2_right: TbsSkinPanel;
bsknpnl6_left: TbsSkinPanel;
spl2: TSplitter;
pnl2_td: TPanel;
pnl2_ch_fee_edi: TPanel;
lbl75: TLabel;
lbl79: TLabel;
dbmmo10: TDBMemo;
lbl83: TLabel;
dbedt37: TDBEdit;
Panel2: TPanel;
bsSkinButton5: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
t_op_seae: TADOQuery;
t_op_ctn: TADOQuery;
t_op_ctn1: TDataSource;
t_op_seae1: TDataSource;
t_op_ctndetail: TADOQuery;
t_op_ctndetail1: TDataSource;
ScrollBox1: TScrollBox;
bsSkinPanel1: TbsSkinPanel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label25: TLabel;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
Label29: TLabel;
Label30: TLabel;
Label31: TLabel;
Label32: TLabel;
Label33: TLabel;
Label34: TLabel;
Label35: TLabel;
Label36: TLabel;
Label37: TLabel;
Label38: TLabel;
Label39: TLabel;
Label40: TLabel;
Label41: TLabel;
Label42: TLabel;
Label43: TLabel;
Label44: TLabel;
Label10: TLabel;
Label24: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label23: TLabel;
DBMemo1: TDBMemo;
DBMemo4: TDBMemo;
DBMemo5: TDBMemo;
DBMemo38: TDBMemo;
DBMemo2: TDBMemo;
DBEdit9: TDBEdit;
DBEdit10: TDBEdit;
DBEdit11: TDBEdit;
DBEdit12: TDBEdit;
DBEdit13: TDBEdit;
DBEdit16: TDBEdit;
DBEdit18: TDBEdit;
DBEdit19: TDBEdit;
DBEdit20: TDBEdit;
DBEdit21: TDBEdit;
DBEdit22: TDBEdit;
DBEdit23: TDBEdit;
DBEdit24: TDBEdit;
DBEdit25: TDBEdit;
DBEdit26: TDBEdit;
DBEdit27: TDBEdit;
DBEdit28: TDBEdit;
DBEdit29: TDBEdit;
DBEdit30: TDBEdit;
DBEdit31: TDBEdit;
DBEdit32: TDBEdit;
DBEdit33: TDBEdit;
DBEdit34: TDBEdit;
DBEdit35: TDBEdit;
DBEdit36: TDBEdit;
DBEdit17: TDBEdit;
DBEdit37: TDBEdit;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
CheckShipper: TbsSkinCheckRadioBox;
CheckConsignee: TbsSkinCheckRadioBox;
CheckNotifyParty: TbsSkinCheckRadioBox;
CheckMark: TbsSkinCheckRadioBox;
Checkhscode: TbsSkinCheckRadioBox;
CheckDescription: TbsSkinCheckRadioBox;
CheckMblno: TbsSkinCheckRadioBox;
CheckCtn: TbsSkinCheckRadioBox;
CheckVessel: TbsSkinCheckRadioBox;
CheckETD: TbsSkinCheckRadioBox;
CheckPortLoad: TbsSkinCheckRadioBox;
CheckPortDisCharge: TbsSkinCheckRadioBox;
CheckPortDestination: TbsSkinCheckRadioBox;
CheckBLFRT: TbsSkinCheckRadioBox;
CheckPayableAt: TbsSkinCheckRadioBox;
CheckIssuetype: TbsSkinCheckRadioBox;
Checkcargoid: TbsSkinCheckRadioBox;
CheckContractNo: TbsSkinCheckRadioBox;
Checkpkgs: TbsSkinCheckRadioBox;
Checkkindofpkgs: TbsSkinCheckRadioBox;
Checkkgs: TbsSkinCheckRadioBox;
Checkcbm: TbsSkinCheckRadioBox;
checkTEMPSET: TbsSkinCheckRadioBox;
checkREEFERF: TbsSkinCheckRadioBox;
checkHUMIDITY: TbsSkinCheckRadioBox;
checkDCLASS: TbsSkinCheckRadioBox;
checkDUNNO: TbsSkinCheckRadioBox;
checkFUWEI: TbsSkinCheckRadioBox;
checkSHANDIAN: TbsSkinCheckRadioBox;
checkHAIYANGWURANWU: TbsSkinCheckRadioBox;
CheckVoyno: TbsSkinCheckRadioBox;
DBEdit3: TDBEdit;
CheckPortLoadID: TbsSkinCheckRadioBox;
CheckPortDisChargeID: TbsSkinCheckRadioBox;
CheckPortDestinationID: TbsSkinCheckRadioBox;
CheckPrepardAt: TbsSkinCheckRadioBox;
CheckService: TbsSkinCheckRadioBox;
Checknoofbl: TbsSkinCheckRadioBox;
wwDBComboBox15: TwwDBComboBox;
bsSkinPanel2: TbsSkinPanel;
txt1: TStaticText;
DBGridEh1: TDBGridEh;
DBGrid1: TDBGrid;
DBMemo3: TDBMemo;
Label5: TLabel;
OP_STATUS_LOG: TADOQuery;
Memo4: TMemo;
Memo3: TMemo;
Memo2: TMemo;
Memo1: TMemo;
CheckSiRemark: TbsSkinCheckRadioBox;
t_op_ams: TADOQuery;
procedure FormShow(Sender: TObject);
procedure btnCoseClick(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
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_si_edit: Tfrm_op_seae_web_si_edit;
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_si_edit.InitialData( qryTask:TADOQuery; bsno1:string);
begin
m_qryTask:=qryTask;
m_bsno:=bsno1;
end;
procedure Tfrm_op_seae_web_si_edit.InitialBusiData();
var
strtmp,strtmp1:string;
begin
//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
t_op_seae.Close;
t_op_seae.SQL.clear;
t_op_seae.SQL.Add('select B.*,case B.BSSTATUS when ''Create'' then ''¼<><C2BC>'' when ''Confirm'' then ''<27><>ȷ<EFBFBD><C8B7>'' when ''Submit'' then ''<27><EFBFBD>ص<EFBFBD>''');
t_op_seae.SQL.Add('when ''Back'' then ''<27><><EFBFBD><EFBFBD>'' else '''' end BSSTATUSREF ');
t_op_seae.SQL.Add(',u.EMAIL CUSTMAIL,u.TEL,u.[NAME] CUSTATTN,u.REC_BC_MAIL,CASE WHEN U.IS_ADMIN=1 THEN INFO_CLIENT ELSE (select info_client from SYS_USER where GID=U.PARENT_ID) END ί<>е<EFBFBD>λ');
t_op_seae.SQL.Add(' from OP_SEAE_SI B LEFT JOIN SYS_USER U ON (U.GID=B.USERID) where B.BSSTATUS<>''Create'' and B.SINO='''+m_bsno+''' '
+' order by B.ETD DESC');
t_op_seae.open;
t_op_ctn.Open;
t_op_ctndetail.Open;
qry_op_seae.Close;
qry_op_seae.SQL.clear;
qry_op_seae.SQL.Add('select * from t_op_seae where <20><><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('BSNO').AsString+ '''');
qry_op_seae.open;
qry_op_ctn.Active:=False;
qry_op_ctn.Active:=True;
qry_op_ctndetail.Active:=false;
qry_op_ctndetail.Active:=True;
setcolor;
end;
procedure Tfrm_op_seae_web_si_edit.FormShow(Sender: TObject);
begin
InitialBusiData();
end;
procedure Tfrm_op_seae_web_si_edit.btnCoseClick(Sender: TObject);
begin
close();
end;
procedure Tfrm_op_seae_web_si_edit.setcolor;
begin
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString<>t_op_seae.FieldByName('SHIPPER').AsString then begin
CheckShipper.Checked:=true;
DBMemo1.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString<>t_op_seae.FieldByName('CONSIGNEE').AsString then begin
CheckConsignee.Checked:=true;
DBMemo4.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString<>t_op_seae.FieldByName('NOTIFYPARTY').AsString then begin
CheckNotifyParty.Checked:=true;
DBMemo5.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><>ͷ').AsString<>t_op_seae.FieldByName('MARKS').AsString then begin
Checkmark.Checked:=true;
DBMemo38.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('DESCRIPTION').AsString then begin
CheckDescription.Checked:=true;
DBMemo2.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString<>t_op_seae.FieldByName('MBLNO').AsString then begin
CheckMblno.Checked:=true;
DBEdit2.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('CONTRACTNO').AsString then begin
CheckContractNo.Checked:=true;
DBEdit1.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('VESSEL').AsString then begin
CheckVessel.Checked:=true;
DBEdit13.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('VOYNO').AsString then begin
CheckVoyno.Checked:=true;
DBEdit16.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('ETD').AsString then begin
CheckETD.Checked:=true;
DBEdit3.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('PORTLOAD').AsString then begin
CheckPortLoad.Checked:=true;
DBEdit10.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('װ<>۴<EFBFBD><DBB4><EFBFBD>').AsString<>t_op_seae.FieldByName('PORTLOADID').AsString then begin
CheckPortLoadID.Checked:=true;
DBEdit9.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('PORTDISCHARGE').AsString then begin
CheckPortDisCharge.Checked:=true;
DBEdit11.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('PORTDISCHARGEID').AsString then begin
CheckPortDisChargeID.Checked:=true;
DBEdit12.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString<>t_op_seae.FieldByName('DESTINATION').AsString then begin
CheckPortDestination.Checked:=true;
DBEdit18.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').AsString<>t_op_seae.FieldByName('DESTINATIONID').AsString then begin
CheckPortDestinationID.Checked:=true;
DBEdit19.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString<>t_op_seae.FieldByName('BLFRT').AsString then begin
CheckBLFRT.Checked:=true;
DBEdit20.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').AsString<>t_op_seae.FieldByName('PREPARDAT').AsString then begin
CheckPrepardAt.Checked:=true;
DBEdit21.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').AsString<>t_op_seae.FieldByName('PAYABLEAT').AsString then begin
CheckPayableAt.Checked:=true;
DBEdit17.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('SERVICE').AsString then begin
CheckService.Checked:=true;
DBEdit23.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').AsString<>t_op_seae.FieldByName('ISSUETYPE').AsString then begin
CheckIssuetype.Checked:=true;
DBEdit22.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('NOBILL').AsString then begin
Checknoofbl.Checked:=true;
DBEdit37.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD>ʽ').AsString<>t_op_seae.FieldByName('HSCODE').AsString then begin
Checkhscode.Checked:=true;
DBEdit36.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString<>t_op_seae.FieldByName('CARGOID').AsString then begin
Checkcargoid.Checked:=true;
wwDBComboBox15.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('PKGS').AsString then begin
Checkpkgs.Checked:=true;
DBEdit24.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><>װ').AsString<>t_op_seae.FieldByName('KINDPKGS').AsString then begin
Checkkindofpkgs.Checked:=true;
DBEdit25.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('KGS').AsString then begin
Checkkgs.Checked:=true;
DBEdit26.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('CBM').AsString then begin
Checkcbm.Checked:=true;
DBEdit27.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('TEMPSET').AsString then begin
checkTEMPSET.Checked:=true;
DBEdit30.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('REEFERF').AsString then begin
checkREEFERF.Checked:=true;
DBEdit28.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('ʪ<><CAAA>').AsString<>t_op_seae.FieldByName('HUMIDITY').AsString then begin
checkHUMIDITY.Checked:=true;
DBEdit29.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('DCLASS').AsString then begin
CheckDCLASS.Checked:=true;
DBEdit31.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('DUNNO').AsString then begin
CheckDUNNO.Checked:=true;
DBEdit32.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><>Σ').AsString<>t_op_seae.FieldByName('FUWEI').AsString then begin
CheckFUWEI.Checked:=true;
DBEdit33.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('SHANDIAN').AsString then begin
CheckSHANDIAN.Checked:=true;
DBEdit34.Font.Color:=clRed;
end;
if qry_op_seae.FieldByName('SI<53><49>ע').AsString<>t_op_seae.FieldByName('SIREMARK').AsString then begin
CheckSiRemark.Checked:=true;
DBMemo3.Font.Color:=clRed;
end;
if (defctn) then begin
CheckCtn.Checked:=true;
Label3.Font.Color:=clRed;
end;
{
if qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_seae.FieldByName('HAIYANGWURANWU').AsString then begin
CheckHAIYANGWURANWU.Checked:=true;
DBEdit35.Font.Color:=clRed;
end;
}
end;
procedure Tfrm_op_seae_web_si_edit.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
function Tfrm_op_seae_web_si_edit.defctn: Boolean;
begin
Result:=False;
if t_op_ctn.RecordCount<>qry_op_ctn.RecordCount then begin
result:=True;
Exit;
end;
t_op_ctn.First;
while not t_op_ctn.Eof do begin
if qry_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',t_op_ctn.fieldbyname('CNTRNO').AsString,[]) then begin
if (t_op_ctndetail.RecordCount<>qry_op_ctndetail.RecordCount) then Result:=False;
if (qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_ctn.FieldByName('SEALNO').AsString) then begin
result:=True;
end;
if ((qry_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString+qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)<>t_op_ctn.FieldByName('CTNALL').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_ctn.FieldByName('PKGS').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><>װ').AsString<>t_op_ctn.FieldByName('KINDPKGS').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_ctn.FieldByName('KGS').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>t_op_ctn.FieldByName('CBM').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>t_op_ctn.FieldByName('WEIGHKGS').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD>ط<EFBFBD>ʽ').AsString<>t_op_ctn.FieldByName('WEIGHTYPE').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('VGM<47><4D>ϵ<EFBFBD><CFB5>').AsString<>t_op_ctn.FieldByName('WEIGHATTN').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('VGM<47><4D>ϵ<EFBFBD><CFB5>ϵ<EFBFBD><CFB5>ʽ').AsString<>t_op_ctn.FieldByName('WEIGHTEL').AsString) then begin
result:=True;
end;
if (qry_op_ctn.FieldByName('<27><><EFBFBD>صص<D8B5>').AsString<>t_op_ctn.FieldByName('VGMADDR').AsString) then begin
result:=True;
end;
if (Result<>true) then begin
t_op_ctndetail.First;
while not t_op_ctndetail.Eof do begin
if (t_op_ctndetail.Locate('HSCODE;PKGS', VarArrayOf([qry_op_ctndetail.FieldByName('HTS').asstring, qry_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger]), [])) then begin
if (t_op_ctndetail.FieldByName('KINDPKGS').AsString<>qry_op_ctndetail.FieldByName('<27><>װ').asstring) then Result:=True;
if (t_op_ctndetail.FieldByName('DESCRIPTION').AsString<>qry_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) then Result:=True;
if (t_op_ctndetail.FieldByName('KGS').AsString<>qry_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) then Result:=True;
if (t_op_ctndetail.FieldByName('CBM').AsString<>qry_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) then Result:=True;
end else begin
Result:=true;
end;
t_op_ctndetail.Next;
end;
end;
end else begin
result:=True;
end;
t_op_ctn.Next;
end;
end;
procedure Tfrm_op_seae_web_si_edit.bsSkinButton2Click(Sender: TObject);
var
sql,mailremarks,mailto,mailtitle:String;
SMTP1:TIdSMTP;
IdMsg:TIdMessage;
begin
if not assigned(frm_sendmail_msg) then
frm_sendmail_msg:=tfrm_sendmail_msg.Create (self);
frm_sendmail_msg.Memo2.Clear;
frm_sendmail_msg.Memo4.Clear;
frm_sendmail_msg.Memo1.Clear;
frm_sendmail_msg.Memo2.Lines.Add(t_op_seae.fieldbyname('CUSTMAIL').AsString);
frm_sendmail_msg.Memo4.Lines.Add('<27><><EFBFBD>ܽص<DCBD>:|ETD:'+t_op_seae.FieldByName('ETD').AsString+'|<7C><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString+':ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>չ<EFBFBD>˾:<3A><EFBFBD>ݷ<EFBFBD>');
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>:'+t_op_seae.FieldByName('ORDERNO').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('ETD').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('CNTRTOTAL').AsString);
frm_sendmail_msg.Memo1.Lines.Add('ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
frm_sendmail_msg.Memo1.Lines.Add('');
frm_sendmail_msg.Memo1.Lines.Add('');
frm_sendmail_msg.Memo1.Lines.Add(MailSignName);
if frm_sendmail_msg.ShowModal = mrOK then
begin
mailremarks:=frm_sendmail_msg.Memo1.Text;
mailto:=frm_sendmail_msg.Memo2.Text;
mailtitle:=frm_sendmail_msg.Memo4.Text;
end;
frm_main.db.BeginTrans;
try
qry_op_seae.Edit;
if (CheckShipper.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('SHIPPER').AsString;
if (CheckConsignee.Checked) then qry_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('CONSIGNEE').AsString;
if (CheckNotifyParty.Checked) then qry_op_seae.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('NOTIFYPARTY').AsString;
if (Checkmark.Checked) then qry_op_seae.FieldByName('<27><>ͷ').AsString:=t_op_seae.FieldByName('MARKS').AsString;
if (CheckDescription.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DESCRIPTION').AsString;
if (CheckMblno.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=t_op_seae.FieldByName('MBLNO').AsString;
if (CheckContractNo.Checked) then qry_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('CONTRACTNO').AsString;
if (CheckVessel.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VESSEL').AsString;
if (CheckVoyno.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VOYNO').AsString;
if (CheckETD.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('ETD').AsString;
if (CheckPortLoad.Checked) then qry_op_seae.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOAD').AsString;
if (CheckPortLoadID.Checked) then qry_op_seae.FieldByName('װ<>۴<EFBFBD><DBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOADID').AsString;
if (CheckPortDisCharge.Checked) then qry_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGE').AsString;
if (CheckPortDisChargeID.Checked) then qry_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGEID').AsString;
if (CheckPortDestination.Checked) then qry_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATION').AsString;
if (CheckPortDestinationID.Checked) then qry_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATIONID').AsString;
if (CheckBLFRT.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('BLFRT').AsString;
if (CheckPrepardAt.Checked) then qry_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString;
if (CheckPayableAt.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PAYABLEAT').AsString;
if (CheckService.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SERVICE').AsString;
if (CheckIssuetype.Checked) then qry_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('ISSUETYPE').AsString;
if (Checknoofbl.Checked) then qry_op_seae.FieldByName('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('NOBILL').AsString;
if (Checkhscode.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('HSCODE').AsString;
if (Checkcargoid.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString:=t_op_seae.FieldByName('CARGOID').AsString;
if (Checkpkgs.Checked or Checkkindofpkgs.Checked) then begin
if (Checkpkgs.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PKGS').AsString;
if (Checkkindofpkgs.Checked) then qry_op_seae.FieldByName('<27><>װ').AsString:=t_op_seae.FieldByName('KINDPKGS').AsString;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ').AsString:=qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+qry_op_seae.FieldByName('<27><>װ').AsString;
end;
if (Checkkgs.Checked) then begin
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('KGS').AsString;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'KGS';
end;
if (Checkcbm.Checked) then begin
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('CBM').AsString;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+'CBM';
end;
if (checkTEMPSET.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('TEMPSET').AsString;
if (checkREEFERF.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('REEFERF').AsString;
if (checkHUMIDITY.Checked) then qry_op_seae.FieldByName('ʪ<><CAAA>').AsString:=t_op_seae.FieldByName('HUMIDITY').AsString;
if (CheckDCLASS.Checked) then qry_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DCLASS').AsString;
if (CheckDUNNO.Checked) then qry_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DUNNO').AsString;
if (CheckFUWEI.Checked) then qry_op_seae.FieldByName('<27><>Σ').AsString:=t_op_seae.FieldByName('FUWEI').AsString;
if (CheckSHANDIAN.Checked) then qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SHANDIAN').AsString;
if (CheckSiRemark.Checked) then qry_op_seae.FieldByName('SI<53><49>ע').AsString:=t_op_seae.FieldByName('SIREMARK').AsString;
if (CheckCtn.Checked) then begin
savectndetail;
end;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString:=t_op_seae.FieldByName('SHIPPERTEL').AsString;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString:=t_op_seae.FieldByName('SHIPPERCOUNTRY').AsString;
qry_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString:=t_op_seae.FieldByName('CONSIGNEETEL').AsString;
qry_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString:=t_op_seae.FieldByName('CONSIGNEERCOUNTRY').AsString;
qry_op_seae.FieldByName('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString:=t_op_seae.FieldByName('NOTIFYPARTYTEL').AsString;
qry_op_seae.FieldByName('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString:=t_op_seae.FieldByName('NOTIFYPARTYCOUNTRY').AsString;
qry_op_seae.Post;
t_op_seae.Edit;
t_op_seae.fieldbyname('BSSTATUS').AsString:='Confirm';
t_op_seae.Post;
OP_STATUS_LOG.Close;
OP_STATUS_LOG.SQL.Text:='INSERT INTO OP_STATUS_LOG (GID,RELATIVE_ID,STATUS,OP_TIME,OP_USER)VALUES (NEWID(),'''+t_op_seae.Fieldbyname('SINO').AsString+''',''ConfirmConfirm'',GETDATE(),'''+employee+''')';
OP_STATUS_LOG.ExecSQL;
OP_STATUS_LOG.Close;
OP_STATUS_LOG.SQL.Text:='UPDATE OP_SEAE_ORDER SET SISTATUS=''Confirm'' WHERE ORDNO='''+t_op_seae.fieldbyname('ORDNO').AsString+'''';
OP_STATUS_LOG.ExecSQL;
m_qryTask.Edit;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27>ѽ<EFBFBD><D1BD><EFBFBD>';
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
m_qryTask.Post;
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27>ѽ<EFBFBD><D1BD><EFBFBD>',employee] );
m_qryTask.Connection.Execute(sql);
m_qryTask.Requery();
frm_main.db.CommitTrans;
finally
if frm_main.db.InTransaction then
begin
frm_main.db.RollbackTrans;
end;
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
close;
end;
if (Trim(mailto)<>'') then begin
SMTP1:=TIdSMTP.Create(nil);
IdMsg:=TIdMessage.Create(nil);
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:=MailAddress;
SMTP1.Password :=MailPw;
// SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Host :='mail.sdsmartlogistics.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
SMTP1.Connect;
end;
with IdMsg do
begin
Body.Text:=mailremarks;
From.address :=MailAddress;
Recipients.EMailAddresses :=mailto;
Subject:=mailtitle;
CharSet:='GB2312';
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
Insert_mail_Log(qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͻص<CFBD>',mailto,mailtitle,mailremarks,'');
end;
end;
procedure Tfrm_op_seae_web_si_edit.savectndetail;
var
aQuery:TADOQuery;
bok:Tbookmark;
if_first:boolean;
pkgs:integer;
kgs,cbm:double;
s,package:string;
begin
aQuery:=CreateAdoQuery;
try
qry_op_ctndetail.Close;
qry_op_ctn.Close;
With aQuery do begin
close;sql.Clear;
SQL.Text:='delete from t_op_ctn_detail where ctn_id IN (SELECT ctn_id FROM t_op_ctn WHERE <20><><EFBFBD><EFBFBD>='''+qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+''')';
ExecSQL;
close;sql.Clear;
SQL.Text:='delete FROM t_op_ctn WHERE <20><><EFBFBD><EFBFBD>='''+qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString+''' ';
ExecSQL;
end;
qry_op_ctn.Open;
qry_op_ctndetail.Open;
t_op_ctn.First;
while not t_op_ctn.Eof do begin
qry_op_ctn.Insert;
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CTNNUM'];
if frm_data_share.t_code_ctn.Locate('MSC<53><43><EFBFBD><EFBFBD>',t_op_ctn['CTNALL'],[]) then
begin
qry_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
qry_op_ctn['<27>ߴ<EFBFBD>']:=frm_data_share.t_code_ctn['<27>ߴ<EFBFBD>'];
if frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
qry_op_ctn['TEU']:=1*qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
if (frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
(frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
qry_op_ctn['TEU']:=2*qry_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
end
else
begin
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:='';
qry_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:='';
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:='';
qry_op_ctn['<27>ߴ<EFBFBD>']:='';
qry_op_ctn['TEU']:=0;
end;
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['PKGS'];
qry_op_ctn['<27><>װ']:=t_op_ctn.FieldByName('KINDPKGS').AsString;
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['KGS'];
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CBM'];
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CNTRNO'];
qry_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['SEALNO'];
qry_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctn['WEIGHKGS'];
qry_op_ctn['<27><><EFBFBD>ط<EFBFBD>ʽ']:=t_op_ctn['WEIGHTYPE'];
qry_op_ctn['VGM<47><4D>ϵ<EFBFBD><CFB5>']:=t_op_ctn['WEIGHATTN'];
qry_op_ctn['VGM<47><4D>ϵ<EFBFBD><CFB5>ϵ<EFBFBD><CFB5>ʽ']:=t_op_ctn['WEIGHTEL'];
qry_op_ctn['<27><><EFBFBD>صص<D8B5>']:=t_op_ctn['VGMADDR'];
qry_op_ctn.Post;
t_op_ctndetail.First;
while not t_op_ctndetail.Eof do begin
qry_op_ctndetail.Insert;
qry_op_ctndetail['HTS']:=t_op_ctndetail['HSCODE'];
qry_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctndetail['PKGS'];
qry_op_ctndetail['<27><>װ']:=t_op_ctndetail['KINDPKGS'];
qry_op_ctndetail['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctndetail['DESCRIPTION'];
qry_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctndetail['KGS'];
qry_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctndetail['CBM'];
qry_op_ctndetail.Post;
t_op_ctndetail.Next;
end;
t_op_ctn.Next;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_web_si_edit.getkingpkgs(
kindpkgscode: string): string;
var
aQuery:TADOQuery;
begin
if (kindpkgscode='') then begin
result:='';
exit;
end;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> from t_code_package where EDI<44><49><EFBFBD><EFBFBD>='''+kindpkgscode+'''');
Open;
if IsEmpty then
Result:='a'
else
Result:=FieldByName('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_op_seae_web_si_edit.bsSkinButton1Click(Sender: TObject);
var
sql:string;
mailremarks,mailto,mailtitle:String;
SMTP1:TIdSMTP;
IdMsg:TIdMessage;
begin
if( Application.MessageBox(PChar('<27><>ȷʵҪֱ<D2AA>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӹر<D3B9><D8B1><EFBFBD><EFBFBD><EFBFBD>!,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
Exit;
try
if not assigned(frm_sendmail_msg) then
frm_sendmail_msg:=tfrm_sendmail_msg.Create (self);
frm_sendmail_msg.Memo2.Clear;
frm_sendmail_msg.Memo4.Clear;
frm_sendmail_msg.Memo1.Clear;
frm_sendmail_msg.Memo2.Lines.Add(DBEdit3.Text);
frm_sendmail_msg.Memo4.Lines.Add('<27><><EFBFBD>ؽص<D8BD>:|ETD:'+t_op_seae.FieldByName('ETD').AsString+'|<7C><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString+':ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>չ<EFBFBD>˾:<3A><EFBFBD>ݷ<EFBFBD>');
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>:'+t_op_seae.FieldByName('ORDERNO').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('ETD').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD>˾:'+t_op_seae.FieldByName('CARRIER').AsString);
frm_sendmail_msg.Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('CNTRTOTAL').AsString);
frm_sendmail_msg.Memo1.Lines.Add('ж<><D0B6><EFBFBD><EFBFBD>:'+t_op_seae.FieldByName('PORTDISCHARGE').AsString);
frm_sendmail_msg.Memo1.Lines.Add('');
frm_sendmail_msg.Memo1.Lines.Add('');
frm_sendmail_msg.Memo1.Lines.Add(MailSignName);
if frm_sendmail_msg.ShowModal = mrOK then
begin
mailremarks:=frm_sendmail_msg.Memo1.Text;
mailto:=frm_sendmail_msg.Memo2.Text;
mailtitle:=frm_sendmail_msg.Memo4.Text;
end;
//** m_qryTask.Connection.BeginTrans;
m_qryTask.Edit;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
m_qryTask.Post;
//
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
m_qryTask.Connection.Execute(sql);
//** m_qryTask.Connection.CommitTrans;
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
close();
except
on e:Exception do
begin
// on except
//* m_qryTask.Connection.RollbackTrans;
m_qryTask.Cancel();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
end;
if (Trim(mailto)<>'') then begin
SMTP1:=TIdSMTP.Create(nil);
IdMsg:=TIdMessage.Create(nil);
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:=MailAddress;
SMTP1.Password :=MailPw;
// SMTP1.Host :='smtpcom.263xmail.com';
SMTP1.Host :='mail.sdsmartlogistics.com';
SMTP1.Port :=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
SMTP1.Connect;
end;
with IdMsg do
begin
Body.Text:=mailremarks;
From.address :=MailAddress;
Recipients.EMailAddresses :=mailto;
Subject:=mailtitle;
CharSet:='GB2312';
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
Insert_mail_Log('','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͻص<CFBD>',mailto,mailtitle,mailremarks,'');
end;
end;
end.