From 1454acc72625deef11d59d43640d9b0daaafe14d Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Mon, 27 Dec 2021 21:00:35 +0800 Subject: [PATCH] edit --- .../driver-account-detail.component.ts | 9 -- .../driver-account.component.html | 2 +- .../driver-account.component.ts | 44 ++++++---- .../freight-account-detail.component.html | 9 +- .../freight-account-detail.component.ts | 87 ++++++++++--------- .../freight-account.component.html | 2 +- .../freight-account.component.ts | 55 +++++++----- .../services/freight-account.service.ts | 10 ++- 8 files changed, 122 insertions(+), 96 deletions(-) diff --git a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts index bb7e3ee3..7b005830 100644 --- a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts +++ b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts @@ -11,7 +11,6 @@ import { FreightAccountService } from '../../../services/freight-account.service styleUrls: ['./driver-account-detail.component.less'] }) export class DriverAccountDetailComponent implements OnInit { - url = `/rule?_allow_anonymous=true`; @ViewChild('st', { static: true }) st!: STComponent; @ViewChild('sf', { static: false }) @@ -101,10 +100,6 @@ export class DriverAccountDetailComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName = i; - this.sf?.setValue('/receiveName', i); - }, visibleIf: { expand: (value: boolean) => value } @@ -122,10 +117,6 @@ export class DriverAccountDetailComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName2 = i; - this.sf?.setValue('/receiveName2', i); - }, visibleIf: { expand: (value: boolean) => value } diff --git a/src/app/routes/financial-management/components/driver-account/driver-account.component.html b/src/app/routes/financial-management/components/driver-account/driver-account.component.html index 8f38e950..ea3f5792 100644 --- a/src/app/routes/financial-management/components/driver-account/driver-account.component.html +++ b/src/app/routes/financial-management/components/driver-account/driver-account.component.html @@ -22,7 +22,7 @@ - { + Object.assign(requestOptions.body, { accountType: 2 }); if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value }); } @@ -59,7 +61,7 @@ export class DriverAccountComponent implements OnInit { hidden: true } }, - receiveName: { + tenantName: { type: 'string', title: '司机姓名', ui: { placeholder: '请输入' } @@ -76,31 +78,41 @@ export class DriverAccountComponent implements OnInit { placeholder: '请输入' } }, - page2: { + ltdid: { type: 'string', title: '网络货运人', - enum: [{ label: '全部', value: '全部' }], ui: { widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value - } + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() } }, - page22: { + bankType: { type: 'string', title: '银行类型', - enum: [{ label: '全部', value: '全部' }], + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], ui: { widget: 'select', placeholder: '请选择', + change: (i: any) => { + this.sf.value.receiveName2 = i; + this.sf?.setValue('/receiveName2', i); + }, visibleIf: { expand: (value: boolean) => value } - } + }, + default: null }, - page3: { + virtualAccount: { type: 'string', title: '虚拟账户', ui: { @@ -128,17 +140,17 @@ export class DriverAccountComponent implements OnInit { private initST(): STColumn[] { return [ - { title: '司机姓名', index: 'description' }, + { title: '司机姓名', index: 'tenantName' }, { title: '证件号码', index: 'description' }, { title: '手机号', index: 'description' }, - { title: '网络货运人', index: 'description' }, - { title: '银行类型', index: 'description' }, - { title: '虚拟账户', index: 'description' }, - { title: '可用余额', index: 'description' }, - { title: '冻结余额', index: 'description' }, + { title: '网络货运人', index: 'ltdid' }, + { title: '银行类型', index: 'description', type: 'enum', enum: { 1: '平安银行', 2: '浦发银行' } }, + { title: '虚拟账户', index: 'virtualAccount' }, + { title: '可用余额', index: 'availableBalance' }, + { title: '冻结余额', index: 'freezeBalance' }, { title: '本月累计提现金额', index: 'description', width: 150 }, - { title: '账户总余额', index: 'description' }, - { title: '创建时间', index: 'updatedAt', type: 'date', width: 150 }, + { title: '账户总余额', index: 'availableBalance' }, + { title: '创建时间', index: 'createTime', type: 'date', width: 150 }, { title: '操作', buttons: [ diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html index 40790f8f..46979a1e 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html @@ -19,11 +19,12 @@ - + - + @@ -49,9 +50,9 @@ - \ No newline at end of file diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts index ee41839e..f1e9661e 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { Router } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; -import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema } from '@delon/form'; import { NzModalService } from 'ng-zorro-antd/modal'; import { FreightAccountService } from '../../../services/freight-account.service'; @@ -18,18 +18,32 @@ export class FreightAccountDetailComponent implements OnInit { columns: STColumn[] = this.initST(); searchSchema: SFSchema = this.initSF(); + info: any = {}; + _$expand = false; - constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private route: ActivatedRoute) {} ngOnInit(): void {} beforeReq = (requestOptions: STRequestOptions) => { + Object.assign(requestOptions.body, { transactionNumber: this.route.snapshot.params.id }); if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value }); } return requestOptions; }; + afterReq = (data: any[], rawData?: any) => { + console.log(data, rawData); + if (rawData?.success) { + this.info = { + incomeAmount: rawData.data.rawData, + payAmount: rawData.data.payAmount + }; + } + return data; + }; + exportList() { this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); } @@ -72,81 +86,69 @@ export class FreightAccountDetailComponent implements OnInit { format: 'yyyy-MM-dd' } as SFDateWidgetSchema }, - orderSn2: { + transactionNumber: { type: 'string', title: '流水号', ui: { placeholder: '请输入' } }, - orderSn3: { + businessNumber: { type: 'string', title: '关联单号', ui: { placeholder: '请输入' } }, - receiveName: { + tradeType: { type: 'string', title: '交易类型', enum: [ { label: '全部', value: '' }, - { label: '订单支付', value: '订单支付' }, - { label: '余额充值', value: '余额充值' }, - { label: '余额提现', value: '余额提现' }, - { label: '资金分配', value: '资金分配' }, - { label: '资金回收', value: '资金回收' } + { label: '整车订单退款', value: '1' }, + { label: '整车订单支付', value: '2' }, + { label: '提现失败退回', value: '3' }, + { label: '提现', value: '4' }, + { label: '充值', value: '5' }, + { label: '运货订单结算F', value: '5' } ], ui: { widget: 'select', placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName = i; - this.sf?.setValue('/receiveName', i); - }, visibleIf: { expand: (value: boolean) => value } }, default: '' }, - receiveName2: { + incomeType: { type: 'string', title: '收支类型', enum: [ { label: '全部', value: '' }, - { label: '收入', value: '收入' }, - { label: '支出', value: '支出' } + { label: '收入', value: '1' }, + { label: '支出', value: '2' } ], ui: { widget: 'select', placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName2 = i; - this.sf?.setValue('/receiveName2', i); - }, visibleIf: { expand: (value: boolean) => value } }, default: '' }, - receiveName3: { + projectId: { + title: '项目', type: 'string', - title: '所属项目', - enum: [{ label: '全部', value: '' }], + default: '', ui: { widget: 'select', - placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName3 = i; - this.sf?.setValue('/receiveName3', i); - }, visibleIf: { expand: (value: boolean) => value - } - }, - default: '' + }, + asyncData: () => this.service.getEnterpriseProject() + } as SFSelectWidgetSchema } } }; @@ -155,13 +157,18 @@ export class FreightAccountDetailComponent implements OnInit { private initST(): STColumn[] { return [ { title: '交易时间', index: 'updatedAt', type: 'date' }, - { title: '流水号', index: 'callNo' }, - { title: '交易类型', index: 'callNo' }, - { title: '关联单号', index: 'callNo' }, - { title: '所属项目', index: 'callNo' }, - { title: '收支类型', index: 'callNo' }, - { title: '交易金额', index: 'callNo' }, - { title: '账户余额', index: 'callNo' } + { title: '流水号', index: 'transactionNumber' }, + { + title: '交易类型', + index: 'tradeType', + type: 'enum', + enum: { 1: '整车订单退款', 2: '整车订单支付', 3: '提现失败退回', 4: '提现', 5: '充值', 6: '运货订单结算' } + }, + { title: '关联单号', index: 'businessNumber' }, + { title: '所属项目', index: 'projectId' }, + { title: '收支类型', index: 'incomeType', type: 'enum', enum: { 1: '收入', 2: '支出' } }, + { title: '交易金额', index: 'amount' }, + { title: '账户余额', index: 'accountBalance' } ]; } } diff --git a/src/app/routes/financial-management/components/freight-account/freight-account.component.html b/src/app/routes/financial-management/components/freight-account/freight-account.component.html index f1dcf5ed..12b1bcd6 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account.component.html +++ b/src/app/routes/financial-management/components/freight-account/freight-account.component.html @@ -22,7 +22,7 @@ - { + Object.assign(requestOptions.body, { accountType: 1 }); if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value }); } @@ -63,7 +65,7 @@ export class FreightAccountComponent implements OnInit { hidden: true } }, - receiveName: { + tenantName: { type: 'string', title: '企业名称', ui: { placeholder: '请输入' } @@ -80,35 +82,37 @@ export class FreightAccountComponent implements OnInit { placeholder: '请输入' } }, - page2: { + ltdid: { type: 'string', title: '网络货运人', - enum: [{ label: '全部', value: '全部' }], ui: { widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value - } + }, + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder() } }, - receiveName2: { + bankType: { type: 'string', title: '银行类型', - enum: [{ label: '全部', value: '全部' }], + enum: [ + { label: '全部', value: null }, + { label: '平安银行', value: '1' }, + { label: '浦发银行', value: '2' } + ], ui: { widget: 'select', placeholder: '请选择', - change: (i: any) => { - this.sf.value.receiveName2 = i; - this.sf?.setValue('/receiveName2', i); - }, visibleIf: { expand: (value: boolean) => value } - } + }, + default: null }, - page3: { + virtualAccount: { type: 'string', title: '虚拟账户', ui: { @@ -136,24 +140,29 @@ export class FreightAccountComponent implements OnInit { private initST(): STColumn[] { return [ - { title: '企业名称', index: 'description' }, + { title: '企业名称', index: 'tenantName' }, { title: '联系人', index: 'description' }, { title: '联系人电话', index: 'description' }, - { title: '网络货运人', index: 'description' }, - { title: '银行类型', index: 'description' }, - { title: '虚拟账户', index: 'description' }, - { title: '可用余额', index: 'description' }, - { title: '冻结余额', index: 'description' }, + { title: '网络货运人', index: 'ltdid' }, + { title: '银行类型', index: 'bankType', type: 'enum', enum: { 1: '平安银行', 2: '浦发银行' } }, + { title: '虚拟账户', index: 'virtualAccount' }, + { title: '可用余额', index: 'availableBalance' }, + { title: '冻结余额', index: 'freezeBalance' }, { title: '累计消费金额', index: 'description' }, - { title: '账户总余额', render: 'description1' }, - { title: '创建时间', index: 'updatedAt', type: 'date', width: 150 }, - { title: '状态', render: 'description1' }, + { title: '账户总余额', render: 'availableBalance' }, + { title: '创建时间', index: 'createTime', type: 'date', width: 150 }, + { + title: '状态', + render: 'stateLocked', + type: 'badge', + badge: { 0: { text: '正常', color: 'success' }, 1: { text: '锁定', color: 'warning' } } + }, { title: '操作', buttons: [ { text: '查看明细', - click: item => this.router.navigate(['/financial-management/freight-account/detail/1']) + click: item => this.router.navigate(['/financial-management/freight-account/detail/' + item.id]) } ] } diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index 6f376729..c9d7f5f6 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -1,12 +1,18 @@ import { Injectable, Injector } from '@angular/core'; -import { BaseService } from '@shared'; +import { BaseService, ShipperBaseService } from '@shared'; @Injectable({ providedIn: 'root' }) -export class FreightAccountService extends BaseService { +export class FreightAccountService extends ShipperBaseService { $mock_url = '/rule?_allow_anonymous=true'; + // 获取账户余额信息 + $api_get_account_balance = '/api/fcc/accountBalance/getAccountBalance'; + + // 货主端获取账户余额交易明细 + $api_get_balance_by_shipper = '/api/fcc/accountBalanceDetail/getAccountBalanceByShipperPage'; + constructor(public injector: Injector) { super(injector); }