This commit is contained in:
Taric Xin
2022-01-14 09:37:21 +08:00
parent 35c3135e52
commit 7659770852
8 changed files with 75 additions and 19 deletions

View File

@ -99,8 +99,7 @@ export class DownloadComponentsListComponent implements OnInit {
width: '170px',
className: 'text-center',
buttons: [
{ text: '下载', click: (_record) => this.download(_record), iif: (item) => item.status === 1 },
{ text: '删除', click: (_record) => this.delOne(_record), iif: (item) => item.status !== 0 },
{ text: '下载', click: (_record) => this.download(_record)},
],
},
];

View File

@ -45,8 +45,12 @@ export class DriverAccountComponent implements OnInit {
this.modal.create({
nzTitle: '账户明细',
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: {},
nzComponentParams: {
params: { accountType: 2, roleId: item.roleId },
url: '/api/fcc/accountBalance/getDriverAccountBalanceDetailByOperator'
},
nzFooter: null
});
}

View File

@ -52,7 +52,10 @@ export class FreightAccountComponent implements OnInit {
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: {},
nzComponentParams: {
params: { accountType: 1, roleId: item.roleId },
url: '/api/fcc/accountBalance/getShipperAccountBalanceDetailByOperator'
},
nzFooter: null
});
}

View File

@ -244,7 +244,7 @@ export class WithdrawalsRecordComponent implements OnInit {
{ title: '提现单号', index: 'refundApplyCode', width: 120 },
{ title: '网络货运人', index: 'ltdName', width: 120 },
{ title: '银行类型', index: 'bankTypeLabel', width: 100 },
{ title: '账户类型', index: 'accountType', width: 100 },
{ title: '账户类型', index: 'bankTypeLabel', width: 100 },
{ title: '账户名称', index: 'bankAccountName', width: 100 },
{ title: '虚拟账户', index: 'virtualAccount', width: 100 },
{ title: '提现金额', index: 'amount', width: 100 },

View File

@ -102,12 +102,18 @@ export class UserCenterComponentsDriverComponent implements OnInit {
}
showAccountDetail(item: any) {
console.log(item);
this.modal.create({
nzTitle: '资金账户',
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: { isCanCreate: true },
nzComponentParams: {
isCanCreate: true,
url: '/api/fcc/accountBalance/getDriverAccountDetailByOperator',
params: { accountType: 2, roleId: item.appUserId }
},
nzFooter: null
});
}

View File

@ -74,7 +74,11 @@ export class FreightComponentsListComponent implements OnInit {
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: { isCanCreate: true },
nzComponentParams: {
isCanCreate: true,
url: '/api/fcc/accountBalance/getShipperAccountBalanceDetailByOperator',
params: { accountType: 1, roleId: item.appUserId }
},
nzFooter: null
});
}

View File

@ -1,11 +1,11 @@
<st #st [data]="url" [columns]="columns" bordered size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[res]="{ reName: { list: 'data'} }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ y: '370px' }">
<ng-template st-row="ltdName" let-item let-index="index">
<ng-container *ngIf="isCanCreate; else elsePATemplate">
<a (click)="createPA(item)">{{ item.promotersTelephone || '添加' }}</a>
<a (click)="createAccount(item,'1')">{{ item.promotersTelephone || '添加' }}</a>
</ng-container>
<ng-template #elsePATemplate>
{{ item.promotersTelephone }}
@ -13,7 +13,7 @@
</ng-template>
<ng-template st-row="bankTypeLabel" let-item let-index="index">
<ng-container *ngIf="isCanCreate; else elsePFTemplate">
<a (click)="createPF(item)">{{ item.promotersTelephone || '添加' }}</a>
<a (click)="createAccount(item,'2')">{{ item.promotersTelephone || '添加' }}</a>
</ng-container>
<ng-template #elsePFTemplate>
{{ item.promotersTelephone }}

View File

@ -1,6 +1,7 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { BaseService } from '../../services';
@Component({
@ -13,35 +14,74 @@ export class AccountDetailComponent implements OnInit {
st!: STComponent;
columns: STColumn[] = [];
url = '';
url = '/api/fcc/accountBalance/getDriverAccountDetailByOperator';
isCanCreate = false;
constructor(public service: BaseService, private currencyPipe: CurrencyPipe) {
params: any = {};
constructor(public service: BaseService, private currencyPipe: CurrencyPipe, private modalHelp: NzModalRef) {
this.initST();
}
ngOnInit(): void {}
createPA(item: any) {}
createPF(item: any) {}
createAccount(item: any, type: '1' | '2') {
const params = {
ltdId: item.ltdId,
roleId: item.roleId,
projectId: item.projectId,
enterpriseId: item.enterpriseId,
ctfId: this.params.ctfId,
clientName: this.params.clientName
};
if (this.params.accountType === 1) {
this.service
.request('/api/fcc/accountBalance/saveByShipper', {
accountType: this.params.accountType,
bankType: type,
isProjectMain: 0,
...params
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('开户成功');
this.modalHelp.destroy();
}
});
}
if (this.params.accountType === 2) {
this.service
.request('/api/fcc/accountBalance/saveByDriver', {
accountType: this.params.accountType,
bankType: type,
...params
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('开户成功');
this.modalHelp.destroy();
}
});
}
}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, this.params);
return requestOptions;
};
initST() {
this.columns = [
{ title: '网络货运人', index: 'phone', className: 'text-center' },
{ title: '网络货运人', index: 'ltdName', className: 'text-center' },
{
title: '平安账户余额',
render: 'ltdName',
render: 'paBalance',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
format: item => `${this.currencyPipe.transform(item.paBalance)}`
},
{
title: '浦发账户余额',
render: 'bankTypeLabel',
render: 'pfBalance',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
format: item => `${this.currencyPipe.transform(item.pfBalance)}`
}
];
}