|
|
@@ -204,6 +204,38 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
</div>
|
|
|
+ <div v-if="item.answerType == 'tel_confirm'" class="formLabel z-cell">
|
|
|
+ <van-cell>
|
|
|
+ <template #title>
|
|
|
+ <span v-if="item.isMust == 0" class="van-f-red">*</span>
|
|
|
+ <span>{{ 1 + index + '.' }}</span>
|
|
|
+ {{ item.collectionName }}
|
|
|
+ <!-- 操作说明图片和电话 -->
|
|
|
+ <taskTips
|
|
|
+ v-if="item.contactPhone || item.examplePhoto"
|
|
|
+ :contactPhone="item.contactPhone"
|
|
|
+ :examplePhoto="item.examplePhoto">
|
|
|
+ </taskTips>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ <van-field
|
|
|
+ class="sendCode"
|
|
|
+ v-model="item.answerValue"
|
|
|
+ :placeholder="item.collectionOptionList[0].collectionOption"
|
|
|
+ type="tel"
|
|
|
+ @blur="telConfirmBlur(item, index, 'A')">
|
|
|
+ <template #button v-if="!verifyMobile">
|
|
|
+ <van-button
|
|
|
+ size="small"
|
|
|
+ style="color: white; background: rgb(0, 87, 186); border-radius: 6px"
|
|
|
+ @click="telConfirm(item, index)"
|
|
|
+ :disabled="confirmed">
|
|
|
+ <span v-if="confirmed">已确认</span>
|
|
|
+ <span v-else>确认真实</span>
|
|
|
+ </van-button>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </div>
|
|
|
<div v-if="item.answerType == 'check_code' && !verifyMobile" class="formLabel z-cell">
|
|
|
<van-cell>
|
|
|
<template #title>
|
|
|
@@ -674,6 +706,39 @@
|
|
|
</template>
|
|
|
</van-field>
|
|
|
</div>
|
|
|
+ <div v-if="childitem.answerType == 'tel_confirm'" class="formLabel z-cell">
|
|
|
+ <van-cell>
|
|
|
+ <template #title>
|
|
|
+ <span v-if="childitem.isMust == 0" class="van-f-red">*</span>
|
|
|
+ <span>{{ 1 + index + '.' }}</span>
|
|
|
+ <span>{{ 1 + childIndex + '.' }}</span>
|
|
|
+ {{ childitem.collectionName }}
|
|
|
+ <!-- 操作说明图片和电话 -->
|
|
|
+ <taskTips
|
|
|
+ v-if="childitem.contactPhone || childitem.examplePhoto"
|
|
|
+ :contactPhone="childitem.contactPhone"
|
|
|
+ :examplePhoto="childitem.examplePhoto">
|
|
|
+ </taskTips>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ <van-field
|
|
|
+ class="sendCode"
|
|
|
+ v-model="childitem.collectionOptionList[0].answerValue"
|
|
|
+ :placeholder="childitem.collectionOptionList[0].collectionOption"
|
|
|
+ type="tel"
|
|
|
+ @blur="telConfirmBlur(childitem, index)">
|
|
|
+ <template #button v-if="!verifyMobile">
|
|
|
+ <van-button
|
|
|
+ size="small"
|
|
|
+ style="color: white; background: rgb(0, 87, 186); border-radius: 6px"
|
|
|
+ @click="telConfirm(childitem, index)"
|
|
|
+ :disabled="confirmed">
|
|
|
+ <span v-if="confirmed">已确认</span>
|
|
|
+ <span v-else>确认真实</span>
|
|
|
+ </van-button>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </div>
|
|
|
<div
|
|
|
v-if="childitem.answerType == 'check_code' && !verifyMobile"
|
|
|
class="formLabel z-cell">
|
|
|
@@ -3703,6 +3768,7 @@ import {
|
|
|
deleteTaskAnswer,
|
|
|
getCollectionShowHistory,
|
|
|
sendAndCheckVerCode,
|
|
|
+ confirmPhone,
|
|
|
} from '@/api/index';
|
|
|
import zRadio from '@/components/zRadio';
|
|
|
import zCheckbox from '@/components/zCheckbox';
|
|
|
@@ -3818,6 +3884,7 @@ export default {
|
|
|
continuousShoot: '0',
|
|
|
machineInTheStore: '否',
|
|
|
validatorFlag: true, //是否验证通过
|
|
|
+ confirmed: false,
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
@@ -3827,6 +3894,8 @@ export default {
|
|
|
next();
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.verificationPassedPhoneNum = '';
|
|
|
+ this.confirmed = false;
|
|
|
this.showCode = false;
|
|
|
this.flag = false;
|
|
|
this.link = '3';
|
|
|
@@ -4268,6 +4337,25 @@ export default {
|
|
|
this.verifyMobile = false;
|
|
|
}
|
|
|
},
|
|
|
+ telConfirmBlur(val) {
|
|
|
+ let answerValue = '';
|
|
|
+ if (val.answerValue != null) {
|
|
|
+ answerValue = val.answerValue;
|
|
|
+ } else if (val.answerValue && val.collectionOptionList.length) {
|
|
|
+ answerValue = val.collectionOptionList[0].answerValue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!/^1[123456789]\d{9}$/.test(answerValue) || answerValue == '') {
|
|
|
+ this.$toast(val.collectionName + '格式错误');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (answerValue != this.verificationPassedPhoneNum) {
|
|
|
+ this.verifyMobile = false;
|
|
|
+ this.confirmed = false;
|
|
|
+ } else {
|
|
|
+ this.verifyMobile = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
numberFn(val, index, type) {
|
|
|
let value = this.collectionItemList[index].answerValue;
|
|
|
if (value) {
|
|
|
@@ -4551,7 +4639,8 @@ export default {
|
|
|
collectionItemLists[q].answerType == 'check_code' ||
|
|
|
collectionItemLists[q].answerType == 'nyr' ||
|
|
|
collectionItemLists[q].answerType == 'dhwb' ||
|
|
|
- collectionItemLists[q].answerType == 'xm'
|
|
|
+ collectionItemLists[q].answerType == 'xm' ||
|
|
|
+ collectionItemLists[q].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
collectionItemLists[q].answerValue =
|
|
|
collectionItemLists[q].collectionOptionList[0].answerValue;
|
|
|
@@ -4583,6 +4672,19 @@ export default {
|
|
|
if (collectionItemLists[q].answerType == 'xm') {
|
|
|
this.XMsizeComparison(collectionItemLists[q], 'A');
|
|
|
}
|
|
|
+ if (
|
|
|
+ collectionItemLists[q].answerType == 'tel_send_code' ||
|
|
|
+ collectionItemLists[q].answerType == 'tel_confirm'
|
|
|
+ ) {
|
|
|
+ if (
|
|
|
+ collectionItemLists[q].collectionOptionList[0].answerValue != null &&
|
|
|
+ this.verifyMobile
|
|
|
+ ) {
|
|
|
+ this.verificationPassedPhoneNum =
|
|
|
+ collectionItemLists[q].collectionOptionList[0].answerValue;
|
|
|
+ console.log(this.verificationPassedPhoneNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (
|
|
|
collectionItemLists[q].answerType == 'duox' ||
|
|
|
collectionItemLists[q].answerType == 'dx'
|
|
|
@@ -4658,7 +4760,10 @@ export default {
|
|
|
listchild[qq1].answerValue = '';
|
|
|
}
|
|
|
}
|
|
|
- if (listchild[qq1].answerType == 'tel_send_code') {
|
|
|
+ if (
|
|
|
+ listchild[qq1].answerType == 'tel_send_code' ||
|
|
|
+ listchild[qq1].answerType == 'tel_confirm'
|
|
|
+ ) {
|
|
|
if (listchild[qq1].collectionOptionList[0].answerValue != null) {
|
|
|
listchild[qq1].answerValue =
|
|
|
listchild[qq1].collectionOptionList[0].answerValue;
|
|
|
@@ -5593,7 +5698,8 @@ export default {
|
|
|
this.collectionItemList[b].answerType == 'check_code' ||
|
|
|
this.collectionItemList[b].answerType == 'nyr' ||
|
|
|
this.collectionItemList[b].answerType == 'dhwb' ||
|
|
|
- this.collectionItemList[b].answerType == 'xm'
|
|
|
+ this.collectionItemList[b].answerType == 'xm' ||
|
|
|
+ this.collectionItemList[b].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: this.collectionItemList[b].collectionId,
|
|
|
@@ -5651,7 +5757,8 @@ export default {
|
|
|
listDatas[f2].answerType == 'check_code' ||
|
|
|
listDatas[f2].answerType == 'nyr' ||
|
|
|
listDatas[f2].answerType == 'dhwb' ||
|
|
|
- listDatas[f2].answerType == 'xm'
|
|
|
+ listDatas[f2].answerType == 'xm' ||
|
|
|
+ listDatas[f2].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: listDatas[f2].collectionId,
|
|
|
@@ -5723,7 +5830,8 @@ export default {
|
|
|
listDatas2[f10].answerType == 'check_code' ||
|
|
|
listDatas2[f10].answerType == 'nyr' ||
|
|
|
listDatas2[f10].answerType == 'dhwb' ||
|
|
|
- listDatas2[f10].answerType == 'xm'
|
|
|
+ listDatas2[f10].answerType == 'xm' ||
|
|
|
+ listDatas2[f10].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: listDatas2[f10].collectionId,
|
|
|
@@ -5814,7 +5922,8 @@ export default {
|
|
|
listc4[fc4].answerType == 'check_code' ||
|
|
|
listc4[fc4].answerType == 'nyr' ||
|
|
|
listc4[fc4].answerType == 'dhwb' ||
|
|
|
- listc4[fc4].answerType == 'xm'
|
|
|
+ listc4[fc4].answerType == 'xm' ||
|
|
|
+ listc4[fc4].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: listc4[fc4].collectionId,
|
|
|
@@ -5920,7 +6029,8 @@ export default {
|
|
|
listc5[fc5].answerType == 'check_code' ||
|
|
|
listc5[fc5].answerType == 'nyr' ||
|
|
|
listc5[fc5].answerType == 'dhwb' ||
|
|
|
- listc5[fc5].answerType == 'xm'
|
|
|
+ listc5[fc5].answerType == 'xm' ||
|
|
|
+ listc5[fc5].answerType == 'tel_confirm'
|
|
|
) {
|
|
|
formData.collectionAnswers.push({
|
|
|
collectionId: listc5[fc5].collectionId,
|
|
|
@@ -6179,6 +6289,34 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ telConfirm(val) {
|
|
|
+ let item = '';
|
|
|
+ let answerValue = '';
|
|
|
+ if (val.collectionOptionList && val.collectionOptionList.length) {
|
|
|
+ answerValue = val.collectionOptionList[0].answerValue;
|
|
|
+ item = val.collectionOptionList[0];
|
|
|
+ } else {
|
|
|
+ answerValue = val.answerValue;
|
|
|
+ item = val;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!/^1[123456789]\d{9}$/.test(answerValue) || answerValue == '') {
|
|
|
+ this.$toast(val.collectionName + '格式错误');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ confirmPhone({
|
|
|
+ phone: answerValue, // string 电话
|
|
|
+ visitId: this.visitId, // Long 拜访id
|
|
|
+ taskId: this.taskId, // Long 任务id
|
|
|
+ collectionId: item.collectionId, // Long 采集项id
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.verificationPassedPhoneNum = answerValue;
|
|
|
+ this.confirmed = true;
|
|
|
+ this.$toast('发送成功');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
verification(item, collectionItems) {
|
|
|
let answerValue = '';
|
|
|
if (item.collectionOptionList && item.collectionOptionList.length) {
|