Commit 6431560d by Chao Sun

薪资单

parent 07ab2a1f
...@@ -224,4 +224,9 @@ export class LifeCommonService { ...@@ -224,4 +224,9 @@ export class LifeCommonService {
return value; return value;
} }
getDate(str) {
str = String(str)
const newStr = str.substr(0, 4) + '年' + str.substr(4, 2) + '月';
return newStr;
}
} }
...@@ -81,7 +81,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -81,7 +81,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
{ no: 13, subtitle: '我的商机', icon: 'icon-xiansuo1', path: '', routerLink: 'business' }, { no: 13, subtitle: '我的商机', icon: 'icon-xiansuo1', path: '', routerLink: 'business' },
{ no: 12, subtitle: '我的保单', icon: 'icon-baodanyangben', path: '', routerLink: '' }, { no: 12, subtitle: '我的保单', icon: 'icon-baodanyangben', path: '', routerLink: '' },
{ no: 14, subtitle: '我的佣金', icon: 'icon-yongjin', path: '', routerLink: '' }, { no: 14, subtitle: '我的佣金', icon: 'icon-yongjin', path: '', routerLink: '' },
{ no: 19, subtitle: '我的薪资', icon: 'icon-yongjin', path: '', routerLink: 'salary' }, { no: 19, subtitle: '薪资单', icon: 'icon-xinzidan', path: '', routerLink: 'salary' },
{ no: '', subtitle: '', icon: '', path: '', routerLink: '' } { no: '', subtitle: '', icon: '', path: '', routerLink: '' }
], ],
isShow: true isShow: true
......
...@@ -317,18 +317,18 @@ export class MyService { ...@@ -317,18 +317,18 @@ export class MyService {
//薪资pdf //薪资pdf
payScalePdf(param) { payScalePdf(param) {
this.http.post(`${this.ydapi}/practitioner/payScalePdf`, param, { responseType: 'blob', observe: 'response' }).subscribe(data => { const url = this.ydapi + '/practitioner/payScalePdf';
console.log(data) return this.http
const link = document.createElement('a'); .post(url, JSON.stringify(param));
const blob = new Blob([data.body], { type: 'application/pdf;charset=UTF-8' }); // this.http.post(`${this.ydapi}/practitioner/payScalePdf`, param, { responseType: 'blob', observe: 'response' }).subscribe(data => {
console.log(blob) // const link = document.createElement('a');
link.setAttribute('href', window.URL.createObjectURL(blob)); // const blob = new Blob([data.body], { type: 'application/pdf;charset=UTF-8' });
link.setAttribute('download', data.headers.get('Content-Disposition').split('filename=')[1]); // link.setAttribute('href', window.URL.createObjectURL(blob));
alert(data.headers.get('Content-Disposition').split('filename=')[1]) // link.setAttribute('download', data.headers.get('Content-Disposition').split('filename=')[1]);
link.style.visibility = 'hidden'; // link.style.visibility = 'hidden';
document.body.appendChild(link); // document.body.appendChild(link);
link.click(); // link.click();
document.body.removeChild(link); // document.body.removeChild(link);
}) // })
} }
} }
<div class="salesWrapper"> <div class="salesWrapper">
<div class="salesContent"> <div class="salesContent">
<div class="salesItem" *ngFor="let payScaleItem of payScaleInfos"> <div class="salesItem" *ngFor="let payScaleItem of payScaleInfos">
<div class="icon_bolck"><span class="iconfont icon-yongjin"></span></div> <div class="icon_bolck"><span class="iconfont icon-xinzidan"></span></div>
<div class="line"> <div class="line">
<div>{{payScaleItem.monDtlPeriod}}</div> <div>薪资日期</div>
<!-- <span class="iconfont icon-ar-r" style="font-size: 10px;position: relative; right: -2px;"></span> --> <div>{{lifeCommonService.getDate(payScaleItem.monDtlPeriod)}}</div>
</div> </div>
<div class="line long_line"> <div class="line">
<span>实发佣金</span> <div>流水编号</div>
<div class="price">¥{{payScaleItem.monDtlRAmount | number: "1.2-2"}}</div> <div>{{payScaleItem.monShId}}</div>
</div> </div>
<div class="line long_line"> <div class="line">
<span>应发佣金</span> <span>应发佣金</span>
<div class="price">¥{{payScaleItem.monDtlAmount | number: "1.2-2"}}</div> <div class="price">¥{{payScaleItem.monDtlAmount | number: "1.0-2"}}</div>
</div>
<div class="line">
<span>扣除税</span>
<div class="price">¥{{(payScaleItem.monDtlAmount-payScaleItem.monDtlRAmount) | number: "1.0-2"}}</div>
</div> </div>
<div class="line long_line"> <div class="line">
<span>实发佣金</span>
<div class="price">¥{{payScaleItem.monDtlRAmount | number: "1.0-2"}}</div>
</div>
<div class="line">
<div></div> <div></div>
<!-- <div>{{(payScaleItem.createDate).substr(0,10)}}</div> --> <div (click)="getPdf(payScaleItem.monShId)">
<div (click)="getPdf(payScaleItem.monShId)">详细</div> 薪资单明细
<!-- <span class="iconfont icon-xiazai" style="font-size: 18px;color:#ff3500;"></span> -->
</div>
</div> </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="payScaleInfos?.length<=0">暂无数据</div>
</div> </div>
</div> </div>
\ No newline at end of file
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
height: 35px; height: 35px;
position: absolute; position: absolute;
left: 3px; left: 3px;
top: 20px; top: 50px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
border-radius: 50%; border-radius: 50%;
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MyService } from '../my.service'; import { MyService } from '../my.service';
import { LifeCommonService } from '../../common/life-common.service';
@Component({ @Component({
selector: 'ydlife-salary', selector: 'ydlife-salary',
templateUrl: './salary.component.html', templateUrl: './salary.component.html',
...@@ -7,11 +9,16 @@ import { MyService } from '../my.service'; ...@@ -7,11 +9,16 @@ import { MyService } from '../my.service';
}) })
export class SalaryComponent implements OnInit { export class SalaryComponent implements OnInit {
practitionerIdEG: any; practitionerIdEG: any;
practitionerId: any;
payScaleInfos: Array<any>; payScaleInfos: Array<any>;
constructor(private myService: MyService) { } //控制弹框
toastDialog: boolean;
toastInfo: any;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService) { }
ngOnInit() { ngOnInit() {
this.practitionerIdEG = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerIdEG']; this.practitionerIdEG = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerIdEG'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.payScaleListQuery(); this.payScaleListQuery();
} }
...@@ -28,7 +35,22 @@ export class SalaryComponent implements OnInit { ...@@ -28,7 +35,22 @@ export class SalaryComponent implements OnInit {
//下载pdf //下载pdf
getPdf(monShId) { getPdf(monShId) {
this.myService.payScalePdf({ monShId: monShId, practitionerId: Number(this.practitionerId) }).subscribe((res) => {
this.myService.payScalePdf({ monShId: monShId }) if (res['success']) {
if (res['data']['url']) {
window.open(res['data']['url'])
} else {
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: '暂无薪资单!',
timeout: 3000,
align: 'center'
};
return;
}
}
})
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
"description": "", "description": "",
"glyphs": [ "glyphs": [
{ {
"icon_id": "4908034",
"name": "薪资单",
"font_class": "xinzidan",
"unicode": "e67a",
"unicode_decimal": 59002
},
{
"icon_id": "9592761",
"name": "邮箱",
"font_class": "youxiang",
"unicode": "e679",
"unicode_decimal": 59001
},
{
"icon_id": "816614", "icon_id": "816614",
"name": "上引号", "name": "上引号",
"font_class": "shangyinhao", "font_class": "shangyinhao",
...@@ -1140,4 +1154,4 @@ ...@@ -1140,4 +1154,4 @@
"unicode_decimal": 58967 "unicode_decimal": 58967
} }
] ]
} }
\ No newline at end of file
...@@ -20,6 +20,12 @@ Created by iconfont ...@@ -20,6 +20,12 @@ Created by iconfont
/> />
<missing-glyph /> <missing-glyph />
<glyph glyph-name="xinzidan" unicode="&#59002;" d="M311.935 263.783h400.573V222.82600000000002H311.935v40.9593Zm0-130.123h400.573V92.70100000000002H311.935v40.9593Zm0 130.123M927.063 722.912c0 21.7363-9.90713 39.3328-28.5385 50.8662-36.0795 22.4757-75.2643 44.9517-111.492 67.2796-15.5261 9.61134-31.7916 14.491-48.0571 14.491s-32.3828-4.87963-47.909-14.491c-21.1451-13.0123-42.1423-26.1724-63.1395-39.3328-20.9971 13.3079-42.1423 26.4683-63.435 39.6286-15.3785 9.4635-37.4105 14.1953-53.6759 14.1953-16.2653 0-38.4455-4.87963-53.9714-14.491-21.1451-13.0123-42.1423-26.1724-63.1395-39.3328-21.1451 13.3079-42.1423 26.4683-63.435 39.4805-15.3785 9.4635-31.4958 14.343-47.7612 14.343-16.2653 0-29.2778-4.87963-44.8036-14.343-23.8065-14.7868-53.9714-29.8691-77.4823-44.5079l-28.3905-15.3785c-14.6388-8.87205-37.2626-15.2303-37.2626-43.7687v-748.208c0-47.6133 28.6863-78.2219 73.0465-78.2219h683.294c22.4757 0 38.8891 7.39338 53.0844 21.293 10.3507 10.2028 22.6238 28.982 22.6238 60.4778 0.147868 222.836 0.147868 439.019 0.443601 730.02Zm-792.716 58.7033c1.18293 0.147868 2.51374 0.443601 2.21799 0.147868-0.147868 0-1.18293 0-2.21799-0.147868Zm717.156-829.682H168.062c-7.83698 0-32.2351 0-32.2351 22.6238V741.542l12.5686 7.98484c0.295734 0.147868 10.9422 5.91469 11.2379 6.06257l30.017 15.9696c7.98484 4.58389 46.2825 22.9194 74.673 38.8891 7.83698 4.43602 12.5686 5.61897 18.4834 5.61897s11.9773-1.92227 18.4834-6.06257c24.2501-14.9346 48.5004-30.017 72.6028-45.2474 6.65405-4.14028 13.1601-6.21043 20.1099-6.21043 6.8019 0 13.456 2.07015 19.8141 6.06257l0.147868 0.147868c24.2501 15.5261 49.0919 29.4257 72.455 43.9166 6.65405 4.14028 18.7792 6.06257 24.546 6.06257 5.76682 0 17.8919-1.92227 24.546-5.91469 24.2501-14.9346 48.3525-30.017 72.3073-45.2474 6.50615-4.14028 13.1601-6.21043 20.1099-6.21043 7.09762 0 13.7517 2.07015 20.4057 6.35829 23.6586 14.9346 47.6133 29.8691 72.0114 44.9517 6.65405 4.14028 15.2303 8.5763 21.1451 8.5763s8.13268-0.443601 22.1799-5.91469c39.4805-15.6739 73.9338-42.1423 110.013-64.618 1.33079-0.739338 1.77441-1.33079 1.92227-1.47868 0-0.295734 10.3507-6.21043 10.3507-7.39338-0.295734-291.003-0.147868-536.907 0-759.743 0.295734-22.9194-22.6238-26.1724-34.4531-26.1724Zm0 0M410.267 466.806c-15.3785 0-27.7988-5.0275-27.7988-20.4057s12.4209-20.4057 27.7988-20.4057h79.1091v-62.2522c0-9.90713 2.36586-19.0749 10.9422-24.1023 8.5763-5.0275 10.3507-5.0275 18.927 0 8.5763 5.0275 9.4635 14.1953 9.4635 24.1023v62.2522h80.5876c15.0825 0.443601 27.2078 5.32322 27.2078 20.4057 0 15.0825-11.9773 20.1099-27.2078 20.4057h-80.5876v41.9943h80.5876c10.055-0.147868 19.9619 1.03507 24.3981 10.055 2.66161 5.47108 1.77441 13.0123 0 17.0048-4.14028 9.16777-14.343 13.8995-24.3981 13.7517h-80.5876v1.92227l72.6028 64.0267c6.94975 7.09762 9.75928 17.3007 7.09762 26.9119-2.66161 9.61134-3.40094 10.7943-13.0123 13.3079-9.61134 2.51374-18.1876 0.443601-25.1374-6.65405L510.077 580.663l-60.9214 71.7156c-6.94975 7.09762-15.8219 9.4635-25.4333 6.94975-9.61134-2.51374-10.055-7.09762-12.5686-16.5612-2.66161-9.61134 0.147868-19.8141 7.09762-26.9119l71.1242-64.0267v-1.92227h-79.1091c-15.3785 0-27.7988-6.65405-27.7988-21.8843 0-14.1953 12.4209-18.927 27.7988-18.927h79.1091V466.806h-79.1091Zm0 0" horiz-adv-x="1024" />
<glyph glyph-name="youxiang" unicode="&#59001;" d="M983.899806 110.614218V671.113777h0.180631l-0.180631 4.696419c-0.180632 5.238314-0.722526 10.476627-1.806315 15.714941-2.890104 25.469042-21.675781 44.977245-45.519139 47.686717H122.287529c-11.741048 0-23.482096-1.625684-34.861881-5.238314-30.346093-10.295996-50.757453-40.100194-50.576821-74.058917v-534.849885c-0.361263-21.314518 5.780208-42.087141 17.701887-59.789028l0.361263-0.722526 5.418946-3.973893c18.243782-21.856412 44.977245-34.319986 73.517022-34.500618H904.421944c37.751984 0 70.265655 27.094726 79.477862 66.291763l0.180631 0.541894c0.361263 5.96084 0.361263 11.741048-0.180631 17.701888zM390.16405 348.505909l55.453872-49.854295 43.893456-40.100194c5.418945-5.96084 13.005468-9.57347 21.133886-9.57347 7.947786 0 15.534309 3.431999 21.133886 9.57347l101.153642 91.941436 272.753572-263.721997H126.622685L390.16405 348.505909z m120.119951-30.346092L111.449638 679.96472H115.604163c214.409596 0.903158 703.559711 2.890104 793.875463 0.361263l-399.195625-362.166166z m165.458458 69.72376l251.619686 227.956959v-474.518963L675.742459 387.883577z m-328.568707-0.180631L93.205856 135.721997V617.104957l253.967896-229.402011z" horiz-adv-x="1024" />
<glyph glyph-name="shangyinhao" unicode="&#59000;" d="M505.6 691.2c0-12.8-12.8-25.6-44.8-44.8C307.2 531.2 236.8 441.6 236.8 371.2c0-38.4 25.6-70.4 70.4-83.2 70.4-25.6 96-70.4 96-115.2 0-38.4-19.2-134.4-134.4-134.4-89.6 0-204.8 64-204.8 217.6C64 409.6 211.2 576 416 723.2 428.8 736 441.6 736 448 736c12.8 0 25.6-6.4 38.4-19.2C499.2 704 505.6 697.6 505.6 691.2zM960 691.2c0-12.8-12.8-25.6-44.8-44.8-153.6-108.8-224-204.8-224-275.2 0-38.4 25.6-70.4 70.4-83.2 70.4-25.6 96-70.4 96-115.2 0-38.4-19.2-134.4-134.4-134.4-89.6 0-204.8 64-204.8 217.6 0 160 147.2 326.4 352 473.6 12.8 12.8 25.6 12.8 38.4 12.8C928 736 960 704 960 691.2z" horiz-adv-x="1024" /> <glyph glyph-name="shangyinhao" unicode="&#59000;" d="M505.6 691.2c0-12.8-12.8-25.6-44.8-44.8C307.2 531.2 236.8 441.6 236.8 371.2c0-38.4 25.6-70.4 70.4-83.2 70.4-25.6 96-70.4 96-115.2 0-38.4-19.2-134.4-134.4-134.4-89.6 0-204.8 64-204.8 217.6C64 409.6 211.2 576 416 723.2 428.8 736 441.6 736 448 736c12.8 0 25.6-6.4 38.4-19.2C499.2 704 505.6 697.6 505.6 691.2zM960 691.2c0-12.8-12.8-25.6-44.8-44.8-153.6-108.8-224-204.8-224-275.2 0-38.4 25.6-70.4 70.4-83.2 70.4-25.6 96-70.4 96-115.2 0-38.4-19.2-134.4-134.4-134.4-89.6 0-204.8 64-204.8 217.6 0 160 147.2 326.4 352 473.6 12.8 12.8 25.6 12.8 38.4 12.8C928 736 960 704 960 691.2z" horiz-adv-x="1024" />
......
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