Commit 51c53002 by sunchao

薪资单列表页显示逻辑调整

parent 608def54
......@@ -28,7 +28,24 @@
</div>
<div id="salesContent" *ngIf="selectedId == 2">
<div class="salesItem" *ngFor="let payScaleItem of payScaleInfos" (click)="getPdf(payScaleItem.monShId,payScaleItem.pdfOssPath)">
<div *ngIf="nowYear>2021">
<div class="salesItem" *ngFor="let historyPartItem of historyPart2" (click)="enterDetail(payScaleItem.years,payScaleItem.month,payScaleItem.loginName,payScaleItem.isBasic)">
<div class="icon_bolck" style="top: 16px;"><span class="iconfont icon-xinzidan"></span></div>
<div style="padding-right: 20px;">
<div class="line">
<span>薪资日期</span>
<div>{{historyPartItem.years}}年{{historyPartItem.month}}月</div>
</div>
<div class="line">
<span>本期实发佣金</span>
<div class="price">¥{{historyPartItem.monDtlRAmount | number: "1.2-2"}}</div>
</div>
</div>
<div class="iconfont icon-ar-r"
style="width: 20px;height: 20px;position: absolute;right: 2px;top: 23px;"></div>
</div>
</div>
<div class="salesItem" *ngFor="let payScaleItem of historyPart1" (click)="getPdf(payScaleItem.monShId,payScaleItem.pdfOssPath)">
<div class="icon_bolck"><span class="iconfont icon-xinzidan"></span></div>
<div class="line">
<div>薪资日期</div>
......@@ -57,7 +74,7 @@
</div>
</div>
</div>
<div style="text-align: center;margin-top: 20px;" *ngIf="payScaleInfos?.length<=0">暂无数据</div>
<div style="text-align: center;margin-top: 20px;" *ngIf="(historyPart2?.length<=0) && (historyPart1?.length<=0)">暂无数据</div>
</div>
</div>
......
......@@ -16,17 +16,23 @@ export class SalaryComponent implements OnInit {
toastInfo: any;
tabList:Array<any>;
selectedId:any = 0;
nowYear:any = (new Date()).getFullYear();
historyPart1:Array<any> = [];
historyPart2:Array<any> = [];
constructor(private activatedRoute: ActivatedRoute,private myService: MyService,
public lifeCommonService: LifeCommonService,
private router: Router) { }
private router: Router) {
}
ngOnInit() {
console.log(this.nowYear)
const title = this.activatedRoute.snapshot.data[0]['title'];
this.lifeCommonService.setTitle(title);
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.payScaleListQuery();
this.tabList = [
{name:'2021年',id:0},
{name:`${this.nowYear}年`,id:0},
{name:'历史薪资',id:2}
]
}
......@@ -35,11 +41,20 @@ export class SalaryComponent implements OnInit {
this.myService.payScaleListQuery({ practitionerId:this.practitionerId,isHistory: this.selectedId}).subscribe((res) => {
if (res['success']) {
if(this.selectedId == 0){
if(this.nowYear == 2021){
this.payScaleInfos = res['data']['payScaleInfos'].filter((item)=>{
return (item.years == 2021 && item.month >= 5)
});
}else{
this.payScaleInfos = res['data']['payScaleInfos'].filter((item)=>{
this.payScaleInfos = res['data']['payScaleInfos'];
}
}else{
//2021年5月之后的数据
this.historyPart2 = res['data']['payScaleInfos'].filter((item)=>{
return new Date(item.monDtlPeriod).getTime() >= 1619827200000
});
//2021年5月之前的数据
this.historyPart1 = res['data']['payScaleInfos'].filter((item)=>{
return new Date(item.monDtlPeriod).getTime() < 1619827200000
});
}
......
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