📄 busicount.~pas
字号:
unit BusiCount;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
fcOutlookList, fcButton, fcImgBtn, fcShapeBtn, ExtCtrls, fcClearPanel,
fcButtonGroup, fcOutlookBar, Spin, ComCtrls, StdCtrls, DsFancyButton,
WorddotRpt, db, DBTables;
type
TFrm_BusiCount = class(TForm)
PC_Content: TPageControl;
TabSheet1: TTabSheet;
DsFancyButton1: TDsFancyButton;
DsFancyButton2: TDsFancyButton;
DsFancyButton3: TDsFancyButton;
DsFancyButton4: TDsFancyButton;
DsFancyButton7: TDsFancyButton;
DsFancyButton8: TDsFancyButton;
Panel2: TPanel;
Panel3: TPanel;
Label5: TLabel;
Bevel1: TBevel;
RB_Normal: TRadioButton;
RB_Word: TRadioButton;
Panel4: TPanel;
fcShapeBtn1: TfcShapeBtn;
fcShapeBtn2: TfcShapeBtn;
fcShapeBtn3: TfcShapeBtn;
SE_CurrYear: TSpinEdit;
SE_AddUpYear: TSpinEdit;
SE_CurrMon: TSpinEdit;
SE_AddUpMon: TSpinEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label6: TLabel;
Label7: TLabel;
TabSheet2: TTabSheet;
Panel1: TPanel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
SE_CYear: TSpinEdit;
SE_AYear: TSpinEdit;
SE_CMon: TSpinEdit;
SE_AMon: TSpinEdit;
Panel5: TPanel;
Label14: TLabel;
Bevel2: TBevel;
Rb_Nor: TRadioButton;
Rb_Wor: TRadioButton;
Panel6: TPanel;
fcShapeBtn4: TfcShapeBtn;
fcShapeBtn5: TfcShapeBtn;
fcShapeBtn6: TfcShapeBtn;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
WorddotRpt1: TWorddotRpt;
procedure fcShapeBtn2Click(Sender: TObject);
procedure fcShapeBtn1Click(Sender: TObject);
procedure fcShapeBtn3Click(Sender: TObject);
procedure fcShapeBtn6Click(Sender: TObject);
procedure fcShapeBtn5Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
Dt_Curr,Dt_End,Dt_AddUp, Dt_PiorCurr,Dt_PiorEnd, Dt_LastCurr, Dt_LastEnd, Dt_LastAddUp: TDateTime;
Satisfy_month_WX,Satisfy_total_WX,Satisfy_month_GY,Satisfy_total_GY,Satisfy_month_DY,Satisfy_total_DY,Satisfy_month_NX,Satisfy_total_NX:integer;
Satisfy_month_TSJB, Satisfy_total_TSJB, Satisfy_month_YWSL, Satisfy_total_YWSL:integer;
procedure PrepareData(AYyyyMm:string);
public
{ Public declarations }
function Embo(Int_Embo:word):integer;
PROCEDURE ALLMONTH_SE;
procedure AllYear_SE;
procedure GetStatNum(const TOTALTIME,starttime,endtime:TDateTime; serv_id,serv_type:string; var month_num,total_num:integer);
procedure ServeType(const TOTALTIME,starttime,endtime:TDateTime;var month_num,total_num:integer);
procedure CalWXGZ(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalGYJL(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalDYJL(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalNXGZ(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalTSJB(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalYWSL(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num,iOverTimeFinishmonth_Num,iOverTimeFinishtotal_Num,iSatisfymonth_Num,
iSatisfytotal_Num:integer; var OverTimeRate_month,OverTimeRate_total,SatisfyRate_month,SatisfyRate_total:string);
procedure CalCut(const totaltime, starttime, endtime:TDateTIme;var iSendmonth_Num,iSendtotal_Num,iFinishmonth_Num,iFinishtotal_Num,
iNoFinishmonth_Num,iNoFinishtotal_Num:integer);
procedure CalCJ(const starttime, endtime:TDateTIme;var iSendmonth_Num,iFinishmonth_Num,iNoFinishmonth_Num:integer);
end;
var
Frm_BusiCount: TFrm_BusiCount;
implementation
{$R *.DFM}
uses RepClass,SystemDM;
const
cst_simulate='无';
procedure TFrm_BusiCount.PrepareData(AYyyyMm:string);
begin
with SysDm.Qr_Temp do
begin
Close;
SQl.Text :='select top 1 Month_ID,Stat_Time from stat_month_service_num where Month_ID='''+AYyyyMm+'''';
Prepare;
Open;
if not IsEmpty then
begin
if FormatDateTime('YYYYMM',FieldbyName('Stat_Time').AsDateTime)<=AYyyyMm then
begin
Close;
SQL.Text :=format('delete from stat_month_service_num where Month_ID=''%S''',[AYyyyMm]);
Prepare;
ExecSQL;
Close;
SQL.Text :=format('exec USP_ALL_MONREP ''%S''',[Copy(AYyyyMm,1,4)+'-'+Copy(AYyyyMm,5,2)]);
Prepare;
ExecSQL;
end;
end else
begin
Close;
SQL.Text :=format('exec USP_ALL_MONREP ''%S''',[Copy(AYyyyMm,1,4)+'-'+Copy(AYyyyMm,5,2)]);
Prepare;
ExecSQL;
end;
end;
end;
procedure TFrm_BusiCount.fcShapeBtn2Click(Sender: TObject);
//var
//Temp: TOpAmountRpt;
begin
Try
if PC_Content.ActivePageIndex = 0 then
begin
ALLMONTH_SE;
{Temp := TOpAmountRpt.Create(Dt_curr,Dt_AddUp,True,True);
Temp.createOpDealAmountInfo;
if Rb_Normal.Checked then
Temp.printOpDealAmountRpt(0);
if Rb_Word.Checked then
Temp.printOpDealAmountRpt(2); }
end;
if PC_Content.ActivePageIndex = 1 then
begin
AllYear_SE;
{Temp := TOpAmountRpt.Create(Dt_curr,Dt_AddUp,True,True);
Temp.createOpCompareAmountInfo ;
if Rb_Nor.Checked then
Temp.printOpCompareAmountRpt(0);
if Rb_Wor.Checked then
Temp.printOpCompareAmountRpt(2); }
end;
finally
//Temp.Free;
end;
close;
end;
procedure TFrm_BusiCount.fcShapeBtn1Click(Sender: TObject);
var
Temp: TOpAmountRpt;
begin
Dt_Curr := EncodeDate(SE_CurrYear.Value,SE_CurrMon.Value,01);
Dt_AddUp := EncodeDate(SE_AddUpYear.Value,SE_AddUpMon.Value,01);
Temp := TOpAmountRpt.Create(Dt_curr,Dt_AddUp,True,True);
Try
Temp.createOpDealAmountInfo;
Temp.printOpDealAmountRpt(1);
finally
Temp.Free;
end;
end;
procedure TFrm_BusiCount.fcShapeBtn3Click(Sender: TObject);
begin
Close;
end;
procedure TFrm_BusiCount.fcShapeBtn6Click(Sender: TObject);
var
Temp: TOpAmountRpt;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -