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.

1312 lines
41 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_TaskContrast;
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;
type
TfrmOpSeae_TaskContrast = 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;
lbl46: TLabel;
lbl47: TLabel;
lbl48: TLabel;
dbtxt1: TDBText;
btn5: TbsSkinSpeedButton;
lbl50: TLabel;
bsknpnl1: TbsSkinPanel;
lbldc: TLabel;
dbedt3: TDBEdit;
dbedt4: TDBEdit;
dbedt5: TDBEdit;
dbedt6: TDBEdit;
dbedt7: TDBEdit;
dbedt8: TDBEdit;
RxDBLookupCombo1: TRxDBLookupCombo;
dbedt9: TDBEdit;
dbedt10: 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;
cxspltr1: TcxSplitter;
pnl4_jjx: TPanel;
bsknpnl2: TbsSkinPanel;
wdblkpcmb1: TwwDBLookupCombo;
dbgrdh1: TDBGridEh;
bsknpnl3: TbsSkinPanel;
lbl52: TLabel;
dbtxtTEU: TDBText;
lbl53: TLabel;
dbtxt2: TDBText;
dbtxt3: TDBText;
lbl54: TLabel;
dbtxt4: TDBText;
lbl55: TLabel;
lbl56: TLabel;
dbtxt5: TDBText;
bsknpnl5: TbsSkinPanel;
lbl58: TLabel;
dbtxtTEU1: TDBText;
lbl59: TLabel;
dbtxt6: TDBText;
dbtxt7: TDBText;
lbl60: TLabel;
dbtxt8: TDBText;
lbl61: TLabel;
lbl62: TLabel;
dbtxt9: 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;
pm1_tsk_vcMenu: TPopupMenu;
mni_mniN1Confirm: TMenuItem;
mni_mniN2ConfirmAndFinish: TMenuItem;
il1: TImageList;
tlb1: TToolBar;
btn1Forword: TToolButton;
btn2Confirm: TToolButton;
btnCancelTask: TToolButton;
btn12: TToolButton;
spl1: TSplitter;
wwDBGrid1: TwwDBGrid;
lbl57: TLabel;
il2_taskmenu: TImageList;
wwDBGrid: TwwDBGrid;
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;
iwbpdfdtr1: TiWebPDFEditor;
bsknpnl2_right: TbsSkinPanel;
scrlbx1: TScrollBox;
bsknpnl6_left: TbsSkinPanel;
cxspltr2: TcxSplitter;
btn1_RefreshPDF: TButton;
btn1pdfDownload: TSpeedButton;
spl2: TSplitter;
pnl2_td: TPanel;
pnl2_ch_fee_edi: TPanel;
qry1_op_seae_edi_mail_bcinfo: TADOQuery;
qry2_op_seae_edi_rp_iftmbc: TADOQuery;
ds1_op_seae_edi_mail_bcinfo: TDataSource;
ds2_op_seae_edi_rp_iftmbc: TDataSource;
pnl2_rptBC: TPanel;
lbl66: TLabel;
dbedtF_TSR_TSR: TDBEdit;
lbl67: TLabel;
dbedtF_DC0_LOC_ZAddrCode: TDBEdit;
lbl68: TLabel;
dbedtA: TDBEdit;
lbl69: TLabel;
lbl70: TLabel;
dbedtF_JGSHJ1: TDBEdit;
dbedtF_JDSHJ1: TDBEdit;
dbedtF_JGSHJ2: TDBEdit;
dbedtF_JDSHJ2: TDBEdit;
lbl72: TLabel;
lbl71: TLabel;
dbmmoF_WP_EQN_Num: TDBMemo;
lbl73: TLabel;
lbl74: TLabel;
dbedtF_DC0_LOC_XAddrCode: TDBEdit;
lbl75: TLabel;
dbedtF_DC0_LOC_XAddrCode1: TDBEdit;
lbl76: TLabel;
dbedtF_DC0_LOC_XAddrCode2: TDBEdit;
pnl2_BC: TPanel;
lbl49: TLabel;
lbl51: TLabel;
lbl63: TLabel;
lbl64: TLabel;
lbl65: TLabel;
lbl77: TLabel;
lbl78: TLabel;
dbedtF_HX: TDBEdit;
dbedtF_JGSHJ: TDBEdit;
dbedtF_JDSHJ: TDBEdit;
dbedtF_YZH: TDBEdit;
dbmmoF_EXT_IsMatchBusiRemark: TDBMemo;
dbedtF_CM: TDBEdit;
dbedtF_HC: TDBEdit;
lbl79: TLabel;
dbmmo10: TDBMemo;
btn1_ImportAssistInfo: TButton;
lbl80: TLabel;
dbedtF_ETD: TDBEdit;
lbl81: TLabel;
dbedtF_HYH: TDBEdit;
lbl82: TLabel;
lbl83: TLabel;
dbedt37: TDBEdit;
mmo1_extMatch: TMemo;
Label1: TLabel;
DBEdit1: TDBEdit;
ToolButton1: TToolButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure btnCoseClick(Sender: TObject);
procedure btnCancelTaskClick(Sender: TObject);
procedure mniN1ConfirmClick(Sender: TObject);
procedure mni_mniN2ConfirmAndFinishClick(Sender: TObject);
procedure btn1ForwordClick(Sender: TObject);
procedure btn1_RefreshPDFClick(Sender: TObject);
procedure btn1pdfDownloadClick(Sender: TObject);
procedure cxspltr2Moved(Sender: TObject);
procedure cxspltr2BeforeClose(Sender: TObject;
var AllowClose: Boolean);
procedure cxspltr2BeforeOpen(Sender: TObject; var AllowOpen: Boolean);
procedure btn1_ImportAssistInfoClick(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
{ Private declarations }
m_pdfFileName:string;
m_bsno:string;
m_qryTask:TADOQuery;
procedure InitialBusiData();
procedure openpdfFile();
function sendmail( mailSendTbl: TkbmMemTable;mailtype,bsno:string;ishtml:Boolean):Boolean;
procedure InitialTDWindow();
procedure InitialCh_fee_edi_Window();
public
{ Public declarations }
public procedure InitialData( qryTask:TADOQuery; bsno1:string;pdfpath:string);
end;
var
frmOpSeae_TaskContrast: TfrmOpSeae_TaskContrast;
implementation
{$R *.dfm}
uses my_sys_function,u_main, u_tree_main, u_data_share, u_sys_progress,
u_op_seae_TaskContrast_TD, u_ch_fee_edi, u_op_letter;
/// <summary>
/// <20><>ʱĿ¼
/// </summary>
function GetWinTempPath: string;
var
TempDir: array[0..255] of char;
begin
GetTempPath(255, @TempDir);
Result := strPas(TempDir);
end;
procedure TfrmOpSeae_TaskContrast.InitialData( qryTask:TADOQuery; bsno1:string ;pdfpath:string);
var
state,tasktype,strtmp:string;
strsql:string;
begin
m_qryTask:=qryTask;
m_bsno:=bsno1;
m_pdfFileName:=pdfpath;
tasktype:= m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
qry1_op_seae_edi_mail_bcinfo.Active:=False;
qry2_op_seae_edi_rp_iftmbc.Active:=false;
pnl2_BC.Visible:=false;
pnl2_rptBC.Visible:=False;
if(tasktype='HAHYedi') or ( tasktype='<27>ᵥȷ<E1B5A5><C8B7>' ) then
begin
//iwbpdfdtr1.visible:=false;
cxspltr2.Visible:=False;
bsknpnl2_right.Visible:=False;
pnl2_td.Align:= alClient;
pnl2_td.Visible:=True;
pnl2_ch_fee_edi.Visible:=False;
btn1_RefreshPDF.Visible:=False;
InitialTDWindow();
end
else
begin
pnl2_td.Visible:=false;
//
if(tasktype='Invoice') or ( tasktype='INVOIC' ) then
begin
cxspltr2.Visible:=False;
bsknpnl2_right.Visible:=False;
pnl2_ch_fee_edi.Align:= alClient;
pnl2_ch_fee_edi.Visible:=True;
btn1_RefreshPDF.Visible:=False;
InitialCh_fee_edi_Window();
end
else
begin
btn1_RefreshPDF.Visible:=true;
pnl2_ch_fee_edi.Visible:=false;
//iwbpdfdtr1.visible:=true;
//bsknpnl2_right.Align:= alClient;
bsknpnl2_right.Visible:=true;
cxspltr2.visible:=true;
if(tasktype='BC') or (tasktype='BA') then
begin
pnl2_BC.Visible:=True;
dbedtF_HYH.Color:=dbedt37.Color;//Ĭ<><C4AC>
strsql:='SELECT TOP 1 F_CM ,F_HC,F_HX,F_YZH,F_JGSHJ,F_JDSHJ,F_SeaNo,F_ETD,F_HYH,F_Remark from t_op_seae_edi_mail_bcinfo where '
+' F_Base_MailID =''' + m_qryTask.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString +''';';
qry1_op_seae_edi_mail_bcinfo.SQL.Text:=strsql;
qry1_op_seae_edi_mail_bcinfo.Active:=True;
strtmp:= m_qryTask.fieldbyname('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>').AsString;
if(strtmp<>'') then
begin
strsql:= 'select * from t_op_seae_edi_rp_iftmbc where '
+' F_Base_ReportID =''' +strtmp +''';';
qry2_op_seae_edi_rp_iftmbc.sql.Text:=strsql;
qry2_op_seae_edi_rp_iftmbc.Active:=true;
end;
cxspltr1.Visible:= False;
pnl4_jjx.Visible:= False;
if(cxspltr2.State=ssClosed) then //ssOpened, ssClosed
pnl2_rptBC.Visible:=True;
end
else
begin
pnl2_BC.Visible:=False;
end;
end;
if(pnl2_BC.Visible=False) and (tasktype<>'BCL') then
begin
pnl4_jjx.Visible:= True;
cxspltr1.Visible:= True;
end;
//
end;
//
state:=m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').AsString;
//״̬<D7B4><CCAC><EFBFBD><EFBFBD>
btnCancelTask.Enabled:=False;
btn2Confirm.Enabled:=False;
btn1Forword.Enabled:=False;
mni_mniN1Confirm.Visible:=false;
mni_mniN2ConfirmAndFinish.Visible:=False;
if(m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger<1) then
begin
btnCancelTask.Enabled:=true;
mni_mniN2ConfirmAndFinish.Visible:=true;
if tasktype='VC' then
begin
btn2Confirm.Enabled:=True;
mni_mniN1Confirm.Visible:=false;
//btn1Forword.Enabled:=True;
end
else
begin
btn2Confirm.Enabled:=True;
if(state<>'PENDING') then
mni_mniN1Confirm.Visible:=True;
//btn1Forword.Enabled:=True;
end;
end ;
if (tasktype='VC') or (tasktype='SEAWAY') or (tasktype='BC') or (tasktype='BA') then
begin
btn1Forword.Enabled:=True;
end ;
end;
procedure TfrmOpSeae_TaskContrast.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_bsno + '''');
qry_op_seae.open;
qry_op_ctn.Active:=False;
qry_op_ctn.Active:=True;
qry_op_ctndetail.Active:=false;
qry_op_ctndetail.Active:=True;
if( pnl2_td.Visible) then
begin
frmOp_seae_Taskcontrast_TD.BindData(Self.m_qryTask,qry_op_seae,qry_op_ctn);
end
else if(pnl2_ch_fee_edi.Visible) then
begin
frmCh_fee_edi.BindData(Self.m_qryTask,True);
end;
if( pnl2_BC.Visible) then
begin
//<2F><>Լ<EFBFBD><D4BC>--<2D>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
//dbedtF_HYH
// dbedt37
mmo1_extMatch.text:='';
if Trim(qry1_op_seae_edi_mail_bcinfo.FieldByName('F_Remark').AsString )<>'' then
begin
strtmp1:=Trim(qry1_op_seae_edi_mail_bcinfo.FieldByName('F_Remark').AsString );
mmo1_extMatch.Text:=strtmp1;
end;
if(dbedtF_HYH.Text<>'') and (dbedt37.Text<>'') and (dbedtF_HYH.Text<>dbedt37.Text) then
begin
dbedtF_HYH.Color:=clRed;
strtmp:=Format('Լ<><D4BC>(<28><>ͬ<EFBFBD><CDAC>)<29><>ҵ<EFBFBD><D2B5>ϵͳ<CFB5>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ų<EFBFBD>һ<EFBFBD><D2BB>:%s~%s',[dbedtF_HYH.Text,dbedt37.Text]);
if(dbmmoF_EXT_IsMatchBusiRemark.Text<>'') then
begin
if( dbmmoF_EXT_IsMatchBusiRemark.Text ='ƥ<><C6A5>BC<42><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣') then
begin
if Trim(strtmp1)='' then mmo1_extMatch.Text:=strtmp else
mmo1_extMatch.Lines.Append(strtmp);
end
else
if Trim(strtmp1)='' then mmo1_extMatch.Text:=strtmp else
mmo1_extMatch.Lines.Append(strtmp);
mmo1_extMatch.Lines.Append(dbmmoF_EXT_IsMatchBusiRemark.Text);
end
else
begin
if Trim(strtmp1)='' then mmo1_extMatch.Text:=strtmp else
mmo1_extMatch.Lines.Append(strtmp);
mmo1_extMatch.Lines.Append('<27><>ʱû<CAB1><C3BB>BC<42><43><EFBFBD>ĶԱȽ<D4B1><C8BD><EFBFBD>!');
end;
end
else if (dbmmoF_EXT_IsMatchBusiRemark.Text='') then
mmo1_extMatch.Lines.Append('<27><>ʱû<CAB1><C3BB>BC<42><43><EFBFBD>ĶԱȽ<D4B1><C8BD><EFBFBD>!')
else
mmo1_extMatch.Lines.Append(dbmmoF_EXT_IsMatchBusiRemark.Text);
end;
end;
/// <summary>
///
/// </summary>
procedure TfrmOpSeae_TaskContrast.openpdfFile();
var
filename,naspath,info:string;
begin
if(LowerCase(ExtractFileExt(m_pdfFileName))<>'.pdf' ) then
Exit;
//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ֱ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
if(FileExists(m_pdfFileName) ) then
begin
btn1pdfDownload.Visible:=true;
filename:= GetWinTempPath()+ '_cp'+FormatDateTime('MMDDhhmmss',Now)+'.pdf'; //
if(FileExists(filename)) then
DeleteFile(filename);
CopyFile(pChar(m_pdfFileName),pChar(filename),false);
//<2F>ȴ<EFBFBD>1<EFBFBD><31>
Sleep(1000);
info:='<27><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD>ļ<EFBFBD>,<2C>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>:<3A><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD>Nass<73><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޺ͱ<DEBA><CDB1><EFBFBD><EFBFBD><EFBFBD>ʱĿ¼<C4BF><C2BC>д<EFBFBD><D0B4>Ȩ<EFBFBD><C8A8>\n<><6E><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!'
+'\n<><6E><EFBFBD><EFBFBD>pdf<64>ļ<EFBFBD><C4BC><EFBFBD>ʽ<EFBFBD><CABD>ǰ<EFBFBD><C7B0>ʾ<EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD>֧<EFBFBD><D6A7>,<2C><><EFBFBD>Գ<EFBFBD><D4B3><EFBFBD>ͨ<EFBFBD><CDA8>"<22><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>"<22><>ť<EFBFBD><C5A5><EFBFBD>غ<EFBFBD>ʹ<EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!';
if(FileExists(filename)) then
begin
try
iwbpdfdtr1.LoadFromFile(filename);
except
on ex:Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><CAA7>:'+ex.Message
+'\n<><6E><EFBFBD>Գ<EFBFBD><D4B3><EFBFBD>ͨ<EFBFBD><CDA8>"<22><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>"<22><>ť<EFBFBD><C5A5><EFBFBD>غ<EFBFBD>ʹ<EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
end;
end;
end
else
begin
ShowMessage(info);
end;
//iwbpdfdtr1.LoadFromFile(m_pdfFileName)
end
else if(m_pdfFileName<>'')then
ShowMessage('Ҫ<><D2AA><EFBFBD>ص<EFBFBD><D8B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure TfrmOpSeae_TaskContrast.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
try
if(iwbpdfdtr1.currentpage>0) then
iwbpdfdtr1.CloseRead;
except
;
end;
//<2F>ӳٰ<D3B3><D9B0><EFBFBD>
Sleep(500);
//iwbpdfdtr1.FreeInstance;
//iwbpdfdtr1:=nil;
end;
procedure TfrmOpSeae_TaskContrast.FormShow(Sender: TObject);
begin
InitialBusiData();
self.iwbpdfdtr1.TitleBarVisible:= False;
//self.iwbpdfdtr1.ToolbarVisible:=False;
iwbpdfdtr1.CloseButtonVisible:=False;
iwbpdfdtr1.SidebarVisible:=False;
iwbpdfdtr1.SignToolbarVisible:=False;
//
iwbpdfdtr1.CloseButtonVisible:=False;
iwbpdfdtr1.SidebarVisible:=False;
iwbpdfdtr1.SignToolbarVisible:=False;
iwbpdfdtr1.OpenButtonVisible:=False;
iwbpdfdtr1.SaveButtonVisible:=false;
iwbpdfdtr1.FullScreenButtonVisible:=false;
iwbpdfdtr1.PrintButtonVisible:=false;
iwbpdfdtr1.PrintSetButtonVisible:=False;
iwbpdfdtr1.SidebarVisible:=false;
btn1pdfDownload.Visible:=False;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>λ<EFBFBD><CEBB>,<2C><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA>ټ<EFBFBD><D9BC><EFBFBD>pdf<64>ļ<EFBFBD>
openpdfFile();
end;
procedure TfrmOpSeae_TaskContrast.btnCoseClick(Sender: TObject);
begin
close();
end;
procedure TfrmOpSeae_TaskContrast.btnCancelTaskClick(Sender: TObject);
var
sql:string;
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.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.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;
end;
/// <summary>
///
/// </summary>
procedure TfrmOpSeae_TaskContrast.mniN1ConfirmClick(Sender: TObject);
var
sql:string;
optype:string;
begin
//ȷ<><C8B7> ORIGINAL FTP
//if(m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='ORIGINAL') and (m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ').AsString='FTP' ) then
begin
//
optype:='PENDING';
try
//** 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:=optype;
m_qryTask.FieldByName('<27><><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,optype,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;
end;
end;
/// <summary>
/// ȷ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
procedure TfrmOpSeae_TaskContrast.mni_mniN2ConfirmAndFinishClick(
Sender: TObject);
var
sql,strtmp:string;
mainno,bsno,filename,filetype:string;
optype:string;
isok:Boolean;
remark:string;
begin
//ȷ<><C8B7> ORIGINAL FTP
//if(m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='ORIGINAL') and (m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ').AsString='FTP' ) then
//
mainno:=m_qryTask.fieldbyname('<27><EFBFBD><E1B5A5>').AsString;
bsno:=m_qryTask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').AsString;
strtmp:=m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
filename:=m_qryTask.fieldbyname('<27><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>·<EFBFBD><C2B7>').AsString;
remark:=m_qryTask.fieldbyname('<27><>ע').AsString;
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD>
if strtmp ='ORIGINAL' then
begin
if( frm_tree_main.checkGuadanTimes(remark)=False) then
begin
if( Application.MessageBox(PChar('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>һ<EFBFBD>ιҵ<CEB9>,<2C><>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
Exit;
end;
end;
optype:='<27><><EFBFBD><EFBFBD>';
isok:=true;
try
if strtmp ='<27>ᵥȷ<E1B5A5><C8B7>' then
begin
if(qry_op_seae.Recordset.RecordCount>0) then
if( Application.MessageBox(PChar('<27>Ƿ<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'ѡ<><D1A1>[<5B><><>й<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>,<2C><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD>.'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)=IDYES) then
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
isok:= frmOp_seae_Taskcontrast_TD.DoImportData();
close;
Exit;
end;
end;
if strtmp ='ORIGINAL' then
begin
filetype:='<27><><EFBFBD><EFBFBD>˾<EFBFBD>ҵ<EFBFBD>';
isok:= frm_tree_main.Guadan(mainNo,bsno, filetype,filename);
end
else if( strtmp='BC') OR (strtmp='BA') then
begin
filetype:='<27><><EFBFBD><EFBFBD>֪ͨ';
isok:= frm_tree_main.Guadan(mainNo,bsno, filetype,filename);
end
else if strtmp ='VC' then
begin
filetype:='VC<56>ҵ<EFBFBD>';
end
else if strtmp ='INVOIC' then
begin
//
if(frmCh_fee_edi.DoImportData()) then
begin
close();
Exit;
end;
end;
//<2F>ҵ<EFBFBD>
if (isok=true) then
begin
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:=optype;
m_qryTask.FieldByName('<27><><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,optype,employee] );
m_qryTask.Connection.Execute(sql);
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
close();
end ;
except
on e:Exception do
begin
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
end;
//
end;
procedure TfrmOpSeae_TaskContrast.btn1ForwordClick(Sender: TObject);
var
strsql, str,wtdw,strsjr,tasktype,YJ_FILEID,FNType,strtmp:string;
mainno,bsno:string;//<2F><><EFBFBD><EFBFBD><E1B5A5>,<2C><><EFBFBD><EFBFBD>
aQuery,qryMail:TADOQuery;
ishtml:Boolean;
errorinfo:string;
isok:Boolean;
filename:string;
wtbh:string;//ί<>б<EFBFBD><D0B1><EFBFBD>/PO ,ί<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>BC/BAת<41><D7AA>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ǿղ<C7BF><D5B2>Ҳ<EFBFBD><D2B2><EFBFBD>TSE<53><45>ͷ<EFBFBD><CDB7>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>___ί<5F>б<EFBFBD><D0B1><EFBFBD>
begin
//
isok:=True;
errorinfo:='';
tasktype:= m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FNType:='VC_SEAWAY_<59><EFBFBD><E1B5A5><EFBFBD><EFBFBD>';
if( (tasktype='BC') or (tasktype='BA') ) then
FNType:='<27><><EFBFBD><EFBFBD>֪ͨ';
ishtml:=False;
if(qry_op_seae.Recordset.RecordCount<1) then
begin
Application.MessageBox('û<><C3BB>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>޷<EFBFBD>ת<EFBFBD><D7AA>!','<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_OK+MB_ICONINFORMATION) ;
Exit;
end;
wtdw:=qry_op_seae.FieldByName('ί<>е<EFBFBD>λ').AsString;
if( (wtdw)='') then
begin
Application.MessageBox('ί<>е<EFBFBD>λΪ<CEBB><CEAA>,<2C>޷<EFBFBD>ת<EFBFBD><D7AA>!','<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_OK+MB_ICONINFORMATION) ;
Exit;
end;
mainno:=m_qryTask.fieldbyname('<27><EFBFBD><E1B5A5>').AsString;
bsno:= qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
filename:=m_qryTask.fieldbyname('<27><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>·<EFBFBD><C2B7>').AsString;
strtmp:= qry_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString;
if((strtmp='') or (Pos('TSE',UpperCase(strtmp))=1)) then
wtbh:=''
else
wtbh:='___'+strtmp;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--->BC/BA:<3A><><EFBFBD><EFBFBD>֪ͨ
// VC/Seaway:VC_SEAWAY_<59><EFBFBD><E1B5A5><EFBFBD><EFBFBD>
// d.<2E>ռ<EFBFBD><D5BC><EFBFBD>
str:=' select d.*,c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> from t_code_cust_mailproject_detail d left join t_code_cust_mailproject c '
+' on (c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=d.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''' + FNType + ''' and c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+wtdw+''' and '
+' d.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in '
+'( SELECT distinct <20>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD> from t_op_seae where ί<>е<EFBFBD>λ='''+wtdw+''' and isnull(<28>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>,'''')<>'''' '
+'and <20><><EFBFBD><EFBFBD>='''+ bsno +''' )';
aQuery:=CreateAdoQuery();
with aQuery do
begin
close;sql.Clear;
SQL.Add(str);
Open;
strsjr:='';
if IsEmpty then
begin
Application.MessageBox(pchar('ί<>е<EFBFBD>λ[' + FNType +']<5D>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ջ<EFBFBD><D5BB>߸<EFBFBD>ƱƱҵ<C6B1><D2B5>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>,<2C>޷<EFBFBD>ת<EFBFBD><D7AA>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_OK+MB_ICONINFORMATION) ;
Close;
exit;
end ;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>
First;
while not eof do
begin
//
if strsjr='' then
strsjr := fieldbyname('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString
else
strsjr := strsjr +',' +fieldbyname('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString;
Next;
end;
if(pos('@',strsjr)<1) then
begin
Application.MessageBox('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ȷ,<2C><>ȷ<EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD>ת<EFBFBD><D7AA>!','<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_OK+MB_ICONINFORMATION) ;
Close;
Exit;
end;
First;
end ;
//
mailSend.EmptyTable;
mailSend.Open;
mailSend.Insert;
mailSend.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString:= strsjr;//fieldbyname('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString;
mailSend.FieldByName('<27>ʼ<EFBFBD>ǩ<EFBFBD><C7A9>').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('<27>ʼ<EFBFBD>ǩ<EFBFBD><C7A9>').AsString;
//Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mailsend.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString:= tasktype+':'+ mainno;
if (tasktype='BC') or (tasktype='BA') or (tasktype='VC') OR ( (UpperCase(tasktype)='SEAWAY') and (m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ').AsString='<27>ʼ<EFBFBD>') ) then
begin
YJ_FILEID:=m_qryTask.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
qryMail:=CreateAdoQuery();
ishtml:=True;
qryMail.Close;
qryMail.SQL.Clear;
qryMail.SQL.Add('SELECT [<5B>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>],[<5B>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>] FROM [t_op_seae_edi_mail] where [<5B>ʼ<EFBFBD>ID]='''+YJ_FILEID+''';') ;
qryMail.Open;
if(not qryMail.Eof) then
begin
//
str:='ת<><D7AA>:'+qryMail.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
if(FNType='<27><><EFBFBD><EFBFBD>֪ͨ') then //BC/BA<42><41><EFBFBD><EFBFBD>ί<EFBFBD>б<EFBFBD><D0B1>Ų<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ҳ<EFBFBD>Ϊ[TSE]<5D><>ͷ<EFBFBD><CDB7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>+[___ί<5F>б<EFBFBD><D0B1><EFBFBD>]
str:= str +wtbh;
mailsend.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString :=str;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=filename ;
str:=qryMail.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString:=str;
//<2F>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD>ͼ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD>пհ<D0BF><D5B0>ʼ<EFBFBD>!!!!
if( qryMail.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString ='') and (filename='') then
begin
qryMail.Close();
ShowMessage('δ<>ܻ<EFBFBD><DCBB><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><><D7AA>ʧ<EFBFBD><CAA7>');
Exit;
end;
end;
end
else if(tasktype='SEAWAY') then
begin
//YJ_FILEID:=m_qryTask.fieldbyname('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>').AsString;
str:='SEAWAY BILL:'+mainno ;// fieldbyname('<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>').AsString +FormatDateTime('YYYYMMDDHHMMSS',now) ;
//str:=StringReplace(str,'[<5B>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>]',qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString ,[]);
mailsend.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString :=str;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=filename ;
if aQuery.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').IsNull then
str:=' '
else
str:=aQuery.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString:=str;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=bsno;//t_op_letter.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=mainno ;//t_op_letter.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
end;
mailSend.Post;
try
//** m_qryTask.Connection.BeginTrans;
isok:= sendmail(mailSend,FNType,bsno,ishtml) ;
if(isok) then
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BC/BA<42><41><EFBFBD>ҵ<EFBFBD>
if(m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger=0) and ( (tasktype='BC') or (tasktype='BA') ) then
begin
//<2F>ҵ<EFBFBD> filetype:='<27><><EFBFBD><EFBFBD>֪ͨ';
isok:= frm_tree_main.Guadan(mainNo,bsno,'<27><><EFBFBD><EFBFBD>֪ͨ',filename);
if(isok) then
begin
strsql:='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'')';
strsql:=Format(strsql,[bsno, tasktype+ '<27>ҵ<EFBFBD>',employee] );
m_qryTask.Connection.Execute(strsql);
end
else
ShowMessage('<27>ʼ<EFBFBD><CABC><EFBFBD>ת<EFBFBD><D7AA>;<3B><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ҵ<EFBFBD>ʧ<EFBFBD><CAA7>!');
end;
//<2F><><EFBFBD><EFBFBD>״̬
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><D7AA>';
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
m_qryTask.Post;
//
strsql:='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'')';
strsql:=Format(strsql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><>ת<EFBFBD><D7AA>',employee] );
m_qryTask.Connection.Execute(strsql);
//** m_qryTask.Connection.CommitTrans;
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
aQuery.Close();
close();
end
else
Application.MessageBox(PChar('<27>ʼ<EFBFBD>ת<EFBFBD><D7AA>ʧ<EFBFBD><CAA7>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
except
on ex:exception do
begin
//** m_qryTask.Connection.RollbackTrans;
m_qryTask.Cancel();
Application.MessageBox(PChar('ת<><D7AA>ʧ<EFBFBD><CAA7>:'+ex.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_OK+MB_ICONINFORMATION);
exit;
end;
end;
Close();
// //<2F><>ȡ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD>ת<EFBFBD><D7AA>
//׼<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD>
end;
function TfrmOpSeae_TaskContrast.sendmail( mailSendTbl: TkbmMemTable;mailtype,bsno:string;ishtml:Boolean):Boolean;
var
i:integer;
str_memo:Tmemo;
SMTP1:TIdSMTP;
IdMsg:TIdMessage;
strfile,mailremarks,naspath,strnr,lognr:string;
//
emptybody, textbody, htmlbody : TIdText;
idAtta: TIdAttachmentFile;
filename:string;
begin
Result:= true;
try
naspath:=get_parameters_value(175,'\\223.223.95.160\data');
try
frm_tree_main.ConnectDownServer();
except on ex: Exception do
begin
;//s
end;
end;
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=1;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
begin
SMTP1:=TIdSMTP.Create(nil);
IdMsg:=TIdMessage.Create(nil);
str_memo:=Tmemo.create(nil);
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:=MailAddress;
SMTP1.Password :=MailPw;
SMTP1.Host :='mail.sdsmartlogistics.com';
//----------------
{
SMTP1.username:='dev003@dongshengsoft.com';
SMTP1.Password :='carey2017';
SMTP1.Host :='smtpcom.263xmail.com';
}
//debug
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);
Result:=False;
Exit;
end;
end;
if not SMTP1.Connected then
begin
SMTP1.Connect;
end;
try
with IdMsg do
begin
body.Clear;
if(ishtml) then
begin
IdMsg:=TIDMessage.create();
emptybody := TIdText.Create(IdMsg.MessageParts, nil);
emptybody.ContentType := 'multipart/alternative';
emptybody.ParentPart := -1;
textbody := TIdText.Create(IdMsg.MessageParts, nil);
textbody.Body.Text := 'plain text part';
textbody.ContentType := 'text/plain';
textbody.ParentPart := 0;
htmlbody := TIdText.Create(IdMsg.MessageParts, nil);
htmlbody.body.text :=mailSendTbl.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;// '<html><body><p>This is a email saying weeeeee</p><img src="CID:12345" /><b><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></b></body></html>';
htmlbody.ContentType := 'text/html';
htmlbody.ParentPart := 0;
IdMsg.ContentType := 'multipart/related; type="multipart/alternative"';
//IdMsg.ContentType :='text/html';
IdMsg.CharSet:='iso-8859-1';
IdMsg.Encoding:=meMIME;
// IdMsg.body:=null;//mailSendTbl.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
lognr:=mailtype + '<27>ҵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD> ';
end
else
begin
// textbody := TIdText.Create(IdMsg.MessageParts, nil);
// textbody.Body.Text := 'plain text part';
// textbody.ContentType := 'text/plain';
//textbody.ParentPart := 0;
//textbody.Body.Text:= mailSendTbl.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
Body.Text:=mailSendTbl.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
lognr :=Body.Text;
end;
From.address :=MailAddress;
Recipients.EMailAddresses :=mailSendTbl.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString;
Subject:=mailSendTbl.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString;
strfile:= mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
//-----------------
if(FileExists(strfile)) then
begin
//---------------------
{
filename:= GetWinTempPath()+ExtractFileName(strfile); //
if(FileExists(filename)) then
DeleteFile(filename);
//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ֱ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
if(FileExists(strfile) ) then
begin
CopyFile(pChar(strfile),pChar(filename),false);
end;
if(not FileExists(filename)) then
filename := strfile;
}
//--------------
idAtta:= TIdAttachmentFile.Create(MessageParts,strfile);
idAtta.ContentType:='application/octet-stream';
idAtta.ContentDisposition:='attachment';
idAtta.ContentTransfer:='base64';
idAtta.FileName:=ExtractFileName(strfile);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
// <20><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
Insert_mail_Log(bsno,mailtype,mailSendTbl.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString,mailSendTbl.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString,lognr,mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
finally
SMTP1.Disconnect;
end;
try
finally
str_memo.Free;
SMTP1.Free;
IdMsg.Free;
end;
end;
finally
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
end;
procedure TfrmOpSeae_TaskContrast.btn1_RefreshPDFClick(Sender: TObject);
var
filename,naspath,sfilename:string;
begin
sfilename :=ExtractFileExt(m_pdfFileName);
if(LowerCase(sfilename)<>'.pdf' ) then
begin
ShowMessage('<27>ļ<EFBFBD><C4BC><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>: '+sfilename);
Exit;
end;
try
iwbpdfdtr1.CloseRead;
except
end;
//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ֱ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
frm_tree_main.ConnectDownServer();
if(FileExists(m_pdfFileName) ) then
begin
filename:= GetWinTempPath()+ '_cp'+FormatDateTime('MMDDhhmmss',Now)+'.pdf'; //
if(FileExists(filename)) then
DeleteFile(filename);
CopyFile(pChar(m_pdfFileName),pChar(filename),false);
//<2F>ȴ<EFBFBD>1<EFBFBD><31>
Sleep(2000);
iwbpdfdtr1.LoadFromFile(filename);
end;
end;
procedure TfrmOpSeae_TaskContrast.btn1pdfDownloadClick(Sender: TObject);
var
filename,naspath,sfilename:string;
dlg:TSaveDialog;
begin
sfilename :=ExtractFileExt(m_pdfFileName);
//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ֱ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
frm_tree_main.ConnectDownServer();
if(FileExists(m_pdfFileName) ) then
begin
dlg:=TSaveDialog.Create(self);
dlg.FileName:=ExtractFileName(m_pdfFileName);
dlg.Filter:=sfilename;
if(dlg.Execute()) then
begin
filename:=dlg.FileName;
if(FileExists(filename)) then
begin
if( Application.MessageBox('Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ񸲸<C7B7>?','<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>',MB_YESNO+MB_ICONEXCLAMATION)<>ID_YES) then
Exit;
end;
CopyFile(pChar(m_pdfFileName),pChar(filename),false);
end;
end;
//
end;
procedure TfrmOpSeae_TaskContrast.InitialTDWindow();
begin
if not Assigned(frmOp_seae_Taskcontrast_TD) then
frmOp_seae_Taskcontrast_TD:=TfrmOp_seae_Taskcontrast_TD.create(nil);
frmOp_seae_Taskcontrast_TD.parent:=pnl2_td;
frmOp_seae_Taskcontrast_TD.Align:= alClient;
frmOp_seae_Taskcontrast_TD.Show();
end;
procedure TfrmOpSeae_TaskContrast.InitialCh_fee_edi_Window();
begin
if not Assigned(frmCh_fee_edi) then
frmCh_fee_edi:=TfrmCh_fee_edi.create(nil);
frmCh_fee_edi.parent:=pnl2_ch_fee_edi;
frmCh_fee_edi.Align:= alClient;
frmCh_fee_edi.Show();
end;
procedure TfrmOpSeae_TaskContrast.cxspltr2Moved(Sender: TObject);
begin
if cxspltr2.Left<200 then
begin
bsknpnl2_right.Left:=200+cxspltr2.Width;
cxspltr2.Left:=200;
end;
end;
procedure TfrmOpSeae_TaskContrast.cxspltr2BeforeClose(Sender: TObject;
var AllowClose: Boolean);
begin
if( m_qryTask<>nil) and ( (m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='BC') or
(m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='BA') ) then
pnl2_rptBC.Visible:=True;
end;
procedure TfrmOpSeae_TaskContrast.cxspltr2BeforeOpen(Sender: TObject;
var AllowOpen: Boolean);
begin
pnl2_rptBC.Visible:=false;
end;
procedure TfrmOpSeae_TaskContrast.btn1_ImportAssistInfoClick(
Sender: TObject);
begin
//
if(m_qryTask.FieldByName('<27>Ƿ񹫹<C7B7>').AsBoolean=True) then
Exit;
if ( (m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'BC') and
(m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'BA') ) then
Exit ;
//
if(qry_op_seae.Eof) then
Exit;
if(qry1_op_seae_edi_mail_bcinfo=nil) or (qry1_op_seae_edi_mail_bcinfo.Eof) then
Exit;
try
qry_op_seae.Edit;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_CM').AsString;
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_HC').AsString;
qry_op_seae.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').AsString:=qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_JGSHJ').AsString;
qry_op_seae.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').AsString:=qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_JDSHJ').AsString;
if(qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_ETD').AsString<>'') then
qry_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=qry1_op_seae_edi_mail_bcinfo.fieldbyname('F_ETD').AsString;
qry_op_seae.Post;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!');
qry_op_seae.Requery();
except
on ex:Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:'+ex.Message);
end;
end;
end;
procedure TfrmOpSeae_TaskContrast.ToolButton1Click(Sender: TObject);
begin
try
frm_op_letter:=tfrm_op_letter.Create (self);
frm_op_letter.bsTypeid:=3;
frm_op_letter.t_op_letter.DataSource:=ds_op_seae2;
frm_op_letter_insert:=true;
frm_op_letter.t_op_letter.Open;
frm_op_letter.t_op_letter_rh.Open;
{
frm_op_letter.bsSkinNotebook1.PageIndex:=7;
frm_op_letter.DataSource1.DataSet:=frm_op_letter.t_op_letter_rh;
frm_op_letter.t_op_letter.Insert;
frm_op_letter.t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD>֪ͨ';
frm_op_letter.t_op_letter['HEAD_TO']:=frm_op_letter.GetCorpCName(frm_op_letter.t_op_letter.DataSource.DataSet.FieldByName('ί<>е<EFBFBD>λ').asstring);
frm_op_letter.t_op_letter.Post;
frm_op_letter.t_op_letter_rh.insert;
}
frm_op_letter.ShowModal;
finally
frm_op_letter.Free;
frm_op_letter:=nil;
end;
end;
end.