Browse Source

feature_20250722_金牌店档案收集

zhujindu 4 months ago
parent
commit
578c216817

+ 27 - 2
src/views/deviceWithin/addStoreVisit.vue

@@ -188,7 +188,13 @@
               type="tel"
               @blur="telFn(item, index, 'A')">
               <template #button>
-                <van-button size="small" type="primary">发送验证码</van-button>
+                <van-button
+                  size="small"
+                  type="primary"
+                  @click="sendCode(item)"
+                  :disabled="time != null"
+                  >发送验证码<span v-if="time">({{ timeNum }})</span>
+                </van-button>
               </template>
             </van-field>
             <p
@@ -2888,6 +2894,8 @@ export default {
       productTitles: null,
       inspectionType: '',
       competitortableData: [],
+      time: null, //计时
+      timeNum: 0,
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -2925,6 +2933,8 @@ export default {
     store.dispatch('setShotsNum', 0);
     this.show = false;
     this.stillDistribute = false;
+    this.time = null; //计时
+    this.timeNum = 0;
   },
   watch: {
     $route(to, from) {
@@ -4364,7 +4374,9 @@ export default {
             this.collectionItemList[b].answerType == 'sm' ||
             this.collectionItemList[b].answerType == 'wb' ||
             this.collectionItemList[b].answerType == 'tel' ||
-            this.collectionItemList[b].answerType == 'date'
+            this.collectionItemList[b].answerType == 'date' ||
+            this.collectionItemList[b].answerType == 'tel_send_code' ||
+            this.collectionItemList[b].answerType == 'check_code'
           ) {
             formData.collectionAnswers.push({
               collectionId: this.collectionItemList[b].collectionId,
@@ -4896,6 +4908,19 @@ export default {
         return true;
       }
     },
+    // 发送验证码
+    sendCode(val) {
+      if (!/^1[3456789]\d{9}$/.test(val.answerValue) || val.answerValue == '') {
+        this.$toast(val.collectionName + '格式错误');
+        return;
+      }
+      if (this.time) return;
+      this.timeNum = 0;
+      this.time = setInterval(() => {
+        this.timeNum++;
+        if (this.timeNum == 60) this.time = null;
+      }, 1000);
+    },
     onClickLeft() {
       this.$router.go(-1);
     },

+ 9 - 1
src/views/historicalVisit/hisvistdeils.vue

@@ -94,9 +94,17 @@
     <div
       class="container containert"
       style="width: 94%; margin: 0 auto; border-radius: 6px"
-      v-if="taskType == 1">
+      v-if="taskType == 1 || taskType == 4">
       <van-form ref="tabstoreVal">
         <div v-for="(item, index) in collectionItemList" :key="index">
+          <div v-if="item.answerType == 'tel_send_code'" class="formLabel z-cell">
+            <van-cell>
+              <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
+            </van-cell>
+            <div class="selesetText">
+              <p class="mg0">{{ item.answerValue }}</p>
+            </div>
+          </div>
           <div class="formLabel z-cell z-cells" v-if="item.answerType == 'sz'">
             <van-cell>
               <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>