fix bug
This commit is contained in:
@ -329,7 +329,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
number: {
|
||||
@ -337,7 +337,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
carModel: {
|
||||
@ -373,7 +373,45 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['weight', 'carModel', 'carLength']
|
||||
};
|
||||
@ -381,10 +419,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
'*': {
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 8 }
|
||||
},
|
||||
$carModel: {
|
||||
spanLabelFixed: 100,
|
||||
grid: { span: 8 }
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -418,73 +452,30 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
type1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +10', '车源匹配率 +10'],
|
||||
enum: ['货源曝光率 +10', '车源匹配率 +10'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +10', '车源匹配率 +10']
|
||||
default: ['货源曝光率 +10', '车源匹配率 +10']
|
||||
},
|
||||
type2: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +20', '车源匹配率 +20'],
|
||||
enum: ['货源曝光率 +20', '车源匹配率 +20'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '赠送基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '赠送综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
default: ['货源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
insurancePremium: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
title: '服务包费用',
|
||||
readOnly:true,
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => this.customValidator(val),
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
},
|
||||
@ -494,9 +485,27 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '预投基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '预投综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
required: ['insurancePackagedGoods', 'insurancePremium']
|
||||
required: [ 'insurancePremium']
|
||||
};
|
||||
this.ui5 = {
|
||||
'*': {
|
||||
@ -518,6 +527,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -935,6 +945,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
paymentDays: this.sf7.value.paymentDays,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
insurancePackagedGoods:this.sf4.value.insurancePackagedGoods,
|
||||
goodsValue:this.sf4.value.goodsValue,
|
||||
};
|
||||
console.log(params);
|
||||
const modalRef = this.modalService.create({
|
||||
@ -1150,17 +1162,17 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
// 计算保价费金额
|
||||
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
||||
if (this.sf5.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.sf5.value.goodsValue,
|
||||
goodsValue: this.sf4.value.goodsValue,
|
||||
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 {
|
||||
}else{
|
||||
this.sf5.setValue('/insurancePremium', null);
|
||||
this.sf5.setValue('/insuranceRate', null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user