This commit is contained in:
潘晓云
2022-03-10 11:20:21 +08:00
parent da3b427a77
commit 31cb7bd194
4 changed files with 355 additions and 103 deletions

View File

@ -1,85 +1,62 @@
<page-header-wrapper [title]="'提现记录'">
</page-header-wrapper>
<!-- <nz-card>
<nz-row [nzGutter]="16">
<nz-col [nzXl]="6" [nzLg]="6" [nzSm]="12">
<nz-statistic nzValue="100 笔" [nzTitle]="'待审核订单数'" [nzValueStyle]="{'font-size':'21px'}">
</nz-statistic>
</nz-col>
<nz-col [nzXl]="6" [nzLg]="6" [nzSm]="12">
<nz-statistic nzValue="80000.00 元" [nzTitle]="'待审核提现金额'" [nzValueStyle]="{'font-size':'21px'}">
</nz-statistic>
</nz-col>
<nz-col [nzXl]="6" [nzLg]="6" [nzSm]="12">
<nz-statistic nzValue="100 笔" [nzTitle]="'已提现订单数'" [nzValueStyle]="{'font-size':'21px'}">
</nz-statistic>
</nz-col>
<nz-col [nzXl]="6" [nzLg]="6" [nzSm]="12">
<nz-statistic nzValue="80000.00 元" [nzTitle]="'已提现金额'" [nzValueStyle]="{'font-size':'21px'}">
</nz-statistic>
</nz-col>
</nz-row>
</nz-card> -->
<nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24,gutter:15 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24,gutter:15 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box" nzBordered>
<nz-tabset [nzTabBarExtraContent]="extraTemplate">
<nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="changeRefundStatus('1')"></nz-tab>
<nz-tab nzTitle="处理中" (nzClick)="changeRefundStatus('2')"></nz-tab>
<nz-tab nzTitle="提现成功" (nzClick)="changeRefundStatus('3')"></nz-tab>
<nz-tab nzTitle="提现失败" (nzClick)="changeRefundStatus('5')"></nz-tab>
<nz-tab nzTitle="已拒绝" (nzClick)="changeRefundStatus('4')"></nz-tab>
</nz-tabset>
<nz-tabset [nzTabBarExtraContent]="extraTemplate">
<nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="changeRefundStatus('1')"></nz-tab>
<nz-tab nzTitle="处理中" (nzClick)="changeRefundStatus('2')"></nz-tab>
<nz-tab nzTitle="提现成功" (nzClick)="changeRefundStatus('3')"></nz-tab>
<nz-tab nzTitle="提现失败" (nzClick)="changeRefundStatus('5')"></nz-tab>
<nz-tab nzTitle="已拒绝" (nzClick)="changeRefundStatus('4')"></nz-tab>
</nz-tabset>
<ng-template #extraTemplate>
<div class="d-flex align-items-center ">
<div class="mr-md">
已选择
<strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 累计提现 <strong
class="text-red">{{
totalCallNo }}</strong>
<a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
<button nz-button (click)="this.auditAction(null)">审核</button>
</div>
<ng-template #extraTemplate>
<div class="d-flex align-items-center ">
<div class="mr-md">
已选择
<strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 累计提现 <strong class="text-red">{{
totalCallNo }}</strong>
<!-- <a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a> -->
</div>
<button nz-button (click)="this.auditAction(null)">审核</button>
</div>
</ng-template>
<st #st [data]="service.$api_get_refund_page" [columns]="columns" [req]="{ process: beforeReq }"
[loading]="service.http.loading" [scroll]="{ x:'1200px' }" (change)="stChange($event)"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: afterRes }"
[page]="{ show: true, pageSizes: [10, 20, 50, 100, 200, 500] }" [loading]="service.http.loading">
<ng-template st-row="bankCardNumber" let-item let-index="index" let-column="column">
{{ item.bankName }} <br> {{ item.bankCardNumber }}
</ng-template>
<st #st [data]="service.$api_get_refund_page" [columns]="columns" [req]="{ process: beforeReq }"
[loading]="service.http.loading" [scroll]="{ x:'1200px' }" (change)="stChange($event)">
<ng-template st-row="bankCardNumber" let-item let-index="index" let-column="column">
{{ item.bankName }} <br> {{ item.bankCardNumber }}
</ng-template>
</st>
</st>
</nz-card>
<ng-template #auditModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注">
<textarea nz-input rows="3" [(ngModel)]="msg" placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px;margin-left: 14px;"></textarea>
</se>
</div>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注">
<textarea nz-input rows="3" [(ngModel)]="msg" placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px;margin-left: 14px;"></textarea>
</se>
</div>
</ng-template>
</div>
</ng-template>

View File

@ -1,9 +1,10 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { STComponent, STColumn, STChange, STRequestOptions, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service';
import Big from 'src/app/shared/utils/deal-precision';
@Component({
@ -12,12 +13,10 @@ import { FreightAccountService } from 'src/app/routes/financial-management/servi
styleUrls: ['../../../../commom/less/box.less', '../../../../commom/less/expend-but.less']
})
export class PartnerAccountManagementWithdrawalsRecordComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
@ViewChild('st', { static: true }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('auditModal', { static: false }) auditModal!: any;
@ViewChild('viewReasonModal', { static: false }) viewReasonModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
@ -52,11 +51,47 @@ export class PartnerAccountManagementWithdrawalsRecordComponent implements OnIni
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.amount, 0).toFixed(2);
break;
if (e.type === 'checkbox') {
const checkRows = (e.checkbox as STData[]) || [];
//判断当前页是否有选中的行
if (checkRows.length === 0) {
// 当前页没有存在已勾选的行,移除之前所记录的当前页的行
const stList = this.st.list;
stList.forEach(item => {
this.selectedRows = this.selectedRows.filter((e: any) => e.id !== item.id);
})
} else {
//添加新增的行
checkRows.forEach((item: any) => {
const newSelectedList = this.selectedRows.filter((r: any) => r.id === item.id);
if (newSelectedList.length === 0) {
this.selectedRows.push(item);
}
})
// 移除取消选中的行
const stList = this.st.list;
stList.forEach(item => {
if (!item.checked) {
const index = this.selectedRows.findIndex(_item => item.id === _item.id);
if (index !== -1) this.selectedRows.splice(index, 1);
}
})
}
let totalCallNo = 0;
this.selectedRows.forEach((item => {
totalCallNo = new Big(this.totalCallNo).plus(item?.amount).parse();
}));
this.totalCallNo = totalCallNo;
} else if (e.type === 'loaded') {
// 页面加载时勾选
(e?.loaded || []).forEach((r) => {
this.selectedRows.forEach((x) => {
if (x.id === r.id) {
r.checked = true;
}
});
});
}
}
@ -123,7 +158,7 @@ export class PartnerAccountManagementWithdrawalsRecordComponent implements OnIni
showReason(item: any) {
const modal = this.nzModalService.create({
nzTitle: '查看原因',
nzContent: '运单数据异常暂时无法开票请联系客服400-xxxx-xxxx',
nzContent: item?.rejectionCause || item?.failCause,
nzFooter: [
{
label: '关闭',
@ -240,27 +275,27 @@ export class PartnerAccountManagementWithdrawalsRecordComponent implements OnIni
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '提现时间', index: 'createTime', width: 180 },
{ title: '提现单号', index: 'refundApplyCode', width: 120 },
{ title: '网络货运人', index: 'ltdName', width: 140 },
{ title: '银行类型', index: 'bankTypeLabel', width: 100 },
{ title: '账户类型', index: 'bankTypeLabel', width: 100 },
{ title: '账户名称', index: 'bankAccountName', width: 140 },
{ title: '虚拟账户', index: 'virtualAccount', width: 100 },
{ title: '', index: 'key', type: 'checkbox', className: 'text-center' },
{ title: '提现时间', index: 'createTime', width: 180, className: 'text-center' },
{ title: '提现单号', index: 'refundApplyCode', width: 180, className: 'text-center' },
{ title: '网络货运人', index: 'ltdName', width: 220, className: 'text-center' },
{ title: '银行类型', index: 'bankTypeLabel', width: 100, className: 'text-center' },
{ title: '账户类型', index: 'bankTypeLabel', width: 100, className: 'text-center' },
{ title: '账户名称', index: 'bankAccountName', width: 220, className: 'text-center' },
{ title: '虚拟账户', index: 'virtualAccount', width: 180, className: 'text-center' },
{
title: '提现金额',
index: 'amount',
width: 120,
width: 150,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.amount }) }
},
{ title: '提现银行账户', render: 'bankCardNumber', width: 180 },
{ title: '提现状态', index: 'refundStatusLabel', width: 100 },
{ title: '银行流水号', index: 'bankSerialNumber', width: 120 },
{ title: '核心交易流水', index: 'coreSerNo', width: 120 },
{ title: '失败原因', index: 'rejectionCause', width: 150, format: item => item.failCause || item.rejectionCause },
{ title: '提现银行账户', render: 'bankCardNumber', width: 200, className: 'text-center' },
{ title: '提现状态', index: 'refundStatusLabel', width: 100, className: 'text-center' },
{ title: '银行流水号', index: 'bankSerialNumber', width: 160, className: 'text-center' },
{ title: '核心交易流水', index: 'coreSerNo', width: 180, className: 'text-center' },
{ title: '失败原因', index: 'rejectionCause', width: 200, format: item => item.failCause, className: 'text-center' },
{
title: '操作',
fixed: 'right',
@ -278,6 +313,11 @@ export class PartnerAccountManagementWithdrawalsRecordComponent implements OnIni
ltdId: item.ltdId
})
},
{
text: '查看原因',
iif: item => item.refundStatus === '4',
click: item => this.showReason(item)
},
{
text: '审核',
iif: item => item.refundStatus === '1',