|
|
@@ -1,7 +1,13 @@
|
|
|
<template>
|
|
|
<div class="homePage" ref="homePage">
|
|
|
<van-nav-bar class="navBar" left-arrow title="门店拜访" @click-left="onClickLeft" />
|
|
|
- <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @click="onClickTabs">
|
|
|
+ <van-tabs
|
|
|
+ class="myTab"
|
|
|
+ type="card"
|
|
|
+ v-model="tabVal"
|
|
|
+ color="#0057ba"
|
|
|
+ @click="onClickTabs"
|
|
|
+ v-if="isGZorJZ">
|
|
|
<van-tab title="提示类" name="-1" v-if="isGZorJZ == 'false'">
|
|
|
<hintTabPage :tabVal="tabVal" ref="hintTabPage"></hintTabPage
|
|
|
></van-tab>
|
|
|
@@ -32,7 +38,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getReportInfo } from '@/api/index';
|
|
|
+import { getReportInfo, getDictOption } from '@/api/index';
|
|
|
import hintTabPage from './hintTabPage/index.vue';
|
|
|
import tabBar from '@/components/tabBar';
|
|
|
import ABtarget from './ABtarget.vue';
|
|
|
@@ -47,27 +53,23 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- tabVal: '0',
|
|
|
+ tabVal: '-1',
|
|
|
hintTabPageIndex: 0,
|
|
|
- isGZorJZ: 'true',
|
|
|
+ isGZorJZ: null,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
// 监听切换用户
|
|
|
'userInfo.userName': {
|
|
|
handler(val) {
|
|
|
- // 家装或工装不显示提示类tab
|
|
|
- this.isGZorJZ = localStorage.getItem('isGZorJZ');
|
|
|
- if (this.isGZorJZ == 'true') {
|
|
|
- this.tabVal = '0';
|
|
|
- } else {
|
|
|
- this.tabVal = '-1';
|
|
|
- }
|
|
|
+ if (val) this.getDict();
|
|
|
},
|
|
|
immediete: true,
|
|
|
},
|
|
|
},
|
|
|
activated() {
|
|
|
+ console.log(this.isGZorJZ);
|
|
|
+ console.log(this.tabVal);
|
|
|
if (this.tabVal == '-1') {
|
|
|
// 从其他页面跳转过来如果;要重新获取对应tab数据
|
|
|
if (this.$refs.hintTabPage) this.$refs.hintTabPage.initData();
|
|
|
@@ -78,9 +80,32 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getDict();
|
|
|
this.getReportInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getDict() {
|
|
|
+ this.isGZorJZ = null;
|
|
|
+ let gz_Option = await getDictOption({}, 'gz_customer_post'); //公装业务员岗位
|
|
|
+ let jz_Option = await getDictOption({}, 'jz_post_name'); //家装业务员岗位
|
|
|
+ let postName = this.userInfo.postName;
|
|
|
+ let is_gz = gz_Option.data.find((res) => res.dictLabel == postName);
|
|
|
+ let is_jz = jz_Option.data.find((res) => res.dictLabel == postName);
|
|
|
+ if (is_gz || is_jz) {
|
|
|
+ localStorage.setItem('isGZorJZ', 'true');
|
|
|
+ } else {
|
|
|
+ localStorage.setItem('isGZorJZ', 'false');
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 家装或工装不显示提示类tab
|
|
|
+ this.isGZorJZ = localStorage.getItem('isGZorJZ');
|
|
|
+ if (this.isGZorJZ == 'true') {
|
|
|
+ this.tabVal = '0';
|
|
|
+ } else {
|
|
|
+ this.tabVal = '-1';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
onClickTabs(val) {
|
|
|
this.$nextTick(() => {
|
|
|
// this.tabVal == '-1' 有watch监听不需要在触发
|