This commit is contained in:
wangshiming
2022-05-11 14:25:49 +08:00
parent d9d3a2e245
commit 571485133a
2 changed files with 101 additions and 68 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-04-29 17:28:23 * @Date : 2022-04-29 17:28:23
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-05-11 10:11:53 * @LastEditTime : 2022-05-11 14:25:14
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\recorded\\components\\record\\record.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\recorded\\components\\record\\record.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -34,7 +34,7 @@
<nz-card class="content-box" nzBordered> <nz-card class="content-box" nzBordered>
<nz-tabset [nzTabBarExtraContent]="extraTemplate"> <nz-tabset [nzTabBarExtraContent]="extraTemplate">
<nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab> <nz-tab nzTitle="全部" (nzClick)="changeRefundStatus('0')"></nz-tab>
<nz-tab nzTitle="待初审" (nzClick)="changeRefundStatus('1')"></nz-tab> <nz-tab nzTitle="待初审" (nzClick)="changeRefundStatus('1')"></nz-tab>
<nz-tab nzTitle="待复核" (nzClick)="changeRefundStatus('2')"></nz-tab> <nz-tab nzTitle="待复核" (nzClick)="changeRefundStatus('2')"></nz-tab>
<nz-tab nzTitle="已入账" (nzClick)="changeRefundStatus('3')"></nz-tab> <nz-tab nzTitle="已入账" (nzClick)="changeRefundStatus('3')"></nz-tab>
@ -68,16 +68,22 @@
{{ item.bankName }} <br /> {{ item.bankName }} <br />
{{ item.bankCardNumber }} {{ item.bankCardNumber }}
</ng-template> </ng-template>
<ng-template st-row="sts" let-item let-index="index" let-column="column">
<div *ngIf="item.sts == '0'">待初审</div>
<div *ngIf="item.sts == '1'">待复核</div>
<div *ngIf="item.sts == '2'">已入账</div>
<div *ngIf="item.sts == '3'">已拒绝</div>
</ng-template>
</st> </st>
<div class="text-md" *ngIf="st?.list?.length !== 0"> <div class="text-md" *ngIf="st?.list?.length !== 0">
<span class="mr-md" <span class="mr-md"
>合伙人数:<label class="text-red-dark font-weight-bold">{{ totalInfo?.invoiceAmountSum }}</label></span >合伙人数:<label class="text-red-dark font-weight-bold">{{ totalInfo?.partnerNum }}</label></span
> >
<span class="mr-md" <span class="mr-md"
>入账笔数:<label class="text-red-dark font-weight-bold">{{ totalInfo?.count }}</label></span >入账笔数:<label class="text-red-dark font-weight-bold">{{ totalInfo?.invoiceEntryNum }}</label></span
> >
<span class="mr-md" <span class="mr-md"
>开票金额:<label class="text-red-dark font-weight-bold">{{ totalInfo?.invoiceEntryNum }}</label></span >开票金额:<label class="text-red-dark font-weight-bold">{{ totalInfo?.invoiceAmountSum }}</label></span
> >
<span class="mr-md" <span class="mr-md"
>代缴个税:<label class="text-red-dark font-weight-bold">{{ totalInfo?.taxPersonalSum }}</label></span >代缴个税:<label class="text-red-dark font-weight-bold">{{ totalInfo?.taxPersonalSum }}</label></span

View File

@ -8,7 +8,6 @@ import { FreightAccountService } from 'src/app/routes/financial-management/servi
import Big from 'src/app/shared/utils/deal-precision'; import Big from 'src/app/shared/utils/deal-precision';
import { RecordedService } from '../../services/recorded.service'; import { RecordedService } from '../../services/recorded.service';
@Component({ @Component({
selector: 'app-partner-recorded-record', selector: 'app-partner-recorded-record',
templateUrl: './record.component.html', templateUrl: './record.component.html',
@ -22,12 +21,12 @@ export class PartnerRecordedRecordComponent implements OnInit {
columns!: STColumn[]; columns!: STColumn[];
searchSchema!: SFSchema; searchSchema!: SFSchema;
totalInfo: any = { totalInfo: any = {
invoiceAmountSum: 0,
invoiceEntryNum: 0,
partnerNum: 0, partnerNum: 0,
recordedAmountSum: 0, invoiceEntryNum: 0,
taxPersonalSum: 0 invoiceAmountSum: 0,
} taxPersonalSum: 0,
recordedAmountSum: 0
};
_$expand = false; _$expand = false;
@ -40,16 +39,20 @@ export class PartnerRecordedRecordComponent implements OnInit {
ltdId = ''; // 网络货运人 ltdId = ''; // 网络货运人
accountName = ''; // 账户名称 accountName = ''; // 账户名称
constructor(
constructor(public service: RecordedService, private nzModalService: NzModalService, public service: RecordedService,
private router: Router, public ar: ActivatedRoute, public shipperSrv: ShipperBaseService) { private nzModalService: NzModalService,
private router: Router,
public ar: ActivatedRoute,
public shipperSrv: ShipperBaseService
) {
this.ltdId = this.ar.snapshot.queryParams?.ltdId || ''; this.ltdId = this.ar.snapshot.queryParams?.ltdId || '';
} }
ngOnInit(): void { ngOnInit(): void {
this.searchSchema = this.initSF(); this.searchSchema = this.initSF();
this.columns = this.initST(); this.columns = this.initST();
this.getSummary()
} }
beforeReq = (requestOptions: STRequestOptions) => { beforeReq = (requestOptions: STRequestOptions) => {
@ -60,7 +63,7 @@ export class PartnerRecordedRecordComponent implements OnInit {
start: this.sf?.value.createTime?.[0] || '', start: this.sf?.value.createTime?.[0] || '',
end: this.sf?.value.createTime?.[1] || '' end: this.sf?.value.createTime?.[1] || ''
}, },
refundStatus: this.refundStatus || null sts: this.refundStatus || ''
}); });
} }
delete requestOptions?.body?.expand; delete requestOptions?.body?.expand;
@ -81,16 +84,15 @@ export class PartnerRecordedRecordComponent implements OnInit {
const stList = this.st.list; const stList = this.st.list;
stList.forEach(item => { stList.forEach(item => {
this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id); this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id);
}) });
} else { } else {
//添加新增的行 //添加新增的行
checkRows.forEach((item: any) => { checkRows.forEach((item: any) => {
const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id); const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id);
if (newSelectedList.length === 0) { if (newSelectedList.length === 0) {
this.selectedRows.push(item); this.selectedRows.push(item);
} }
}) });
// 移除取消选中的行 // 移除取消选中的行
const stList = this.st.list; const stList = this.st.list;
stList.forEach(item => { stList.forEach(item => {
@ -98,17 +100,17 @@ export class PartnerRecordedRecordComponent implements OnInit {
const index = this.selectedRows.findIndex(_item => item.id === _item.id); const index = this.selectedRows.findIndex(_item => item.id === _item.id);
if (index !== -1) this.selectedRows.splice(index, 1); if (index !== -1) this.selectedRows.splice(index, 1);
} }
}) });
} }
let totalCallNo = 0; let totalCallNo = 0;
this.selectedRows.forEach((item => { this.selectedRows.forEach(item => {
totalCallNo = new Big(this.totalCallNo).plus(item?.entryAmount).parse(); totalCallNo = new Big(this.totalCallNo).plus(item?.entryAmount).parse();
})); });
this.totalCallNo = totalCallNo; this.totalCallNo = totalCallNo;
} else if (e.type === 'loaded') { } else if (e.type === 'loaded') {
// 页面加载时勾选 // 页面加载时勾选
(e?.loaded || []).forEach((r) => { (e?.loaded || []).forEach(r => {
this.selectedRows.forEach((x) => { this.selectedRows.forEach(x => {
if (x.id === r.id) { if (x.id === r.id) {
r.checked = true; r.checked = true;
} }
@ -117,8 +119,27 @@ export class PartnerRecordedRecordComponent implements OnInit {
} }
} }
changeRefundStatus(status?: string) { changeRefundStatus(status: any) {
this.refundStatus = status || null; let value = '';
switch (status) {
case '0':
value = '';
break;
case '1':
value = '0';
break;
case '2':
value = '1';
break;
case '3':
value = '2';
break;
case '4':
value = '3';
break;
}
this.refundStatus = value || null;
this.st.load(1); this.st.load(1);
} }
@ -146,10 +167,14 @@ export class PartnerRecordedRecordComponent implements OnInit {
this.service.msgSrv.warning('请填写拒绝原因 '); this.service.msgSrv.warning('请填写拒绝原因 ');
return; return;
} }
this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { this.audit(
modal.destroy(); { ids: params, rejectReason: this.msg, sts: '3' },
this.st.load(1); () => {
}, '审核拒绝成功'); modal.destroy();
this.st.load(1);
},
'审核拒绝成功'
);
// this.service // this.service
// .request(this.service.$api_disagree_recorded, { // .request(this.service.$api_disagree_recorded, {
// id: params, // id: params,
@ -168,10 +193,14 @@ export class PartnerRecordedRecordComponent implements OnInit {
label: '通过', label: '通过',
type: 'primary', type: 'primary',
onClick: () => { onClick: () => {
this.audit({ ids: params, rejectReason: this.msg, sts: '1' }, () => { this.audit(
modal.destroy(); { ids: params, rejectReason: this.msg, sts: '1' },
this.st.load(1); () => {
}, '审核通过成功'); modal.destroy();
this.st.load(1);
},
'审核通过成功'
);
} }
} }
] ]
@ -230,22 +259,22 @@ export class PartnerRecordedRecordComponent implements OnInit {
placeholder: '请输入' placeholder: '请输入'
} }
}, },
sts: { // sts: {
type: 'string', // type: 'string',
title: '入账状态', // title: '入账状态',
default: '', // default: '',
enum: [ // enum: [
{ label: '全部', value: '' }, // { label: '全部', value: '' },
{ label: '待初审', value: '0' }, // { label: '待初审', value: '0' },
{ label: '待复核', value: '1' }, // { label: '待复核', value: '1' },
{ label: '已入账', value: '2' }, // { label: '已入账', value: '2' },
{ label: '已拒绝', value: '3' }, // { label: '已拒绝', value: '3' },
], // ],
ui: { // ui: {
widget: 'select', // widget: 'select',
placeholder: '请选择' // placeholder: '请选择'
} // }
}, // },
ltdId: { ltdId: {
type: 'string', type: 'string',
title: '网络货运人', title: '网络货运人',
@ -254,7 +283,7 @@ export class PartnerRecordedRecordComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true,
asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, true), asyncData: () => this.shipperSrv.getNetworkFreightForwarder({}, true)
} }
}, },
submitTime: { submitTime: {
@ -269,7 +298,7 @@ export class PartnerRecordedRecordComponent implements OnInit {
expand: (value: boolean) => value expand: (value: boolean) => value
} }
} as SFDateWidgetSchema } as SFDateWidgetSchema
}, }
} }
}; };
} }
@ -283,11 +312,11 @@ export class PartnerRecordedRecordComponent implements OnInit {
{ title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' }, { title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' },
{ {
title: '开票金额', title: '开票金额',
index: 'amount', index: 'invoiceAmount',
width: 150, width: 150,
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoiceAmount }) }
}, },
{ {
title: '代缴个税', title: '代缴个税',
@ -295,7 +324,7 @@ export class PartnerRecordedRecordComponent implements OnInit {
width: 150, width: 150,
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.taxPersonal }) }
}, },
{ {
title: '入账金额', title: '入账金额',
@ -303,11 +332,11 @@ export class PartnerRecordedRecordComponent implements OnInit {
width: 150, width: 150,
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.entryAmount }) }
}, },
{ title: '提交时间', index: 'submitTime', width: 180, className: 'text-center' }, { title: '提交时间', index: 'submitTime', width: 180, className: 'text-center' },
{ title: '入账状态', index: 'stsLabel', width: 120, className: 'text-center' }, { title: '入账状态', render: 'sts', width: 120, className: 'text-center' },
{ {
title: '操作', title: '操作',
fixed: 'right', fixed: 'right',
@ -336,17 +365,15 @@ export class PartnerRecordedRecordComponent implements OnInit {
} }
/** /**
* 审核 * 审核
*/ */
audit(params: any, callback: Function, msg = '成功') { audit(params: any, callback: Function, msg = '成功') {
this.service this.service.request(this.service.$api_audit_recored, { ...params }).subscribe(res => {
.request(this.service.$api_audit_recored, { ...params }) if (res) {
.subscribe(res => { this.service.msgSrv.success(msg);
if (res) { callback();
this.service.msgSrv.success(msg); }
callback(); });
}
});
} }
search() { search() {
@ -361,6 +388,6 @@ export class PartnerRecordedRecordComponent implements OnInit {
if (res) { if (res) {
this.totalInfo = res; this.totalInfo = res;
} }
}) });
} }
} }