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.
DS6JIEFENG/海运业务/u_op_seae_print_vessel.~pas

163 lines
5.2 KiB
Plaintext

12 months ago
unit u_op_seae_print_vessel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, ADODB, DB, BusinessSkinForm, dxDBTLCl, dxGrClms,
bsSkinCtrls, dxTL, dxDBCtrl, dxDBGrid, dxCntner, ComCtrls, bsSkinTabs,
StdCtrls, kbmMemTable;
type
Tfrm_op_seae_print_vessel = class(TForm)
bsSkinPanel1: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridDateColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1TEU: TdxDBGridMaskColumn;
dxDBGrid1Column63: TdxDBGridMaskColumn;
dxDBGrid1Column64: TdxDBGridMaskColumn;
dxDBGrid1Column65: TdxDBGridDateColumn;
dxDBGrid1Column66: TdxDBGridMaskColumn;
dxDBGrid1Column67: TdxDBGridMaskColumn;
bsBusinessSkinForm1: TbsBusinessSkinForm;
t_op_seae1: TDataSource;
t_op_seae: TADOStoredProc;
t_sys_report_employee: TADOQuery;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
SaveDialog1: TSaveDialog;
mailSend: TkbmMemTable;
mailSendStringField: TStringField;
mailSendField: TStringField;
mailSendField2: TStringField;
mailSendField3: TStringField;
mailSendField4: TStringField;
mailSendField5: TStringField;
mailSendField6: TStringField;
mailSendField7: TStringField;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton8: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
Memo1: TMemo;
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
private
function getMailAddr:string;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_seae_print_vessel: Tfrm_op_seae_print_vessel;
implementation
uses my_sys_function, u_main, u_data_share;
{$R *.dfm}
procedure Tfrm_op_seae_print_vessel.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_seae_print_vessel.bsSkinButton1Click(Sender: TObject);
begin //<2F><><EFBFBD>ݹ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ļ<EFBFBD>
end;
procedure Tfrm_op_seae_print_vessel.bsSkinButton11Click(Sender: TObject);
var
aQuery:TADOQuery;
str,mailaddr:string;
begin
mailaddr:=getMailAddr;
if (trim(mailaddr)='') then begin
ShowMessage('<27>ռ<EFBFBD><D5BC><EFBFBD>ַΪ<D6B7><CEAA>,<2C><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD>ʼ<EFBFBD>');
Exit;
end;
Memo1.Lines.Clear;
Memo1.Lines.Add('Dear<61><72>');
Memo1.Lines.Add('');
Memo1.Lines.Add('');
Memo1.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>лл~');
Memo1.Lines.Add('');
t_op_seae.First;
while not t_op_seae.Eof do begin
Memo1.Lines.Add(t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
t_op_seae.Next;
end;
mailSend.EmptyTable;
mailSend.Open;
mailSend.Insert;
mailSend.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').AsString:=mailaddr;
mailSend.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+' '+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'<27><><EFBFBD>ر<EFBFBD>';
mailSend.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString:=Memo1.Text;
frm_data_share.t_sys_employee.Locate('<27><><EFBFBD><EFBFBD>',employee,[]);
mailSend.FieldByName('<27>ʼ<EFBFBD>ǩ<EFBFBD><C7A9>').AsString:=MailSignName;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>';
mailSend.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:=t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
mailSend.Post;
sys_frprint('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>',5,t_op_seae,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,True,'',nil,nil,mailSend,'EXCEL');
end;
procedure Tfrm_op_seae_print_vessel.bsSkinButton6Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>',1,t_op_seae,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_op_seae_print_vessel.bsSkinButton8Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>',3,t_op_seae,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_op_seae_print_vessel.bsSkinButton4Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>',2,t_op_seae,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
end;
function Tfrm_op_seae_print_vessel.getMailAddr: string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
With aQuery do begin
close;SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD> from t_crm_client_linkman where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('<27><>վ').AsString+''' and <20><><EFBFBD><EFBFBD>='''+t_op_seae.fieldbyname('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').AsString+'''');
open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
end.