Преглед изворни кода

Merge branch 'feature_20241212_同城分销店拆分、分销店对应多个经销商'

# Conflicts:
#	src/store/getters.js
zhujindu пре 11 месеци
родитељ
комит
c289803402

+ 11 - 0
src/api/store.js

@@ -0,0 +1,11 @@
+// 门店相关接口
+import request from '@/utils/request';
+
+// 获取经销商分类
+export function listChainsByCategory(query) {
+  return request({
+    url: 'mobile/store/listChainsByCategory',
+    method: 'get',
+    params: query,
+  });
+}

Разлика између датотеке није приказан због своје велике величине
+ 14 - 0
src/assets/TCFX_0.svg


+ 2 - 0
src/assets/styles/index.css

@@ -76,6 +76,8 @@ div:focus {outline: none;}
 .zpover6 .popper__arrow::after{border-bottom-color: #8F82BC !important;border-top-color: #8F82BC !important;}
 .zpover2  .popper__arrow::after{border-bottom-color: #FFBA13 !important;border-top-color: #FFBA13 !important;}
 .zpover1  .popper__arrow::after{border-bottom-color: #0057ba !important;border-top-color: #0057ba !important;}
+.zpoverStoreztype{background-color: #4a4a4a !important;}
+.zpoverStoreztype  .popper__arrow::after{border-bottom-color: #4a4a4a !important;border-top-color: #4a4a4a !important;}
 .itenHhistory{margin: 10px;border-bottom: 1px solid #eee;}
 .itenHhistory:last-child{border:0}
 .flex1{overflow: hidden;}

+ 1 - 1
src/components/uploadImgVStorec.vue

@@ -45,7 +45,7 @@ export default {
       default: 1,
     },
     imgArr: {
-      type: String,
+      type: [String, Array],
       default: '',
     },
   },

+ 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/store/getters.js

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

+ 10 - 3
src/store/modules/user.js

@@ -1,10 +1,10 @@
-import { getMobileUserInfo } from '@/api/index';
-import { selectAllocationPermission } from '@/api/week';
+import { getMobileUserInfo, getDictOption } from '@/api/index';
 
 const user = {
   state: {
     userInfo: null,
     activaTypeStore: null,
+    storeType: [],
   },
 
   mutations: {
@@ -17,6 +17,9 @@ const user = {
     SET_ASSIGN_FLAG: (state, value) => {
       state.isAssignFlag = value;
     },
+    SET_STORE_TYPE: (state, value) => {
+      state.storeType = value;
+    },
   },
 
   actions: {
@@ -32,7 +35,11 @@ const user = {
             localStorage.setItem('deptLevel', res.data.depts[0].deptLevel);
             localStorage.setItem('userId', res.data.userId);
             localStorage.setItem('deptIds', JSON.stringify(res.data.deptIds));
-            resolve();
+            // 门店类型
+            getDictOption({}, 'sfa_store_type').then((res) => {
+              commit('SET_STORE_TYPE', res.data);
+              resolve();
+            });
           })
           .catch((error) => {
             reject(error);

+ 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;
 }

+ 57 - 49
src/views/componentsTarget/createStoreBJ.vue

@@ -1,4 +1,4 @@
-<!-- 拜访数据(实时) -->
+<!-- 建店布机 -->
 <template>
   <van-row>
     <van-col span="12">
@@ -13,13 +13,13 @@
     </van-col>
     <van-col span="12">
       <p>
-        可控店点数:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.controlledShopMonthAct) }}</span>
       </p>
     </van-col>
     <van-col span="12">
       <p>
-        可控店点数:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.controlledShopYearAct) }}</span>
         <span class="colorbalck" v-if="reportTargetAll.controlledShopYearRate"
           >({{ reportTargetAll.controlledShopYearRate }}%)</span
@@ -29,13 +29,13 @@
     </van-col>
     <van-col span="12">
       <p>
-        分销店点数:
+        <span class="colLabel colLabel_FX">分销店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.allShopMonthAct) }}</span>
       </p>
     </van-col>
     <van-col span="12">
       <p>
-        分销店点数:
+        <span class="colLabel colLabel_FX">分销店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.allShopYearAct) }}</span>
         <span class="colorbalck" v-if="reportTargetAll.allShopYearRate"
           >({{ reportTargetAll.allShopYearRate }}%)</span
@@ -43,75 +43,83 @@
         <span class="colorbalck" v-else>({{ '-' }})</span>
       </p>
     </van-col>
-    <div class="colBack">
+    <div>
       <div class="backLeft back"></div>
       <div class="backRight back"></div>
       <van-col span="12">
         <p>
-          金牌店点数:
+          <span class="colLabel colLabel_JP">金牌店</span>
           <span class="colorbalck">{{ Micrometer(reportTargetAll.goldShopMonthAct) }}</span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          金牌店点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.goldShopYearAct)
-          }}</span
-          ><span class="colorbalck" v-if="reportTargetAll.goldShopYearRate"
-            >({{ reportTargetAll.goldShopYearRate }}%)</span
-          >
+          <span class="colLabel colLabel_JP">金牌店</span>
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.goldShopYearAct) }}</span>
+          <span class="colorbalck" v-if="reportTargetAll.goldShopYearRate">
+            ({{ reportTargetAll.goldShopYearRate }}%)
+          </span>
           <span class="colorbalck" v-else>({{ '-' }})</span>
         </p>
       </van-col>
-      <van-col span="12"
-        ><p>
-          金牌店布机:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.goldShopBjMonthAct)
-          }}</span>
-        </p></van-col
-      >
       <van-col span="12">
         <p>
-          金牌店布机:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.goldShopBjYearAct)
-          }}</span
-          ><span class="colorbalck" v-if="reportTargetAll.goldShopBjYearRate"
-            >({{ reportTargetAll.goldShopBjYearRate }}%)</span
-          >
+          <span class="colLabel colLabel_JPBJ">金牌店布机</span>
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.goldShopBjMonthAct) }}</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          <span class="colLabel colLabel_JPBJ">金牌店布机</span>
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.goldShopBjYearAct) }}</span>
+          <span class="colorbalck" v-if="reportTargetAll.goldShopBjYearRate">
+            ({{ reportTargetAll.goldShopBjYearRate }}%)
+          </span>
           <span class="colorbalck" v-else>({{ '-' }})</span>
         </p>
       </van-col>
-
-      <van-col span="12"
-        ><p>
-          同A店点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcAShopMonthAct)
+      <van-col span="12">
+        <p>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          涂料店:<span class="colorbalck">{{
+            Micrometer(reportTargetAll.tcfxTlShopMonthAct)
           }}</span>
-        </p></van-col
-      >
+        </p>
+      </van-col>
       <van-col span="12">
         <p>
-          同A店点数:<span class="colorbalck">{{ Micrometer(reportTargetAll.tcAShopYearAct) }}</span
-          ><span class="colorbalck" v-if="reportTargetAll.tcAShopYearRate"
-            >({{ reportTargetAll.tcAShopYearRate }}%)</span
-          >
+          涂料店:<span class="colorbalck">{{
+            Micrometer(reportTargetAll.tcfxTlShopYearAct)
+          }}</span>
+          <span class="colorbalck" v-if="reportTargetAll.tcfxTlShopYearRate">
+            ({{ reportTargetAll.tcfxTlShopYearRate }}%)
+          </span>
           <span class="colorbalck" v-else>({{ '-' }})</span>
         </p>
       </van-col>
 
-      <van-col span="12"
-        ><p>
-          同B店点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcBShopMonthAct)
-          }}</span>
-        </p></van-col
-      >
       <van-col span="12">
-        <p>
-          同B店点数:<span class="colorbalck">{{ Micrometer(reportTargetAll.tcBShopYearAct) }}</span
-          ><span class="colorbalck" v-if="reportTargetAll.tcBShopYearRate"
-            >({{ reportTargetAll.tcBShopYearRate }}%)</span
-          >
+        <p style="margin-top: 0">
+          其他店:
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcfxOtherShopMonthAct) }}</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p style="margin-top: 0">
+          其他店:
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcfxOtherShopYearAct) }}</span>
+          <span class="colorbalck" v-if="reportTargetAll.tcfxOtherShopYearRate">
+            ({{ reportTargetAll.tcfxOtherShopYearRate }}%)
+          </span>
           <span class="colorbalck" v-else>({{ '-' }})</span>
         </p>
       </van-col>

+ 22 - 0
src/views/componentsTarget/index.css

@@ -49,4 +49,26 @@ p{
         position: relative;
         z-index: 3;
     }
+}
+.colLabel{
+    display: inline-block;
+    padding: 2px 5px;
+    color: #fff;
+    margin-right: 10px;
+    border-radius:3px;
+}
+.colLabel_KK{
+    background: rgb(235, 104, 119);
+}
+.colLabel_FX{
+    background: rgb(253 120 88);
+}
+.colLabel_JP{
+    background: rgb(241, 183, 137);
+}
+.colLabel_JPBJ{
+    background: rgb(248 215 189);
+}
+.colLabel_TCFX{
+    background: rgb(131 204 202);
 }

+ 56 - 46
src/views/componentsTarget/placeOrder.vue

@@ -1,10 +1,10 @@
-<!-- 拜访数据(实时) -->
+<!-- 下单点数 -->
 <template>
   <van-row>
     <van-col span="24"><span class="leftTitle">本月进度</span></van-col>
     <van-col span="12">
       <p>
-        可控店下单点数:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{
           Micrometer(reportTargetAll.controlledOrderShopMonthAct)
         }}</span>
@@ -12,61 +12,71 @@
     </van-col>
     <van-col span="12">
       <p>
-        可控店下单率:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{ reportTargetAll.controlledShopMonthOrderRate }}%</span>
       </p>
     </van-col>
-    <van-col span="12"
-      ><p>
-        分销店下单点数:<span class="colorbalck">{{
-          Micrometer(reportTargetAll.fxOrderShopMonthAct)
-        }}</span>
-      </p></van-col
-    >
-    <van-col span="12"
-      ><p>
-        分销店下单率:<span class="colorbalck">{{ reportTargetAll.fxShopMonthOrderRate }}%</span>
-      </p></van-col
-    >
-    <div class="colBack">
+    <van-col span="12">
+      <p>
+        <span class="colLabel colLabel_FX">分销店</span>
+        <span class="colorbalck">{{ Micrometer(reportTargetAll.fxOrderShopMonthAct) }}</span>
+      </p>
+    </van-col>
+    <van-col span="12">
+      <p>
+        <span class="colLabel colLabel_FX">分销店</span
+        ><span class="colorbalck">{{ reportTargetAll.fxShopMonthOrderRate }}%</span>
+      </p>
+    </van-col>
+    <div>
       <div class="backLeft back"></div>
       <div class="backRight back"></div>
-      <van-col span="12"
-        ><p>
-          金牌店下单点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.jpOrderShopMonthAct)
-          }}</span>
-        </p></van-col
-      >
-      <van-col span="12"
-        ><p>
-          金牌店下单率:<span class="colorbalck">{{ reportTargetAll.jpShopMonthOrderRate }}%</span>
-        </p></van-col
-      >
-
-      <van-col span="12"
-        ><p>
-          同A店下单点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcAOrderShopMonthAct)
-          }}</span>
-        </p></van-col
-      >
       <van-col span="12">
         <p>
-          同A店下单率:<span class="colorbalck">{{ reportTargetAll.tcAShopMonthOrderRate }}%</span>
+          <span class="colLabel colLabel_JP">金牌店</span>
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.jpOrderShopMonthAct) }}</span>
         </p>
       </van-col>
-
-      <van-col span="12"
-        ><p>
-          同B店下单点数:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcBOrderShopMonthAct)
-          }}</span>
-        </p></van-col
-      >
       <van-col span="12">
         <p>
-          同B店下单率:<span class="colorbalck">{{ reportTargetAll.tcBShopMonthOrderRate }}%</span>
+          <span class="colLabel colLabel_JP">金牌店</span>
+          <span class="colorbalck"> {{ reportTargetAll.jpShopMonthOrderRate }}% </span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          涂料店:
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcfxTlOrderShopMonthAct) }}</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p>
+          涂料店:
+          <span class="colorbalck">{{ reportTargetAll.tcfxTlShopMonthOrderRate }}%</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p style="margin-top: 0">
+          其他店:
+          <span class="colorbalck">{{
+            Micrometer(reportTargetAll.tcfxOtherOrderShopMonthAct)
+          }}</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p style="margin-top: 0">
+          其他店:
+          <span class="colorbalck">{{ reportTargetAll.tcfxOtherShopMonthOrderRate }}%</span>
         </p>
       </van-col>
     </div>

+ 35 - 30
src/views/componentsTarget/visitedRealTime.vue

@@ -44,12 +44,6 @@
         整体拜访率:<span class="colorbalck">{{ reportTargetAll.allVisitMonthRate }}%</span>
       </p></van-col
     >
-    <!--            <van-col v-if="powerGrade==2&&!JZQuota&&!GZdata" span="24"><p>未分配点数:<span-->
-    <!--                class="colorbalck">{{ reportTargetAll.undistrNum }}</span></p></van-col>-->
-    <!--            <van-col v-if="powerGrade==2&&!JZQuota&&!GZdata" span="24"><p>已覆盖未排线点数:<span-->
-    <!--                class="colorbalck">{{ reportTargetAll.coverNotPlan }}</span></p></van-col>-->
-    <!--            <van-col span="24" v-if="powerGrade==2"><p>未挂接销售门店数:<span class="colorbalck">{{reportTargetAll.customerYearTarget}}%</span></p></van-col>-->
-    <!--            <van-col span="24" v-if="powerGrade==2"><p>已挂接销售,但不在拜访计划中的门店数量:<span class="colorbalck">{{reportTargetAll.customerYearTarget}}%</span></p></van-col>-->
   </van-row>
   <!-- 其他 -->
   <van-row v-else>
@@ -61,73 +55,84 @@
     </van-col>
     <van-col span="12">
       <p>
-        可控店:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.controlledShopVisitDayNum) }}</span>
       </p>
     </van-col>
     <van-col span="12">
       <p>
-        <span style="font-weight: 600">本月</span>可控店:
+        <span class="colLabel colLabel_KK">可控店</span>
         <span class="colorbalck">{{
           Micrometer(reportTargetAll.controlledShopVisitMonthNum)
         }}</span>
         <span class="colorbalck">({{ reportTargetAll.controlledShopVisitMonthRate }}%)</span>
       </p>
     </van-col>
-    <van-col span="12"
-      ><p>
-        分销店:<span class="colorbalck">{{ Micrometer(reportTargetAll.fxShopVisitDayNum) }}</span>
-      </p></van-col
-    >
-    <van-col span="12"
-      ><p>
-        <span style="font-weight: 600">本月</span>分销店:
+    <van-col span="12">
+      <p>
+        <span class="colLabel colLabel_FX">分销店</span>
+        <span class="colorbalck">{{ Micrometer(reportTargetAll.fxShopVisitDayNum) }}</span>
+      </p>
+    </van-col>
+    <van-col span="12">
+      <p>
+        <span class="colLabel colLabel_FX">分销店</span>
         <span class="colorbalck">{{ Micrometer(reportTargetAll.fxShopVisitMonthNum) }}</span>
         <span class="colorbalck"> ({{ reportTargetAll.fxShopVisitMonthRate }}%) </span>
       </p>
     </van-col>
-    <div class="colBack">
+    <div>
       <div class="backLeft back"></div>
       <div class="backRight back"></div>
       <van-col span="12">
         <p>
-          金牌店:
+          <span class="colLabel colLabel_JP">金牌店</span>
           <span class="colorbalck">{{ Micrometer(reportTargetAll.jpShopVisitDayNum) }}</span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          <span style="font-weight: 600">本月</span>金牌店:
+          <span class="colLabel colLabel_JP">金牌店</span>
           <span class="colorbalck">{{ Micrometer(reportTargetAll.jpShopVisitMonthNum) }}</span>
           <span class="colorbalck"> ({{ reportTargetAll.jpShopVisitMonthRate }}%) </span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          同A店:
-          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcAShopVisitDayNum) }}</span>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          <span style="font-weight: 600">近2月</span>同A店:
-          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcAShopVisitMonthNum) }}</span>
-          <span class="colorbalck"> ({{ reportTargetAll.tcAShopVisitMonthRate }}%) </span>
+          <span class="colLabel colLabel_TCFX">同城分销</span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          同B店:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcBShopVisitDayNum)
-          }}</span>
+          涂料店:
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcfxTlShopVisitDayNum) }}</span>
         </p>
       </van-col>
       <van-col span="12">
         <p>
-          <span style="font-weight: 600">近3月</span>同B店:<span class="colorbalck">{{
-            Micrometer(reportTargetAll.tcBShopVisitMonthNum)
+          <span style="font-weight: 600">近2月</span>涂料店:
+          <span class="colorbalck">{{ Micrometer(reportTargetAll.tcfxTlShopVisitMonthNum) }}</span>
+          <span class="colorbalck"> ({{ reportTargetAll.tcfxTlShopVisitMonthRate }}%) </span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p style="margin-top: 0">
+          其他店:<span class="colorbalck">{{
+            Micrometer(reportTargetAll.tcfxOtherShopVisitDayNum)
+          }}</span>
+        </p>
+      </van-col>
+      <van-col span="12">
+        <p style="margin-top: 0">
+          <span style="font-weight: 600">近3月</span>其他店:<span class="colorbalck">{{
+            Micrometer(reportTargetAll.tcfxOtherShopVisitMonthNum)
           }}</span>
-          <span class="colorbalck"> ({{ reportTargetAll.tcBShopVisitMonthRate }}%) </span>
+          <span class="colorbalck"> ({{ reportTargetAll.tcfxOtherShopVisitMonthRate }}%) </span>
         </p>
       </van-col>
     </div>

+ 41 - 18
src/views/deviceOutside/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor deviceOutside">
     <div class="navBarTOP">
       <!--        顶部条-->
       <van-nav-bar class="navBar" title="计划外">
@@ -244,7 +244,34 @@
                   :src="sbpmdh"
                   @click="linkapp(item)" />
               </div>
-              <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+              <!-- 分销店 -->
+              <template
+                v-if="
+                  item.sfaStoreType &&
+                  item.sfaStoreType.type == 'fxd' &&
+                  item.sfaStoreChainsContactList
+                ">
+                <div class="info" v-if="typeShow">
+                  经销商:
+                  <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
+                    <el-popover
+                      popper-class="zpover zpoverStoreztype"
+                      placement="bottom-start"
+                      trigger="click">
+                      <div>
+                        <div>{{ item.chainCode }}</div>
+                        <div>{{ item.chainName }}</div>
+                      </div>
+                      <div slot="reference" :key="index">
+                        {{ item.categoryDescribe }}
+                      </div>
+                    </el-popover>
+                  </div>
+                </div>
+              </template>
+              <template v-else>
+                <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+              </template>
               <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
               <div class="info" v-if="item.storeLonExist">
                 距离:{{ Micrometer(item.distance) }}m
@@ -1021,11 +1048,7 @@ export default {
       }
       var that = this;
       this.disabled = true;
-      let loading2 = this.$toast.loading({
-        duration: 0,
-        message: '加载中...',
-        forbidClick: true,
-      });
+      this.toastLoading(0, '加载中...', true);
       getUserOrgStoreList({
         lat: that.lat,
         lon: that.lon,
@@ -1038,8 +1061,8 @@ export default {
         genDate: this.genDate,
       }).then((res) => {
         this.disabled = false;
+        this.toastLoading().clear();
         if (res.code == 200) {
-          loading2.clear();
           this.loading = false;
           if (this.pageNum == '1') {
             this.list = [];
@@ -1277,9 +1300,6 @@ export default {
         if (val.lat == '' || val.lat == null) {
           this.lat = location.lat;
           this.lon = location.lon;
-        } else {
-          this.lat = val.lat;
-          this.lon = val.lon;
         }
         // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
         let PointSumval = this.twoPointSum(
@@ -1561,9 +1581,6 @@ export default {
                         if (val.lat == '' || val.lat == null) {
                           that.lat = location.lat;
                           that.lon = location.lon;
-                        } else {
-                          that.lat = val.lat;
-                          that.lon = val.lon;
                         }
                         let PointSum = that
                           .twoPointSum(that.lat, that.lon, location.lat, location.lon)
@@ -1811,9 +1828,6 @@ export default {
                           if (val.lat == '' || val.lat == null) {
                             that.lat = location.lat;
                             that.lon = location.lon;
-                          } else {
-                            that.lat = val.lat;
-                            that.lon = val.lon;
                           }
                           let PointSum = that
                             .twoPointSum(that.lat, that.lon, location.lat, location.lon)
@@ -2282,7 +2296,7 @@ export default {
   font-weight: 600;
 }
 </style>
-<style>
+<style lang="scss">
 .van-tabs__nav--card .van-tab.van-tab--active {
   background-color: #0057ba !important;
 }
@@ -2392,4 +2406,13 @@ export default {
 .textsize {
   font-size: 14px;
 }
+.deviceOutside {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
+}
 </style>

+ 92 - 19
src/views/deviceOutside/rangeStore.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="rangeStore">
     <div id="container"></div>
     <div class="navBarTOP">
       <van-nav-bar class="navBar" title="附近客户信息" left-arrow @click-left="onClickLeft">
@@ -14,7 +14,7 @@
         direction="horizontal"
         class="mapCheckbox"
         @change="selectMapIco">
-        <van-grid :column-num="7" class="icoImgMAP">
+        <van-grid :column-num="5" class="icoImgMAP">
           <van-grid-item>
             <div slot="text" class="titleico">
               <van-checkbox name="jinpai_ccm">
@@ -35,14 +35,41 @@
           </van-grid-item>
           <van-grid-item>
             <div slot="text" class="titleico">
-              <van-checkbox name="tcfx_A">
+              <van-checkbox name="tcfx_tl">
                 <van-icon :name="storeAmap" size="32" />
-                <p class="p">同城</p>
-                <p>A店</p>
+                <p class="p">非金牌</p>
+                <p>涂料店</p>
               </van-checkbox>
             </div>
           </van-grid-item>
           <van-grid-item>
+            <div slot="text" class="titleico">
+              <van-checkbox name="tcfx_cw">
+                <van-icon :name="storeBCZmap" size="32" />
+                <p class="p">非金牌</p>
+                <p>厨卫店</p>
+              </van-checkbox>
+            </div>
+          </van-grid-item>
+          <van-grid-item>
+            <div slot="text" class="titleico">
+              <van-checkbox name="qita">
+                <van-icon :name="othermap" size="32" />
+                <p class="p">非金牌</p>
+                <p>其他店</p>
+              </van-checkbox>
+            </div>
+          </van-grid-item>
+          <!-- <van-grid-item v-if="filterTCFX(item)" v-for="(item, index) in storeType" :key="index">
+            <div slot="text" class="titleico">
+              {{ index }}
+              <van-checkbox :name="'TCFX_' + index" v-if="index == 0">
+                <van-icon :name="require('@/assets/' + 'TCFX_' + index)" size="32" />
+                <p class="p">{{ item.dictLabel }}</p>
+              </van-checkbox>
+            </div>
+          </van-grid-item> -->
+          <!-- <van-grid-item>
             <div slot="text" class="titleico">
               <van-checkbox name="tcfx_B_fs">
                 <van-icon :name="storeBFSmap" size="32" />
@@ -66,15 +93,7 @@
                 <p>水泥店</p>
               </van-checkbox>
             </div>
-          </van-grid-item>
-          <van-grid-item>
-            <div slot="text" class="titleico">
-              <van-checkbox name="qita">
-                <van-icon :name="othermap" size="32" />
-                <p class="p">其他</p>
-              </van-checkbox>
-            </div>
-          </van-grid-item>
+          </van-grid-item> -->
         </van-grid>
       </van-checkbox-group>
       <div class="searchDiv">
@@ -358,7 +377,34 @@
                 >{{ info.telephone }}</a
               ><van-icon name="phone" size="16" color="#1989fa" />
             </p>
-            <p class="text">经销商:{{ info.chainName }}</p>
+            <!-- 分销店 -->
+            <template
+              v-if="
+                info.sfaStoreType &&
+                info.sfaStoreType.type == 'fxd' &&
+                info.sfaStoreChainsContactList
+              ">
+              <div class="text">
+                经销商:
+                <div class="TCFXListItem" v-for="(item, index) in info.sfaStoreChainsContactList">
+                  <el-popover
+                    popper-class="zpover zpoverStoreztype"
+                    placement="bottom-start"
+                    trigger="click">
+                    <div>
+                      <div>{{ item.chainCode }}</div>
+                      <div>{{ item.chainName }}</div>
+                    </div>
+                    <div slot="reference" :key="index">
+                      {{ item.categoryDescribe }}
+                    </div>
+                  </el-popover>
+                </div>
+              </div>
+            </template>
+            <template v-else>
+              <p class="text">经销商:{{ info.chainName }}</p>
+            </template>
             <p class="text">地址:{{ info.addressLine }}</p>
             <div class="text" style="height: 24px">
               <!--          <van-button @click="linkapp(info)" style="float: right;margin-top: -36px;" type="info" size="small" plain  class="centerBtn centerBtn1">-->
@@ -607,6 +653,7 @@ import check from './../../assets/check.svg';
 import { topStore } from '@/api/inventory';
 import { gcj02BD } from '@/utils';
 import { checkStoreAddressByStoreCode } from '@/api/visitstore';
+import { mapState } from 'vuex';
 export default {
   name: 'rangeStore',
   components: {
@@ -617,6 +664,11 @@ export default {
     BmInfoWindow,
     BmGeolocation,
   },
+  computed: {
+    ...mapState({
+      storeType: (state) => state.user.storeType,
+    }),
+  },
   data() {
     return {
       moreTypeShow: false,
@@ -1048,42 +1100,49 @@ export default {
     },
     mpFn(row, tyle) {
       if (row.iconName == 'qita') {
+        // 非金牌-其他
         if (tyle == 1) {
           this.checkIco = otheractive;
         } else {
           return this.other;
         }
-      } else if (row.iconName == 'tcfx_A') {
+      } else if (row.iconName == 'tcfx_tl') {
+        // 非金牌-涂料店
         if (tyle == 1) {
           this.checkIco = storeAactive;
         } else {
           return this.storeA;
         }
-      } else if (row.iconName == 'tcfx_B_cz') {
+      } else if (row.iconName == 'tcfx_cw') {
+        // 非金牌-厨卫
         if (tyle == 1) {
           this.checkIco = storeBCZactive;
         } else {
           return this.storeBCZ;
         }
       } else if (row.iconName == 'tcfx_B_fs') {
+        // 同城分销-瓷砖店
         if (tyle == 1) {
           this.checkIco = storeBFSactive;
         } else {
           return this.storeBFS;
         }
       } else if (row.iconName == 'tcfx_B_qt') {
+        // 同城分销-黄沙-水泥
         if (tyle == 1) {
           this.checkIco = storeBOtheractive;
         } else {
           return this.storeBOther;
         }
       } else if (row.iconName == 'jinpai') {
+        // 无布机-金牌店
         if (tyle == 1) {
           this.checkIco = storeGoldactive;
         } else {
           return this.storeGold;
         }
-      } else if (row.iconName == 'jinpai_ccm') {
+      } else if (row.iconName == '有布机') {
+        // 有布机-金牌店
         if (tyle == 1) {
           this.checkIco = storeCCMactive;
         } else {
@@ -2005,6 +2064,11 @@ export default {
         });
       }
     },
+    filterTCFX(item) {
+      if (!item.remark) return false;
+      let remark = JSON.parse(item.remark);
+      return remark.tcfx ? true : false;
+    },
   },
 };
 </script>
@@ -2118,7 +2182,7 @@ export default {
   height: 26px;
 }
 </style>
-<style>
+<style lang="scss">
 .van-tabs__nav--card .van-tab.van-tab--active {
   background-color: #0057ba !important;
 }
@@ -2227,4 +2291,13 @@ export default {
 .textsize {
   font-size: 14px;
 }
+.rangeStore {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
+}
 </style>

+ 41 - 31
src/views/deviceOutside/topStore.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor topStore">
     <div class="navBarTOP">
       <!--        顶部条-->
       <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
@@ -183,24 +183,6 @@
                         <van-icon :name="order60" size="26" />
                       </div>
                     </el-popover>
-                    <!--                  <el-popover-->
-                    <!--                      popper-class="zpover"-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="金牌店近30天未下单">-->
-
-                    <!--                    <div v-if="cstype==4" class="visitStoreIco" style="background-color: #fff;" slot="reference"><van-icon :name="order" size="26" /></div>-->
-                    <!--                  </el-popover>-->
-                    <!--                  <el-popover-->
-                    <!--                      popper-class="zpover zpover99"-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="本店没参加碰瓷专案">-->
-                    <!--                    <div  class="visitStoreIco"  v-if="cstype==2"  slot="reference" style="background-color: white"><van-icon :name="nocj" size="26" /></div>-->
-                    <!--                  </el-popover>-->
-
                     <el-popover
                       popper-class="zpover"
                       placement="bottom"
@@ -221,7 +203,6 @@
                       width="200"
                       trigger="click"
                       content="本店本月进过超好贴">
-                      <!--         v-if="item.storeLabels.zyssl"        -->
                       <div
                         v-if="item.storeLabels.chtczj"
                         class="visitStoreIco"
@@ -230,15 +211,6 @@
                       </div>
                     </el-popover>
-                    <!--                  <el-popover-->
-                    <!--                      placement="bottom"-->
-                    <!--                      width="200"-->
-                    <!--                      popper-class="zpover zpover2"-->
-                    <!--                      trigger="click"-->
-                    <!--                      content="本月未被拜访的信息">-->
-                    <!--                    <div v-if="item.storeLabels.noVisit" class="visitStoreIco" style="background-color: #fff" slot="reference">-->
-                    <!--                      <van-icon :name="visitTimess" size="26" /></div>-->
-                    <!--                  </el-popover>-->
                     <el-popover
                       placement="bottom"
                       popper-class="zpover zpover1 zpover1sb"
@@ -298,7 +270,36 @@
                   /></a>
                 </div>
                 <div class="info">地址:{{ item.addressLine }}</div>
-                <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+                <!-- 分销店 -->
+                <template
+                  v-if="
+                    item.sfaStoreType &&
+                    item.sfaStoreType.type == 'fxd' &&
+                    item.sfaStoreChainsContactList
+                  ">
+                  <div class="info" v-if="typeShow">
+                    经销商:
+                    <div
+                      class="TCFXListItem"
+                      v-for="(item, index) in item.sfaStoreChainsContactList">
+                      <el-popover
+                        popper-class="zpover zpoverStoreztype"
+                        placement="bottom-start"
+                        trigger="click">
+                        <div>
+                          <div>{{ item.chainCode }}</div>
+                          <div>{{ item.chainName }}</div>
+                        </div>
+                        <div slot="reference" :key="index">
+                          {{ item.categoryDescribe }}
+                        </div>
+                      </el-popover>
+                    </div>
+                  </div>
+                </template>
+                <template v-else>
+                  <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+                </template>
                 <div class="info" style="color: #444">
                   门店销额(近三个月):¥{{ Micrometer(item.rolling3monthAMT) }}元
                   <span
@@ -2738,7 +2739,7 @@ export default {
   font-weight: 600;
 }
 </style>
-<style>
+<style lang="scss">
 .zpover99 {
   background-color: #00afff !important;
 }
@@ -2848,4 +2849,13 @@ export default {
 .visitStoreIcos {
   /*background: url("./../../assets/order1.png") center;*/
 }
+.topStore {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
+}
 </style>

+ 38 - 280
src/views/deviceWithin/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor deviceWithin">
     <div class="navBarTOP">
       <!--        顶部条-->
       <van-nav-bar class="navBar" title="计划内"> </van-nav-bar>
@@ -250,7 +250,34 @@
                 :src="sbpmdh"
                 @click="linkapp(item)" />
             </div>
-            <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+            <!-- 分销店 -->
+            <template
+              v-if="
+                item.sfaStoreType &&
+                item.sfaStoreType.type == 'fxd' &&
+                item.sfaStoreChainsContactList
+              ">
+              <div class="info" v-if="typeShow">
+                经销商:
+                <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
+                  <el-popover
+                    popper-class="zpover zpoverStoreztype"
+                    placement="bottom-start"
+                    trigger="click">
+                    <div>
+                      <div>{{ item.chainCode }}</div>
+                      <div>{{ item.chainName }}</div>
+                    </div>
+                    <div slot="reference" :key="index">
+                      {{ item.categoryDescribe }}
+                    </div>
+                  </el-popover>
+                </div>
+              </div>
+            </template>
+            <template v-else>
+              <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
+            </template>
             <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
             <div class="info" v-if="item.storeLonExist">距离:{{ Micrometer(item.distance) }}m</div>
           </div>
@@ -426,34 +453,9 @@ export default {
   },
   watch: {
     $route(to, from) {
-      // this.getMonth();
-      // this.storeName = localStorage.getItem("deviveStoreName");
       if (from.path == '/deviceWithin/index' && to.path == '/storeVisitpage') {
         localStorage.setItem('startTime', new Date());
       }
-      // if (from.path == "/abnormalVisit" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      //   this.$dialog.close();
-      // }
-      // if (from.path == "/home" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      //   // localStorage.removeItem("startTime")
-      // }
-      // if (from.path == "/outsidelist/index" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeVisitpage" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/topStore" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeDetail" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
-      // if (from.path == "/storeEdit" && to.path == "/deviceWithin/index") {
-      //   this.getUserInPlanList();
-      // }
     },
   },
   activated() {
@@ -466,15 +468,6 @@ export default {
       this.getUserInPlanList();
     });
   },
-  // created() {
-  //   let that = this;
-  //   that.query = that.$route.query;
-  //   this.timeData = this.parseTime(new Date(), "{yy}-{mm}-{dd}");
-  //   this.storeName = localStorage.getItem("deviveStoreName");
-  //   localStorage.removeItem("visitId");
-  //   this.getUserInPlanList();
-  //   this.getMonth();
-  // },
   methods: {
     linkapp(val) {
       var poind = this.gcj02BD(val.lat, val.lon);
@@ -801,7 +794,6 @@ export default {
                     this.lon = TXisBD.lon;
                     localStorage.setItem('lat', this.lat);
                     localStorage.setItem('lon', this.lon);
-                    // var location = this.CJ02BD(res.latitude, res.longitude);
                     this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
                   })
                   .catch((error) => {
@@ -809,169 +801,6 @@ export default {
                       message: error,
                     });
                   });
-                // let loading1 = this.$toast.loading({
-                //   duration: 0,
-                //   message: '加载中...',
-                //   forbidClick: true,
-                // });
-                // let url = window.location.href;
-                // let wx = this.wx;
-                // 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(() => {});
-                //           } else {
-                //             clearInterval(times);
-                //           }
-                //         }
-                //       }, 1000);
-                //       qiyeData = response.data.data;
-                //       wx.config({
-                //         beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-                //         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                //         appId: qiyeData.appId, // 必填,企业微信的corpID
-                //         timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-                //         nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-                //         signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-                //         jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-                //       });
-                //       wx.ready(() => {
-                //         wx.getLocation({
-                //           type: 'gcj02',
-                //           success: (res) => {
-                //             flat = false;
-                //             var location = this.CJ02BD(res.latitude, res.longitude);
-                //             this.location = location;
-                //             checkStoreAddressByStoreCode({
-                //               storeCode: val.storeCode,
-                //               lon: location.lon,
-                //               lat: location.lat,
-                //             }).then((response) => {
-                //               loading1.clear();
-                //               if (val.lat == '' || val.lat == null) {
-                //                 that.lat = location.lat;
-                //                 that.lon = location.lon;
-                //               } else {
-                //                 that.lat = val.lat;
-                //                 that.lon = val.lon;
-                //               }
-                //               let PointSum = that
-                //                 .twoPointSum(that.lat, that.lon, location.lat, location.lon)
-                //                 .toFixed(2);
-                //               let PointSumval = that
-                //                 .twoPointSum(location.lat, location.lon, location.lat, location.lon)
-                //                 .toFixed(2);
-                //               // GZ:工装店铺 直接进入拜访
-                //               if (localStorage.getItem('postType') == 'GZ') {
-                //                 localStorage.setItem('startTime', new Date());
-                //                 localStorage.setItem('ORGName', val.deptName);
-                //                 localStorage.setItem('chainNameR', val.storeName);
-                //                 this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-                //                 return;
-                //               }
-                //               // 门店编码校验门店地址不通过
-                //               if (response.code != 200) {
-                //                 // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-                //                 if (response.data.updateAddress == 0) {
-                //                   // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
-                //                   this.$dialog
-                //                     .confirm({
-                //                       confirmButtonText: '确定拜访',
-                //                       cancelButtonText: '取消拜访',
-                //                       title: '系统提示',
-                //                       message:
-                //                         '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
-                //                       closeOnClickOverlay: true,
-                //                     })
-                //                     .then(() => {
-                //                       this.toSuishenbangOutstoreVisit(
-                //                         res,
-                //                         val,
-                //                         location,
-                //                         PointSumval
-                //                       );
-                //                     });
-                //                 } else if (response.data.updateAddress == 1) {
-                //                   // 同城AB+金牌,去修改地址
-                //                   // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
-                //                   if (!response.data.addressUpdateTimesOver) {
-                //                     this.$dialog
-                //                       .confirm({
-                //                         title: '系统提示',
-                //                         message: response.msg + '请立即修改后再拜访',
-                //                         messageAlign: 'left',
-                //                         confirmButtonText: '立即修改',
-                //                         cancelButtonText: '取消',
-                //                       })
-                //                       .then(() => {
-                //                         this.$router.push({
-                //                           path: '/storeDetail',
-                //                           query: {
-                //                             id: val.storeId,
-                //                             type: 'address',
-                //                             storeAddressId: val.storeAddressId,
-                //                           },
-                //                         });
-                //                       });
-                //                   } else {
-                //                     this.$dialog.confirm({
-                //                       title: '系统提示',
-                //                       message: '已经达到最大修改次数',
-                //                       messageAlign: 'left',
-                //                       confirmButtonText: '确定',
-                //                     });
-                //                   }
-                //                 } else if (response.data.updateAddress == 2) {
-                //                   // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
-                //                   this.resetCoord(res, val, location, PointSumval);
-                //                   return;
-                //                 }
-                //               } else {
-                //                 // 门店编码校验门店地址通过 进入拜访
-                //                 this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-                //               }
-                //             });
-                //           },
-                //           fail: function () {
-                //             loading1.clear();
-                //             that.$dialog.alert({
-                //               message: 'GPS未开启',
-                //             });
-                //           },
-                //         });
-                //       });
-                //       wx.error(function (res) {
-                //         loading1.clear();
-                //         that.$dialog
-                //           .alert({
-                //             message: '定位失败,请开启企微定位权限',
-                //           })
-                //           .then(() => {});
-                //       });
-                //     } else {
-                //       loading1.clear();
-                //     }
-                //   });
               }
             }
           }
@@ -993,9 +822,6 @@ export default {
         if (val.lat == '' || val.lat == null) {
           this.lat = location.lat;
           this.lon = location.lon;
-        } else {
-          this.lat = val.lat;
-          this.lon = val.lon;
         }
         // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
         let PointSumval = this.twoPointSum(
@@ -1277,9 +1103,6 @@ export default {
                         if (val.lat == '' || val.lat == null) {
                           that.lat = location.lat;
                           that.lon = location.lon;
-                        } else {
-                          that.lat = val.lat;
-                          that.lon = val.lon;
                         }
                         let PointSum = that
                           .twoPointSum(that.lat, that.lon, location.lat, location.lon)
@@ -1521,9 +1344,6 @@ export default {
                           if (val.lat == '' || val.lat == null) {
                             that.lat = location.lat;
                             that.lon = location.lon;
-                          } else {
-                            that.lat = val.lat;
-                            that.lon = val.lon;
                           }
                           let PointSum = that
                             .twoPointSum(that.lat, that.lon, location.lat, location.lon)
@@ -1654,77 +1474,6 @@ export default {
       this.$router.push({
         path: '/topStore',
       });
-      // let loading1 = this.$toast.loading({
-      //   duration: 0,
-      //   message: '加载中...',
-      //   forbidClick: true,
-      // });
-      // let url = window.location.href;
-      // let wx = this.wx;
-      // var 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 = 5;
-      //       var flat = true;
-      //       var times = setInterval(() => {
-      //         this.cont--;
-      //         if (this.cont == '0') {
-      //           if (flat) {
-      //             loading1.clear();
-      //             clearInterval(times);
-      //             that.$dialog.alert({
-      //               message: '定位失败,请开启企微定位权限',
-      //             });
-      //           } else {
-      //             clearInterval(times);
-      //           }
-      //         }
-      //       }, 1000);
-      //       qiyeData = response.data.data;
-      //       wx.config({
-      //         beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-      //         debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-      //         appId: qiyeData.appId, // 必填,企业微信的corpID
-      //         timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-      //         nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-      //         signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-      //         jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-      //       });
-      //       wx.ready(function () {
-      //         wx.getLocation({
-      //           type: 'gcj02',
-      //           success: function (res) {
-      //             flat = false;
-      //             loading1.clear();
-      //             that.$router.push({
-      //               path: '/topStore',
-      //             });
-      //           },
-      //           fail: function () {
-      //             loading1.clear();
-      //             that.$dialog.alert({
-      //               message: 'GPS未开启',
-      //             });
-      //           },
-      //         });
-      //       });
-      //       wx.error(function (res) {
-      //         loading1.clear();
-      //         that.$dialog.alert({
-      //           message: '定位失败,请开启企微定位权限',
-      //         });
-      //       });
-      //     }
-      //   });
     },
     formLink() {
       this.$router.push('/storeVisit/questions');
@@ -1920,4 +1669,13 @@ export default {
   font-size: 16px;
   font-weight: 600;
 }
+.deviceWithin {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
+}
 </style>

+ 372 - 301
src/views/historicalVisit/historAllVisit.vue

@@ -1,47 +1,58 @@
 <template>
-  <div class="bgcolor">
+  <div class="bgcolor historAllVisit">
     <div class="navBarTOP">
       <!--        顶部条-->
-      <van-nav-bar
-          class="navBar"
-          title="历史拜访"
-          left-arrow
-          @click-left="onClickLeft"
-      />
+      <van-nav-bar class="navBar" title="历史拜访" left-arrow @click-left="onClickLeft" />
       <div class="searcTime">
         <van-row class="serchInput">
           <van-col span="12">
-            <van-cell class="monthNow selectcell" :title="companyName"  is-link arrow-direction="down" @click="regionClick"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="companyName"
+              is-link
+              arrow-direction="down"
+              @click="regionClick" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="regionName"  is-link @click="SalesRegionClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="regionName"
+              is-link
+              @click="SalesRegionClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="deptName" is-link @click="SalesDepartmentClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="deptName"
+              is-link
+              @click="SalesDepartmentClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
-            <van-cell  class="monthNow selectcell"  :title="userName" is-link @click="StaffClick" arrow-direction="down"/>
+            <van-cell
+              class="monthNow selectcell"
+              :title="userName"
+              is-link
+              @click="StaffClick"
+              arrow-direction="down" />
           </van-col>
           <van-col span="12">
             <div class="monthNow" @click="startTimeshow = true">
               <span class="month">{{ startTime }}</span>
-              <van-icon class="CalendarIcon" :name="timeico"/>
+              <van-icon class="CalendarIcon" :name="timeico" />
             </div>
           </van-col>
           <van-col span="12">
             <div class="monthNow" @click="endTimeshow = true">
               <span class="month">{{ endTime }}</span>
-              <van-icon class="CalendarIcon" :name="timeico"/>
+              <van-icon class="CalendarIcon" :name="timeico" />
             </div>
           </van-col>
         </van-row>
       </div>
       <div class="searchDiv">
-        <van-search
-            v-model="storeName"
-            show-action
-            placeholder="搜索名称/编号/地址/拜访人"
-        >
+        <van-search v-model="storeName" show-action placeholder="搜索名称/编号/地址/拜访人">
           <template #action>
             <div @click="onSearch">搜索</div>
           </template>
@@ -50,125 +61,170 @@
       <div class="lineGrey"></div>
     </div>
     <!--        主体内容-->
-    <div class="container" style="margin-top: 262px;">
+    <div class="container" style="margin-top: 262px">
       <van-list
-      class="myList1"
-      v-model="loading"
-      :finished="finished"
-      finished-text="没有更多了"
-      @load="onLoad"
-      >
-        <div v-if="list.length>0">
-          <div class="cellcontent" v-for="(item,index) in list" :key="index">
-            <van-cell @click="detilsFn(item)">
-              <div class="card" style="position: relative;">
-                <span v-if="item.visitSource==2" class="stateAbnormal">异常拜访</span>
+        class="myList1"
+        v-model="loading"
+        :finished="finished"
+        finished-text="没有更多了"
+        @load="onLoad">
+        <div v-if="list.length > 0">
+          <div class="cellcontent" v-for="(item, index) in list" :key="index">
+            <van-cell>
+              <div class="card" style="position: relative" @click="detilsFn(item)">
+                <span v-if="item.visitSource == 2" class="stateAbnormal">异常拜访</span>
                 <!--<span v-if="item.visitModel==5" class="state">偏差过大</span>-->
-                <span v-if="item.visitSource==1" class="state">正常拜访</span>
-                <div class="title"><span>{{ item.storeName }}</span>
-                  (<span style="color:#0057ba">{{
-                      item.storeCode
-                    }}</span>)
+                <span v-if="item.visitSource == 1" class="state">正常拜访</span>
+                <div class="title">
+                  <span>{{ item.storeName }}</span> (<span style="color: #0057ba">{{
+                    item.storeCode
+                  }}</span
+                  >)
                 </div>
                 <div class="info">拜访人:{{ item.nickName }}</div>
-                <div class="info">拜访时间:{{ item.visitsTime }}
-                  <span class="textRight" v-if="item.status=='1'&&item.taskId==null">审批中</span>
-                  <span class="textRight" v-if="item.status=='1'&&item.taskId!=null" style="color:red;">退回修改</span>
-                  <span  class="textRight" style="color: #07c160;" v-if="item.status==2">审批完成</span>
-                  <span class="textRight" v-if="item.status=='3'" style="color:red;">拒绝</span></div>
+                <div class="info">
+                  拜访时间:{{ item.visitsTime }}
+                  <span class="textRight" v-if="item.status == '1' && item.taskId == null"
+                    >审批中</span
+                  >
+                  <span
+                    class="textRight"
+                    v-if="item.status == '1' && item.taskId != null"
+                    style="color: red"
+                    >退回修改</span
+                  >
+                  <span class="textRight" style="color: #07c160" v-if="item.status == 2"
+                    >审批完成</span
+                  >
+                  <span class="textRight" v-if="item.status == '3'" style="color: red">拒绝</span>
+                </div>
                 <div class="info" v-if="item.dwellTime">拜访时长:{{ item.dwellTime }}</div>
                 <div class="info">地址:{{ item.addressLine }}</div>
-                <div class="info">经销商:{{ item.chainName }}</div>
               </div>
+              <!-- 分销店 -->
+              <template
+                v-if="
+                  item.sfaStoreType &&
+                  item.sfaStoreType.type == 'fxd' &&
+                  item.sfaStoreChainsContactList
+                ">
+                <div class="info">
+                  经销商:
+                  <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
+                    <el-popover
+                      popper-class="zpover zpoverStoreztype"
+                      placement="bottom-start"
+                      trigger="click">
+                      <div>
+                        <div>{{ item.chainCode }}</div>
+                        <div>{{ item.chainName }}</div>
+                      </div>
+                      <div slot="reference" :key="index">
+                        {{ item.categoryDescribe }}
+                      </div>
+                    </el-popover>
+                  </div>
+                </div>
+              </template>
+              <template v-else>
+                <div class="info">经销商:{{ item.chainName }}</div>
+              </template>
             </van-cell>
             <div class="lineGrey"></div>
           </div>
-       </div>
+        </div>
       </van-list>
-<!--      <p style="text-align: center;color: #ccc;font-size: 12px;" v-if="list.length!=0">&#45;&#45;已经到底了&#45;&#45;</p>-->
-<!--      <van-empty description="&#45;&#45;已经到底了&#45;&#45;" v-if="list.length==0"/>-->
+      <!--      <p style="text-align: center;color: #ccc;font-size: 12px;" v-if="list.length!=0">&#45;&#45;已经到底了&#45;&#45;</p>-->
+      <!--      <van-empty description="&#45;&#45;已经到底了&#45;&#45;" v-if="list.length==0"/>-->
     </div>
     <van-popup v-model="startTimeshow" position="bottom" :style="{ height: '30%' }">
       <van-datetime-picker
-          v-model="startcurrentDate"
-          type="date"
-          title="开始日期"
-          :min-date="minDate"
-          :max-date="startmaxDate"
-          @confirm="dateeconfirm"
-          @cancel="startTimeshow=false"
-      />
+        v-model="startcurrentDate"
+        type="date"
+        title="开始日期"
+        :min-date="minDate"
+        :max-date="startmaxDate"
+        @confirm="dateeconfirm"
+        @cancel="startTimeshow = false" />
     </van-popup>
     <van-popup v-model="endTimeshow" position="bottom" :style="{ height: '50%' }">
       <van-datetime-picker
-          v-model="currentDate"
-          type="date"
-          title="开始日期"
-          :min-date="endminDate"
-          :max-date="maxDate"
-          @confirm="endTimeconfirm"
-          @cancel="endTimeshow=false"
-      />
+        v-model="currentDate"
+        type="date"
+        title="开始日期"
+        :min-date="endminDate"
+        :max-date="maxDate"
+        @confirm="endTimeconfirm"
+        @cancel="endTimeshow = false" />
     </van-popup>
     <van-popup v-model="RegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="companyList"
-          value-key="deptName"
-          @confirm="onregionConfirm"
-          @cancel="RegionShow = false"
-      />
+        show-toolbar
+        :columns="companyList"
+        value-key="deptName"
+        @confirm="onregionConfirm"
+        @cancel="RegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesRegionShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="regionList"
-          value-key="deptName"
-          @confirm="onSalesRegionConfirm"
-          @cancel="SalesRegionShow = false"
-      />
+        show-toolbar
+        :columns="regionList"
+        value-key="deptName"
+        @confirm="onSalesRegionConfirm"
+        @cancel="SalesRegionShow = false" />
     </van-popup>
     <van-popup v-model="SalesDepartmentShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="deptList"
-          value-key="deptName"
-          @confirm="onSalesDepartmentConfirm"
-          @cancel="SalesDepartmentShow = false"
-      />
+        show-toolbar
+        :columns="deptList"
+        value-key="deptName"
+        @confirm="onSalesDepartmentConfirm"
+        @cancel="SalesDepartmentShow = false" />
     </van-popup>
     <van-popup v-model="StaffShow" capture position="bottom">
       <van-picker
-          show-toolbar
-          :columns="userList"
-          @confirm="onStaffConfirm"
-          value-key="nickName"
-          @cancel="StaffShow = false"
-      />
+        show-toolbar
+        :columns="userList"
+        @confirm="onStaffConfirm"
+        value-key="nickName"
+        @cancel="StaffShow = false" />
     </van-popup>
   </div>
 </template>
 
 <script>
-import {getVisits,getvisitDeptInfo} from "@/api/index";
-import timeico from "@/assets/Icon/datatims.png";
+import { getVisits, getvisitDeptInfo } from '@/api/index';
+import timeico from '@/assets/Icon/datatims.png';
 
 export default {
-  name: "index.vue",
+  name: 'index.vue',
   data() {
     return {
       timeico: timeico,
       defaultDate: new Date(),
       searchValue: '',
       calendarShow: '',
-      monthNames: ['-01', '-02', '-03', '-04', '-05', '-06', '-07', '-08', '-09', '-10', '-11', '-12',],
+      monthNames: [
+        '-01',
+        '-02',
+        '-03',
+        '-04',
+        '-05',
+        '-06',
+        '-07',
+        '-08',
+        '-09',
+        '-10',
+        '-11',
+        '-12',
+      ],
       calendarIsshow: false,
       tabVal: 'insidePlan',
       list: [],
       loading: false,
       finished: true,
       listActive: null,
-      query: "",
+      query: '',
       show: false,
       minDate: new Date(2022, 0, 1),
       maxDate: new Date(),
@@ -176,142 +232,142 @@ export default {
       startcurrentDate: new Date(),
       endminDate: new Date(),
       startmaxDate: new Date(),
-      endTime: "",
-      startTime: "",
+      endTime: '',
+      startTime: '',
       endTimeshow: false,
       startTimeshow: false,
-      storeName: "",
-      companyName:"全部公司",
-      deptName:"全部销售部",
-      regionName:"全部大区",
-      userName:"全部业务员",
-      companyCode:"",
-      deptCode:"",
-      regionCode:"",
-      userCode:"",
-      companyList:[],
-      deptList:[],
-      regionList:[],
-      userList:[],
+      storeName: '',
+      companyName: '全部公司',
+      deptName: '全部销售部',
+      regionName: '全部大区',
+      userName: '全部业务员',
+      companyCode: '',
+      deptCode: '',
+      regionCode: '',
+      userCode: '',
+      companyList: [],
+      deptList: [],
+      regionList: [],
+      userList: [],
       RegionShow: false,
       SalesRegionShow: false,
       SalesDepartmentShow: false,
       StaffShow: false,
-      deptForm:{type:"",parentId:""},
-      pageNum:1 , // 当前页码  int类型
-      pageSize:10, // 当前每页条数  int类型
-      formData:{
-        companyId:"", // 公司id,必传 Long类型
-        regionId:"", // 大区id,必传  Long类型
-        deptId:"", // 部门id,如果为周报或日报为必传  Long类型
-        userId:"", // 业务员id,如果为日报为必传      Long类型
-        startTime:"", // 开始时间,必传  格式:yyyy-MM-dd  String类型
-        endTime:"", // 结束时间,必传  格式:yyyy-MM-dd  String类型
-        pageNum:1 , // 当前页码  int类型
-        pageSize:10, // 当前每页条数  int类型
+      deptForm: { type: '', parentId: '' },
+      pageNum: 1, // 当前页码  int类型
+      pageSize: 10, // 当前每页条数  int类型
+      formData: {
+        companyId: '', // 公司id,必传 Long类型
+        regionId: '', // 大区id,必传  Long类型
+        deptId: '', // 部门id,如果为周报或日报为必传  Long类型
+        userId: '', // 业务员id,如果为日报为必传      Long类型
+        startTime: '', // 开始时间,必传  格式:yyyy-MM-dd  String类型
+        endTime: '', // 结束时间,必传  格式:yyyy-MM-dd  String类型
+        pageNum: 1, // 当前页码  int类型
+        pageSize: 10, // 当前每页条数  int类型
       },
-    }
+    };
   },
   activated() {
-  // watch: {
-  //   $route(to, from) {
-  //     if (from.path == "/My/index" && to.path == "/historAllVisit") {
-  //       this.info();
-  //       this.userList=[]
-        this.pageNum=1;
-        this.list=[];
-        // this.powerGrade = localStorage.getItem("powerGrade")
-        // this.getDeptInfo("dept")
-        // if(this.powerGrade==5){
-        //   setTimeout(()=>{
-        //     if(this.$route.query.userCode==undefined){
-        //       this.companyName=this.companyList[0].deptName;
-        //       this.companyCode=this.companyList[0].deptId;
-        //     }
-        //     this.getDeptInfo("dept",1)
-        //   },1000)
-        // }
-        // if(this.powerGrade==4){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("dept",1)
-        //   },1000)
-        // }
-        // if(this.powerGrade==3){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("dept",2)
-        //   },1000)
-        // }
-        // if(this.powerGrade==2||this.powerGrade==1){
-        //   setTimeout(()=>{
-        //     this.getDeptInfo("user")
-        //   },2000)
-        // }
-        setTimeout(()=>{
-          this.onSearch();
-        },1000)
-      // }
+    // watch: {
+    //   $route(to, from) {
+    //     if (from.path == "/My/index" && to.path == "/historAllVisit") {
+    //       this.info();
+    //       this.userList=[]
+    this.pageNum = 1;
+    this.list = [];
+    // this.powerGrade = localStorage.getItem("powerGrade")
+    // this.getDeptInfo("dept")
+    // if(this.powerGrade==5){
+    //   setTimeout(()=>{
+    //     if(this.$route.query.userCode==undefined){
+    //       this.companyName=this.companyList[0].deptName;
+    //       this.companyCode=this.companyList[0].deptId;
+    //     }
+    //     this.getDeptInfo("dept",1)
+    //   },1000)
+    // }
+    // if(this.powerGrade==4){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("dept",1)
+    //   },1000)
+    // }
+    // if(this.powerGrade==3){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("dept",2)
+    //   },1000)
     // }
-  // },
-},
+    // if(this.powerGrade==2||this.powerGrade==1){
+    //   setTimeout(()=>{
+    //     this.getDeptInfo("user")
+    //   },2000)
+    // }
+    setTimeout(() => {
+      this.onSearch();
+    }, 1000);
+    // }
+    // }
+    // },
+  },
   created() {
     this.info();
-    this.userList=[]
-    this.pageNum=1;
-    this.list=[];
-    this.powerGrade = localStorage.getItem("powerGrade")
-    this.getDeptInfo("dept")
-    if(this.powerGrade==5){
-      setTimeout(()=>{
-        if(this.$route.query.userCode==undefined){
-          this.companyName=this.companyList[0].deptName;
-          this.companyCode=this.companyList[0].deptId;
+    this.userList = [];
+    this.pageNum = 1;
+    this.list = [];
+    this.powerGrade = localStorage.getItem('powerGrade');
+    this.getDeptInfo('dept');
+    if (this.powerGrade == 5) {
+      setTimeout(() => {
+        if (this.$route.query.userCode == undefined) {
+          this.companyName = this.companyList[0].deptName;
+          this.companyCode = this.companyList[0].deptId;
         }
-        this.getDeptInfo("dept",1)
-      },1000)
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==4){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",1)
-      },1000)
+    if (this.powerGrade == 4) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 1);
+      }, 1000);
     }
-    if(this.powerGrade==3){
-      setTimeout(()=>{
-        this.getDeptInfo("dept",2)
-      },1000)
+    if (this.powerGrade == 3) {
+      setTimeout(() => {
+        this.getDeptInfo('dept', 2);
+      }, 1000);
     }
-    if(this.powerGrade==2||this.powerGrade==1){
-      setTimeout(()=>{
-        this.getDeptInfo("user")
-      },2000)
+    if (this.powerGrade == 2 || this.powerGrade == 1) {
+      setTimeout(() => {
+        this.getDeptInfo('user');
+      }, 2000);
     }
     // setTimeout(()=>{
     //   this.onSearch();
     // },1000)
   },
   methods: {
-    onLoad(){
+    onLoad() {
       // this.loading = false;
       this.getVisitsListFn();
     },
-    info(){
+    info() {
       this.query = this.$route.query;
-      this.startTime = this.getDay(-7)
-      this.startcurrentDate = new Date(this.getDay(-7))
-      this.endTime = this.parseTime(new Date(), '{y}-{m}-{d}')
-      this.endminDate = new Date(this.getDay(-7))
+      this.startTime = this.getDay(-7);
+      this.startcurrentDate = new Date(this.getDay(-7));
+      this.endTime = this.parseTime(new Date(), '{y}-{m}-{d}');
+      this.endminDate = new Date(this.getDay(-7));
     },
     detilsFn(val) {
       this.$router.push({
-        path: "/historicalDetails",
+        path: '/historicalDetails',
         query: {
           visitId: val.id,
-          storeId:val.storeId,
-          storeCode:val.storeCode,
-          taskId:val.taskId,
-          userId:val.userId,
-          storeCategory:val.storeCategory
-        }
-      })
+          storeId: val.storeId,
+          storeCode: val.storeCode,
+          taskId: val.taskId,
+          userId: val.userId,
+          storeCategory: val.storeCategory,
+        },
+      });
     },
     timeBefore7(date) {
       if (!date) {
@@ -324,9 +380,9 @@ export default {
         m = date.getMonth();
         var d1 = new Date(y, m, 0);
         var d2 = d1.getDate();
-        return y + '/' + (m < 10 ? ('0' + m) : m) + '/' + (d2 + d);
+        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d2 + d);
       } else {
-        return y + '/' + (m < 10 ? ('0' + m) : m) + '/' + (d < 10 ? ('0' + d) : d);
+        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d);
       }
     },
     getDay(day) {
@@ -338,33 +394,33 @@ export default {
       var tDate = today.getDate();
       tMonth = this.doHandleMonth(tMonth + 1);
       tDate = this.doHandleMonth(tDate);
-      return tYear + "-" + tMonth + "-" + tDate;
+      return tYear + '-' + tMonth + '-' + tDate;
     },
     doHandleMonth(month) {
       var m = month;
       if (month.toString().length == 1) {
-        m = "0" + month;
+        m = '0' + month;
       }
       return m;
     },
     dateeconfirm() {
-      this.startTimeshow = false
-      this.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}')
-      this.endminDate = new Date(this.startcurrentDate)
-      this.onSearch()
+      this.startTimeshow = false;
+      this.startTime = this.parseTime(this.startcurrentDate, '{yy}-{mm}-{dd}');
+      this.endminDate = new Date(this.startcurrentDate);
+      this.onSearch();
     },
     endTimeconfirm() {
-      this.endTimeshow = false
-      this.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}')
-      this.startmaxDate = new Date(this.currentDate)
-      this.onSearch()
+      this.endTimeshow = false;
+      this.endTime = this.parseTime(this.currentDate, '{yy}-{mm}-{dd}');
+      this.startmaxDate = new Date(this.currentDate);
+      this.onSearch();
     },
     onClickLeft() {
-      this.$router.go(-1)
+      this.$router.go(-1);
     },
     onSearch() {
-      this.pageNum=1;
-      this.list=[];
+      this.pageNum = 1;
+      this.list = [];
       this.getVisitsListFn();
     },
     getVisitsListFn() {
@@ -378,27 +434,30 @@ export default {
         this.refreshing = false;
       }
       getVisits({
-        startTime: this.startTime+ " 00:00:00",//
-        stopTime: this.endTime+ " 24:00:00", //
+        startTime: this.startTime + ' 00:00:00', //
+        stopTime: this.endTime + ' 24:00:00', //
         storeRequest: this.storeName.trim(),
-        pageNum:this.pageNum,
-        pageSize:this.pageSize,
-        companyId: this.companyCode, regionId: this.regionCode, userId: this.userCode, deptId: this.deptCode
-      }).then(res => {
-        loading1.clear()
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
+        companyId: this.companyCode,
+        regionId: this.regionCode,
+        userId: this.userCode,
+        deptId: this.deptCode,
+      }).then((res) => {
+        loading1.clear();
         if (res.code == 200) {
-          this.loading=false
-          this.list = this.list.concat(res.data)
-          if (this.list.length >=res.total) {
+          this.loading = false;
+          this.list = this.list.concat(res.data);
+          if (this.list.length >= res.total) {
             this.finished = true;
-          }else{
+          } else {
             this.finished = false;
           }
-          this.pageNum=this.pageNum+1
+          this.pageNum = this.pageNum + 1;
         } else {
-          this.$toast.fail(res.msg)
+          this.$toast.fail(res.msg);
         }
-      })
+      });
     },
     regionClick() {
       // if(this.powerGrade>4){
@@ -420,101 +479,101 @@ export default {
     },
     StartTimeClick() {
       this.StartTimeShow = true;
-    },onregionConfirm(val) {
+    },
+    onregionConfirm(val) {
       this.RegionShow = false;
-      this.companyName=val.deptName;
-      this.companyCode=val.deptId;
-      this.regionName="全部大区";
-      this.regionCode="";
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.getDeptInfo("dept",1)
+      this.companyName = val.deptName;
+      this.companyCode = val.deptId;
+      this.regionName = '全部大区';
+      this.regionCode = '';
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.getDeptInfo('dept', 1);
     },
     onSalesRegionConfirm(val) {
       this.SalesRegionShow = false;
-      this.regionName=val.deptName;
-      this.regionCode=val.deptId;
-      if(val.deptId!=""){
-        this.getDeptInfo("dept",2)
+      this.regionName = val.deptName;
+      this.regionCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('dept', 2);
       }
-      this.deptName="全部销售部";
-      this.deptCode="";
-      this.userName="全部业务员";
-      this.userCode="";
-      this.userList=[]
+      this.deptName = '全部销售部';
+      this.deptCode = '';
+      this.userName = '全部业务员';
+      this.userCode = '';
+      this.userList = [];
     },
     onSalesDepartmentConfirm(val) {
       this.SalesDepartmentShow = false;
-      this.deptName=val.deptName;
-      this.deptCode=val.deptId;
-      if(val.deptId!=""){
-
-        this.getDeptInfo("user")
+      this.deptName = val.deptName;
+      this.deptCode = val.deptId;
+      if (val.deptId != '') {
+        this.getDeptInfo('user');
       }
-      this.userName="全部业务员";
-      this.userCode="";
+      this.userName = '全部业务员';
+      this.userCode = '';
     },
     onStaffConfirm(val) {
       this.StaffShow = false;
-      this.userName=val.nickName;
-      this.userCode=val.userId;
+      this.userName = val.nickName;
+      this.userCode = val.userId;
     },
-    getDeptInfo(type,grade){
-      this.deptForm.type=type
-      if(type=="dept"){
-        if(grade=="1"){
-          this.deptForm.parentId=this.companyCode
-        }else if(grade=="2"){
-          this.deptForm.parentId=this.regionCode
-        }else{
-          this.deptForm.type=""
-          this.deptForm.parentId=""
+    getDeptInfo(type, grade) {
+      this.deptForm.type = type;
+      if (type == 'dept') {
+        if (grade == '1') {
+          this.deptForm.parentId = this.companyCode;
+        } else if (grade == '2') {
+          this.deptForm.parentId = this.regionCode;
+        } else {
+          this.deptForm.type = '';
+          this.deptForm.parentId = '';
         }
-      }else if(type=="user"){
-        this.deptForm.parentId=this.deptCode
+      } else if (type == 'user') {
+        this.deptForm.parentId = this.deptCode;
       }
-      getvisitDeptInfo(this.deptForm).then(res=>{
-        if(type=="dept"){
-          if(grade=="1"){
-            if(res.data.region!=null){
-              this.regionList=[{deptName:"全部大区",deptId:""}].concat(res.data.region)
+      getvisitDeptInfo(this.deptForm).then((res) => {
+        if (type == 'dept') {
+          if (grade == '1') {
+            if (res.data.region != null) {
+              this.regionList = [{ deptName: '全部大区', deptId: '' }].concat(res.data.region);
             }
-          }else if(grade=="2"){
-            if(res.data.dept!=null){
-              this.deptList=[{deptName:"全部销售部",deptId:""}].concat(res.data.dept)
+          } else if (grade == '2') {
+            if (res.data.dept != null) {
+              this.deptList = [{ deptName: '全部销售部', deptId: '' }].concat(res.data.dept);
             }
-          }else{
-            this.companyList=res.data.company
-            if(this.$route.query.userCode==undefined){
-              this.companyName=res.data.company[0].deptName
-              this.companyCode=res.data.company[0].deptId
+          } else {
+            this.companyList = res.data.company;
+            if (this.$route.query.userCode == undefined) {
+              this.companyName = res.data.company[0].deptName;
+              this.companyCode = res.data.company[0].deptId;
             }
-            if(res.data.dept!=null){
-              this.deptName=res.data.dept[0].deptName
-              this.deptCode=res.data.dept[0].deptId
-              this.deptList=res.data.dept
+            if (res.data.dept != null) {
+              this.deptName = res.data.dept[0].deptName;
+              this.deptCode = res.data.dept[0].deptId;
+              this.deptList = res.data.dept;
             }
-            if(res.data.region!=null){
-              this.regionName=res.data.region[0].deptName
-              this.regionCode=res.data.region[0].deptId
-              this.regionList=res.data.region
+            if (res.data.region != null) {
+              this.regionName = res.data.region[0].deptName;
+              this.regionCode = res.data.region[0].deptId;
+              this.regionList = res.data.region;
             }
-            if(res.data.user!=null){
-              this.userList=res.data.user
-              this.userCode=""
+            if (res.data.user != null) {
+              this.userList = res.data.user;
+              this.userCode = '';
             }
           }
-        }else if(type=="user"){
-          if(res.data.user!=null){
-            this.userList=[{nickName:"全部业务员",userId:""}].concat(res.data.user)
+        } else if (type == 'user') {
+          if (res.data.user != null) {
+            this.userList = [{ nickName: '全部业务员', userId: '' }].concat(res.data.user);
           }
         }
-      })
+      });
     },
-  }
-}
+  },
+};
 </script>
 <style lang="scss">
 .searchDiv {
@@ -533,7 +592,7 @@ export default {
   }
 
   .van-search--show-action {
-    padding-right: 12px
+    padding-right: 12px;
   }
 
   .van-search__content {
@@ -554,6 +613,15 @@ export default {
     }
   }
 }
+.historAllVisit {
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
+}
 </style>
 <style lang="scss" scoped>
 .bgcolor {
@@ -573,12 +641,13 @@ export default {
   box-sizing: border-box;
   background-color: #f1f1f1;
   border-radius: 20px;
-  margin:8px;
+  margin: 8px;
   border: 1px solid #ccc;
   position: relative;
   color: #333;
   font-size: 14px;
-  .van-cell__left-icon, .van-cell__right-icon{
+  .van-cell__left-icon,
+  .van-cell__right-icon {
     line-height: 34px;
   }
   .CalendarIcon {
@@ -593,10 +662,12 @@ export default {
     }
   }
 }
-.serchInput{
-  padding: 0 4px ;
+.serchInput {
+  padding: 0 4px;
+}
+.selectcell {
+  width: 92%;
 }
-.selectcell{width: 92%}
 .card {
   box-sizing: border-box;
 
@@ -620,7 +691,7 @@ export default {
   background-color: white;
 }
 .btnbox {
-  padding: 0 16px
+  padding: 0 16px;
 }
 .cellcontent .centerBtn {
   margin: 0 auto 10px;
@@ -672,4 +743,4 @@ export default {
   float: right;
   color: #0057ba;
 }
-</style>
+</style>

+ 31 - 1
src/views/historicalVisit/historicalDetails.vue

@@ -29,7 +29,28 @@
         <div class="subtitle">拜访人:{{ list.nickName }}</div>
         <div class="subtitle">拜访日期:{{ list.startTime }}~{{ list.stopTime }}</div>
         <div class="subtitle" v-if="list.dwellTime">拜访时长:{{ list.dwellTime }}</div>
-        <div class="subtitle">经销商:{{ list.chainName }}</div>
+        <!-- 分销店 -->
+        <template
+          v-if="
+            verifyStoreType(list.storeCategory) && verifyStoreType(list.storeCategory).type == 'fxd'
+          ">
+          <div class="subtitle" style="display: flex">
+            <div class="label" style="width: 75px">经销商:</div>
+            <div class="valuue TCFXList">
+              <div
+                class="sfaStoreChainsContactList"
+                v-for="(item, index) in list.sfaStoreChainsContactList"
+                :key="index">
+                {{ item.categoryDescribe }}
+                {{ item.chainCode }}
+                {{ item.chainName }}
+              </div>
+            </div>
+          </div>
+        </template>
+        <template v-else>
+          <div class="subtitle">经销商:{{ list.chainName }}</div>
+        </template>
         <div class="subtitle" v-if="updateTimeShow">更新时间:{{ list.updateTime }}</div>
       </div>
       <p
@@ -389,6 +410,15 @@ export default {
     }
   }
 }
+.TCFXList {
+  .van-field__control--custom {
+    flex-direction: column;
+    align-items: self-start;
+    .TCFXListTreeSelec {
+      padding: 3px;
+    }
+  }
+}
 </style>
 <style>
 .fontWeit .van-cell__title {

+ 4 - 4
src/views/home/hintTabPage/hintDetail.vue

@@ -135,7 +135,7 @@ export default {
           ],
         },
         {
-          label: '同A店',
+          label: '同城分销-涂料店',
           childredColumn: [
             {
               label: '(近2月)',
@@ -144,7 +144,7 @@ export default {
           ],
         },
         {
-          label: '同B店',
+          label: '同城分销-其他店',
           childredColumn: [
             {
               label: '(近3月)',
@@ -178,7 +178,7 @@ export default {
           ],
         },
         {
-          label: '同A店',
+          label: '同城分销-涂料店',
           childredColumn: [
             {
               label: '(7天未结案)',
@@ -187,7 +187,7 @@ export default {
           ],
         },
         {
-          label: '同B店',
+          label: '同城分销-其他店',
           childredColumn: [
             {
               label: '(7天未结案)',

+ 4 - 4
src/views/home/hintTabPage/index.vue

@@ -267,7 +267,7 @@ export default {
             ],
           },
           {
-            title: '同A店',
+            title: '同城分销-涂料店',
             titleProp: 'tongA',
             bagColor: '#88abda',
             visitDetail: [
@@ -284,7 +284,7 @@ export default {
             ],
           },
           {
-            title: '同B店',
+            title: '同城分销-其他店',
             titleProp: 'tongB',
             bagColor: '#8f82bc',
             visitDetail: [
@@ -370,7 +370,7 @@ export default {
             ],
           },
           {
-            title: '同A店',
+            title: '同城分销-涂料店',
             titleProp: 'tongA',
             bagColor: '#88abda',
             visitDetail: [
@@ -393,7 +393,7 @@ export default {
             ],
           },
           {
-            title: '同B店',
+            title: '同城分销-其他店',
             titleProp: 'tongB',
             bagColor: '#8f82bc',
             visitDetail: [

+ 7 - 3
src/views/home/hintTabPage/visitPage.vue

@@ -16,7 +16,7 @@
               </template>
             </div>
           </div>
-          <div class="itemRight" :style="{ width: fromType == 'noVisit' ? '130px' : '140px' }">
+          <div class="itemRight" :style="{ width: fromType == 'noVisit' ? '150px' : '160px' }">
             <div class="label">{{ list.rightTable }}</div>
             <div
               class="label"
@@ -114,15 +114,19 @@ export default {
   position: relative;
   .storeType {
     display: flex;
-    padding: 8px 0;
+    /* padding: 8px 0; */
+    flex-direction: column;
     .title {
       color: #fff;
       height: 21px;
       margin-right: 6px;
-      width: 50px;
+      /* width: 50px; */
       text-align: center;
       line-height: 21px;
       border-radius: 2px;
+      margin: 4px 0;
+      width: max-content;
+      padding: 0 3px;
     }
     .itemContent {
       /* display: flex; */

+ 68 - 21
src/views/signApproval/newStoreApprovalDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="newStoreApprovalDetail">
     <div class="navBarTOP">
       <!-- 顶部条 -->
       <van-nav-bar class="navBar" title="门店详情" left-arrow @click-left="onClickLeft" />
@@ -51,16 +51,41 @@
             v-model="list.telephone"
             label="联系电话"
             v-if="list.storeCategory != 'C917'" />
-          <van-field
-            readonly
-            v-model="list.chainCode"
-            label="经销商编号"
-            v-if="list.storeCategory != 'C917'" />
-          <van-field
-            readonly
-            v-model="list.chainName"
-            label="经销商名称"
-            v-if="list.storeCategory != 'C917'" />
+          <template v-if="list.storeCategory != 'C917'">
+            <!-- 分销店 -->
+            <template
+              v-if="
+                verifyStoreType(list.storeCategory) &&
+                verifyStoreType(list.storeCategory).type == 'fxd'
+              ">
+              <van-field label="经销商" readonly class="TCFXList">
+                <template #input>
+                  <template v-if="list.sfaStoreChainsContactList">
+                    <div
+                      class="sfaStoreChainsContactList"
+                      v-for="(item, index) in list.sfaStoreChainsContactList"
+                      :key="index">
+                      {{ item.categoryDescribe }}
+                      {{ item.chainCode }}
+                      {{ item.chainName }}
+                    </div>
+                  </template>
+                </template>
+              </van-field>
+            </template>
+            <template v-else>
+              <van-field
+                readonly
+                v-model="list.chainCode"
+                label="经销商编号"
+                v-if="list.storeCategory != 'C917'" />
+              <van-field
+                readonly
+                v-model="list.chainName"
+                label="经销商名称"
+                v-if="list.storeCategory != 'C917'" />
+            </template>
+          </template>
           <van-field readonly v-model="list.salesmanName" label="销售员" />
           <div v-if="list.storeCategory != 'C917'">
             <van-field
@@ -176,7 +201,13 @@
           </van-collapse>
         </van-tab>
         <van-tab title="属性信息" name="outsidePlan">
-          <van-field readonly label="属性" v-if="dictTypeFormShow" v-model="list.tcfxName" />
+          <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
+            <van-field
+              readonly
+              label="属性"
+              v-if="item.dictValue == list.tcfxName"
+              v-model="item.text" />
+          </template>
         </van-tab>
       </van-tabs>
       <br />
@@ -419,6 +450,8 @@ export default {
           TCFXList.push({
             text: res.data[t].dictLabel,
             dictCode: res.data[t].dictCode,
+            dictValue: res.data[t].dictValue,
+            remark: res.data[t].remark,
           });
         }
         this.TCFXList = TCFXList;
@@ -494,15 +527,18 @@ export default {
           } else {
             this.GZAttributeFormShow = false;
           }
-          if (this.list.storeCategory == '129081') {
-            this.dictTypeFormShow = true;
-            if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
-              this.list.tcfxName = this.list.attribute3;
-            } else {
-              this.list.tcfxName = this.list.attribute5;
-            }
-          }
-          if (this.list.storeCategory == '10131') {
+          // if (this.list.storeCategory == '129081') {
+          //   this.dictTypeFormShow = true;
+          //   if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
+          //     this.list.tcfxName = this.list.attribute3;
+          //   } else {
+          //     this.list.tcfxName = this.list.attribute5;
+          //   }
+          // }
+          if (
+            this.verifyStoreType(this.list.storeCategory) &&
+            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+          ) {
             this.dictTypeFormShow = true;
             for (var k = 0; k < this.TCFXList.length; k++) {
               if (this.TCFXList[k].dictCode == this.list.tcfxName) {
@@ -901,4 +937,15 @@ export default {
     }
   }
 }
+.newStoreApprovalDetail {
+  .TCFXList {
+    .van-field__control--custom {
+      flex-direction: column;
+      align-items: self-start;
+      .TCFXListTreeSelec {
+        padding: 3px;
+      }
+    }
+  }
+}
 </style>

Разлика између датотеке није приказан због своје велике величине
+ 429 - 323
src/views/signApproval/signApproval.vue


+ 35 - 1
src/views/storeManagement/index.vue

@@ -267,7 +267,34 @@
               </div>
               <div class="info">联系电话:{{ item.telephone }}</div>
               <div class="info">地址:{{ item.addressLine }}</div>
-              <div class="info" v-if="addShow1">经销商:{{ item.chainName }}</div>
+              <!-- 分销店 -->
+              <template
+                v-if="
+                  item.sfaStoreType &&
+                  item.sfaStoreType.type == 'fxd' &&
+                  item.sfaStoreChainsContactList
+                ">
+                <div class="info" v-if="addShow1">
+                  经销商:
+                  <div class="TCFXListItem" v-for="(item, index) in item.sfaStoreChainsContactList">
+                    <el-popover
+                      popper-class="zpover zpoverStoreztype"
+                      placement="bottom-start"
+                      trigger="click">
+                      <div>
+                        <div>{{ item.chainCode }}</div>
+                        <div>{{ item.chainName }}</div>
+                      </div>
+                      <div slot="reference" :key="index">
+                        {{ item.categoryDescribe }}
+                      </div>
+                    </el-popover>
+                  </div>
+                </div>
+              </template>
+              <template v-else>
+                <div class="info" v-if="addShow1">经销商:{{ item.chainName }}</div>
+              </template>
             </div>
           </van-cell>
           <div class="lineGrey"></div>
@@ -1006,6 +1033,13 @@ export default {
       }
     }
   }
+  .TCFXListItem {
+    display: inline-block;
+    border: 1px solid #ccc;
+    padding: 3px 5px;
+    margin: 0 5px;
+    border-radius: 6px;
+  }
 }
 </style>
 <style lang="scss" scoped>

+ 340 - 207
src/views/storeManagement/storeAdd.vue

@@ -1,14 +1,15 @@
 <template>
-  <div>
+  <div class="storeAdd">
     <div class="navBarTOP">
-      <!--        顶部条-->
+      <!-- 新建同城分销店必须要下单 -->
       <van-nav-bar
         class="navBar"
         title="新增信息"
         left-arrow
         @click-left="onClickLeft"
         :right-text="
-          fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131'
+          verifyStoreType(fromValue.storeCategory) &&
+          verifyStoreType(fromValue.storeCategory).type == 'fxd'
             ? '去下单'
             : '保存'
         "
@@ -46,46 +47,80 @@
                 <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="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>
+            <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 == 'fxd'
+                ">
+                <van-row style="border-bottom: 1px solid #ebedf0">
+                  <van-col span="24">
+                    <van-field label="经销商名称" @click="showPickerChainsListFn" class="TCFXList">
+                      <template #left-icon>
+                        <span class="van-f-red">*</span>
+                      </template>
+                      <template #input>
+                        <template v-if="sfaStoreChainsContactList.length">
+                          <div
+                            class="sfaStoreChainsContactList"
+                            v-for="(item, index) in sfaStoreChainsContactList"
+                            :key="index">
+                            {{ item.categoryDescribe }}
+                            {{ item.chainCode }}
+                            {{ item.chainName }}
+                          </div>
+                        </template>
+                        <template v-else>
+                          <span style="color: rgb(150, 151, 153)"> 点击选择经销商名称 </span>
+                        </template>
+                      </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"
@@ -296,10 +331,11 @@
                         :type="1"></upload-img>
                     </div>
                   </van-col>
-                  <!-- 新建同城A、B店不显示陈列照 -->
+                  <!-- 新建同城分销店不显示陈列照 -->
                   <template
                     v-if="
-                      fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
+                      verifyStoreType(fromValue.storeCategory) &&
+                      !verifyStoreType(fromValue.storeCategory).type == 'fxd'
                     ">
                     <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
                       <div v-if="storeTypePOP">
@@ -339,7 +375,8 @@
                   <!-- 新建同城A、B店不显示陈列照 -->
                   <template
                     v-if="
-                      fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
+                      verifyStoreType(fromValue.storeCategory) &&
+                      !verifyStoreType(fromValue.storeCategory).type == 'fxd'
                     ">
                     <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
                       <div v-if="storeTypePOP">
@@ -359,6 +396,7 @@
             </div>
           </van-tab>
           <van-tab title="属性信息" name="Planpic">
+            <!-- 同城分销店-属性信息 -->
             <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
               <p style="color: #666"><span class="van-f-red">*</span>属性</p>
               <div style="padding: 4px">
@@ -368,7 +406,8 @@
                       span="12"
                       v-for="(item, index) in TCFXList"
                       :key="index"
-                      style="margin-bottom: 10px">
+                      style="margin-bottom: 10px"
+                      v-if="item.remark == fromValue.storeCategory">
                       <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
                     </van-col>
                   </van-row>
@@ -448,13 +487,60 @@
         @cancel="showPicker = false" />
     </van-popup>
     <!--经销商-->
-    <van-popup v-model="showPickerChainsList" position="bottom">
-      <van-picker
-        show-toolbar
-        :columns="ChainsList"
-        value-key="chainName"
-        @confirm="onConfirmChainsList"
-        @cancel="showPickerChainsList = false" />
+    <van-popup
+      v-model="showPickerChainsList"
+      position="bottom"
+      class="agencyBox"
+      :close-on-click-overlay="false">
+      <!-- 分销店 -->
+      <template
+        v-if="
+          verifyStoreType(fromValue.storeCategory) &&
+          verifyStoreType(fromValue.storeCategory).type == 'fxd'
+        ">
+        <div class="header_btn">
+          <div class="cancel" @click="showPickerChainsList = false">取消</div>
+          <div class="confirm" @click="treeSelectConfirm">确定</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)"
+                v-if="item.children.length">
+                <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.chainCode }} {{ val.chainName }}</div>
+              </div>
+              <van-empty description="" v-if="item.children.length == 0" />
+            </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">
@@ -612,6 +698,7 @@ import {
   getMainProjectList,
   getCustomerNatureList,
   getpotentialCustomerTypeList,
+  getDictOption,
 } from '@/api/index';
 import uploadImg from '@/components/uploadImgVStore';
 import uploadImgc from '@/components/uploadImgVStorec';
@@ -624,6 +711,7 @@ import txmapimg1 from '@/assets/txmap1.svg';
 import txmapimg2 from '@/assets/txmap2.svg';
 import txmapimg3 from '@/assets/marker_blue.png';
 import { getPosition, getTicketFun } from '@/utils/TXApiFun';
+import { listChainsByCategory } from '@/api/store';
 export default {
   name: 'storeAdd',
   components: { uploadImg, uploadImgView, mapmarker, uploadImgc, deleteImgView },
@@ -750,13 +838,18 @@ export default {
       marker: undefined,
       pageShow: false,
       map: '',
+      activeIndex: 0,
+      treeSelectItemInd: 0,
+      treeSelect: [],
+      sfaStoreChainsContactList: [], //选中确定的经销商
+      activatedTCFXList: [], //选中的经销商
+      // addStoreType:null, //新增门店类型,TCFX:同城分销(包括分销店和金牌店);C917:潜在客户;C912:工地
     };
   },
   created() {
     this.getTCFXList();
     this.getSJSList();
     this.getQGJZist();
-    this.getbrands();
     this.getpotentialCustomerTypeList();
     setTimeout(() => {
       // this.getLocation()
@@ -835,12 +928,13 @@ export default {
         this.getpotentialCustomerTypeList();
         this.getSJSList();
         this.getQGJZist();
-        this.getbrands();
         this.getStreetQuery();
       }
     },
   },
   activated() {
+    this.tabVal = 'insidePlan';
+    this.beforeAddFn();
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.$nextTick(() => {
@@ -1247,6 +1341,7 @@ export default {
             this.fromValue.city = '';
           }
           this.storeCategoryList = storeCategory;
+          console.log(this.storeCategoryList);
         } else {
           loading1.clear();
           this.$toast.fail('请求超时');
@@ -1320,96 +1415,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() {
@@ -1472,11 +1477,16 @@ export default {
         this.ManagementModelList = ManagementModelList;
       });
     },
+    // 同城分销-属性信息
     getTCFXList() {
       getTCFXList({}).then((res) => {
         var TCFXList = [];
         for (var t = 0; t < res.data.length; t++) {
-          TCFXList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
+          TCFXList.push({
+            text: res.data[t].dictLabel,
+            dictCode: res.data[t].dictValue,
+            remark: res.data[t].remark,
+          });
         }
         this.TCFXList = TCFXList;
       });
@@ -1570,20 +1580,24 @@ export default {
     onConfirm(value) {
       this.fromValue.storeCategoryName = value.text;
       this.fromValue.storeCategory = value.dictValue;
-      if (value.dictValue == '129081' || value.dictValue == '10131') {
+      if (
+        this.verifyStoreType(this.fromValue.storeCategory) &&
+        this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
+      ) {
+        this.getbrands();
+        // 是否车铺开店
         this.typeABshow = true;
+        // 属性信息
+        this.dictTypeFormShow = true;
       } else {
         this.typeABshow = false;
         this.fromValue.carShop = '';
         this.fromValue.carShopImgList = [];
-      }
-      if (value.dictValue == '129081') {
-        this.dictTypeAFormShow = true;
-      } else {
         this.fromValue.tcfxName = '';
         this.fromValue.tcfxCode = '';
-        this.dictTypeAFormShow = false;
+        this.dictTypeFormShow = false;
       }
+
       if (value.dictValue == 'C917') {
         this.GZAttributeFormShow = true;
         this.dictTypeSJSFormShow = false;
@@ -1596,13 +1610,6 @@ export default {
         this.fromValue.tcfxCode = '';
         this.GZAttributeFormShow = false;
       }
-      if (value.dictValue == '10131') {
-        this.dictTypeFormShow = true;
-      } else {
-        this.fromValue.tcfxName = '';
-        this.fromValue.tcfxCode = '';
-        this.dictTypeFormShow = false;
-      }
       if (value.dictValue == 'sjs61') {
         this.dictTypeSJSFormShow = true;
       } else {
@@ -1633,6 +1640,10 @@ export default {
       this.fromValue.orgId = '';
       this.fromValue.ifJzStoreType = value.ifJzStoreType;
       this.getChainsByDeptCode(null, value.ifJzStoreType);
+      // 切换门店类型删除选定经销商
+      this.treeSelect = [];
+      this.sfaStoreChainsContactList = []; //选中确定的经销商
+      this.activatedTCFXList = []; //选中的经销商
       this.showPicker = false;
     },
     numberFn() {
@@ -1651,6 +1662,13 @@ export default {
         return;
       } else {
         this.showPickerChainsList = true;
+        // 分销店
+        if (
+          this.verifyStoreType(this.fromValue.storeCategory) &&
+          this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
+        ) {
+          this.getStoreChainsContact();
+        }
       }
     },
     moreTypeShowfn() {
@@ -1687,16 +1705,7 @@ export default {
       });
       var fromValue = this.fromValue;
       var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
-      if (
-        fromValue.chainName == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        fromValue.storeCategory != 'C912' &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        // fromValue.storeCategory!='C912'
-        this.$toast('经销商未填写');
-        return;
-      } else if (fromValue.orgId == '') {
+      if (fromValue.orgId == '') {
         this.$toast('部门未选择');
         return;
       } else if (fromValue.storeName == '') {
@@ -1771,57 +1780,62 @@ export default {
           this.$toast('照片未上传');
         }
         return;
-      } else if (
-        fromValue.imgSed == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        this.storeTypePOP &&
-        fromValue.storeCategory != 'C917' &&
-        fromValue.storeCategory !== '129081' &&
-        fromValue.storeCategory !== '10131'
-      ) {
-        this.$toast('图片未上传');
-        return;
       } else if (fromValue.lon == '') {
         this.$toast('请获取定位坐标');
         return;
       } else if (
-        (fromValue.storeCategory == '10131' ||
-          fromValue.storeCategory == 'sjs61' ||
-          fromValue.storeCategory == 'zyjz63') &&
+        (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
         fromValue.tcfxName == ''
       ) {
         this.$toast('属性未填写');
         return;
-      } else if (
-        (fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131') &&
-        fromValue.carShop == ''
-      ) {
-        this.$toast('请选择是否车铺开店');
-        return;
-      } else if (
-        (fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131') &&
-        fromValue.carShop == '1' &&
-        fromValue.carShopImgList.length < 1
-      ) {
-        this.$toast('请上传车铺开店照片');
-        return;
       }
       if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
         this.$toast('家装展厅面积未填写');
         return;
       }
-
-      if (fromValue.storeCategory == '129081' && fromValue.attribute3 == '') {
-        this.$toast('属性未填写');
-        return;
-      }
+      // 同城分销类型门店
       if (
-        fromValue.storeCategory == '129081' &&
-        fromValue.attribute3 == '0' &&
-        fromValue.attribute5 == ''
+        this.verifyStoreType(this.fromValue.storeCategory) &&
+        this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
       ) {
-        this.$toast('属性未填写');
-        return;
+        // 同城分销多经销商
+        this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
+        if (!this.fromValue.sfaStoreChainsContactList.length) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (fromValue.carShop == '') {
+          this.$toast('请选择是否车铺开店');
+          return;
+        } else if (fromValue.carShop == '1' && fromValue.carShopImgList.length < 1) {
+          this.$toast('请上传车铺开店照片');
+          return;
+        }
+        if (fromValue.tcfxName == '') {
+          this.$toast('属性未填写');
+          return;
+        }
+      } else {
+        // 非同城分销店 经销商必填校验
+        if (
+          fromValue.chainName == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          fromValue.storeCategory != 'C912' &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (
+          fromValue.imgSed == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          this.storeTypePOP &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('图片未上传');
+          return;
+        }
       }
       if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
         this.$toast('潜在客户类型未填写');
@@ -1940,6 +1954,86 @@ export default {
         }
       }
     },
+    //获取经销商
+    async getStoreChainsContact() {
+      // 打开select,上次选中确认数据赋值给选中待确认,回显使用
+      this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
+      if (!this.treeSelect.length) {
+        this.toastLoading(0, '加载中...', true);
+        listChainsByCategory({ orgId: this.fromValue.orgId }).then((res) => {
+          this.toastLoading().clear();
+          // 初始化数据
+          res.data.forEach((val) => {
+            val.dot = false;
+          });
+          this.treeSelect = res.data;
+        });
+      }
+      for (let x = 0; x < this.treeSelect.length; x++) {
+        // 设置左侧选中图标
+        let activate = this.activatedTCFXList.find((item) => {
+          return item.categoryCode == this.treeSelect[x].code;
+        });
+        this.treeSelect[x].dot = activate ? true : false;
+        // 反显右侧选中
+        let children = this.treeSelect[x].children;
+        if (children && this.treeSelect[x].dot) {
+          for (let y = 0; y < children.length; y++) {
+            let activate = this.activatedTCFXList.find((item) => {
+              return (
+                children[y].categoryCode == item.categoryCode &&
+                children[y].chainCode == item.chainCode
+              );
+            });
+            if (activate) {
+              children[y].Check = true;
+            } else {
+              children[y].Check = false;
+            }
+          }
+        }
+      }
+      this.$forceUpdate();
+      this.activeIndex = 0;
+    },
+    // 左侧数据点击
+    clickNav(index) {
+      // this.treeSelect[index].children.forEach((val) => {
+      //   // 回显右侧选中
+      //   let activate = this.activatedTCFXList.find((item) => item.code == val.code);
+      //   val.Check = activate ? true : false;
+      // });
+    },
+    // 右侧数据点击
+    treeSelectItemClick(itemData, index, val, ind) {
+      itemData.children.forEach((item) => {
+        if (val.chainCode == item.chainCode) {
+          item.Check = !item.Check;
+          // 设置左侧选中图标
+          itemData.dot = item.Check;
+        } else {
+          item.Check = false;
+        }
+      });
+      this.$forceUpdate();
+    },
+    // 分销店 确认
+    treeSelectConfirm() {
+      let treeSelectArr = [];
+      this.treeSelect.forEach((item) => {
+        if (item.dot) {
+          let childrenData = item.children.find((val) => val.Check);
+          treeSelectArr.push(childrenData);
+        }
+      });
+      if (!treeSelectArr.length) {
+        this.$toast('请选择至少选择一个经销商');
+        return false;
+      }
+      console.log(treeSelectArr);
+      this.sfaStoreChainsContactList = treeSelectArr;
+      this.showPickerChainsList = false;
+    },
   },
 };
 </script>
@@ -1965,7 +2059,7 @@ export default {
   display: inline-block;
 }
 </style>
-<style>
+<style lang="scss">
 .van-dialog__confirm,
 .van-dialog__confirm:active {
   color: #0057ba;
@@ -2016,4 +2110,43 @@ export default {
 .morelaji .van-cell {
   padding: 10px 0;
 }
+.storeAdd {
+  .agencyBox {
+    .header_btn {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 10px;
+      font-size: 16px;
+      border-bottom: 1px solid #ccc;
+      div {
+        padding: 3px;
+      }
+    }
+    .van-sidebar {
+      width: 100px;
+      text-align: center;
+      flex: none;
+    }
+    .treeSelectchildren {
+      .item {
+        display: flex;
+        align-items: center;
+        padding: 5px;
+        .value {
+          margin-left: 15px;
+        }
+      }
+    }
+  }
+  .TCFXList {
+    .van-field__control--custom {
+      flex-direction: column;
+      align-items: self-start;
+      .sfaStoreChainsContactList {
+        padding: 3px;
+      }
+    }
+  }
+}
 </style>

+ 73 - 24
src/views/storeManagement/storeDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="storeDetail">
     <div class="navBarTOP">
       <!-- 顶部条 -->
       <van-nav-bar class="navBar" title="客户详情" left-arrow @click-left="onClickLeft">
@@ -117,16 +117,33 @@
             v-model="list.telephone"
             label="联系电话"
             v-if="list.storeCategory != 'C917'" />
-          <van-field
-            readonly
-            v-model="list.chainCode"
-            label="经销商编号"
-            v-if="list.storeCategory != 'C917'" />
-          <van-field
-            readonly
-            v-model="list.chainName"
-            label="经销商名称"
-            v-if="list.storeCategory != 'C917'" />
+          <template v-if="list.storeCategory != 'C917'">
+            <!-- 分销店 -->
+            <template
+              v-if="
+                verifyStoreType(list.storeCategory) &&
+                verifyStoreType(list.storeCategory).type == 'fxd'
+              ">
+              <van-field label="经销商" readonly class="TCFXList">
+                <template #input>
+                  <template v-if="list.sfaStoreChainsContactList">
+                    <div
+                      class="sfaStoreChainsContactList"
+                      v-for="(item, index) in list.sfaStoreChainsContactList"
+                      :key="index">
+                      {{ item.categoryDescribe }}
+                      {{ item.chainCode }}
+                      {{ item.chainName }}
+                    </div>
+                  </template>
+                </template>
+              </van-field>
+            </template>
+            <template v-else>
+              <van-field readonly v-model="list.chainCode" label="经销商编号" />
+              <van-field readonly v-model="list.chainName" label="经销商名称" />
+            </template>
+          </template>
           <van-field readonly v-model="list.salesmanName" label="销售员" />
           <div v-if="list.storeCategory != 'C917'">
             <van-field
@@ -273,7 +290,13 @@
           </van-collapse>
         </van-tab>
         <van-tab title="属性信息" name="outsidePlan">
-          <van-field readonly label="属性" v-if="dictTypeFormShow" v-model="list.tcfxName" />
+          <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
+            <van-field
+              readonly
+              label="属性"
+              v-if="item.dictValue == list.tcfxName"
+              v-model="item.text" />
+          </template>
         </van-tab>
       </van-tabs>
       <!--省、市、区、街道-->
@@ -588,6 +611,7 @@ export default {
       });
       localStorage.removeItem('successStoreId');
     } else {
+      this.tabVal = 'insidePlan';
       this.showmap = false;
       this.img = '';
       this.detilId = this.$route.query.detilId;
@@ -1147,6 +1171,8 @@ export default {
           TCFXList.push({
             text: res.data[t].dictLabel,
             dictCode: res.data[t].dictCode,
+            dictValue: res.data[t].dictValue,
+            remark: res.data[t].remark,
           });
         }
         this.TCFXList = TCFXList;
@@ -1235,7 +1261,10 @@ export default {
           } else {
             this.displayImg = [];
           }
-          if (this.list.storeCategory == '129081' || this.list.storeCategory == '10131') {
+          if (
+            this.verifyStoreType(this.list.storeCategory) &&
+            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+          ) {
             this.cityABStore = true;
           } else {
             this.cityABStore = false;
@@ -1261,7 +1290,10 @@ export default {
           } else {
             this.list.carShopImgList = [];
           }
-          if (this.list.storeCategory == '10131' || this.list.storeCategory == '129081') {
+          if (
+            this.verifyStoreType(this.list.storeCategory) &&
+            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+          ) {
             this.typeABshow = true;
           } else {
             this.typeABshow = false;
@@ -1281,15 +1313,18 @@ export default {
           } else {
             this.GZAttributeFormShow = false;
           }
-          if (this.list.storeCategory == '129081') {
-            this.dictTypeFormShow = true;
-            if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
-              this.list.tcfxName = this.list.attribute3;
-            } else {
-              this.list.tcfxName = this.list.attribute5;
-            }
-          }
-          if (this.list.storeCategory == '10131') {
+          // if (this.list.storeCategory == '129081') {
+          //   this.dictTypeFormShow = true;
+          //   if (this.list.attribute3 != '0' && this.list.attribute3 != null) {
+          //     this.list.tcfxName = this.list.attribute3;
+          //   } else {
+          //     this.list.tcfxName = this.list.attribute5;
+          //   }
+          // }
+          if (
+            this.verifyStoreType(this.list.storeCategory) &&
+            this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+          ) {
             this.dictTypeFormShow = true;
             for (var k = 0; k < this.TCFXList.length; k++) {
               if (this.TCFXList[k].dictCode == this.list.tcfxName) {
@@ -1544,7 +1579,10 @@ export default {
     },
     // 新建同城店铺提交审核
     submitApprovalFun() {
-      if (this.list.storeCategory !== '129081' && this.list.storeCategory !== '10131') {
+      if (
+        this.verifyStoreType(this.list.storeCategory) &&
+        !this.verifyStoreType(this.list.storeCategory).type == 'fxd'
+      ) {
         this.$dialog
           .confirm({
             title: '系统提示',
@@ -1796,4 +1834,15 @@ export default {
     }
   }
 }
+.storeDetail {
+  .TCFXList {
+    .van-field__control--custom {
+      flex-direction: column;
+      align-items: self-start;
+      .TCFXListTreeSelec {
+        padding: 3px;
+      }
+    }
+  }
+}
 </style>

+ 357 - 104
src/views/storeManagement/storeEdit.vue

@@ -47,46 +47,80 @@
                 <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="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>
+            <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 == 'fxd'
+                ">
+                <van-row style="border-bottom: 1px solid #ebedf0">
+                  <van-col span="24">
+                    <van-field label="经销商名称" @click="showPickerChainsListFn" class="TCFXList">
+                      <template #left-icon>
+                        <span class="van-f-red">*</span>
+                      </template>
+                      <template #input>
+                        <template v-if="sfaStoreChainsContactList.length">
+                          <div
+                            class="sfaStoreChainsContactList"
+                            v-for="(item, index) in sfaStoreChainsContactList"
+                            :key="index">
+                            {{ item.categoryDescribe }}
+                            {{ item.chainCode }}
+                            {{ item.chainName }}
+                          </div>
+                        </template>
+                        <template v-else>
+                          <span style="color: rgb(150, 151, 153)"> 点击选择经销商名称 </span>
+                        </template>
+                      </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"
@@ -327,7 +361,7 @@
                         @newimgarr="newimgarr1"
                         imgText="陈列照(至少一张)"
                         :type="2"
-                        count="1"></upload-img>
+                        :count="1"></upload-img>
                     </div>
                   </div>
                 </div>
@@ -339,6 +373,7 @@
             </div> -->
           </van-tab>
           <van-tab title="属性信息" name="Planpic">
+            <!-- 同城分销店-属性信息 -->
             <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
               <p style="color: #666"><span class="van-f-red">*</span>属性</p>
               <div style="padding: 4px">
@@ -348,7 +383,8 @@
                       span="12"
                       v-for="(item, index) in TCFXList"
                       :key="index"
-                      style="margin-bottom: 10px">
+                      style="margin-bottom: 10px"
+                      v-if="item.remark == fromValue.storeCategory">
                       <van-radio shape="square" :name="item.dictCode + ''">{{
                         item.text
                       }}</van-radio>
@@ -431,13 +467,58 @@
         @cancel="showPicker = false" />
     </van-popup>
     <!--经销商-->
-    <van-popup v-model="showPickerChainsList" position="bottom">
-      <van-picker
-        show-toolbar
-        :columns="ChainsList"
-        value-key="chainName"
-        @confirm="onConfirmChainsList"
-        @cancel="showPickerChainsList = false" />
+    <van-popup
+      v-model="showPickerChainsList"
+      position="bottom"
+      class="agencyBox"
+      :close-on-click-overlay="false">
+      <!-- 分销店 -->
+      <template
+        v-if="
+          verifyStoreType(fromValue.storeCategory) &&
+          verifyStoreType(fromValue.storeCategory).type == 'fxd'
+        ">
+        <div class="header_btn">
+          <div class="cancel" @click="showPickerChainsList = false">取消</div>
+          <div class="confirm" @click="treeSelectConfirm">确定</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.chainCode }} {{ val.chainName }}</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">
@@ -580,6 +661,7 @@ import {
   getMainRelationList,
   getManagementModelList,
   getpotentialCustomerTypeList,
+  getDictOption,
 } from '@/api/index';
 import uploadImg from '@/components/uploadImgVStore';
 import uploadImgc from '@/components/uploadImgVStorec';
@@ -592,6 +674,7 @@ import txmapimg3 from '@/assets/marker_blue.png';
 import { valid } from '@/api/visitstore';
 import { ImagePreview } from 'vant';
 import { getPosition, getTicketFun, getMapPoi, getkeywordPoi } from '@/utils/TXApiFun';
+import { listChainsByCategory } from '@/api/store';
 
 export default {
   name: 'storeAdd',
@@ -719,9 +802,16 @@ export default {
       pLat: '',
       pLot: '',
       displayImg: [],
+      activeIndex: 0,
+      treeSelectItemInd: 0,
+      treeSelect: [],
+      sfaStoreChainsContactList: [], //选中确定的经销商
+      activatedTCFXList: [], //选中的经销商
     };
   },
   activated() {
+    this.tabVal = 'insidePlan';
+    this.treeSelect = [];
     // 授权
     getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
       this.getTCFXList();
@@ -1176,6 +1266,7 @@ export default {
 
         if (res.code == 200) {
           this.fromValue = res.data;
+          this.sfaStoreChainsContactList = this.fromValue.sfaStoreChainsContactList;
           if (this.fromValue.imgSed && this.fromValue.imgSed != '') {
             this.displayImg = this.fromValue.imgSed.split(',');
           } else {
@@ -1209,19 +1300,23 @@ export default {
           }
           // this.getChainsByDeptCode(res.data.orgId)
           this.getChainsByDeptCode(null, res.data.ifJzStoreType);
-          if (this.fromValue.storeCategory == '129081' || this.fromValue.storeCategory == '10131') {
+          if (
+            this.verifyStoreType(this.fromValue.storeCategory) &&
+            this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
+          ) {
             this.typeABshow = true;
+            this.dictTypeFormShow = true;
           }
-          if (this.fromValue.storeCategory == '129081') {
-            this.dictTypeAFormShow = true;
-          }
+          // if (this.fromValue.storeCategory == '129081') {
+          //   this.dictTypeAFormShow = true;
+          // }
+          // if (this.fromValue.storeCategory == '10131') {
+          //   this.dictTypeFormShow = true;
+          // }
 
           if (this.fromValue.attribute3 == '0') {
             this.attrShow = true;
           }
-          if (this.fromValue.storeCategory == '10131') {
-            this.dictTypeFormShow = true;
-          }
           if (this.fromValue.storeCategory == 'sjs61') {
             this.dictTypeSJSFormShow = true;
           }
@@ -1369,14 +1464,27 @@ export default {
         this.$toast('部门未选择');
         return;
       } else {
-        this.showPickerChainsList = true;
+        // 分销店
+        if (
+          this.verifyStoreType(this.fromValue.storeCategory) &&
+          this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
+        ) {
+          this.getStoreChainsContact();
+        } else {
+          this.showPickerChainsList = true;
+        }
       }
     },
+    // 同城分销-属性信息
     getTCFXList() {
       getTCFXList({}).then((res) => {
         var TCFXList = [];
         for (var t = 0; t < res.data.length; t++) {
-          TCFXList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
+          TCFXList.push({
+            text: res.data[t].dictLabel,
+            dictCode: res.data[t].dictValue,
+            remark: res.data[t].remark,
+          });
         }
         this.TCFXList = TCFXList;
       });
@@ -1462,21 +1570,28 @@ export default {
       // || value.dictValue == "129081" ||value.dictValue == "10131"
       this.fromValue.storeCategoryName = value.text;
       this.fromValue.storeCategory = value.dictValue;
-      if (value.dictValue == '129081' || value.dictValue == '10131') {
+      if (
+        this.verifyStoreType(this.fromValue.storeCategory) &&
+        this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
+      ) {
         this.typeABshow = true;
+        this.dictTypeFormShow = true;
       } else {
         this.typeABshow = false;
         this.fromValue.carShop = '';
         this.fromValue.carShopImgList = [];
-      }
-
-      if (value.dictValue == '129081') {
-        this.dictTypeAFormShow = true;
-      } else {
         this.fromValue.tcfxName = '';
         this.fromValue.tcfxCode = '';
-        this.dictTypeAFormShow = false;
+        this.dictTypeFormShow = false;
       }
+
+      // if (value.dictValue == '129081') {
+      //   this.dictTypeAFormShow = true;
+      // } else {
+      //   this.fromValue.tcfxName = '';
+      //   this.fromValue.tcfxCode = '';
+      //   this.dictTypeAFormShow = false;
+      // }
       if (value.dictValue == 'C917') {
         this.GZAttributeFormShow = true;
         this.dictTypeSJSFormShow = false;
@@ -1489,13 +1604,13 @@ export default {
         this.fromValue.tcfxCode = '';
         this.GZAttributeFormShow = false;
       }
-      if (value.dictValue == '10131') {
-        this.dictTypeFormShow = true;
-      } else {
-        this.fromValue.tcfxName = '';
-        this.fromValue.tcfxCode = '';
-        this.dictTypeFormShow = false;
-      }
+      // if (value.dictValue == '10131') {
+      //   this.dictTypeFormShow = true;
+      // } else {
+      //   this.fromValue.tcfxName = '';
+      //   this.fromValue.tcfxCode = '';
+      //   this.dictTypeFormShow = false;
+      // }
       if (value.dictValue == 'sjs61') {
         this.dictTypeSJSFormShow = true;
       } else {
@@ -1525,6 +1640,10 @@ export default {
         this.fromValue.storeCategory = value.dictValue;
         this.fromValue.ifJzStoreType = value.ifJzStoreType;
         this.getChainsByDeptCode(null, value.ifJzStoreType);
+        // 切换门店类型删除选定经销商
+        this.treeSelect = [];
+        this.sfaStoreChainsContactList = []; //选中确定的经销商
+        this.activatedTCFXList = []; //选中的经销商
         this.showPicker = false;
       }
       if (value.dictValue == 'C912') {
@@ -1568,15 +1687,7 @@ export default {
       }
       var fromValue = this.fromValue;
       var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
-      if (
-        fromValue.chainName == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        fromValue.storeCategory != 'C912' &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        this.$toast('经销商未选择');
-        return;
-      } else if (fromValue.orgId == '') {
+      if (fromValue.orgId == '') {
         this.$toast('部门未选择');
         return;
       } else if (fromValue.storeName == '') {
@@ -1652,17 +1763,7 @@ export default {
         }
         return;
       } else if (
-        fromValue.imgSed == '' &&
-        fromValue.ifJzStoreType != 1 &&
-        this.storeTypePOP &&
-        fromValue.storeCategory != 'C917'
-      ) {
-        this.$toast('图片未上传');
-        return;
-      } else if (
-        (fromValue.storeCategory == '10131' ||
-          fromValue.storeCategory == 'sjs61' ||
-          fromValue.storeCategory == 'zyjz63') &&
+        (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
         fromValue.tcfxName == ''
       ) {
         this.$toast('属性未填写');
@@ -1672,22 +1773,48 @@ export default {
         this.$toast('家装展厅面积未填写');
         return;
       }
-      if (fromValue.storeCategory == '129081' && fromValue.attribute3 == '') {
-        this.$toast('属性未填写');
+      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
+        this.$toast('潜在客户类型未填写');
         return;
       }
+
+      // 同城分销类型门店
       if (
-        fromValue.storeCategory == '129081' &&
-        fromValue.attribute3 == '0' &&
-        fromValue.attribute5 == ''
+        this.verifyStoreType(this.fromValue.storeCategory) &&
+        this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
       ) {
-        this.$toast('属性未填写');
-        return;
-      }
-      if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
-        this.$toast('潜在客户类型未填写');
-        return;
+        // 同城分销多经销商
+        this.fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
+        if (!this.fromValue.sfaStoreChainsContactList.length) {
+          this.$toast('经销商未填写');
+          return;
+        }
+        if (fromValue.tcfxName == '') {
+          this.$toast('属性未填写');
+          return;
+        }
+      } else {
+        // 非同城分销店 经销商必填校验
+        if (
+          fromValue.chainName == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          fromValue.storeCategory != 'C912' &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('经销商未选择');
+          return;
+        }
+        if (
+          fromValue.imgSed == '' &&
+          fromValue.ifJzStoreType != 1 &&
+          this.storeTypePOP &&
+          fromValue.storeCategory != 'C917'
+        ) {
+          this.$toast('图片未上传');
+          return;
+        }
       }
+
       let loading1 = this.$toast.loading({
         duration: 0,
         message: '加载中...',
@@ -1753,6 +1880,93 @@ export default {
         startPosition: index,
       });
     },
+    //获取经销商
+    async getStoreChainsContact() {
+      // 打开select,上次选中确认数据赋值给选中待确认,回显使用
+      this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
+      if (!this.treeSelect.length) {
+        this.toastLoading(0, '加载中...', true);
+        listChainsByCategory({ orgId: this.fromValue.orgId }).then((res) => {
+          this.toastLoading().clear();
+          // 初始化数据
+          res.data.forEach((val) => {
+            val.dot = false;
+          });
+          this.showPickerChainsList = true;
+          this.treeSelect = res.data;
+          this.setCheckData();
+        });
+      } else {
+        this.showPickerChainsList = true;
+        this.setCheckData();
+      }
+    },
+    setCheckData() {
+      for (let x = 0; x < this.treeSelect.length; x++) {
+        // 设置左侧选中图标
+        let activate = this.activatedTCFXList.find((item) => {
+          return item.categoryCode == this.treeSelect[x].code;
+        });
+        this.treeSelect[x].dot = activate ? true : false;
+        // 右侧选中返现
+        let children = this.treeSelect[x].children;
+        if (children && this.treeSelect[x].dot) {
+          for (let y = 0; y < children.length; y++) {
+            let activate = this.activatedTCFXList.find((item) => {
+              return (
+                children[y].categoryCode == item.categoryCode &&
+                children[y].chainCode == item.chainCode
+              );
+            });
+            if (activate) {
+              children[y].Check = true;
+            } else {
+              children[y].Check = false;
+            }
+          }
+        }
+      }
+      this.$forceUpdate();
+      this.activeIndex = 0;
+    },
+    // 左侧数据点击
+    clickNav(index) {
+      // this.treeSelect[index].children.forEach((val) => {
+      //   // 回显右侧选中
+      //   let activate = this.activatedTCFXList.find((item) => item.code == val.code);
+      //   val.Check = activate ? true : false;
+      // });
+    },
+    // 右侧数据点击
+    treeSelectItemClick(itemData, index, val, ind) {
+      itemData.children.forEach((item) => {
+        if (val.chainCode == item.chainCode) {
+          item.Check = !item.Check;
+          // 设置左侧选中图标
+          itemData.dot = item.Check;
+        } else {
+          item.Check = false;
+        }
+      });
+      this.$forceUpdate();
+    },
+    // 分销店 确认
+    treeSelectConfirm() {
+      let treeSelectArr = [];
+      this.treeSelect.forEach((item) => {
+        if (item.dot) {
+          let childrenData = item.children.find((val) => val.Check);
+          treeSelectArr.push(childrenData);
+        }
+      });
+      if (!treeSelectArr.length) {
+        this.$toast('请选择至少选择一个经销商');
+        return false;
+      }
+      console.log(treeSelectArr);
+      this.sfaStoreChainsContactList = treeSelectArr;
+      this.showPickerChainsList = false;
+    },
   },
 };
 </script>
@@ -1814,7 +2028,7 @@ export default {
   }
 }
 </style>
-<style>
+<style lang="scss">
 #allmap {
   width: 100px;
   height: 100px;
@@ -1865,4 +2079,43 @@ export default {
 .morelaji .van-cell {
   padding: 10px 0;
 }
+.storeEdit {
+  .agencyBox {
+    .header_btn {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 10px;
+      font-size: 16px;
+      border-bottom: 1px solid #ccc;
+      div {
+        padding: 3px;
+      }
+    }
+    .van-sidebar {
+      width: 100px;
+      text-align: center;
+      flex: none;
+    }
+    .treeSelectchildren {
+      .item {
+        display: flex;
+        align-items: center;
+        padding: 5px;
+        .value {
+          margin-left: 15px;
+        }
+      }
+    }
+  }
+  .TCFXList {
+    .van-field__control--custom {
+      flex-direction: column;
+      align-items: self-start;
+      .sfaStoreChainsContactList {
+        padding: 3px;
+      }
+    }
+  }
+}
 </style>