From da3b427a7792657502c128740db1b4dc63402387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Thu, 10 Mar 2022 10:16:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=90=E7=8E=B0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account-detail.component.ts | 2 +- .../components/list/list.component.ts | 2 +- .../recorded-detail.component.ts | 2 +- .../virtual-account-detail.component.ts | 2 +- .../withdrawals-detail.component.html | 63 ++++ .../withdrawals-detail.component.less | 17 + .../withdrawals-detail.component.ts | 73 +++++ .../withdrawals-record.component.html | 85 +++++ .../withdrawals-record.component.ts | 294 ++++++++++++++++++ .../routes/partner/partner-routing.module.ts | 6 +- src/app/routes/partner/partner.module.ts | 7 +- src/assets/mocks/menu-data.json | 10 + 12 files changed, 557 insertions(+), 6 deletions(-) create mode 100644 src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html create mode 100644 src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less create mode 100644 src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts create mode 100644 src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html create mode 100644 src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts diff --git a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts index 589fc368..9dd83dc6 100644 --- a/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts +++ b/src/app/routes/partner/account-management/components/account-detail/account-detail.component.ts @@ -5,7 +5,7 @@ import { ModalHelper, _HttpClient } from '@delon/theme'; import { AccountManagemantService } from '../../services/account-managemant.service'; @Component({ - selector: 'app-partner-account-detail', + selector: 'app-partner-account-management-account-detail', templateUrl: './account-detail.component.html', styleUrls: ['./account-detail.component.less'] }) diff --git a/src/app/routes/partner/account-management/components/list/list.component.ts b/src/app/routes/partner/account-management/components/list/list.component.ts index d49477c8..84e281a5 100644 --- a/src/app/routes/partner/account-management/components/list/list.component.ts +++ b/src/app/routes/partner/account-management/components/list/list.component.ts @@ -8,7 +8,7 @@ import { AccountManagemantService } from '../../services/account-managemant.serv import { PartnerAccountManagementVirtualAccountDetailComponent } from '../virtual-account-detail/virtual-account-detail.component'; @Component({ - selector: 'app-partner-list', + selector: 'app-partner-account-management-list', templateUrl: './list.component.html', }) export class PartnerAccountManagementListComponent implements OnInit { diff --git a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts index 49dfd681..4efdf3a2 100644 --- a/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts +++ b/src/app/routes/partner/account-management/components/recorded-detail/recorded-detail.component.ts @@ -6,7 +6,7 @@ import { ModalHelper, _HttpClient } from '@delon/theme'; import { AccountManagemantService } from '../../services/account-managemant.service'; @Component({ - selector: 'app-partner-recorded-detail', + selector: 'app-partner-account-management-recorded-detail', templateUrl: './recorded-detail.component.html', }) export class PartnerAccountManagementRecordedDetailComponent implements OnInit { diff --git a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts index 9a583480..c4c969dd 100644 --- a/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts +++ b/src/app/routes/partner/account-management/components/virtual-account-detail/virtual-account-detail.component.ts @@ -7,7 +7,7 @@ import { ShipperBaseService } from 'src/app/shared/services/business/shipper-bas import { AccountManagemantService } from '../../services/account-managemant.service'; @Component({ - selector: 'app-partner-virtual-account-detail', + selector: 'app-partner-account-management-virtual-account-detail', templateUrl: './virtual-account-detail.component.html', }) export class PartnerAccountManagementVirtualAccountDetailComponent implements OnInit { diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html new file mode 100644 index 00000000..82f0ce06 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html @@ -0,0 +1,63 @@ + + + + + + + + + +
+ + {{formData?.ltdName}} + + + {{formData?.bankType==='1'?'平安银行':'浦发银行'}} + + + {{formData?.refundApplyCode}} + + + {{formData?.bankAccountName}} + + + {{formData?.createTime}} + + + {{formData?.virtualAccount}} + + + {{formData?.refundStatusLabel}} + + + {{formData?.amount}} + + + {{formData?.bankSerialNumber}} + + + {{formData?.bankId}} + + + + +
+ + +
+
+ +
+
+
\ No newline at end of file diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less new file mode 100644 index 00000000..e299b7d1 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.less @@ -0,0 +1,17 @@ +:host::ng-deep { + + .ant-alert-info { + background-color: #f3f3f3; + border : 1px solid #dbdbdb; + + .ant-alert-message { + color: rgba(0, 0, 0, 0.85); + font-weight: 600; + font-size: 16px; + } + } + + .ant-form-item { + margin-bottom: 15px; + } +} \ No newline at end of file diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts new file mode 100644 index 00000000..74f5b1d4 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { FreightAccountService } from 'src/app/routes/financial-management/services/freight-account.service'; + +@Component({ + selector: 'app-partner-account-management-withdrawals-detail', + templateUrl: './withdrawals-detail.component.html', + styleUrls: ['./withdrawals-detail.component.less'] +}) +export class PartnerAccountManagementWithdrawalsDetailComponent implements OnInit { + formData: any = {}; + + timeLineData: any = []; + + constructor(public service: FreightAccountService, private route: ActivatedRoute) { + const id = route.snapshot.params.id; + this.loadRefundDetail(id); + } + + ngOnInit(): void { } + + loadRefundDetail(id: string) { + this.service.request(this.service.$api_get_refund_detail, { id }).subscribe(res => { + if (res) { + this.formData = res; + // 处理流程节点数据 + // 流程是否结束 + let isEnd = false; + if (res.successTime) { + isEnd = true; + if (res.refundStatus === '3') { + this.timeLineData.push({ time: res.successTime, value: `到账成功`, color: 'green' }); + } else { + this.timeLineData.push({ time: res.successTime, value: `提现失败`, color: 'red' }); + } + } + if (res.agreeTime && res.refundStatus !== '4') { + this.timeLineData.push({ time: res.agreeTime, value: `银行处理中`, color: 'gray' }); + } + if (res.agreeTime) { + if (res.refundStatus === '4') { + isEnd = true; + this.timeLineData.push({ + time: res.agreeTime, + value: `拒绝提现
操作人员:${res.handlerUserIdLabel}`, + color: 'red' + }); + } else { + this.timeLineData.push({ + time: res.agreeTime, + value: `审核通过
操作人员:${res.handlerUserIdLabel}`, + color: 'gray' + }); + } + } + if (res.createTime) { + this.timeLineData.push({ + time: res.createTime, + value: `提交提现申请
提现${res.amount}元至${res.bankName}(${res.bankCardNumber})
操作人员:${res.userIdLabel}`, + color: 'gray' + }); + } + if (this.timeLineData?.length > 0 && !isEnd) { + this.timeLineData[0].color = 'green'; + } + } + }); + } + + goBack() { + history.go(-1); + } +} diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html new file mode 100644 index 00000000..f81ec9dc --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.html @@ -0,0 +1,85 @@ + + + + + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + + + +
+
+ 已选择 + {{ selectedRows.length }} 条数据   累计提现 {{ + totalCallNo }} + 清空 +
+ +
+
+ + + + {{ item.bankName }}
{{ item.bankCardNumber }} +
+
+
+ + +
+
+ + + +
+
+
\ No newline at end of file diff --git a/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts new file mode 100644 index 00000000..054a9b09 --- /dev/null +++ b/src/app/routes/partner/account-management/components/withdrawals-record/withdrawals-record.component.ts @@ -0,0 +1,294 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from '@angular/router'; +import { STComponent, STColumn, STChange, STRequestOptions } 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'; + + +@Component({ + selector: 'app-partner-account-management-withdrawals-record', + templateUrl: './withdrawals-record.component.html', + 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; + columns: STColumn[] = this.initST(); + searchSchema: SFSchema = this.initSF(); + + _$expand = false; + + selectedRows: any[] = []; + totalCallNo = 0; + refundStatus: any = ''; + + msg = ''; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) { } + + ngOnInit(): void { } + + beforeReq = (requestOptions: STRequestOptions) => { + if (this.sf) { + Object.assign(requestOptions.body, { + ...this.sf.value, + createTime: { + start: this.sf.value.createTime?.[0] || '', + end: this.sf.value.createTime?.[1] || '' + }, + refundStatus: this.refundStatus || null + }); + } + return requestOptions; + }; + + afterRes = (data: any[], rawData?: any) => { + data = data.map(node => ({ ...node, disabled: node.refundStatus !== '1' })); + return data; + }; + + 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; + } + } + + changeRefundStatus(status?: string) { + this.refundStatus = status || null; + this.st.load(1); + } + + auditAction(item?: any) { + this.msg = ''; + let params: Array = []; + if (item) { + params = [item.id]; + } else { + params = this.selectedRows.map(node => node.id); + } + const modal = this.nzModalService.create({ + nzTitle: '审核', + nzContent: this.auditModal, + nzFooter: [ + { + label: '拒绝', + type: 'default', + onClick: () => { + this.service + .request(this.service.$api_disagree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核拒绝成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.service + .request(this.service.$api_agree_refund, { + refundApplicationId: params, + msg: this.msg + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核通过成功'); + modal.destroy(); + this.st.load(1); + } + }); + } + } + ] + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + showReason(item: any) { + const modal = this.nzModalService.create({ + nzTitle: '查看原因', + nzContent: '运单数据异常,暂时无法开票,请联系客服400-xxxx-xxxx', + nzFooter: [ + { + label: '关闭', + type: 'primary', + onClick: () => { + modal.destroy(); + } + } + ] + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } + + private initSF(): SFSchema { + return { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + refundApplyCode: { + type: 'string', + title: '提现单号', + ui: { + placeholder: '请输入' + } + }, + refundStatus: { + type: 'string', + title: '提现状态', + ui: { + widget: 'dict-select', + params: { dictKey: 'refund:apply:status' }, + placeholder: '请选择' + } + }, + createTime: { + title: '提现时间', + type: 'string', + ui: { + widget: 'sl-from-to-search', + format: 'yyyy-MM-dd', + placeholder: '请选择', + nzShowTime: true + } as SFDateWidgetSchema + }, + bankAccountName: { + type: 'string', + title: '账户名称', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + accountType: { + type: 'string', + title: '账户类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bank:type' }, + placeholder: '请选择', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + ltdId: { + type: 'string', + title: '网络货运人', + ui: { + widget: 'select', + placeholder: '请选择', + allowClear: true, + asyncData: () => this.service.getNetworkFreightForwarder(), + visibleIf: { + expand: (value: boolean) => value + } + } + }, + bankType: { + type: 'string', + title: '银行类型', + ui: { + widget: 'dict-select', + params: { dictKey: 'bankname:type' }, + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + } + } + }; + } + + 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: 'amount', + width: 120, + 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: '操作', + fixed: 'right', + width: '110px', + buttons: [ + { + text: '查看回单', + iif: item => item.refundStatus === '3', + click: item => + this.service.getReceiptUrl(item.receiptUrl, { + bankType: item.bankType, + rmYll: item.userId, + snglFlgCd: item.coreSerNo, + bussType: '06', + ltdId: item.ltdId + }) + }, + { + text: '审核', + iif: item => item.refundStatus === '1', + click: item => this.auditAction(item) + }, + { + text: '详情', + click: item => this.router.navigate(['/financial-management/withdrawals-record/detail/' + item.id]) + } + ] + } + ]; + } +} diff --git a/src/app/routes/partner/partner-routing.module.ts b/src/app/routes/partner/partner-routing.module.ts index f70fd812..9fef0745 100644 --- a/src/app/routes/partner/partner-routing.module.ts +++ b/src/app/routes/partner/partner-routing.module.ts @@ -25,6 +25,8 @@ import { PartnerAccountManagementListComponent } from './account-management/comp import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerAccountManagementWithdrawalsDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; const routes: Routes = [ { @@ -67,7 +69,9 @@ const routes: Routes = [ children: [ { path: 'list', component: PartnerAccountManagementListComponent }, { path: 'account-detail', component: PartnerAccountManagementAccountDetailComponent }, - { path: 'recorded-detail/:id', component: PartnerAccountManagementRecordedDetailComponent } + { path: 'recorded-detail/:id', component: PartnerAccountManagementRecordedDetailComponent }, + { path: 'withdraw-record', component: PartnerAccountManagementWithdrawalsRecordComponent }, + { path: 'withdraw-record/:id', component: PartnerAccountManagementWithdrawalsDetailComponent }, ] }, ]; diff --git a/src/app/routes/partner/partner.module.ts b/src/app/routes/partner/partner.module.ts index 7e3d1570..66b8695d 100644 --- a/src/app/routes/partner/partner.module.ts +++ b/src/app/routes/partner/partner.module.ts @@ -30,6 +30,8 @@ import { PartnerAccountManagementVirtualAccountDetailComponent } from './account import { ParterRebateManageMentRecordComponent } from './rebate-management/components/rebate-record/rebate-record.component'; import { PartnerAccountManagementAccountDetailComponent } from './account-management/components/account-detail/account-detail.component'; import { PartnerAccountManagementRecordedDetailComponent } from './account-management/components/recorded-detail/recorded-detail.component'; +import { PartnerAccountManagementWithdrawalsRecordComponent } from './account-management/components/withdrawals-record/withdrawals-record.component'; +import { PartnerAccountManagementWithdrawalsDetailComponent } from './account-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component'; const COMPONENTS: any[] = [ PartnerBusinessStatisticsIndexComponent, @@ -50,7 +52,10 @@ const COMPONENTS: any[] = [ PartnerAccountManagementListComponent, PartnerAccountManagementVirtualAccountDetailComponent, PartnerAccountManagementAccountDetailComponent, - PartnerAccountManagementRecordedDetailComponent]; + PartnerAccountManagementRecordedDetailComponent, + PartnerAccountManagementWithdrawalsRecordComponent, + PartnerAccountManagementWithdrawalsDetailComponent +]; @NgModule({ declarations: [...COMPONENTS], diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index 3307c095..82b7732b 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -548,6 +548,16 @@ "text": "账户明细", "link": "/partner/account-management/account-detail", "hide": true + }, + { + "text": "提现记录", + "link": "/partner/account-management/withdraw-record", + "hide": true + }, + { + "text": "提现详情", + "link": "/partner/account-management/withdraw-record/:id", + "hide": true } ] }