mel_mx.pas

来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 514 行

PAS
514
字号
unit mel_mx;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Mask, ppProd, ppClass, ppReport, ppComm, ppRelatv, ppDB,
  ppDBPipe, ppDBBDE, Db, ADODB, ppPrnabl, ppCtrls, ppBands, ppCache,
  ppStrtch, ppSubRpt, ppVar, ExtCtrls;

type
  TFormmel_mx = class(TForm)
    ADOmel_mx: TADODataSet;
    DataSource1: TDataSource;
    ppBDEPipeline1: TppBDEPipeline;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Button1: TButton;
    Button2: TButton;
    MaskEdit3: TMaskEdit;
    Label9: TLabel;
    Panel1: TPanel;
    ADOCommand1: TADOCommand;
    ADOmel_mxb: TADODataSet;
    DataSource2: TDataSource;
    ppBDEPipeline2: TppBDEPipeline;
    ppReport1: TppReport;
    ppHeaderBand1: TppHeaderBand;
    ppLabel52: TppLabel;
    ppLabel1: TppLabel;
    ppLabel2: TppLabel;
    ppLabel3: TppLabel;
    ppLabel4: TppLabel;
    ppLabel5: TppLabel;
    ppLabel6: TppLabel;
    ppLabel7: TppLabel;
    ppLabel8: TppLabel;
    ppLabel9: TppLabel;
    ppLabel10: TppLabel;
    ppLabel11: TppLabel;
    ppLabel12: TppLabel;
    ppLabel13: TppLabel;
    ppLabel14: TppLabel;
    ppLabel15: TppLabel;
    ppLabel16: TppLabel;
    ppLabel17: TppLabel;
    ppLabel18: TppLabel;
    ppLabel19: TppLabel;
    ppLabel20: TppLabel;
    ppLabel21: TppLabel;
    ppLabel22: TppLabel;
    ppLabel23: TppLabel;
    ppLabel24: TppLabel;
    ppLabel25: TppLabel;
    ppLabel26: TppLabel;
    ppLabel27: TppLabel;
    ppLabel28: TppLabel;
    ppLabel29: TppLabel;
    ppLabel30: TppLabel;
    ppLabel31: TppLabel;
    ppLabel32: TppLabel;
    ppLabel33: TppLabel;
    ppLabel34: TppLabel;
    ppLabel35: TppLabel;
    ppLabel36: TppLabel;
    ppLabel37: TppLabel;
    ppLabel38: TppLabel;
    ppLabel39: TppLabel;
    ppLabel40: TppLabel;
    ppLabel41: TppLabel;
    ppLabel42: TppLabel;
    ppLabel43: TppLabel;
    ppLabel44: TppLabel;
    ppLabel45: TppLabel;
    ppLabel46: TppLabel;
    ppLabel47: TppLabel;
    ppLabel48: TppLabel;
    ppLabel49: TppLabel;
    ppLabel50: TppLabel;
    ppLabel51: TppLabel;
    ppLabel53: TppLabel;
    ppLabel54: TppLabel;
    ppLabel55: TppLabel;
    ppLabel56: TppLabel;
    ppLabel57: TppLabel;
    ppLabel58: TppLabel;
    ppLabel59: TppLabel;
    ppLabel60: TppLabel;
    ppLabel61: TppLabel;
    ppLabel62: TppLabel;
    ppLabel63: TppLabel;
    ppLabel64: TppLabel;
    ppLabel65: TppLabel;
    ppLabel66: TppLabel;
    ppLabel67: TppLabel;
    ppLine1: TppLine;
    ppLine2: TppLine;
    ppLine3: TppLine;
    ppDBText46: TppDBText;
    ppDetailBand1: TppDetailBand;
    ppSubReport1: TppSubReport;
    ppChildReport1: TppChildReport;
    ppDetailBand2: TppDetailBand;
    ppDBText28: TppDBText;
    ppDBText29: TppDBText;
    ppDBText30: TppDBText;
    ppDBText31: TppDBText;
    ppDBText32: TppDBText;
    ppDBText33: TppDBText;
    ppDBText34: TppDBText;
    ppDBText35: TppDBText;
    ppDBText36: TppDBText;
    ppDBText37: TppDBText;
    ppDBText38: TppDBText;
    ppDBText39: TppDBText;
    ppDBText40: TppDBText;
    ppDBText41: TppDBText;
    ppDBText42: TppDBText;
    ppDBText43: TppDBText;
    ppDBText44: TppDBText;
    ppDBText45: TppDBText;
    ppDBText48: TppDBText;
    ppDBText49: TppDBText;
    ppDBText50: TppDBText;
    ppDBText51: TppDBText;
    ppDBText52: TppDBText;
    ppDBText53: TppDBText;
    ppDBText54: TppDBText;
    ppDBText55: TppDBText;
    ppDBText56: TppDBText;
    ppDBText57: TppDBText;
    ppDBText58: TppDBText;
    ppDBText59: TppDBText;
    ppDBText60: TppDBText;
    ppDBText61: TppDBText;
    ppDBText62: TppDBText;
    ppDBText63: TppDBText;
    ppDBText64: TppDBText;
    ppDBText65: TppDBText;
    ppDBText66: TppDBText;
    ppDBText67: TppDBText;
    ppDBText68: TppDBText;
    ppDBText69: TppDBText;
    ppDBText70: TppDBText;
    ppDBText71: TppDBText;
    ppDBText72: TppDBText;
    ppDBText73: TppDBText;
    ppDBText74: TppDBText;
    ppGroup3: TppGroup;
    ppGroupHeaderBand3: TppGroupHeaderBand;
    ppGroupFooterBand3: TppGroupFooterBand;
    ppLabel104: TppLabel;
    ppLabel105: TppLabel;
    ppLabel110: TppLabel;
    ppLine7: TppLine;
    ppLabel113: TppLabel;
    ppLabel82: TppLabel;
    ppSystemVariable7: TppSystemVariable;
    ppLabel121: TppLabel;
    ppDBCalc1: TppDBCalc;
    ppDBCalc2: TppDBCalc;
    ppFooterBand2: TppFooterBand;
    ppSystemVariable3: TppSystemVariable;
    ppGroup2: TppGroup;
    ppGroupHeaderBand2: TppGroupHeaderBand;
    ppGroupFooterBand2: TppGroupFooterBand;
    ppReport2: TppReport;
    ppHeaderBand2: TppHeaderBand;
    ppLabel69: TppLabel;
    ppLabel70: TppLabel;
    ppLabel71: TppLabel;
    ppLabel72: TppLabel;
    ppLabel73: TppLabel;
    ppLabel74: TppLabel;
    ppLabel75: TppLabel;
    ppLabel76: TppLabel;
    ppLabel77: TppLabel;
    ppLabel78: TppLabel;
    ppLabel79: TppLabel;
    ppLabel80: TppLabel;
    ppLabel81: TppLabel;
    ppLabel92: TppLabel;
    ppLine4: TppLine;
    ppLabel83: TppLabel;
    ppLabel84: TppLabel;
    ppLabel85: TppLabel;
    ppLabel86: TppLabel;
    ppLabel87: TppLabel;
    ppLabel88: TppLabel;
    ppLabel89: TppLabel;
    ppLabel90: TppLabel;
    ppLabel91: TppLabel;
    ppLabel93: TppLabel;
    ppLabel94: TppLabel;
    ppLabel95: TppLabel;
    ppLabel96: TppLabel;
    ppLabel97: TppLabel;
    ppLabel98: TppLabel;
    ppLabel99: TppLabel;
    ppLabel100: TppLabel;
    ppLabel101: TppLabel;
    ppLabel102: TppLabel;
    ppLabel103: TppLabel;
    ppLine5: TppLine;
    ppLabel106: TppLabel;
    ppLabel107: TppLabel;
    ppDBText75: TppDBText;
    ppLabel109: TppLabel;
    ppLabel108: TppLabel;
    ppLabel112: TppLabel;
    ppLabel114: TppLabel;
    ppLine10: TppLine;
    ppDetailBand3: TppDetailBand;
    ppSubReport2: TppSubReport;
    ppChildReport2: TppChildReport;
    ppDetailBand4: TppDetailBand;
    ppDBText1: TppDBText;
    ppDBText2: TppDBText;
    ppDBText3: TppDBText;
    ppDBText4: TppDBText;
    ppDBText5: TppDBText;
    ppDBText6: TppDBText;
    ppDBText7: TppDBText;
    ppDBText8: TppDBText;
    ppDBText9: TppDBText;
    ppDBText10: TppDBText;
    ppDBText11: TppDBText;
    ppDBText12: TppDBText;
    ppDBText13: TppDBText;
    ppDBText14: TppDBText;
    ppDBText15: TppDBText;
    ppDBText16: TppDBText;
    ppDBText17: TppDBText;
    ppDBText18: TppDBText;
    ppDBText19: TppDBText;
    ppDBText20: TppDBText;
    ppDBText21: TppDBText;
    ppDBText22: TppDBText;
    ppDBText23: TppDBText;
    ppDBText24: TppDBText;
    ppDBText25: TppDBText;
    ppDBText26: TppDBText;
    ppDBText27: TppDBText;
    ppGroup4: TppGroup;
    ppGroupHeaderBand4: TppGroupHeaderBand;
    ppGroupFooterBand4: TppGroupFooterBand;
    ppLabel68: TppLabel;
    ppLine9: TppLine;
    ppDBCalc3: TppDBCalc;
    ppDBCalc4: TppDBCalc;
    ppLabel115: TppLabel;
    ppLabel116: TppLabel;
    ppLabel117: TppLabel;
    ppLabel119: TppLabel;
    ppLabel120: TppLabel;
    ppSystemVariable1: TppSystemVariable;
    ppFooterBand1: TppFooterBand;
    ppSystemVariable2: TppSystemVariable;
    ppGroup1: TppGroup;
    ppGroupHeaderBand1: TppGroupHeaderBand;
    ppGroupFooterBand1: TppGroupFooterBand;
    ppLine11: TppLine;
    ppLine12: TppLine;
    ppLabel111: TppLabel;
    ppLabel118: TppLabel;
    ppLabel122: TppLabel;
    ppLabel123: TppLabel;
    Label1: TLabel;
    ppLine13: TppLine;
    ppLine14: TppLine;
    ppLine15: TppLine;
    ppLine16: TppLine;
    ppLine8: TppLine;
    ppLine17: TppLine;
    ppLine18: TppLine;
    ppLine19: TppLine;
    ppLine20: TppLine;
    ppLine21: TppLine;
    ppLine22: TppLine;
    ppLine23: TppLine;
    ppLine24: TppLine;
    ppLine25: TppLine;
    ppLine26: TppLine;
    ppLine27: TppLine;
    ppLine28: TppLine;
    ppLine29: TppLine;
    ppLine30: TppLine;
    ppLine31: TppLine;
    ppLine32: TppLine;
    ppLine33: TppLine;
    ppLine34: TppLine;
    ppLine35: TppLine;
    ppLine36: TppLine;
    ppLine37: TppLine;
    ppLine38: TppLine;
    ppLine39: TppLine;
    ppLine40: TppLine;
    ppLine41: TppLine;
    ppLine42: TppLine;
    ppLine43: TppLine;
    ppLine44: TppLine;
    ppLine45: TppLine;
    ppLine46: TppLine;
    ppLine47: TppLine;
    ppLine48: TppLine;
    ppLine49: TppLine;
    ppLine50: TppLine;
    ppLine51: TppLine;
    ppLine52: TppLine;
    ppLine53: TppLine;
    ppLine54: TppLine;
    ppLine55: TppLine;
    ppLine56: TppLine;
    ppLine57: TppLine;
    ppLine58: TppLine;
    ppLine59: TppLine;
    ppLine60: TppLine;
    ppLine61: TppLine;
    ppLine62: TppLine;
    ppLine63: TppLine;
    ppLine64: TppLine;
    ppLine65: TppLine;
    ppLine66: TppLine;
    ppLine67: TppLine;
    ppLine68: TppLine;
    ppLine69: TppLine;
    ppLine70: TppLine;
    ppLine71: TppLine;
    ppLine72: TppLine;
    ppLine73: TppLine;
    ppLine74: TppLine;
    ppLine75: TppLine;
    ppLine76: TppLine;
    ppLine77: TppLine;
    ppLine78: TppLine;
    ppLine79: TppLine;
    ppLine80: TppLine;
    ppLine81: TppLine;
    ppLine82: TppLine;
    ppLine6: TppLine;
    ppLine83: TppLine;
    ppLine84: TppLine;
    ppLine85: TppLine;
    ppLine86: TppLine;
    ppLine87: TppLine;
    ppLine88: TppLine;
    ppLine89: TppLine;
    ppLine90: TppLine;
    ppLine91: TppLine;
    ppLine92: TppLine;
    ppLine93: TppLine;
    ppLine94: TppLine;
    ppLine95: TppLine;
    ppLine96: TppLine;
    ppLine97: TppLine;
    ppLine98: TppLine;
    ppLine99: TppLine;
    ppLine100: TppLine;
    ppLine101: TppLine;
    ppLine102: TppLine;
    ppLine103: TppLine;
    ppLine104: TppLine;
    ppLine105: TppLine;
    ppLine106: TppLine;
    ppLine107: TppLine;
    ppLine108: TppLine;
    ppLine109: TppLine;
    ppLine110: TppLine;
    ppLine111: TppLine;
    ppLine112: TppLine;
    ppLine113: TppLine;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ppReport1PreviewFormCreate(Sender: TObject);
    procedure ppReport2PreviewFormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ppReport1BeforePrint(Sender: TObject);
    procedure ppReport2BeforePrint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Formmel_mx: TFormmel_mx;
  k2:string;
implementation
uses datamol,main,publicfunction;
{$R *.DFM}

procedure TFormmel_mx.Button2Click(Sender: TObject);
begin
  close;
end;

procedure TFormmel_mx.Button1Click(Sender: TObject);
var
  i:integer;
  s:string;
begin
  Panel1.Visible:=true;
  panel1.update;
  application.ProcessMessages;
  if k2=MaskEdit3.text then
  else
  if MaskEdit3.text<>'' then
    begin
      s:=MaskEdit3.text;
      k2:=MaskEdit3.text;
      for i:=0 to length(s)-1 do
        if s[i]='/' then
          s[i]:='.';
      ADOCommand1.Prepared;
      ADOCommand1.CommandText:='exec mel_mx '''+s+''' ';
      ADOCommand1.Execute;
    end;
  if RadioButton1.Checked then
  begin
    ADOmel_mx.Close;
    ADOmel_mx.CommandText:='select dept,substring(workno,len(workno)-3,4) as workno,name,m0101,m0102,m0201,m0202,m0301,m0302,m0401,m0402,m0501,m0502,'+
    'm0601,m0602,m0701,m0702,m0801,m0802,m0901,m0902,m1001,m1002,m1101,m1102,m1201,m1202,m1301,m1302,m1401,m1402,m1501,m1502,m1601,m1602,'+
    'm1701,m1702,m1801,m1802,m1901,m1902,m2001,m2002, totlemt01, totlemt02,recdate from mel_totle  order by dept,workno';
    ADOmel_mx.Open;
    Panel1.Visible:=false;
    ppReport1.print;
  end
  else begin
        ADOmel_mxb.Close;
        ADOmel_mxb.CommandText:='select dept,substring(workno,len(workno)-3,4) as workno,name,m2101,m2102,m2201,m2202,m2301,m2302,m2401,m2402,m2501,m2502,'+
        'm2601,m2602,m2701,m2702,m2801,m2802,m2901,m2902,m3001,m3002,m3101,m3102, totlemb01, totlemb02,recdate from mel_totle  order by dept,workno';
        ADOmel_mxb.Open;
        Panel1.Visible:=false;
        ppReport2.print;
       end;
end;

procedure TFormmel_mx.FormCreate(Sender: TObject);
begin
  maskedit3.Text:=copy(datetostr(date),1,7);
  RadioButton1.Checked:=true;
  k2:='';
end;

procedure TFormmel_mx.ppReport1PreviewFormCreate(Sender: TObject);
begin
  tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;

procedure TFormmel_mx.ppReport2PreviewFormCreate(Sender: TObject);
begin
  tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;

procedure TFormmel_mx.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  k2:='';
end;

procedure TFormmel_mx.ppReport1BeforePrint(Sender: TObject);
begin
  pplabel113.Caption:='制表人:'+pubworkname;
end;

procedure TFormmel_mx.ppReport2BeforePrint(Sender: TObject);
var
  day :integer;
begin
  pplabel119.caption:='制表人:'+pubworkname;
  day:=getdays(copy(MaskEdit3.Text,6,2),copy(MaskEdit3.text,1,4));
  if day=30 then
    begin
      pplabel108.Visible:=false;
      pplabel112.Visible:=false;
      pplabel114.Visible:=false;
      ppdbtext26.Visible:=false;
      ppdbtext27.visible:=false;
    end;
   if day=29 then
     begin
       pplabel108.Visible:=false;
       pplabel112.Visible:=false;
       pplabel114.Visible:=false;
       ppdbtext26.Visible:=false;
       ppdbtext27.visible:=false;
       pplabel81.Visible:=false;
       pplabel102.Visible:=false;
       pplabel103.Visible:=false;
       ppdbtext22.Visible:=false;
       ppdbtext23.visible:=false;
     end;
   if day=28 then
     begin
       pplabel108.Visible:=false;
       pplabel112.Visible:=false;
       pplabel114.Visible:=false;
       ppdbtext26.Visible:=false;
       ppdbtext27.visible:=false;
       pplabel81.Visible:=false;
       pplabel102.Visible:=false;
       pplabel103.Visible:=false;
       ppdbtext22.Visible:=false;
       ppdbtext23.visible:=false;
       pplabel80.Visible:=false;
       pplabel100.Visible:=false;
       pplabel101.Visible:=false;
       ppdbtext20.Visible:=false;
       ppdbtext21.visible:=false;
     end;
end;

end.

⌨️ 快捷键说明

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