Browse Source

Merge branch 'feature_20250722_金牌店档案收集' into uat(dev)

# Conflicts:
#	src/api/index.js
zhujindu 4 months ago
parent
commit
d769c6e6b6

+ 18 - 0
src/api/index.js

@@ -1039,3 +1039,21 @@ export function deleteSummaryMobile(query) {
     method: 'delete',
   });
 }
+
+// 根据日报id查询汇报当天拜访照片base64格式
+export function imgToBase64(data) {
+  return request({
+    url: '/mobile/reportMobile/imgToBase64',
+    method: 'post',
+    data,
+  });
+}
+
+// 发送验证码并校验验证码
+export function sendAndCheckVerCode(query) {
+  return request({
+    url: '/mobile/storeGroup/sendAndCheckVerCode',
+    method: 'get',
+    params: query,
+  });
+}

+ 71 - 7
src/views/deviceWithin/addStoreVisit.vue

@@ -191,7 +191,7 @@
                 <van-button
                   size="small"
                   type="primary"
-                  @click="sendCode(item)"
+                  @click="sendCode(item, index)"
                   :disabled="time != null"
                   >发送验证码<span v-if="time">({{ timeNum }})</span>
                 </van-button>
@@ -214,6 +214,7 @@
               v-model="item.answerValue"
               :placeholder="item.text"
               type="number"
+              @blur="verification(item, collectionItemList)"
               @input="numberFn(item, index, 'A')"></van-field>
             <p
               style="color: red; font-size: 14px; margin: 0; padding: 10px 0; text-align: right"
@@ -568,7 +569,7 @@
                           <van-button
                             size="small"
                             type="primary"
-                            @click="sendCode(childitem)"
+                            @click="sendCode(childitem, index)"
                             :disabled="time != null"
                             >发送验证码<span v-if="time">({{ timeNum }})</span>
                           </van-button>
@@ -597,6 +598,7 @@
                         v-model="childitem.collectionOptionList[0].answerValue"
                         :placeholder="item.text"
                         type="number"
+                        @blur="verification(childitem, child.collectionItems)"
                         @input="numberFn(childitem, index)"></van-field>
                       <p
                         style="
@@ -2897,6 +2899,7 @@ import {
   editDwellTime,
   deleteTaskAnswer,
   getCollectionShowHistory,
+  sendAndCheckVerCode,
 } from '@/api/index';
 import zRadio from '@/components/zRadio';
 import zCheckbox from '@/components/zCheckbox';
@@ -5043,16 +5046,77 @@ export default {
     },
     // 发送验证码
     sendCode(val) {
-      if (!/^1[3456789]\d{9}$/.test(val.answerValue) || val.answerValue == '') {
+      let answerValue = '';
+      if (val.collectionOptionList && val.collectionOptionList.length) {
+        answerValue = val.collectionOptionList[0].answerValue;
+      } else {
+        answerValue = val.answerValue;
+      }
+
+      if (!/^1[3456789]\d{9}$/.test(answerValue) || 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);
+      this.sendCodeFun(
+        {
+          type: '1', //String	调用类型:1:发送验证码 2:校验验证码
+          phone: answerValue, //String	手机号
+          verification: '', //String	手机号验证码
+        },
+        () => {
+          this.time = setInterval(() => {
+            this.timeNum++;
+            if (this.timeNum == 60) this.time = null;
+          }, 1000);
+          this.$toast('发送成功');
+        }
+      );
+    },
+    verification(item, collectionItems) {
+      let answerValue = '';
+      if (item.collectionOptionList && item.collectionOptionList.length) {
+        answerValue = item.collectionOptionList[0].answerValue;
+      } else {
+        answerValue = item.answerValue;
+      }
+      // 验证码
+      if (answerValue == '') {
+        return;
+      }
+      let telSendCode = collectionItems.find((res) => {
+        if (res.answerType == 'tel_send_code') {
+          return res;
+        }
+      });
+      // 手机号
+      let sendPhone = '';
+      if (telSendCode.collectionOptionList && telSendCode.collectionOptionList.length) {
+        sendPhone = telSendCode.collectionOptionList[0].answerValue;
+      } else {
+        sendPhone = telSendCode.answerValue;
+      }
+      if (sendPhone == '') {
+        return;
+      }
+      this.sendCodeFun(
+        {
+          type: '2', //String	调用类型:1:发送验证码 2:校验验证码
+          phone: sendPhone, //String	手机号
+          verification: answerValue, //String	手机号验证码
+        },
+        (res) => {
+          this.$toast(res.data ? '验证成功' : '验证码错误');
+        }
+      );
+    },
+    sendCodeFun(params, callback) {
+      sendAndCheckVerCode(params).then((res) => {
+        if (res.code == 200) {
+          callback && callback(res);
+        }
+      });
     },
     onClickLeft() {
       this.$router.go(-1);

+ 37 - 1
src/views/storeManagement/storeDetail.vue

@@ -326,7 +326,38 @@
           </van-collapse>
         </van-tab>
         <van-tab title="属性信息" name="outsidePlan">
-          <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
+          <!-- 金牌店档案信息 -->
+          <template v-if="list.ifJpStoreType && list.storeArchives">
+            <div class="JpStore">
+              <van-field readonly v-model="list.storeArchives.ownerMobile" label="主经营者电话" />
+              <van-field readonly v-model="list.storeArchives.ownerName" label="主经营者姓名" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.ownerBirthday"
+                label="主经营者出生日期" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.mainProductCategorys"
+                label="主营/擅长经营品类" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.emergencyContact"
+                label="紧急联系人姓名" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.emergencyContactBirthday"
+                label="紧急联系人出生日期" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.emergencyContactMobile"
+                label="紧急联系人电话" />
+              <van-field
+                readonly
+                v-model="list.storeArchives.emergencyContactRelation"
+                label="紧急联系人身份" />
+            </div>
+          </template>
+          <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow" v-else>
             <van-field
               readonly
               label="属性"
@@ -1858,5 +1889,10 @@ export default {
       }
     }
   }
+  .JpStore {
+    .van-field__label {
+      width: 9em;
+    }
+  }
 }
 </style>