Commit 74e7aa0b authored by 郭志伟's avatar 郭志伟

fix: 华贵试算提示问题修复

parent cb98ee30
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
this.$emit(DATA_CHANGE_EVENT, this.formData); this.$emit(DATA_CHANGE_EVENT, this.formData);
}, },
resetFormItemVal(key, val) { resetFormItemVal(key, val) {
if (this.formData.birth && this.formData[key] && !val) { if (this.formData.birth && val && this.formData[key] === val) {
switch (key) { switch (key) {
case "amountInsured": case "amountInsured":
this.$notify({ type: "warning", message: "已超出该年龄承保的最高保额,请重新选择" }); this.$notify({ type: "warning", message: "已超出该年龄承保的最高保额,请重新选择" });
......
export default { export default {
data() {
return {
ageIndexCache: "",
isAgeIndexChange: false
};
},
computed: { computed: {
// 场景不同暂不做整合 // 场景不同暂不做整合
// age() { // age() {
...@@ -16,6 +22,7 @@ export default { ...@@ -16,6 +22,7 @@ export default {
}, },
ageIndex() { ageIndex() {
const { age } = this; const { age } = this;
let _index = 0;
const ageRangeList = [ const ageRangeList = [
[18, 35], [18, 35],
[31, 35], [31, 35],
...@@ -27,9 +34,17 @@ export default { ...@@ -27,9 +34,17 @@ export default {
]; ];
// 特殊情况 // 特殊情况
if (31 <= age && age <= 35) { if (31 <= age && age <= 35) {
return 1; _index = 1;
} else {
_index = ageRangeList.findIndex(item => item[0] <= age && age <= item[1]);
} }
return ageRangeList.findIndex(item => item[0] <= age && age <= item[1]); if (this.ageIndexCache !== _index) {
this.ageIndexCache = _index;
this.isAgeIndexChange = true;
} else {
this.isAgeIndexChange = false;
}
return _index;
}, },
amountOptions() { amountOptions() {
const { ageIndex, countOptions } = this; const { ageIndex, countOptions } = this;
......
...@@ -919,7 +919,7 @@ export default { ...@@ -919,7 +919,7 @@ export default {
resetFormItemVal(key, val) { resetFormItemVal(key, val) {
const currentIdNo = this.getRealIdNo(); const currentIdNo = this.getRealIdNo();
const birthday = this.getBirthDate(currentIdNo); const birthday = this.getBirthDate(currentIdNo);
if (birthday && this.formData.productItem[key] && !val) { if (birthday && this.formData.productItem[key] === val && val) {
switch (key) { switch (key) {
case "amountInsured": case "amountInsured":
this.$notify({ type: "warning", message: "已超出该年龄承保的最高保额,请重新选择" }); this.$notify({ type: "warning", message: "已超出该年龄承保的最高保额,请重新选择" });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment