解决冲突

This commit is contained in:
wangshiming
2022-02-25 17:19:20 +08:00
parent 4685f7ed60
commit 8d4c408e95
8 changed files with 59 additions and 36 deletions

View File

@ -174,7 +174,7 @@ export class ContractManagementContractListComponent implements OnInit {
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
containsAllLable: true, containsAllLable: true,
params: { dictKey: 'contract:document:type' }, params: { dictKey: 'goodresource:type' },
containAllLable:true, containAllLable:true,
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value, _$expand: (value: boolean) => value,

View File

@ -128,7 +128,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
default: '', default: '',
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'contract:template:type' }, params: { dictKey: 'goodresource:type' },
containsAllLable: true, containsAllLable: true,
visibleIf: { visibleIf: {
templateType: value => value === 'MX' templateType: value => value === 'MX'

View File

@ -105,7 +105,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit {
default: '', default: '',
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'contract:template:type' }, params: { dictKey: 'goodresource:type' },
containsAllLable: true, containsAllLable: true,
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value

View File

@ -105,7 +105,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit {
default: '', default: '',
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'contract:template:type' }, params: { dictKey: 'goodresource:type' },
containsAllLable: true, containsAllLable: true,
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value

View File

@ -105,7 +105,7 @@ export class ContractManagementTemplateDetailComponent implements OnInit {
default: '', default: '',
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'contract:template:type' }, params: { dictKey: 'goodresource:type' },
containsAllLable: true, containsAllLable: true,
visibleIf: { visibleIf: {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value

View File

@ -236,10 +236,9 @@
<div class="align-center"> <div class="align-center">
<nz-input-number <nz-input-number
[ngModel]="i.value" [ngModel]="i.value"
[nzMin]="50000"
[nzMax]="3000000"
[nzStep]="0.01" [nzStep]="0.01"
(ngModelChange)="i.setValue($event);getInsurersPrice($event)" (ngModelChange)="getInsurersPrice($event)"
nzPlaceHolder="请输入50000-3000000之间数值" nzPlaceHolder="请输入50000-3000000之间数值"
></nz-input-number> ></nz-input-number>
</div> </div>

View File

@ -1,5 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { debounceTime } from 'rxjs/operators';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Subject } from 'rxjs';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { import {
SFCheckboxWidgetSchema, SFCheckboxWidgetSchema,
@ -48,6 +50,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
startInfo: any = []; // 发货地数据 startInfo: any = []; // 发货地数据
endInfo: any = []; // 卸货地数据 endInfo: any = []; // 卸货地数据
PageStatus = ''; PageStatus = '';
changeSub = new Subject<string>();
envCache: any; envCache: any;
enterpriseProjectIds: any; enterpriseProjectIds: any;
constructor( constructor(
@ -125,6 +128,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.initSF6(); this.initSF6();
this.initSF7(); this.initSF7();
this.initdata(); this.initdata();
this.getInsurers()
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
@ -1290,30 +1294,54 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}); });
} }
} }
getInsurersPrice($event: any) { getInsurersPrice($event?: any) {
console.log($event); console.log($event);
this.changeSub.next(`${$event}`);
console.log(this.sf5.value.goodsValue)
console.log(this.sf5.value.insuranceType)
if (this.sf5.value.goodsValue >= 50000) {
if(this.totalDistance <=0){
this.service.msgSrv.warning('当前装卸货距离为0无法计算保价费金额');
return;
}
const params = {
goodsValue: this.sf5.value.goodsValue,
insuranceType: this.sf5.value.insuranceType,
km: this.totalDistance
};
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium', res.insurancePremium);
this.sf5.setValue('/insuranceRate', res.insuranceRate);
} else {
this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null);
}
});
}
} }
getInsurers($event?: any) {
this.changeSub.pipe(debounceTime(500)).subscribe((res: any) => {
console.log(res)
if (res) {
console.log(res)
if(res > 3000000 ) {
console.log('1111')
this.sf5.getProperty('/goodsValue')!.widget.reset(3000000);
this.sf5.setValue('/goodsValue', 3000000);
this.service.msgSrv.error('请输入50000-3000000之间数值!')
}
if(res < 50000) {
// this.sf5.setValue('/goodsValue', 50000);
this.sf5.getProperty('/goodsValue')!.widget.reset(50000);
this.sf5.setValue('/goodsValue', 50000);
console.log('2222')
this.service.msgSrv.error('请输入50000-3000000之间数值!')
}
if (this.sf5.value.goodsValue >= 50000) {
if(this.totalDistance <=0){
this.service.msgSrv.warning('当前装卸货距离为0无法计算保价费金额');
return;
}
const params = {
goodsValue: this.sf5.value.goodsValue,
insuranceType: this.sf5.value.insuranceType,
km: this.totalDistance
};
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium', res.insurancePremium);
this.sf5.setValue('/insuranceRate', res.insuranceRate);
} else {
this.sf5.setValue('/insurancePremium', null);
this.sf5.setValue('/insuranceRate', null);
}
});
}
}
});
}
} }

View File

@ -93,10 +93,6 @@ export class InsuranceTableComponent implements OnInit {
* @param i 下标 * @param i 下标
*/ */
changeEndKm(event: any, i: number) { changeEndKm(event: any, i: number) {
// console.log(this.debounce4(event, i));
// console.log(this.data[i].startKm);
// console.log(event);
// console.log(i);
if (event) { if (event) {
console.log(event); console.log(event);