|
|
@@ -47,12 +47,14 @@ import HomeTarget from './HomeTarget.vue';
|
|
|
import { mapState } from 'vuex';
|
|
|
import bottomBtn from './bottomBtn.vue';
|
|
|
import { WXdigest } from '@/utils/digest';
|
|
|
+import store from '@/store';
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
components: { tabBar, hintTabPage, ABtarget, HomeTarget, bottomBtn },
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
userInfo: (state) => state.user.userInfo,
|
|
|
+ reportInfo: (state) => state.user.reportInfo,
|
|
|
}),
|
|
|
},
|
|
|
data() {
|
|
|
@@ -81,15 +83,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.getReportInfo();
|
|
|
WXdigest();
|
|
|
- if (this.tabVal == '-1') {
|
|
|
- // 从其他页面跳转过来如果;要重新获取对应tab数据
|
|
|
- // if (this.$refs.hintTabPage) this.$refs.hintTabPage.initData();
|
|
|
- } else if (this.tabVal == '0') {
|
|
|
- // if (this.$refs.Atarget) this.$refs.Atarget.initData();
|
|
|
- } else if (this.tabVal == '1') {
|
|
|
- // if (this.$refs.Btarget) this.$refs.Btarget.initData();
|
|
|
- }
|
|
|
},
|
|
|
created() {
|
|
|
this.getDict();
|
|
|
@@ -110,17 +105,27 @@ export default {
|
|
|
async getDict(isRefresh) {
|
|
|
let postType = this.userInfo.postType;
|
|
|
let postName = this.userInfo.postName;
|
|
|
- if (postName == '质感销售负责人' || postName == '质感销售专员' || postType == 'GZ') {
|
|
|
+ if (postName == '质感销售负责人' || postName == '质感销售专员') {
|
|
|
this.onlyShowHomeTarget = true;
|
|
|
} else {
|
|
|
- this.onlyShowHomeTarget = false;
|
|
|
- // postType:人员类型,JZ(家装)、GZ(公装)、YF(应服)、DIY(DIY)
|
|
|
- if (postType == 'JZ') {
|
|
|
- localStorage.setItem('isGZorJZ', 'true');
|
|
|
- this.isGZorJZ = 'true';
|
|
|
+ // <!-- 0-历史指标 1-动态指标,String类型 -->
|
|
|
+ if (postType == 'GZ') {
|
|
|
+ if (this.reportInfo.targetType == '0') {
|
|
|
+ localStorage.setItem('isGZorJZ', 'true');
|
|
|
+ this.isGZorJZ = 'true';
|
|
|
+ } else if (this.reportInfo.targetType == '1') {
|
|
|
+ this.onlyShowHomeTarget = true;
|
|
|
+ }
|
|
|
} else {
|
|
|
- localStorage.setItem('isGZorJZ', 'false');
|
|
|
- this.isGZorJZ = 'false';
|
|
|
+ this.onlyShowHomeTarget = false;
|
|
|
+ // postType:人员类型,JZ(家装)、GZ(公装)、YF(应服)、DIY(DIY)
|
|
|
+ if (postType == 'JZ') {
|
|
|
+ localStorage.setItem('isGZorJZ', 'true');
|
|
|
+ this.isGZorJZ = 'true';
|
|
|
+ } else {
|
|
|
+ localStorage.setItem('isGZorJZ', 'false');
|
|
|
+ this.isGZorJZ = 'false';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
// 家装或工装不显示提示类tab
|
|
|
@@ -164,19 +169,16 @@ export default {
|
|
|
// window.location.href = process.env.VUE_APP_SSB_LINK + "/homeIndex"
|
|
|
},
|
|
|
getReportInfo() {
|
|
|
- getReportInfo({ isContent: false }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- localStorage.setItem('powerGrade', res.data.positionId);
|
|
|
- localStorage.setItem('userDeptLevel', res.data.userDeptLevel);
|
|
|
- localStorage.setItem('isDiy', res.data.diy);
|
|
|
- localStorage.setItem('uType', res.data.userType);
|
|
|
- localStorage.setItem('jzType', res.data.jzType);
|
|
|
- localStorage.setItem('customerVisits', res.data.customerManagerVisits);
|
|
|
- localStorage.setItem('postType', res.data.postType);
|
|
|
- } else {
|
|
|
- this.$toast(res.msg);
|
|
|
- }
|
|
|
- });
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
+ // 获取移动端获取用户信息接口
|
|
|
+ store
|
|
|
+ .dispatch('getReportInfoDeta')
|
|
|
+ .then(() => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ });
|
|
|
},
|
|
|
deepseek() {
|
|
|
buryingPoint({
|