This commit is contained in:
wangshiming
2022-02-18 10:55:34 +08:00
parent cd4d216ec7
commit 149742b163
2 changed files with 43 additions and 16 deletions

View File

@ -223,21 +223,21 @@
<nz-card>
<div class="card-title">服务信息</div>
<div nz-row>
<div nz-col nzSpan="12">
<div nz-col nzSpan="18">
<sf #sf55 [schema]="schema55" [button]="'none'" [ui]="ui55" [formData]="sf55data"></sf>
</div>
</div>
<div nz-row [nzGutter]="24" style="margin: 24px 0">
<div nz-row [nzGutter]="24" style="margin-bottom: 24px">
<div nz-col [nzSpan]="10">
<div class="align-center">
<span style="font-weight: bolder; margin-right: 24px">购买货运险</span>
<span style="font-weight: bolder; margin-right: 12px">购买货运险</span>
<nz-alert nzType="warning" [nzMessage]="template1" nzShowIcon></nz-alert>
</div>
</div>
</div>
<ng-template #template1>推荐投保,填写货值自动估保费,司机接单后不可退保。详见<a>《投保告知》</a></ng-template>
<ng-template #template1>推荐投保,填写货值自动估保费,司机接单后不可退保。详见<a target="_blank" [queryParams]="{ type: 10 }" [routerLink]="['/passport/agreement']">《投保告知》</a></ng-template>
<div nz-row>
<div nz-col nzSpan="12">
<div nz-col nzSpan="18">
<sf #sf5 [schema]="schema5" [button]="'none'" [ui]="ui5" [formData]="sf5data">
<ng-template sf-template="goodsValue" let-i let-ui="ui">
<div class="align-center">
@ -246,12 +246,12 @@
[nzMin]="50000"
[nzMax]="3000000"
[nzStep]="0.01"
(ngModelChange)="i.setValue($event)"
(ngModelChange)="i.setValue($event);goodsValuesChange($event)"
nzPlaceHolder="请输入50000-3000000之间数值"
></nz-input-number>
</div>
</ng-template>
<ng-template sf-template="insureInfo" let-i let-ui="ui">
<ng-template sf-template="insurancePremium" let-i let-ui="ui">
<div class="align-center">
<input nz-input placeholder="保价费金额" [ngModel]="i.value" [disabled]="true" />
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2" nzTooltipPlacement="bottom"

View File

@ -412,19 +412,25 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'custom'
}
},
insureInfo: {
insurancePremium: {
type: 'string',
title: '',
ui: {
widget: 'custom'
}
},
insuranceRate: {
type: 'string',
title: '保险费率',
ui: {
hidden: true
}
}
},
required: ['goodsValue']
}
};
this.ui5 = {
'*': {
spanLabelFixed: 90,
spanLabelFixed: 115,
grid: { span: 12 }
}
};
@ -1007,11 +1013,32 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
});
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
}
goodsValuesChange(value: any) {
console.log(value);
console.log(this.totalDistance);
if(value >= 50000 && this.totalDistance > 0){
const params = {
goodsValue: value,
insuranceType: this.sf55.value.insuranceType,
km: this.totalDistance
};
this.service
.request(this.service.$api_getWholeInsuranceInfo, params)
.subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium',res.insurancePremium);
}else{
this.sf5.setValue('/insurancePremium',null);
}
});
}
}