|
|
@@ -264,7 +264,7 @@
|
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
|
:placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
- @blur="SZsizeComparison(item, index)"></van-field>
|
|
|
+ @blur="SZsizeComparison(item, 'A')"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="item.fileInfoList"></delete-upload-img>
|
|
|
@@ -452,7 +452,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="
|
|
|
@@ -763,7 +763,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>
|
|
|
@@ -813,9 +813,7 @@
|
|
|
<van-field
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
:placeholder="childitem.collectionOptionList[0].collectionOption"
|
|
|
- type="number"
|
|
|
- @blur="SZsizeComparison(childitem, childIndex)"
|
|
|
- @input="numberFn(childitem, index)"></van-field>
|
|
|
+ @blur="SZsizeComparison(childitem)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="childitem.fileInfoList"></delete-upload-img>
|
|
|
@@ -1179,7 +1177,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>
|
|
|
@@ -1602,7 +1600,7 @@
|
|
|
child33item1.collectionOptionList[0].answerValue
|
|
|
"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="DHWBsizeComparison(child33item1, child33Index1)"
|
|
|
+ @blur="DHWBsizeComparison(child33item1)"
|
|
|
:placeholder="
|
|
|
child33item1.collectionOptionList[0].collectionOption
|
|
|
"></van-field>
|
|
|
@@ -1906,9 +1904,7 @@
|
|
|
:placeholder="
|
|
|
child33item1.collectionOptionList[0].collectionOption
|
|
|
"
|
|
|
- type="number"
|
|
|
- @blur="SZsizeComparison(child33item1, child33Index1)"
|
|
|
- @input="numberFn(child33item1, index)"></van-field>
|
|
|
+ @blur="SZsizeComparison(child33item1)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="child33item1.fileInfoList"></delete-upload-img>
|
|
|
@@ -2358,12 +2354,7 @@
|
|
|
.answerValue
|
|
|
"
|
|
|
:formatter="dhwbFormatter"
|
|
|
- @blur="
|
|
|
- DHWBsizeComparison(
|
|
|
- child44item1,
|
|
|
- child44Index1
|
|
|
- )
|
|
|
- "
|
|
|
+ @blur="DHWBsizeComparison(child44item1)"
|
|
|
:placeholder="
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.collectionOption
|
|
|
@@ -2701,15 +2692,8 @@
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.collectionOption
|
|
|
"
|
|
|
- type="number"
|
|
|
@blur="
|
|
|
- SZsizeComparison(
|
|
|
- child44item1,
|
|
|
- child44Index1
|
|
|
- )
|
|
|
- "
|
|
|
- @input="
|
|
|
- numberFn(child44item1, child44Index1)
|
|
|
+ SZsizeComparison(child44item1)
|
|
|
"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
@@ -3103,9 +3087,7 @@
|
|
|
<van-field
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
:placeholder="childitem1.collectionOptionList[0].collectionOption"
|
|
|
- type="number"
|
|
|
- @blur="SZsizeComparison(childitem1, childIndex1)"
|
|
|
- @input="numberFn(childitem1, index)"></van-field>
|
|
|
+ @blur="SZsizeComparison(childitem1)"></van-field>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="childitem1.fileInfoList"></delete-upload-img>
|
|
|
@@ -3943,26 +3925,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // 数字类型 van-field number 类型iOS不能输入负数,改成text
|
|
|
- szNumberFn(val, index, type) {
|
|
|
- debugger;
|
|
|
- let value = this.collectionItemList[index].answerValue;
|
|
|
- if (value) {
|
|
|
- if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(value)) {
|
|
|
- value = this.collectionItemList[index].answerValue.replace(
|
|
|
- /\.\d{2,}$/,
|
|
|
- value.substr(value.indexOf('.'), 3)
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
// 数字类型最大值最小值校验
|
|
|
- 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,
|
|
|
''
|
|
|
);
|
|
|
- this.$set(item, 'answerValue', value);
|
|
|
+ this.$set(itemData, 'answerValue', value);
|
|
|
if (value) {
|
|
|
// 最大值
|
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
@@ -3972,7 +3951,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -3984,15 +3963,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;
|
|
|
@@ -4002,7 +3991,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最大输入值为:' + maxValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -4014,7 +4003,7 @@ export default {
|
|
|
// this.$toast(
|
|
|
// this.collectionItemList[index].collectionName + '最小输入值为:' + minValue
|
|
|
// );
|
|
|
- this.$set(item, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'answerValue', '');
|
|
|
this.$toast('输入内容不合法');
|
|
|
}
|
|
|
}
|
|
|
@@ -4022,7 +4011,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('输入内容不合法,至少有一个汉字');
|
|
|
}
|
|
|
}
|
|
|
@@ -4035,13 +4024,6 @@ export default {
|
|
|
''
|
|
|
);
|
|
|
},
|
|
|
- // 数字 负数、小数
|
|
|
- szFormatter(value) {
|
|
|
- return value.replace(
|
|
|
- /[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
|
- ''
|
|
|
- );
|
|
|
- },
|
|
|
logshowFN() {
|
|
|
this.logshow = true;
|
|
|
},
|