|
|
@@ -757,6 +757,7 @@ export default {
|
|
|
store.dispatch('setDeviceOutsidePage', false);
|
|
|
},
|
|
|
mounted() {
|
|
|
+ localStorage.setItem('tabVal', '1');
|
|
|
// 上拉边界下拉出现白色空白
|
|
|
let node = document.getElementsByClassName('deviceOutside')[0];
|
|
|
node.addEventListener(
|
|
|
@@ -799,11 +800,7 @@ export default {
|
|
|
this.storeCategoryList = this.result.join(',');
|
|
|
}
|
|
|
// 当前tabs,0:销售部;1:我的
|
|
|
- if (localStorage.getItem('tabVal')) {
|
|
|
- this.tabVal = localStorage.getItem('tabVal');
|
|
|
- } else {
|
|
|
- this.tabVal = '1';
|
|
|
- }
|
|
|
+ this.tabVal = localStorage.getItem('tabVal');
|
|
|
this.query = this.$route.query; // 路由参数
|
|
|
localStorage.removeItem('visitId');
|
|
|
if (localStorage.getItem('postType') == 'GZ') {
|
|
|
@@ -899,6 +896,7 @@ export default {
|
|
|
from: 'outPlan',
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200 && res.data) {
|
|
|
+ store.dispatch('setDeviceOutsidePage', true);
|
|
|
window.location.href = res.data;
|
|
|
} else {
|
|
|
this.Toast({
|
|
|
@@ -1143,8 +1141,8 @@ export default {
|
|
|
}).then((res) => {
|
|
|
this.disabled = false;
|
|
|
this.toastLoading().clear();
|
|
|
+ this.loading = false;
|
|
|
if (res.code == 200) {
|
|
|
- this.loading = false;
|
|
|
if (this.pageNum == '1') {
|
|
|
this.list = [];
|
|
|
}
|
|
|
@@ -1173,45 +1171,18 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- positionFn(val) {
|
|
|
- getPosition(true)
|
|
|
- .then((res) => {
|
|
|
- let { TXisBD } = res;
|
|
|
- this.lat = TXisBD.lat;
|
|
|
- this.lon = TXisBD.lon;
|
|
|
- if (val == 1) {
|
|
|
- if (this.tabVal == 1) {
|
|
|
- this.getUserOutPlaListFun();
|
|
|
- } else {
|
|
|
- this.getUserOrgStoreList();
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.getUserOutPlaListFun();
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- this.$dialog.alert({
|
|
|
- message: error,
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
getUserOutPlaListFun() {
|
|
|
this.storeType = localStorage.getItem('storeType');
|
|
|
- var that = this;
|
|
|
this.disabled = true;
|
|
|
- let loading3 = this.$toast.loading({
|
|
|
- duration: 0,
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true,
|
|
|
- });
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
this.endShow = false;
|
|
|
if (this.refreshing) {
|
|
|
this.list = [];
|
|
|
this.refreshing = false;
|
|
|
}
|
|
|
getUserOutPlaList({
|
|
|
- lat: that.lat,
|
|
|
- lon: that.lon,
|
|
|
+ lat: this.lat,
|
|
|
+ lon: this.lon,
|
|
|
chainCode: this.chainCode ? this.chainCode : '',
|
|
|
storeLabelTypes: this.storeLabelTypes.join(','),
|
|
|
pageNum: this.pageNum,
|
|
|
@@ -1221,9 +1192,9 @@ export default {
|
|
|
genDate: this.genDate,
|
|
|
}).then((res) => {
|
|
|
this.disabled = false;
|
|
|
+ this.toastLoading().clear();
|
|
|
+ this.loading = false;
|
|
|
if (res.code == 200) {
|
|
|
- loading3.clear();
|
|
|
- this.loading = false;
|
|
|
this.list = this.list.concat(res.rows);
|
|
|
if (this.list.length >= res.total) {
|
|
|
this.finished = true;
|
|
|
@@ -1871,14 +1842,7 @@ export default {
|
|
|
accuracy: resData.accuracy,
|
|
|
}).then((response) => {
|
|
|
// 进入拜访之前先刷新页面
|
|
|
- this.pageNum = 1;
|
|
|
- this.list = [];
|
|
|
- this.finished = true;
|
|
|
- if (this.tabVal == 1) {
|
|
|
- this.getUserOutPlaListFun();
|
|
|
- } else {
|
|
|
- this.getUserOrgStoreList();
|
|
|
- }
|
|
|
+ store.dispatch('setDeviceOutsidePage', true);
|
|
|
this.$router.push({
|
|
|
path: '/outabnormalVisit',
|
|
|
query: {
|
|
|
@@ -2083,6 +2047,7 @@ export default {
|
|
|
},
|
|
|
// 滚动条与底部距离小于 offset 时触发 初始化会触发
|
|
|
onLoad() {
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
// 授权
|
|
|
getTicketFun().then(() => {
|
|
|
var postType = localStorage.getItem('postType');
|
|
|
@@ -2091,16 +2056,22 @@ export default {
|
|
|
} else {
|
|
|
this.typeShow = true;
|
|
|
}
|
|
|
- if (this.lon == '' && this.tabVal != 1) {
|
|
|
- this.positionFn(1);
|
|
|
- } else {
|
|
|
- if (this.tabVal == 1) {
|
|
|
- this.positionFn();
|
|
|
- // this.getUserOutPlaListFun();
|
|
|
- } else {
|
|
|
- this.getUserOrgStoreList();
|
|
|
- }
|
|
|
- }
|
|
|
+ getPosition(true)
|
|
|
+ .then((res) => {
|
|
|
+ let { TXisBD } = res;
|
|
|
+ this.lat = TXisBD.lat;
|
|
|
+ this.lon = TXisBD.lon;
|
|
|
+ if (this.tabVal == '1') {
|
|
|
+ this.getUserOutPlaListFun();
|
|
|
+ } else {
|
|
|
+ this.getUserOrgStoreList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.$dialog.alert({
|
|
|
+ message: error,
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
// 跳转好帮手门店详情
|