Browse Source

Merge branch 'feature_20250917_仿石漆潜在客户区域创建' into uat(dev)

# Conflicts:
#	src/router/index.js
zhujindu 2 months ago
parent
commit
131ff0b354

+ 8 - 8
src/layout/index.vue

@@ -1,17 +1,17 @@
 <template>
 <template>
   <div class="container bgcolor">
   <div class="container bgcolor">
-    <!-- 默认都走缓存 keepAlive:true 不缓存-->
-    <!-- <template v-if="$route.meta.keepAlive">
-      <router-view></router-view>
-    </template>
-    <template v-else>
+    <!-- 默认都走缓存 keepAlive:true 缓存-->
+    <template v-if="$route.meta.keepAlive">
       <keep-alive>
       <keep-alive>
         <router-view></router-view>
         <router-view></router-view>
       </keep-alive>
       </keep-alive>
-    </template> -->
-    <keep-alive>
+    </template>
+    <template v-else>
+      <router-view></router-view>
+    </template>
+    <!-- <keep-alive>
       <router-view></router-view>
       <router-view></router-view>
-    </keep-alive>
+    </keep-alive> -->
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>

+ 107 - 53
src/views/storeManagement/competingStoresAdd.vue

@@ -31,7 +31,8 @@
           name="picker"
           name="picker"
           :value="fromData.storeCategoryName"
           :value="fromData.storeCategoryName"
           label="客户类型"
           label="客户类型"
-          placeholder="点击选择客户类型">
+          placeholder="点击选择客户类型"
+          :rules="[{ required: true, message: '请选择客户类型' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -43,7 +44,8 @@
           :value="fromData.orgName"
           :value="fromData.orgName"
           label="销售部"
           label="销售部"
           placeholder="点击选择销售部"
           placeholder="点击选择销售部"
-          @click="PickerDept">
+          @click="PickerDept"
+          :rules="[{ required: true, message: '请选择销售部' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -77,7 +79,8 @@
           :value="fromData.provinceName"
           :value="fromData.provinceName"
           label="省(州)"
           label="省(州)"
           placeholder="点击选择省(州)"
           placeholder="点击选择省(州)"
-          @click="showProvincePicker = true">
+          @click="showProvincePicker = true"
+          :rules="[{ required: true, message: '请选择省(州)' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -89,7 +92,8 @@
           :value="fromData.cityName"
           :value="fromData.cityName"
           label="城市"
           label="城市"
           placeholder="点击选择城市"
           placeholder="点击选择城市"
-          @click="showCityPicker = true">
+          @click="showCityPicker = true"
+          :rules="[{ required: true, message: '请选择城市' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -101,23 +105,30 @@
           :value="fromData.districtName"
           :value="fromData.districtName"
           label="区(县)"
           label="区(县)"
           placeholder="点击选择区(县)"
           placeholder="点击选择区(县)"
-          @click="showDistrictPicker = true">
+          @click="showDistrictPicker = true"
+          :rules="[{ required: true, message: '请选择区(县)' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
         </van-field>
         </van-field>
-        <van-field
+        <van-field readonly v-model="fromData.cityLevel" label="城市等级">
+          <template #left-icon>
+            <span class="van-f-red">*</span>
+          </template>
+        </van-field>
+        <!-- <van-field
           readonly
           readonly
           clickable
           clickable
           name="picker"
           name="picker"
           :value="fromData.townName"
           :value="fromData.townName"
           label="街道"
           label="街道"
           placeholder="点击选择街道"
           placeholder="点击选择街道"
-          @click="showTownPicker = true">
+          @click="showTownPicker = true"
+          :rules="[{ required: true, message: '请选择街道' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
-        </van-field>
+        </van-field> -->
         <van-field
         <van-field
           v-model="fromData.addressLine"
           v-model="fromData.addressLine"
           label="地址"
           label="地址"
@@ -125,7 +136,8 @@
           rows="1"
           rows="1"
           autosize
           autosize
           type="textarea"
           type="textarea"
-          @blur="addressFn">
+          @blur="addressFn"
+          :rules="[{ required: true, message: '请选择地址' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -138,20 +150,24 @@
         <van-field
         <van-field
           type="tel"
           type="tel"
           v-model="fromData.telephone"
           v-model="fromData.telephone"
-          label="联系电话"
-          placeholder="请输入联系电话"
+          label="门店联系电话"
+          placeholder="请输入门店联系电话"
           :rules="[
           :rules="[
             {
             {
-              required: false,
+              required: true,
               validator: FSQValidatePhone,
               validator: FSQValidatePhone,
-              message: '请输入联系电话',
+              message: '请输入门店联系电话',
             },
             },
           ]">
           ]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
         </van-field>
         </van-field>
-        <van-field v-model="fromData.salesmanName" label="联系人" placeholder="联系人">
+        <van-field
+          v-model="fromData.salesmanName"
+          label="门店联系人"
+          placeholder="请输入门店联系人"
+          :rules="[{ required: true, message: '请输入门店联系人' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -183,14 +199,14 @@
         @confirm="onDistrictConfirm"
         @confirm="onDistrictConfirm"
         @cancel="showDistrictPicker = false" />
         @cancel="showDistrictPicker = false" />
     </van-popup>
     </van-popup>
-    <van-popup v-model="showTownPicker" position="bottom">
+    <!-- <van-popup v-model="showTownPicker" position="bottom">
       <van-picker
       <van-picker
         show-toolbar
         show-toolbar
         title="街道"
         title="街道"
         :columns="townList"
         :columns="townList"
         @confirm="onTownConfirm"
         @confirm="onTownConfirm"
         @cancel="showTownPicker = false" />
         @cancel="showTownPicker = false" />
-    </van-popup>
+    </van-popup> -->
     <!--    部门数据 -->
     <!--    部门数据 -->
     <van-popup v-model="showPickerDept" position="bottom">
     <van-popup v-model="showPickerDept" position="bottom">
       <van-picker
       <van-picker
@@ -250,13 +266,13 @@
 <script>
 <script>
 import { phoneCheck, streetQuery, getChainsByDeptCode } from '@/api/index';
 import { phoneCheck, streetQuery, getChainsByDeptCode } from '@/api/index';
 import { updateStore } from '@/api/FSQStore';
 import { updateStore } from '@/api/FSQStore';
-import { getPosition, getTicketFun } from '@/utils/TXApiFun';
+import { getPosition, getTicketFun, getMapPoi, getkeywordPoi, getGeocoder } from '@/utils/TXApiFun';
 import { jsonp } from 'vue-jsonp';
 import { jsonp } from 'vue-jsonp';
+import { getstreetInfoList } from '@/api/addDesigner';
 export default {
 export default {
   data() {
   data() {
     return {
     return {
       fromData: {
       fromData: {
-        storeCode: '',
         storeName: '',
         storeName: '',
         telephone: '',
         telephone: '',
         storeCategoryName: '',
         storeCategoryName: '',
@@ -265,8 +281,6 @@ export default {
         districtName: '',
         districtName: '',
         addressLine: '',
         addressLine: '',
         orgName: '',
         orgName: '',
-        // chainName: '',
-        townName: '',
         salesmanName: '',
         salesmanName: '',
         lat: '',
         lat: '',
         lon: '',
         lon: '',
@@ -301,11 +315,10 @@ export default {
       maplist: [],
       maplist: [],
     };
     };
   },
   },
-  activated() {
+  created() {
     this.showmap = false;
     this.showmap = false;
+    this.getStoreCategoryList();
     // this.toastLoading(0, '加载中...', true);
     // this.toastLoading(0, '加载中...', true);
-    // 获取地址
-    this.getStreetQuery();
     // 授权
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.$nextTick(() => {
       this.$nextTick(() => {
@@ -315,30 +328,62 @@ export default {
   },
   },
   methods: {
   methods: {
     getLocation() {
     getLocation() {
-      if (localStorage.getItem('loginType') == 'cs') {
-        this.fromData.lat = '31.2517820000';
-        this.fromData.lon = '120.5593090000';
-        this.addVisits();
-      } else {
-        getPosition()
-          .then((res) => {
-            let { TXisBD, resData } = res;
-            this.mlon = resData.longitude;
-            this.mlan = resData.latitude;
-            this.location = TXisBD;
-            this.fromData.lat = TXisBD.lat;
-            this.fromData.lon = TXisBD.lon;
-            this.location.lat1 = resData.latitude;
-            this.location.lon1 = resData.longitude;
-            this.addVisits();
-          })
-          .catch((error) => {
-            // this.beforeAddFn();
-            this.$dialog.alert({
-              message: error,
-            });
+      getPosition()
+        .then((res) => {
+          let { TXisBD, resData } = res;
+          this.mlon = resData.longitude;
+          this.mlan = resData.latitude;
+          this.location = TXisBD;
+          this.fromData.lat = TXisBD.lat;
+          this.fromData.lon = TXisBD.lon;
+          this.location.lat1 = resData.latitude;
+          this.location.lon1 = resData.longitude;
+          this.addVisits();
+          this.initData();
+        })
+        .catch((error) => {
+          // this.beforeAddFn();
+          this.$dialog.alert({
+            message: error,
           });
           });
-      }
+        });
+    },
+    initData() {
+      getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 })
+        .then((res) => {
+          if (res.status == 0 && res.result) {
+            let result = res.result;
+            this.fromData.cityNameOld = result.ad_info.city;
+            this.fromData.districtNameOld = result.ad_info.district;
+            let addresses = result.formatted_addresses; // 描述性地址
+            getstreetInfoList({ districtName: result.ad_info.district }).then((response) => {
+              if (response.code == 200 && response.data) {
+                this.fromData.province = response.data.provinceCode;
+                this.fromData.city = response.data.cityCode;
+                this.fromData.district = response.data.countyCode;
+                this.fromData.provinceName = response.data.provinceName;
+                this.fromData.cityName = response.data.cityName;
+                this.fromData.districtName = response.data.countyName;
+                this.fromData.cityLevel = response.data.countyLevel;
+                this.$nextTick(() => {
+                  this.getStreetQuery();
+                  this.getStreetQuery('1');
+                  this.getStreetQuery('2');
+                  // this.getStreetQuery('3');
+                });
+              }
+            });
+            if (addresses) {
+              this.fromData.addressLine = addresses.recommend;
+              localStorage.setItem('locationRemark', addresses.recommend);
+            }
+          } else {
+            this.toastLoading().clear();
+          }
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     },
     addVisits() {
     addVisits() {
       var that = this;
       var that = this;
@@ -369,6 +414,15 @@ export default {
     clickSubmit(values) {
     clickSubmit(values) {
       this.$refs.tabstoreVal.submit();
       this.$refs.tabstoreVal.submit();
     },
     },
+    getStoreCategoryList() {
+      // designerStoreCategory().then((res) => {
+      //   if (res.code == 200) {
+      //     this.storeCategoryList = res.data;
+      //     this.fromData.storeCategoryName = this.storeCategoryList[0].dictLabel;
+      //     this.fromData.storeCategory = this.storeCategoryList[0].dictValue;
+      //   }
+      // });
+    },
     onSubmit(value) {
     onSubmit(value) {
       this.toastLoading(0, '提交中...', true);
       this.toastLoading(0, '提交中...', true);
       updateStore(this.fromData).then((res) => {
       updateStore(this.fromData).then((res) => {
@@ -587,8 +641,8 @@ export default {
       this.fromData.city = '';
       this.fromData.city = '';
       this.fromData.districtName = '';
       this.fromData.districtName = '';
       this.fromData.countyCode = '';
       this.fromData.countyCode = '';
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = '';
       this.countyCode = '';
       this.cityCode = '';
       this.cityCode = '';
       this.provinceCode = value.provinceCode;
       this.provinceCode = value.provinceCode;
@@ -600,8 +654,8 @@ export default {
       this.fromData.city = value.cityCode;
       this.fromData.city = value.cityCode;
       this.fromData.districtName = '';
       this.fromData.districtName = '';
       this.fromData.district = '';
       this.fromData.district = '';
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = '';
       this.countyCode = '';
       this.cityCode = value.cityCode;
       this.cityCode = value.cityCode;
       this.getStreetQuery('2');
       this.getStreetQuery('2');
@@ -610,11 +664,11 @@ export default {
     onDistrictConfirm(value) {
     onDistrictConfirm(value) {
       this.fromData.districtName = value.text;
       this.fromData.districtName = value.text;
       this.fromData.district = value.countyCode;
       this.fromData.district = value.countyCode;
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = value.countyCode;
       this.countyCode = value.countyCode;
       this.fromData.cityLevel = value.countyLevel;
       this.fromData.cityLevel = value.countyLevel;
-      this.getStreetQuery('3');
+      // this.getStreetQuery('3');
       this.showDistrictPicker = false;
       this.showDistrictPicker = false;
     },
     },
     onTownConfirm(value) {
     onTownConfirm(value) {

+ 0 - 1
src/views/storeManagement/competingStoresDetail.vue

@@ -156,7 +156,6 @@ export default {
         districtName: '',
         districtName: '',
         addressLine: '',
         addressLine: '',
         orgName: '',
         orgName: '',
-        townName: '',
         contactName: '',
         contactName: '',
         salesmanName: '',
         salesmanName: '',
         cityLevel: '',
         cityLevel: '',

+ 91 - 50
src/views/storeManagement/competingStoresEdit.vue

@@ -31,7 +31,8 @@
           name="picker"
           name="picker"
           :value="fromData.storeCategoryName"
           :value="fromData.storeCategoryName"
           label="客户类型"
           label="客户类型"
-          placeholder="点击选择客户类型">
+          placeholder="点击选择客户类型"
+          :rules="[{ required: true, message: '请选择客户类型' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -43,7 +44,8 @@
           :value="fromData.orgName"
           :value="fromData.orgName"
           label="销售部"
           label="销售部"
           placeholder="点击选择销售部"
           placeholder="点击选择销售部"
-          @click="PickerDept">
+          @click="PickerDept"
+          :rules="[{ required: true, message: '请选择销售部' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -77,7 +79,8 @@
           :value="fromData.provinceName"
           :value="fromData.provinceName"
           label="省(州)"
           label="省(州)"
           placeholder="点击选择省(州)"
           placeholder="点击选择省(州)"
-          @click="showProvincePicker = true">
+          @click="showProvincePicker = true"
+          :rules="[{ required: true, message: '请选择省(州)' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -89,7 +92,8 @@
           :value="fromData.cityName"
           :value="fromData.cityName"
           label="城市"
           label="城市"
           placeholder="点击选择城市"
           placeholder="点击选择城市"
-          @click="showCityPicker = true">
+          @click="showCityPicker = true"
+          :rules="[{ required: true, message: '请选择城市' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -101,23 +105,25 @@
           :value="fromData.districtName"
           :value="fromData.districtName"
           label="区(县)"
           label="区(县)"
           placeholder="点击选择区(县)"
           placeholder="点击选择区(县)"
-          @click="showDistrictPicker = true">
+          @click="showDistrictPicker = true"
+          :rules="[{ required: true, message: '请选择区(县)' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
         </van-field>
         </van-field>
-        <van-field
+        <!-- <van-field
           readonly
           readonly
           clickable
           clickable
           name="picker"
           name="picker"
           :value="fromData.townName"
           :value="fromData.townName"
           label="街道"
           label="街道"
           placeholder="点击选择街道"
           placeholder="点击选择街道"
-          @click="showTownPicker = true">
+          @click="showTownPicker = true"
+          :rules="[{ required: true, message: '请选择街道' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
-        </van-field>
+        </van-field> -->
         <van-field
         <van-field
           v-model="fromData.addressLine"
           v-model="fromData.addressLine"
           label="地址"
           label="地址"
@@ -125,7 +131,8 @@
           rows="1"
           rows="1"
           autosize
           autosize
           type="textarea"
           type="textarea"
-          @blur="addressFn">
+          @blur="addressFn"
+          :rules="[{ required: true, message: '请选择地址' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -138,20 +145,24 @@
         <van-field
         <van-field
           type="tel"
           type="tel"
           v-model="fromData.telephone"
           v-model="fromData.telephone"
-          label="联系电话"
-          placeholder="请输入联系电话"
+          label="门店联系电话"
+          placeholder="请输入门店联系电话"
           :rules="[
           :rules="[
             {
             {
-              required: false,
+              required: true,
               validator: FSQValidatePhone,
               validator: FSQValidatePhone,
-              message: '请输入联系电话',
+              message: '请输入门店联系电话',
             },
             },
           ]">
           ]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
         </van-field>
         </van-field>
-        <van-field v-model="fromData.salesmanName" label="联系人" placeholder="联系人">
+        <van-field
+          v-model="fromData.salesmanName"
+          label="门店联系人"
+          placeholder="请输入门店联系人"
+          :rules="[{ required: true, message: '请输入门店联系人' }]">
           <template #left-icon>
           <template #left-icon>
             <span class="van-f-red">*</span>
             <span class="van-f-red">*</span>
           </template>
           </template>
@@ -183,14 +194,14 @@
         @confirm="onDistrictConfirm"
         @confirm="onDistrictConfirm"
         @cancel="showDistrictPicker = false" />
         @cancel="showDistrictPicker = false" />
     </van-popup>
     </van-popup>
-    <van-popup v-model="showTownPicker" position="bottom">
+    <!-- <van-popup v-model="showTownPicker" position="bottom">
       <van-picker
       <van-picker
         show-toolbar
         show-toolbar
         title="街道"
         title="街道"
         :columns="townList"
         :columns="townList"
         @confirm="onTownConfirm"
         @confirm="onTownConfirm"
         @cancel="showTownPicker = false" />
         @cancel="showTownPicker = false" />
-    </van-popup>
+    </van-popup> -->
     <!--    部门数据 -->
     <!--    部门数据 -->
     <van-popup v-model="showPickerDept" position="bottom">
     <van-popup v-model="showPickerDept" position="bottom">
       <van-picker
       <van-picker
@@ -250,8 +261,9 @@
 <script>
 <script>
 import { phoneCheck, streetQuery, getChainsByDeptCode } from '@/api/index';
 import { phoneCheck, streetQuery, getChainsByDeptCode } from '@/api/index';
 import { updateStore } from '@/api/FSQStore';
 import { updateStore } from '@/api/FSQStore';
-import { getPosition, getTicketFun } from '@/utils/TXApiFun';
+import { getPosition, getTicketFun, getMapPoi, getkeywordPoi, getGeocoder } from '@/utils/TXApiFun';
 import { jsonp } from 'vue-jsonp';
 import { jsonp } from 'vue-jsonp';
+import { getstreetInfoList } from '@/api/addDesigner';
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -266,7 +278,7 @@ export default {
         addressLine: '',
         addressLine: '',
         orgName: '',
         orgName: '',
         // chainName: '',
         // chainName: '',
-        townName: '',
+        // townName: '',
         salesmanName: '',
         salesmanName: '',
         lat: '',
         lat: '',
         lon: '',
         lon: '',
@@ -304,8 +316,6 @@ export default {
   activated() {
   activated() {
     this.showmap = false;
     this.showmap = false;
     // this.toastLoading(0, '加载中...', true);
     // this.toastLoading(0, '加载中...', true);
-    // 获取地址
-    this.getStreetQuery();
     // 授权
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.$nextTick(() => {
       this.$nextTick(() => {
@@ -315,30 +325,61 @@ export default {
   },
   },
   methods: {
   methods: {
     getLocation() {
     getLocation() {
-      if (localStorage.getItem('loginType') == 'cs') {
-        this.fromData.lat = '31.2517820000';
-        this.fromData.lon = '120.5593090000';
-        this.addVisits();
-      } else {
-        getPosition()
-          .then((res) => {
-            let { TXisBD, resData } = res;
-            this.mlon = resData.longitude;
-            this.mlan = resData.latitude;
-            this.location = TXisBD;
-            this.fromData.lat = TXisBD.lat;
-            this.fromData.lon = TXisBD.lon;
-            this.location.lat1 = resData.latitude;
-            this.location.lon1 = resData.longitude;
-            this.addVisits();
-          })
-          .catch((error) => {
-            // this.beforeAddFn();
-            this.$dialog.alert({
-              message: error,
-            });
+      getPosition()
+        .then((res) => {
+          let { TXisBD, resData } = res;
+          this.mlon = resData.longitude;
+          this.mlan = resData.latitude;
+          this.location = TXisBD;
+          this.fromData.lat = TXisBD.lat;
+          this.fromData.lon = TXisBD.lon;
+          this.location.lat1 = resData.latitude;
+          this.location.lon1 = resData.longitude;
+          this.addVisits();
+          this.initData();
+        })
+        .catch((error) => {
+          // this.beforeAddFn();
+          this.$dialog.alert({
+            message: error,
           });
           });
-      }
+        });
+    },
+    initData() {
+      getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 })
+        .then((res) => {
+          if (res.status == 0 && res.result) {
+            let result = res.result;
+            this.fromData.cityNameOld = result.ad_info.city;
+            this.fromData.districtNameOld = result.ad_info.district;
+            let addresses = result.formatted_addresses; // 描述性地址
+            getstreetInfoList({ districtName: result.ad_info.district }).then((response) => {
+              if (response.code == 200 && response.data) {
+                this.fromData.province = response.data.provinceCode;
+                this.fromData.city = response.data.cityCode;
+                this.fromData.district = response.data.countyCode;
+                this.fromData.provinceName = response.data.provinceName;
+                this.fromData.cityName = response.data.cityName;
+                this.fromData.districtName = response.data.countyName;
+                this.$nextTick(() => {
+                  this.getStreetQuery();
+                  this.getStreetQuery('1');
+                  this.getStreetQuery('2');
+                  // this.getStreetQuery('3');
+                });
+              }
+            });
+            if (addresses) {
+              this.fromData.addressLine = addresses.recommend;
+              localStorage.setItem('locationRemark', addresses.recommend);
+            }
+          } else {
+            this.toastLoading().clear();
+          }
+        })
+        .catch(() => {
+          this.toastLoading().clear();
+        });
     },
     },
     addVisits() {
     addVisits() {
       var that = this;
       var that = this;
@@ -587,8 +628,8 @@ export default {
       this.fromData.city = '';
       this.fromData.city = '';
       this.fromData.districtName = '';
       this.fromData.districtName = '';
       this.fromData.countyCode = '';
       this.fromData.countyCode = '';
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = '';
       this.countyCode = '';
       this.cityCode = '';
       this.cityCode = '';
       this.provinceCode = value.provinceCode;
       this.provinceCode = value.provinceCode;
@@ -600,8 +641,8 @@ export default {
       this.fromData.city = value.cityCode;
       this.fromData.city = value.cityCode;
       this.fromData.districtName = '';
       this.fromData.districtName = '';
       this.fromData.district = '';
       this.fromData.district = '';
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = '';
       this.countyCode = '';
       this.cityCode = value.cityCode;
       this.cityCode = value.cityCode;
       this.getStreetQuery('2');
       this.getStreetQuery('2');
@@ -610,11 +651,11 @@ export default {
     onDistrictConfirm(value) {
     onDistrictConfirm(value) {
       this.fromData.districtName = value.text;
       this.fromData.districtName = value.text;
       this.fromData.district = value.countyCode;
       this.fromData.district = value.countyCode;
-      this.fromData.townName = '';
-      this.fromData.townCode = '';
+      // this.fromData.townName = '';
+      // this.fromData.townCode = '';
       this.countyCode = value.countyCode;
       this.countyCode = value.countyCode;
       this.fromData.cityLevel = value.countyLevel;
       this.fromData.cityLevel = value.countyLevel;
-      this.getStreetQuery('3');
+      // this.getStreetQuery('3');
       this.showDistrictPicker = false;
       this.showDistrictPicker = false;
     },
     },
     onTownConfirm(value) {
     onTownConfirm(value) {

+ 8 - 1
src/views/week/index.vue

@@ -42,7 +42,11 @@
               <van-icon :name="addShop" class="zicon" />
               <van-icon :name="addShop" class="zicon" />
             </template>
             </template>
           </van-cell>
           </van-cell>
-          <van-cell title="新增潜在客户" is-link to="/competingStoresAdd">
+          <van-cell
+            title="新增潜在客户"
+            is-link
+            to="/competingStoresAdd"
+            v-if="postType == 'DIY' && addShow">
             <template #icon>
             <template #icon>
               <van-icon :name="addShop" class="zicon" />
               <van-icon :name="addShop" class="zicon" />
             </template>
             </template>
@@ -299,6 +303,7 @@ export default {
       summaryPendingApprovalNum: 0,
       summaryPendingApprovalNum: 0,
       summaryApprovalFeedbackNum: 0,
       summaryApprovalFeedbackNum: 0,
       reportInfo: null,
       reportInfo: null,
+      postType: null,
     };
     };
   },
   },
   watch: {
   watch: {
@@ -307,6 +312,7 @@ export default {
       if (to.path == '/My/index') {
       if (to.path == '/My/index') {
         this.nickName = localStorage.getItem('nickName');
         this.nickName = localStorage.getItem('nickName');
         this.postName = localStorage.getItem('postName');
         this.postName = localStorage.getItem('postName');
+        this.postType = localStorage.getItem('postType');
         this.powerGrade = localStorage.getItem('powerGrade');
         this.powerGrade = localStorage.getItem('powerGrade');
         this.isDiy = localStorage.getItem('isDiy');
         this.isDiy = localStorage.getItem('isDiy');
         this.getstoreCoverPosition();
         this.getstoreCoverPosition();
@@ -317,6 +323,7 @@ export default {
   created() {
   created() {
     this.powerGrade = localStorage.getItem('powerGrade');
     this.powerGrade = localStorage.getItem('powerGrade');
     this.postName = localStorage.getItem('postName');
     this.postName = localStorage.getItem('postName');
+    this.postType = localStorage.getItem('postType');
     this.isDiy = localStorage.getItem('isDiy');
     this.isDiy = localStorage.getItem('isDiy');
     this.nickName = localStorage.getItem('nickName');
     this.nickName = localStorage.getItem('nickName');
     this.getstoreCoverPosition();
     this.getstoreCoverPosition();