From 2ad18a13c0c3c46cdef7ade4d9dd45b3c6eb8e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Thu, 31 Mar 2022 17:58:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E4=B8=8A=E6=8A=A5=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fund-info/fund-info.component.html | 2 +- .../fund-info/fund-info.component.ts | 36 +++++++-- .../fund-reporting.component.html | 7 +- .../fund-reporting.component.ts | 74 +++++++++++++++---- .../reporting/services/reporting.service.ts | 5 +- 5 files changed, 98 insertions(+), 26 deletions(-) diff --git a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html index ab8abf9d..ec41a240 100644 --- a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html +++ b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.html @@ -1,5 +1,5 @@ - diff --git a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts index ee1f57f6..74fedc47 100644 --- a/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts +++ b/src/app/routes/datatable/reporting/components/fund-info/fund-info.component.ts @@ -19,7 +19,7 @@ export class DatatableReportingFundInfoComponent implements OnInit { get reqParams() { - return {}; + return { capitalCode: this?.record?.orderCode }; } constructor(public service: ReportingService, private modalRef: NzModalRef, public router: Router) { @@ -35,13 +35,34 @@ export class DatatableReportingFundInfoComponent implements OnInit { initST() { this.columns = [ { title: '序号', type: 'no', className: 'text-center', width: '60px', }, - { title: '监管平台字段', index: 'orderStatus', className: 'text-center', width: '120px', }, - { title: '系统字段', index: 'orderStatus', className: 'text-center', width: '100px', }, + { title: '监管平台字段', index: 'thirdPartyFieldName', className: 'text-center', width: '120px', }, + { title: '系统字段', index: 'checkFieldName', className: 'text-center', width: '100px', }, { title: '归属模块', index: 'orderStatus', className: 'text-center', width: '120px', }, - { title: '是否必填', index: 'orderStatus', className: 'text-center', width: '100px', }, - { title: '上传值', index: 'orderStatus', className: 'text-center', width: '150px', }, - { title: '本地校验', index: 'orderStatus', className: 'text-center', width: '100px', }, - { title: '错误内容', index: 'orderStatus', className: 'text-center', width: '150px', }, + { + title: '是否必填', + index: 'orderStatus', + className: 'text-center', + width: '100px', + type: 'enum', + enum: { + '0': '非必填', + '1': '必填', + }, + }, + { title: '上传值', index: 'fieldValue', className: 'text-center', width: '150px', }, + { + title: '本地校验', + index: 'checkStatus', + className: 'text-center', + type: 'enum', + enum: { + '0': '校验中', + '1': '通过', + '2': '不通过' + }, + width: '100px', + }, + { title: '错误内容', index: 'remark', className: 'text-center', width: '150px', }, ] } @@ -71,4 +92,5 @@ export class DatatableReportingFundInfoComponent implements OnInit { } + } diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html index 07ad3e63..ed76d2ea 100644 --- a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.html @@ -28,7 +28,8 @@ + [page]="{ show: true, showSize: true, pageSizes: [1,10,20, 50, 100] }" [loading]="false" + (change)="changeSt($event)"> {{item?.billStatusLabel}} @@ -48,10 +49,10 @@ {{item?.billStatusLabel}} -
{{item?.tolalAmount | currency :' '}}
+
{{item?.tolalAmount | currency }}
-
{{item?.payAmount | currency :' '}}
+
{{item?.payAmount | currency }}
diff --git a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts index 1d704f71..cc0563a2 100644 --- a/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts +++ b/src/app/routes/datatable/reporting/components/fund-reporting/fund-reporting.component.ts @@ -1,10 +1,11 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { STColumn, STComponent, STData } from '@delon/abc/st'; +import { STChange, STColumn, STComponent, STData } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; import { ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { ReportingService } from '../../services/reporting.service'; +import { DatatableReportingFundInfoComponent } from '../fund-info/fund-info.component'; import { DatatableReportingUploadSettingComponent } from '../upload-setting/upload-setting.component'; import { DatatableReportingVerifyResultComponent } from '../verify-result/verify-result.component'; @@ -30,6 +31,7 @@ export class DatatableFundReportingComponent implements OnInit { ]; selectedIndex = '1'; //选择的项目 serviceTel = ''; + selectedRows: any[] = []; constructor( public service: ReportingService, private router: Router, @@ -51,7 +53,7 @@ export class DatatableFundReportingComponent implements OnInit { */ get reqParams() { const params = Object.assign({}, this.sf?.value || {}, { - uploadStatus: this.selectedIndex, + uploadStatus: this.selectedIndex }); delete params._$expand; return { ...params }; @@ -60,9 +62,9 @@ export class DatatableFundReportingComponent implements OnInit { /** * 选中行 */ - get selectedRows() { - return this.st?.list.filter((item: any) => item.checked) || []; - } + // get selectedRows() { + // return this.st?.list.filter((item: any) => item.checked) || []; + // } /** * 伸缩查询条件 @@ -217,12 +219,12 @@ export class DatatableFundReportingComponent implements OnInit { { title: '', type: 'checkbox', className: 'text-center', width: '60px', }, { title: '上传状态', render: 'uploadStatus', className: 'text-center', width: '120px', }, { title: '本地校验', render: 'verifyStatus', className: 'text-center', width: '120px', }, - { title: '流水单号', index: 'serialNumberCode', className: 'text-center', width: '150px', }, + { title: '流水单号', index: 'serialNumberCode', className: 'text-center', width: '190px', }, { title: '订单号', render: 'orderCode', className: 'text-center', - width: '150px', + width: '180px', }, { title: '运单号', render: 'wayBillCode', className: 'text-center', width: '150px', }, { @@ -243,9 +245,9 @@ export class DatatableFundReportingComponent implements OnInit { { title: '收款银行', index: 'bankTypeLabel', className: 'text-center', width: '200px' }, - { title: '银行流水号', index: 'bankSerialNumber', className: 'text-center', width: '150px' }, + { title: '银行流水号', index: 'bankSerialNumber', className: 'text-center', width: '180px' }, { title: '实际支付金额', render: 'payAmount', className: 'text-center', width: '150px' }, - { title: '交易时间', index: 'transactionTime', className: 'text-center', width: '150px' }, + { title: '交易时间', index: 'transactionTime', className: 'text-center', width: '180px' }, { title: '上传次数', index: 'uploadFrequency', className: 'text-center', width: '120px' }, { title: '上传时间', index: 'uploadTime', className: 'text-center', width: '180px' }, ]; @@ -268,9 +270,11 @@ export class DatatableFundReportingComponent implements OnInit { nzOkText: '确定', nzCancelText: '取消', nzOnOk: () => { - this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_fund_reporting_recall, ids).subscribe((res: any) => { if (res) { this.service.msgSrv.success('撤销成功'); + this.search(); } }) @@ -326,7 +330,8 @@ export class DatatableFundReportingComponent implements OnInit { this.openWainingModal('请选择需要上传的数据'); return; } - this.service.request(this.service.$api_recall_reporting, { rows: this.selectedRows }).subscribe((res: any) => { + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_fund_reporting_upload, ids).subscribe((res: any) => { if (res) { this.service.msgSrv.success('上传成功'); this.search(); @@ -354,13 +359,13 @@ export class DatatableFundReportingComponent implements OnInit { /** * 查看校验结果 */ - viewResult(item: any) { + viewResult(record: any) { const modalRef = this.modal.create({ nzTitle: '校验结果', nzWidth: 1200, - nzContent: DatatableReportingVerifyResultComponent, + nzContent: DatatableReportingFundInfoComponent, nzComponentParams: { - record: item + record }, nzFooter: null }); @@ -380,6 +385,7 @@ export class DatatableFundReportingComponent implements OnInit { search() { + this.selectedRows = []; this.st.load(1); } @@ -398,5 +404,45 @@ export class DatatableFundReportingComponent implements OnInit { }) } + changeSt(e: STChange): void { + + 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); + } + }) + } + } else if (e.type === 'loaded') { + // 页面加载时勾选 + (e?.loaded || []).forEach((r: any) => { + this.selectedRows.forEach((x) => { + if (x.id === r.id) { + r.checked = true; + } + }); + }); + } + } } diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts index bc10de77..ff73672a 100644 --- a/src/app/routes/datatable/reporting/services/reporting.service.ts +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -12,7 +12,10 @@ export class ReportingService extends BaseService { $api_get_upload_setting = ``; // 修改上传设置 $api_upload_setting_save = ``; // 修改上传设置 - $api_get_fund_reporting_page = `/api/fcc/fundUploadHead/list/page`; + $api_get_fund_reporting_page = `/api/fcc/fundUploadHead/list/page`; // 资金上报列表 + $api_fund_reporting_upload = `/api/fcc/fundUploadHead/uploadFundNumber`; // 资金批量上传 + $api_fund_reporting_recall = `/api/fcc/fundUploadHead/recallUploadFundNumber`; //资金批量撤回 + $api_get_fund_valid_result = `/api/fcc/capitalFieldCheck/getCapitalFieldCheckList`; // 查询资金校验表 constructor(public injector: Injector) { super(injector); }