|
|
@@ -152,17 +152,9 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="item.answerValue"
|
|
|
- :placeholder="item.text"
|
|
|
+ :placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="item.ruleMessage"
|
|
|
@blur="SZsizeComparison(item, 'A')"></van-field>
|
|
|
- <p
|
|
|
- style="color: #444; font-size: 12px; margin: 0; padding: 10px 0; text-align: right">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="item.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="item.fileInfoList"></delete-upload-img>
|
|
|
@@ -347,7 +339,8 @@
|
|
|
v-model="item.answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
@blur="DHWBsizeComparison(item, 'A')"
|
|
|
- :placeholder="item.text"></van-field>
|
|
|
+ :placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="item.ruleMessage"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
color: #444;
|
|
|
@@ -355,16 +348,10 @@
|
|
|
margin: 0;
|
|
|
text-align: right;
|
|
|
position: relative;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="item.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
+ "
|
|
|
+ v-if="item.showHistory == 1">
|
|
|
<span
|
|
|
style="color: #00afff; position: absolute; top: 8px; right: 0px"
|
|
|
- v-if="item.showHistory == 1"
|
|
|
@click="getCollectionShowHistory(item)"
|
|
|
>回显历史</span
|
|
|
>
|
|
|
@@ -582,7 +569,8 @@
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
@blur="DHWBsizeComparison(childitem)"
|
|
|
- :placeholder="childitem.text"></van-field>
|
|
|
+ :placeholder="childitem.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="childitem.ruleMessage"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
color: #444;
|
|
|
@@ -590,16 +578,10 @@
|
|
|
margin: 0;
|
|
|
text-align: right;
|
|
|
position: relative;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="childitem.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
+ "
|
|
|
+ v-if="childitem.showHistory == 1">
|
|
|
<span
|
|
|
style="color: #00afff; position: absolute; top: 8px; right: 0px"
|
|
|
- v-if="childitem.showHistory == 1"
|
|
|
@click="getCollectionShowHistory(childitem)"
|
|
|
>回显历史</span
|
|
|
>
|
|
|
@@ -634,23 +616,9 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
- :placeholder="item.text"
|
|
|
+ :placeholder="childitem.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="childitem.ruleMessage"
|
|
|
@blur="SZsizeComparison(childitem)"></van-field>
|
|
|
- <p
|
|
|
- style="
|
|
|
- color: #444;
|
|
|
- font-size: 12px;
|
|
|
- margin: 0;
|
|
|
- padding: 10px 0;
|
|
|
- text-align: right;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="childitem.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="childitem.fileInfoList"></delete-upload-img>
|
|
|
@@ -1031,7 +999,10 @@
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
:formatter="dhwbFormatter"
|
|
|
@blur="DHWBsizeComparison(childitem1)"
|
|
|
- :placeholder="childitem1.text"></van-field>
|
|
|
+ :placeholder="
|
|
|
+ childitem1.collectionOptionList[0].collectionOption
|
|
|
+ "
|
|
|
+ :error-message="childitem1.ruleMessage"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
color: #444;
|
|
|
@@ -1039,13 +1010,8 @@
|
|
|
margin: 0;
|
|
|
text-align: right;
|
|
|
position: relative;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="childitem1.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
+ "
|
|
|
+ v-if="childitem1.showHistory == 1">
|
|
|
<span
|
|
|
style="
|
|
|
color: #00afff;
|
|
|
@@ -1053,7 +1019,6 @@
|
|
|
top: 8px;
|
|
|
right: 0px;
|
|
|
"
|
|
|
- v-if="childitem1.showHistory == 1"
|
|
|
@click="getCollectionShowHistory(childitem1)"
|
|
|
>回显历史</span
|
|
|
>
|
|
|
@@ -1461,7 +1426,11 @@
|
|
|
"
|
|
|
:formatter="dhwbFormatter"
|
|
|
@blur="DHWBsizeComparison(child33item1)"
|
|
|
- :placeholder="child33item1.text"></van-field>
|
|
|
+ :placeholder="
|
|
|
+ child33item1.collectionOptionList[0]
|
|
|
+ .collectionOption
|
|
|
+ "
|
|
|
+ :error-message="child33item1.ruleMessage"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
color: #444;
|
|
|
@@ -1469,16 +1438,8 @@
|
|
|
margin: 0;
|
|
|
text-align: right;
|
|
|
position: relative;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="
|
|
|
- child33item1.collectionOptionList[0]
|
|
|
- .collectionOption
|
|
|
- "
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
+ "
|
|
|
+ v-if="child33item1.showHistory == 1">
|
|
|
<span
|
|
|
style="
|
|
|
color: #00afff;
|
|
|
@@ -1486,7 +1447,6 @@
|
|
|
top: 8px;
|
|
|
right: 0px;
|
|
|
"
|
|
|
- v-if="child33item1.showHistory == 1"
|
|
|
@click="getCollectionShowHistory(child33item1)"
|
|
|
>回显历史</span
|
|
|
>
|
|
|
@@ -1708,26 +1668,9 @@
|
|
|
v-model="
|
|
|
child33item1.collectionOptionList[0].answerValue
|
|
|
"
|
|
|
- :placeholder="child33item1.text"
|
|
|
+ :placeholder="child33item1.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="child33item1.ruleMessage"
|
|
|
@blur="SZsizeComparison(child33item1)"></van-field>
|
|
|
- <p
|
|
|
- style="
|
|
|
- color: #444;
|
|
|
- font-size: 12px;
|
|
|
- margin: 0;
|
|
|
- padding: 10px 0;
|
|
|
- text-align: right;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="
|
|
|
- child33item1.collectionOptionList[0]
|
|
|
- .collectionOption
|
|
|
- "
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="child33item1.fileInfoList"></delete-upload-img>
|
|
|
@@ -2182,7 +2125,11 @@
|
|
|
:formatter="dhwbFormatter"
|
|
|
@blur="DHWBsizeComparison(child44item1)"
|
|
|
:placeholder="
|
|
|
- child44item1.text
|
|
|
+ child44item1.collectionOptionList[0]
|
|
|
+ .collectionOption
|
|
|
+ "
|
|
|
+ :error-message="
|
|
|
+ child44item1.ruleMessage
|
|
|
"></van-field>
|
|
|
<p
|
|
|
style="
|
|
|
@@ -2191,16 +2138,8 @@
|
|
|
margin: 0;
|
|
|
text-align: right;
|
|
|
position: relative;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="
|
|
|
- child44item1.collectionOptionList[0]
|
|
|
- .collectionOption
|
|
|
- "
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
+ "
|
|
|
+ v-if="child44item1.showHistory == 1">
|
|
|
<span
|
|
|
style="
|
|
|
color: #00afff;
|
|
|
@@ -2208,7 +2147,6 @@
|
|
|
top: 8px;
|
|
|
right: 0px;
|
|
|
"
|
|
|
- v-if="child44item1.showHistory == 1"
|
|
|
@click="
|
|
|
getCollectionShowHistory(child44item1)
|
|
|
"
|
|
|
@@ -2468,28 +2406,11 @@
|
|
|
child44item1.collectionOptionList[0]
|
|
|
.answerValue
|
|
|
"
|
|
|
- :placeholder="child44item1.text"
|
|
|
+ :placeholder="child44item1.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="child44item1.ruleMessage"
|
|
|
@blur="
|
|
|
SZsizeComparison(child44item1)
|
|
|
"></van-field>
|
|
|
- <p
|
|
|
- style="
|
|
|
- color: #444;
|
|
|
- font-size: 12px;
|
|
|
- margin: 0;
|
|
|
- padding: 10px 0;
|
|
|
- text-align: right;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="
|
|
|
- child44item1.collectionOptionList[0]
|
|
|
- .collectionOption
|
|
|
- "
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="
|
|
|
@@ -2864,23 +2785,9 @@
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
v-model="childitem1.collectionOptionList[0].answerValue"
|
|
|
- :placeholder="item.text"
|
|
|
+ :placeholder="childitem1.collectionOptionList[0].collectionOption"
|
|
|
+ :error-message="childitem1.ruleMessage"
|
|
|
@blur="SZsizeComparison(childitem1)"></van-field>
|
|
|
- <p
|
|
|
- style="
|
|
|
- color: #444;
|
|
|
- font-size: 12px;
|
|
|
- margin: 0;
|
|
|
- padding: 10px 0;
|
|
|
- text-align: right;
|
|
|
- ">
|
|
|
- <van-field
|
|
|
- class="mobile-input"
|
|
|
- v-model="childitem1.collectionOptionList[0].collectionOption"
|
|
|
- autosize
|
|
|
- readonly
|
|
|
- type="textarea" />
|
|
|
- </p>
|
|
|
<delete-upload-img
|
|
|
:photoIdentifyType="photoIdentifyType"
|
|
|
:imgs="childitem1.fileInfoList"></delete-upload-img>
|
|
|
@@ -3200,6 +3107,7 @@ export default {
|
|
|
pictureSource: '0',
|
|
|
inspectionType: '',
|
|
|
competitortableData: [],
|
|
|
+ validatorFlag: true, //是否验证通过
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -3371,7 +3279,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (val.type == 'E') {
|
|
|
- debugger;
|
|
|
this.collectionItemList[val.index].collectionOptionList[val.index1].collectionItems[
|
|
|
val.index2
|
|
|
].collectionOptionList[val.index3].collectionItems[val.index4].collectionOptionList[
|
|
|
@@ -3628,36 +3535,39 @@ export default {
|
|
|
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);
|
|
|
+ let value = answerValue
|
|
|
+ ? answerValue.replace(
|
|
|
+ /[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
|
+ ''
|
|
|
+ )
|
|
|
+ : '';
|
|
|
+ this.$set(itemData, 'answerValue', value);
|
|
|
if (value) {
|
|
|
// 最大值
|
|
|
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.$set(itemData, 'answerValue', '');
|
|
|
- this.$toast('输入内容不合法');
|
|
|
+ this.$set(itemData, 'ruleMessage', '最大值为:' + maxValue);
|
|
|
+ // this.$set(itemData, 'answerValue', '');
|
|
|
+ // this.$toast('输入内容不合法');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
//最小值
|
|
|
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.$set(itemData, 'answerValue', '');
|
|
|
- this.$toast('输入内容不合法');
|
|
|
+ this.$set(itemData, 'ruleMessage', '最小值为:' + minValue);
|
|
|
+ // this.$set(itemData, 'answerValue', '');
|
|
|
+ // this.$toast('输入内容不合法');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
+ this.$set(itemData, 'ruleMessage', '');
|
|
|
+ } else {
|
|
|
+ // this.$set(itemData, 'ruleMessage', '请输入数字');
|
|
|
}
|
|
|
},
|
|
|
// dhwb 单行文本校验
|
|
|
@@ -3678,34 +3588,38 @@ export default {
|
|
|
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(itemData, 'answerValue', '');
|
|
|
- this.$toast('输入内容不合法');
|
|
|
+ // this.$set(itemData, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'ruleMessage', '最大字数为:' + maxValue);
|
|
|
+ // this.$toast('输入内容不合法');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
//最小值
|
|
|
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(itemData, 'answerValue', '');
|
|
|
- this.$toast('输入内容不合法');
|
|
|
+ // this.$set(itemData, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'ruleMessage', '最小字数为:' + minValue);
|
|
|
+ // this.$toast('输入内容不合法');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
// 至少一个汉字
|
|
|
let leastOneChinese = item.collectionOptionList[0].leastOneChinese;
|
|
|
if (leastOneChinese == '1') {
|
|
|
if (!/[\u4e00-\u9fa5]/.test(value)) {
|
|
|
- this.$set(itemData, 'answerValue', '');
|
|
|
- this.$toast('输入内容不合法,至少有一个汉字');
|
|
|
+ // this.$set(itemData, 'answerValue', '');
|
|
|
+ this.$set(itemData, 'ruleMessage', '至少有一个汉字');
|
|
|
+ // this.$toast('输入内容不合法,至少有一个汉字');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
+ this.$set(itemData, 'ruleMessage', '');
|
|
|
+ } else {
|
|
|
+ // this.$set(itemData, 'ruleMessage', '请输入至少有一个汉字');
|
|
|
}
|
|
|
},
|
|
|
// 且只可输入:汉字、数字、字母、标点符号, 特殊字符:空格、换行、表情等不可输入
|
|
|
@@ -4639,7 +4553,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ filterCollectionInfos(collectionItemList, type) {
|
|
|
+ if (
|
|
|
+ (collectionItemList.answerType == 'dx' || collectionItemList.answerType == 'duox') &&
|
|
|
+ collectionItemList.collectionOptionList
|
|
|
+ ) {
|
|
|
+ for (let x = 0; x < collectionItemList.collectionOptionList.length; x++) {
|
|
|
+ this.filterCollectionInfos(collectionItemList.collectionOptionList[x]);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // dhwb 初始化内容校验
|
|
|
+ if (collectionItemList.answerType == 'dhwb') {
|
|
|
+ this.DHWBsizeComparison(collectionItemList, type);
|
|
|
+ }
|
|
|
+ // sz 初始化内容校验
|
|
|
+ if (collectionItemList.answerType == 'sz') {
|
|
|
+ this.SZsizeComparison(collectionItemList, type);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onSubmit() {
|
|
|
+ this.validatorFlag = true;
|
|
|
var checkUnManage = 'Y';
|
|
|
var formData = {};
|
|
|
if (this.checked) {
|
|
|
@@ -4677,6 +4611,7 @@ export default {
|
|
|
|
|
|
if (this.$route.query.taskType == 1) {
|
|
|
for (var b = 0; b < this.collectionItemList.length; b++) {
|
|
|
+ this.filterCollectionInfos(this.collectionItemList[b], 'A');
|
|
|
if (
|
|
|
this.collectionItemList[b].answerType == 'sz' ||
|
|
|
this.collectionItemList[b].answerType == 'sm' ||
|
|
|
@@ -5099,6 +5034,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 特殊题型判断是否通过
|
|
|
+ if (!this.validatorFlag) return;
|
|
|
// 调色机扫码是否正确
|
|
|
if (!this.filterFormData(formData)) {
|
|
|
this.$dialog.alert({
|