Bladeren bron

同城分销店拆分、分销店对应多个经销商

zhujindu 11 maanden geleden
bovenliggende
commit
d86b0fe29b
6 gewijzigde bestanden met toevoegingen van 378 en 300 verwijderingen
  1. 2 0
      src/main.js
  2. 1 0
      src/permission.js
  3. 1 0
      src/store/getters.js
  4. 11 1
      src/store/modules/user.js
  5. 168 138
      src/utils/index.js
  6. 195 161
      src/views/storeManagement/storeAdd.vue

+ 2 - 0
src/main.js

@@ -15,6 +15,7 @@ import {
   Micrometer,
   weeklyTimeDivision,
   gcj02BD,
+  verifyStoreType,
 } from '@/utils/index';
 import { toastLoading } from '@/utils/commonVant';
 import '@vant/touch-emulator';
@@ -50,6 +51,7 @@ Vue.prototype.twoPointSum = twoPointSum;
 Vue.prototype.wx = wx;
 Vue.prototype.parseTimeParagraph = parseTimeParagraph;
 Vue.prototype.Micrometer = Micrometer;
+Vue.prototype.verifyStoreType = verifyStoreType;
 Vue.prototype.Toast = Toast;
 Vue.prototype.notify = Notify;
 var clipboard = new ClipboardJS('.btn');

+ 1 - 0
src/permission.js

@@ -17,6 +17,7 @@ router.beforeEach((to, from, next) => {
         .catch(() => {
           next();
         });
+      store.dispatch('setStoreType');
     } else {
       next();
     }

+ 1 - 0
src/store/getters.js

@@ -1,4 +1,5 @@
 const getters = {
   userInfo: (state) => state.user.userInfo,
+  storeType: (state) => state.user.storeType,
 };
 export default getters;

+ 11 - 1
src/store/modules/user.js

@@ -1,10 +1,11 @@
-import { getMobileUserInfo } from '@/api/index';
+import { getMobileUserInfo, getDictOption } from '@/api/index';
 import { selectAllocationPermission } from '@/api/week';
 
 const user = {
   state: {
     userInfo: null,
     activaTypeStore: null,
+    storeType: [],
   },
 
   mutations: {
@@ -17,6 +18,9 @@ const user = {
     SET_ASSIGN_FLAG: (state, value) => {
       state.isAssignFlag = value;
     },
+    SET_STORE_TYPE: (state, value) => {
+      state.storeType = value;
+    },
   },
 
   actions: {
@@ -43,6 +47,12 @@ const user = {
     setActivaTypeStore({ commit }, value) {
       commit('SET_ACTIVA_TYPE_STORE', value);
     },
+    // 门店类型
+    setStoreType({ commit }, value) {
+      getDictOption({}, 'sfa_store_type').then((res) => {
+        commit('SET_STORE_TYPE', res.data);
+      });
+    },
   },
 };
 

+ 168 - 138
src/utils/index.js

@@ -1,189 +1,219 @@
+import store from '../store';
+
 // 日期格式化
 export function parseTime(time, pattern) {
-    if(time!="null"){
+  if (time != 'null') {
     if (arguments.length === 0 || !time) {
-        return null
+      return null;
     }
-    const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
-    let date
+    const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}';
+    let date;
     if (typeof time === 'object') {
-        date = time
+      date = time;
     } else {
-        if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
-            time = parseInt(time)
-        } else if (typeof time === 'string') {
-            time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
-        }
-        if ((typeof time === 'number') && (time.toString().length === 10)) {
-            time = time * 1000
-        }
-        date = new Date(time)
+      if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
+        time = parseInt(time);
+      } else if (typeof time === 'string') {
+        time = time
+          .replace(new RegExp(/-/gm), '/')
+          .replace('T', ' ')
+          .replace(new RegExp(/\.[\d]{3}/gm), '');
+      }
+      if (typeof time === 'number' && time.toString().length === 10) {
+        time = time * 1000;
+      }
+      date = new Date(time);
     }
     const formatObj = {
-        y: date.getFullYear(),
-        m: date.getMonth() + 1,
-        d: date.getDate(),
-        h: date.getHours(),
-        i: date.getMinutes(),
-        s: date.getSeconds(),
-        a: date.getDay()
-    }
+      y: date.getFullYear(),
+      m: date.getMonth() + 1,
+      d: date.getDate(),
+      h: date.getHours(),
+      i: date.getMinutes(),
+      s: date.getSeconds(),
+      a: date.getDay(),
+    };
     const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
-        let value = formatObj[key]
-        // Note: getDay() returns 0 on Sunday
-        if (key === 'a') {
-            return ['日', '一', '二', '三', '四', '五', '六'][value]
-        }
-        if (result.length > 0 && value < 10) {
-            value = '0' + value
-        }
-        return value || 0
-    })
-    return time_str
-    }else{
-        return ""
-    }
+      let value = formatObj[key];
+      // Note: getDay() returns 0 on Sunday
+      if (key === 'a') {
+        return ['日', '一', '二', '三', '四', '五', '六'][value];
+      }
+      if (result.length > 0 && value < 10) {
+        value = '0' + value;
+      }
+      return value || 0;
+    });
+    return time_str;
+  } else {
+    return '';
+  }
 }
 // 千分号
 export function Micrometer(num) {
-    if(num!=null){
-    let numt = (num || 0).toString().split(".");
+  if (num != null) {
+    let numt = (num || 0).toString().split('.');
     if (numt[1] == undefined) {
-        return numt[0].replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
+      return numt[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
     } else {
-        return numt[0].replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") + "." + numt[1];
-    }
-    }else{
-        return 0.00
+      return numt[0].replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + '.' + numt[1];
     }
+  } else {
+    return 0.0;
+  }
 }
-export function weeklyTimeDivision(time,type){
-    if(type==0){
-        return time.split(" ")[0]+"  "
-    }else{
-        return time.split(" ")[1]
-    }
+export function weeklyTimeDivision(time, type) {
+  if (type == 0) {
+    return time.split(' ')[0] + '  ';
+  } else {
+    return time.split(' ')[1];
+  }
 }
 export function parseTimeParagraph(dayTime) {
-    var currentDate = new Date(dayTime)
-    var timesStamp = currentDate.getTime();
-    var currenDay = currentDate.getDay();
-    var dates = [];
-    var   tabTime=[]
-    for (var i = 0; i < 14; i++) {
-        var dataTime=new Date(timesStamp + 24 * 60 * 60 * 1000 * (i - (currenDay + 6) % 7)).toLocaleDateString().replace(/\//g, '-')
-        var dataTimeArr=dataTime.split("-")
-        if(dataTimeArr[1]<10){
-            dataTimeArr[1]="0"+dataTimeArr[1]
-        }
-        if(dataTimeArr[2]<10){
-            dataTimeArr[2]="0"+dataTimeArr[2]
-        }
-        dates.push(dataTimeArr.join("-")+" "+["周日","周一","周二","周三","周四","周五","周六"][new Date(dataTime.toString().replace(/-/g, '/')).getDay()]);
+  var currentDate = new Date(dayTime);
+  var timesStamp = currentDate.getTime();
+  var currenDay = currentDate.getDay();
+  var dates = [];
+  var tabTime = [];
+  for (var i = 0; i < 14; i++) {
+    var dataTime = new Date(timesStamp + 24 * 60 * 60 * 1000 * (i - ((currenDay + 6) % 7)))
+      .toLocaleDateString()
+      .replace(/\//g, '-');
+    var dataTimeArr = dataTime.split('-');
+    if (dataTimeArr[1] < 10) {
+      dataTimeArr[1] = '0' + dataTimeArr[1];
+    }
+    if (dataTimeArr[2] < 10) {
+      dataTimeArr[2] = '0' + dataTimeArr[2];
     }
-    tabTime.push(dates[0])
-    tabTime.push(dates[4])
-    return dates
+    dates.push(
+      dataTimeArr.join('-') +
+        ' ' +
+        ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][
+          new Date(dataTime.toString().replace(/-/g, '/')).getDay()
+        ]
+    );
+  }
+  tabTime.push(dates[0]);
+  tabTime.push(dates[4]);
+  return dates;
 }
 export function weeklay(dataTime) {
-    return ["周日","周一","周二","周三","周四","周五","周六"][new Date(dataTime).getDay()]
+  return ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][new Date(dataTime).getDay()];
 }
 
 // 回显数据字典
 export function selectDictLabel(datas, value) {
-    var actions = [];
-    Object.keys(datas).some((key) => {
-        if (datas[key].dictValue == ('' + value)) {
-            actions.push(datas[key].dictLabel);
-            return true;
-        }
-    })
-    return actions.join('');
+  var actions = [];
+  Object.keys(datas).some((key) => {
+    if (datas[key].dictValue == '' + value) {
+      actions.push(datas[key].dictLabel);
+      return true;
+    }
+  });
+  return actions.join('');
 }
 
 export function selectDictLabelu(datas, value) {
-    var actions = [];
-    Object.keys(datas).some((key) => {
-        if (datas[key].dictValue == ('' + value)) {
-            actions.push(datas[key].text);
-            return true;
-        }
-    })
-    return actions.join('');
+  var actions = [];
+  Object.keys(datas).some((key) => {
+    if (datas[key].dictValue == '' + value) {
+      actions.push(datas[key].text);
+      return true;
+    }
+  });
+  return actions.join('');
 }
 
 // 回显数据字典(字符串数组)
 export function selectDictLabels(datas, value, separator) {
-    var actions = [];
-    var currentSeparator = undefined === separator ? "," : separator;
-    var temp = value.split(currentSeparator);
-    Object.keys(value.split(currentSeparator)).some((val) => {
-        Object.keys(datas).some((key) => {
-            if (datas[key].dictValue == ('' + temp[val])) {
-                actions.push(datas[key].dictLabel + currentSeparator);
-            }
-        })
-    })
-    return actions.join('').substring(0, actions.join('').length - 1);
+  var actions = [];
+  var currentSeparator = undefined === separator ? ',' : separator;
+  var temp = value.split(currentSeparator);
+  Object.keys(value.split(currentSeparator)).some((val) => {
+    Object.keys(datas).some((key) => {
+      if (datas[key].dictValue == '' + temp[val]) {
+        actions.push(datas[key].dictLabel + currentSeparator);
+      }
+    });
+  });
+  return actions.join('').substring(0, actions.join('').length - 1);
 }
 
 // 字符串格式化(%s )
 export function sprintf(str) {
-    var args = arguments, flag = true, i = 1;
-    str = str.replace(/%s/g, function () {
-        var arg = args[i++];
-        if (typeof arg === 'undefined') {
-            flag = false;
-            return '';
-        }
-        return arg;
-    });
-    return flag ? str : '';
+  var args = arguments,
+    flag = true,
+    i = 1;
+  str = str.replace(/%s/g, function () {
+    var arg = args[i++];
+    if (typeof arg === 'undefined') {
+      flag = false;
+      return '';
+    }
+    return arg;
+  });
+  return flag ? str : '';
 }
 
 // 转换字符串,undefined,null等转化为""
 export function praseStrEmpty(str) {
-    if (!str || str == "undefined" || str == "null") {
-        return "";
-    }
-    return str;
+  if (!str || str == 'undefined' || str == 'null') {
+    return '';
+  }
+  return str;
 }
 
 //
 export function twoPointSum(latA, lonA, latB, lonB) {
-    var coordinate = 6371000.;
-    var PI = 3.14159265358979324;
-    var x = Math.cos(latA * PI / 180.) * Math.cos(latB * PI / 180.) * Math.cos((lonA - lonB) * PI / 180);
-    var y = Math.sin(latA * PI / 180.) * Math.sin(latB * PI / 180.);
-    var s = x + y;
-    if (s > 1) s = 1;
-    if (s < -1) s = -1;
-    var alphabet = Math.acos(s);
-    var PointSum = alphabet * coordinate;
-    return PointSum;
+  var coordinate = 6371000;
+  var PI = 3.14159265358979324;
+  var x =
+    Math.cos((latA * PI) / 180) *
+    Math.cos((latB * PI) / 180) *
+    Math.cos(((lonA - lonB) * PI) / 180);
+  var y = Math.sin((latA * PI) / 180) * Math.sin((latB * PI) / 180);
+  var s = x + y;
+  if (s > 1) s = 1;
+  if (s < -1) s = -1;
+  var alphabet = Math.acos(s);
+  var PointSum = alphabet * coordinate;
+  return PointSum;
 }
 
 export function CJ02BD(gcjLat, gcjLon) {
-    var x = gcjLon,
-        y = gcjLat;
-    var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
-    var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
-    var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
-    var bdLon = z * Math.cos(theta) + 0.0065;
-    var bdLat = z * Math.sin(theta) + 0.006;
+  var x = gcjLon,
+    y = gcjLat;
+  var x_pi = (3.14159265358979324 * 3000.0) / 180.0;
+  var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
+  var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
+  var bdLon = z * Math.cos(theta) + 0.0065;
+  var bdLat = z * Math.sin(theta) + 0.006;
 
-    return {
-        'lat': bdLat,
-        'lon': bdLon
-    };
+  return {
+    lat: bdLat,
+    lon: bdLon,
+  };
 }
 export function gcj02BD(gcjLat, gcjLon) {
-    var x = gcjLon - 0.0065,
-        y = gcjLat - 0.006;
-    var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
-    var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
-    var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
-    var bdLon = z * Math.cos(theta);
-    var bdLat = z * Math.sin(theta);
-    return { lat: bdLat, lon: bdLon };
+  var x = gcjLon - 0.0065,
+    y = gcjLat - 0.006;
+  var x_pi = (3.14159265358979324 * 3000.0) / 180.0;
+  var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
+  var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
+  var bdLon = z * Math.cos(theta);
+  var bdLat = z * Math.sin(theta);
+  return { lat: bdLat, lon: bdLon };
+}
+
+/**
+ *门店类型集合,返回对应的类型
+ *@param {*String} dictValue //类型
+ *  */
+export function verifyStoreType(dictValue) {
+  if (!dictValue) return null;
+  let storeData = null;
+  storeData = store.getters.storeType.find((val) => val.dictValue == dictValue);
+  let remarkType = JSON.parse(storeData.remark);
+  return remarkType;
 }

+ 195 - 161
src/views/storeManagement/storeAdd.vue

@@ -46,46 +46,84 @@
                 <span class="van-f-red">*</span>
               </template>
             </van-field>
-            <div style="background-color: white; padding: 0 14px" class="morelaji">
-              <van-row
-                v-if="fromValue.storeCategory != 'C917'"
-                style="border-bottom: 1px solid #ebedf0">
-                <van-col span="24">
-                  <van-field
-                    rows="1"
-                    autosize
-                    type="textarea"
-                    readonly
-                    clickable
-                    name="picker"
-                    :value="fromValue.chainName"
-                    label="经销商名称"
-                    placeholder="点击选择经销商名称"
-                    @click="showPickerChainsListFn">
-                    <template #left-icon>
-                      <span
-                        v-if="
-                          fromValue.ifJzStoreType != 1 &&
-                          fromValue.storeCategory != 'C912' &&
-                          fromValue.storeCategory != 'C917'
-                        "
-                        class="van-f-red"
-                        >*</span
-                      >
-                    </template>
-                  </van-field>
-                </van-col>
-                <!-- <van-col span="4">
-                  <van-button
-                    size="small"
-                    type="info"
-                    style="margin-top: 6px"
-                    native-type="button"
-                    @click="moreTypeShowfn">
-                    <van-icon name="list-switching" />更多
-                  </van-button>
-                </van-col> -->
-              </van-row>
+            <div
+              style="background-color: white; padding: 0 14px"
+              class="morelaji"
+              v-if="fromValue.storeCategory != 'C917'">
+              <template
+                v-if="
+                  verifyStoreType(fromValue.storeCategory) &&
+                  verifyStoreType(fromValue.storeCategory).type == 'tcfxd'
+                ">
+                <van-row
+                  v-if="fromValue.storeCategory != 'C917'"
+                  style="border-bottom: 1px solid #ebedf0">
+                  <van-col span="24">
+                    <van-field
+                      rows="1"
+                      autosize
+                      type="textarea"
+                      readonly
+                      clickable
+                      name="picker"
+                      :value="fromValue.chainName"
+                      label="经销商名称"
+                      placeholder="点击选择经销商名称"
+                      @click="showPickerChainsListFn">
+                      <template #left-icon>
+                        <span
+                          v-if="
+                            fromValue.ifJzStoreType != 1 &&
+                            fromValue.storeCategory != 'C912' &&
+                            fromValue.storeCategory != 'C917'
+                          "
+                          class="van-f-red"
+                          >*</span
+                        >
+                      </template>
+                    </van-field>
+                  </van-col>
+                </van-row>
+              </template>
+              <template v-else>
+                <van-row style="border-bottom: 1px solid #ebedf0">
+                  <van-col span="20">
+                    <van-field
+                      rows="1"
+                      autosize
+                      type="textarea"
+                      readonly
+                      clickable
+                      name="picker"
+                      :value="fromValue.chainName"
+                      label="经销商名称"
+                      placeholder="点击选择经销商名称"
+                      @click="showPickerChainsListFn">
+                      <template #left-icon>
+                        <span
+                          v-if="
+                            fromValue.ifJzStoreType != 1 &&
+                            fromValue.storeCategory != 'C912' &&
+                            fromValue.storeCategory != 'C917'
+                          "
+                          class="van-f-red"
+                          >*</span
+                        >
+                      </template>
+                    </van-field>
+                  </van-col>
+                  <van-col span="4">
+                    <van-button
+                      size="small"
+                      type="info"
+                      style="margin-top: 6px"
+                      native-type="button"
+                      @click="moreTypeShowfn">
+                      <van-icon name="list-switching" />更多
+                    </van-button>
+                  </van-col>
+                </van-row>
+              </template>
             </div>
             <van-field
               v-model="fromValue.storeName"
@@ -449,30 +487,52 @@
     </van-popup>
     <!--经销商-->
     <van-popup v-model="showPickerChainsList" position="bottom" class="agencyBox">
-      <!-- <van-picker
-        show-toolbar
-        :columns="ChainsList"
-        value-key="chainName"
-        @confirm="onConfirmChainsList"
-        @cancel="showPickerChainsList = false" /> -->
-      <div class="header_btn">
-        <div class="cancel" @click="showPickerChainsList = false">取消</div>
-        <div class="confirm">确定</div>
-      </div>
-      <van-tree-select :items="treeSelect" :main-active-index.sync="activeIndex">
-        <template #content>
-          <van-checkbox-group
-            v-if="activeIndex == index"
-            v-model="result"
-            :max="1"
-            v-for="(item, index) in treeSelect"
-            :key="index">
-            <van-checkbox name="a">复选框 a{{ activeIndex }}{{ index }}</van-checkbox>
-            <van-checkbox name="b">复选框 b{{ activeIndex }}{{ index }}</van-checkbox>
-            <van-checkbox name="c">复选框 c{{ activeIndex }}{{ index }}</van-checkbox>
-          </van-checkbox-group>
-        </template>
-      </van-tree-select>
+      <template
+        v-if="
+          verifyStoreType(fromValue.storeCategory) &&
+          verifyStoreType(fromValue.storeCategory).type == 'tcfxd'
+        ">
+        <div class="header_btn">
+          <div class="cancel" @click="showPickerChainsList = false">取消</div>
+          <div class="confirm">确定</div>
+        </div>
+        <van-tree-select
+          :items="treeSelect"
+          :main-active-index.sync="activeIndex"
+          @click-nav="clickNav">
+          <template #content>
+            <div
+              class="treeSelectchildren"
+              v-if="activeIndex == index"
+              v-for="(item, index) in treeSelect"
+              :key="index">
+              <div
+                class="item"
+                v-for="(val, ind) in item.children"
+                :key="ind"
+                @click="treeSelectItemClick(item, index, val, ind)">
+                <div
+                  :class="{
+                    'van-radio__icon': true,
+                    'van-radio__icon--round': true,
+                    'van-radio__icon--checked': val.Check,
+                  }">
+                  <i class="van-icon van-icon-success"></i>
+                </div>
+                <div class="value">{{ val.code }} {{ val.name }}</div>
+              </div>
+            </div>
+          </template>
+        </van-tree-select>
+      </template>
+      <template v-else>
+        <van-picker
+          show-toolbar
+          :columns="ChainsList"
+          value-key="chainName"
+          @confirm="onConfirmChainsList"
+          @cancel="showPickerChainsList = false" />
+      </template>
     </van-popup>
     <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%; font-size: 14px">
       <van-row style="background-color: #f5f5f5">
@@ -630,6 +690,7 @@ import {
   getMainProjectList,
   getCustomerNatureList,
   getpotentialCustomerTypeList,
+  getDictOption,
 } from '@/api/index';
 import uploadImg from '@/components/uploadImgVStore';
 import uploadImgc from '@/components/uploadImgVStorec';
@@ -769,13 +830,21 @@ export default {
       pageShow: false,
       map: '',
       activeIndex: 0,
-      treeSelect: [
-        { text: '浙江', aa: 1, children: [], dot: true },
-        { text: '江苏1', aa: 2, children: [] },
-        { text: '江苏2', children: [] },
-        { text: '江苏3', children: [] },
-        { text: '江苏4', children: [] },
-        { text: '江苏5', children: [] },
+      treeSelectItemInd: 0,
+      treeSelect: [],
+      treeSelectchildrenItem: [
+        {
+          code: '0110053190',
+          name: '苏州市宏图商贸有限公司',
+        },
+        {
+          code: '0110044320',
+          name: '苏州市金水涂料商行',
+        },
+        {
+          code: '0110053191',
+          name: '苏州市宏图商贸有限公司1',
+        },
       ],
     };
   },
@@ -1275,6 +1344,7 @@ export default {
             this.fromValue.city = '';
           }
           this.storeCategoryList = storeCategory;
+          console.log(this.storeCategoryList);
         } else {
           loading1.clear();
           this.$toast.fail('请求超时');
@@ -1348,96 +1418,6 @@ export default {
               message: error,
             });
           });
-        //   let loading1 = this.$toast.loading({
-        //     duration: 0,
-        //     message: '定位中...',
-        //     forbidClick: true,
-        //   });
-        //   let url = window.location.href;
-        //   this.list = [];
-        //   let that = this;
-        //   let qiyeData;
-        //   const instance = axios.create();
-        //   instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-        //   instance
-        //     .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-        //       params: {
-        //         url: url,
-        //       },
-        //     })
-        //     .then((response) => {
-        //       if (response.status == 200) {
-        //         this.cont = 3;
-        //         var flat = true;
-        //         var times = setInterval(() => {
-        //           this.cont--;
-        //           if (this.cont == '0') {
-        //             if (flat) {
-        //               loading1.clear();
-        //               clearInterval(times);
-        //               that.$dialog
-        //                 .alert({
-        //                   message: '定位失败,请开启企微定位权限',
-        //                 })
-        //                 .then(() => {
-        //                   this.$router.go(-1);
-        //                 });
-        //             } else {
-        //               clearInterval(times);
-        //             }
-        //           }
-        //         }, 1000);
-        //         qiyeData = response.data.data;
-        //         that.wx.config({
-        //           beta: true,
-        //           debug: false,
-        //           appId: qiyeData.appId,
-        //           timestamp: qiyeData.timestamp,
-        //           nonceStr: qiyeData.nonceStr,
-        //           signature: qiyeData.signature,
-        //           jsApiList: ['ready', 'getLocation'],
-        //         });
-        //         that.wx.ready(function () {
-        //           that.wx.getLocation({
-        //             type: 'gcj02',
-        //             success: function (res) {
-        //               flat = false;
-        //               loading1.clear();
-        //               that.mlon = res.longitude;
-        //               that.mlan = res.latitude;
-        //               var location = that.CJ02BD(res.latitude, res.longitude);
-        //               that.location = location;
-        //               that.fromValue.lat = that.location.lat;
-        //               that.fromValue.lon = that.location.lon;
-        //               that.location.lat1 = res.latitude;
-        //               that.location.lon1 = res.longitude;
-        //               that.addVisits();
-        //             },
-        //             fail: function () {
-        //               loading1.clear();
-        //               that.$dialog
-        //                 .confirm({
-        //                   confirmButtonText: '返回上一页',
-        //                   cancelButtonText: '重新定位',
-        //                   title: '系统提示',
-        //                   message: 'GPS未开启',
-        //                 })
-        //                 .then(() => {
-        //                   that.$router.go(-1);
-        //                 })
-        //                 .catch(() => {
-        //                   that.getLocation();
-        //                 });
-        //             },
-        //           });
-        //         });
-        //         that.wx.error(function (res) {
-        //           this.$toast.fail('定位失败');
-        //         });
-        //       } else {
-        //         this.$toast.fail('接口异常');
-        //       }
-        //     });
       }
     },
     getpotentialCustomerTypeList() {
@@ -1679,6 +1659,13 @@ export default {
         return;
       } else {
         this.showPickerChainsList = true;
+        // 同城分销
+        if (
+          this.verifyStoreType(this.fromValue.storeCategory) &&
+          this.verifyStoreType(this.fromValue.storeCategory).type == 'tcfxd'
+        ) {
+          this.getStoreChainsContact();
+        }
       }
     },
     moreTypeShowfn() {
@@ -1968,6 +1955,38 @@ export default {
         }
       }
     },
+    //
+    async getStoreChainsContact() {
+      if (!this.treeSelect.length) {
+        let treeSelect = await getDictOption({}, 'store_chains_contact');
+        treeSelect.data.forEach((val) => {
+          val.text = val.dictLabel;
+          val.children = [];
+        });
+        this.treeSelect = treeSelect.data;
+        this.clickNav(0);
+      }
+      this.activeIndex = 0;
+    },
+    // 左侧数据点击
+    clickNav(index) {
+      let children = this.treeSelect[index].children;
+      if (!children.length) {
+        this.treeSelect[index].children = this.treeSelectchildrenItem;
+      }
+    },
+    // 右侧数据点击
+    treeSelectItemClick(itemData, index, val, ind) {
+      itemData.children.forEach((item) => {
+        if (val.code == item.code) {
+          item.Check = !item.Check;
+          itemData.dot = item.Check;
+        } else {
+          item.Check = false;
+        }
+      });
+      this.$forceUpdate();
+    },
   },
 };
 </script>
@@ -2057,6 +2076,21 @@ export default {
         padding: 3px;
       }
     }
+    .van-sidebar {
+      width: 100px;
+      text-align: center;
+      flex: none;
+    }
+    .treeSelectchildren {
+      .item {
+        display: flex;
+        align-items: center;
+        padding: 5px;
+        .value {
+          margin-left: 15px;
+        }
+      }
+    }
   }
 }
 </style>