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_sign_new_info.pas

1261 lines
43 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_sign_new_info;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, StdCtrls, dxExEdtr, DB, dxTL, dxDBCtrl,
dxDBGrid, dxCntner, ADODB, bsdbctrls, cxDBLabel, cxControls, cxContainer,
cxEdit, cxLabel, dxDBTLCl, dxGrClms, Mask, DBCtrlsEh, wwdblook, RxLookup,
wwdbdatetimepicker, ComCtrls, bsSkinTabs, OleCtrls, iWebPDFEditorLib_TLB,EncdDecd,ShellAPI,
Menus, kbmMemTable, bsSkinBoxCtrls, cxTextEdit, cxDBEdit, cxMaskEdit,
cxCheckBox, cxDropDownEdit, cxCalendar;
type
Tfrm__op_seae_sign_new_info = class(TForm)
bsknpnl5: TbsSkinPanel;
dxdbgrd_mx: TdxDBGrid;
dxdbgrdclmndxdbgrd2Column1: TdxDBGridColumn;
dxdbgrdclmn_mxColumn3: TdxDBGridColumn;
dxdbgrdclmn_mxColumn4: TdxDBGridColumn;
dxdbgrdclmn_mxColumn5: TdxDBGridColumn;
dxdbgrdclmn_mxColumn6: TdxDBGridColumn;
dxdbgrdchckclmndxdbgrd2Column2: TdxDBGridCheckColumn;
bsknpnl7: TbsSkinPanel;
cxlbl1: TcxLabel;
cxlbl2: TcxLabel;
cxlbl3: TcxLabel;
cxlbl4: TcxLabel;
cxlbl5: TcxLabel;
cxlbl7: TcxLabel;
cxlbl8: TcxLabel;
cxdblbl1: TcxDBLabel;
cxdblbl2: TcxDBLabel;
cxdblbl3: TcxDBLabel;
cxdblbl4: TcxDBLabel;
cxdblbl5: TcxDBLabel;
cxdblbl6: TcxDBLabel;
bsknpnl6: TbsSkinPanel;
cxlbl6: TcxLabel;
dxdbgrd1: TdxDBGrid;
dxdbgrdclmn1: TdxDBGridColumn;
dxdbgrdclmn2: TdxDBGridColumn;
dxdbgrdclmn3: TdxDBGridColumn;
dxdbgrdclmn4: TdxDBGridColumn;
dxdbgrdclmn5: TdxDBGridColumn;
bsknpnl3: TbsSkinPanel;
btn8: TbsSkinButton;
btn9_mailSend: TbsSkinButton;
btn11: TbsSkinButton;
ds1_qdtm: TDataSource;
ds2_qdtd: TDataSource;
qry2_qdtd: TADOQuery;
qry1_qdtm: TADOQuery;
btn3_custprint: TbsSkinButton;
btn9_exit: TbsSkinButton;
img1: TImage;
cxlbl19: TcxLabel;
bsknpnl8: TbsSkinPanel;
shp7: TShape;
shp6: TShape;
shpe: TShape;
shp4: TShape;
shp3: TShape;
shp2: TShape;
shp1: TShape;
bskndbtxt3: TbsSkinDBText;
bskndbtxt4: TbsSkinDBText;
bskndbtxt5: TbsSkinDBText;
bskndbtxt6: TbsSkinDBText;
cxlbl9: TcxLabel;
cxlbl10: TcxLabel;
cxlbl11: TcxLabel;
cxlbl12: TcxLabel;
cxlbl13: TcxLabel;
cxlbl14: TcxLabel;
cxlbl15: TcxLabel;
btn2_CancelSignItem: TbsSkinButton;
dxdbgrdchckclmn6: TdxDBGridCheckColumn;
pm1: TPopupMenu;
mniN1ViewCustSign: TMenuItem;
mniN2_ViewInvoceSign: TMenuItem;
kbmMemTable1: TkbmMemTable;
strngfldMemTable1Field: TStringField;
strngfldMemTable1Field3: TStringField;
strngfldMemTable1Field4: TStringField;
strngfldMemTable1Field5: TStringField;
strngfldMemTable1Field6: TStringField;
strngfldMemTable1Field7: TStringField;
strngfldMemTable1Field2: TStringField;
strngfldMemTable1Field9: TStringField;
strngfldMemTable1Field10: TStringField;
strngfldMemTable1Field11: TStringField;
strngfldMemTable1Field8: TStringField;
strngfldMemTable1Field12: TStringField;
strngfldMemTable1Field13: TStringField;
strngfldMemTable1Field15: TStringField;
strngfldMemTable1Field14: TStringField;
strngfldMemTable1Field16: TStringField;
strngfldMemTable1Field17: TStringField;
kbmMemTable1Field18: TBooleanField;
strngfldMemTable1Field19: TStringField;
kbmMemTable1RMB: TFloatField;
kbmMemTable1USD: TFloatField;
mailSend: TkbmMemTable;
strngfldSendStringField: TStringField;
strngfldSendField: TStringField;
strngfldSendField2: TStringField;
strngfldSendField3: TStringField;
strngfldSendField4: TStringField;
strngfldSendField5: TStringField;
strngfldSendField6: TStringField;
strngfldSendField7: TStringField;
cxlbl17: TcxLabel;
cxlbl18: TcxLabel;
cxdbtxtdt1: TcxDBTextEdit;
cxdbtxtdt2: TcxDBTextEdit;
shp8: TShape;
bskndbtxt1: TbsSkinDBText;
cxdbchckbx1_tf: TcxDBCheckBox;
cxlbl16_tf: TcxLabel;
cxdbdtdt1_tf: TcxDBDateEdit;
cxlbl16: TcxLabel;
cxlbl20: TcxLabel;
dxdbgrdclmndxdbgrd1Column7: TdxDBGridColumn;
cxlbl21: TcxLabel;
bskndbtxt2: TbsSkinDBText;
dxdbgrdclmndxdbgrd1Column8: TdxDBGridColumn;
dxdbgrdclmn9_usd: TdxDBGridColumn;
dxdbgrdclmn10_rmb: TdxDBGridColumn;
cxlbl22: TcxLabel;
bskndbtxt7: TbsSkinDBText;
btn3_notify: TbsSkinButton;
dxdbgrd1Column11: TdxDBGridColumn;
dxdbgrd1Column12: TdxDBGridColumn;
procedure bsSkinButton2Click(Sender: TObject);
procedure btn3_sustprint(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btn8Click(Sender: TObject);
procedure btn11Click(Sender: TObject);
procedure btn9_mailSendClick(Sender: TObject);
procedure btn9_exitClick(Sender: TObject);
procedure btn3_notifyClick(Sender: TObject);
procedure btn2_CancelSignItemClick(Sender: TObject);
procedure btn8_confirmSignoutClick(Sender: TObject);
procedure mniN2_ViewInvoceSignClick(Sender: TObject);
procedure mniN1ViewCustSignClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure dxdbgrd1CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure dxdbgrd1Column11CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure dxdbgrd1Column12CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
private
{ Private declarations }
m_qdtbh:string;
m_iway:Integer;
m_newfilename:string;
m_newCWfilename:string;//<2F><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>
m_isNewSign:Boolean;
m_wtdw:string;//ί<>е<EFBFBD>λ|<7C><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
m_isPJ:boolean ;//<2F>Ƿ<EFBFBD>Ʊ<EFBFBD><C6B1>
m_reportname:string;//ǩ<><C7A9><EFBFBD><EFBFBD><><C6B1>֪ͨ<CDA8><D6AA>
function GetNotieState():Boolean;
function CheckIsAllCeckout():Boolean;
function CheckBilldue():Boolean;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
procedure signletterSateDeal();
procedure signoutSateDeal(wtdw:string);
procedure show_qdtxx (qdtbh:string;iway:Integer);
procedure UpateSeaeState(bsno,billstate:string);
function GetClientLimited(sname:string):Boolean;
public
{ Public declarations }
procedure InitialUserinfo(qdtbh:string;iway:Integer);
procedure SigninfoShow();
end;
var
frm__op_seae_sign_new_info: Tfrm__op_seae_sign_new_info;
implementation
uses my_sys_function, u_main, u_op_seae_sign_info, u_data_share;
{$R *.dfm}
/// <summary>
/// <20><>ʱĿ¼
/// </summary>
function GetWinTempPath: string;
var
TempDir: array[0..255] of char;
begin
GetTempPath(255, @TempDir);
Result := strPas(TempDir);
end;
///<2F><>Bitmapλͼת<CDBC><D7AA>Ϊbase64<36>ַ<EFBFBD><D6B7><EFBFBD>
function BitmapToString(img:TBitmap):string ;
var
ms:TMemoryStream;
ss:TStringStream;
s:string;
begin
ms := TMemoryStream.Create;
img.SaveToStream(ms);
ss := TStringStream.Create('');
ms.Position:=0;
EncodeStream(ms,ss);//<2F><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊbase64<36>ַ<EFBFBD><D6B7><EFBFBD>
s:=ss.DataString;
ms.Free;
ss.Free;
result:=s;
end;
function StringToBitmap(imgStr:string):TBitmap;
var ss:TStringStream;
ms:TMemoryStream;
bitmap:TBitmap;
begin
ss := TStringStream.Create(imgStr);
ms := TMemoryStream.Create;
DecodeStream(ss,ms);//<2F><>base64<36>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ԭΪ<D4AD>ڴ<EFBFBD><DAB4><EFBFBD>
ms.Position:=0;
bitmap := TBitmap.Create;
bitmap.LoadFromStream(ms);
ss.Free;
ms.Free;
result :=bitmap;
end;
function Tfrm__op_seae_sign_new_info.CheckBilldue():Boolean;
var
FeeItems:string;
amt,usd:Double;
bh,wtdw,tdh,jflx:string;
bkmark:TBookmark;
aQuery:TADOQuery;
itfCount:Integer;//<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>
begin
Result:=True;
wtdw:=qry1_qdtm.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
bkmark := qry2_qdtd.GetBookMark; //<2F>Ե<EFBFBD>ǰ<EFBFBD><C7B0>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>־
qry2_qdtd.DisableControls; //<2F>ж<EFBFBD>Table<6C><65><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ
qry2_qdtd.First ;
//1<>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>,2<><32><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>
if GetCorpNameSpecialAccount(FormatDateTime('YYYY-MM-DD',GetDbDatetime),wtdw) then
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
close;SQL.Clear;
sql.add('select <20><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+ wtdw +'''');
open;
if not IsEmpty then begin
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').AsString='<27><>' then
begin
if MessageDlg(wtdw+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>Ϊ:'+fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').AsString+#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
begin
Result:=false;
exit;
end
else
begin
Result:=true;
exit;
end;
end;
end;
//<2F><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>
close;SQL.Clear;
sql.add('Select count(1) as tf_count from t_op_fangdan ');
SQL.Add('where <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from [t_op_seae_sign_detail] where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''' ) ') ;
open;
if not IsEmpty then begin
itfCount:=FieldByName('tf_count').AsInteger;
if( itfCount= qry2_qdtd.Recordset.RecordCount) then
begin
//ȫ<><C8AB><EFBFBD>ط<EFBFBD>
Result:=true;
Exit;
end;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;// 1 <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD> ,2 <20>Ƿ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>
While Not qry2_qdtd.EOF Do //<2F>Ա<EFBFBD><D4B1><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
bh:= qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
tdh:=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
jflx:=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
if (jflx='') or (jflx='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') or (jflx='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>') then
begin
if GetCrmsales(bh,wtdw,jflx,amt,usd,FeeItems) then
begin
//<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>
MessageDlg('<27><><EFBFBD><EFBFBD><E1B5A5>Ϊ"'+ tdh+'"<22><>'+wtdw+'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'
+FormatFloat('0.00;0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',USD)
+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>',mtWarning,[mbok],0);
Result:=False;
Break;
end ;
end
else
begin
if GetCrmsales(bh,wtdw,jflx,amt,usd,FeeItems) then
begin
MessageDlg( '<27><><EFBFBD><EFBFBD><E1B5A5>Ϊ"'+ tdh+'"<22><>'+wtdw+'<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'
+FormatFloat('0.00;0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',USD)
+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>',mtWarning,[mbok],0);
Result:=False;
Break;
end;
end;
qry2_qdtd.Next;
end;
qry2_qdtd.GotoBookMark(bkmark);
qry2_qdtd.EnableControls; //<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>¼ָ<C2BC><D6B8><EFBFBD>ص<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
qry2_qdtd.FreeBookMark(bkmark); //ɾ<><C9BE><EFBFBD><EFBFBD>ǩBookMark<72><6B>־
end; //end CheckBilldue
procedure Tfrm__op_seae_sign_new_info.InitialUserinfo(qdtbh:string;iway:Integer);
begin
m_qdtbh:=qdtbh;
m_iway:=iway;
end;
procedure Tfrm__op_seae_sign_new_info.SigninfoShow();
begin
//
if not Assigned( frm__op_seae_sign_new_info ) then
begin
frm__op_seae_sign_new_info:= Tfrm__op_seae_sign_new_info.Create(self);
end;
frm__op_seae_sign_new_info.ShowModal();
end;
procedure Tfrm__op_seae_sign_new_info.show_qdtxx (qdtbh:string;iway:Integer);
var
qdtzht,picpath:string;
cancancel:Boolean;
begin
//
m_isNewSign:=False;
btn9_exit.visible:=false;
m_qdtbh:=qdtbh;
qry1_qdtm.Parameters.ParamByName('qdtbh').value:=qdtbh;
if (qry1_qdtm.State= dsOpening) or (qry1_qdtm.State =dsBrowse) or (qry1_qdtm.State= dsEdit) then
qry1_qdtm.Requery()
else
begin
qry1_qdtm.open;
qry1_qdtm.First;
end;
m_isPJ:=False;
m_reportname:='ǩ<><C7A9><EFBFBD><EFBFBD>';
dxdbgrdclmn9_usd.Visible:=false;
dxdbgrdclmn9_usd.SummaryFooterType:= cstNone;
dxdbgrdclmn10_rmb.Visible:=false;
dxdbgrdclmn10_rmb.SummaryFooterType:= cstNone;
dxdbgrd1Column11.visible:=false;
dxdbgrd1Column12.visible:=false;
if(not qry1_qdtm.Eof) then
begin
m_wtdw:= trim(qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
if (qry1_qdtm.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull=False)
and (qry1_qdtm.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString='Ʊ<><C6B1>' ) then
begin
m_isPJ:=True;
m_reportname:='Ʊ<><C6B1>֪ͨ<CDA8><D6AA>' ;
dxdbgrdclmn9_usd.Visible:=True;
dxdbgrdclmn9_usd.SummaryFooterType:= cstSum;
dxdbgrdclmn10_rmb.Visible:=True;
dxdbgrdclmn10_rmb.SummaryFooterType:= cstSum;
dxdbgrd1Column11.visible:=true;
dxdbgrd1Column12.visible:=True;
end;
end;
if (m_isPJ) then begin
qry2_qdtd.SQL.text:=StringReplace(qry2_qdtd.SQL.text,'and V_op_bscard_All.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><=Getdate()-7','',[]);
end;
qry2_qdtd.Parameters.ParamByName('qdtbh').value:=qdtbh;
qry2_qdtd.Parameters.ParamByName('qdtbh2').value:=qdtbh;
if (qry2_qdtd.State = dsOpening) or (qry2_qdtd.State= dsBrowse) or (qry2_qdtd.State= dsEdit) then
qry2_qdtd.Requery()
else
begin
qry2_qdtd.open;
qry2_qdtd.First;
end;
//֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9> <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
{
if (GetNotieState) then
begin
btn3_notify.enabled:=True
end
else
}
btn3_notify.Enabled:=false;
//ȡ<><C8A1>ǩ<EFBFBD><C7A9><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
qdtzht:= qry1_qdtm.fieldbyname('״̬').AsString;
btn2_CancelSignItem.Enabled:=false;
if (qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (qdtzht='ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (qdtzht='<27>ᵥǩ<E1B5A5><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (qdtzht='֪ͨǩ<D6AA><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') then
cancancel:=True;
//(iway<=3) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>
if (cancancel=True) then
btn2_CancelSignItem.Enabled:=True;
if(not qry1_qdtm.eof) then
begin
if m_iway=31 then
picpath :=qry1_qdtm.fieldbyname('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>ͼƬ').AsString
else
picpath :=qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD>ǩ<EFBFBD><C7A9>ͼƬ').AsString;
picpath :=qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD>ǩ<EFBFBD><C7A9>ͼƬ').AsString;
if (picpath<>'') and (FileExists(picpath)) then
begin
img1.Picture.LoadFromFile(picpath);
img1.Visible:=True;
end
else
img1.Visible:=false;
end
else
begin
img1.Visible:=false;
end;
btn9_exit.visible :=true;
//<2F>Ƿ<EFBFBD><C7B7>ط<EFBFBD>,<2C>طų<D8B7><C5B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><ECBDAB><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>
if (not qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').IsNull) and ( qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').AsBoolean) then
begin
cxdbchckbx1_tf.Visible:=True;
cxlbl16_tf.Visible:=True;
cxdbdtdt1_tf.Visible:=True;
end
else
begin
cxdbchckbx1_tf.Visible:=false;
cxlbl16_tf.Visible:=false;
cxdbdtdt1_tf.Visible:=false;
end;
if(qry2_qdtd.Recordset<>nil) then
cxlbl20.Caption:= IntToStr(qry2_qdtd.Recordset.recordcount);
end;
procedure Tfrm__op_seae_sign_new_info.bsSkinButton2Click(Sender: TObject);
begin
//grid_save_xls(dxdbgrid1);
end;
/// <summary>
/// <20><EFBFBD><E8B6A8>ʽ
/// </summary>
procedure Tfrm__op_seae_sign_new_info.btn3_sustprint(Sender: TObject);
begin
sys_print(m_reportname,2,ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil);
end;
/// <summary>
///
/// </summary>
procedure Tfrm__op_seae_sign_new_info.FormShow(Sender: TObject);
begin
Width:=width-1;
show_qdtxx(m_qdtbh,m_iway);
end;
/// <summary>
/// ֱ<>Ӵ<EFBFBD>ӡ
/// </summary>
procedure Tfrm__op_seae_sign_new_info.btn8Click(Sender: TObject);
begin
try
sys_print(m_reportname ,3,ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil);
qry1_qdtm.Edit;
qry1_qdtm.FieldByName('<27><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>').AsDateTime:=GetDbDatetime();
qry1_qdtm.Post;
except
qry1_qdtm.Cancel;
end;
end;
/// <summary>
/// <20><>ӡԤ<D3A1><D4A4>
/// </summary>
procedure Tfrm__op_seae_sign_new_info.btn11Click(Sender: TObject);
begin
try
sys_print(m_reportname,1,ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil);
qry1_qdtm.Edit;
qry1_qdtm.FieldByName('<27><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>').AsDateTime:=GetDbDatetime();
qry1_qdtm.Post;
except
qry1_qdtm.Cancel;
end;
end;
procedure Tfrm__op_seae_sign_new_info.btn9_mailSendClick(Sender: TObject);
var
//book1:Tbookmark;
aQuery:TADOQuery;
str:string;
strsjr:string;
begin
//1.<2E><>֤<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><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>=''ǩ<><C7A9><EFBFBD><EFBFBD>'' and c.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+ m_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>λ='''+ m_wtdw + ''' and isnull(<28>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>,'''')<>'''' and '
+ ' <20><><EFBFBD><EFBFBD><E1B5A5> in ( select <20><><EFBFBD><EFBFBD><E1B5A5> from t_op_seae_sign_detail where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh+ ''' ) ) ; ';
aQuery:=CreateAdoQuery();
with aQuery do begin
close;sql.Clear;
SQL.Add(str);
Open;
strsjr:='';
if not IsEmpty then
begin
//<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;
First;
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;
str:=fieldbyname('<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>').AsString +FormatDateTime('YYYYMMDDHHMMSS',now) ;
mailsend.fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString :=str;
str:= fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString + qry1_qdtm.Fields.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=str;
//
if fieldbyname('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').IsNull then
str:=' '
else
str:=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:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:= qry1_qdtm.Fields.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
mailSend.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString:='';//t_op_letter.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
mailSend.Post;
try
sys_print(m_reportname,5,ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil,true,m_wtdw,nil,nil,mailSend);
//<2F><><EFBFBD><EFBFBD>״̬
qry1_qdtm.Edit;
qry1_qdtm.FieldByName('<27>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime:=GetDbDatetime();
qry1_qdtm.Post;
except
qry1_qdtm.Cancel();
end;
end
else
begin
Application.MessageBox(PChar('<27>ͻ<EFBFBD>"'+ m_wtdw+ '"û<><C3BB><><C7A9><EFBFBD><EFBFBD>]<5D>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
end;
end;
end;
procedure Tfrm__op_seae_sign_new_info.btn9_exitClick(Sender: TObject);
begin
close();
end;
/// <summary>
/// <20><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>֪ͨ<CDA8><D6AA>ť״̬<D7B4>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
/// </summary>
function Tfrm__op_seae_sign_new_info.GetNotieState():Boolean;
var
qdtzht:string;
begin
//
Result:=False;
if(not qry1_qdtm.Eof) then
begin
if(m_isPJ=false) then
begin
//<2F>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
Exit;
end;
qdtzht:= qry1_qdtm.FieldByName('״̬').AsString;
if(qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (qdtzht='<27>Ѵ<EFBFBD>ӡǩ<D3A1><C7A9><EFBFBD><EFBFBD>') or (qdtzht='<27>ѷ<EFBFBD><D1B7><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') then
begin
Result:=true;
end;
end;
//<2F>ж<EFBFBD>:<3A><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>Ѿ<EFBFBD>ǩ<EFBFBD><C7A9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>
end;
function Tfrm__op_seae_sign_new_info.CheckIsAllCeckout():Boolean;
var
aquery:TADOQuery;
qdtbh,qdtzht,sqlstr:string;
begin
Result:=False;
if(not qry1_qdtm.Eof) then
begin
qdtzht:= qry1_qdtm.FieldByName('״̬').AsString;
if(qdtzht='ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') then
begin
Result:=true;
end
else if(qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (qdtzht='<27>Ѵ<EFBFBD>ӡǩ<D3A1><C7A9><EFBFBD><EFBFBD>') or (qdtzht='<27>ѷ<EFBFBD><D1B7><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') then
begin
//
aquery:=CreateAdoQuery();
aquery.Close;
aquery.SQL.Clear;
sqlstr:='select count(1) as fcount from ( select d.<2E><><EFBFBD><EFBFBD>,s.ҵ<><D2B5>״̬ FROM [t_op_seae_sign_detail] d left join '
+'(select <20><><EFBFBD><EFBFBD><><D2B5>״̬ from t_op_state where ҵ<><D2B5>״̬=''<27>ᵥǩ<E1B5A5><C7A9>'' ) s on d.<2E><><EFBFBD><EFBFBD>=s.<2E><><EFBFBD><EFBFBD> where d.ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> =:ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)'
+' v where ҵ<><D2B5>״̬ is null ';
aquery.SQL.Add(sqlstr);
aQuery.Parameters.ParamByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=m_qdtbh;
aQuery.open();
aQuery.first;
if (not aquery.Eof) and (aquery.FieldByName('fcount').AsInteger=0) then
begin
// ȫ<><C8AB>ǩ<EFBFBD><C7A9>
aQuery.Close;
aQuery.SQL.Clear;
sqlstr:='update t_op_seae_sign_main set ״̬=''ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'',ǩ<><C7A9>ʱ<EFBFBD><CAB1>=getdate() where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''' + qdtbh +''' ';
aquery.SQL.Add(sqlstr);
aquery.ExecSQL();
Result:=True;
end;
end;
end;
//<2F>ж<EFBFBD>
end;
/// <summary>
/// ֪ͨǩ<D6AA><C7A9>
/// </summary>
procedure Tfrm__op_seae_sign_new_info.btn3_notifyClick(Sender: TObject);
var
zht:string;
begin
//
if(GetNotieState) then
begin
zht:= qry1_qdtm.FieldByName('״̬').AsString;
//
try
frm_main.db.BeginTrans;
qry1_qdtm.Edit;
qry1_qdtm.FieldByName('״̬').AsString:='֪ͨǩ<D6AA><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>';
qry1_qdtm.FieldByName('֪ͨǩ<D6AA><C7A9>ʱ<EFBFBD><CAB1>').AsDateTime:=GetDbDatetime();
frm_main.db.CommitTrans;
application.MessageBox(PChar('ǩ<><C7A9><EFBFBD><EFBFBD>֪ͨ<CDA8>ѷ<EFBFBD><D1B7><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
qry1_qdtm.Requery();
except
on ex: Exception do
begin
errorlog(ex.Message) ;
ShowMessage(ex.Message);
qry1_qdtm.Cancel;
frm_main.db.rollbacktrans;
end;
end;
end;
end;
/// <summary>
/// ǩ<>ָ<EFBFBD><D6B8><EFBFBD>״̬
/// </summary>
procedure Tfrm__op_seae_sign_new_info.signletterSateDeal();
var
FeeItems:string;
amt,usd:Double;
tdh:string;
i:Integer;
begin
qry2_qdtd.first;
While Not qry2_qdtd.EOF Do //<2F>Ա<EFBFBD><D4B1><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
begin
tdh:=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
begin
if GetBillStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) then //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end
else
if GetCorpNameSpecialAccount(FormatDateTime('YYYY-MM-DD',GetDbDatetime),qry1_qdtm.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString) then
begin
if MessageDlg(m_wtdw+' <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>û<EFBFBD>й<EFBFBD><D0B9><EFBFBD>'+#13#10+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end;
end
else
begin
if (Trim(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='') or (Trim(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') or (Trim(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>') or (qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) then
begin
if GetCrmsales(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString
,m_wtdw,qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,amt,usd,FeeItems) then
begin
//<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',USD) +'<27><><EFBFBD>ܷŵ<DCB7>'+#13#10+'<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ģʽ:'+#13#10+'1.<2E>Ƿ<EFBFBD><C7B7>п<EFBFBD><D0BF>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>'+#13#10+'2.<2E><><EFBFBD>˷ŵ<CBB7>'+#13#10+'3.<2E><><EFBFBD>˱<EFBFBD><CBB1>ŵ<EFBFBD>'+#13#10+'4.<2E><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>',mtWarning,[mbno],0)=mryes then
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end;
end
else
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end;
end
else
begin
if GetCrmsales(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,m_wtdw
,qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,amt,usd,FeeItems) then
begin
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',USD) +'<27><><EFBFBD>ܷŵ<DCB7>'+#13#10+'<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ģʽ:'+#13#10+'1.<2E>Ƿ<EFBFBD><C7B7>п<EFBFBD><D0BF>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>'+#13#10+'2.<2E><><EFBFBD>˷ŵ<CBB7>'+#13#10+'3.<2E><><EFBFBD>˱<EFBFBD><CBB1>ŵ<EFBFBD>'+#13#10+'4.<2E><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>',mtWarning,[mbno],0)=mryes then
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end;
end
else
begin
InsertSeaeStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
if (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>'))
and (not GetStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'<27>ᵥǩ<E1B5A5><C7A9>')) then
UpdateMblStatus(qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString,'֪ͨ<CDA8>ŵ<EFBFBD>');
end;
end;
end;
end
else
begin
Application.MessageBox(pchar(tdh+ '<27>Ѿ<EFBFBD>֪ͨ<CDA8>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD>ᵥǩ<E1B5A5><C7A9>'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
end;
end;
qry2_qdtd.Next;
end;
end;
/// <summary>
/// ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
/// </summary>
procedure Tfrm__op_seae_sign_new_info.signoutSateDeal(wtdw:string);
var
FeeItems,reasons,JobAmt:string;
amt,usd:Double;
tdh:string; //<2F><><EFBFBD><EFBFBD><E1B5A5>
bh:string;// <20><><EFBFBD><EFBFBD>
jflx:string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
i:Integer;
aAdoQuery:TAdoQuery;
begin
qry2_qdtd.first;
While Not qry2_qdtd.EOF Do //<2F>Ա<EFBFBD><D4B1><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
tdh:=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
bh :=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
jflx:= qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
//
if GetCorpNameSpecialAccount(FormatDateTime('YYYY-MM-DD',GetDbDatetime),wtdw) then
begin
//
if MessageDlg(wtdw +' <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>û<EFBFBD>й<EFBFBD><D0B9><EFBFBD>'+#13#10+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now),reasons);
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
//
end
else
begin
//**b
if not GetStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>') then
begin
if GetBillStatusCount(bh) then
begin
if GetCrmOP(employee,m_wtdw,'<27><><EFBFBD><EFBFBD>') then //<2F><>ǩ<EFBFBD>ͻ<EFBFBD>
begin
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now),reasons);
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end
else
if (jflx='') or (jflx='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') or (jflx='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>') or (qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) then
begin
if GetCrmsales(bh,m_wtdw
,jflx,amt,usd,FeeItems) then
begin
JobAmt:=GetCrmpjAmt(bh);
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>'#13#10'<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>Ϊ:'+JobAmt+#13#10+'<27><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',USD) +'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now),reasons);
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
JobAmt:=GetCrmpjAmt(bh);
if trim(JobAmt)<>'' then
begin
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>'#13#10'<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>Ϊ:'+JobAmt +'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end;
end
else
if (jflx='Լ<><D4BC>ʱ<EFBFBD><CAB1>') or (jflx='Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
begin
if GetClientLimited(wtdw) then
begin
ShowMessage('<27>½<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ܷŵ<DCB7>,ϵͳ<CFB5>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>,<2C><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>');
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;SQL.Clear;
SQL.Add('Update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>''');
SQL.Add('where <20><><EFBFBD><EFBFBD>='+''''+bh+'''');
ExecSQL;
finally
Free;
end;
end
else
begin //
if GetCrmsales(bh,m_wtdw
,jflx,amt,usd,FeeItems) then
begin
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>½<EFBFBD>'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',USD)+#13#10+#13#10+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
// if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>½<EFBFBD>'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',USD)+#13#10+FeeItems+#13#10+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now),reasons);
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end;
end;
end
else //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
if GetBillStatus(bh) then //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
begin
if (jflx='') or (jflx='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') or (jflx='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>') or (qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) then
begin
if GetCrmsales(bh,kbmMemTable1.FieldByName('ί<>е<EFBFBD>λ').AsString
,jflx,amt,usd,FeeItems) then
begin
JobAmt:=GetCrmpjAmt(bh);
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>'#13#10'<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>Ϊ:'+JobAmt+#13#10+'<27><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',USD) +'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:='';
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now),reasons);
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
if GetClientLimited(kbmMemTable1.FieldByName('ί<>е<EFBFBD>λ').AsString) then
begin
ShowMessage('<27>½<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ܷŵ<DCB7>,ϵͳ<CFB5>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>,<2C><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>');
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;SQL.Clear;
SQL.Add('Update t_op_seae set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>''');
SQL.Add('where <20><><EFBFBD><EFBFBD>='+''''+bh+'''');
ExecSQL;
finally
Free;
end;
end;
if GetCrmsales(bh,kbmMemTable1.FieldByName('ί<>е<EFBFBD>λ').AsString
,jflx,amt,usd,FeeItems) then
begin
if MessageDlg('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>½<EFBFBD>'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',amt) +'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;-0.00;0',USD)+#13#10+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mryes then
begin
reasons:='';
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now),reasons);
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end
else
begin
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now));
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',Now));
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
end;
end;
end
else
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>,<2C><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>');
end;
end;
//**e
end;
end;
//
qry2_qdtd.Next;
end;
end;
procedure Tfrm__op_seae_sign_new_info.btn2_CancelSignItemClick(Sender: TObject);
var
i,iret:Integer;
isSelectAll :Boolean;
strxh,strinfo,strsql:string;
reasons:string;//ԭ<><D4AD>
begin
//״̬<D7B4><CCAC>δǩ<CEB4><C7A9><EFBFBD><EFBFBD> <20>û<EFBFBD>û<EFBFBD><C3BB>ǩ<EFBFBD>ֵ<EFBFBD>
if dxdbgrd1.SelectedCount<1 then
begin
Application.MessageBox(PChar('<27><>ѡ<EFBFBD><D1A1>Ҫȡ<D2AA><C8A1><EFBFBD><EFBFBD><EFBFBD>ᵥ!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
Exit;
end;
//begin check
isSelectAll:=False;
if(dxdbgrd1.Count =dxdbgrd1.SelectedCount) then
begin
strinfo:='ȡ<><C8A1>ȫ<EFBFBD><C8AB>ǩ<EFBFBD><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>?';
isSelectAll:=true;
end
else
strinfo:='<27><>' + IntToStr(dxdbgrd1.SelectedCount) +'<27><><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>?' ;
iret:= application.MessageBox(pchar(strinfo),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_YESNO or MB_ICONQUESTION );
if iret <> ID_YES then
Exit;
reasons:=trim(InputBox('ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ԭ<EFBFBD><D4AD>', ''));
if reasons=''then
begin
showmessage('ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
exit;
end;
reasons:=StringReplace(reasons,'''','''''',[rfReplaceAll]);
if( isSelectAll) then
begin
//<2F><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>־ <20>̽<EFBFBD><CCBD><EFBFBD> 2017-08-04
strsql:= 'INSERT INTO [dbo].[t_op_seae_sign_cancel_log] '
+' ([ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD><E1B5A5>],[ȡ<><C8A1>ԭ<EFBFBD><D4AD>],[ȡ<><C8A1><EFBFBD><EFBFBD>],[ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]) '
+'SELECT [ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD><E1B5A5>],'''+reasons +''' as ȡ<><C8A1>ԭ<EFBFBD><D4AD>,'''+employee+''' as ȡ<><C8A1><EFBFBD><EFBFBD>, getdate() as [ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] '
+' FROM [t_op_seae_sign_detail] where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''''
+ ' delete from [t_op_state] where ҵ<><D2B5>״̬=''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'' and <20><><EFBFBD><EFBFBD> '
+' in ( select <20><><EFBFBD><EFBFBD> from [t_op_seae_sign_detail] where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''');' +#13#10
+'delete from [t_op_seae_sign_detail] where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''';' +#13#10
+ 'update [t_op_seae_sign_main] set ״̬=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''';';
try
frm_main.db.BeginTrans;
frm_main.db.Execute(strsql) ;
frm_main.db.CommitTrans;
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD>Ѿ<EFBFBD>ȡ<EFBFBD><C8A1>,<2C><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><><C8B7>"<22>رմ<D8B1><D5B4><EFBFBD>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
close();
except
on E: Exception do
begin
//
ShowMessage(E.Message);
frm_main.db.RollbackTrans;
end;
end;
end
else
begin
strxh:='''-123';
for i:=0 to dxdbgrd1.SelectedCount-1 do
begin//
qry2_qdtd.GoTobookmark(pointer(dxdbgrd1.SelectedRows[i]));
strxh := strxh +''',''' + qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
strxh := strxh +'''';
try
//<2F><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>־ <20>̽<EFBFBD><CCBD><EFBFBD> 2017-08-04
strsql:= 'INSERT INTO [dbo].[t_op_seae_sign_cancel_log] '
+' ([ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD><E1B5A5>],[ȡ<><C8A1>ԭ<EFBFBD><D4AD>],[ȡ<><C8A1><EFBFBD><EFBFBD>],[ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]) '
+'SELECT [ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD><E1B5A5>],'''+reasons +''' as ȡ<><C8A1>ԭ<EFBFBD><D4AD>,'''+employee+''' as ȡ<><C8A1><EFBFBD><EFBFBD>, getdate() as [ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] '
+' FROM [t_op_seae_sign_detail] where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh + ''''
+ ' delete from [t_op_state] where ҵ<><D2B5>״̬=''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'' and <20><><EFBFBD><EFBFBD> '
+' in ('+strxh + ');' +#13#10
+ ' delete from [t_op_state] where ҵ<><D2B5>״̬=''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'' and <20><><EFBFBD><EFBFBD> in (' +strxh+ ');'
+' delete from [t_op_seae_sign_detail] where <20><><EFBFBD><EFBFBD> in ('+strxh + ');';
frm_main.db.BeginTrans;
frm_main.db.Execute(strsql) ;
frm_main.db.CommitTrans;
qry2_qdtd.Requery();
if(qry2_qdtd.Recordset<>nil) then
cxlbl20.Caption:= IntToStr(qry2_qdtd.Recordset.recordcount);
except
on E: Exception do
begin
frm_main.db.RollbackTrans;
ShowMessage(E.Message);
end;
end;
end;
end;
procedure Tfrm__op_seae_sign_new_info.UpateSeaeState(bsno,billstate:string);
var aAdoQuery:TAdoQuery;
begin
aAdoQuery:=CreateAdoQuery;
with aAdoQuery do
try
Close;SQL.Clear;
SQL.Add('Update t_op_Seae');
SQL.Add('set <20>ᵥǩ<E1B5A5><C7A9>״̬=:billstate ,ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> where <20><><EFBFBD><EFBFBD>=:bsNo');
Parameters.ParamByName('bsNo').value:=bsno;
Parameters.ParamByName('billstate').value:=billstate;
Parameters.ParamByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value:=GetDbDatetime();;
execsql;
finally
aAdoQuery.Free;
end;
end;
function Tfrm__op_seae_sign_new_info.GetClientLimited(sname:string):Boolean;
var AAdoQuery:TAdoQuery;
begin
Result:=False;
AAdoQuery:=CreateAdoQuery;
with AAdoQuery do
try
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales');
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:SName and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (''Լ<><D4BC>ʱ<EFBFBD><CAB1>'',''Լ<><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'')');
Parameters.ParamByName('SName').Value:=SName;
Open;First;
if not IsEmpty then
begin
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value<Date then
Result:=True;
end
else
Result:=True;
finally
Free;
end;
end;
//ȷ<><C8B7>ǩ<EFBFBD><C7A9>
procedure Tfrm__op_seae_sign_new_info.btn8_confirmSignoutClick(Sender: TObject);
var
zht,wtdw:string;
picfile,pdffile:string;
remotePath:string;
begin
end;
procedure Tfrm__op_seae_sign_new_info.mniN1ViewCustSignClick(Sender: TObject);
var
tmpfile:string;
begin
if qry1_qdtm.IsEmpty then exit;
try
tmpfile:=qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD>ǩ<EFBFBD><C7A9>').asstring ;
if(tmpfile='') or (not FileExists(tmpfile)) then
Exit;
ShellExecute(Handle, nil, pchar(tmpfile), nil, nil, SW_NORMAL);
except
showmessage('<27><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
end ;
end;
procedure Tfrm__op_seae_sign_new_info.mniN2_ViewInvoceSignClick(
Sender: TObject);
var
tmpfile:string;
begin
//
if qry1_qdtm.IsEmpty then exit;
try
tmpfile:=qry1_qdtm.fieldbyname('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>').asstring ;
if(tmpfile='') or (not FileExists(tmpfile)) then
Exit;
ShellExecute(Handle, nil, pchar(tmpfile), nil, nil, SW_NORMAL);
except
showmessage('<27><><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
end ;
end;
procedure Tfrm__op_seae_sign_new_info.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
//
qry1_qdtm.Close;
qry2_qdtd.Close;
end;
procedure Tfrm__op_seae_sign_new_info.FormDestroy(Sender: TObject);
begin
if Self=frm__op_seae_sign_new_info then
frm__op_seae_sign_new_info := nil;
end;
procedure Tfrm__op_seae_sign_new_info.dxdbgrd1CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
if ANode.Index mod 2=0 then
AColor:= cl3DLight;
if (not qry1_qdtm.IsEmpty) and ( not qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').IsNull) and ( qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').AsBoolean) then
AFont.Color:=clGreen;
end;
procedure Tfrm__op_seae_sign_new_info.dxdbgrd1Column11CustomDraw(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
var
SS:Double;
begin
SS:=StrToFloatDef(ANode.strings[dxdbgrd1Column11.Index],0);
if (SS=0) then
AFont.Color:=clred;
end;
procedure Tfrm__op_seae_sign_new_info.dxdbgrd1Column12CustomDraw(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
var
SS:Double;
begin
SS:=StrToFloatDef(ANode.strings[dxdbgrd1Column12.Index],0);
if (SS=0) then
AFont.Color:=clred;
end;
end.