瀏覽代碼

feat: 新增业务范围显示

zhangyuhan 4 年之前
父節點
當前提交
f77dd7ff07
共有 2 個文件被更改,包括 19 次插入12 次删除
  1. 7 0
      src/components/selector/BusinessScopeSelector.vue
  2. 12 12
      src/views/PotentialList.vue

+ 7 - 0
src/components/selector/BusinessScopeSelector.vue

@@ -41,6 +41,13 @@ export default {
   data () {
   data () {
     return {}
     return {}
   },
   },
+  watch: {
+    initList () {
+      this.$nextTick(() => {
+        this.$refs.content.init()
+      })
+    }
+  },
   created () {},
   created () {},
   methods: {
   methods: {
     setState (data) {
     setState (data) {

+ 12 - 12
src/views/PotentialList.vue

@@ -52,6 +52,7 @@ import BuyerclassSelector from '@/components/selector/BuyerclassSelector.vue'
 import BusinessScopeSelector from '@/components/selector/BusinessScopeSelector.vue'
 import BusinessScopeSelector from '@/components/selector/BusinessScopeSelector.vue'
 import forLayOut from '@/components/forecast/ForLayout.vue'
 import forLayOut from '@/components/forecast/ForLayout.vue'
 import { setFollowEnt, setRemoveEnt, setCancelEnt } from '@/api/modules'
 import { setFollowEnt, setRemoveEnt, setCancelEnt } from '@/api/modules'
+import { mapState } from 'vuex'
 export default {
 export default {
   name: 'Potential',
   name: 'Potential',
   components: {
   components: {
@@ -144,13 +145,13 @@ export default {
     },
     },
     changeBusiness (item) {
     changeBusiness (item) {
       let tempArr = []
       let tempArr = []
-      this.getScopeList.forEach(v => {
+      this.scope.forEach(v => {
         if (item.includes(v.key.join(' '))) {
         if (item.includes(v.key.join(' '))) {
           tempArr.push(v)
           tempArr.push(v)
         }
         }
       })
       })
       if (item.length === 0) {
       if (item.length === 0) {
-        tempArr = this.getScopeList
+        tempArr = this.scope
       }
       }
       this.filters.business_scope = tempArr
       this.filters.business_scope = tempArr
     },
     },
@@ -172,24 +173,23 @@ export default {
     }
     }
   },
   },
   computed: {
   computed: {
+    ...mapState({
+      scope: state => state.user.scope
+    }),
     getTopInfo () {
     getTopInfo () {
       return this.topInfo[this.$route.params.type || 'c']
       return this.topInfo[this.$route.params.type || 'c']
     },
     },
-    getScopeList () {
-      const scopeData = this.$store.state.user.scope
-      if (scopeData[0] && scopeData[0].a_key) {
-        return scopeData[0].a_key
-      }
-      return []
-    },
     getScopeKeyList () {
     getScopeKeyList () {
-      return this.getScopeList.map(v => {
+      return this.scope.map(v => {
         return v.key.join(' ')
         return v.key.join(' ')
       })
       })
     }
     }
   },
   },
-  created () {
-    this.filters.business_scope = this.getScopeList
+  async created () {
+    if (!this.scope.length) {
+      await this.$store.dispatch('user/getKeywordsList')
+    }
+    this.filters.business_scope = this.scope
   }
   }
 }
 }
 </script>
 </script>