Commit dd2a9db8 by chenwq

Merge branch 'SAAS+V5.8.4' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into feature/584/cwq
2 parents 42cb3ec3 2bbc8a37
......@@ -192,7 +192,7 @@ export default {
watch: {
'infoForm.baseSceneCode': {
handler(val) {
if (this.options.sceneTypeOpts && this.options.sceneTypeOpts.length && val.length) {
if (val.length) {
let { sceneFiles } = this.infoForm
this.infoForm.sceneFiles = val.map(baseSceneCode => {
let file = sceneFiles.find(file => file.baseSceneCode == baseSceneCode)
......
......@@ -156,17 +156,16 @@ export default {
immediate: true
},
'componentData.guaranteeStandard': {
handler(val) {
handler(val, oldVal) {
if(val == oldVal) return
let { ladderConditions } = this
if (!ladderConditions.length) {
ladderConditions.map(e => {
ladderConditions.map(e => {
e.startValue = ''
e.endValue = ''
e.aError = false
e.bError = false
})
this.$set(this, 'ladderConditions', ladderConditions)
}
},
deep: true
},
......
......@@ -611,9 +611,35 @@ export default {
},
/**
* 兜底标准输入(按指标类型应用不同规则)
* 当兜底标准修改时,检查阶梯模式区间,清空大于兜底标准的区间值
*/
handleStandardInput(value, item) {
item.guaranteeStandard = this.formatDecimal(value, this.isRateIndicator(item.guaranteeIndex) ? { min: 0, max: 100, decimalPlaces: 2 } : { min: 0, max: 99999999, decimalPlaces: 2 });
// 如果是阶梯模式,检查所有区间值是否大于兜底标准
if (item.compensationMode === 2 && item.ladderConditions && item.ladderConditions.length) {
const standard = Number.parseFloat(item.guaranteeStandard);
// 兜底标准被清空或无效,清空所有阶梯条件
if (Number.isNaN(standard) || standard <= 0 || item.guaranteeStandard === "") {
item.ladderConditions.forEach((ladder) => {
ladder.startValue = "";
ladder.endValue = "";
ladder.compensationAmount = "";
});
return;
}
// 兜底标准有效,清空大于兜底标准的区间值
item.ladderConditions.forEach((ladder) => {
const endValue = Number.parseFloat(ladder.endValue);
if (!Number.isNaN(endValue) && endValue > standard) {
// 清空大于兜底标准的区间值
ladder.startValue = "";
ladder.endValue = "";
ladder.compensationAmount = "";
}
});
}
},
/**
* 赔付金额输入(0-999999,小数点后 2 位)
......@@ -728,6 +754,14 @@ export default {
callback(new Error("开始值必须小于结束值"));
return;
}
// 校验区间值不能大于兜底标准
const standard = Number.parseFloat(item.guaranteeStandard);
if (!Number.isNaN(standard) && standard > 0) {
if (startValue > standard) {
callback(new Error(`开始值不能大于兜底标准`));
return;
}
}
// 区间冲突校验:与其他区间是否有重叠
const conflict = this.checkLadderConflict(item, lIdx, startValue, endValue);
if (conflict) {
......@@ -758,6 +792,14 @@ export default {
callback(new Error("结束值必须大于开始值"));
return;
}
// 校验区间值不能大于兜底标准
const standard = Number.parseFloat(item.guaranteeStandard);
if (!Number.isNaN(standard) && standard > 0) {
if (endValue > standard) {
callback(new Error(`结束值不能大于兜底标准`));
return;
}
}
// 区间冲突校验:与其他区间是否有重叠
const conflict = this.checkLadderConflict(item, lIdx, startValue, endValue);
if (conflict) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!