|
@@ -153,7 +153,7 @@
|
|
|
<van-field
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
v-model="item.answerValue"
|
|
|
:placeholder="item.text"
|
|
:placeholder="item.text"
|
|
|
- @blur="SZsizeComparison(item)"></van-field>
|
|
|
|
|
|
|
+ @blur="SZsizeComparison(item, 'A')"></van-field>
|
|
|
<p
|
|
<p
|
|
|
style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
|
|
style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
|
|
|
<van-field
|
|
<van-field
|
|
@@ -346,7 +346,7 @@
|
|
|
<van-field
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
v-model="item.answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(item, index)"
|
|
|
|
|
|
|
+ @blur="DHWBsizeComparison(item, 'A')"
|
|
|
:placeholder="item.text"></van-field>
|
|
:placeholder="item.text"></van-field>
|
|
|
<p
|
|
<p
|
|
|
style="
|
|
style="
|
|
@@ -3617,8 +3617,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 数字类型最大值最小值校验
|
|
// 数字类型最大值最小值校验
|
|
|
- SZsizeComparison(item, index) {
|
|
|
|
|
- let value = item.answerValue.replace(
|
|
|
|
|
|
|
+ SZsizeComparison(item, type) {
|
|
|
|
|
+ // type == A 是一级,answerValue 在当前层级,否则在子集collectionOptionList
|
|
|
|
|
+ let answerValue = null;
|
|
|
|
|
+ let itemData = null;
|
|
|
|
|
+ if (type == 'A') {
|
|
|
|
|
+ answerValue = item.answerValue;
|
|
|
|
|
+ itemData = item;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ answerValue = item.collectionOptionList[0].answerValue;
|
|
|
|
|
+ itemData = item.collectionOptionList[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ let value = answerValue.replace(
|
|
|
/[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
/[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
|
''
|
|
''
|
|
|
);
|
|
);
|
|
@@ -3632,7 +3642,7 @@ export default {
|
|
|
// this.$toast(
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
|
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3644,15 +3654,25 @@ export default {
|
|
|
// this.$toast(
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
|
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// dhwb 单行文本校验
|
|
// dhwb 单行文本校验
|
|
|
- DHWBsizeComparison(item, index) {
|
|
|
|
|
- let value = item.answerValue;
|
|
|
|
|
|
|
+ DHWBsizeComparison(item, type) {
|
|
|
|
|
+ // type == A 是一级,answerValue 在当前层级,否则在子集collectionOptionList
|
|
|
|
|
+ let answerValue = null;
|
|
|
|
|
+ let itemData = null;
|
|
|
|
|
+ if (type == 'A') {
|
|
|
|
|
+ answerValue = item.answerValue;
|
|
|
|
|
+ itemData = item;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ answerValue = item.collectionOptionList[0].answerValue;
|
|
|
|
|
+ itemData = item.collectionOptionList[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ let value = answerValue;
|
|
|
if (value) {
|
|
if (value) {
|
|
|
// 最大值
|
|
// 最大值
|
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
@@ -3662,7 +3682,7 @@ export default {
|
|
|
// this.$toast(
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
|
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3674,7 +3694,7 @@ export default {
|
|
|
// this.$toast(
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
|
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3682,7 +3702,7 @@ export default {
|
|
|
let leastOneChinese = item.collectionOptionList[0].leastOneChinese;
|
|
let leastOneChinese = item.collectionOptionList[0].leastOneChinese;
|
|
|
if (leastOneChinese == '1') {
|
|
if (leastOneChinese == '1') {
|
|
|
if (!/[\u4e00-\u9fa5]/.test(value)) {
|
|
if (!/[\u4e00-\u9fa5]/.test(value)) {
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
|
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法,至少有一个汉字');
|
|
this.$toast('输入内容不合法,至少有一个汉字');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|