|
|
@@ -3578,15 +3578,18 @@ export default {
|
|
|
},
|
|
|
numberFn(val, index, type) {
|
|
|
let value = this.collectionItemList[index].answerValue;
|
|
|
- if (value && !/^[+-]?\d*\.{0,1}\d{0,1}$/.test(value)) {
|
|
|
- value = this.collectionItemList[index].answerValue.replace(
|
|
|
- /\.\d{2,}$/,
|
|
|
- value.substr(value.indexOf('.'), 3)
|
|
|
- );
|
|
|
+ if (value) {
|
|
|
+ if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(value)) {
|
|
|
+ value = this.collectionItemList[index].answerValue.replace(
|
|
|
+ /\.\d{2,}$/,
|
|
|
+ value.substr(value.indexOf('.'), 3)
|
|
|
+ );
|
|
|
+ }
|
|
|
// 最大值
|
|
|
let maxValue = this.collectionItemList[index].collectionOptionList[0].maxValue;
|
|
|
if (maxValue) {
|
|
|
if (value > maxValue) {
|
|
|
+ this.collectionItemList[index].answerValue = value.slice(0, -1);
|
|
|
this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -3594,6 +3597,7 @@ export default {
|
|
|
let minValue = this.collectionItemList[index].collectionOptionList[0].minValue;
|
|
|
if (minValue) {
|
|
|
if (value < minValue) {
|
|
|
+ this.collectionItemList[index].answerValue = minValue;
|
|
|
this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
|
|
|
}
|
|
|
}
|