|
|
@@ -261,7 +261,7 @@
|
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
|
:placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
- @blur="SZsizeComparison(item)"></van-field>
|
|
|
+ @blur="SZsizeComparison(item, 'A')"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="item.fileInfoList"></delete-upload-img>
|
|
|
@@ -449,7 +449,7 @@
|
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(item, index)"
|
|
|
+ @blur="DHWBsizeComparison(item, 'A')"
|
|
|
:placeholder="item.collectionOptionList[0].collectionOption"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
@@ -760,7 +760,7 @@
|
|
|
<van-field
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(childitem, childIndex)"
|
|
|
+ @blur="DHWBsizeComparison(childitem)"
|
|
|
:placeholder="
|
|
|
childitem.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -1174,7 +1174,7 @@
|
|
|
<van-field
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(childitem1, childIndex1)"
|
|
|
+ @blur="DHWBsizeComparison(childitem1)"
|
|
|
:placeholder="
|
|
|
childitem1.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -1597,7 +1597,7 @@
|
|
|
child33item1.collectionOptionList[0].answerValue
|
|
|
"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(child33item1, child33Index1)"
|
|
|
+ @blur="DHWBsizeComparison(child33item1)"
|
|
|
:placeholder="
|
|
|
child33item1.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -2351,12 +2351,7 @@
|
|
|
.answerValue
|
|
|
"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="
|
|
|
- DHWBsizeComparison(
|
|
|
- child44item1,
|
|
|
- child44Index1
|
|
|
- )
|
|
|
- "
|
|
|
+ @blur="DHWBsizeComparison(child44item1)"
|
|
|
:placeholder="
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.collectionOption
|
|
|
@@ -3089,7 +3084,6 @@
|
|
|
<van-field
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
:placeholder="childitem1.collectionOptionList[0].collectionOption"
|
|
|
- type="number"
|
|
|
@blur="SZsizeComparison(childitem1)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -3926,12 +3920,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 数字类型最大值最小值校验
|
|
|
- SZsizeComparison(item) {
|
|
|
- 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,
|
|
|
''
|
|
|
);
|
|
|
- this.$set(item, 'answerValue', value);
|
|
|
+ this.$set(itemData, 'answerValue', value);
|
|
|
if (value) {
|
|
|
// 最大值
|
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
@@ -3941,7 +3945,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -3953,15 +3957,25 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// 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) {
|
|
|
// 最大值
|
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
@@ -3971,7 +3985,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -3983,7 +3997,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -3991,7 +4005,7 @@ export default {
|
|
|
let leastOneChinese = item.collectionOptionList[0].leastOneChinese;
|
|
|
if (leastOneChinese == '1') {
|
|
|
if (!/[\u4e00-\u9fa5]/.test(value)) {
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法,至少有一个汉字');
|
|
|
}
|
|
|
}
|