|
|
unit u_op_seae_paper_manage;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, bsSkinCtrls, DB,
|
|
|
ADODB, ExtCtrls, RxLookup, StdCtrls, wwdbdatetimepicker, wwdblook, Menus,
|
|
|
Mask, bsSkinBoxCtrls, bsdbctrls,DateUtils, kbmMemTable, DBCtrlsEh,
|
|
|
ComCtrls, bsSkinTabs, dxDBTLCl, dxGrClms, cxDBLabel, cxControls,
|
|
|
cxContainer, cxEdit, cxLabel, cxTextEdit, cxMaskEdit, cxDropDownEdit,
|
|
|
cxDBEdit, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, DBCtrls;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_paper_manage = class(TForm)
|
|
|
qry_paper_detail: TADOQuery;
|
|
|
ds2_detail: TDataSource;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N1: TMenuItem;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
bsSkinTabSheet2: TbsSkinTabSheet;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
btn6_exit: TbsSkinButton;
|
|
|
btn_seach2: TbsSkinButton;
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label13: TLabel;
|
|
|
Label14: TLabel;
|
|
|
wwDBDateTimePicker5: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker6: TwwDBDateTimePicker;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
MenuItem1: TMenuItem;
|
|
|
Edit6_searchtdh: TEdit;
|
|
|
Label8: TLabel;
|
|
|
bsknpnl1: TbsSkinPanel;
|
|
|
pnl2: TbsSkinPanel;
|
|
|
qry1_paper_in: TADOQuery;
|
|
|
Edit1_tdzbh: TEdit;
|
|
|
lbl14: TLabel;
|
|
|
bsknpnl4_NewQDT: TbsSkinPanel;
|
|
|
lbl15_searchqdthm: TLabel;
|
|
|
ds1: TDataSource;
|
|
|
N2: TMenuItem;
|
|
|
qry_crm_client: TADOQuery;
|
|
|
ds_crm_client: TDataSource;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn2: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn3: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn4_noP: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn5_noB: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn6_noE: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn7: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn8: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column1: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column2: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column3: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column4: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column5: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column6: TdxDBGridColumn;
|
|
|
dxdbgrd1_S: TdxDBGrid;
|
|
|
dxdbgrdclmnDBGrid1Column7: TdxDBGridColumn;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn9: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column8: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column9: TdxDBGridColumn;
|
|
|
dxdbgrdclmnDBGrid1Column10: TdxDBGridColumn;
|
|
|
qry1_sel: TADOQuery;
|
|
|
ds2_sel: TDataSource;
|
|
|
lbl9: TLabel;
|
|
|
cbb1_printstate: TbsSkinComboBox;
|
|
|
lbl10: TLabel;
|
|
|
cbb2_shipinc_paper: TRxDBLookupCombo;
|
|
|
qry2_crm_client_paper: TADOQuery;
|
|
|
ds2_crm_client_paper: TDataSource;
|
|
|
btn4_exit: TbsSkinButton;
|
|
|
btn1_Refresh: TbsSkinButton;
|
|
|
btn4_cancel: TbsSkinButton;
|
|
|
btn1_addPaper: TbsSkinButton;
|
|
|
edt1_pagecount: TEdit;
|
|
|
lbl1: TLabel;
|
|
|
bskndbtxt1: TbsSkinDBText;
|
|
|
lbl8: TLabel;
|
|
|
cbb1: TRxDBLookupCombo;
|
|
|
lbl6: TLabel;
|
|
|
cbb3_GenNoList: TbsSkinComboBox;
|
|
|
btn1_genNolist: TbsSkinButton;
|
|
|
Edit3_endNo: TEdit;
|
|
|
lbl7: TLabel;
|
|
|
Edit2_startno: TEdit;
|
|
|
lbl3: TLabel;
|
|
|
Edit1_preno: TEdit;
|
|
|
lbl2: TLabel;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
lbl5: TLabel;
|
|
|
lbl4: TLabel;
|
|
|
wdbdtmpckr2_kc: TwwDBDateTimePicker;
|
|
|
wdbdtmpckr1_kc: TwwDBDateTimePicker;
|
|
|
cbb2: TcxDBComboBox;
|
|
|
btn4_searchNew: TbsSkinButton;
|
|
|
procedure btn4_exitClick(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure btn3_clearConditonClick(Sender: TObject);
|
|
|
procedure btn4_searchNewClick(Sender: TObject);
|
|
|
procedure bsknpnl1Resize(Sender: TObject);
|
|
|
procedure btn1_addPaperClick(Sender: TObject);
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
procedure Edit3_ztdhKeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxdbgrd1_SDblClick(Sender: TObject);
|
|
|
procedure dxdbgrdclmndxdbgrd1xdbgrdclmndxdbgrd1Column13CustomDraw(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 dxDBGrid2Column14CustomDraw(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 MenuItem1Click(Sender: TObject);
|
|
|
procedure btn6_exitClick(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure btn11Click(Sender: TObject);
|
|
|
procedure searchqdt(bh:string);
|
|
|
procedure Edit1_tdzbhKeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxDBGrid1DblClick(Sender: TObject);
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
procedure bsSkinPageControl1Change(Sender: TObject);
|
|
|
procedure FormResize(Sender: TObject);
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
procedure edt1_pagecountKeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure Edit6_searchtdhKeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure btn_seach2Click(Sender: TObject);
|
|
|
procedure cbb1Change(Sender: TObject);
|
|
|
procedure btn1_genNolistClick(Sender: TObject);
|
|
|
procedure btn1_RefreshClick(Sender: TObject);
|
|
|
procedure wdbdtmpckr2_kcKeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure btn4_cancelClick(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
employeePhone:string;
|
|
|
m_infomation:string;
|
|
|
m_strNo_pre,m_strNo_start,m_strNo_end:string;//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ᵥҳ<E1B5A5><D2B3>ʱ<EFBFBD>ij<EFBFBD>ʼֵ
|
|
|
function CheckBilldue():Boolean;
|
|
|
procedure bindPaperIn();
|
|
|
function genPaperno():Boolean;
|
|
|
procedure inctypeChange();
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
op:integer;
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_paper_manage: Tfrm_op_seae_paper_manage;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main,my_sys_function, u_sys_progress ;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
//const stateNewQD = '<27><><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>';
|
|
|
//
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.bindPaperIn();
|
|
|
var
|
|
|
str:string;
|
|
|
shipinc:string;
|
|
|
begin
|
|
|
//str:=cbb1.text;
|
|
|
shipinc:= cbb1.DisplayValues[1] ;
|
|
|
if shipinc<>'' then
|
|
|
str:=' and <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>='''+ shipinc + '''' ;
|
|
|
if wdbdtmpckr1_kc.Text<>'' then
|
|
|
str:=' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='''+ wdbdtmpckr1_kc.Text + '''' ;
|
|
|
if wdbdtmpckr2_kc.Text<>'' then
|
|
|
str:=' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='''+ wdbdtmpckr2_kc.Text + ' 23:59:59''' ;
|
|
|
|
|
|
str:= 'select * from t_op_seae_paper_in where 1=1 ' + str ;
|
|
|
|
|
|
with qry1_paper_in do begin
|
|
|
close;sql.Clear;
|
|
|
SQL.Add(str);
|
|
|
Open;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_paper_manage.btn4_exitClick(Sender: TObject);
|
|
|
begin
|
|
|
Close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.FormShow(Sender: TObject);
|
|
|
var str,mblstatus:string;
|
|
|
begin
|
|
|
loadreggrid(dxdbgrd1_S,false,caption+'1');
|
|
|
loadreggrid(dxDBGrid1,false,caption+'2');
|
|
|
|
|
|
|
|
|
qry_crm_client.Close();
|
|
|
qry_crm_client.Open();
|
|
|
qry_crm_client.First;
|
|
|
qry1_sel.Close();
|
|
|
qry1_sel.Open;
|
|
|
//
|
|
|
qry2_crm_client_paper.Close();
|
|
|
qry2_crm_client_paper.Open;
|
|
|
|
|
|
|
|
|
bsSkinPageControl1.ActivePageIndex:=0;
|
|
|
dxdbgrd1_S.Width:=self.ClientWidth;
|
|
|
bsknpnl1.Height :=34;
|
|
|
self.WindowState:= wsMaximized;
|
|
|
wwDBDateTimePicker5.Date:=Date-7; ;//StrToDateTime(Formatdatetime('YYYY-MM-DD',date-7));
|
|
|
wwDBDateTimePicker6.Date:=Date;//StrToDateTime(Formatdatetime('YYYY-MM-DD',date));
|
|
|
inctypeChange();
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
|
|
|
savereggrid(dxdbgrd1_S,caption+'1');
|
|
|
savereggrid(dxDBGrid1,caption+'2');
|
|
|
|
|
|
frm_op_seae_paper_manage.Hide;
|
|
|
frm_op_seae_paper_manage.ManualFloat(frm_op_seae_paper_manage.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_seae_paper_manage');
|
|
|
action:=cafree;
|
|
|
frm_op_seae_paper_manage:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn3_clearConditonClick(Sender: TObject);
|
|
|
begin
|
|
|
//Edit1_ywbh.text:='';
|
|
|
//Edit2_wtbh.text:='';
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
function replaceSQuotes(txt: string):string;
|
|
|
begin
|
|
|
result:=stringreplace(txt,'''','''''',[rfReplaceAll]);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn4_searchNewClick(Sender: TObject);
|
|
|
var
|
|
|
str,mblstatus:widestring;
|
|
|
begin
|
|
|
bindPaperIn();
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.bsknpnl1Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
// i:=round(bsSkinPanel1.Width/11);
|
|
|
// bsSkinButton9.Width:=i;
|
|
|
//bsSkinButton1.Width:=i;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn1_addPaperClick(Sender: TObject);
|
|
|
var
|
|
|
str:widestring;
|
|
|
ipagecount:integer;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>
|
|
|
aQuery:TAdoQuery;
|
|
|
//qdm_Query:TAdoQuery;
|
|
|
paperd_Query:TAdoQuery;
|
|
|
info:string;
|
|
|
strwtdw1,strwtdw2,zhtdh:string;
|
|
|
dbTime:TDateTime;
|
|
|
strNo_pre,strNo_start,strNo_end:string;
|
|
|
blIsHasPaperNo:Boolean;//<2F>ᵥֽ<E1B5A5>Ƿ<EFBFBD><C7B7>б<EFBFBD><D0B1><EFBFBD>
|
|
|
shipinc:string;//<2F><><EFBFBD><EFBFBD>˾
|
|
|
inputNo:Integer;
|
|
|
i:Integer;
|
|
|
begin
|
|
|
strNo_pre:='';
|
|
|
strNo_start:='';
|
|
|
strNo_end:='';
|
|
|
shipinc:= cbb1.DisplayValues[1] ;
|
|
|
if shipinc ='' then
|
|
|
begin
|
|
|
Application.MessageBox(pchar('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><>ѡ<EFBFBD><EFBFBD>˾'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
blIsHasPaperNo:=qry_crm_client.fieldbyname('<27>ᵥֽ<E1B5A5>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean;
|
|
|
if(blIsHasPaperNo) then
|
|
|
begin
|
|
|
if(cbb3_GenNoList.Items.count<1) then
|
|
|
begin
|
|
|
Application.MessageBox(pchar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>!'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
strNo_pre :=trim(Edit1_preno.text);
|
|
|
strNo_start:=trim(Edit2_startno.text);
|
|
|
strNo_end :=Trim(Edit3_endNo.text);
|
|
|
if(strNo_start<>m_strNo_start) or (strNo_end<>m_strNo_end) then
|
|
|
begin
|
|
|
Application.MessageBox(pchar('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5>ź<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>ı䣡'
|
|
|
+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD>!'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
aQuery:=CreateAdoQuery();
|
|
|
str:='select count(1) as f_count from [t_op_seae_paper_detail] '
|
|
|
+' where <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>=''' + cbb1.DisplayValues[1]
|
|
|
+''' and [<5B>ᵥֽ<E1B5A5><D6BD>]>='''+ strNo_start + ''' and [<5B>ᵥֽ<E1B5A5><D6BD>]<='''+ strNo_end+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae_paper_in where <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>='''+cbb1.DisplayValues[1]+''' and ǰ<C7B0><D7BA><EFBFBD><EFBFBD>='''+Trim(Edit1_preno.Text)+''')' ;
|
|
|
|
|
|
with aQuery do begin
|
|
|
close;
|
|
|
sql.Clear;
|
|
|
SQL.Add(str);
|
|
|
Open;
|
|
|
if(fieldbyname('f_count').asinteger >0 ) then
|
|
|
begin
|
|
|
//
|
|
|
info:='<27><>' +inttostr( fieldbyname('f_count').asinteger) +'<27><><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
|
|
|
close;
|
|
|
Exit;
|
|
|
end;
|
|
|
aQuery:=nil;
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
ipagecount:=strtoint(trim(edt1_pagecount.Text));
|
|
|
if(ipagecount<1) then
|
|
|
begin
|
|
|
Application.MessageBox(pchar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>!'),PChar('<27><>Ϣ<EFBFBD><CFA2>ʾ'),MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
if(ipagecount>1000) then
|
|
|
begin
|
|
|
if(Application.MessageBox(pchar('<27><>ǰҪ<C7B0><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽΪ'+ inttostr(ipagecount)
|
|
|
+'<27><>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>1000<30><30><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'ѡ<><D1A1>(Y)<29><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>'
|
|
|
,MB_ICONQUESTION+MB_YESNO) <> ID_YES) then
|
|
|
Exit;
|
|
|
end;
|
|
|
//
|
|
|
|
|
|
str:= 'INSERT INTO [t_sys_paperid] ([inputperson]) VALUES ('''+ employee +''');';
|
|
|
|
|
|
aQuery:=CreateAdoQuery();
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Clear;
|
|
|
aQuery.SQL.Add(str) ;
|
|
|
aQuery.ExecSQL();
|
|
|
aQuery.sql.Clear();
|
|
|
str:= 'select MAX(paperid) as inputNo,GETDATE()as FDate from t_sys_paperid; ';
|
|
|
aQuery.sql.add(str);
|
|
|
aQuery.Open;
|
|
|
aQuery.First;
|
|
|
inputNo:=aQuery.FieldByName('inputNo').AsInteger;
|
|
|
dbTime:=aQuery.FieldByName('FDate').AsDateTime;
|
|
|
aQuery.Close;
|
|
|
try
|
|
|
frm_main.db.BeginTrans;
|
|
|
//<2F><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>
|
|
|
|
|
|
|
|
|
//3b<33><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>
|
|
|
aQuery.Close;
|
|
|
aQuery.SQL.Clear;
|
|
|
aQuery.SQL.Add('UPDATE [t_op_seae_paper_shipinc] '
|
|
|
+ ' SET [<5B>ᵥֽʣ<D6BD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] = <20>ᵥֽʣ<D6BD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+ '+inttostr(ipagecount )
|
|
|
+ ' WHERE [<5B><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>] = ''' + cbb1.DisplayValues[1] +'''');
|
|
|
aQuery.ExecSQL;
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
with qry1_paper_in do begin
|
|
|
Insert;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger := inputNo;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString := shipinc;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString := '<27><><EFBFBD><EFBFBD>';
|
|
|
FieldByName('ֽ<><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger := ipagecount;
|
|
|
|
|
|
FieldByName('ǰ<C7B0><D7BA><EFBFBD><EFBFBD>').AsString := strNo_pre ;
|
|
|
FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsString := strNo_start;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString := strNo_end;
|
|
|
|
|
|
FieldByName('<27><>ע').AsString := '';
|
|
|
FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').AsString := employee;
|
|
|
FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime := DatabaseDateTime;
|
|
|
end;
|
|
|
|
|
|
//qry_crm_client.Post;
|
|
|
qry1_paper_in.Post;
|
|
|
if(blIsHasPaperNo) then
|
|
|
begin
|
|
|
paperd_Query:=CreateAdoQuery();
|
|
|
paperd_Query.Close;
|
|
|
paperd_Query.SQL.Clear;
|
|
|
paperd_Query.SQL.Add('select * from t_op_seae_paper_detail where 1=2');
|
|
|
paperd_Query.Open;
|
|
|
// ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ
|
|
|
for i:=0 to cbb3_GenNoList.Items.count-1 do
|
|
|
begin
|
|
|
//
|
|
|
with paperd_Query do
|
|
|
begin
|
|
|
Insert;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger := inputNo;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString := shipinc;
|
|
|
FieldByName('<27>ᵥֽ<E1B5A5><D6BD>').AsString := cbb3_GenNoList.Items[i];
|
|
|
end;
|
|
|
end;
|
|
|
paperd_Query.Post();
|
|
|
paperd_Query.Close();
|
|
|
cbb3_GenNoList.Items.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
except
|
|
|
on ex: Exception do
|
|
|
begin
|
|
|
qry_crm_client.Cancel;
|
|
|
qry1_paper_in.Cancel;
|
|
|
frm_main.db.RollbackTrans;
|
|
|
errorlog(ex.Message) ;
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:'+ex.Message),'',MB_ICONWARNING);
|
|
|
bindPaperIn();
|
|
|
Exit;
|
|
|
end;
|
|
|
end;
|
|
|
qry_crm_client.Close();
|
|
|
qry_crm_client.Open();
|
|
|
dxdbgrd1_S.ClearSelection();
|
|
|
bindPaperIn();
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.N1Click(Sender: TObject);
|
|
|
begin
|
|
|
//grid_save_xls(dxdbgrd2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.Edit3_ztdhKeyPress(Sender: TObject; var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
//bsSkinButton8Click(Sender);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.dxdbgrd1_SDblClick(Sender: TObject);
|
|
|
begin
|
|
|
//
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.dxdbgrdclmndxdbgrd1xdbgrdclmndxdbgrd1Column13CustomDraw(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 Trim(ANode.Strings[dxDBGrid2Column13.Index])<>'' then
|
|
|
AColor:=clred;
|
|
|
AFont.Color:=clblack;
|
|
|
}
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.dxDBGrid2Column14CustomDraw(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 Trim(ANode.Strings[dxDBGrid2Column14.Index])<>'' then
|
|
|
AColor:=clred;
|
|
|
AFont.Color:=clblack;
|
|
|
}
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.MenuItem1Click(Sender: TObject);
|
|
|
begin
|
|
|
grid_save_xls(dxDBGrid1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn6_exitClick(Sender: TObject);
|
|
|
begin
|
|
|
Close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn11Click(Sender: TObject);
|
|
|
begin
|
|
|
|
|
|
bsSkinPageControl1.Pages[0].Visible:=true;
|
|
|
bsSkinPageControl1.Pages[1].Visible:=true;
|
|
|
bsSkinPageControl1.ActivePageIndex:=0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.searchqdt(bh:string);
|
|
|
begin
|
|
|
//
|
|
|
if bh<>'' then
|
|
|
begin
|
|
|
//
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.Edit1_tdzbhKeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
var
|
|
|
str:string;
|
|
|
begin
|
|
|
//
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.dxDBGrid1DblClick(Sender: TObject);
|
|
|
var
|
|
|
str:string;
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
/// <summary>
|
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB>Ƿ<EFBFBD>Ƿ<EFBFBD><C7B7>
|
|
|
/// </summary>
|
|
|
function Tfrm_op_seae_paper_manage.CheckBilldue():Boolean;
|
|
|
var
|
|
|
FeeItems:string;
|
|
|
amt,usd:Double;
|
|
|
wtdw,tdh,bh,jflx:string;
|
|
|
begin
|
|
|
Result:=True;
|
|
|
if(cbb3_GenNoList.Items.count<1) then
|
|
|
begin
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>!','<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=False;
|
|
|
Exit;
|
|
|
end;
|
|
|
//<2F>жϺ<D0B6><CFBA><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
end; //end CheckBilldue
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.N2Click(Sender: TObject);
|
|
|
var
|
|
|
i:Integer;
|
|
|
info,strXH,str:string;
|
|
|
begin
|
|
|
// <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ֽ δʹ<CEB4><CAB9>,<2C>ɽ<EFBFBD><C9BD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if( dxDBGrid1.SelectedCount<1) then
|
|
|
Exit;
|
|
|
try
|
|
|
qry2_crm_client_paper.DisableControls;
|
|
|
strXH:='';
|
|
|
for i:=0 to dxDBGrid1.SelectedCount-1 do
|
|
|
begin
|
|
|
qry2_crm_client_paper.GoTobookmark(pointer(dxDBGrid1.SelectedRows[i]));
|
|
|
//״̬
|
|
|
if( qry2_crm_client_paper.fieldbyname('ʹ<><CAB9>״̬').AsString<>'δ<><CEB4>ӡ') then
|
|
|
begin
|
|
|
//<2F>հ<EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD>
|
|
|
info:='<27>հ<EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѡ<EFBFBD><D1A1>δʹ<CEB4>õĿհ<C4BF>ֽ';
|
|
|
Application.MessageBox(pchar(info),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
//
|
|
|
if(strXH='') then
|
|
|
strXH:=qry2_crm_client_paper.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString
|
|
|
else
|
|
|
strXH := strXH +','+ qry2_crm_client_paper.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
//<2F><><EFBFBD><EFBFBD>״̬ͬʱ<CDAC>Ŀ<DEB8><C4BF><EFBFBD>
|
|
|
str:='';
|
|
|
finally
|
|
|
qry2_crm_client_paper.EnableControls;
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.bsSkinPageControl1Change(Sender: TObject);
|
|
|
begin
|
|
|
//
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.FormResize(Sender: TObject);
|
|
|
begin
|
|
|
//
|
|
|
bsSkinTabSheet1.Width:=self.ClientWidth;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.bsSkinButton14Click(Sender: TObject);
|
|
|
begin
|
|
|
wwDBDateTimePicker5.text:='';
|
|
|
wwDBDateTimePicker6.text:='';
|
|
|
Edit1_tdzbh.text:='';
|
|
|
Edit6_searchtdh.text:='';
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.edt1_pagecountKeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
|
|
|
if not (Key in [#8, #13, #127, '.', '-', '0'..'9']) then Key := #0;
|
|
|
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_paper_manage.Edit6_searchtdhKeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn_seach2Click(Sender: TObject);
|
|
|
var
|
|
|
str,strorder,strChgs,strtmp:string;
|
|
|
|
|
|
begin
|
|
|
strChgs:= cbb2_shipinc_paper.DisplayValues[1] ;
|
|
|
if(strChgs='') then
|
|
|
begin
|
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><EFBFBD>˾','<27><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>',MB_ICONINFORMATION);
|
|
|
exit;
|
|
|
end;
|
|
|
str:='';
|
|
|
str:=' AND d.<2E><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>= ''' +strChgs +''' ';
|
|
|
strtmp:= StringReplace(trim(Edit1_tdzbh.text),'''','',[rfReplaceAll]);
|
|
|
if Edit1_tdzbh.text<>'' then
|
|
|
str:=str + ' AND d.<2E>ᵥֽ<E1B5A5><D6BD> like ''%' +strtmp +'%''';
|
|
|
strtmp:= StringReplace(trim(Edit6_searchtdh.text),'''','',[rfReplaceAll]);
|
|
|
if strtmp<>'' then
|
|
|
str:=str + ' AND d.<2E>ᵥ<EFBFBD><E1B5A5> like ''%' +strtmp +'%''';
|
|
|
if cbb1_printstate.ItemIndex>0 then //0 Ϊ<<3C><>>
|
|
|
str:=str + ' AND isnull(d.[ʹ<><CAB9>״̬],''δ<><CEB4>ӡ'')='''+cbb1_printstate.Text+''' ' ;
|
|
|
//
|
|
|
str:='SELECT d.[<5B><><EFBFBD><EFBFBD>],d.[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],d.[<5B><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>],d.[<5B>ᵥֽ<E1B5A5><D6BD>],d.[<5B>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>],'
|
|
|
+'d.[<5B>ᵥ<EFBFBD><E1B5A5>],d.[ҳ<><D2B3>],d.[<5B><>ҳ<EFBFBD><D2B3>],isnull(d.[ʹ<><CAB9>״̬],''δ<><CEB4>ӡ'') as [ʹ<><CAB9>״̬]'
|
|
|
+',d.[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],d.[<5B><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>],d.[<5B><>ע],d.[<5B>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>],d.[<5B><>ӡ̨<D3A1><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] '
|
|
|
+',m.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,m.¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FROM '
|
|
|
+' [t_op_seae_paper_detail] d,t_op_seae_paper_in m where d.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=m.<2E><><EFBFBD><EFBFBD> '
|
|
|
+ str;
|
|
|
strorder :=' order by <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ᵥֽ<E1B5A5><D6BD>';
|
|
|
if(qry2_crm_client_paper.FieldByName('ֽ<><D6BD>ʹ<EFBFBD><CAB9><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean) then
|
|
|
strorder:= strorder + ' desc';
|
|
|
str:=str+strorder;
|
|
|
//dxDBGrid1.Filter.Clear();
|
|
|
with qry_paper_detail do begin
|
|
|
Close;
|
|
|
SQL.Clear;
|
|
|
SQL.Add(str);
|
|
|
Open;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.cbb1Change(Sender: TObject);
|
|
|
begin
|
|
|
inctypeChange();
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_paper_manage.inctypeChange();
|
|
|
|
|
|
var
|
|
|
blbh:Boolean; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
begin
|
|
|
//qry_crm_client.Active:=False;
|
|
|
//qry_crm_client.Active:= True;
|
|
|
blbh:= (cbb1.DisplayValues[1]<>'') and qry_crm_client.fieldbyname('<27>ᵥֽ<E1B5A5>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean;
|
|
|
dxdbgrdclmndxdbgrd1_SColumn4_noP.Visible:= ((cbb1.DisplayValues[1]='') or blbh);
|
|
|
dxdbgrdclmndxdbgrd1_SColumn5_noB.Visible:= ( (cbb1.DisplayValues[1]='') or blbh);
|
|
|
dxdbgrdclmndxdbgrd1_SColumn6_noE.Visible:= ( (cbb1.DisplayValues[1]='') or blbh);
|
|
|
pnl2.Visible:=blbh;
|
|
|
if(blbh) then
|
|
|
begin
|
|
|
// if(pnl2.Visible=false) then
|
|
|
// bsknpnl2.Height:= bsknpnl2.Height+pnl2.Height;
|
|
|
//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD> ҳ<><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
|
|
|
edt1_pagecount.ReadOnly:=true;
|
|
|
edt1_pagecount.text:='0';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
// if(pnl2.Visible=true) or (bsknpnl2.Height>60) then
|
|
|
// bsknpnl2.Height:= bsknpnl2.Height-pnl2.Height;
|
|
|
cbb3_GenNoList.Items.Clear;
|
|
|
edt1_pagecount.text:='0';
|
|
|
if cbb1.DisplayValues[1]<>'' then //<2F>ޱ<EFBFBD><DEB1><EFBFBD><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>˾<EFBFBD><CBBE>Ϊ<EFBFBD><CEAA>
|
|
|
edt1_pagecount.ReadOnly:=False;
|
|
|
end;
|
|
|
bindPaperIn();
|
|
|
//
|
|
|
end;
|
|
|
procedure Tfrm_op_seae_paper_manage.btn1_genNolistClick(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
genPaperno();
|
|
|
except
|
|
|
on ex:exception do
|
|
|
begin
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:'+EX.Message),'',MB_ICONWARNING);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
function Tfrm_op_seae_paper_manage.genPaperno():Boolean;
|
|
|
var
|
|
|
i,istart,iend,ipageNoLen,Icount,icheckcount :integer;
|
|
|
info,strStart,strEnd,strtmpNo,str00,str:string;
|
|
|
aQuery:TAdoQuery;
|
|
|
|
|
|
begin
|
|
|
Result:=true;
|
|
|
|
|
|
strStart:= Trim(Edit2_startno.text);
|
|
|
strEnd:=Trim(Edit3_endNo.text);
|
|
|
if(strStart='') or (strEnd='') then
|
|
|
begin
|
|
|
info:='<27><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>:<3A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
|
|
|
Result:=false;
|
|
|
Exit;
|
|
|
end;
|
|
|
ipageNoLen:=length(strEnd);
|
|
|
if Length(strStart)<>ipageNoLen then
|
|
|
begin
|
|
|
info:='<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>볤<EFBFBD>Ȳ<EFBFBD>һ<EFBFBD><D2BB>,<2C><>ȷ<EFBFBD><C8B7>';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=false;
|
|
|
Edit3_endNo.SetFocus;
|
|
|
Exit;
|
|
|
end;
|
|
|
|
|
|
//
|
|
|
info:='<27><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>:<3A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫΪ<C8AB><CEAA><EFBFBD><EFBFBD>[0-9]';
|
|
|
try
|
|
|
istart:=StrToInt(strStart)
|
|
|
except
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=false;
|
|
|
Edit2_startno.SetFocus;
|
|
|
exit;
|
|
|
end;
|
|
|
|
|
|
try
|
|
|
iend:=StrToInt(strEnd)
|
|
|
except
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=false;
|
|
|
Edit3_Endno.SetFocus;
|
|
|
exit;
|
|
|
end;
|
|
|
icount := iend- istart;
|
|
|
if(Icount<=0) then
|
|
|
begin
|
|
|
info:='[<5B><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>]<5D><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],<2C><>ȷ<EFBFBD><C8B7>';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=false;
|
|
|
Edit3_endNo.SetFocus;
|
|
|
Exit;
|
|
|
end;
|
|
|
if(Icount>2000) then
|
|
|
begin
|
|
|
info:='<27><><EFBFBD>ɵ<EFBFBD><C9B5>ᵥֽҳ<D6BD><D2B3>Ϊ<EFBFBD><CEAA>'+inttostr(Icount)
|
|
|
+',<2C>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2000<30><30>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>,<2C><>ȷ<EFBFBD><C8B7>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ֽ<EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ!';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONWARNING);
|
|
|
Result:=false;
|
|
|
Edit3_endNo.SetFocus;
|
|
|
Exit;
|
|
|
end;
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
aQuery:=CreateAdoQuery();
|
|
|
str:='select count(1) as f_count from [t_op_seae_paper_detail] '
|
|
|
+' where <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>=''' + cbb1.DisplayValues[1]
|
|
|
+''' and [<5B>ᵥֽ<E1B5A5><D6BD>]>='''+ strStart + ''' and [<5B>ᵥֽ<E1B5A5><D6BD>]<='''+ strEnd+''' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae_paper_in where <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>='''+cbb1.DisplayValues[1]+''' and ǰ<C7B0><D7BA><EFBFBD><EFBFBD>='''+Trim(Edit1_preno.Text)+''')' ;
|
|
|
|
|
|
with aQuery do begin
|
|
|
close;
|
|
|
sql.Clear;
|
|
|
SQL.Add(str);
|
|
|
Open;
|
|
|
if(fieldbyname('f_count').asinteger >0) then
|
|
|
begin
|
|
|
//
|
|
|
info:='<27><>' +inttostr( fieldbyname('f_count').asinteger) +'<27><><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Result:=false;
|
|
|
Result:=false;
|
|
|
close;
|
|
|
exit;
|
|
|
end;
|
|
|
aQuery:=nil;
|
|
|
end;
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ᵥֽ<E1B5A5><D6BD><EFBFBD><EFBFBD> ipageNoLen
|
|
|
str00:='0000000000000000000';
|
|
|
cbb3_GenNoList.Items.Clear;
|
|
|
cbb3_GenNoList.Items.Add(strStart);
|
|
|
for i:=1 to icount-1 do
|
|
|
begin
|
|
|
istart:=istart+1;
|
|
|
strtmpNo:=Copy(str00,1,ipageNoLen- Length(inttostr(istart)))+inttostr(istart);
|
|
|
cbb3_GenNoList.Items.Add(strtmpNo);
|
|
|
|
|
|
end;
|
|
|
cbb3_GenNoList.Items.Add(strEnd);
|
|
|
cbb3_GenNoList.ItemIndex:=0;
|
|
|
//
|
|
|
m_strNo_pre:= trim(Edit1_preno.text);
|
|
|
m_strNo_start:= strStart;
|
|
|
m_strNo_end:=strEnd;
|
|
|
edt1_pagecount.Text :=inttostr(icount+1);
|
|
|
if(Icount>100) then
|
|
|
begin
|
|
|
info:='<27><><EFBFBD>ɵ<EFBFBD><C9B5>ᵥֽҳ<D6BD><D2B3>Ϊ<EFBFBD><CEAA>'+inttostr(Icount)
|
|
|
+',<2C>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>100<30><30>,<2C><>ȷ<EFBFBD><C8B7>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>ֽ<EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ!';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONWARNING);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn1_RefreshClick(Sender: TObject);
|
|
|
begin
|
|
|
qry_crm_client.Close();
|
|
|
qry_crm_client.Open();
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.wdbdtmpckr2_kcKeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
// <20>س<EFBFBD><D8B3>Զ<EFBFBD><D4B6><EFBFBD>ѯ
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
btn4_searchNewClick(btn4_searchNew);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_paper_manage.btn4_cancelClick(Sender: TObject);
|
|
|
var
|
|
|
rkxh,chgsh,str,info:string ;
|
|
|
aQuery:TADOQuery;
|
|
|
iPages:Integer;
|
|
|
begin
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
|
|
|
if(dxdbgrd1_S.SelectedCount<1) then
|
|
|
begin
|
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1>Ҫȡ<D2AA><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
Exit;
|
|
|
end;
|
|
|
rkxh:= qry1_paper_in.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString ;
|
|
|
chgsh:= qry1_paper_in.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString ;
|
|
|
iPages:= qry1_paper_in.fieldbyname('ֽ<><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger ;
|
|
|
//
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>
|
|
|
aQuery:=CreateAdoQuery();
|
|
|
str:=' select count(1) as f_count from t_op_seae_paper_detail '
|
|
|
+' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+ rkxh + ' and isnull(ʹ<><CAB9>״̬,''δʹ<CEB4><CAB9>'')<>''δʹ<CEB4><CAB9>''' ;
|
|
|
|
|
|
with aQuery do begin
|
|
|
close;
|
|
|
sql.Clear;
|
|
|
SQL.Add(str);
|
|
|
Open;
|
|
|
if(fieldbyname('f_count').asinteger >0 ) then
|
|
|
begin
|
|
|
//
|
|
|
info:='<27><>' +inttostr( fieldbyname('f_count').asinteger) +'ֽ<><D6BD><EFBFBD>Ѿ<EFBFBD>ʹ<EFBFBD>ò<EFBFBD><C3B2><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ȷ<EFBFBD><C8B7>';
|
|
|
Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_ICONINFORMATION);
|
|
|
close;
|
|
|
Exit;
|
|
|
end;
|
|
|
aQuery:=nil;
|
|
|
end;
|
|
|
//ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
info:='<27><>' +inttostr(iPages) +'ֽ<>Ž<EFBFBD>Ҫȡ<D2AA><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ȷʵҪȡ<D2AA><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?';
|
|
|
if( Application.MessageBox(PChar(info) ,'<27><>Ϣ<EFBFBD><CFA2>ʾ',mb_iconquestion+mb_yesno)<>id_yes) then
|
|
|
Exit;
|
|
|
str:=' delete from t_op_seae_paper_detail where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+rkxh+';' +#13#10
|
|
|
+'update t_op_seae_paper_shipinc set <20>ᵥֽʣ<D6BD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>= <20>ᵥֽʣ<D6BD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-'+inttostr(iPages)
|
|
|
+' where <20><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>='''+chgsh +'''; ' +#13#10
|
|
|
+'delete from t_op_seae_paper_in where <20><><EFBFBD><EFBFBD>='+rkxh+';';
|
|
|
try
|
|
|
frm_main.db.BeginTrans;
|
|
|
frm_main.db.execute(str);
|
|
|
frm_main.db.CommitTrans;
|
|
|
qry_crm_client.Active:=False;
|
|
|
qry_crm_client.Active:=True;
|
|
|
inctypeChange();
|
|
|
except
|
|
|
on ex: Exception do
|
|
|
begin
|
|
|
|
|
|
frm_main.db.RollbackTrans;
|
|
|
errorlog(ex.Message) ;
|
|
|
Application.MessageBox(PChar('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:'+ex.Message),'',MB_ICONWARNING);
|
|
|
|
|
|
Exit;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end.
|