⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ecscmain.pas

📁 一个电力企业的后台管理程序
💻 PAS
字号:
unit EcscMain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Main, ActnList, ImgList, Menus, OleCtrls, SHDocVw, StdCtrls, ComCtrls,
  ToolWin, ExtCtrls, Buttons, ppBands, ppCtrls, ppVar, ppPrnabl, ppClass,
  ppCache, ppComm, ppRelatv, ppProd, ppReport;

type
  TForm_Main = class(TMainForm)
    mmi_Set: TMenuItem;
    mmi_Set_SysConfig: TMenuItem;
    mmi_Set_SysRole: TMenuItem;
    N44: TMenuItem;
    mmi_Set_LoginManager: TMenuItem;
    mmi_Set_PersonPhone: TMenuItem;
    mmi_SysData: TMenuItem;
    mmi_SysData_Hostconfig: TMenuItem;
    mmi_SysData_IVRParam: TMenuItem;
    mmi_yw: TMenuItem;
    mmi_yw_counseling: TMenuItem;
    mmi_yw_delete: TMenuItem;
    mmi_Static: TMenuItem;
    mmi_static_workstate: TMenuItem;
    mmi_Static_DealState: TMenuItem;
    mmi_Static_Trend: TMenuItem;
    TB_Static: TToolButton;
    TB_Yw: TToolButton;
    TB_Set: TToolButton;
    TB_SysData: TToolButton;
    ToolButton10: TToolButton;
    TB_Quit: TToolButton;
    Act_Quit: TAction;
    mmi_Set_Dept: TMenuItem;
    mmi_Static_ProgramStatic: TMenuItem;
    mmi_Static_FaultStatic: TMenuItem;
    TB_Counseling: TToolButton;
    Act_Counseling: TAction;
    Act_postmail: TAction;
    TB_postmail: TToolButton;
    mmi_SysData_PhoneLine: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    ActionList_carte: TActionList;
    Act_user_relogin: TAction;
    Act_Set_SysConfig: TAction;
    Act_Set_SysRole: TAction;
    Act_Set_Dept: TAction;
    Act_Set_LoginManager: TAction;
    Act_Set_personphone: TAction;
    Act_SysData_HostConfig: TAction;
    Act_SysData_ivrparam: TAction;
    Act_yw_counseling: TAction;
    Act_yw_delete: TAction;
    Act_Static_WorkState: TAction;
    Act_Static_DealState: TAction;
    Act_static_trend: TAction;
    Act_Static_DeptState: TAction;
    Act_Static_ProgramStatic: TAction;
    Act_Static_FaultStatic: TAction;
    act_SysData_PhoneLine: TAction;
    Act_AgentWork: TAction;
    Act_AgentCall: TAction;
    Act_InputAskInfo: TAction;
    Act_BusiCount: TAction;
    Act_BusFx: TAction;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    N12: TMenuItem;
    N13: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    mmi_Static_DeptStatic: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure FormShowHint(Sender: TObject);
    procedure Act_QuitExecute(Sender: TObject);
    procedure Act_postmailExecute(Sender: TObject);
    procedure Act_user_reloginExecute(Sender: TObject);
    procedure mmi_User_QuitClick(Sender: TObject);
    procedure Act_Set_SysConfigExecute(Sender: TObject);
    procedure Act_Set_SysRoleExecute(Sender: TObject);
    procedure Act_Set_DeptExecute(Sender: TObject);
    procedure Act_Set_LoginManagerExecute(Sender: TObject);
    procedure Act_Set_personphoneExecute(Sender: TObject);
    procedure Act_SysData_HostConfigExecute(Sender: TObject);
    procedure Act_SysData_ivrparamExecute(Sender: TObject);
    procedure Act_yw_counselingExecute(Sender: TObject);
    procedure Act_yw_deleteExecute(Sender: TObject);
    procedure Act_Static_WorkStateExecute(Sender: TObject);
    procedure Act_Static_DealStateExecute(Sender: TObject);
    procedure Act_static_trendExecute(Sender: TObject);
    procedure Act_Static_ProgramStaticExecute(Sender: TObject);
    procedure Act_Static_FaultStaticExecute(Sender: TObject);
    procedure act_SysData_PhoneLineExecute(Sender: TObject);
    procedure N4Click(Sender: TObject);
    procedure mmi_Static_DeptStaticClick(Sender: TObject);
    procedure Act_AgentWorkExecute(Sender: TObject);
    procedure Act_AgentCallExecute(Sender: TObject);
    procedure Act_InputAskInfoExecute(Sender: TObject);
    procedure Act_BusiCountExecute(Sender: TObject);
    procedure Act_BusFxExecute(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
    procedure N15Click(Sender: TObject);

  private
    procedure AppException(Sender: TObject;E:Exception);
    procedure SetRoleAuth;
  public
    { Public declarations }
  end;

var
  Form_Main: TForm_Main;

implementation
uses PostMailFrm, SystemDM, sysconfigfrm, SystemPH, RoleSet, DepartmentFrm, LoginManagerFM,
     phonemanageFRM, pashostconfig, IvrPathFrm, CounselingFrm, RecordBatchDelFrm,
     WorkStateTJFrm, DealStateTJFrm, TrendTJFrm, prgramstaticFrm, prgramstaticFrm0,
  phonelinefm, U_Gwbj, U_SySet,GzRepFrm,UserCompRepFrm,ClientAskRepFrm,Frm_CutUser_Static,
  ZhRepFrm,AgentCountFrm,RepWork,CallRecordForm,AskInfoForm,BusiCount,CoutAllYwForm,AgentStateFrm,Frm_Dst,
  DepartmentWorFrm,Frm_ClientElecAsk,Frm_NormalStatic;

{$R *.DFM}


procedure TForm_Main.AppException(Sender: TObject; E: Exception);
begin
  //Application.messagebox('一个无法预料的错误!','电力客服数据管理系统',1) ;
  ShowMessage(E.message);
end;

procedure TForm_Main.FormCreate(Sender: TObject);
begin
  inherited;
  Application.OnException:=AppException;
  SetRoleAuth;
end;

procedure TForm_Main.FormShowHint(Sender: TObject);
begin
  inherited;
   StatusBar1.Panels[0].Text:=Application.Hint;
end;

procedure TForm_Main.Act_QuitExecute(Sender: TObject);
begin
  inherited;
  close;
end;

procedure TForm_Main.Act_postmailExecute(Sender: TObject);
var
  TempForm:TForm;
begin
  inherited;
  Screen.Cursor := crHourGlass;
  try
    TempForm:= FindForm(TFrm_Gwsz, '');
    if not Assigned(TempForm) then
    begin
      Application.CreateForm(TFrm_Gwsz,Frm_Gwsz);
    end;
    WebIsHide(1);
    //Frm_Gwsz.WindowState:=wsMaximized;
    Frm_Gwsz.Visible := True;
    Frm_Gwsz.Show;
  finally
    Screen.Cursor := crDefault;
  end;
//  if not assigned(Form_PostMail) then application.CreateForm(TForm_PostMail,Form_PostMail);
//  Form_PostMail.ShowModal;
//  if not assigned(Frm_Gwsz) then application.CreateForm(TFrm_Gwsz,Frm_Gwsz);
//  Frm_Gwsz.ShowModal;

end;

procedure TForm_Main.SetRoleAuth;
begin
  if sysDM.WorkAuthStr[1]='1' then
    TB_Set.enabled:=true
  else
    TB_Set.enabled:=false;
  if sysDM.WorkAuthStr[2]='1' then
    TB_SysData.enabled:=true
  else
    TB_SysData.enabled:=false;
  if sysDM.WorkAuthStr[3]='1' then
  begin
    TB_YW.enabled:=true;
    TB_Counseling.Enabled:=true;
    ToolButton2.Enabled :=true;
    ToolButton3.Enabled :=true;
  end else
  begin
    TB_YW.enabled:=false;
    TB_Counseling.Enabled:=false;
    ToolButton2.Enabled :=false;
    ToolButton3.Enabled :=false;
  end;
  if sysDM.WorkAuthStr[4]='1' then
    TB_Static.enabled:=true
  else
    TB_Static.enabled:=false;
end;

procedure TForm_Main.Act_user_reloginExecute(Sender: TObject);
begin
  inherited;
  SetRoleAuth;
end;

procedure TForm_Main.mmi_User_QuitClick(Sender: TObject);
begin
  inherited;
  close;
end;

procedure TForm_Main.Act_Set_SysConfigExecute(Sender: TObject);
var
  tempForm:TForm;
begin
  inherited;
  Screen.Cursor := crHourGlass;
  try
    TempForm:= FindForm(TFrm_Sysconfig, '');
    if  not Assigned(TempForm) then
    begin
      Application.CreateForm(TFrm_Sysconfig,Frm_Sysconfig);
    end;
    WebIsHide(1);
    Frm_sysconfig.WindowState:=wsMaximized;
    Frm_sysconfig.Show;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TForm_Main.Act_Set_SysRoleExecute(Sender: TObject);
var
   TempForm:TForm;
begin
  inherited;
  Screen.Cursor := crHourGlass;
  try
    TempForm:= FindForm(TForm_RoleSet, '');
    if not Assigned(TempForm) then
    begin
      Application.CreateForm(TForm_RoleSet,Form_RoleSet);
    end;
    WebIsHide(1);
    Form_RoleSet.WindowState:=wsMaximized;
    Form_RoleSet.Show;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TForm_Main.Act_Set_DeptExecute(Sender: TObject);
var
  TempForm:TForm;
begin
  inherited;
  Screen.Cursor := crHourGlass;
  try
    TempForm:= FindForm(TForm_DepartmentWork, '');
    if not Assigned(TempForm) then
    begin
      Application.CreateForm(TForm_DepartmentWork,Form_DepartmentWork);
    end;
    WebIsHide(1);
    Form_DepartmentWork.WindowState:=wsMaximized;
    Form_DepartmentWork.Show;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TForm_Main.Act_Set_LoginManagerExecute(Sender: TObject);
begin
  inherited;
  WebIsHide(1);
  OpenForm(Sender,Tfrm_LoginManager);
end;

procedure TForm_Main.Act_Set_personphoneExecute(Sender: TObject);
begin
  inherited;
  WebIsHide(1);
  OpenForm(Sender,Tfrm_phonemanage);
end;

procedure TForm_Main.Act_SysData_HostConfigExecute(Sender: TObject);
begin
  inherited;
  WebIsHide(1);
  Screen.Cursor := crHourGlass;
  try
    Application.CreateForm(TFrm_HostConfig,Frm_HostConfig);
    Frm_HostConfig.WindowState:=wsMaximized;
    Frm_HostConfig.Show;
  finally
    Screen.Cursor := crDefault;
  end;
end;

procedure TForm_Main.Act_SysData_ivrparamExecute(Sender: TObject);
begin
  inherited;
  //WebIsHide(1);
  Frm_IvrPath:=TFrm_IvrPath.Create(Application);
  Frm_IvrPath.Show;
end;

procedure TForm_Main.Act_yw_counselingExecute(Sender: TObject);
var
   TempForm:TForm;
begin
  inherited;
    Screen.Cursor := crHourGlass;
  try
    TempForm:= FindForm(TFrm_AskInfo, '');
    if not Assigned(TempForm) then
    begin
      Application.CreateForm(TFrm_AskInfo,Frm_AskInfo);
    end;
    WebIsHide(1);
    //Frm_Gwsz.WindowState:=wsMaximized;
    Frm_AskInfo.Visible := True;
    Frm_AskInfo.Show;
  finally
    Screen.Cursor := crDefault;
  end;

{  Screen.Cursor := crHourGlass;
  try
//    TempForm:= FindForm(TForm_Counsetling, '');
    TempForm:= FindForm(TFrm_AskInfo, '');

    if not Assigned(TempForm) then
    begin
      Application.CreateForm(TFrm_AskInfo,Frm_AskInfo);
    end;
    WebIsHide(1);
    Frm_AskInfo.WindowState:=wsMaximized;
    Frm_AskInfo.Show;
  finally
    Screen.Cursor := crDefault;
  end;}
{ with TFrm_AskInfo.Create(nil)do
  try
 //  WebIsHide(1);
   Visible := True;
   Show;
  finally
   Free;
  // WebIsHide(0);
  end;}
end;

procedure TForm_Main.Act_yw_deleteExecute(Sender: TObject);
begin
  inherited;
  //WebIsHide(1);
  if not Assigned(Form_BatchDel) then
  begin
    Form_BatchDel:=TForm_BatchDel.Create(Application);
  end;
  Form_BatchDel.ShowModal;
end;

procedure TForm_Main.Act_Static_WorkStateExecute(Sender: TObject);
var
 TempForm : TFrm_AgentCount;
begin
  inherited;
  WebIsHide(1);
  TempForm := TFrm_AgentCount.Create(nil);
  try
   TempForm.ShowModal;
  finally
   TempForm.Free;
  end;
 WebIsHide(0); 
end;

procedure TForm_Main.Act_Static_DealStateExecute(Sender: TObject);
var
 TempForm : TFrm_ZhRep;
begin
  inherited;
  WebIsHide(1);
  TempForm := TFrm_ZhRep.Create(nil);
  try
   TempForm.ShowModal;
  finally
   TempForm.Free;
  end;
  WebIsHide(0); 
end;

procedure TForm_Main.Act_static_trendExecute(Sender: TObject);
var
 TempForm : TFrm_ClientAsk;
begin
  inherited;
  WebIsHide(1);
  TempForm := TFrm_ClientAsk.Create(nil);
  try
   TempForm.ShowModal;
  finally
   TempForm.Free;
  end;
  WebIsHide(0);
end;

procedure TForm_Main.Act_Static_ProgramStaticExecute(Sender: TObject);
var
 TempForm : TFrm_ClientComp;
begin
  inherited;
  WebIsHide(1);
  TempForm := TFrm_ClientComp.Create(nil);
  try
   TempForm.ShowModal;
  finally
   TempForm.Free;
  end;
  WebIsHide(0);
end;

procedure TForm_Main.Act_Static_FaultStaticExecute(Sender: TObject);
var
 TempForm : TFrm_GzRep;
begin
  inherited;
 WebIsHide(1);
 TempForm := TFrm_GzRep.Create(nil);
 try
  TempForm.ShowModal;
 finally
  TempForm.Free;
 end;
 WebIsHide(0);
end;

procedure TForm_Main.act_SysData_PhoneLineExecute(Sender: TObject);
begin
  inherited;
  Fm_PhoneLine:=TFm_PhoneLine.Create(Application);
  try
    Fm_PhoneLine.ShowModal;
  finally
    Fm_PhoneLine.Free;
  end;
end;

procedure TForm_Main.N4Click(Sender: TObject);
begin
  inherited;
  Application.CreateForm(TFrm_SySet,Frm_SySet);
  Frm_SySet.ShowModal;
  Frm_SySet.Free;
end;

procedure TForm_Main.mmi_Static_DeptStaticClick(Sender: TObject);
var
 TempForm : TForm_ClientElecAsk;
begin
  inherited;
  TempForm := TForm_ClientElecAsk.Create(nil);
  try
   TempForm.ShowModal;
  finally
   TempForm.Free;
  end;
end;

procedure TForm_Main.Act_AgentWorkExecute(Sender: TObject);
begin
  inherited;
 with TFrm_AgentWork.Create(nil) do
 try
  ShowModal;
 finally
  Free;
 end;
end;

procedure TForm_Main.Act_AgentCallExecute(Sender: TObject);
begin
  inherited;
 {with TFrm_CallRep.Create(nil) do
 try
  ShowModal;
 finally
  Free;
 end;}
  with TForm_NormalStatic.Create(nil) do
  try
    ShowModal;
  finally
    Free;
  end;
end;

procedure TForm_Main.Act_InputAskInfoExecute(Sender: TObject);
begin
  inherited;
 with TFrm_AskInfo.Create(nil)do
 try
  ShowModal;
 finally
  Free;
 end;
end;

procedure TForm_Main.Act_BusiCountExecute(Sender: TObject);
begin
  inherited;
  with TFrm_BusiCount.Create(nil)do
  try
   ShowModal;
  finally
   Free;
  end;
end;

procedure TForm_Main.Act_BusFxExecute(Sender: TObject);
begin
  inherited;
 with TForm_CutUser_Static.Create(nil) do
 try
  ShowModal;
 finally
  Free;
 end;
 {with TFrm_AllBusi.Create(nil)do
 try
  ShowModal;
 finally
  Free;
 end;}
end;

procedure TForm_Main.ToolButton2Click(Sender: TObject);
begin
  inherited;
 with TForm_AgetState.Create(nil)do
 try
  ShowModal;
 finally
  Free;
 end;
end;

procedure TForm_Main.ToolButton3Click(Sender: TObject);
begin
  inherited;
 with TForm_Dts.Create(nil)do
 try
  ShowModal;
 finally
  Free;
 end;
end;

procedure TForm_Main.N15Click(Sender: TObject);
var
  TempForm:TForm;
begin
  inherited;
  Screen.Cursor :=crHourGlass;
  try
    TempForm:=FindForm(TForm_Department,'');
    if not Assigned(TempForm) then
      Application.CreateForm(TForm_Department,Form_Department);
    WebIsHide(1);
    Form_Department.WindowState :=wsMaximized;
    Form_Department.Show;
  Finally
    Screen.Cursor :=crDefault;
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -