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.

848 lines
24 KiB
Plaintext

12 months ago
unit u_op_seae_ysbg;
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, SHDocVw;
type
TfrmOpSeae_ysbg = 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;
bsknpnl2_right: TbsSkinPanel;
scrlbx1: TScrollBox;
bsknpnl6_left: TbsSkinPanel;
cxspltr2: TcxSplitter;
btn1_RefreshPDF: TButton;
btn1pdfDownload: TSpeedButton;
spl2: TSplitter;
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;
lbl75: TLabel;
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;
WebBrowser1: TWebBrowser;
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 btn1pdfDownloadClick(Sender: TObject);
procedure cxspltr2Moved(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_ysbg: TfrmOpSeae_ysbg;
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_ysbg.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;
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;
btn2Confirm.Enabled:=True;
if(state<>'PENDING') then
mni_mniN1Confirm.Visible:=True;
//btn1Forword.Enabled:=True;
end ;
btn1Forword.Enabled:=True;
end;
procedure TfrmOpSeae_ysbg.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;
end;
/// <summary>
///
/// </summary>
procedure TfrmOpSeae_ysbg.openpdfFile();
var
filename,naspath,info:string;
begin
if(LowerCase(ExtractFileExt(m_pdfFileName))<>'.html' ) then
Exit;
//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ֱ<EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD>
if(FileExists(m_pdfFileName) ) then
begin
WebBrowser1.Navigate(m_pdfFileName);
end
else if(m_pdfFileName<>'')then
ShowMessage('Ҫ<><D2AA><EFBFBD>ص<EFBFBD><D8B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure TfrmOpSeae_ysbg.FormShow(Sender: TObject);
begin
InitialBusiData();
openpdfFile();
end;
procedure TfrmOpSeae_ysbg.btnCoseClick(Sender: TObject);
begin
close();
end;
procedure TfrmOpSeae_ysbg.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_ysbg.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_ysbg.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>
optype:='<27><><EFBFBD><EFBFBD>';
isok:=true;
try
filetype:='<27><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>';
isok:= frm_tree_main.Guadan(mainNo,bsno, filetype,filename);
//<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_ysbg.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:='<27>ƻ<EFBFBD><C6BB><EFBFBD><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;
str:=mainno+'<27><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>' ;// 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;
mailSend.Post;
try
//** m_qryTask.Connection.BeginTrans;
isok:= sendmail(mailSend,FNType,bsno,True) ;
if(isok) then
begin
//<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_ysbg.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
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
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_ysbg.btn1pdfDownloadClick(Sender: TObject);
begin
//
try
frm_tree_main.ConnectDownServer();
except on ex: Exception do
begin
;//s
end;
end;
openpdfFile();
end;
procedure TfrmOpSeae_ysbg.InitialTDWindow();
begin
end;
procedure TfrmOpSeae_ysbg.InitialCh_fee_edi_Window();
begin
end;
procedure TfrmOpSeae_ysbg.cxspltr2Moved(Sender: TObject);
begin
if cxspltr2.Left<200 then
begin
bsknpnl2_right.Left:=200+cxspltr2.Width;
cxspltr2.Left:=200;
end;
end;
end.