|
@@ -607,6 +607,7 @@ import { getOrderUrlByStoreId, topjoinInPlan, topStore } from '@/api/inventory';
|
|
|
import { parseTime } from '@/utils';
|
|
import { parseTime } from '@/utils';
|
|
|
import { checkStoreAddressByStoreCode } from '@/api/visitstore';
|
|
import { checkStoreAddressByStoreCode } from '@/api/visitstore';
|
|
|
import sbpmdh from '@/assets/sbpmdh.png';
|
|
import sbpmdh from '@/assets/sbpmdh.png';
|
|
|
|
|
+import { getPosition, getTicketFun } from '@/utils/TXApiFun';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'outsidelist',
|
|
name: 'outsidelist',
|
|
|
components: { mapmarker },
|
|
components: { mapmarker },
|
|
@@ -1177,93 +1178,119 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 范围
|
|
// 范围
|
|
|
rangeStoreFn() {
|
|
rangeStoreFn() {
|
|
|
- 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,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ getPosition()
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ let { TXisBD } = res;
|
|
|
|
|
+ this.lat = TXisBD.lat;
|
|
|
|
|
+ this.lon = TXisBD.lon;
|
|
|
|
|
+ this.buryingPoint({
|
|
|
|
|
+ systemModel: '高销额门店推荐',
|
|
|
|
|
+ buryingPointType: 3,
|
|
|
|
|
+ buryingPointValue: '进入地图',
|
|
|
|
|
+ buryingPointName: '高销额门店推荐',
|
|
|
|
|
+ buryingPointPosition: '进入地图',
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/rangeStore',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ lat: '',
|
|
|
|
|
+ lon: '',
|
|
|
|
|
+ tabVal: 6,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
- .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(function () {
|
|
|
|
|
- wx.getLocation({
|
|
|
|
|
- type: 'gcj02',
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- flat = false;
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- that.buryingPoint({
|
|
|
|
|
- systemModel: '高销额门店推荐',
|
|
|
|
|
- buryingPointType: 3,
|
|
|
|
|
- buryingPointValue: '进入地图',
|
|
|
|
|
- buryingPointName: '高销额门店推荐',
|
|
|
|
|
- buryingPointPosition: '进入地图',
|
|
|
|
|
- });
|
|
|
|
|
- that.$router.push({
|
|
|
|
|
- path: '/rangeStore',
|
|
|
|
|
- query: {
|
|
|
|
|
- lat: '',
|
|
|
|
|
- lon: '',
|
|
|
|
|
- tabVal: 6,
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- fail: function () {
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- that.$dialog.alert({
|
|
|
|
|
- message: 'GPS未开启',
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- wx.error(function (res) {
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- that.$dialog
|
|
|
|
|
- .alert({
|
|
|
|
|
- message: '定位失败,请开启企微定位权限',
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {});
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this.$dialog.alert({
|
|
|
|
|
+ message: error,
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
+ // 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 = 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(function () {
|
|
|
|
|
+ // wx.getLocation({
|
|
|
|
|
+ // type: 'gcj02',
|
|
|
|
|
+ // success: function (res) {
|
|
|
|
|
+ // flat = false;
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ // that.buryingPoint({
|
|
|
|
|
+ // systemModel: '高销额门店推荐',
|
|
|
|
|
+ // buryingPointType: 3,
|
|
|
|
|
+ // buryingPointValue: '进入地图',
|
|
|
|
|
+ // buryingPointName: '高销额门店推荐',
|
|
|
|
|
+ // buryingPointPosition: '进入地图',
|
|
|
|
|
+ // });
|
|
|
|
|
+ // that.$router.push({
|
|
|
|
|
+ // path: '/rangeStore',
|
|
|
|
|
+ // query: {
|
|
|
|
|
+ // lat: '',
|
|
|
|
|
+ // lon: '',
|
|
|
|
|
+ // tabVal: 6,
|
|
|
|
|
+ // },
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+ // fail: function () {
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ // that.$dialog.alert({
|
|
|
|
|
+ // message: 'GPS未开启',
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
|
|
+ // wx.error(function (res) {
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ // that.$dialog
|
|
|
|
|
+ // .alert({
|
|
|
|
|
+ // message: '定位失败,请开启企微定位权限',
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {});
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
},
|
|
},
|
|
|
//取消搜索
|
|
//取消搜索
|
|
|
cancelSearch() {
|
|
cancelSearch() {
|
|
@@ -1435,173 +1462,188 @@ export default {
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- 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,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ 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);
|
|
|
})
|
|
})
|
|
|
- .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: '定位失败,请开启企微定位权限',
|
|
|
|
|
- })
|
|
|
|
|
- .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;
|
|
|
|
|
- // loading1.clear();
|
|
|
|
|
- var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
|
|
- checkStoreAddressByStoreCode({
|
|
|
|
|
- storeCode: val.storeCode,
|
|
|
|
|
- lon: location.lon,
|
|
|
|
|
- lat: location.lat,
|
|
|
|
|
- }).then((response) => {
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- 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(
|
|
|
|
|
- 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 (error) {
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- that.$dialog
|
|
|
|
|
- .alert({
|
|
|
|
|
- message: '定位失败,请开启企微定位权限',
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {});
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this.$dialog.alert({
|
|
|
|
|
+ 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 = 5;
|
|
|
|
|
+ // 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;
|
|
|
|
|
+ // // loading1.clear();
|
|
|
|
|
+ // var location = that.CJ02BD(res.latitude, res.longitude);
|
|
|
|
|
+ // checkStoreAddressByStoreCode({
|
|
|
|
|
+ // storeCode: val.storeCode,
|
|
|
|
|
+ // lon: location.lon,
|
|
|
|
|
+ // lat: location.lat,
|
|
|
|
|
+ // }).then((response) => {
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ // 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(
|
|
|
|
|
+ // 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 (error) {
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ // that.$dialog
|
|
|
|
|
+ // .alert({
|
|
|
|
|
+ // message: '定位失败,请开启企微定位权限',
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {});
|
|
|
|
|
+ // });
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1613,6 +1655,93 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ checkStoreAddressByStoreCodeFun(val, location, res) {
|
|
|
|
|
+ checkStoreAddressByStoreCode({
|
|
|
|
|
+ storeCode: val.storeCode,
|
|
|
|
|
+ lon: location.lon,
|
|
|
|
|
+ lat: location.lat,
|
|
|
|
|
+ }).then((response) => {
|
|
|
|
|
+ // loading1.clear();
|
|
|
|
|
+ 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(
|
|
|
|
|
+ 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);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 重置经纬度
|
|
// 重置经纬度
|
|
|
resetCoord(res, val, location, PointSumval) {
|
|
resetCoord(res, val, location, PointSumval) {
|
|
|
this.$dialog
|
|
this.$dialog
|
|
@@ -1681,7 +1810,6 @@ export default {
|
|
|
PointSum: PointSumval,
|
|
PointSum: PointSumval,
|
|
|
marklat: res.latitude,
|
|
marklat: res.latitude,
|
|
|
marklon: res.longitude,
|
|
marklon: res.longitude,
|
|
|
- linkType: 6,
|
|
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -2399,13 +2527,16 @@ export default {
|
|
|
this.onLoad();
|
|
this.onLoad();
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
- var postType = localStorage.getItem('postType');
|
|
|
|
|
- if (postType == 'GZ') {
|
|
|
|
|
- this.typeShow = false;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.typeShow = true;
|
|
|
|
|
- }
|
|
|
|
|
- this.getUserOutPlaList();
|
|
|
|
|
|
|
+ // 授权
|
|
|
|
|
+ getTicketFun().then(() => {
|
|
|
|
|
+ var postType = localStorage.getItem('postType');
|
|
|
|
|
+ if (postType == 'GZ') {
|
|
|
|
|
+ this.typeShow = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.typeShow = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getUserOutPlaList();
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
onLoadlong() {
|
|
onLoadlong() {
|
|
|
this.list = [];
|
|
this.list = [];
|