diff --git a/src/app/routes/insurance-management/components/list/list.component.html b/src/app/routes/insurance-management/components/list/list.component.html index 226346c3..6405c0a4 100644 --- a/src/app/routes/insurance-management/components/list/list.component.html +++ b/src/app/routes/insurance-management/components/list/list.component.html @@ -4,19 +4,26 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @LastEditors : Shiming - * @LastEditTime : 2022-02-14 13:29:21 + * @LastEditTime : 2022-02-17 10:12:21 * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> - - +
- +
@@ -25,10 +32,8 @@
- - + + +
- \ No newline at end of file + diff --git a/src/app/routes/insurance-management/components/list/list.component.ts b/src/app/routes/insurance-management/components/list/list.component.ts index 842b16a8..bddd9a85 100644 --- a/src/app/routes/insurance-management/components/list/list.component.ts +++ b/src/app/routes/insurance-management/components/list/list.component.ts @@ -50,11 +50,11 @@ export class insuranceManagementListComponent implements OnInit { } ]; tabs = { - cancelQuantity: 0, + totalCount: 0, receivedQuantity: 0, stayQuantity: 0, GoingQuantity: 0, - totalCount: 0 + cancelQuantity: 0 }; constructor( public service: InsuranceManagementService, @@ -69,7 +69,7 @@ export class insuranceManagementListComponent implements OnInit { get reqParams() { const a: any = {}; if (this.resourceStatus) { - a.billStatus = this.resourceStatus; + a.insureStatus = this.resourceStatus; } const params: any = Object.assign({}, this.sf?.value || {}); delete params._$expand; @@ -91,36 +91,32 @@ export class insuranceManagementListComponent implements OnInit { } getGoodsSourceStatistical() { this.tabs = { - cancelQuantity: 0, + totalCount: 0, receivedQuantity: 0, stayQuantity: 0, GoingQuantity: 0, - totalCount: 0 + cancelQuantity: 0 }; const params: any = Object.assign({}, this.reqParams || {}); - delete params.billStatus - // this.service.request(this.service.$api_getBulkStatistical, params).subscribe((res: any) => { - // if (res) { - // let totalCount = 0; - // res.forEach((element: any) => { - // if (element.billStatusLabel === '待发车') { - // this.tabs.stayQuantity = element.quantity; - // } else if (element.billStatusLabel === '待接单') { - // this.tabs.receivedQuantity = element.quantity; - // } else if (element.billStatusLabel === '待签收') { - // this.tabs.signQuantity = element.quantity; - // } else if (element.billStatusLabel === '已完成') { - // this.tabs.compolatelQuantity = element.quantity; - // } else if (element.billStatusLabel === '已取消') { - // this.tabs.cancelQuantity = element.quantity; - // } else if (element.billStatusLabel === '运输中') { - // this.tabs.GoingQuantity = element.quantity; - // } - // totalCount += element.quantity; - // }); - // this.tabs.totalCount = totalCount; - // } - // }); + delete params.insureStatus; + this.service.request(this.service.$api_listStatisticalStatus, params).subscribe((res: any) => { + if (res) { + let totalCount = 0; + res.forEach((element: any) => { + if (element.insureStatusLabel === '待投保') { + this.tabs.receivedQuantity = element.quantity; + } else if (element.insureStatusLabel === '已投保') { + this.tabs.stayQuantity = element.quantity; + } else if (element.insureStatusLabel === '投保失败') { + this.tabs.GoingQuantity = element.quantity; + } else if (element.insureStatusLabel === '已取消') { + this.tabs.cancelQuantity = element.quantity; + } + totalCount += element.quantity; + }); + this.tabs.totalCount = totalCount; + } + }); } selectChange(e: number) { this.resourceStatus = e; @@ -142,6 +138,10 @@ export class insuranceManagementListComponent implements OnInit { this.schema = { properties: { _$expand: { type: 'boolean', ui: { hidden: true } }, + insureCode: { + type: 'string', + title: '投保编号' + }, billCode: { type: 'string', title: '订单号' @@ -150,6 +150,15 @@ export class insuranceManagementListComponent implements OnInit { type: 'string', title: '货源编号' }, + policyNo: { + type: 'string', + title: '保单号', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } + }, shipperAppUserId: { type: 'string', title: '货主', @@ -159,6 +168,9 @@ export class insuranceManagementListComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', allowClear: true, + visibleIf: { + _$expand: (value: boolean) => value + }, onSearch: (q: any) => { if (!!q) { return this.service @@ -316,7 +328,6 @@ export class insuranceManagementListComponent implements OnInit { this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } - /** * 初始化数据列表 */ @@ -334,17 +345,17 @@ export class insuranceManagementListComponent implements OnInit { title: '保单号', width: '250px', className: 'text-right', - render: 'policyNo' + index: 'policyNo' }, { title: '类型', index: 'insureTypeLabel', width: '220px', className: 'text-left' }, { title: '始发地', index: 'startAddress', width: '220px', className: 'text-left' }, { title: '目的地', index: 'endAddress', width: '220px', className: 'text-left' }, - { title: '距离', index: 'distance', width: '180px', className: 'text-left' }, - { title: '保额(元)', index: 'resourceCode', width: '180px', className: 'text-left' }, - { title: '保费(元)', render: 'premium', width: '180px', className: 'text-left' }, + { title: '距离', render: 'distance', width: '180px', className: 'text-left' }, + { title: '保额(元)', render: 'insureAmount', width: '180px', className: 'text-right' }, + { title: '保费(元)', render: 'premium', width: '180px', className: 'text-right' }, { title: '实际保费(元)', - className: 'text-left', + className: 'text-right', width: '180px', render: 'practicalPremium' }, @@ -355,15 +366,15 @@ export class insuranceManagementListComponent implements OnInit { render: 'goodsName' }, { - title: '车牌号', + title: '承运司机', className: 'text-right', - width: '180px', + width: '250px', render: 'driverName' }, { title: '关联订单号', className: 'text-right', - index: 'goodsNumber', + render: 'goodsNumber', width: '180px' }, { @@ -376,19 +387,19 @@ export class insuranceManagementListComponent implements OnInit { title: '网络货运人', className: 'text-left', width: '250px', - index: 'enterpriseInfoName', + index: 'enterpriseInfoName' }, { title: '货主', className: 'text-left', width: '180px', - index: 'shipperAppUserName', + index: 'shipperAppUserName' }, { title: '所属项目', width: '200px', className: 'text-left', - render: 'enterpriseProjectName' + index: 'enterpriseProjectName' }, { title: '投保时间', @@ -419,6 +430,7 @@ export class insuranceManagementListComponent implements OnInit { width: '180px', className: 'text-left', index: 'processMessage' + // processResult=2 }, { title: '操作', @@ -428,19 +440,19 @@ export class insuranceManagementListComponent implements OnInit { buttons: [ { text: '再次投保', - click: _record => console.log(''), + click: _record => this.retreatNext(_record) // iif: item => // item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1' }, { text: '查看保单', - click: _record => console.log(''), + click: _record => console.log('') // iif: item => // item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1' }, { text: '退保费', - click: _record => this.changeOrder(), + click: _record => this.retreatPrice(_record) } ] } @@ -469,8 +481,39 @@ export class insuranceManagementListComponent implements OnInit { this._$expand = false; } - // 修改订单 - changeOrder() { - this.router.navigate(['/insurance-management/list-set', 1]); + // 退保费 + retreatPrice(value: any) { + this.modal.warning({ + nzTitle: '确认退还保费吗?', + nzClosable: true, + nzContent: '退还后不可撤销,请谨慎操作!', + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_del_many, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除菜单成功'); + } + }); + } + }); } + // 再次投保 + retreatNext(value: any) { + this.modal.warning({ + nzTitle: '确认再次投保吗?', + nzClosable: true, + nzCancelText: '取消', + nzOnOk: () => { + this.service.request(this.service.$api_del_many, [value.id]).subscribe(res => { + if (res) { + this.service.msgSrv.success('删除菜单成功'); + } + }); + } + }); + } + // 保险配置 + changeOrder() { + this.router.navigate(['/insurance-management/list-set', 1]); + } } diff --git a/src/app/routes/insurance-management/services/insurance-management.service.ts b/src/app/routes/insurance-management/services/insurance-management.service.ts index 51e399db..deaea9a6 100644 --- a/src/app/routes/insurance-management/services/insurance-management.service.ts +++ b/src/app/routes/insurance-management/services/insurance-management.service.ts @@ -21,6 +21,8 @@ export class InsuranceManagementService extends ShipperBaseService { public $api_enterpriceList = '/api/mdc/cuc/enterpriseInfo/operate/enterpriceList'; // 查询保险费信息表 public $api_premiumInfo_list = '/api/sdc/premiumInfo/list/page'; + // 统计保险单状态数量 + public $api_listStatisticalStatus = '/api/sdc/premiumInfo/listStatisticalStatus'; // 保险费公司认证