From a8ca0fa98e7f873d9322700a55ed63cf59c1acb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E6=99=93=E4=BA=91?= Date: Thu, 7 Apr 2022 15:18:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E4=B8=8A=E6=8A=A5=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fund-reporting.component.html | 3 +- .../fund-reporting.component.ts | 41 ++++++--- .../order-reporting.component.html | 8 +- .../order-reporting.component.ts | 85 +++++++++++++++++-- .../reporting/services/reporting.service.ts | 3 +- 5 files changed, 117 insertions(+), 23 deletions(-) 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 98069a2c..ca872918 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,7 @@ + [page]="{ show: true, showSize: true, pageSizes: [10,20, 50, 100] }" (change)="changeSt($event)"> {{item?.uploadStatusLabel}} @@ -58,5 +58,6 @@ + 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 e6d1d68a..e7bdf47b 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 @@ -7,7 +7,6 @@ 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'; @Component({ selector: 'app-datatable-fund-reporting', @@ -230,24 +229,24 @@ export class DatatableFundReportingComponent implements OnInit { className: 'text-center', width: '180px', }, - { title: '运单号', render: 'wayBillCode', className: 'text-center', width: '150px', }, + { title: '运单号', render: 'wayBillCode', className: 'text-center', width: '180px', }, { title: '网络货运人', index: 'ltdName', className: 'text-center', width: '180px', }, - { title: '实际承运人名称', index: 'carrier', className: 'text-center', width: '200px' }, - { title: '实际承运人证件号码', index: 'cardId', className: 'text-center', width: '120px' }, + { title: '实际承运人名称', index: 'carrier', className: 'text-center', width: '150px' }, + { title: '实际承运人证件号码', index: 'cardId', className: 'text-center', width: '200px' }, { title: '车牌号', index: 'carNumber', className: 'text-center', width: '180px' }, { title: '车牌颜色', index: 'carColor', className: 'text-center', width: '180px' }, { title: '总金额', render: 'tolalAmount', className: 'text-center', width: '120px' }, - { title: '付款方式', index: 'payTypeLabel', className: 'text-center', width: '180px' }, - { title: '车队长', index: 'payee', className: 'text-center', width: '250px' }, - { title: '收款账户', index: 'collectionAccount', className: 'text-center', width: '200px' }, + { title: '付款方式', index: 'payTypeLabel', className: 'text-center', width: '150px' }, + { title: '车队长', index: 'payee', className: 'text-center', width: '150px' }, + { title: '收款账户', index: 'collectionAccount', className: 'text-center', width: '180px' }, - { title: '收款银行', index: 'bankTypeLabel', className: 'text-center', width: '200px' }, + { title: '收款银行', index: 'bankTypeLabel', className: 'text-center', width: '150px' }, { title: '银行流水号', index: 'bankSerialNumber', className: 'text-center', width: '180px' }, { title: '实际支付金额', render: 'payAmount', className: 'text-center', width: '150px' }, @@ -290,7 +289,9 @@ export class DatatableFundReportingComponent implements OnInit { selectChange(item: any) { this.selectedIndex = item?.value || ''; + setTimeout(() => { + this.selectedRows = []; this.st.load(1); }) } @@ -378,14 +379,34 @@ export class DatatableFundReportingComponent implements OnInit { }) } + + /** * 查看监管审核结果 */ viewAuditResult(record: any) { - if (record?.verifyStatus !== '1') { + if (record?.verifyStatus !== '2') { return; } - this.openWainingModal('监管审核结果', record?.result) + this.openWainingModal('监管审核结果', record?.uploadResult) + } + + /** + * 更新数据 + */ + updateData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_update_fund_data, ids).subscribe(res => { + if (res) { + this.selectedRows = []; + this.st.reload(); + + } + }) } diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html index c500e2d0..117c0795 100644 --- a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.html @@ -28,7 +28,8 @@ + [page]="{ show: true, showSize: true, pageSizes: [10,20, 50, 100] }" [loading]="service.http.loading" + (change)="changeSt($event)"> {{filterStatus(item?.orderCheckStatus)}} @@ -65,10 +66,10 @@ - 查看轨迹 + 查看轨迹 - 查看轨迹 + 查看轨迹 @@ -80,6 +81,7 @@ + diff --git a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts index 6d3fe302..d5b58c12 100644 --- a/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts +++ b/src/app/routes/datatable/reporting/components/order-reporting/order-reporting.component.ts @@ -1,6 +1,6 @@ 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'; @@ -31,6 +31,7 @@ export class DatatableOrderReportingComponent implements OnInit { selectedIndex = ''; //选择的项目 serviceTel = ''; isLoading: boolean = false; + selectedRows: any[] = []; constructor( public service: ReportingService, private router: Router, @@ -61,9 +62,9 @@ export class DatatableOrderReportingComponent implements OnInit { /** * 选中行 */ - get selectedRows() { - return this.st?.list.filter((item: any) => item.checked) || []; - } + // get selectedRows() { + // return this.st?.list.filter((item: any) => item.checked) || []; + // } /** * 伸缩查询条件 @@ -293,14 +294,13 @@ export class DatatableOrderReportingComponent implements OnInit { className: 'text-center', width: '180px', }, - - { title: '统一社会信用代码', index: 'unifiedSocialCreditCode', render: 'loadingPlace', className: 'text-center', width: '200px' }, + { title: '统一社会信用代码', index: 'unifiedSocialCreditCode', className: 'text-center', width: '200px' }, { title: '运单生成时间', index: 'wayBillCreateTime', className: 'text-center', width: '180px' }, { title: '发货时间', index: 'dispatchedDate', className: 'text-center', width: '180px' }, { title: '收货时间', index: 'receivingDate', className: 'text-center', width: '180px' }, { title: '托运人名称', index: 'shipperName', className: 'text-center', width: '250px' }, - { title: '托运人统一社会信用代码', index: 'shipperCreditCode', render: 'loadingPlace', className: 'text-center', width: '200px' }, - { title: '装货地址', index: 'loadingAddress', render: 'dischargePlace', className: 'text-center', width: '200px' }, + { title: '托运人统一社会信用代码', index: 'shipperCreditCode', className: 'text-center', width: '200px' }, + { title: '装货地址', index: 'loadingAddress', className: 'text-center', width: '200px' }, { title: '收货方名称', index: 'receivingName', className: 'text-center', width: '150px' }, { title: '收货地址', index: 'consigneeAddress', className: 'text-center', width: '150px' }, { title: '运费金额', render: 'freightAmount', className: 'text-center', width: '250px' }, @@ -364,9 +364,51 @@ export class DatatableOrderReportingComponent 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; + } + }); + }); + } + } + selectChange(item: any) { this.selectedIndex = item?.representationsStatus || ''; setTimeout(() => { + this.selectedRows = []; this.st.load(1); }) } @@ -465,6 +507,7 @@ export class DatatableOrderReportingComponent implements OnInit { search() { + this.selectedRows = []; this.st.load(1); } @@ -483,6 +526,32 @@ export class DatatableOrderReportingComponent implements OnInit { }) } + /** + * 查看轨迹 + */ + viewTrack(_record: any) { + // const =; + this.router.navigate([]) + } + + /** + * 更新数据 + */ + updateData() { + if (this.selectedRows.length === 0) { + this.openWainingModal('请选择需要更新的数据'); + return; + } + const ids = this.selectedRows.map(i => i?.id); + this.service.request(this.service.$api_update_fund_data, ids).subscribe(res => { + if (res) { + this.selectedRows = []; + this.st.reload(); + + } + }) + } + filterStatus(status: number) { switch (status) { case 0: diff --git a/src/app/routes/datatable/reporting/services/reporting.service.ts b/src/app/routes/datatable/reporting/services/reporting.service.ts index 1cf31e76..155de748 100644 --- a/src/app/routes/datatable/reporting/services/reporting.service.ts +++ b/src/app/routes/datatable/reporting/services/reporting.service.ts @@ -6,7 +6,7 @@ import { BaseService } from '@shared'; }) export class ReportingService extends BaseService { - $api_get_order_reporting_page = `/api/sdc/regulation/list/page`; // 订单上报列表 + $api_get_order_reporting_page = `/api/sdc/regulation/list/queryPage`; // 订单上报列表 $api_upload_order_reporting = `/api/sdc/regulation/push`; // 上传订单上报 $api_recall_order_reporting = `/api/sdc/regulation/withdraw`; // 撤回上传订单上报 $api_async_export_order_reporting_list = ``; // 导出订单上报 @@ -17,6 +17,7 @@ export class ReportingService extends BaseService { $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`; // 查询资金校验表 + $api_update_fund_data = `/api/fcc/fundUploadHead/updateUploadFundNumber`;//资金批量更新数据 constructor(public injector: Injector) {