From 83deb7c465bc3c624a56089844cea6a725f45db8 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 8 Mar 2022 14:38:12 +0800 Subject: [PATCH] fix bug --- .../onecar-publish/onecar-publish.component.ts | 6 +++--- .../vehicle-detail/vehicle-detail.component.html | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index da4e8c3e..b84972e9 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -407,7 +407,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { params: { dictKey: 'insure:packaged:goods' }, containsAllLabel: false, validator: val => { - if (this.sf5.value?.insuranceType !=='3' && this.isEmpty(val)) { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { return [{ keyword: 'required', message: '必填项' }]; } else { return []; @@ -421,7 +421,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ui: { widget: 'custom', validator: val => { - if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) { + if (this.sf5?.value?.insuranceType && this.sf5?.value?.insuranceType !=='3' && this.isEmpty(val)) { return [{ keyword: 'required', message: '必填项' }]; } else { return []; @@ -1383,7 +1383,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } // 计算保价费金额 getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { - if ( this.sf5.value.insuranceType !=='3' && this.sf4.value.goodsValue >= 50000 && this.totalDistance > 0 ) { + if ( this.sf5.value?.insuranceType !=='3' && this.sf4.value?.goodsValue >= 50000 && this.totalDistance > 0 ) { const params = { insuranceType, goodsValue: this.sf4.value.goodsValue, diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html index 9429b4ee..5249b461 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html @@ -156,13 +156,15 @@ - - {{ i?.insuranceTypeLabel }} + + {{ i?.insuranceTypeLabel}} - - {{ i?.goodsValue | currency }} + + {{i?.goodsValue !==null?(i?.goodsValue|currency)+'元':'-'}} + + + {{i?.insurancePremium!==null?(i?.insurancePremium |currency)+'元':'-'}} - {{ i?.insurancePremium | currency }} 元