Parcourir la source

经销商拜访

zhujindu il y a 9 mois
Parent
commit
f1a8dfcb6a

+ 7 - 7
.env.test

@@ -3,15 +3,15 @@ VUE_APP_TITLE = 经销商拜访
 ENV = 'test'
 
 # 本地开发环境配置
-# VUE_APP_Target=http://192.168.100.191:9560/
-# VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
-# VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
-# VUE_APP_BASE_API = '/'
-#测试环境
-VUE_APP_Target=https://ssbsfatest.nipponpaint.com.cn
+VUE_APP_Target=http://192.168.100.190:9560/
 VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
 VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
-VUE_APP_BASE_API = '/ssbsfa/'
+VUE_APP_BASE_API = '/'
+#测试环境
+# VUE_APP_Target=https://ssbsfatest.nipponpaint.com.cn
+# VUE_APP_SSB_LINK=http://suishenbangtest.nipponpaint.com.cn
+# VUE_APP_XD_LINK=http://b2btest.nipponpaint.com.cn
+# VUE_APP_BASE_API = '/ssbsfa/'
 
 # 正式环境
 # VUE_APP_Target=https://ssbsfa.nipponpaint.com.cn

+ 36 - 3
src/api/home.js

@@ -1,10 +1,43 @@
 import request from '@/utils/request';
 
-// 提示类建店未完工、未结案列表信息
-export function getStoreInfos(query) {
+// 查询我负责的经销商列表
+export function queryMyChainsGroupList(query) {
   return request({
-    url: '/mobile/storeStatistics/getStoreInfos',
+    url: 'mobile/chainsGroup/queryMyChainsGroupList',
     method: 'get',
     params: query,
   });
 }
+// 查询我部门的销售部经销商列表
+export function queryMyChainsGroupListByDept(query) {
+  return request({
+    url: '/mobile/chainsGroup/queryMyChainsGroupListByDept',
+    method: 'get',
+    params: query,
+  });
+}
+// 通过经销商ID获取对应经销商任务组信息
+export function getChainsGroupTask(data) {
+  return request({
+    url: '/mobile/chainsGroup/getChainsGroupTask',
+    method: 'post',
+    data,
+  });
+}
+
+export function checkChainsAddressByChainCode(query) {
+  return request({
+    url: '/mobile/chainsGroup/checkChainsAddressByChainCode',
+    method: 'get',
+    params: query,
+  });
+}
+
+// 查询主经销商
+export function getMainchains(data) {
+  return request({
+    url: '/mobile/chainsGroup/getMainchains',
+    method: 'post',
+    data,
+  });
+}

+ 1 - 8
src/api/index.js

@@ -86,14 +86,7 @@ export function restartProcess(query) {
     params: query,
   });
 }
-// 计划外
-export function queryMyChainsGroupList(query) {
-  return request({
-    url: 'mobile/chainsGroup/queryMyChainsGroupList',
-    method: 'get',
-    params: query,
-  });
-}
+
 export function getUserOutPlaList(query) {
   return request({
     url: 'mobile/route/userOutPlan',

+ 213 - 0
src/components/uploadVvisit.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="questionNamep">
+    <div class="cameraDivp" @click="uploadImg">
+      <van-icon class="photo" name="photograph" size="22px" color="#969696" />
+    </div>
+    <div id="allmap"></div>
+  </div>
+</template>
+
+<script>
+import { addstorePhoto } from '@/api/index';
+import axios from 'axios';
+
+export default {
+  name: 'uploadImg',
+  props: {
+    shouws: {
+      type: Boolean,
+      default: false,
+    },
+    uploadid: {
+      type: String,
+      default: '',
+    },
+    storeGroupId: {
+      type: String,
+      default: '',
+    },
+    visitsId: {
+      type: String,
+      default: '',
+    },
+    taskId: {
+      type: String,
+      default: '',
+    },
+    collectionId: {
+      type: String,
+      default: '',
+    },
+    objectType: {
+      type: String,
+      default: 'rw-ycbf',
+    },
+    visitModel: {
+      type: String,
+      default: '3',
+    },
+  },
+  methods: {
+    uploadImg() {
+      let url = window.location.href;
+      let that = this;
+      let wx = this.wx;
+      let qiyeData;
+      let addressesRemark = '';
+      var map = new TMap.Map('allmap', {
+        zoom: 14,
+        center: new TMap.LatLng(39.986785, 116.301012),
+      });
+
+      var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
+      var markers = new TMap.MultiMarker({
+        map: map,
+        geometries: [],
+      });
+      markers.setGeometries([]);
+      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) {
+            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', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
+            });
+            wx.ready(function () {
+              wx.getLocation({
+                type: 'gcj02',
+                success: function (res) {
+                  var location = new TMap.LatLng(res.latitude, res.longitude);
+                  map.setCenter(location);
+                  markers.updateGeometries([
+                    {
+                      id: 'main', // 点标注数据数组
+                      position: location,
+                    },
+                  ]);
+                  geocoder.getAddress({ location: location }).then(
+                    function (result) {
+                      var addresses = result.result.formatted_addresses;
+                      addressesRemark = addresses.recommend;
+                    },
+                    function (err) {
+                      addressesRemark = '';
+                    }
+                  );
+                },
+                fail: function () {
+                  that.$dialog.alert({
+                    message: 'GPS未开启',
+                  });
+                },
+              });
+              wx.chooseImage({
+                count: 1,
+                sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+                sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
+                defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+                isSaveToAlbum: 0,
+                success: function (res) {
+                  var localIds = '';
+                  if (res.localIds != undefined) {
+                    localIds = res.localIds[0];
+                  } else {
+                    localIds = res.localId;
+                  }
+                  // andriod中localId可以作为img标签的src属性显示图片;
+                  // iOS应当使用 getLocalImgData 获取图片base64数据,从而用于img标签的显示(在img标签内使用 wx.chooseImage 的 localid 显示可能会不成功)
+                  wx.uploadImage({
+                    localId: localIds, // 需要上传的图片的本地ID,由chooseImage接口获得
+                    isShowProgressTips: 1, // 默认为1,显示进度提示
+                    success: function (res) {
+                      that.uploadImagev(res.serverId, addressesRemark);
+                    },
+                  });
+                },
+              });
+            });
+          }
+        });
+    },
+    uploadImagev(meidaId, addressesRemark) {
+      var that = this;
+      var form = {
+        mediaId: meidaId,
+        collectionItemId: that.collectionId,
+        objectType: that.objectType,
+        storeGroupId: that.storeGroupId,
+        taskId: '',
+        visitsId: localStorage.getItem('visitId'),
+        visitModel: that.visitModel,
+        visitSource: '2',
+        locationRemark: addressesRemark,
+      };
+      var loind1 = that.$toast.loading({
+        duration: 0,
+        message: '上传中...',
+        forbidClick: true,
+      });
+      addstorePhoto(form).then((res) => {
+        if (res.code == 200) {
+          loind1.clear();
+          that.$toast('上传成功!');
+          that.$emit('newimgarr', { fileUrl: res.data.url, id: res.data.fileId, type: 2 });
+        } else {
+          that.$toast('上传失败!');
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.questionNamep {
+  font-size: 16px;
+  color: #484848;
+  line-height: 40px;
+  padding: 0 15px;
+  box-sizing: border-box;
+  position: relative;
+
+  .cameraDivp {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    .photo {
+      /*margin-top: 9px;*/
+      float: right;
+    }
+
+    .camera {
+      width: 60px;
+      height: 100%;
+      position: absolute;
+      right: 0;
+      top: 0;
+      opacity: 0;
+      z-index: 89;
+    }
+  }
+}
+#allmap {
+  width: 10px;
+  height: 10px;
+  left: -1000px;
+  position: relative;
+}
+</style>

+ 2 - 2
src/main.js

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

+ 10 - 2
src/router/index.js

@@ -8,7 +8,7 @@ VueRouter.prototype.push = function push(location) {
 };
 Vue.use(VueRouter);
 const router = new VueRouter({
-  mode: 'history',
+  mode: 'hash',
   // scrollBehavior(to, from, savedPosition) {
   //   if (savedPosition) {
   //     return savedPosition;
@@ -16,7 +16,7 @@ const router = new VueRouter({
   //     return { x: 0, y: 0 };
   //   }
   // },
-  base: '/agent/',
+  base: '/mobile/',
 
   routes: [
     {
@@ -64,6 +64,14 @@ const router = new VueRouter({
             title: '拜访历史详情',
           },
         },
+        {
+          path: '/visitAbnormal',
+          name: 'visitAbnormal',
+          component: () => import('@/views/home/visitAbnormal.vue'),
+          meta: {
+            title: '拜访异常',
+          },
+        },
       ],
     },
     {

+ 4 - 4
src/utils/index.js

@@ -210,12 +210,12 @@ export function gcj02BD(gcjLat, gcjLon) {
  *门店类型集合,返回对应的类型
  *@param {*String} dictValue //类型
  *  */
-export function verifyStoreType(dictValue) {
+export function verifyChainType(dictValue) {
   if (!dictValue) return null;
   let storeData = null;
-  storeData = store.getters.storeType.find((val) => val.dictValue == dictValue);
-  let remarkType = storeData ? JSON.parse(storeData.remark) : null;
-  return remarkType;
+  storeData = store.getters.chainsType.find((val) => val.dictValue == dictValue);
+  let dictLabel = storeData ? storeData.dictLabel : '';
+  return dictLabel;
 }
 
 export function getMonthCommon() {

+ 168 - 210
src/views/home/index.vue

@@ -8,7 +8,7 @@
       </van-nav-bar>
       <div class="searchDiv">
         <van-search
-          v-model="storeName"
+          v-model="chainsName"
           left-icon="search"
           show-action
           placeholder="搜索名称/编号/地址"
@@ -31,16 +31,16 @@
           :finished="finished"
           finished-text="--已经到底了--"
           @load="onLoad">
-          <div class="cellcontent" v-for="(item, index) in list" :key="index">
+          <div class="cellcontent" v-for="(item, index) in list" :key="index" v-if="list.length">
             <van-cell>
               <div class="card">
                 <div class="title titlero">
                   <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
-                    <span>{{ item.storeName }}</span>
-                    (<span>{{ item.storeCode }}</span
+                    <span>{{ item.chainName }}</span>
+                    (<span>{{ item.chainCode }}</span
                     >)
                   </span>
-                  <span class="btn" :data-clipboard-text="item.storeCode">
+                  <span class="btn" :data-clipboard-text="item.chainCode">
                     <van-icon
                       :name="require('@/assets/icon/paste.png')"
                       color="#ee0a24"
@@ -48,11 +48,11 @@
                       style="top: 6px; margin-left: 4px" />
                   </span>
                 </div>
-                <div class="info">客户分类:{{ item.storeCategory }}</div>
-                <div class="info">实际经营者:{{ item.storeCategory }}</div>
-                <div class="info">开户日期:{{ item.storeCategory }}</div>
-                <div class="info">是否冻结:{{ item.storeCategory }}</div>
-                <div class="info">是否关户:{{ item.storeCategory }}</div>
+                <div class="info">客户分类:{{ verifyChainType(item.typeCode2) }}</div>
+                <div class="info">实际经营者:{{ item.customerManager }}</div>
+                <div class="info">开户日期:{{ item.openDate }}</div>
+                <div class="info">是否冻结:{{ item.freeze }}</div>
+                <div class="info">是否关户:{{ item.close }}</div>
               </div>
               <div
                 class="statstext"
@@ -86,14 +86,14 @@
                       异常拜访
                     </p>
                   </van-col>
-                  <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
+                  <!-- <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
                     <img
                       :src="require('@/assets/icon/bfxx.png')"
                       style="margin: 0 auto; height: 18px; display: block" />
                     <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
                       拜访信息
                     </p>
-                  </van-col>
+                  </van-col> -->
                   <van-col span="5" @click="visitFn(item)">
                     <img
                       :src="require('@/assets/icon/kehuxinxi-2.png')"
@@ -173,8 +173,8 @@
               片区经销商<van-icon name="arrow-down" style="float: right" />
             </p>
             <div v-if="otherfxdShow1">
-              <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
-                <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
+              <div v-for="(item1, index1) in PQChain" :key="200 + index1" class="checkbox1">
+                <div class="child">
                   <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
                 </div>
               </div>
@@ -184,11 +184,8 @@
               非片区经销商<van-icon name="arrow-down" style="float: right" />
             </p>
             <div v-if="otherfxdShow2">
-              <div
-                v-for="(itemlj, indexlj) in storeTypeLists"
-                :key="400 + indexlj"
-                class="checkbox1">
-                <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
+              <div v-for="(itemlj, indexlj) in FPQChain" :key="400 + indexlj" class="checkbox1">
+                <div class="child">
                   <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
                 </div>
               </div>
@@ -196,16 +193,6 @@
             </div>
           </div>
           <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
-          <!-- <p class="searchchecktitle" @click="otherShow = !otherShow">
-            &nbsp;其他 <van-icon name="arrow-down" style="float: right" />
-          </p>
-          <div v-if="otherShow">
-            <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
-              <div v-if="item2.groupType == 'other'" class="child">
-                <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
-              </div>
-            </div>
-          </div> -->
         </van-checkbox-group>
       </div>
     </van-popup>
@@ -266,27 +253,25 @@
 
 <script>
 import {
-  queryMyChainsGroupList,
-  getUserOrgStoreList,
-  stopVisit,
   checkVisit,
   addVisitsPosition,
   mobileReposition,
-  getStoreyslTypeList,
   getStoreTypeListlp,
-  joinInPlan,
   getStoreLabels,
   getCustomerList,
   buryingPoint,
-  ProductItemImge,
-  getUserOutPlaList,
 } from '@/api/index';
-import request from '@/utils/request';
 import { checkStoreAddressByStoreCode } from '@/api/visitstore';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
 import { mapState } from 'vuex';
 import store from '@/store';
 import { scrollTopMixins } from '@/mixin/scrollTop';
+import {
+  queryMyChainsGroupList,
+  queryMyChainsGroupListByDept,
+  checkChainsAddressByChainCode,
+  getMainchains,
+} from '@/api/home';
 export default {
   name: 'outsidelist',
   mixins: [scrollTopMixins],
@@ -324,13 +309,14 @@ export default {
       pageNum: 1,
       listActive: null,
       query: '',
-      storeName: '',
+      chainsName: '',
       storeType: '',
       endShow: false,
       storeCategory: '',
       fromValue: {},
       storeTypeList: [],
-      storeTypeLists: [],
+      PQChain: [],
+      FPQChain: [],
       chainsData: [],
       serachstype: '',
       addShow1: false,
@@ -380,7 +366,6 @@ export default {
       } else {
         this.storeLabelTypes = [];
       }
-      this.storeName = localStorage.getItem('outvstoreName'); //搜索框内容
       this.chainName = localStorage.getItem('outvchainName'); //筛选-经销商名称搜索
       this.chainCode = localStorage.getItem('outvchainCode'); //筛选-经销商Code
       // 筛选-店型选择
@@ -408,7 +393,7 @@ export default {
       return { color: '#0057ba', 'text-decoration': 'underline' };
     },
     clearFn() {
-      this.storeName = '';
+      this.chainsName = '';
       localStorage.setItem('outvstoreName', '');
     },
     moreTypeShowFn() {
@@ -419,13 +404,7 @@ export default {
       buryingPoint(val);
     },
     getCustomer() {
-      var name = '';
-      if (this.tabVal != 1) {
-        name = 'org';
-      } else {
-        name = 'my';
-      }
-      getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
+      getMainchains({ mainChainsName: this.CustomerName }).then((request) => {
         this.chainsData = request.data;
         this.chainsData.push({});
         this.chainsData.pop();
@@ -448,7 +427,6 @@ export default {
     },
     onConfirm(value) {
       this.storeCategoryList = this.result.join(',');
-      // this.typeName=value.dictLabel
       this.showPicker = false;
       this.onSearchm();
     },
@@ -461,17 +439,15 @@ export default {
       this.monthVisited = '';
       this.onSearch();
     },
-    getStoreTypeList() {
-      if (this.storeTypeLists.length == 0) {
-        getStoreTypeListlp({}).then((res) => {
-          this.storeTypeLists = res.data;
-          this.storeTypeList = res.data;
-        });
+    setChainTypeList() {
+      if (store.getters.chainsType) {
+        this.PQChain = store.getters.chainsType.filter((val) => val.remark == 'pq');
+        this.FPQChain = store.getters.chainsType.filter((val) => val.remark == 'fp');
       }
     },
     searchFn() {
       //获取门店类型  //获取门店标签
-      Promise.all([this.getStoreTypeList(), this.getStoreLabels()]).then(() => {
+      Promise.all([this.setChainTypeList(), this.getStoreLabels()]).then(() => {
         this.showPicker = true;
         this.CustomerName = '';
       });
@@ -485,14 +461,14 @@ export default {
       }
       this.disabled = true;
       this.toastLoading(0, '加载中...', true);
-      getUserOrgStoreList({
+      queryMyChainsGroupListByDept({
         lat: this.lat,
         lon: this.lon,
-        chainCode: this.chainCode ? this.chainCode : '',
         pageNum: this.pageNum,
         typeCodeList: this.storeCategoryList,
         pageSize: this.pageSize,
-        storeName: this.storeName.trim(),
+        chainsName: this.chainsName.trim(),
+        monthVisited: this.monthVisited, //本月是否拜访1=拜访,0=未拜访
       }).then((res) => {
         this.disabled = false;
         this.toastLoading().clear();
@@ -502,7 +478,7 @@ export default {
             this.list = [];
           }
 
-          this.list = this.list.concat(res.data);
+          this.list = this.list.concat(res.rows);
           if (this.list.length >= res.total) {
             this.finished = true;
           } else {
@@ -531,13 +507,12 @@ export default {
         this.refreshing = false;
       }
       queryMyChainsGroupList({
-        // lat: this.lat,
-        // lon: this.lon,
-        // chainCode: this.chainCode ? this.chainCode : '',
+        lat: this.lat,
+        lon: this.lon,
         pageNum: this.pageNum,
         typeCodeList: this.storeCategoryList,
         pageSize: this.pageSize,
-        chainsName: this.storeName.trim(),
+        chainsName: this.chainsName.trim(),
         monthVisited: this.monthVisited, //本月是否拜访1=拜访,0=未拜访
       }).then((res) => {
         this.disabled = false;
@@ -568,71 +543,64 @@ export default {
     storeVisit(val) {
       localStorage.setItem('tabVal', this.tabVal);
       localStorage.removeItem('visitId');
-      checkVisit({ storeId: val.storeId }).then((res) => {
-        this.buryingPoint({
-          systemModel: '计划外',
-          buryingPointType: 1,
-          buryingPointValue: val.storeName + '(' + val.storeCode + ')',
-          buryingPointName: '进店拜访',
-          buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
+      this.buryingPoint({
+        systemModel: '计划外',
+        buryingPointType: 1,
+        buryingPointValue: val.chainName + '(' + val.chainCode + ')',
+        buryingPointName: '进店拜访',
+        buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
+      });
+      if (val.stateString.indexOf('拜访中') != -1) {
+        localStorage.setItem('startTime', new Date());
+        localStorage.setItem('ORGName', val.deptName);
+        localStorage.setItem('chainNameR', val.chainName);
+        this.$router.push({
+          path: '/visitPage',
+          query: {
+            typeCode2: val.typeCode2,
+            chainId: val.chainId,
+            rdId: val.rdId,
+            lat: val.lat,
+            lon: val.lon,
+            visitId: val.visitId,
+            pageType: 'out',
+            addressLine: val.addressLine,
+            storeCategory: val.storeCategory,
+            chainName: val.chainName,
+            hisTime: val.hisTime,
+            contactName: val.contactName,
+            chainCode: val.chainCode,
+            tabVal: this.tabVal,
+            visitModel: '1',
+            latNew: val.lat,
+            lonNew: val.lon,
+            PointSum: '0',
+            marklat: val.lat,
+            marklon: val.lon,
+            from: 'outPlan',
+          },
         });
-        if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
-          if (val.stateString.indexOf('拜访中') != -1) {
-            localStorage.setItem('startTime', new Date());
-            localStorage.setItem('ORGName', val.deptName);
-            localStorage.setItem('chainNameR', val.storeName);
-            this.$router.push({
-              path: '/visitPage',
-              query: {
-                storeId: val.storeId,
-                rdId: val.rdId,
-                lat: val.lat,
-                lon: val.lon,
-                visitId: val.visitId,
-                pageType: 'out',
-                addressLine: val.addressLine,
-                storeCategory: val.storeCategory,
-                storeName: val.storeName,
-                hisTime: val.hisTime,
-                contactName: val.contactName,
-                storeCode: val.storeCode,
-                tabVal: this.tabVal,
-                visitModel: '1',
-                latNew: val.lat,
-                lonNew: val.lon,
-                PointSum: '0',
-                marklat: val.lat,
-                marklon: val.lon,
-                from: 'outPlan',
-              },
+      } else {
+        getPosition()
+          .then((res) => {
+            let { TXisBD, resData } = res;
+            this.lat = TXisBD.lat;
+            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) => {
+            this.$dialog.alert({
+              message: error,
             });
-          } else {
-            getPosition()
-              .then((res) => {
-                let { TXisBD, resData } = res;
-                this.lat = TXisBD.lat;
-                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) => {
-                this.$dialog.alert({
-                  message: error,
-                });
-              });
-          }
-        } else {
-          this.$dialog.alert({
-            message: res.msg,
           });
-        }
-      });
+      }
     },
     checkStoreAddressByStoreCodeFun(val, location, res) {
-      checkStoreAddressByStoreCode({
-        storeCode: val.storeCode,
+      checkChainsAddressByChainCode({
+        chainCode: val.chainCode,
         lon: location.lon,
         lat: location.lat,
       }).then((response) => {
@@ -647,11 +615,11 @@ export default {
           location.lon
         ).toFixed(2);
         //  直接进入拜访 不校验经纬度
-        localStorage.setItem('startTime', new Date());
-        localStorage.setItem('ORGName', val.deptName);
-        localStorage.setItem('chainNameR', val.storeName);
-        this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
-        return;
+        // localStorage.setItem('startTime', new Date());
+        // localStorage.setItem('ORGName', val.deptName);
+        // localStorage.setItem('chainNameR', val.chainName);
+        // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
+        // return;
         // 门店校验 地址不通过
         if (response.code != 200) {
           // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
@@ -685,7 +653,7 @@ export default {
                   this.$router.push({
                     path: '/storeDetail',
                     query: {
-                      id: val.storeId,
+                      id: val.chainId,
                       type: 'address',
                       storeAddressId: val.storeAddressId,
                     },
@@ -722,7 +690,7 @@ export default {
         })
         .then(() => {
           mobileReposition({
-            storeId: val.storeId,
+            chainId: val.chainId,
             lat: location.lat,
             lon: location.lon,
           }).then((response) => {
@@ -737,7 +705,7 @@ export default {
                 });
               localStorage.setItem('startTime', new Date());
               localStorage.setItem('ORGName', val.deptName);
-              localStorage.setItem('chainNameR', val.storeName);
+              localStorage.setItem('chainNameR', val.chainName);
             } else {
               this.$toast(response.msg);
             }
@@ -747,7 +715,7 @@ export default {
     // 进入拜访 router.push
     toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
       addVisitsPosition({
-        storeId: val.storeId,
+        chainId: val.chainId,
         visitsId: '',
         lon: res.longitude,
         lat: res.latitude,
@@ -761,7 +729,8 @@ export default {
         this.$router.push({
           path: '/visitPage',
           query: {
-            storeId: val.storeId,
+            typeCode2: val.typeCode2,
+            chainId: val.chainId,
             rdId: val.rdId,
             lat: location.lat,
             lon: location.lon,
@@ -769,10 +738,10 @@ export default {
             pageType: 'out',
             addressLine: val.addressLine,
             storeCategory: val.storeCategory,
-            storeName: val.storeName,
+            chainName: val.chainName,
             hisTime: val.hisTime,
             contactName: val.contactName,
-            storeCode: val.storeCode,
+            chainCode: val.chainCode,
             tabVal: this.tabVal,
             visitModel: '1',
             latNew: location.lat,
@@ -789,89 +758,77 @@ export default {
     abnormalVisit(val) {
       localStorage.removeItem('visitId');
       localStorage.setItem('tabVal', this.tabVal);
-      checkVisit({ storeId: val.storeId }).then((res) => {
-        this.buryingPoint({
-          systemModel: '计划外',
-          buryingPointType: 1,
-          buryingPointValue: val.storeName + '(' + val.storeCode + ')',
-          buryingPointName: '异常拜访',
-          buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
-        });
-        if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
-          getPosition()
-            .then((res) => {
-              let { TXisBD, resData } = res;
-              this.lat = TXisBD.lat;
-              this.lon = TXisBD.lon;
-              localStorage.setItem('lat', this.lat);
-              localStorage.setItem('lon', this.lon);
-              let PointSum = this.twoPointSum(
-                TXisBD.lat,
-                TXisBD.lon,
-                TXisBD.lat,
-                TXisBD.lon
-              ).toFixed(2);
-              addVisitsPosition({
-                storeId: val.storeId,
-                visitsId: '',
-                lon: resData.longitude,
-                lat: resData.latitude,
-                sourceLon: location.lon,
-                sourceLat: location.lat,
-                positionDesc: '',
-                accuracy: resData.accuracy,
-              }).then((response) => {
-                // 进入拜访之前先刷新页面
-                store.dispatch('setDeviceOutsidePage', true);
-                this.$router.push({
-                  path: '/outabnormalVisit',
-                  query: {
-                    storeId: val.storeId,
-                    rdId: val.rdId,
-                    lat: this.lat,
-                    lon: this.lon,
-                    visitId: val.visitId,
-                    pageType: 'out',
-                    visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
-                    storeCode: val.storeCode,
-                    tabVal: this.tabVal,
-                    latNew: TXisBD.lat,
-                    lonNew: TXisBD.lon,
-                    PointSum: PointSum,
-                    marklat: resData.latitude,
-                    marklon: resData.longitude,
-                  },
-                });
-                localStorage.setItem('startTime', new Date());
-                localStorage.setItem('ORGName', val.deptName);
-                localStorage.setItem('chainNameR', val.storeName);
-              });
-            })
-            .catch((error) => {
-              this.$dialog.alert({
-                message: error,
-              });
+      this.buryingPoint({
+        systemModel: '计划外',
+        buryingPointType: 1,
+        buryingPointValue: val.chainName + '(' + val.chainCode + ')',
+        buryingPointName: '异常拜访',
+        buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
+      });
+      getPosition()
+        .then((res) => {
+          let { TXisBD, resData } = res;
+          this.lat = TXisBD.lat;
+          this.lon = TXisBD.lon;
+          localStorage.setItem('lat', this.lat);
+          localStorage.setItem('lon', this.lon);
+          let PointSum = this.twoPointSum(TXisBD.lat, TXisBD.lon, TXisBD.lat, TXisBD.lon).toFixed(
+            2
+          );
+          addVisitsPosition({
+            chainId: val.chainId,
+            visitsId: '',
+            lon: resData.longitude,
+            lat: resData.latitude,
+            sourceLon: location.lon,
+            sourceLat: location.lat,
+            positionDesc: '',
+            accuracy: resData.accuracy,
+          }).then((response) => {
+            // 进入拜访之前先刷新页面
+            store.dispatch('setDeviceOutsidePage', true);
+            this.$router.push({
+              path: '/visitAbnormal',
+              query: {
+                chainId: val.chainId,
+                rdId: val.rdId,
+                lat: this.lat,
+                lon: this.lon,
+                visitId: val.visitId,
+                pageType: 'out',
+                visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
+                chainCode: val.chainCode,
+                tabVal: this.tabVal,
+                latNew: TXisBD.lat,
+                lonNew: TXisBD.lon,
+                PointSum: PointSum,
+                marklat: resData.latitude,
+                marklon: resData.longitude,
+              },
             });
-        } else {
+            localStorage.setItem('startTime', new Date());
+            localStorage.setItem('ORGName', val.deptName);
+            localStorage.setItem('chainNameR', val.chainName);
+          });
+        })
+        .catch((error) => {
           this.$dialog.alert({
-            title: '系统提示',
-            message: res.msg,
+            message: error,
           });
-        }
-      });
+        });
     },
     // 客户门店
     visitFn(val) {
       this.buryingPoint({
         systemModel: '计划外',
         buryingPointType: 1,
-        buryingPointValue: val.storeName + '(' + val.storeCode + ')',
+        buryingPointValue: val.chainName + '(' + val.chainCode + ')',
         buryingPointName: '客户信息',
         buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
       });
       this.$router.push({
         path: '/storeDetail',
-        query: { id: val.storeId, detilId: 'a' },
+        query: { id: val.chainId, detilId: 'a' },
       });
     },
     // 拜访信息
@@ -880,8 +837,8 @@ export default {
         path: '/historicalDetails',
         query: {
           visitId: val.visitId,
-          storeId: val.storeId,
-          storeCode: val.storeCode,
+          chainId: val.chainId,
+          chainCode: val.chainCode,
         },
       });
     },
@@ -895,6 +852,7 @@ export default {
       this.onLoad();
     },
     onSearchm() {
+      storeCategoryList;
       var StoreLabelsArr = [];
       for (var k = 0; k < this.storeLabelTypes.length; k++) {
         for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
@@ -911,7 +869,7 @@ export default {
           }
         }
       }
-      localStorage.setItem('outvstoreName', this.storeName);
+      localStorage.setItem('outvstoreName', this.chainName);
       localStorage.setItem('outvchainName', this.chainName);
       localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
       localStorage.setItem('outvstoreCategoryList', this.result);
@@ -955,9 +913,9 @@ export default {
     },
     // 跳转好帮手门店详情
     goOtherSystem(item) {
-      if (item.storeCode) {
+      if (item.chainCode) {
         window.location.href =
-          process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
+          process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.chainCode;
       } else {
         this.$dialog.alert({
           message: '缺少门店code',

+ 350 - 0
src/views/home/visitAbnormal.vue

@@ -0,0 +1,350 @@
+<template>
+  <div class="visitAbnormal">
+    <div class="header">
+      <van-nav-bar class="navBar" title="异常拜访" left-arrow @click-left="onClickLeft">
+        <template #right>
+          <span @click="onstopVisit" class="navRightBtnTop">取消拜访</span>
+        </template>
+      </van-nav-bar>
+    </div>
+    <div class="container">
+      <van-form class="bgWhite">
+        <div class="formLabel">
+          <van-cell>
+            <template #title> <span class="van-f-red">*</span>异常信息照 </template>
+            <template #right-icon>
+              <upload-img
+                :uploadid="uploadid2"
+                :imgArr="imgs"
+                @newimgarr="newimgarr1"
+                :visitModel="visitModel"
+                :visitsId="visitId"
+                :taskId="rdId"></upload-img>
+            </template>
+          </van-cell>
+        </div>
+        <div style="padding: 10px 10px 0">
+          <delete-upload-img :imgs="imgs" @delimg="newimgarr1"></delete-upload-img>
+        </div>
+        <div class="formLabel">
+          <van-cell>
+            <template #title> <span class="van-f-red">*</span>异常事由 </template>
+          </van-cell>
+          <van-radio-group v-model="abnormalReason" class="z-checkbox">
+            <van-radio :name="item.dictValue" v-for="(item, index) in typeList" :key="index">{{
+              item.dictLabel
+            }}</van-radio>
+          </van-radio-group>
+        </div>
+        <div class="formLabel" style="padding-bottom: 20px">
+          <van-cell>
+            <van-cell>
+              <template #title> <span class="van-f-red">*</span>信息备注 </template>
+            </van-cell>
+          </van-cell>
+          <van-field
+            v-model="remark"
+            rows="3"
+            autosize
+            maxlength="260"
+            show-word-limit
+            label=""
+            :formatter="formatter"
+            type="textarea"
+            placeholder="请填写异常信息" />
+        </div>
+      </van-form>
+      <div class="formLabel" style="margin: 20px 16px">
+        <van-button
+          block
+          type="info"
+          size="normal"
+          style="background-color: #0057ba"
+          @click="endVisitsFn"
+          >提交
+        </van-button>
+      </div>
+    </div>
+    <div id="allmap"></div>
+  </div>
+</template>
+
+<script>
+import uploadImg from '@/components/uploadVvisit';
+import deleteUploadImg from '@/components/deleteUploadImg1';
+import { addVisits, endVisits, getPhotoTypeList1, stopVisit } from '@/api/index';
+
+export default {
+  name: 'outabnormalVisit',
+  components: { uploadImg, deleteUploadImg },
+  data() {
+    return {
+      PhotoTypeList: [],
+      typeList: '',
+      imgs: [],
+      cont: 0,
+      abnormalReason: '',
+      uploadid2: 'uploadid2',
+      remark: '',
+      lat: '',
+      lon: '',
+      chainCode: '',
+      dialogms: true,
+      visitModel: '',
+    };
+  },
+  created() {
+    this.urlParameter = this.$route.query;
+    this.chainId = this.$route.query.chainId + '';
+    this.visitId = this.$route.query.visitId;
+    this.chainCode = this.$route.query.chainCode;
+    this.rdId = this.$route.query.rdId + '';
+    this.lat = this.$route.query.lat + '';
+    this.lon = this.$route.query.lon + '';
+    this.visitModel = this.$route.query.visitModel + '';
+    this.imgs = [];
+    this.remark = '';
+    this.abnormalReason = '';
+    // this.addVisits();
+    this.getPhotoTypeList();
+  },
+  methods: {
+    // 结束拜访
+    onstopVisit() {
+      this.$dialog
+        .confirm({
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          title: '系统提示',
+          message: '取消拜访会清空填写的拜访内容和照片,是否确认?',
+        })
+        .then(() => {
+          stopVisit({ visitsId: this.visitId }).then((res) => {
+            if (res.code == 200) {
+              this.$dialog
+                .alert({
+                  title: '系统提示',
+                  message: '拜访中任务结束成功!',
+                })
+                .then(() => {
+                  window.location.replace(window.location.origin + '/mobile/outsidelist/index');
+                });
+            } else {
+              this.$toast(res.msg);
+            }
+          });
+        });
+    },
+    formatter(value) {
+      return value.replace(
+        /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
+        ''
+      );
+    },
+    getPhotoTypeList() {
+      getPhotoTypeList1({}).then((res) => {
+        this.typeList = res.data;
+      });
+    },
+    newimgarr1(val) {
+      this.imgs.push(val);
+    },
+    onClickLeft() {
+      this.$router.go(-1);
+    },
+    addVisits() {
+      var that = this;
+      var visitEntry = '';
+      if (this.urlParameter.tabVal == '0') {
+        visitEntry = '2';
+      } else {
+        visitEntry = '1';
+      }
+      var map = new TMap.Map('allmap', {
+        zoom: 14,
+        center: new TMap.LatLng(39.986785, 116.301012),
+      });
+      var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
+      var markers = new TMap.MultiMarker({
+        map: map,
+        geometries: [],
+      });
+
+      markers.setGeometries([]);
+      var input = [that.urlParameter.marklat, that.urlParameter.marklon];
+      var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
+      map.setCenter(location);
+      markers.updateGeometries([
+        {
+          id: 'main', // 点标注数据数组
+          position: location,
+        },
+      ]);
+      geocoder.getAddress({ location: location }).then(
+        function (result) {
+          var addresses = result.result.formatted_addresses;
+          var params = {
+            chainId: that.chainId,
+            chainCode: that.chainCode,
+            visitEntry: visitEntry,
+            lat: that.urlParameter.lat,
+            lon: that.urlParameter.lon,
+            visitModel: that.$route.query.visitModel,
+            visitSource: '2',
+            routeDetailsId: that.rdId,
+            locationCity: '',
+            locationRemark: addresses.recommend,
+            locationAccuracy: that.urlParameter.PointSum,
+          };
+          localStorage.setItem('address', '');
+          if (that.visitId != null) {
+            params.id = that.visitId;
+          }
+          addVisits(params).then((res) => {
+            if (res.code == 200) {
+              localStorage.setItem('visitId', res.data);
+              that.visitId = res.data;
+            } else {
+              that.$toast(res.msg);
+            }
+          });
+        },
+        function (err) {
+          var params = {
+            chainId: that.chainId,
+            chainCode: that.chainCode,
+            visitEntry: visitEntry,
+            lat: that.urlParameter.lat,
+            lon: that.urlParameter.lon,
+            visitModel: that.$route.query.visitModel,
+            visitSource: '2',
+            routeDetailsId: that.rdId,
+            locationCity: '',
+            locationRemark: '',
+            locationAccuracy: that.urlParameter.PointSum,
+          };
+          localStorage.setItem('address', '');
+          if (that.visitId != null) {
+            params.id = that.visitId;
+          }
+          addVisits(params).then((res) => {
+            if (res.code == 200) {
+              localStorage.setItem('visitId', res.data);
+              that.visitId = res.data;
+            } else {
+              that.$toast(res.msg);
+            }
+          });
+        }
+      );
+    },
+    endVisitsFn() {
+      if (this.imgs.length == 0) {
+        this.$toast('请上传图片');
+        return;
+      }
+      if (this.abnormalReason == '') {
+        this.$toast('请选择事由');
+        return;
+      } else if (this.remark.trim() == '') {
+        this.$toast('请填写异常内容');
+        return;
+      } else {
+        let dwellTime = this.weekend(localStorage.getItem('startTime'));
+        endVisits({
+          visitSource: '2',
+          dwellTime: dwellTime,
+          remark: this.remark,
+          visitType: '0',
+          abnormalReason: this.abnormalReason,
+          id: this.visitId,
+          chainCode: this.chainCode,
+          visitModel: this.$route.query.visitModel,
+        }).then((res) => {
+          if (res.code == 200) {
+            this.$dialog
+              .alert({
+                title: '系统提示',
+                message: '保存成功',
+              })
+              .then(() => {
+                if (this.$route.query.linkType == 6) {
+                  window.location.replace(window.location.origin + '/mobile/topStore?info=y');
+                } else {
+                  window.location.replace(
+                    window.location.origin + '/mobile/outsidelist/index?info=y'
+                  );
+                }
+              });
+            localStorage.removeItem('visitId');
+            localStorage.removeItem('startTime');
+          } else {
+            this.$toast.fail(res.msg);
+          }
+        });
+      }
+    },
+    weekend(time1) {
+      var arrtime1 = new Date(time1).getTime();
+      var arrtime2 = new Date().getTime();
+      return Math.round((arrtime2 - arrtime1) / 1000);
+    },
+  },
+};
+</script>
+<style scoped>
+.bgWhite {
+  background-color: white;
+}
+.container {
+  padding-bottom: 50px;
+}
+.van-f-red {
+  color: red;
+  width: 4px;
+  display: inline-block;
+}
+.formLabel {
+  margin: 0 16px;
+  border-bottom: 1px solid #f1f1f1;
+}
+.formLabel .van-cell {
+  padding: 10px 0;
+}
+.z-checkbox .van-radio {
+  padding: 6px 0;
+}
+</style>
+<style>
+#allmap {
+  width: 20px;
+  height: 20px;
+  left: -1000px;
+  position: relative;
+}
+.formLabel .van-field {
+  border: 1px solid #f1f1f1;
+  padding: 10px;
+  width: 100%;
+  background-color: #f1f1f1;
+}
+.formLabel .van-field__control {
+  padding: 0 10px;
+}
+.lineGrey {
+  height: 10px;
+  width: 100%;
+  background: #f1f1f1;
+}
+.van-dialog__confirm,
+.van-dialog__confirm:active {
+  color: #0057ba;
+}
+.navRightBtnTop {
+  color: white;
+  background: #74a4d9;
+  display: block;
+  padding: 6px 10px;
+  border-radius: 6px;
+}
+</style>

+ 4 - 3
src/views/home/visitHistory.vue

@@ -7,7 +7,7 @@
     <div class="container">
       <div class="card" v-if="data">
         <div class="title f-blue">
-          {{ data.storeName }}(<span style="color: #0057ba">{{ data.storeCode }}</span
+          {{ datachainsName }}(<span style="color: #0057ba">{{ data.chainCode }}</span
           >)
         </div>
         <div class="info">客户分类:{{ data.storeCategory }}</div>
@@ -36,11 +36,12 @@ export default {
   data() {
     return {
       data: null,
-      storeId: '',
+      chainId: '',
+      list: [],
     };
   },
   created() {
-    this.storeId = this.$route.query.storeId;
+    this.chainId = this.$route.query.chainId;
   },
   mounted() {},
   methods: {

+ 6 - 6
src/views/home/visitHistoryDetail.vue

@@ -9,14 +9,14 @@
       <div class="lineGrey"></div>
       <div class="card mt10">
         <div class="title">
-          {{ list.storeName }}(<span style="color: #1989fa">{{ list.storeCode }}</span
+          {{ list.chainName }}(<span style="color: #1989fa">{{ list.chainCode }}</span
           >)
         </div>
-        <div class="info">客户分类:{{ list.storeCategory }}</div>
-        <div class="info">实际经营者:{{ list.storeCategory }}</div>
-        <div class="info">开户日期:{{ list.storeCategory }}</div>
-        <div class="info">是否冻结:{{ list.storeCategory }}</div>
-        <div class="info">是否关户:{{ list.storeCategory }}</div>
+        <div class="info">客户分类:{{ verifyChainType(list.typeCode2) }}</div>
+        <div class="info">实际经营者:{{ list.customerManager }}</div>
+        <div class="info">开户日期:{{ list.openDate }}</div>
+        <div class="info">是否冻结:{{ list.freeze }}</div>
+        <div class="info">是否关户:{{ list.close }}</div>
       </div>
       <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">任务</div>
       <div class="card" v-if="list.visitSource != 2">

+ 29 - 25
src/views/home/visitPage.vue

@@ -7,11 +7,12 @@
     <div class="container">
       <div class="card">
         <div class="title f-blue">
-          {{ storeName }}(<span style="color: #0057ba">{{ urlParameter.storeCode }}</span
+          {{ urlParameter.chainName }}(<span style="color: #0057ba">{{
+            urlParameter.chainCode
+          }}</span
           >)
         </div>
-        <div class="info1" v-if="addressLine != null">类型:{{ storeCategory }}</div>
-        <div class="info1" v-if="addressLine != 'null'">地址:{{ addressLine }}</div>
+        <div class="info1">客户分类:{{ verifyChainType(urlParameter.typeCode2) }}</div>
         <div class="info1" v-if="notes != null">上次拜访备注:{{ notes }}</div>
         <div class="info1">拜访时长:{{ showTime }}</div>
         <div class="info1">
@@ -33,7 +34,7 @@
           size="small"
           plain
           class="centerBtn"
-          @click="visitFn(urlParameter.storeCode)"
+          @click="visitFn(urlParameter.chainCode)"
           >经营情况</van-button
         > -->
         <!-- <van-button
@@ -121,6 +122,7 @@ import {
   stopVisit,
   buryingPoint,
 } from '@/api/index';
+import { getChainsGroupTask } from '@/api/home';
 import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
 import store from '@/store';
 export default {
@@ -142,7 +144,7 @@ export default {
       radio: '',
       uploadImgEditText: '编辑',
       isEdit: false,
-      storeId: '',
+      chainId: '',
       rdId: '',
       lat: '',
       lon: '',
@@ -174,13 +176,13 @@ export default {
   },
   created() {
     this.urlParameter = this.$route.query;
-    this.storeId = this.$route.query.storeId + '';
+    this.chainId = this.$route.query.chainId + '';
     this.visitId = localStorage.getItem('visitId') || this.$route.query.visitId;
-    this.storeCode = this.$route.query.storeCode;
-    this.rdId = this.$route.query.rdId + '';
+    this.chainCode = this.$route.query.chainCode;
+    this.rdId = this.$route.query.rdId || '';
     this.addressLine = this.$route.query.addressLine;
     this.storeCategory = this.$route.query.storeCategory;
-    this.storeName = this.$route.query.storeName;
+    this.chainName = this.$route.query.chainName;
     this.contactName = this.$route.query.contactName;
     this.lat = this.$route.query.lat + '';
     this.lon = this.$route.query.lon + '';
@@ -188,9 +190,11 @@ export default {
     this.uType = localStorage.getItem('uType');
   },
   mounted() {
+    this.getDetail();
     this.addVisits();
   },
   methods: {
+    getDetail() {},
     animation() {
       //前时间减去上次开启时间减去暂停累计时间
       var times = new Date().getTime() - new Date(this.startTime).getTime();
@@ -242,13 +246,13 @@ export default {
       buryingPoint({
         systemModel: '拜访页',
         buryingPointType: 1,
-        buryingPointValue: val.storeName + '(' + val.storeCode + ')',
+        buryingPointValue: valchainsName + '(' + val.chainCode + ')',
         buryingPointName: '去下单',
         buryingPointPosition: '拜访页',
       });
       this.toastLoading(0, '加载中...', true);
       getOrderUrlByStoreId({
-        storeId: this.$route.query.storeId,
+        chainId: this.$route.query.chainId,
         from: this.$route.query.from,
       }).then((res) => {
         this.toastLoading().clear();
@@ -264,7 +268,7 @@ export default {
     },
     visitFn(val) {
       var that = this;
-      suishenbangStoreSale({ storeCode: val }).then((res) => {
+      suishenbangStoreSale({ chainCode: val }).then((res) => {
         if (res.code == 200) {
           if (res.data.num != '0') {
             window.location.href =
@@ -330,7 +334,7 @@ export default {
         visitEntry = '1';
       }
       if (this.$route.query.shopCode != undefined) {
-        this.storeCode = this.$route.query.shopCode;
+        this.chainCode = this.$route.query.shopCode;
       }
       var that = this;
 
@@ -358,8 +362,8 @@ export default {
           console.log('city=' + city);
           console.log('district=' + district);
           var params = {
-            storeId: that.storeId,
-            storeCode: that.storeCode,
+            chainId: that.chainId,
+            chainCode: that.chainCode,
             visitEntry: visitEntry,
             lat: that.urlParameter.latNew,
             lon: that.urlParameter.lonNew,
@@ -385,7 +389,7 @@ export default {
             message: '加载中...',
             forbidClick: true,
           });
-          getStoreGroupTask(params).then((res) => {
+          getChainsGroupTask(params).then((res) => {
             loading2.clear();
             if (res.code == 200) {
               localStorage.setItem('visitId', res.data.visitId);
@@ -404,8 +408,8 @@ export default {
         },
         function (err) {
           var params = {
-            storeId: that.storeId,
-            storeCode: that.storeCode,
+            chainId: that.chainId,
+            chainCode: that.chainCode,
             visitEntry: visitEntry,
             lat: that.urlParameter.latNew,
             lon: that.urlParameter.lonNew,
@@ -428,7 +432,7 @@ export default {
             message: '加载中...',
             forbidClick: true,
           });
-          getStoreGroupTask(params).then((res) => {
+          getChainsGroupTask(params).then((res) => {
             loading2.clear();
             if (res.code == 200) {
               localStorage.setItem('visitId', res.data.visitId);
@@ -451,8 +455,8 @@ export default {
       this.$router.push({
         path: '/visitTask',
         query: {
-          storeId: this.storeId,
-          storeCode: this.urlParameter.storeCode,
+          chainId: this.chainId,
+          chainCode: this.urlParameter.chainCode,
           visitId: this.visitId,
           ids: index,
           taskId: val.taskId,
@@ -520,9 +524,9 @@ export default {
         forbidClick: true,
       });
       let dwellTime = this.weekend(localStorage.getItem('startTime'), new Date());
-      let storeCode = this.storeCode;
+      let chainCode = this.chainCode;
       if (this.$route.query.shopCode != undefined) {
-        storeCode = this.$route.query.shopCode;
+        chainCode = this.$route.query.shopCode;
       }
       if (this.flag) {
         this.flag = false;
@@ -534,7 +538,7 @@ export default {
           visitSource: '1',
           storeGroupId: this.storeGroupId,
           id: this.visitId,
-          storeCode: storeCode,
+          chainCode: chainCode,
           dwellTime: dwellTime,
           visitModel: this.$route.query.visitModel,
         }).then((res) => {
@@ -587,7 +591,7 @@ export default {
       this.$router.push({
         name: 'visitHistory',
         query: {
-          storeId: this.storeId,
+          chainId: this.chainId,
         },
       });
     },

+ 14 - 13
src/views/home/visitTask.vue

@@ -2744,6 +2744,7 @@ import jianjie from '@/assets/icon/jianjie.jpg';
 import { ImagePreview } from 'vant';
 import taskTips from '@/components/taskTips';
 import store from '@/store';
+import { getChainsGroupTask } from '@/api/home';
 export default {
   name: 'abnormalVisit',
   components: { zRadio, zCheckbox, uploadImg, storeCode, deleteUploadImg, taskTips },
@@ -2787,7 +2788,7 @@ export default {
       collectionId: '',
       parentCollectionId: '',
       // form
-      storeId: '',
+      chainId: '',
       collectionAnswerlisd: [],
       tableData1: [],
       taskType: 1,
@@ -2847,10 +2848,10 @@ export default {
     this.wuliaoMust = true;
     this.taskType = this.$route.query.taskType;
     this.PhotoType = this.$route.query.photoType;
-    this.storeCode = this.$route.query.storeCode;
+    this.chainCode = this.$route.query.chainCode;
     this.visitId = this.$route.query.visitId + '';
     this.taskId = this.$route.query.taskId + '';
-    this.storeId = this.$route.query.storeId + '';
+    this.chainId = this.$route.query.chainId + '';
     this.isMust == this.$route.query.isMust + '';
     this.photoIdentifyType = this.$route.query.photoIdentifyType;
     this.storeGroupId = this.$route.query.storeGroupId + '';
@@ -3149,7 +3150,7 @@ export default {
     // 历史回显
     getCollectionShowHistory(id) {
       getCollectionShowHistory({
-        storeId: this.$route.query.storeId,
+        chainId: this.$route.query.chainId,
         collectionId: id.collectionId,
         visitsId: this.$route.query.visitId,
         storeGroupId: this.$route.query.storeGroupId,
@@ -3264,8 +3265,8 @@ export default {
       this.insert = insert;
       if (this.$route.query.type == 'edit') {
         var params = {
-          storeId: this.$route.query.storeId,
-          storeCode: this.$route.query.storeCode,
+          chainId: this.$route.query.chainId,
+          chainCode: this.$route.query.chainCode,
           visitEntry: '0',
           lat: '',
           lon: '',
@@ -3280,8 +3281,8 @@ export default {
         };
       } else {
         var params = {
-          storeId: this.storeId,
-          storeCode: this.$route.query.storeCode,
+          chainId: this.chainId,
+          chainCode: this.$route.query.chainCode,
           visitEntry: '0',
           lat: this.$route.query.lat,
           lon: this.$route.query.lon,
@@ -3297,7 +3298,7 @@ export default {
       if (this.$route.query.visitId != null) {
         params.id = this.$route.query.visitId;
       }
-      getStoreGroupTask(params).then((res) => {
+      getChainsGroupTask(params).then((res) => {
         loading1.clear();
         this.deviceCode = '';
         this.putInCode = '';
@@ -4172,8 +4173,8 @@ export default {
       // taskType:3物料,2产品类型,1常规类型
       if (this.$route.query.taskType == 3) {
         formData = {
-          storeId: this.storeId,
-          storeCode: this.$route.query.storeCode,
+          chainId: this.chainId,
+          chainCode: this.$route.query.chainCode,
           storeGroupId: this.storeGroupId,
           visitsId: this.visitId,
           taskId: this.taskId,
@@ -4184,8 +4185,8 @@ export default {
         };
       } else {
         formData = {
-          storeId: this.storeId,
-          storeCode: this.$route.query.storeCode,
+          chainId: this.chainId,
+          chainCode: this.$route.query.chainCode,
           storeGroupId: this.storeGroupId,
           visitsId: this.visitId,
           taskId: this.taskId,

+ 2 - 2
vue.config.js

@@ -7,8 +7,8 @@ const name = process.env.VUE_APP_TITLE || '经销商拜访'; // 网页标题
 const port = 9999; // 端口
 module.exports = {
   // publicPath: process.env.NODE_ENV === "production" ? "/mobile/" : "/",
-  publicPath: '/agent/',
-  outputDir: 'agent',
+  publicPath: '/mobile/',
+  outputDir: 'mobile',
   assetsDir: 'static',
   lintOnSave: false,
   productionSourceMap: false,