|
@@ -3577,29 +3577,25 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
numberFn(val, index, type) {
|
|
numberFn(val, index, type) {
|
|
|
- if (type == 'A') {
|
|
|
|
|
- if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
|
|
|
|
|
- this.collectionItemList[index].answerValue = this.collectionItemList[
|
|
|
|
|
- index
|
|
|
|
|
- ].answerValue.replace(
|
|
|
|
|
- /\.\d{2,}$/,
|
|
|
|
|
- this.collectionItemList[index].answerValue.substr(
|
|
|
|
|
- this.collectionItemList[index].answerValue.indexOf('.'),
|
|
|
|
|
- 3
|
|
|
|
|
- )
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ 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)
|
|
|
|
|
+ );
|
|
|
|
|
+ // 最大值
|
|
|
|
|
+ let maxValue = this.collectionItemList[index].collectionOptionList[0].maxValue;
|
|
|
|
|
+ if (maxValue) {
|
|
|
|
|
+ if (value > maxValue) {
|
|
|
|
|
+ this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.collectionItemList[index].answerValue)) {
|
|
|
|
|
- this.collectionItemList[index].answerValue = this.collectionItemList[
|
|
|
|
|
- index
|
|
|
|
|
- ].answerValue.replace(
|
|
|
|
|
- /\.\d{2,}$/,
|
|
|
|
|
- this.collectionItemList[index].answerValue.substr(
|
|
|
|
|
- this.collectionItemList[index].answerValue.indexOf('.'),
|
|
|
|
|
- 3
|
|
|
|
|
- )
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ //最小值
|
|
|
|
|
+ let minValue = this.collectionItemList[index].collectionOptionList[0].minValue;
|
|
|
|
|
+ if (minValue) {
|
|
|
|
|
+ if (value < minValue) {
|
|
|
|
|
+ this.$toast(this.collectionItemList[index].collectionName + '输入内容不合法');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|