edit
This commit is contained in:
@ -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 }}
|
||||
|
||||
@ -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)}`
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user