import { Component, OnInit } from '@angular/core';
import { LifeCommonService } from '../../common/life-common.service';
import { ActivatedRoute,Router } from "@angular/router";


@Component({
  selector: 'ydlife-salary-detail',
  templateUrl: './salary-detail.component.html',
  styleUrls: ['./salary-detail.component.scss']
})
export class SalaryDetailComponent implements OnInit {
  monDtlPeriod:string;
  takFlag:boolean = false;
  constructor(public lifeCommonService: LifeCommonService,
    private activatedRoute: ActivatedRoute,
    private router:Router) { }

  ngOnInit() {
    this.monDtlPeriod = this.activatedRoute.snapshot.queryParams.monDtlPeriod?this.activatedRoute.snapshot.queryParams.monDtlPeriod:null;
    this.lifeCommonService.setTitle(`${this.lifeCommonService.getDate(this.monDtlPeriod)}本期实发佣金`);
  }

  lookTak(){
    this.takFlag = true;
    console.log(this.takFlag)
  }

  jumpToFirstYearSales(){
    this.router.navigate([`/salary_detail/${this.monDtlPeriod}`]);

  }
}
