|
|
|
|
unit u_op_seae_sign_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,DateUtils, cxTextEdit, cxDBEdit,
|
|
|
|
|
cxMaskEdit, cxDropDownEdit, cxCalendar, cxCheckBox;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_op_seae_sign_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;
|
|
|
|
|
dxdbgrdclmndxdbgrd1dxdbgrdclmn1: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmndxdbgrd1dxdbgrdclmn2: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmndxdbgrd1dxdbgrdclmn3: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmndxdbgrd1dxdbgrdclmn4: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmndxdbgrd1dxdbgrdclmn5: TdxDBGridColumn;
|
|
|
|
|
bsknpnl3: TbsSkinPanel;
|
|
|
|
|
btn8: TbsSkinButton;
|
|
|
|
|
btn9_mailSend: TbsSkinButton;
|
|
|
|
|
btn5_sign: TbsSkinButton;
|
|
|
|
|
btn11: TbsSkinButton;
|
|
|
|
|
ds1_qdtm: TDataSource;
|
|
|
|
|
ds2_qdtd: TDataSource;
|
|
|
|
|
qry2_qdtd: TADOQuery;
|
|
|
|
|
qry1_qdtm: TADOQuery;
|
|
|
|
|
btn3_custprint: TbsSkinButton;
|
|
|
|
|
btn9_exit: TbsSkinButton;
|
|
|
|
|
btn3_notify: TbsSkinButton;
|
|
|
|
|
btn5_signout: TbsSkinButton;
|
|
|
|
|
img1: TImage;
|
|
|
|
|
cxlbl18: TcxLabel;
|
|
|
|
|
cxlbl19: TcxLabel;
|
|
|
|
|
btn8_confirmsign: TbsSkinButton;
|
|
|
|
|
btn10_viewsign: TbsSkinButton;
|
|
|
|
|
bsknpnl8: TbsSkinPanel;
|
|
|
|
|
shp7: TShape;
|
|
|
|
|
shp6: TShape;
|
|
|
|
|
shp5: TShape;
|
|
|
|
|
shp4: TShape;
|
|
|
|
|
shp3: TShape;
|
|
|
|
|
shp2: TShape;
|
|
|
|
|
shp1: TShape;
|
|
|
|
|
bskndbtxt3: TbsSkinDBText;
|
|
|
|
|
bskndbtxt4: TbsSkinDBText;
|
|
|
|
|
bskndbtxt5: TbsSkinDBText;
|
|
|
|
|
bskndbtxtd: TbsSkinDBText;
|
|
|
|
|
bskndbtxt6: TbsSkinDBText;
|
|
|
|
|
cxlbl9: TcxLabel;
|
|
|
|
|
cxlbl10: TcxLabel;
|
|
|
|
|
cxlbl11: TcxLabel;
|
|
|
|
|
cxlbl12: TcxLabel;
|
|
|
|
|
cxlbl13: TcxLabel;
|
|
|
|
|
cxlbl14: TcxLabel;
|
|
|
|
|
cxlbl15: TcxLabel;
|
|
|
|
|
iwbpdfdtr1: TiWebPDFEditor;
|
|
|
|
|
lbl1_signtip: TLabel;
|
|
|
|
|
btn2_CancelSignItem: TbsSkinButton;
|
|
|
|
|
dxdbgrdchckclmndxdbgrd1dxdbgrdchckclmn6: 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;
|
|
|
|
|
btn8_confirmSignout: TbsSkinButton;
|
|
|
|
|
dxdbgrd1: TdxDBGrid;
|
|
|
|
|
shp8: TShape;
|
|
|
|
|
cxdbtxtdt1: TcxDBTextEdit;
|
|
|
|
|
cxlbl17: TcxLabel;
|
|
|
|
|
cxdbtxtdt2: TcxDBTextEdit;
|
|
|
|
|
cxlbl16_tf: TcxLabel;
|
|
|
|
|
cxdbchckbx1_tf: TcxDBCheckBox;
|
|
|
|
|
cxdbdtdt1_tf: TcxDBDateEdit;
|
|
|
|
|
lbl1: TLabel;
|
|
|
|
|
cxlbl16: TcxLabel;
|
|
|
|
|
cxlbl20: TcxLabel;
|
|
|
|
|
dxdbgrdclmndxdbgrd1Column7: TdxDBGridColumn;
|
|
|
|
|
cxlbl21: TcxLabel;
|
|
|
|
|
bskndbtxt1: TbsSkinDBText;
|
|
|
|
|
dxdbgrdclmndxdbgrd1Column8: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmn9_usd: TdxDBGridColumn;
|
|
|
|
|
dxdbgrdclmn10_rmb: TdxDBGridColumn;
|
|
|
|
|
cxlbl22: TcxLabel;
|
|
|
|
|
bskndbtxt7: TbsSkinDBText;
|
|
|
|
|
dxdbgrd1Column11: TdxDBGridColumn;
|
|
|
|
|
dxdbgrd1Column12: TdxDBGridColumn;
|
|
|
|
|
bsSkinDBText1: TbsSkinDBText;
|
|
|
|
|
cxLabel1: TcxLabel;
|
|
|
|
|
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 btn5_signoutClick(Sender: TObject);
|
|
|
|
|
procedure btn5_signClick(Sender: TObject);
|
|
|
|
|
procedure iwbpdfdtr1SignFinish(Sender: TObject;
|
|
|
|
|
const bSucceed: WideString);
|
|
|
|
|
procedure btn8_confirmsignClick(Sender: TObject);
|
|
|
|
|
procedure btn10_viewsignClick(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_isTF_Ok:BOOL;
|
|
|
|
|
m_infomation:string;
|
|
|
|
|
m_isPJ:Boolean;//<2F>Ƿ<EFBFBD>Ʊ<EFBFBD><C6B1>
|
|
|
|
|
m_reportname:string;
|
|
|
|
|
procedure CreateSignOcx();
|
|
|
|
|
function GetNotieState():Boolean;
|
|
|
|
|
function CheckIsAllCeckout():Boolean;
|
|
|
|
|
function CheckBilldue():Boolean;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
procedure signletterSateDeal(signStage:string);
|
|
|
|
|
function signoutSateDeal(wtdw:string):Boolean;
|
|
|
|
|
//
|
|
|
|
|
function signoutSateDeal2(wtdw:string):Boolean;
|
|
|
|
|
procedure show_qdtxx (qdtbh:string;iway:Integer);
|
|
|
|
|
procedure UpateSeaeState(bsno,billstate:string);
|
|
|
|
|
function GetClientLimited(sname:string):Boolean;
|
|
|
|
|
//<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|
|
|
|
function gettmpzqdate(cust: string ):string;
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
procedure InitialUserinfo(qdtbh:string;iway:Integer);
|
|
|
|
|
procedure SigninfoShow();
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_op_seae_sign_info: Tfrm_op_seae_sign_info;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
uses my_sys_function, u_main, 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_info.CheckBilldue():Boolean;
|
|
|
|
|
var
|
|
|
|
|
FeeItems:string;
|
|
|
|
|
amt,usd:Double;
|
|
|
|
|
bh,wtdw,tdh,jflx:string;
|
|
|
|
|
bkmark:TBookmark;
|
|
|
|
|
aquery:TADOQuery;
|
|
|
|
|
str:string;
|
|
|
|
|
usd_this,rmb_this:Double;
|
|
|
|
|
strlszq:string;//<2F><>ʱ<EFBFBD><CAB1><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 ;
|
|
|
|
|
|
|
|
|
|
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD> <20><>ѭ<EFBFBD><D1AD>,ֻ<>жϵ<D0B6>һ<EFBFBD><D2BB>
|
|
|
|
|
|
|
|
|
|
bh:= qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
tdh:=qry2_qdtd.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString;
|
|
|
|
|
//jflx:= qry1_qdtm.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring; //qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
jflx:= getzqlx(wtdw,False);
|
|
|
|
|
if(jflx='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>')then
|
|
|
|
|
begin
|
|
|
|
|
strlszq:=gettmpzqdate(wtdw);
|
|
|
|
|
if( strlszq<>'') then
|
|
|
|
|
begin
|
|
|
|
|
jflx:='<27><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>';
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if (jflx='') or (jflx='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') or (jflx='<27>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
|
|
begin
|
|
|
|
|
// bhû<68><C3BB><EFBFBD><EFBFBD>
|
|
|
|
|
if GetCrmsales(bh,wtdw,jflx,amt,usd,FeeItems) then
|
|
|
|
|
begin
|
|
|
|
|
//<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪƱ<CEAA><C6B1>
|
|
|
|
|
m_infomation:= m_infomation+ 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><C7B7>' +#13#10 ;
|
|
|
|
|
Result:=False;
|
|
|
|
|
end ;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//bhû<68><C3BB><EFBFBD><EFBFBD>
|
|
|
|
|
if GetCrmsales(bh,wtdw,jflx,amt,usd,FeeItems) then
|
|
|
|
|
begin
|
|
|
|
|
m_infomation:= m_infomation+ 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);
|
|
|
|
|
Result:=False;
|
|
|
|
|
//Break;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
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
|
|
|
|
|
//Ʊ<><C6B1>Ƿ<EFBFBD><C7B7><EFBFBD>ж<EFBFBD>
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ƿ<EFBFBD>Ѷ<EFBFBD>Ҫ<EFBFBD><D2AA>ʾÿƱ<C3BF><C6B1><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----from <20>ų<EFBFBD>Դ 2017-08-08
|
|
|
|
|
aquery:=CreateAdoQuery();
|
|
|
|
|
str:='select sum(Ӧ<><D3A6>USD-<2D><><EFBFBD><EFBFBD>USD ) as USD,sum(Ӧ<><D3A6>RMB-<2D><><EFBFBD><EFBFBD>RMB) as RMB from t_op_gain '
|
|
|
|
|
+'where <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae_sign_detail where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''%s'');';
|
|
|
|
|
with aquery do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
SQL.Add(Format(str,[m_qdtbh])) ;
|
|
|
|
|
open();
|
|
|
|
|
if(not isempty) then
|
|
|
|
|
begin
|
|
|
|
|
usd_this:=fieldbyname('USD').AsFloat;
|
|
|
|
|
rmb_this:=fieldbyname('RMB').AsFloat;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
if(rmb_this+ usd_this)>0 then
|
|
|
|
|
m_infomation:= m_infomation+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ƿ<EFBFBD><C7B7>'+'<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>Ϊ:'+FormatFloat('0.00;0.00;0',usd_this)
|
|
|
|
|
+ '<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>Ϊ:' +FormatFloat('0.00;0.00;0',rmb_this) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_info.InitialUserinfo(qdtbh:string;iway:Integer);
|
|
|
|
|
begin
|
|
|
|
|
m_qdtbh:=qdtbh;
|
|
|
|
|
m_iway:=iway;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.SigninfoShow();
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
m_infomation:='';
|
|
|
|
|
if not Assigned( frm_op_seae_sign_info) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae_sign_info:= Tfrm_op_seae_sign_info.Create(self);
|
|
|
|
|
end;
|
|
|
|
|
frm_op_seae_sign_info.ShowModal();
|
|
|
|
|
end;
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.show_qdtxx (qdtbh:string;iway:Integer);
|
|
|
|
|
var
|
|
|
|
|
qdtzht,picpath:string;
|
|
|
|
|
cancancel:Boolean;
|
|
|
|
|
itmp:Integer;
|
|
|
|
|
begin
|
|
|
|
|
// CreateSignOcx();
|
|
|
|
|
m_isNewSign:=False;
|
|
|
|
|
btn5_sign.enabled:=false;
|
|
|
|
|
btn8_confirmsign.Enabled:=false;
|
|
|
|
|
btn3_notify.enabled:=false;
|
|
|
|
|
m_qdtbh:=qdtbh;
|
|
|
|
|
qry1_qdtm.Parameters.ParamByName('qdtbh').value:=qdtbh;
|
|
|
|
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>Ϊfalse
|
|
|
|
|
m_isTF_Ok:=False;
|
|
|
|
|
//pj 2017-08-03
|
|
|
|
|
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 (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;
|
|
|
|
|
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;
|
|
|
|
|
//ȡ<><C8A1>ǩ<EFBFBD><C7A9><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
qdtzht:= qry1_qdtm.fieldbyname('״̬').AsString;
|
|
|
|
|
if (qry1_qdtm.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime<Date) and (qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') then begin
|
|
|
|
|
|
|
|
|
|
qdtzht:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
if not (qry1_qdtm.State in [dsedit,dsinsert]) then
|
|
|
|
|
qry1_qdtm.edit;
|
|
|
|
|
qry1_qdtm.fieldbyname('״̬').AsString:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
qry1_qdtm.Post;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
btn2_CancelSignItem.Enabled:=false;
|
|
|
|
|
//or (qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>') <20><><EFBFBD><EFBFBD>ǩ<EFBFBD>ֺ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ᵥ <20>̽<EFBFBD><CCBD><EFBFBD> 2017-08-04
|
|
|
|
|
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;
|
|
|
|
|
if (cancancel=True) then
|
|
|
|
|
btn2_CancelSignItem.Enabled:=True;
|
|
|
|
|
|
|
|
|
|
//ǰ̨
|
|
|
|
|
if(iway=3)then
|
|
|
|
|
begin
|
|
|
|
|
btn5_sign.enabled:=True;
|
|
|
|
|
btn8_confirmsign.enabled:=True;
|
|
|
|
|
if(qdtzht='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
Exit;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<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
|
|
|
|
|
//
|
|
|
|
|
itmp:=DaysBetween(StrToDate(formatdatetime('yyyy-MM-dd',GetDbDatetime)),StrToDate(formatdatetime('yyyy-MM-dd',qry1_qdtm.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime)));
|
|
|
|
|
if( itmp >1) then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ɾ<EFBFBD><C9BE>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>!'),pchar('<27><>Ϣ<EFBFBD><CFA2>ʾ')
|
|
|
|
|
,MB_ICONINFORMATION);
|
|
|
|
|
btn5_sign.Enabled:=False;
|
|
|
|
|
btn8_confirmsign.Enabled:=False;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
m_isTF_Ok:=true; //<2F><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ok
|
|
|
|
|
btn5_sign.Enabled:=true;
|
|
|
|
|
btn8_confirmsign.Enabled:=true;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
cxdbchckbx1_tf.Visible:=True;
|
|
|
|
|
cxlbl16_tf.Visible:=True;
|
|
|
|
|
cxdbdtdt1_tf.Visible:=True;
|
|
|
|
|
end
|
|
|
|
|
else if (m_isPJ) then
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>طŵ<D8B7>
|
|
|
|
|
begin
|
|
|
|
|
if CheckIsAllCeckout() then
|
|
|
|
|
begin
|
|
|
|
|
if(qdtzht<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
|
|
|
|
|
btn5_sign.Enabled:=True;
|
|
|
|
|
btn8_confirmsign.Enabled:=True;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('Ʊ<><C6B1>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δǩ<CEB4><C7A9><EFBFBD><EFBFBD><EFBFBD>ᵥ,<2C><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD>ᵥ!');
|
|
|
|
|
btn5_sign.Enabled:=False;
|
|
|
|
|
btn8_confirmsign.Enabled:=False;
|
|
|
|
|
end;
|
|
|
|
|
cxdbchckbx1_tf.Visible:=false;
|
|
|
|
|
cxlbl16_tf.Visible:=false;
|
|
|
|
|
cxdbdtdt1_tf.Visible:=false;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
// <20><><EFBFBD><EFBFBD>
|
|
|
|
|
if(iway=31) then
|
|
|
|
|
begin
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD> <20>ͻ<EFBFBD>ǩ<EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
btn5_sign.Enabled:=false;
|
|
|
|
|
btn8_confirmsign.Enabled:=False;
|
|
|
|
|
//
|
|
|
|
|
btn5_signout.Enabled :=true;
|
|
|
|
|
btn8_confirmSignout.Enabled:=True;
|
|
|
|
|
//btn5_signout
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//<2F><><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
btn5_signout.Enabled:=false;
|
|
|
|
|
btn8_confirmSignout.Enabled:=False;
|
|
|
|
|
end;
|
|
|
|
|
if(not qry1_qdtm.eof) then
|
|
|
|
|
begin
|
|
|
|
|
if m_iway=31 then
|
|
|
|
|
begin
|
|
|
|
|
picpath :=qry1_qdtm.fieldbyname('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>ͼƬ').AsString;
|
|
|
|
|
if (not qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').IsNull) and ( qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').AsBoolean) then
|
|
|
|
|
begin
|
|
|
|
|
itmp:= strtoint(formatdatetime('yyyyMMdd',GetDbDatetime))
|
|
|
|
|
-strtoint(formatdatetime('yyyyMMdd',qry1_qdtm.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime));
|
|
|
|
|
if( itmp >1) then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ɾ<EFBFBD><C9BE>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>!'),pchar('<27><>Ϣ<EFBFBD><CFA2>ʾ')
|
|
|
|
|
,MB_ICONINFORMATION);
|
|
|
|
|
btn8_confirmSignout.Enabled:=False;
|
|
|
|
|
btn5_signout.Enabled:=False;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
m_isTF_Ok:=true; //<2F><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ok
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
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;
|
|
|
|
|
lbl1_signtip.Caption:='';
|
|
|
|
|
if(qry2_qdtd.Recordset<>nil) then
|
|
|
|
|
cxlbl20.Caption:= IntToStr(qry2_qdtd.Recordset.recordcount);
|
|
|
|
|
end;
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
//grid_save_xls(dxdbgrid1);
|
|
|
|
|
/// <summary>
|
|
|
|
|
end;
|
|
|
|
|
/// <20>趨<EFBFBD><E8B6A8>ʽ
|
|
|
|
|
/// </summary>
|
|
|
|
|
procedure Tfrm_op_seae_sign_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_info.FormShow(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
Width:=width-1;
|
|
|
|
|
m_newCWfilename:='';
|
|
|
|
|
show_qdtxx(m_qdtbh,m_iway);
|
|
|
|
|
end;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ֱ<>Ӵ<EFBFBD>ӡ
|
|
|
|
|
/// </summary>
|
|
|
|
|
procedure Tfrm_op_seae_sign_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_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_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 + '''; ';
|
|
|
|
|
}
|
|
|
|
|
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+ ''' ) ) ; ';
|
|
|
|
|
|
|
|
|
|
strsjr:='';
|
|
|
|
|
aQuery:=CreateAdoQuery();
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
close;sql.Clear;
|
|
|
|
|
SQL.Add(str);
|
|
|
|
|
Open;
|
|
|
|
|
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) ;
|
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
aQuery.Close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
procedure Tfrm_op_seae_sign_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_info.GetNotieState():Boolean;
|
|
|
|
|
var
|
|
|
|
|
qdtzht:string;
|
|
|
|
|
amt:Double;
|
|
|
|
|
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;
|
|
|
|
|
qry2_qdtd.First;
|
|
|
|
|
while not qry2_qdtd.Eof do begin
|
|
|
|
|
amt:=amt+qry2_qdtd.fieldbyname('usd').AsFloat+qry2_qdtd.fieldbyname('rmb').AsFloat;
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
end;
|
|
|
|
|
if (amt=0) then Result:=True;
|
|
|
|
|
|
|
|
|
|
//<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_info.CheckIsAllCeckout():Boolean;
|
|
|
|
|
var
|
|
|
|
|
aquery:TADOQuery;
|
|
|
|
|
qdtbh,qdtzht,sqlstr:string;
|
|
|
|
|
isnoqf:BOOL;
|
|
|
|
|
amt:Double;
|
|
|
|
|
begin
|
|
|
|
|
Result:=False;
|
|
|
|
|
isnoqf:=False;
|
|
|
|
|
qry2_qdtd.First;
|
|
|
|
|
while not qry2_qdtd.Eof do begin
|
|
|
|
|
amt:=amt+qry2_qdtd.fieldbyname('usd').AsFloat+qry2_qdtd.fieldbyname('rmb').AsFloat;
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
end;
|
|
|
|
|
if (amt=0) then isnoqf:=True;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(not qry1_qdtm.Eof) then
|
|
|
|
|
begin
|
|
|
|
|
qdtzht:= qry1_qdtm.FieldByName('״̬').AsString;
|
|
|
|
|
if(qdtzht='ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>') or (isnoqf) 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>') or (qdtzht='<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>') 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_info.btn3_notifyClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
zht,strsql: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();
|
|
|
|
|
strsql:='INSERT INTO [dbo].[t_op_state]([<5B><><EFBFBD><EFBFBD>],[ҵ<><D2B5>״̬],[¼<><C2BC><EFBFBD><EFBFBD>] ,[¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] ) '
|
|
|
|
|
+'select <20><><EFBFBD><EFBFBD> ,''֪ͨǩ<D6AA><C7A9>'' as ҵ<><D2B5>״̬,'''+ employee +''' as ¼<><C2BC><EFBFBD><EFBFBD> ,GETDATE() ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from'
|
|
|
|
|
+' (select <20><><EFBFBD><EFBFBD> from t_op_seae_sign_detail d where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+ m_qdtbh +''''
|
|
|
|
|
+' and not exists (select <20><><EFBFBD><EFBFBD> from [t_op_state] where ҵ<><D2B5>״̬=''֪ͨǩ<D6AA><C7A9>'' and <20><><EFBFBD><EFBFBD>= d.<2E><><EFBFBD><EFBFBD> )) v;';
|
|
|
|
|
frm_main.db.Execute(strsql);
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
|
|
application.MessageBox(PChar('ǩ<><C7A9><EFBFBD><EFBFBD>֪ͨ<CDA8>ѷ<EFBFBD><D1B7><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
|
|
|
|
|
|
|
|
|
|
qry1_qdtm.Requery();
|
|
|
|
|
btn3_notify.Enabled:=False;
|
|
|
|
|
except
|
|
|
|
|
on E: Exception do
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage(E.Message);
|
|
|
|
|
qry1_qdtm.Cancel;
|
|
|
|
|
frm_main.db.rollbacktrans;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ǩ<>ָ<EFBFBD><D6B8><EFBFBD>״̬
|
|
|
|
|
/// </summary>
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.signletterSateDeal(signStage:string);
|
|
|
|
|
var
|
|
|
|
|
FeeItems:string;
|
|
|
|
|
amt,usd:Double;
|
|
|
|
|
tdh,bh:string;
|
|
|
|
|
i:Integer;
|
|
|
|
|
dbtime:TDateTime;
|
|
|
|
|
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;
|
|
|
|
|
bh:= qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
if (not GetStatus(bh,signStage))
|
|
|
|
|
then
|
|
|
|
|
begin
|
|
|
|
|
dbtime:=GetDbDatetime();
|
|
|
|
|
InsertSeaeStatus(bh,signStage,employee,FormatDateTime('yyyy-mm-dd hh:mm:ss',dbtime));//FormatDateTime('YYYY-MM-DD',Now));
|
|
|
|
|
if(signStage='<27>ᵥǩ<E1B5A5><C7A9>') then
|
|
|
|
|
begin
|
|
|
|
|
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD',dbtime));
|
|
|
|
|
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬ no use
|
|
|
|
|
/// </summary>
|
|
|
|
|
function Tfrm_op_seae_sign_info.signoutSateDeal2(wtdw:string):Boolean;
|
|
|
|
|
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
|
|
|
|
|
result:=true;
|
|
|
|
|
reasons:='';
|
|
|
|
|
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
|
|
|
|
|
bh :=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
if not GetStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>') then
|
|
|
|
|
begin
|
|
|
|
|
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;
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬ no use
|
|
|
|
|
/// </summary>
|
|
|
|
|
function Tfrm_op_seae_sign_info.signoutSateDeal(wtdw:string):Boolean;
|
|
|
|
|
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>
|
|
|
|
|
infoFY:string;
|
|
|
|
|
i:Integer;
|
|
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
|
|
aAdoQueryFY:TAdoQuery;
|
|
|
|
|
rmbFY,usdFY:Double;
|
|
|
|
|
dbtime:TDateTime;
|
|
|
|
|
begin
|
|
|
|
|
result:=true;
|
|
|
|
|
qry2_qdtd.first;
|
|
|
|
|
jflx:= qry1_qdtm.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString; //qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;//ȡ<><C8A1>һ<EFBFBD><D2BB>
|
|
|
|
|
infoFY:='';
|
|
|
|
|
//1.<2E><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>,δ<><CEB4><EFBFBD><EFBFBD>
|
|
|
|
|
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>');
|
|
|
|
|
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//**b
|
|
|
|
|
//2.<2E><>ǩ<EFBFBD>ͻ<EFBFBD>,"<22><><EFBFBD><EFBFBD>"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
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>');
|
|
|
|
|
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
aAdoQueryFY:=CreateAdoQuery();
|
|
|
|
|
with aAdoQueryFY do
|
|
|
|
|
begin
|
|
|
|
|
Close;Sql.Clear;
|
|
|
|
|
SQL.Add(' select ');
|
|
|
|
|
SQL.Add('SUM(CASE <20><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case <20>ұ<EFBFBD> when ''USD'' then <20><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as USD ');
|
|
|
|
|
SQL.Add(' , SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case <20>ұ<EFBFBD> when ''RMB'' then <20><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as RMB ');
|
|
|
|
|
SQL.Add(' From t_ch_fee ');
|
|
|
|
|
SQL.Add(' where <20><><EFBFBD><EFBFBD> in ( ');
|
|
|
|
|
SQL.Add(' select <20><><EFBFBD><EFBFBD> From t_op_seae 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 + ''') ');
|
|
|
|
|
SQL.Add(' ) and <20><><EFBFBD><EFBFBD>=''<27><>'' and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''Ӷ<><D3B6>'') ');
|
|
|
|
|
Open;
|
|
|
|
|
rmbFY:=FieldByName('RMB').AsFloat;
|
|
|
|
|
usdFY:=FieldByName('USD').AsFloat;
|
|
|
|
|
if (rmbFY<>0) or (usdFY<>0) then
|
|
|
|
|
infoFY:='RMB:'+FormatFloat('0.00;-0.00;0',rmbFY)+' '+'USD:'+FormatFloat('0.00;-0.00;0',usdFY);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
//bh <20><><EFBFBD><EFBFBD>δʹ<CEB4><CAB9>
|
|
|
|
|
if GetCrmsales(bh,m_wtdw,jflx,amt,usd,FeeItems) then
|
|
|
|
|
begin
|
|
|
|
|
//JobAmt:=GetCrmpjAmt(bh); //<2F><>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
JobAmt:=infoFY;
|
|
|
|
|
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>');
|
|
|
|
|
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
|
|
|
|
// exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//JobAmt:=GetCrmpjAmt(bh); //<2F><>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
JobAmt:=infoFY;
|
|
|
|
|
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>');
|
|
|
|
|
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
|
|
|
|
//exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
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>ȷ<EFBFBD><C8B7>ǩ<EFBFBD><C7A9>!');
|
|
|
|
|
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> in( select <20><><EFBFBD><EFBFBD> from t_op_seae_sign_detail where ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''
|
|
|
|
|
+m_qdtbh +''') ');
|
|
|
|
|
ExecSQL;
|
|
|
|
|
result:=false;
|
|
|
|
|
exit;
|
|
|
|
|
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>');
|
|
|
|
|
reasons:=trim(InputBox('ԭ<><D4AD>', 'ԭ<><D4AD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'));
|
|
|
|
|
// exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end ;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
dbtime:=GetDbDatetime;
|
|
|
|
|
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
|
|
|
|
|
bh :=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
if not GetStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>') then
|
|
|
|
|
begin
|
|
|
|
|
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('yyyy-mm-dd hh:mm:ss',dbtime),reasons);
|
|
|
|
|
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',dbtime));
|
|
|
|
|
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
|
|
|
|
|
end;
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ǩ<><C7A9><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>
|
|
|
|
|
/// </summary>
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.btn5_signoutClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
zht,wtdw:string;
|
|
|
|
|
strpath:string;
|
|
|
|
|
oldfilename:string;
|
|
|
|
|
msg:Integer;
|
|
|
|
|
pzt:WideString;
|
|
|
|
|
i1:Integer;
|
|
|
|
|
i2:Integer;
|
|
|
|
|
i3:Integer;
|
|
|
|
|
i4:Integer;
|
|
|
|
|
i5:Integer;
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
Exit;
|
|
|
|
|
//<2F><>Ϊǰ̨<C7B0><CCA8><EFBFBD><EFBFBD> from 2017-08-08
|
|
|
|
|
{
|
|
|
|
|
if(m_isTF_Ok) 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>='''+ m_wtdw +'''');
|
|
|
|
|
open;
|
|
|
|
|
if not IsEmpty then begin
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
|
|
if MessageDlg(m_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+'ȷʵҪ<CAB5>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
|
|
|
|
|
begin
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if(CheckBilldue=false) then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if(CheckBilldue=false) then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
m_infomation:='';
|
|
|
|
|
if(m_isTF_Ok=false)then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5>Ľ<EFBFBD><C4BD>к<EFBFBD><D0BA><EFBFBD><EFBFBD>ж<EFBFBD>
|
|
|
|
|
if (CheckBilldue()=False) then
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰǩ<C7B0><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
lbl1_signtip.Caption:='';
|
|
|
|
|
strpath:= GetWinTempPath() ;
|
|
|
|
|
oldfilename:= strpath+ 'cwsout111.PDF' ;
|
|
|
|
|
m_newCWfilename := strpath+m_qdtbh+'_cwsign'+ IntToStr(Random(10))+ '.PDF' ;
|
|
|
|
|
sys_frprintFile(m_reportname,'PDF',ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil,True,'',nil,nil,oldfilename);
|
|
|
|
|
deletefile(m_newCWfilename);
|
|
|
|
|
CopyFile(pchar(oldfilename), PChar(m_newCWfilename),true);
|
|
|
|
|
iwbpdfdtr1.LoadFromFile(m_newCWfilename);
|
|
|
|
|
pzt:= '598*94' ; //<2F><><EFBFBD><EFBFBD> 598*94=21*28.5,4*28.5
|
|
|
|
|
//pzt:= '342*102' ; //<2F><><EFBFBD><EFBFBD> 12cm=342,5=142
|
|
|
|
|
i1:=1;
|
|
|
|
|
i2:=1;
|
|
|
|
|
i3:=0;
|
|
|
|
|
i4:=100;
|
|
|
|
|
i5:=80;
|
|
|
|
|
msg := iwbpdfdtr1.HandSignAtTouchMonitor(i1,i2,i3,pzt, i4, i5);
|
|
|
|
|
//msg := iwbpdfdtr1.HandSignAtTouchMonitorPfx(pzt,1,3,0,'120*420',50,60);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.btn5_signClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
strpath:string;
|
|
|
|
|
oldfilename:string;
|
|
|
|
|
msg:Integer;
|
|
|
|
|
pzt:WideString;
|
|
|
|
|
i1:Integer;
|
|
|
|
|
i2:Integer;
|
|
|
|
|
i3:Integer;
|
|
|
|
|
i4:Integer;
|
|
|
|
|
i5:Integer;
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
m_infomation:='';
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ǰ̨У<CCA8><D0A3>
|
|
|
|
|
{
|
|
|
|
|
if(m_isTF_Ok=false)then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5>Ľ<EFBFBD><C4BD>к<EFBFBD><D0BA><EFBFBD><EFBFBD>ж<EFBFBD>
|
|
|
|
|
if (CheckBilldue()=False) then
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰǩ<C7B0><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
//<2F><>Ϊǰ̨<C7B0><CCA8><EFBFBD><EFBFBD> from 2017-08-08
|
|
|
|
|
if(qry1_qdtm.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').isnull) or (qry1_qdtm.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'Ʊ<><C6B1>' ) then
|
|
|
|
|
begin
|
|
|
|
|
// <20>ط<EFBFBD>b
|
|
|
|
|
if(m_isTF_Ok) 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>='''+ m_wtdw +'''');
|
|
|
|
|
open;
|
|
|
|
|
if not IsEmpty then begin
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>').AsString='<27><>' then begin
|
|
|
|
|
if MessageDlg(m_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+'ȷʵҪǩ<D2AA><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
|
|
|
|
|
begin
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if(CheckBilldue=false) then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if(CheckBilldue=false) then //<2F>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
//<2F>ط<EFBFBD>e
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//<2F>½<EFBFBD><C2BD>ͻ<EFBFBD> b
|
|
|
|
|
if (CheckBilldue()=False) then
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰǩ<C7B0><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
//<2F>½<EFBFBD><C2BD>ͻ<EFBFBD> e
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
lbl1_signtip.Caption:='';
|
|
|
|
|
strpath:= GetWinTempPath() ;
|
|
|
|
|
oldfilename:= strpath+ '111.PDF' ;
|
|
|
|
|
m_newfilename := strpath+m_qdtbh+'_'+ IntToStr(Random(10))+ '.PDF' ;
|
|
|
|
|
sys_frprintFile(m_reportname,'PDF',ds1_qdtm,ds2_qdtd,nil,nil,nil,nil,nil,nil,nil,nil,nil,True,'',nil,nil,oldfilename);
|
|
|
|
|
deletefile(m_newfilename);
|
|
|
|
|
CopyFile(pchar(oldfilename), PChar(m_newfilename),true);
|
|
|
|
|
iwbpdfdtr1.LoadFromFile(m_newfilename);
|
|
|
|
|
pzt:= '598*94' ; //<2F><><EFBFBD><EFBFBD> 598*94=21*28.5,4*28.5
|
|
|
|
|
//pzt:= '342*102' ; //<2F><><EFBFBD><EFBFBD> 12cm=342,5=142
|
|
|
|
|
i1:=1;
|
|
|
|
|
i2:=1;
|
|
|
|
|
i3:=0;
|
|
|
|
|
i4:=100;
|
|
|
|
|
i5:=80;
|
|
|
|
|
//iwbpdfdtr1.PDFRotate(90);
|
|
|
|
|
msg := iwbpdfdtr1.HandSignAtTouchMonitor(i1,i2,i3,pzt, i4, i5);
|
|
|
|
|
//msg := iwbpdfdtr1.HandSignAtTouchMonitorPfx(pzt,1,3,0,'120*420',50,80);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.iwbpdfdtr1SignFinish(Sender: TObject;
|
|
|
|
|
const bSucceed: WideString);
|
|
|
|
|
begin
|
|
|
|
|
//mmo1.Text:= iwbpdfdtr1.GetTouchMonitorImageBASE64();
|
|
|
|
|
img1.Picture.Bitmap:= StringToBitmap(iwbpdfdtr1.GetTouchMonitorImageBASE64());
|
|
|
|
|
img1.Visible:=True;
|
|
|
|
|
iwbpdfdtr1.Save();
|
|
|
|
|
iwbpdfdtr1.CloseRead();
|
|
|
|
|
m_isNewSign:=True;
|
|
|
|
|
if(m_iway=31) then
|
|
|
|
|
begin
|
|
|
|
|
btn8_confirmSignout.Enabled:=True;
|
|
|
|
|
lbl1_signtip.Caption:='ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>ǩ<EFBFBD><C7A9>!';
|
|
|
|
|
application.MessageBox(PChar('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
//Ĭ<><C4AC><EFBFBD><EFBFBD>ǰ̨
|
|
|
|
|
lbl1_signtip.Caption:='ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>ǩ<EFBFBD><C7A9>!';
|
|
|
|
|
application.MessageBox(PChar('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>ǩ<EFBFBD>ֽ<EFBFBD><D6BD>б<EFBFBD><D0B1><EFBFBD>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.btn8_confirmsignClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
pdffile,picfile:string;
|
|
|
|
|
remotePath:string;
|
|
|
|
|
begin
|
|
|
|
|
if m_newfilename='' then
|
|
|
|
|
begin
|
|
|
|
|
application.MessageBox(PChar('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ') ;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
remotePath:=get_parameters_value(175,'\\223.223.95.160\data')+'\custsign';
|
|
|
|
|
//remotePath:='\\dev000\custsign';
|
|
|
|
|
//remotePath:='\\X6x8-20170109nn\<5C><><EFBFBD>Դ洢<D4B4>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
// UpLoadCustSignFile
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if(m_iway=31) then
|
|
|
|
|
begin
|
|
|
|
|
picfile:= copy(m_newfilename,0, length(m_newfilename) - 3)+'bmp';
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
picfile:= copy(m_newfilename,0, length(m_newfilename) - 3)+'bmp';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
img1.Picture.SaveToFile(picfile);
|
|
|
|
|
UpLoadCustSignFile(m_newfilename,picfile ,remotePath,'user','user',m_qdtbh,m_iway);
|
|
|
|
|
signletterSateDeal('<27>ᵥǩ<E1B5A5><C7A9>') ;
|
|
|
|
|
signletterSateDeal('<27>ᵥǩ<E1B5A5><C7A9>');
|
|
|
|
|
application.MessageBox(PChar('ȷ<><C8B7>ǩ<EFBFBD>ֳɹ<D6B3>,ǩ<><C7A9><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
|
|
|
|
|
close();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.btn10_viewsignClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
//
|
|
|
|
|
//<2F>鿴ǩ<E9BFB4><C7A9>
|
|
|
|
|
tmpfile:string ;
|
|
|
|
|
begin
|
|
|
|
|
if m_isNewSign= True then
|
|
|
|
|
begin
|
|
|
|
|
if(m_iway=31) then
|
|
|
|
|
ShellExecute(Handle, nil, pchar(m_newCWfilename), nil, nil, SW_NORMAL)
|
|
|
|
|
else
|
|
|
|
|
ShellExecute(Handle, nil, pchar(m_newfilename), nil, nil, SW_NORMAL);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if qry1_qdtm.IsEmpty then exit;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
if(m_iway=31) then
|
|
|
|
|
tmpfile:=qry1_qdtm.fieldbyname('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>').asstring
|
|
|
|
|
else
|
|
|
|
|
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_info.CreateSignOcx();
|
|
|
|
|
begin
|
|
|
|
|
{
|
|
|
|
|
if not Assigned(iwbpdfdtr1) then
|
|
|
|
|
begin
|
|
|
|
|
iwbpdfdtr1:= TiWebPDFEditor.Create(self);
|
|
|
|
|
Left := 0;
|
|
|
|
|
Top := 134;
|
|
|
|
|
Width := 1080;
|
|
|
|
|
Height := 700;
|
|
|
|
|
Align := alCustom;
|
|
|
|
|
TabOrder := 6;
|
|
|
|
|
Parent := Self; // <20>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>.
|
|
|
|
|
iwbpdfdtr1.OnSignFinish := iwbpdfdtr1SignFinish;
|
|
|
|
|
//iwbpdfdtr1.ControlData := 000001009F6F00005948000000000000;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.btn2_CancelSignItemClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
i,iret:Integer;
|
|
|
|
|
isSelectAll :Boolean;
|
|
|
|
|
strxh,strinfo,strsql:string;
|
|
|
|
|
reasons:string;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
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><>"ȷ<><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_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_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_info.btn8_confirmSignoutClick(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
zht,wtdw,bh,qdtbh,reasons:string;
|
|
|
|
|
|
|
|
|
|
//picfile,pdffile:string;
|
|
|
|
|
//remotePath:string;
|
|
|
|
|
dbtime:TDateTime;
|
|
|
|
|
aAdoQuery:TADOQuery;
|
|
|
|
|
strsql:string;
|
|
|
|
|
begin
|
|
|
|
|
{
|
|
|
|
|
if m_newCWfilename='' then
|
|
|
|
|
begin
|
|
|
|
|
application.MessageBox(PChar('<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>!'),'<27><>Ϣ<EFBFBD><CFA2>ʾ') ;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
remotePath:='\\223.223.95.160\data\custsign';
|
|
|
|
|
// remotePath:='\\dev000\custsign';
|
|
|
|
|
//remotePath:='\\X6x8-20170109nn\<5C><><EFBFBD>Դ洢<D4B4>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
// UpLoadCustSignFile
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if(m_iway=31) then
|
|
|
|
|
begin
|
|
|
|
|
pdffile:= m_newCWfilename;
|
|
|
|
|
picfile:= copy(pdffile,0, length(pdffile) - 3)+'bmp';
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
pdffile:= m_newfilename;
|
|
|
|
|
picfile:= copy(pdffile,0, length(pdffile) - 3)+'bmp';
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CheckBilldue()=False) then
|
|
|
|
|
begin
|
|
|
|
|
if(Application.MessageBox(pchar('<27><>ǰǩ<C7B0><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>'+#13#10+ m_infomation +#13#10+'<27>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫǩ<D2AA><C7A9>?'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
try
|
|
|
|
|
frm_main.db.BeginTrans;
|
|
|
|
|
{img1.Picture.SaveToFile(picfile);
|
|
|
|
|
UpLoadCustSignFile(pdffile,picfile ,remotePath,'user','user',m_qdtbh,m_iway);
|
|
|
|
|
|
|
|
|
|
}//
|
|
|
|
|
zht:= qry1_qdtm.FieldByName('״̬').AsString;
|
|
|
|
|
wtdw:=qry1_qdtm.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qry1_qdtm.Edit;
|
|
|
|
|
qry1_qdtm.FieldByName('״̬').AsString:='ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>';
|
|
|
|
|
qry1_qdtm.FieldByName('ǩ<><C7A9>ʱ<EFBFBD><CAB1>').AsDateTime:=GetDbDatetime();
|
|
|
|
|
|
|
|
|
|
dbtime:=GetDbDatetime;
|
|
|
|
|
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
|
|
|
|
|
bh :=qry2_qdtd.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
if not GetStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>') then
|
|
|
|
|
begin
|
|
|
|
|
InsertSeaeStatus(bh,'<27>ᵥǩ<E1B5A5><C7A9>',employee,FormatDateTime('yyyy-mm-dd hh:mm:ss',dbtime),reasons);
|
|
|
|
|
InsertSeaeStatus(bh,'֪ͨ<CDA8>ŵ<EFBFBD>',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',dbtime));
|
|
|
|
|
UpateSeaeState(bh,'<27>ᵥǩ<E1B5A5><C7A9>');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
qry2_qdtd.Next;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
|
|
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
begin
|
|
|
|
|
Close;sql.Clear;
|
|
|
|
|
strsql:= 'UPDATE [t_op_seae_sign_main] SET <20><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = getdate(),״̬=''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>'' WHERE [ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] ='''+ m_qdtbh +''';';
|
|
|
|
|
SQL.Add(strsql);
|
|
|
|
|
strsql:= 'update t_op_seae_sign_detail set ״̬=''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>'' 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 + ''');' ;
|
|
|
|
|
SQL.ADD(strsql);
|
|
|
|
|
strsql:=' INSERT INTO [t_op_state]([<5B><><EFBFBD><EFBFBD>],[ҵ<><D2B5>״̬],[¼<><C2BC><EFBFBD><EFBFBD>],[¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]) '
|
|
|
|
|
+' select <20><><EFBFBD><EFBFBD>,''<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>'',''' + employee+''',getdate() '
|
|
|
|
|
+' from [t_op_seae_sign_detail] WHERE [ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] ='''+ m_qdtbh +''';' ;
|
|
|
|
|
SQL.ADD(strsql);
|
|
|
|
|
ExecSQL();
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
|
|
application.MessageBox(PChar('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION) ;
|
|
|
|
|
qry1_qdtm.Close();
|
|
|
|
|
qry1_qdtm.Open;
|
|
|
|
|
qry1_qdtm.Requery();
|
|
|
|
|
btn5_signout.Enabled:=False;
|
|
|
|
|
btn8_confirmSignout.Enabled:=False;
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
on E: Exception do
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage(E.Message);
|
|
|
|
|
qry1_qdtm.Cancel;
|
|
|
|
|
frm_main.db.rollbacktrans;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
// ǩ<><C7A9>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_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_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_info.FormClose(Sender: TObject;
|
|
|
|
|
var Action: TCloseAction);
|
|
|
|
|
begin
|
|
|
|
|
//
|
|
|
|
|
qry1_qdtm.Close;
|
|
|
|
|
qry2_qdtd.Close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_info.FormDestroy(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if Self=frm_op_seae_sign_info then
|
|
|
|
|
frm_op_seae_sign_info:=nil;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_sign_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.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').IsNull) and ( qry1_qdtm.FieldByName('<27>Ƿ<EFBFBD><C7B7>ط<EFBFBD>').AsBoolean) then
|
|
|
|
|
AFont.Color:=clGreen;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
function Tfrm_op_seae_sign_info.gettmpzqdate(cust: string ):string;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TAdoQuery;
|
|
|
|
|
begin
|
|
|
|
|
result:='';
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do
|
|
|
|
|
begin
|
|
|
|
|
close;sql.Clear;
|
|
|
|
|
sql.Add('select top 1 t.<2E><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>,t.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client_sales_tmp t ');
|
|
|
|
|
sql.Add(' where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=cast(GETDATE() as date) order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> desc ');
|
|
|
|
|
open;First;
|
|
|
|
|
if IsEmpty then
|
|
|
|
|
begin
|
|
|
|
|
result:='';
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
result:= FormatDateTime('YYYY-MM-DD',FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsDateTime)
|
|
|
|
|
+ '~'+FormatDateTime('YYYY-MM-DD',FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime) ;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
procedure Tfrm_op_seae_sign_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_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.
|