Commit bb959b67 by Sweet Zhang

预览薪资单对接

parent eb5410a2
......@@ -32,7 +32,8 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
checkLogin(url: string): boolean {
const lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
if (this.authService.isLoggedIn || (lifeCustomerInfo && lifeCustomerInfo['customerId'] && lifeCustomerInfo['practitionerId'])) {
// 如果是AGMS预览薪资单跳转进来的,不需要登录
if (this.authService.isLoggedIn || (lifeCustomerInfo && lifeCustomerInfo['customerId'] && lifeCustomerInfo['practitionerId']) || (url.indexOf('preFlag=AGMS') >= 0 && url.indexOf('salary_detail') >= 0)) {
return true;
}
// Store the attempted URL for redirecting
......
<div class="wrapper">
<div class="header">
<div (click)="goBack()" style="position: absolute;left: 10px;top: 10px;">返回</div>
<div (click)="goBack()" style="position: absolute;left: 10px;top: 10px;" *ngIf="!isPreSalary">返回</div>
<!-- <div class="paginate">
<div class="pre"><span class="iconfont icon-fanhui"></span>上一期</div>
<div class="next">下一期<span class="iconfont icon-ar-r"></span></div>
</div> -->
<div class="price">
<div>
<div *ngIf="!isPreSalary">
<div class="pre" (click)="querySalaryDetail('pre')"><span class="iconfont icon-fanhui"></span>上一期</div>
<div class="salay">¥{{after_tax_comis | number: "1.2-2"}}</div>
<div class="salay">¥{{after_tax_comis | number: "1.2-2"}}</div>
<div class="next" (click)="querySalaryDetail('next')">下一期<span class="iconfont icon-ar-r"></span></div>
</div>
<div *ngIf="isPreSalary" style="justify-content: center;">
<div class="salay">¥{{after_tax_comis | number: "1.2-2"}}</div>
</div>
<p><span class="cash">{{years}}年{{month}}月佣金</span></p>
</div>
</div>
......@@ -84,7 +87,7 @@
<div class="item_detail" (click)="jumpToFirstYearSales(breedingBonus,'育成奖金',2,6)" *ngIf="breedingBonus">
<span>育成奖金</span>
<span class="red">{{breedingBonus.commission | number: "1.2-2"}}<i class="iconfont icon-ar-r"></i></span>
</div>
</div>
</div>
<div class="item">
<div class="title" style="justify-content: inherit;" (click)="otherToastShow = true">
......@@ -117,7 +120,7 @@
</div>
<div class="item" style="margin-right: 19px;">
<div class="title">
<span>佣金合计(A+B+C)</span>
<span>佣金合计(A+B+C)</span>
<span class="red">{{totalCommission | number: "1.2-2"}}</span>
</div>
</div>
......@@ -125,7 +128,7 @@
<div class="part">
<div class="item" style="margin-right: 19px;">
<div class="title">
<span (click)="otherTaxFlag = true">代扣个人所得税/增值税/附加税(D)<span class="iconfont icon-wenhao" style="margin-top: 3px;color: #f8002e;margin-left: 3px;"></span></span>
<span (click)="otherTaxFlag = true">代扣个人所得税/增值税/附加税(D)<span class="iconfont icon-wenhao" style="margin-top: 3px;color: #f8002e;margin-left: 3px;"></span></span>
<span class="red">{{deduction | number: "1.2-2" }}</span>
</div>
<!-- <a style="color:#2c67a0;" (click)="lookTak()">点击查看个人所得税明细</a> -->
......@@ -134,12 +137,12 @@
<div class="part">
<div class="item" style="margin-right: 19px;">
<div class="title">
<span>本期实领(A+B+C-D)</span>
<span>本期实领(A+B+C-D)</span>
<span class="red">{{after_tax_comis | number: "1.2-2"}}</span>
</div>
</div>
</div>
</div>
<div *ngIf="taxToastShow">
<ydlife-detail-modal [application]="1"
......
......@@ -84,22 +84,38 @@ export class SalaryDetailComponent implements OnInit {
otherTaxFlag:boolean = false;
abc:number;
isBasic:any;
// 是否是预览薪资单
isPreSalary:boolean;
preFlag:string;
constructor(private _toast: ToastService,public lifeCommonService: LifeCommonService,
private activatedRoute: ActivatedRoute,
private router:Router,
private myService:MyService) { }
ngOnInit() {
this.practitionerIdEG = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerIdEG'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.payScaleListQuery();
this.years = this.activatedRoute.snapshot.queryParams.years?this.activatedRoute.snapshot.queryParams.years:null;
this.month = this.activatedRoute.snapshot.queryParams.month?this.activatedRoute.snapshot.queryParams.month:null;
this.agent_id = this.activatedRoute.snapshot.queryParams.agent_id?this.activatedRoute.snapshot.queryParams.agent_id:null;
this.isBasic = this.activatedRoute.snapshot.queryParams.isBasic?this.activatedRoute.snapshot.queryParams.isBasic:null;
this.lifeCommonService.setTitle(`${this.years}年本期实发佣金`);
this.querySalaryDetail(null);
this.preFlag = this.lifeCommonService.getQueryString('preFlag');
this.isPreSalary = this.lifeCommonService.getQueryString('preFlag') === 'AGMS';
if(this.isPreSalary){
this.practitionerId = this.lifeCommonService.getQueryString('practitionerId');
this.years = this.lifeCommonService.getQueryString('years');
this.month = this.lifeCommonService.getQueryString('month');
this.isBasic = this.lifeCommonService.getQueryString('isBasic');
this.lifeCommonService.setTitle(`${this.years}年本期实发佣金`);
this.querySalaryDetail(null);
}else{
this.practitionerIdEG = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerIdEG'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.payScaleListQuery();
this.years = this.activatedRoute.snapshot.queryParams.years?this.activatedRoute.snapshot.queryParams.years:null;
this.month = this.activatedRoute.snapshot.queryParams.month?this.activatedRoute.snapshot.queryParams.month:null;
this.agent_id = this.activatedRoute.snapshot.queryParams.agent_id?this.activatedRoute.snapshot.queryParams.agent_id:null;
this.isBasic = this.activatedRoute.snapshot.queryParams.isBasic?this.activatedRoute.snapshot.queryParams.isBasic:null;
this.lifeCommonService.setTitle(`${this.years}年本期实发佣金`);
this.querySalaryDetail(null);
}
}
querySalaryDetail(type){
......@@ -153,18 +169,23 @@ export class SalaryDetailComponent implements OnInit {
break;
}
}
}
}
this.router.navigate(['/salary_detail'],{ queryParams: { years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic},replaceUrl: true});
const param = {
let param = {
years:this.years,
month:this.month,
agent_id:this.agent_id,
practitionerId:this.practitionerId,
isBasic:this.isBasic
}
if(this.isPreSalary){
param['isActive'] = '1',
param['preFlag'] = 'AGMS'
}else{
this.router.navigate(['/salary_detail'],{ queryParams: { years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic},replaceUrl: true});
}
this.myService.querySalaryDetail(param).subscribe((res)=>{
this.totalCommission = res['data']['abc'];
this.deduction = res['data']['d'];
......@@ -239,7 +260,7 @@ export class SalaryDetailComponent implements OnInit {
}
/**
*
*
* @param type
* 1.跳转到保单
* 2.跳转到体系
......@@ -251,10 +272,18 @@ export class SalaryDetailComponent implements OnInit {
if(item.pdfOssPath){
window.open( item.pdfOssPath)
}else{
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic}});
if(this.isPreSalary){
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic,preFlag:this.preFlag,practitionerId:this.practitionerId}});
}else{
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic}});
}
}
}else{
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic}});
if(this.isPreSalary){
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic,preFlag:this.preFlag,practitionerId:this.practitionerId}});
}else{
this.router.navigate([`/salary_detail/${salaryType}`],{queryParams:{type:type,salaryName:salaryName,years:this.years,month:this.month,agent_id:this.agent_id,isBasic:this.isBasic}});
}
}
}
......@@ -269,9 +298,9 @@ export class SalaryDetailComponent implements OnInit {
//初始化佣奖类型
initSalay(){
this.fycSalesInfo = this.rycSalesInfo = this.fycTutorInfo = this.rycTutorInfo = this.fycMeritsInfo =
this.rycMeritsInfo= this.recommendAward= this.systemRecommendAward = this.specialManagementAward=
this.otherPreTaxDeduction = this.IncentiveBonus = this.addWeight = this.quarterlyBonus= this.onlineAward=
this.fycSalesInfo = this.rycSalesInfo = this.fycTutorInfo = this.rycTutorInfo = this.fycMeritsInfo =
this.rycMeritsInfo= this.recommendAward= this.systemRecommendAward = this.specialManagementAward=
this.otherPreTaxDeduction = this.IncentiveBonus = this.addWeight = this.quarterlyBonus= this.onlineAward=
this.monthlySalesAddWeight = this.independentBrokerAllowance =this.directCounseling = this.indirectCounseling=
this.breedingBonus = this.TLCoachingAllowance = this.continuedAnnualSalesBonus =null;
}
......
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute,Router } from "@angular/router";
import { LifeCommonService } from 'src/app/common/life-common.service';
import { MyService } from '../my.service';
@Component({
......@@ -18,6 +19,7 @@ export class SalaryFirstYearComponent implements OnInit {
month:any;
years:any;
agent_id:any;
practitionerId:any;
//保单列表
policyList:Array<any>;
//体系列表
......@@ -29,7 +31,8 @@ export class SalaryFirstYearComponent implements OnInit {
withdrawId:any;
customerFortuneWithdraws:Array<any>;
isBasic:any;
constructor(private activatedRoute: ActivatedRoute,private myService:MyService) { }
preFlag:string = this.lifeCommonService.getQueryString('preFlag');
constructor(private activatedRoute: ActivatedRoute,private myService:MyService,private lifeCommonService:LifeCommonService) { }
ngOnInit() {
this.type = this.activatedRoute.snapshot.queryParams.type?this.activatedRoute.snapshot.queryParams.type:null;
......@@ -39,6 +42,11 @@ export class SalaryFirstYearComponent implements OnInit {
this.month = this.activatedRoute.snapshot.queryParams.month?this.activatedRoute.snapshot.queryParams.month:null;
this.agent_id = this.activatedRoute.snapshot.queryParams.agent_id?this.activatedRoute.snapshot.queryParams.agent_id:null;
this.isBasic = this.activatedRoute.snapshot.queryParams.isBasic?this.activatedRoute.snapshot.queryParams.isBasic:null;
if(this.preFlag==='AGMS'){
this.practitionerId = this.lifeCommonService.getQueryString('practitionerId');
}else{
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
}
this.searchStaffSalaryDetails();
}
......@@ -64,13 +72,17 @@ export class SalaryFirstYearComponent implements OnInit {
* 14.银盾在线佣金-》H5
*/
searchStaffSalaryDetails(){
const param = {
let param = {
years:this.years,
month:this.month,
agent_id:this.agent_id,
practitionerId:JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId:this.practitionerId,
isBasic:this.isBasic
}
if(this.preFlag==='AGMS'){
param['isActive'] = 1;
param['preFlag'] = 'AGMS';
}
this.myService.searchStaffSalaryDetails(param).subscribe((res)=>{
if(res['data']){
if(this.salaryType == 1){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment