📄 uf_yyfx.pas
字号:
unit uf_yyfx;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, Menus, ImgList, ComCtrls, ExtCtrls, StdCtrls, TeEngine,
Series, TeeProcs, Chart, DBChart, Grids, DBGrids, ToolWin, TeeFunci,
QrTee, QuickRpt;
type
Tf_yyfx = class(TForm)
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
zx: TToolButton;
fg1: TToolButton;
dy: TToolButton;
fg2: TToolButton;
bz: TToolButton;
tc: TToolButton;
StatusBar1: TStatusBar;
ImageList1: TImageList;
MainMenu1: TMainMenu;
MenuItem11: TMenuItem;
f_yyfx_ckxf: TMenuItem;
N1: TMenuItem;
MenuItem18: TMenuItem;
P1: TMenuItem;
MenuItem19: TMenuItem;
MenuItem20: TMenuItem;
MenuItem73: TMenuItem;
MenuItem74: TMenuItem;
MenuItem75: TMenuItem;
MenuItem76: TMenuItem;
Panel1: TPanel;
Label5: TLabel;
Label6: TLabel;
tp1: TDateTimePicker;
tp2: TDateTimePicker;
yyfx: TNotebook;
dc_ckxf: TDBChart;
Series1: TBarSeries;
Panel2: TPanel;
DBGrid1: TDBGrid;
C1: TMenuItem;
R2: TMenuItem;
f_yyfx_jzfs: TMenuItem;
f_yyfx_xflb: TMenuItem;
f_yyfx_srlb: TMenuItem;
f_yyfx_ctxs: TMenuItem;
N8: TMenuItem;
f_yyfx_clxs: TMenuItem;
f_yyfx_cyxs: TMenuItem;
f_yyfx_krtc: TMenuItem;
f_yyfx_tcyy: TMenuItem;
N13: TMenuItem;
f_yyfx_krrs: TMenuItem;
fxfs: TLabel;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
PopupMenu1: TPopupMenu;
f_yyfx_psdxs: TMenuItem;
N16: TMenuItem;
f_yyfx_pjzfs: TMenuItem;
f_yyfx_pxflb: TMenuItem;
f_yyfx_pyylx: TMenuItem;
f_yyfx_pctxs: TMenuItem;
N21: TMenuItem;
f_yyfx_pclxs: TMenuItem;
f_yyfx_pcyxs: TMenuItem;
f_yyfx_pkrtc: TMenuItem;
f_yyfx_ptcyy: TMenuItem;
N26: TMenuItem;
f_yyfx_pkrrs: TMenuItem;
f_yyfx_pckxf: TMenuItem;
f_yyfx_pfwyxs: TMenuItem;
Panel3: TPanel;
DBGrid2: TDBGrid;
d_ckxf: TDataSource;
ckxf: TQuery;
ckxfckbh: TStringField;
ckxfdbxm: TStringField;
ckxfhj: TFloatField;
sdxs: TQuery;
sdxsycrq: TDateTimeField;
sdxshj: TFloatField;
d_sdxs: TDataSource;
dc_sdxs: TDBChart;
LineSeries1: TLineSeries;
clxs: TQuery;
clxsclh: TStringField;
clxsclm: TStringField;
clxshj: TFloatField;
d_clxs: TDataSource;
Panel4: TPanel;
DBGrid3: TDBGrid;
dc_clxs: TDBChart;
BarSeries1: TBarSeries;
ctxs: TQuery;
ctxsth: TStringField;
ctxstm: TStringField;
ctxshj: TFloatField;
d_ctxs: TDataSource;
Panel5: TPanel;
DBGrid4: TDBGrid;
dc_ctxs: TDBChart;
BarSeries2: TBarSeries;
Panel6: TPanel;
cyxs: TQuery;
cyxscz: TStringField;
cyxscz1: TStringField;
FloatField38: TFloatField;
d_cyxs: TDataSource;
DBGrid5: TDBGrid;
dc_cyxs: TDBChart;
PieSeries1: TPieSeries;
jzfs: TQuery;
jzfsjzfs: TStringField;
jzfsjzfs1: TStringField;
jzfsFloatField19: TFloatField;
d_jzfs: TDataSource;
Panel7: TPanel;
DBGrid6: TDBGrid;
dc_jzfs: TDBChart;
PieSeries2: TPieSeries;
krrs: TQuery;
krrsycrq: TDateTimeField;
krrshj: TFloatField;
d_krrs: TDataSource;
Panel8: TPanel;
DBGrid7: TDBGrid;
dc_krrs: TDBChart;
LineSeries2: TLineSeries;
krtc: TQuery;
krtcycrq: TDateTimeField;
krtchj: TFloatField;
d_krtc: TDataSource;
Panel9: TPanel;
DBGrid8: TDBGrid;
dc_krtc: TDBChart;
LineSeries3: TLineSeries;
srlb: TQuery;
srlbsrlb1: TStringField;
srlbhj: TFloatField;
d_srlb: TDataSource;
Panel10: TPanel;
DBGrid9: TDBGrid;
dc_yylx: TDBChart;
PieSeries3: TPieSeries;
tcyy: TQuery;
tcyytcyyh: TStringField;
tcyyhj: TIntegerField;
tcyyjehj: TFloatField;
tcyytcyym: TStringField;
d_tcyy: TDataSource;
Panel11: TPanel;
DBGrid10: TDBGrid;
xflb: TQuery;
xflblbh: TStringField;
xflbxflb: TStringField;
FloatField19: TFloatField;
d_xflb: TDataSource;
Panel12: TPanel;
DBGrid11: TDBGrid;
dc_xflb: TDBChart;
PieSeries5: TPieSeries;
Panel13: TPanel;
fwyxs: TQuery;
d_fwyxs: TDataSource;
DBGrid12: TDBGrid;
dc_fwyxs: TDBChart;
PieSeries6: TPieSeries;
fwyxshj: TFloatField;
fwyxsfwyh: TStringField;
f_yyfx_sdxs: TMenuItem;
N3: TMenuItem;
f_yyfx_fwyxs: TMenuItem;
dc_tcyy: TDBChart;
Series2: TPieSeries;
Image1: TImage;
f_yyfx_psrlb: TMenuItem;
f_yyfx_yylx: TMenuItem;
yylx: TQuery;
d_yylx: TDataSource;
yylxhj: TFloatField;
yylxyylx: TStringField;
yylxyylx1: TStringField;
srlbsrlb: TStringField;
dc_srlb: TDBChart;
PieSeries4: TPieSeries;
fwyxsfwym: TStringField;
Panel14: TPanel;
DBGrid13: TDBGrid;
yl: TToolButton;
PrinterSetup: TPrinterSetupDialog;
gzry: TTable;
y_jzfs: TTable;
t_xflb: TTable;
t_yylx: TTable;
t_srlb: TTable;
t: TTable;
cl: TTable;
cycz: TTable;
t_tcyy: TTable;
ckzl: TTable;
N2: TMenuItem;
N4: TMenuItem;
procedure zxClick(Sender: TObject);
procedure f_yyfx_pckxfClick(Sender: TObject);
procedure f_yyfx_pclxsClick(Sender: TObject);
procedure f_yyfx_pctxsClick(Sender: TObject);
procedure f_yyfx_pcyxsClick(Sender: TObject);
procedure f_yyfx_pjzfsClick(Sender: TObject);
procedure f_yyfx_pkrrsClick(Sender: TObject);
procedure f_yyfx_pkrtcClick(Sender: TObject);
procedure f_yyfx_psdxsClick(Sender: TObject);
procedure f_yyfx_pfwyxsClick(Sender: TObject);
procedure f_yyfx_pxflbClick(Sender: TObject);
procedure f_yyfx_pyylxClick(Sender: TObject);
procedure f_yyfx_ptcyyClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bzClick(Sender: TObject);
procedure dyClick(Sender: TObject);
procedure tcClick(Sender: TObject);
procedure f_yyfx_psrlbClick(Sender: TObject);
procedure MenuItem76Click(Sender: TObject);
procedure ylClick(Sender: TObject);
procedure MenuItem18Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure MenuItem74Click(Sender: TObject);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
f_yyfx: Tf_yyfx;
implementation
uses u_main, uabout, ug_wait;
{$R *.DFM}
procedure Tf_yyfx.zxClick(Sender: TObject);
begin
if tp1.date>tp2.date then
begin
messagebox(handle,'系统不能按所设的时间段设置进行查询!','系统提示信息',MB_OK+MB_ICONWARNING);
exit;
end;
case i_fx of
0:
begin
// main.hbyyfx(sdxs,tp1.date,tp2.date);
// main.hbyyfx(sdxs,now,now);
sdxs.active:=false;
// sdxs.ParamByName('rq1').value:=date;
// sdxs.ParamByName('rq2').value:=date;
// ParamByName('rq1').value:=date;
// ParamByName('rq2').value:=date;
sdxs.active:=true;
dc_sdxs.RefreshDataSet(sdxs,dc_sdxs.Series[0]);
dc_sdxs.RefreshData;
end;
1:
begin
main.hbyyfx(fwyxs,tp1.date,tp2.date);
dc_fwyxs.RefreshDataSet(krtc,dc_fwyxs.Series[0]);
dc_fwyxs.RefreshData;
end;
2:
begin
main.hbyyfx(jzfs,tp1.date,tp2.date);
dc_jzfs.RefreshDataSet(jzfs,dc_jzfs.Series[0]);
dc_jzfs.RefreshData;
end;
3:
begin
main.hbyyfx(xflb,tp1.date,tp2.date);
dc_xflb.RefreshDataSet(xflb,dc_xflb.Series[0]);
dc_xflb.RefreshData;
end;
4:
begin
main.hbyyfx(yylx,tp1.date,tp2.date);
dc_yylx.RefreshDataSet(yylx,dc_yylx.Series[0]);
dc_yylx.RefreshData;
end;
5:
begin
main.hbyyfx(srlb,tp1.date,tp2.date);
dc_srlb.RefreshDataSet(srlb,dc_srlb.Series[0]);
dc_srlb.RefreshData;
end;
6:
begin
main.hbyyfx(ctxs,tp1.date,tp2.date);
dc_ctxs.RefreshDataSet(ctxs,dc_ctxs.Series[0]);
dc_ctxs.RefreshData;
end;
7:
begin
main.hbyyfx(clxs,tp1.date,tp2.date);
Dc_clxs.RefreshDataSet(clxs,Dc_clxs.Series[0]);
Dc_clxs.RefreshData;
end;
8:
begin
main.hbyyfx(cyxs,tp1.date,tp2.date);
dc_cyxs.RefreshDataSet(cyxs,dc_cyxs.Series[0]);
dc_cyxs.RefreshData;
end;
9:
begin
main.hbyyfx(krtc,tp1.date,tp2.date);
dc_krtc.RefreshDataSet(krtc,dc_krtc.Series[0]);
dc_krtc.RefreshData;
end;
10:
begin
main.hbyyfx(tcyy,tp1.date,tp2.date);
dc_tcyy.RefreshDataSet(tcyy,dc_tcyy.Series[0]);
dc_tcyy.RefreshData;
end;
11:
begin
main.hbyyfx(krrs,tp1.date,tp2.date);
dc_krrs.RefreshDataSet(krrs,dc_krrs.Series[0]);
dc_krrs.RefreshData;
end;
12:
begin
main.hbyyfx(ckxf,tp1.date,tp2.date);
dc_ckxf.RefreshDataSet(ckxf,dc_ckxf.Series[0]);
dc_ckxf.RefreshData;
end;
end;
end;
procedure Tf_yyfx.f_yyfx_pckxfClick(Sender: TObject);
begin
fxfs.caption:='常客消费分析';
i_fx:=12;
zxClick(sender);
yyfx.PageIndex:=12;
end;
procedure Tf_yyfx.f_yyfx_pclxsClick(Sender: TObject);
begin
fxfs.caption:='菜类销售分析';
i_fx:=7;
zxClick(sender);
yyfx.PageIndex:=7;
end;
procedure Tf_yyfx.f_yyfx_pctxsClick(Sender: TObject);
begin
fxfs.caption:='餐厅销售分析';
i_fx:=6;
zxClick(sender);
yyfx.PageIndex:=6;
end;
procedure Tf_yyfx.f_yyfx_pcyxsClick(Sender: TObject);
begin
fxfs.caption:='菜肴销售分析';
i_fx:=8;
zxClick(sender);
yyfx.PageIndex:=8;
end;
procedure Tf_yyfx.f_yyfx_pjzfsClick(Sender: TObject);
begin
fxfs.caption:='结帐方式分析';
i_fx:=2;
zxClick(sender);
yyfx.PageIndex:=2;
end;
procedure Tf_yyfx.f_yyfx_pkrrsClick(Sender: TObject);
begin
fxfs.caption:='客人人数分析';
i_fx:=11;
zxClick(sender);
yyfx.PageIndex:=11;
end;
procedure Tf_yyfx.f_yyfx_pkrtcClick(Sender: TObject);
begin
fxfs.caption:='客人退菜分析';
i_fx:=9;
zxClick(sender);
yyfx.PageIndex:=9;
end;
procedure Tf_yyfx.f_yyfx_psdxsClick(Sender: TObject);
begin
fxfs.caption:='时段销售分析';
i_fx:=0;
zxClick(sender);
yyfx.PageIndex:=0;
end;
procedure Tf_yyfx.f_yyfx_pfwyxsClick(Sender: TObject);
begin
fxfs.caption:='服务员销售分析';
i_fx:=1;
zxClick(sender);
yyfx.PageIndex:=1;
end;
procedure Tf_yyfx.f_yyfx_pxflbClick(Sender: TObject);
begin
fxfs.caption:='消费类别分析';
i_fx:=3;
zxClick(sender);
yyfx.PageIndex:=3;
end;
procedure Tf_yyfx.f_yyfx_pyylxClick(Sender: TObject);
begin
fxfs.caption:='营业类型分析';
i_fx:=4;
zxClick(sender);
yyfx.PageIndex:=4;
end;
procedure Tf_yyfx.f_yyfx_ptcyyClick(Sender: TObject);
begin
fxfs.caption:='退菜原因分析';
i_fx:=10;
zxClick(sender);
yyfx.PageIndex:=10;
end;
procedure Tf_yyfx.FormShow(Sender: TObject);
begin
if not gzry.Active then gzry.Active:=true;
if not y_jzfs.Active then y_jzfs.Active:=true;
if not t_xflb.Active then t_xflb.Active:=true;
if not t_yylx.Active then t_yylx.Active:=true;
if not y_jzfs.Active then y_jzfs.Active:=true;
if not t_srlb.Active then t_srlb.Active:=true;
if not t.Active then t.Active:=true;
if not cl.Active then cl.Active:=true;
if not y_jzfs.Active then y_jzfs.Active:=true;
if not cycz.Active then cycz.Active:=true;
if not t_tcyy.Active then t_tcyy.Active:=true;
if not ckzl.Active then ckzl.Active:=true;
case i_fx of
0:fxfs.caption:='时段销售分析';
1:fxfs.caption:='服务员销售分析';
2:fxfs.caption:='结帐方式分析';
3:fxfs.caption:='消费类别分析';
4:fxfs.caption:='营业类型分析';
5:fxfs.caption:='收入类别分析';
6:fxfs.caption:='餐厅销售分析';
7:fxfs.caption:='菜类销售分析';
8:fxfs.caption:='菜肴销售分析';
9:fxfs.caption:='客人退菜分析';
10:fxfs.caption:='退菜原因分析';
11:fxfs.caption:='客人人数分析';
12:fxfs.caption:='常客消费分析';
end;
//zxClick(sender);
yyfx.PageIndex:=i_fx;
g_wait.close;
end;
procedure Tf_yyfx.bzClick(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpJump('tasyyfx');
end;
procedure Tf_yyfx.dyClick(Sender: TObject);
begin
zxclick(sender);
case i_fx of
0:dc_sdxs.Print;
1:dc_fwyxs.Print;
2:dc_jzfs.Print;
3:dc_xflb.Print;
4:dc_yylx.Print;
5:dc_srlb.Print;
6:dc_ctxs.Print;
7:Dc_clxs.Print;
8:dc_cyxs.Print;
9:dc_krtc.Print;
10:dc_tcyy.Print;
11:dc_krrs.Print;
12:dc_ckxf.Print;
end;
end;
procedure Tf_yyfx.tcClick(Sender: TObject);
begin
close;
end;
procedure Tf_yyfx.f_yyfx_psrlbClick(Sender: TObject);
begin
fxfs.caption:='收入类别分析';
i_fx:=5;
zxClick(sender);
yyfx.PageIndex:=5;
end;
procedure Tf_yyfx.MenuItem76Click(Sender: TObject);
begin
about.showmodal;
end;
procedure Tf_yyfx.ylClick(Sender: TObject);
begin
//
end;
procedure Tf_yyfx.MenuItem18Click(Sender: TObject);
begin
PrinterSetup.Execute;
end;
procedure Tf_yyfx.FormClose(Sender: TObject; var Action: TCloseAction);
begin
f_yyfx.Release;
f_yyfx:=NIL;
end;
procedure Tf_yyfx.MenuItem74Click(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpCommand(Help_Finder,0);
end;
procedure Tf_yyfx.N4Click(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpCommand(Help_PartialKey,0);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -