reportforpeople.pas

来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 1,558 行 · 第 1/4 页

PAS
1,558
字号
    ppLine132: TppLine;
    ppLine133: TppLine;
    ppLine134: TppLine;
    ppLine135: TppLine;
    ppLine136: TppLine;
    ppLine137: TppLine;
    ppLine138: TppLine;
    ppLine139: TppLine;
    ppLine140: TppLine;
    ppLine141: TppLine;
    ppDBText36: TppDBText;
    ppDBText37: TppDBText;
    ppDBText38: TppDBText;
    ppDBText39: TppDBText;
    ppDBText42: TppDBText;
    ppDBText44: TppDBText;
    ppDBText115: TppDBText;
    ppDBText116: TppDBText;
    ppDBText117: TppDBText;
    ppDBText118: TppDBText;
    ppDBText119: TppDBText;
    ppDBText120: TppDBText;
    ppDBText121: TppDBText;
    ppDBText122: TppDBText;
    procedure ppDBText13GetText(Sender: TObject; var Text: String);
    procedure ppReport1PreviewFormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ppReport1AfterPrint(Sender: TObject);
    procedure ppDBText24GetText(Sender: TObject; var Text: String);
    procedure RadioGroup1Click(Sender: TObject);
    procedure ppReport2AfterPrint(Sender: TObject);
    procedure ppReport3AfterPrint(Sender: TObject);
    procedure ppReport5PreviewFormCreate(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure ppReport4AfterPrint(Sender: TObject);
    procedure ppReport5AfterPrint(Sender: TObject);
    procedure ppReport6AfterPrint(Sender: TObject);
    procedure ppReport7AfterPrint(Sender: TObject);
    procedure ppReport8AfterPrint(Sender: TObject);
    procedure DateTimePicker1CloseUp(Sender: TObject);
    procedure DateTimePicker2CloseUp(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ppDBText8GetText(Sender: TObject; var Text: String);
    procedure ppDBText67GetText(Sender: TObject; var Text: String);
    procedure ppDBText146GetText(Sender: TObject; var Text: String);
    procedure ppReport16PreviewFormCreate(Sender: TObject);
    procedure ppReport1BeforePrint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  reportformpeople: Treportformpeople;

implementation
uses main,datamol, personalreport;
{$R *.DFM}

procedure Treportformpeople.ppDBText13GetText(Sender: TObject;
  var Text: String);
begin
   if text='0' then
      text:='未婚'
   else
      text:='已婚';
end;

procedure Treportformpeople.ppReport1PreviewFormCreate(Sender: TObject);
begin
  tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
 // TppViewer(tppReport(Sender).PreviewForm.Viewer).ZoomSetting := zsWholePage;
end;

procedure Treportformpeople.Button1Click(Sender: TObject);
var fmat1:string;
begin
  if fmat='/' then
    fmat1:='    /  /  ';
  if fmat='-' then
    fmat1:='    -  -  ';
  if (MaskEdit1.text=fmat1) or (MaskEdit2.text=fmat1) then
    begin
      Application.MessageBox('日期输入不完整!','Error',mb_ok+mb_iconerror);
      exit;
    end;
  case radiogroup1.ItemIndex of
    0:begin
        reportforpeople.Close;
        reportforpeople.CommandText :='';
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1  and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno,indate';
        reportforpeople.Open;
        pplabel15.Caption:='员工基本资料一览表';
        pplabel65.Caption :=companyname1;
        pplabel74.Caption :=pubworkname;
        pplabel149.Caption :='';
        reportforpeople.Close;
      end;
    1:begin
        reportforpeople.Close;
        if combobox1.Text='全部' then
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno'
        else
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and dept='''+trim(combobox1.Text)+''' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno';
        reportforpeople.Open;
        pplabel17.Caption:=companyname1;//读取公司名称
        pplabel18.Caption :='员工基本资料表';
        pplabel21.Caption :=pubworkname;//读取系统变量pubworkname
        pplabel36.Caption :='部门: '+combobox1.Text ;
      end;
    2:begin
        reportforpeople.Close;
        if combobox2.Text='全部' then
        begin
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by prof,dept,workno';
          reportforpeople.Open;
          pplabel163.Caption:=companyname1;//读取公司名称
          pplabel180.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel166.Caption :='职务: '+combobox2.Text ;
        end
        else
        begin
          reportforpeople.commandtext:='select  * from per24010 where  prof='''+combobox2.Text+''' and leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by prof,dept,workno';
          reportforpeople.Open;
          pplabel37.Caption:=companyname1;//读取公司名称
          pplabel42.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel39.Caption :='职务: '+combobox2.Text ;
        end;
      end;
    3:begin
        reportforpeople.Close;
        if combobox8.Text='全部' then
        begin
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by sexname,dept, workno';
          reportforpeople.Open;
          pplabel15.Caption:='男女性员工基本资料表';
          pplabel195.Caption :=companyname1;
          pplabel197.Caption:=' '+maskedit1.Text+'----'+maskedit2.Text+' ';
          pplabel200.Caption :=pubworkname;
        end
        else if combobox8.text='男' then
        begin
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and sexname=''男'' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept, workno';
          reportforpeople.Open;
          pplabel65.Caption :=companyname1;
          pplabel149.Caption:=' '+maskedit1.Text+'----'+maskedit2.Text+' ';
          pplabel74.Caption :=pubworkname;
          pplabel15.Caption:='男性员工基本资料表';
        end
        else if combobox8.Text='女' then
         begin
           reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and sexname=''女'' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept, workno';
           reportforpeople.Open;
           pplabel65.Caption :=companyname1;
           pplabel149.Caption:=' '+maskedit1.Text+'----'+maskedit2.Text+' ';
           pplabel15.Caption:='女性员工基本资料表';
           pplabel74.Caption :=pubworkname;
         end;
      end;
    4:begin
        if combobox3.Text='全部' then
        begin
          adodataset1.close;
          adodataset1.commandtext:='select  a.*,left(a.provname,2) as prov from per24010 a where a.leave<>1 and a.stoppay<>1 and a.indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by  prov,a.dept,a.workno';
          adodataset1.Open;

        end
        else
        begin
          adodataset1.close;
          adodataset1.commandtext:='select  a.*,left(a.provname,2) as prov from per24010 a where a.leave<>1 and a.stoppay<>1 and a.provname like '''+copy(trim(combobox3.Text),1,2)+'%'+''' and a.indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by  prov,a.dept,a.workno';
          adodataset1.Open
        end;
          pplabel57.Caption:=companyname1;//读取公司名称
          pplabel78.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel58.Caption :='省籍: '+combobox3.Text ;
          pplabel59.caption:=maskedit1.Text+'------'+maskedit2.Text;
      end;
    5:begin
        reportforpeople.Close;
        if combobox4.Text='全部'then
        begin
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by degreename,dept,workno';
          reportforpeople.Open;
          pplabel215.Caption:=companyname1;//读取公司名称
          pplabel220.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel217.Caption :='学历: '+combobox4.Text ;
        end
        else
        begin
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and degreename= '''+(trim(combobox4.Text))+''' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by degreename,dept,workno';
          reportforpeople.Open;
          pplabel82.Caption:=companyname1;//读取公司名称
          pplabel87.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel84.Caption :='学历: '+combobox4.Text ;
        end;
      end;
    6:begin
        reportforpeople.Close;
        if combobox5.Text='全部' then
        begin
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by scheno,dept,workno';
          reportforpeople.Open;
          pplabel245.Caption:=companyname1;//读取公司名称
          pplabel250.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel247.Caption :='班次: '+combobox5.Text ;
        end
        else
        begin
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and scheno= '''+(trim(combobox5.Text))+''' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno';
          reportforpeople.Open;
          pplabel102.Caption:=companyname1;//读取公司名称
          pplabel107.Caption :=pubworkname;//读取系统变量pubworkname
          pplabel104.Caption :='班次: '+combobox5.Text ;
        end;
      end;
    7:begin
        reportforpeople.Close;
        if combobox6.Text='全部' then
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dothing,dept,workno '
         else
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and dothing= '''+(trim(combobox6.Text))+''' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dothing,dept,workno ';
        reportforpeople.Open;
        pplabel130.Caption:=companyname1;//读取公司名称
        pplabel136.Caption :=pubworkname;//读取系统变量pubworkname
        pplabel128.Caption :='行事历: '+combobox6.Text ;
      end;
    8:begin
        reportforpeople.Close;
        if combobox7.Text='全部' then
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') and mankind=''轮班'' order by ruleno,dept,workno '
        else
          reportforpeople.commandtext:='select  * from per24010 where leave<>1 and stoppay<>1 and ruleno= '''+(trim(combobox7.Text))+''' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') and mankind=''轮班''  order by ruleno,dept,workno ';
        reportforpeople.Open;
        pplabel142.Caption:=companyname1;//读取公司名称
        pplabel159.Caption :=pubworkname;//读取系统变量pubworkname
        pplabel144.Caption :='轮班规则: '+combobox7.Text ;
      end;
    9:begin
        reportforpeople.Close;
        if combobox9.Text='全部' then
        begin
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dayormon,dept,workno';
          pplabel280.Caption:='日月薪员工基本资料表';
          reportforpeople.Open;
          pplabel279.Caption :=companyname1;
          pplabel284.Caption :=pubworkname;
          pplabel281.Caption:=maskedit1.Text+'------'+maskedit2.Text;
        end
        else if combobox9.Text='日薪' then
        begin
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and dayormon=1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno';
          pplabel15.Caption:='日薪员工基本资料表';
          reportforpeople.Open;
          pplabel65.Caption :=companyname1;
          pplabel74.Caption :=pubworkname;
          pplabel149.Caption :='';
        end
        else if combobox9.Text='月薪' then
        begin
          reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and dayormon=0 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept, workno';
          pplabel15.Caption:='月薪员工基本资料表';
          reportforpeople.Open;
          pplabel65.Caption :=companyname1;
          pplabel74.Caption :=pubworkname;
          pplabel149.Caption :='';
        end;
      end;
    10:begin
        reportforpeople.Close;
        reportforpeople.CommandText :='';
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and brushcard=1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept, workno';
        reportforpeople.Open;
        pplabel15.Caption:='刷卡员工基本资料表';
        pplabel65.Caption :=companyname1;
        pplabel74.Caption :=pubworkname;
        pplabel149.Caption :='';
        reportforpeople.Close;
      end;
    11:begin
        reportforpeople.Close;
        reportforpeople.CommandText :='';
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and brushcard=0 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,workno';
        reportforpeople.Open;
        pplabel15.Caption:='不打卡员工基本资料表';
        pplabel65.Caption :=companyname1;
        pplabel74.Caption :=pubworkname;
        pplabel149.Caption :='';
        reportforpeople.Close;
      end;
    12:begin
        reportforpeople.Close;
        reportforpeople.CommandText :='';
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and mankind=''计件'' and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept, workno';
        reportforpeople.Open;
        pplabel15.Caption:='计件员工基本资料表';
        pplabel65.Caption :=companyname1;
        pplabel74.Caption :=pubworkname;
        pplabel149.Caption :='';
        reportforpeople.Close;
      end;
    13:begin
        reportforpeople.Close;
        reportforpeople.CommandText :='';
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and try=1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,indate,workno';
        reportforpeople.Open;
        pplabel15.Caption:='试用期员工基本资料表';
        pplabel65.Caption :=companyname1;
        pplabel74.Caption :=pubworkname;
        pplabel149.Caption :='';
        reportforpeople.Close;
       end;
    14:
    begin
      reportforpeople.Close;
      if (maskedit1.Text=fmat1) or (maskedit2.Text=fmat1) then
      begin
        Application.messagebox('没有输入要查看新进人员的范围','系统提示',48);
        exit;
        maskedit1.SetFocus;
      end
      else
      begin
        reportforpeople.commandtext:='select * from per24010 where leave<>1 and stoppay<>1 and indate between convert(datetime,'''+maskedit1.Text+''') and convert(datetime,'''+maskedit2.Text+''') order by dept,indate,workno';
        reportforpeople.Open;
        pplabel167.Caption :=companyname1;
        pplabel172.Caption :=pubworkname;
        pplabel169.caption:=maskedit1.text+'~~'+maskedit2.Text;
      end;
    end;
  end;
  case radiogroup1.ItemIndex of
    0,3,10,11,12,13:
     begin
       if (combobox8.Text='全部') and (combobox8.Visible)=true then
         ppreport11.Print
       else
       ppReport1.print;
     end;
    1:
      begin
       if (combobox1.Text='全部')and(combobox1.visible=true) then
       begin
         pplabel15.Caption:='员工基本资料一览表';
         pplabel65.Caption :=companyname1;
         pplabel74.Caption :=pubworkname;
         pplabel149.Caption :='';
         ppReport1.print;
       end
       else
       ppReport2.print;
     end;
    2:
      begin
        if (combobox2.Text='全部')and(combobox2.Visible=true) then
          ppreport10.Print          /////总表职称
        else
          ppReport3.print;
     end;
    4:
      begin
//        preport16.Print
      end;
    5:
      begin
        if (combobox4.Text='全部') and (combobox4.visible=true) then
          ppreport12.Print
        else
          ppReport5.print;
      end;
    6:
      begin
        if (combobox5.Text='全部')and(combobox5.visible=true) then
          ppreport14.Print
        else
          ppReport6.print;
      end;
    7:
      begin
        ppReport7.print;
      end;
    8:
      begin
        ppReport8.print;
      end;
    9:
    begin

⌨️ 快捷键说明

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