|
@@ -4,7 +4,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="container linep">
|
|
<div class="container linep">
|
|
|
<van-collapse v-model="activeNames">
|
|
<van-collapse v-model="activeNames">
|
|
|
- <div v-for="(homePageItem, index) in homePageIndicatorList" :key="index">
|
|
|
|
|
|
|
+ <div v-for="(homePageItem, index) in homePageIndicatorDate" :key="index">
|
|
|
<van-collapse-item v-if="homePageItem.labelStyle == 1" :name="(index + 1).toString()">
|
|
<van-collapse-item v-if="homePageItem.labelStyle == 1" :name="(index + 1).toString()">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<div class="text">{{ homePageItem.name }}</div>
|
|
<div class="text">{{ homePageItem.name }}</div>
|
|
@@ -71,7 +71,6 @@
|
|
|
<p>
|
|
<p>
|
|
|
{{ item.name }}:<span
|
|
{{ item.name }}:<span
|
|
|
:style="labelStyle(item.clickable)"
|
|
:style="labelStyle(item.clickable)"
|
|
|
- @click="onClick(item.clickable)"
|
|
|
|
|
class="colorbalck"
|
|
class="colorbalck"
|
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
|
>
|
|
>
|
|
@@ -95,7 +94,6 @@
|
|
|
<p>
|
|
<p>
|
|
|
{{ item.name }}:<span
|
|
{{ item.name }}:<span
|
|
|
:style="labelStyle(item.clickable)"
|
|
:style="labelStyle(item.clickable)"
|
|
|
- @click="onClick(item.clickable)"
|
|
|
|
|
class="colorbalck"
|
|
class="colorbalck"
|
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
|
>
|
|
>
|
|
@@ -128,7 +126,6 @@
|
|
|
<p>
|
|
<p>
|
|
|
{{ item.name }}:<span
|
|
{{ item.name }}:<span
|
|
|
:style="labelStyle(item.clickable)"
|
|
:style="labelStyle(item.clickable)"
|
|
|
- @click="onClick(item.clickable)"
|
|
|
|
|
class="colorbalck"
|
|
class="colorbalck"
|
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
|
>
|
|
>
|
|
@@ -153,7 +150,6 @@
|
|
|
<p>
|
|
<p>
|
|
|
{{ item.name }}:<span
|
|
{{ item.name }}:<span
|
|
|
:style="labelStyle(item.clickable)"
|
|
:style="labelStyle(item.clickable)"
|
|
|
- @click="onClick(item.clickable)"
|
|
|
|
|
class="colorbalck"
|
|
class="colorbalck"
|
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
>{{ item.indicatorDisplayValue }}</span
|
|
|
>
|
|
>
|
|
@@ -170,20 +166,12 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import store from '@/store';
|
|
|
|
|
-import { userTodayPlanNum, getReportInfo } from '@/api/index';
|
|
|
|
|
-import { mapState } from 'vuex';
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: 'home',
|
|
|
|
|
- computed: {
|
|
|
|
|
- ...mapState({
|
|
|
|
|
- reportInfo: (state) => state.user.reportInfo,
|
|
|
|
|
- }),
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ name: 'shareCommonTarget',
|
|
|
props: {
|
|
props: {
|
|
|
- tabVal: {
|
|
|
|
|
- type: [String, Number],
|
|
|
|
|
- default: '-1',
|
|
|
|
|
|
|
+ homePageIndicatorDate: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: () => ({}),
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -241,7 +229,6 @@ export default {
|
|
|
deptLevel: '',
|
|
deptLevel: '',
|
|
|
// positionId:等级(1-销售员 2-销售部主管 3-大区主管 4-区域公司总经理 5-DIY公司)
|
|
// positionId:等级(1-销售员 2-销售部主管 3-大区主管 4-区域公司总经理 5-DIY公司)
|
|
|
reportTargetAll: {},
|
|
reportTargetAll: {},
|
|
|
- homePageIndicatorList: [],
|
|
|
|
|
approvalPendingNum: 0,
|
|
approvalPendingNum: 0,
|
|
|
isDiy: false,
|
|
isDiy: false,
|
|
|
approvalButton: false,
|
|
approvalButton: false,
|
|
@@ -257,25 +244,6 @@ export default {
|
|
|
GZdata: false,
|
|
GZdata: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- watch: {
|
|
|
|
|
- // tabVal: {
|
|
|
|
|
- // handler(val) {
|
|
|
|
|
- // if (val == 2) {
|
|
|
|
|
- // // keep-alive 模式watch执行了两次
|
|
|
|
|
- // this.initData();
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
- // immediate: true,
|
|
|
|
|
- // },
|
|
|
|
|
- reportInfo: {
|
|
|
|
|
- handler(val) {
|
|
|
|
|
- if (val) {
|
|
|
|
|
- this.initData();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- immediate: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
labelStyle(val) {
|
|
labelStyle(val) {
|
|
|
return {
|
|
return {
|
|
@@ -283,79 +251,6 @@ export default {
|
|
|
color: '#fff',
|
|
color: '#fff',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- // 跳转详情
|
|
|
|
|
- onClick(val) {
|
|
|
|
|
- if (val == 1) {
|
|
|
|
|
- store.dispatch('setActivaTypeStore', 'FuWuShang');
|
|
|
|
|
- this.$router.push({ path: '/noVisit' });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- initData() {
|
|
|
|
|
- console.log(this.tabVal);
|
|
|
|
|
- this.getReportInfo();
|
|
|
|
|
- this.userTodayPlanNum();
|
|
|
|
|
- },
|
|
|
|
|
- getReportInfo() {
|
|
|
|
|
- if (this.reportInfo && this.reportInfo.homePageIndicatorList != null) {
|
|
|
|
|
- this.homePageIndicatorList = this.reportInfo.homePageIndicatorList;
|
|
|
|
|
- this.updataTime = this.reportInfo.homePageIndicatorUpdateTime;
|
|
|
|
|
- }
|
|
|
|
|
- return;
|
|
|
|
|
- let loading1 = this.$toast.loading({
|
|
|
|
|
- duration: 0,
|
|
|
|
|
- message: '加载中...',
|
|
|
|
|
- forbidClick: true,
|
|
|
|
|
- });
|
|
|
|
|
- getReportInfo({ isContent: false }).then((res) => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- loading1.clear();
|
|
|
|
|
- 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);
|
|
|
|
|
- if (res.data.homePageIndicatorList != null) {
|
|
|
|
|
- this.homePageIndicatorList = res.data.homePageIndicatorList;
|
|
|
|
|
- this.updataTime = res.data.homePageIndicatorUpdateTime;
|
|
|
|
|
- }
|
|
|
|
|
- this.type = res.data.userType;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$toast(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- userTodayPlanNum() {
|
|
|
|
|
- localStorage.setItem('outvstoreName', '');
|
|
|
|
|
- localStorage.setItem('outvchainName', '');
|
|
|
|
|
- localStorage.removeItem('outvstoreLabelTypes');
|
|
|
|
|
- localStorage.removeItem('outvjpdStoreLevelTypes');
|
|
|
|
|
- localStorage.removeItem('outvstoreCategoryList');
|
|
|
|
|
- localStorage.setItem('outvchainCode', '');
|
|
|
|
|
- localStorage.setItem('outvstoreName', '');
|
|
|
|
|
- localStorage.setItem('deviveStoreName', '');
|
|
|
|
|
- localStorage.setItem('outvsortType', '');
|
|
|
|
|
- localStorage.setItem('outsortParam', '');
|
|
|
|
|
- localStorage.setItem('lat', '');
|
|
|
|
|
- localStorage.setItem('lon', '');
|
|
|
|
|
- userTodayPlanNum().then((res) => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.todayGoal = res.data;
|
|
|
|
|
- this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
|
|
|
|
|
- localStorage.setItem('nickName', res.data.user.nickName);
|
|
|
|
|
- localStorage.setItem('postName', res.data.user.postName);
|
|
|
|
|
- localStorage.setItem('zipPhoto', res.data.zipPhoto);
|
|
|
|
|
- localStorage.setItem('storeType', res.data.user.type);
|
|
|
|
|
- localStorage.setItem('deptLevel', res.data.user.depts[0].deptLevel);
|
|
|
|
|
- localStorage.setItem('userId', res.data.user.userId);
|
|
|
|
|
- localStorage.setItem('deptIds', JSON.stringify(res.data.user.deptIds));
|
|
|
|
|
- this.monthNoVisit = res.data.monthNoVisit;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$toast(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|