|
|
@@ -262,6 +262,7 @@
|
|
|
v-model="item.answerValue"
|
|
|
:placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
type="number"
|
|
|
+ @blur="SZsizeComparison(item, index)"
|
|
|
@input="numberFn(item, index, 'A')"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -449,7 +450,8 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
|
- :formatter="formatter"
|
|
|
+ :formatter="dhwbFormatter"
|
|
|
+ @blur="DHWBsizeComparison(item, index)"
|
|
|
:placeholder="item.collectionOptionList[0].collectionOption"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
@@ -759,7 +761,7 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
- :formatter="formatter"
|
|
|
+ :formatter="dhwbFormatter"
|
|
|
:placeholder="
|
|
|
childitem.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -810,6 +812,7 @@
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
:placeholder="childitem.collectionOptionList[0].collectionOption"
|
|
|
type="number"
|
|
|
+ @blur="SZsizeComparison(childitem, index)"
|
|
|
@input="numberFn(childitem, index)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -1173,7 +1176,7 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
- :formatter="formatter"
|
|
|
+ :formatter="dhwbFormatter"
|
|
|
:placeholder="
|
|
|
childitem1.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -1595,7 +1598,7 @@
|
|
|
v-model="
|
|
|
child33item1.collectionOptionList[0].answerValue
|
|
|
"
|
|
|
- :formatter="formatter"
|
|
|
+ :formatter="dhwbFormatter"
|
|
|
:placeholder="
|
|
|
child33item1.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -1900,6 +1903,7 @@
|
|
|
child33item1.collectionOptionList[0].collectionOption
|
|
|
"
|
|
|
type="number"
|
|
|
+ @blur="SZsizeComparison(child33item1, index)"
|
|
|
@input="numberFn(child33item1, index)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -2349,7 +2353,7 @@
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.answerValue
|
|
|
"
|
|
|
- :formatter="formatter"
|
|
|
+ :formatter="dhwbFormatter"
|
|
|
:placeholder="
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.collectionOption
|
|
|
@@ -2688,6 +2692,12 @@
|
|
|
.collectionOption
|
|
|
"
|
|
|
type="number"
|
|
|
+ @blur="
|
|
|
+ SZsizeComparison(
|
|
|
+ child44item1,
|
|
|
+ child44Index1
|
|
|
+ )
|
|
|
+ "
|
|
|
@input="
|
|
|
numberFn(child44item1, child44Index1)
|
|
|
"></van-field>
|
|
|
@@ -3084,6 +3094,7 @@
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
:placeholder="childitem1.collectionOptionList[0].collectionOption"
|
|
|
type="number"
|
|
|
+ @blur="SZsizeComparison(childitem1, index)"
|
|
|
@input="numberFn(childitem1, index)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -3869,7 +3880,7 @@ export default {
|
|
|
},
|
|
|
formatter(value) {
|
|
|
return value.replace(
|
|
|
- /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
|
|
|
+ /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030|\s*/gi,
|
|
|
''
|
|
|
);
|
|
|
},
|
|
|
@@ -3917,32 +3928,75 @@ export default {
|
|
|
value.substr(value.indexOf('.'), 3)
|
|
|
);
|
|
|
}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 数字类型最大值最小值校验
|
|
|
+ SZsizeComparison(item, index) {
|
|
|
+ let value = item.answerValue;
|
|
|
+ if (value) {
|
|
|
// 最大值
|
|
|
- let maxValue = this.collectionItemList[index].collectionOptionList[0].maxValue;
|
|
|
+ let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
if (maxValue && maxValue != '') {
|
|
|
if (value > Number(maxValue)) {
|
|
|
// this.collectionItemList[index].answerValue = value.slice(0, -1);
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
|
- this.collectionItemList[index].answerValue = '';
|
|
|
+ this.$set(item, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
//最小值
|
|
|
- let minValue = this.collectionItemList[index].collectionOptionList[0].minValue;
|
|
|
+ let minValue = item.collectionOptionList[0].minValue;
|
|
|
if (minValue && minValue != '') {
|
|
|
if (value < Number(minValue)) {
|
|
|
// this.collectionItemList[index].answerValue = minValue;
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
|
- this.collectionItemList[index].answerValue = '';
|
|
|
+ this.$set(item, 'answerValue', '');
|
|
|
+ this.$toast('输入内容不合法');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // dhwb 单行文本校验
|
|
|
+ DHWBsizeComparison(item, index) {
|
|
|
+ let value = item.answerValue;
|
|
|
+ if (value) {
|
|
|
+ // 最大值
|
|
|
+ let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
+ if (maxValue && maxValue != '') {
|
|
|
+ if (value.length > Number(maxValue)) {
|
|
|
+ // this.collectionItemList[index].answerValue = value.slice(0, -1);
|
|
|
+ // this.$toast(
|
|
|
+ // this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
+ // );
|
|
|
+ this.$set(item, 'answerValue', '');
|
|
|
+ this.$toast('输入内容不合法');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //最小值
|
|
|
+ let minValue = item.collectionOptionList[0].minValue;
|
|
|
+ if (minValue && minValue != '') {
|
|
|
+ if (value.length < Number(minValue)) {
|
|
|
+ // this.collectionItemList[index].answerValue = minValue;
|
|
|
+ // this.$toast(
|
|
|
+ // this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
+ // );
|
|
|
+ this.$set(item, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 且只可输入:汉字、数字、字母、标点符号, 特殊字符:空格、换行、表情等不可输入
|
|
|
+ dhwbFormatter(value) {
|
|
|
+ return value.replace(
|
|
|
+ /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030|\s*/gi,
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ },
|
|
|
logshowFN() {
|
|
|
this.logshow = true;
|
|
|
},
|